Search code examples
embedded-linuxu-boot

What does fatload mmc and bootm means in the uboot?


I am unable to understand these commands like

fatload mmc 0 0x3000000 uImage
fatload mmc 0 0x2A00000 devicetree.dtb
bootm 0x3000000 - 0x2A00000

#fatload mmc 0 0x3000000 uImage. What is it doing? Is it loading uImage as a fat partition and loading at the RAM address 0x3000000?

bootm 0x3000000 - 0x2A00000 - ? Does it mean boot from the RAM address 0x3000000 to 0x2A00000?


Solution

  • U-Boot runs code placed in (processor's) RAM, although it can also read data from other media. The boot process normally takes place in two steps:

    1. Reading the OS image from media (Ethernet, flash, USB, MMC) into RAM
    2. Jumping to the first instruction of the image in RAM

    uImage is the (most probably Linux) kernel.

    xxx.dtb is your device tree in compiled form. It contains the hardware information, so that the information can be kept separately from the kernel.

    Now, to read an image from an MMC card formatted in FAT, the command is:

    fatload mmc <dev>[:partition] <loadAddress> <bootfilename>

    So the 2 fatload commands are loading the 2 files from MMC card into the processor's memory/RAM.

    Now, regarding the bootm : This command starts a kernel image running. The syntax is :

    bootm <address of kernel> <address of ramdisk> <address of dtb>

    Addresses of ramdisk and/or dtb can be omitted if the kernel is configured in such a away that it doesn't need it/them.

    In your case you are not using ramdisk hence the dash - in the middle.