Linux 如何更改 U-Boot 内存映射

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9108077/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 04:20:05  来源:igfitidea点击:

How to change U-Boot memory map

linuxembeddedbootloaderu-boot

提问by mura_no

The U-Boot(2009.03) on MS104-SH4 has the RAM memory map shown below.

MS104-SH4 上的 U-Boot(2009.03) 具有如下所示的 RAM 内存映射。

0x8c000000 Not for use (4kB)
0x8c001000 for Linux kernel & root file system (3MB)
0x8c400000 for Linux process (28MB)

0x8c000000 不使用 (4kB)
0x8c001000 用于 Linux 内核和根文件系统 (3MB)
0x8c400000 用于 Linux 进程 (28MB)

For me, 3MB for Linux kernel & root file system is too small because Linux kernel & ramdisk has 1MB and 3.5MB respectively. So I'd like to change above memory map, for example like shown below.

对我来说,Linux 内核和根文件系统的 3MB 太小了,因为 Linux 内核和 ramdisk 分别有 1MB 和 3.5MB。所以我想改变上面的内存映射,例如如下所示。

0x8c000000 Not for use (4KB)
0x8c001000 for Linux kernel & root file system (16MB)
0x8cf60000 for Linux process (16MB)

0x8c000000 不使用 (4KB)
0x8c001000 用于 Linux 内核和根文件系统 (16MB)
0x8cf60000 用于 Linux 进程 (16MB)

In my guess, I have to modify uboot source code, but cannot find where I should modify. Does somebody tell me if it is possible to modify u-boot memory map? If yes, please also tell me how to do it. Thanks for your help!

在我的猜测中,我必须修改 uboot 源代码,但找不到我应该修改的地方。有人告诉我是否可以修改 u-boot 内存映射?如果是,也请告诉我怎么做。谢谢你的帮助!

I found a similar question on How to find the memory map of a device?, but my SH4 iomem is empty (0 size) so looks like other topic.

我在How to find the memory map of a device上发现了一个类似的问题,但我的 SH4 iomem 是空的(0 大小)所以看起来像其他主题。

采纳答案by raj_gt1

It is possible to modify U-boot memory map. you need to modify source code of U-boot .U-boot/include/configs/<board_name.h>is the place where you can configure memory map . where <board_name.h>is your architecture specific file and has #defineentries which you can change to desirable values. u-boot/arch/<architecture_name>/lib/board.cperform the memory map initialization.

可以修改 U-boot 内存映射。你需要修改 U-boot 的源代码。U-boot/include/configs/<board_name.h>是您可以配置内存映射的地方。<board_name.h>您的体系结构特定文件在哪里,并且具有#define您可以更改为所需值的条目。u-boot/arch/<architecture_name>/lib/board.c执行内存映射初始化。