7

在我基于 ARM 的定制板中,每当我对其进行更改时,我都会将 u-boot 闪存到 NAND。(放置一些调试语句/修改)。有什么办法可以直接将uboot镜像加载到RAM内存中,而不是每次都刷机?

对于 linux 内核映像,我将其加载到内存中并使用 bootm 来启动该映像。同样对于 u-boot 我正在尝试。请提供您的建议。

4

10 回答 10

6

Someone at Freescale has done this, for their P1022DS evaluation system (and some others as well). They have provided a somewhat useful document about the process in the file ${UBOOTROOT}/doc/README.ramboot-ppc8500 (in U-Boot V2010.12). This document is pretty terse and leaves many questions unanswered, but I found it a reasonable place to start when I needed to debug U-Boot for a new board, before the flash memory for that board was operating correctly.

In fact, having non-functional flash memory is one reason you might want to debug U-Boot in RAM. (There are a few reasons listed in the README, and they all sound pretty reasonable to me, in contrast to some of the other advice available on this subject)

In our situation, it was found that early prototype target board hardware included an error in the address bus connection to the flash memory that prevented us from using that flash memory. While the hardware was being redesigned and re-fabricated, we wanted to continue testing/debugging those parts of our U-Boot configuration that did not depend on flash memory, for example, I2C, Ethernet, FPGA configuration, PCIe, etc. (there are plenty of things that are independent of where the U-Boot image comes from).

Running U-Boot after loading it into RAM via a JTAG interface (using Codewarrior and the USB TAP) allowed us to continue our U-Boot bring-up tasks, even though we had no functional flash memory. Once we received a newer version of the target board with correctly functioning flash memory, we returned to debugging those parts of U-Boot that we hadn't been able to test earlier. After that, U-Boot was fully functional, and we did not have to wait for a board spin to make any progress.

于 2011-08-02T16:59:42.983 回答
3

调试引导加载程序有点困难,但使用正确的工具应该相对轻松。

我处理 PowerPC 架构和 BDI-3000,我可以直接加载和调试到 RAM(当然,在初始化 DDR 控制器之后)。

一种选择是如果您有可配置为片上 SRAM 的片上 SRAM 或 L2 高速缓存。BDI 可以先复制到 SRAM 区域,u-boot 完成它的工作(例如初始化 DDR 控制器),然后将自身重新定位到 DDR RAM。绝对比重写慢速 Flash 更快。

于 2011-03-25T02:39:09.553 回答
2

至少在 2004年是不可能的。

于 2011-03-07T11:08:13.323 回答
2

如果您要运行的 U-Boot 映像具有允许从任意地址运行它的启动代码,这应该是可能的。我无法判断您的董事会是否属于这种情况。

如果启动代码首先将代码段从当前(PC 相对)地址复制到最终执行地址(通常在这之前检查这些区域不重叠),那么您可以将 .bin 文件加载到RAM 中的任何地址,并使用go.

我可以看到的第二个障碍是一开始的无条件 RAM 设置代码,许多板都有。

于 2011-03-07T11:51:57.237 回答
1

这是可以在 u-boot 文档常见问题解答中阅读的内容:

问:我不想擦除我的闪存,因为我不确定我的新 U-Boot 映像是否可以工作。是否可以配置 U-Boot 以便我可以将其加载到 RAM 而不是闪存中,并从我的旧引导加载程序启动它?

答案:不。(除非您使用的是 Blackfin 处理器或 Socfpga 板,但您可能不是。)

问题:但我被告知这是可能的?

答:嗯,是的。当然这是可能的。这是软件,所以一切皆有可能。但这很困难,没有支持,而且充满危险。如果你选择这样做,你就靠自己了。它不会帮助您解决问题。

来源: http: //www.denx.de/wiki/view/DULG/CanUBootBeConfiguredSuchThatItCanBeStartedInRAM

于 2016-12-25T15:51:05.523 回答
0

Just take in mind (be care of) the hardware that you are configuring in your modified U-Boot. U Boot is intended to initialize critical modules, some of them are not able to be re-configured on the fly or they may not performe as if they were initialized/configured at startup.

于 2011-03-20T22:17:52.640 回答
0

如果您的 Target board 支持网络启动,您可以通过网络将 uboot 映像从主机加载到 RAM。

于 2013-04-19T10:57:15.907 回答
0

这里的问题是,您尝试做的事情违背了引导加载程序的理念。大多数处理器要求代码从 Flash 开始。该代码称为引导加载程序。 就是U-boot。

但是,如果您想修改 U-boot 使其不是真正的引导加载程序,那么您可以为所欲为。这只是软件。但不要指望任何主线支持由于上述原因。

于 2011-03-10T16:59:06.260 回答
0

是的,如果您的目标支持 USB/TFTP 或当前 U-boot 可以在您身上检测到的任何其他介质,那么 U-Boot 末尾的大多数编译结构都可能提供一个 u-boot.bin 文件,该文件是一个扁平化的二进制文件目标环境然后我们可以将u-boot.bin文件加载到静态内存地址区。该地址是 U-Boot 代码的入口点,U-boot 可以执行扁平化的二进制文件go 0x<memory_address>。静态内存地址区可以从u-boot.map文件中推导出来,这个入口点基本上是编译程序的.text区的地址,通常我们可以在.map文件中用字符串“Address of section .text设置为0x”查找。” 以下是从 USB 执行此操作的示例。

usb start
load usb 0x<memory_address> u-boot.bin
go 0x<memory_address>

这应该可以在不干扰当前代码的情况下从 USB 运行 U-Boot。

于 2019-01-08T09:14:42.630 回答
0

您可以使用 USB 引导。TI 和飞思卡尔提供了他们的 USB 启动实用程序。我不知道其他供应商。

于 2015-10-27T09:09:05.897 回答