This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM4372: NAND and eMMC boot

Part Number: AM4372

Tool/software: Linux

I have a quick question on NAND and EMMC boot

 Let say when the device is out of reset and it is set to boot from NAND. It goes and reads the first sector for a valid MLO if not find I assume it goes to the 2nd sector and tries to read a valid MLO once it finds a valid MLO then it tries to load Uboot from the NAND. Let say Uboot is corrupted in the NAND then what happens?? Does it have a recovery uboot that it can read from the NAND?? I know below is what we have for the NAND and don’t see any uboot backup? I assume the emmc has the same issues that there are no uboot backup? If that is the case then they both have the same issue as to how to recover from a bad uboot or kernel?

I don't think there is any redundancy for the u-boot or the kernel or the file system when using NAND or EMMC? IF there is please let me know how that is done? What i am after is that if the memory fails and the uboot or the kernel or the file system is corrupted what happens?

Also how does the SPL knows where to get the uboot image from? can that be changed?

Thanks

Regards

Mohsen

  • Hi Mohsen,

    Mohsen Khayami said:

     Let say when the device is out of reset and it is set to boot from NAND. It goes and reads the first sector for a valid MLO if not find I assume it goes to the 2nd sector and tries to read a valid MLO once it finds a valid MLO then it tries to load Uboot from the NAND. Let say Uboot is corrupted in the NAND then what happens?? Does it have a recovery uboot that it can read from the NAND?? I know below is what we have for the NAND and don’t see any uboot backup? I assume the emmc has the same issues that there are no uboot backup? If that is the case then they both have the same issue as to how to recover from a bad uboot or kernel?

    I don't think there is any redundancy for the u-boot or the kernel or the file system when using NAND or EMMC? IF there is please let me know how that is done? What i am after is that if the memory fails and the uboot or the kernel or the file system is corrupted what happens?

    u-boot backup copy we have only for QSPI boot (not for NAND/eMMC). You might refer to the QSPI u-boot.backup implementation and re-use that approach for NAND/eMMC.

    Refer also to the below e2e threads:

    Mohsen Khayami said:
    Also how does the SPL knows where to get the uboot image from? can that be changed?

    I think SPL and u-boot images should be in the same media (NAND, eMMC, etc). You can not have SPL in NAND and u-boot image in eMMC. If you need such feature, you should modify the SPL source code, but you will have size restrictions.

    It is the job of the SPL to transfer the 2nd stage loader into main memory, which we call the u-boot. Typically both the SPL and u-boot come from the same storage medium. For example, typically if the SPL is transferred via USB, the u-boot will also be transferred via USB, and if the SPL is transferred via SD card, the u-boot will also be transferred via SD card. However, this is not required. For example, you could flash the serial SPL into the NAND. The ROM code will load the SPL from NAND and transfer control to the SPL, which will wait for the u-boot to be downloaded from the serial port.

    Check also:

    http://omappedia.org/wiki/Bootloader_Project

    Regards,
    Pavel