xpankaj
xpankaj

Reputation: 133

multi stage booting

I have one board with working u-boot flashed on it. Now I want to add some functionality to the bootloader (for initializing some part of the hardware), But the development process may brick the board if I make some mistake. Is it possible to do multi stage booting mentioned as below: 1) start u-boot 2) u-boot will load my binary, which has added functionality to initialize hardware. 3) my binary will load and boot the linux-kernel.

If it is possible, some pointers will be appreciated. Thanks.

Upvotes: 3

Views: 879

Answers (1)

marko
marko

Reputation: 9159

Yes. Multi-stage boot is commonly used on ARM SoCs.

In the case of TI OMAP devices, as an example, two instances of the boot-loader are used. The first is run without any expectations that the SDRAM is initialised, and is copied into and executed from 48kB of embedded SRAM. Necessarily, it doesn't do much besides some basic hardware initialisation (e.g. SDRAM, enabling power to certain functional units, enabling clocks) and then loading the second-stage boot-loader. Even this is a tight fit.

The u-Boot (and also Barebox, and probably other bootloader) source-trees have build options to build this set-up, which I'm sure you could subvert.

You might be better off modifying an existing boot-loader. I have good experiences of using Barebox for this.

In the case of OMAP, the first boot-loader is generally referred to as MLO - this might help in finding resources.

Upvotes: 2

Related Questions