2

I would like to boot an U-boot image from RAM using another U-boot. I loaded the U-boot image in the RAM using tftp tftp 0x90000000 u-boot.img and tried to run it with go 0x90000000 but nothing happens. I guess there are some conflicts concerning the initializations. When I went to the U-boot code, I found in the file /arch/arm/cpu/armv7/start.S the following comment do important init only if we don't start from memory!. So I have some questions.

  • First of all, is it possible to do that?

  • Any Idea of what are those important init?

  • And is there anything else I need to remove from the u-boot code?

EngineerN
  • 133
  • 2
  • 11
  • 3
    Typically you cannot load and execute U-Boot at an arbitrary address. U-Boot is typically built (i.e. linked) to load and start at a specific address defined by **CONFIG_SYS_TEXT_BASE**. – sawdust Jul 06 '15 at 21:03
  • @sawdust Thank you. I didn't knew that. I succeeded to boot the u-boot but I can't boot a linux kernel with it. it is stuck in the **Verifying Checksum ...** of **bootm** function. Any ideas ? – EngineerN Jul 08 '15 at 12:16
  • Sounds like the stack and/or text has been overwritten. You need to locate where everything is in memory, and draw a memory map. Note that U-Boot can relocate itself from its loaded address to high memory. Consider enabling debug output as mentioned at the beginning of **arch/arm/lib/board.c**. The salient messages would be *"New Stack Pointer is:..."* and *""Now running in RAM - U-Boot at:..."* – sawdust Jul 08 '15 at 21:41

1 Answers1

1

I spent a couple of days trying to do the same thing in order to avoid the hassle of burning each new image version to flash, after all, if I have a working bootloader why not load a new version from it. I think this section of U-Boot documentation page explains perfectly why this not impossible.

If you want to start U-Boot from another boot loader, you must disable a lot of code, i. e. all initialization parts that already have been performed by this other boot loader...


The code you have to disable contains the most critical parts in U-Boot, i. e. these are the areas where 99% or more of all errors are located when you port U-Boot to a new hardware. In the result, your RAM image may work, but in the end you will need a full image to program the flash memory with it, and then you will have to enable all this highly critical and completely untested code.

n1colas.m
  • 3,863
  • 4
  • 15
  • 28