Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

loading u-Boot in memory instead of flashing it

In my ARM based custom board, I flash u-boot to NAND whenever I do changes on that. (putting some debug statements/modification). Is there any way to directly load the uboot image in RAM memory instead of flashing it every time?

For linux kernel image I do load it in memory and use bootm to boot that image. Similarly for u-boot I am trying out. Kindly provide your suggestions.

like image 302
Yaj Avatar asked Mar 07 '11 10:03

Yaj


People also ask

How do I load U-Boot?

You can also use the CLI interface with the options -d and -s to load and start U-Boot. For serial USB boot, <dev>=usb device with port=usb1. It is the same for serial UART boot with <dev>=uart and port= the UART Interface identifier.

What is U-Boot image?

Image format U-Boot uses special format for bootable images. The format is based on binary or text files which can be basically anything, preceded by a special header. the header defines the following image properties: Target Operating System. Target CPU Architecture.


2 Answers

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.

like image 63
Jim Chargin Avatar answered Oct 01 '22 21:10

Jim Chargin


Debugging a bootloader is a bit difficult, but with the right tools it should be relatively painless.

I deal with the PowerPC achitecture and with a BDI-3000 I can load and debug directly to RAM (of course, after initializing the DDR controller).

One option is if you have on-chip SRAM or L2 Cache that can be configured as on-chip SRAM. The BDI can copy to the SRAM area first, u-boot does it's thing (initialize DDR controller for example), then relocates itself to DDR RAM afterwards. Definitely faster that re-writing to slow Flash all the time.

like image 23
sessyargc.jp Avatar answered Oct 01 '22 21:10

sessyargc.jp