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/AM3358: Redundant MLO and U-boot

Part Number: AM3358


Tool/software: Linux

Hi,

I'm trying to create a redundant boot system for update functionality, and I'm interested in duplicating U-Boot and SPL data in eMMC (MMC1).

I've already read this thread: https://e2e.ti.com/support/embedded/linux/f/354/t/505682

Partition table:

- Partition 1: Bootloader A (MLO + uboot.img)

- Partition 2: Bootloader B (MLO + uboot.img)

- Partition 3: Linux/Application

- Partition 4: Flags for bootloader update

How can I switch between bootloader A and B?

Thanks!

  • Hi STFZ,

    Regarding MLO, you can not select yourself which MLO to start. This is done by the ROM Code. Per mine understanding, you can have 4 MLO images, and ROM Code will start the first one that is valid.

    MMC/SD cards and NAND devices can hold up to four copies of the booting image. Therefore the ROM Code searches for one valid image out of the four if present by walking over the first four blocks of the mass storage space.

    Please check AM335x TRM, chapter 26 Initialization for more info.

    Check also below pointers:

    e2e.ti.com/.../334778

    e2e.ti.com/.../654763

    Regards,
    Pavel
  • Hi Pavel,

    Thanks! This works.

    Output: "U-Boot SPL
    Trying to boot from MMC1"

    Two u-boot images are required for my purpose.
    MLO doesn't start u-boot:
    - I wrote u-boot.img/u-boot.bin to eMMC as raw partition (start address: 0x80000)
    - I added a 1MB fat partition with boot flag and wrote u-boot.img to this partition
    Both options fail.
    No error is displayed.

    BR,
    Stefan

  • Stefan,

    For how to flash eMMC and boot from eMMC, refer to the below e2e post:

    e2e.ti.com/.../2404955

    Regards,
    Pavel
  • Hi,

    I know how to flash eMMC and so on....

    But this doesn't work in raw mode (RM 26.1.7.5.5).
    MLO and u-boot are not in the same partition.

    Current raw partitions:
    0x20000 ... 0x3FFFF: MLO 1
    0x40000 ... 0x5FFFF: MLO 2

    I don't know how to add u-boot. I tested two options (see my last reply). Both don't work.

    BR,
    Stefan
  • Stefan,

    From what I understand, you are able to flash eMMC and boot from eMMC (raw mode, not FAT mode) successful, when you have only one u-boot image (u-boot-1) in eMMC. And now you want to add one more u-boot image (u-boot-2) in eMMC and control the selection of the two u-boot images.

    This use case is not supported by default in the TI u-boot code base, and you need to modify the SPL source code, as SPL loads u-boot image into DRAM and execute it. But you should be careful when enlarge the SPL functionality, as SPL image has size restrictions as it is located in SRAM (not external DRAM).

    You can tell the SPL to boot from address B if some flag is set and otherwise boot from address A, the flag can be set/cleared during the boot and upgrade procedures. The include/configs/am335x_evm.h file controls a lot of those addresses (A and B).

    You could probably modify the .h file and add a u-boot backup after u-boot and shift the u-boot environment/kernel/rootfs higher in eMMC. You would also have to modify the SPL code to do some type of CRC and use the backup copy if something is wrong. The MTD table in your kernel would have to be modified, too.

    Regards,
    Pavel
  • Hi Pavel, Thank you very much!