U-Boot SPL vs U-BOOT

During I was Working on Embedded  Linux development, during boot up the very first message you will see on the console is as shown below. So I was curious what is U-BOOT SPL and U-BOOT. So i tried to understand this bootup process below.



On Embedded OMAP platforms the first program being run after power-on is ROM code (which is similar to BIOS on a PC. This Code buried in every Microcontroller, Microprocessor by default by the manufacturer).

ROM code looks for bootloader (which must be a file named "MLO" and located on the active first partition of MMC, which must be formatted as FAT12/16/32, -- but that's details)

ROM code copies the content of that "MLO" file to static RAM (because regular RAM is not initialized yet). Next picture shows the SRAM memory layout for OMAP4460 SoC:



SRAM memory is limited (due to physical reasons), so we only have 48 KiB for the bootloader. Usually regular bootloader (e.g. U-Boot) binary is bigger than that. So we need to create some additional bootloader, which will initialize regular RAM and copy the regular bootloader from MMC to RAM, and then will jump to execute that regular bootloader. This additional bootloader is usually referred to as a first-stage bootloader (in a two-stage bootloader scenario).


So this first-stage bootloader is U-Boot SPL, and the second-stage bootloader is regular U-Boot (or U-Boot proper). To be clear: SPL stands for Secondary Program Loader. This means that ROM code is the first thing that loads (and executes) another program and SPL is the second thing that loads (and executes) another program. 

So usually boot sequence is next: ROM code -> SPL -> u-boot -> kernel. 

And actually, it's very similar to PC boot, which is: BIOS -> MBR -> GRUB -> kernel.



Comments

Popular posts from this blog

br0 Network Interface Explained

dB vs dBm