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.

[FAQ] AM625: How to boot with eMMC boot mode on AM62x

Part Number: AM625

This FAQ shows how to boot with eMMC boot mode on AM62x.

Due to some recent issues with eMMC boot mode on AM62x such as:
- Error flashing the rootfs to eMMC UDA partition in Linux kernel
- Error booting from eMMC hardware boot0 partition (tispl.bin not found)
- Cannot save to U-boot environment after flashing to eMMC hardware boot0 partition

This FAQ will address how to fix these issues and boot with eMMC boot mode on AM62x. This is assuming we flashing the U-boot bootloader binaries to eMMC hardware boot0 partition and the rootfs to the user partition on eMMC (UDA in fs mode).

  • 1. Re-build U-boot with the following eMMC patch:

    diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
    index d103c73770..4f54eeff82 100644
    --- a/arch/arm/mach-k3/am625_init.c
    +++ b/arch/arm/mach-k3/am625_init.c
    @@ -25,6 +25,9 @@
     #define K3RTC_KICK0_UNLOCK_VALUE       0x83e70b13
     #define K3RTC_KICK1_UNLOCK_VALUE       0x95a4f1e0
    +/*eMMC boot mode fix*/
    +#define EMMC_BOOT      9
     #if defined(CONFIG_SPL_BUILD)
    @@ -245,6 +248,10 @@ u32 spl_mmc_boot_mode(const u32 boot_device)
            switch (boot_device) {
            case BOOT_DEVICE_MMC1:
    +               if (((devstat & MAIN_DEVSTAT_PRIMARY_BOOTMODE_MASK) >>
    +                       return MMCSD_MODE_EMMCBOOT;
                    if ((bootmode_cfg & MAIN_DEVSTAT_PRIMARY_MMC_FS_RAW_MASK) >>
                            return MMCSD_MODE_EMMCBOOT;
    diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
    index d9bf9a5b7d..577fdaf1ac 100644
    --- a/configs/am62x_evm_a53_defconfig
    +++ b/configs/am62x_evm_a53_defconfig
    @@ -82,7 +82,7 @@ CONFIG_MULTI_DTB_FIT=y

    The patch fixes eMMC boot in U-boot and allows us to save to the U-boot environment after flashing the U-boot binaries to eMMC hardware partition boot0.

    2. In Linux Kernel, rebuilt the DTB with the following patch:

    diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
    index b4051afb0a4e..c1078cd9fb7e 100644
    --- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
    +++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
    @@ -409,12 +409,11 @@ sdhci0: mmc@fa10000 {
                    bus-width = <8>;
                    ti,clkbuf-sel = <0x7>;
                    ti,otap-del-sel-legacy = <0x0>;
    -               ti,otap-del-sel-mmc-hs = <0x0>;
    -               ti,otap-del-sel-ddr52 = <0x5>;
    -               ti,otap-del-sel-hs200 = <0x5>;
                    ti,itap-del-sel-legacy = <0xa>;
                    ti,itap-del-sel-mmc-hs = <0x1>;
                    status = "disabled";
    +               /delete-property/mmc-ddr-1_8v;
    +               /delete-property/mmc-hs200-1_8v;
            sdhci1: mmc@fa00000 {

    This patch reduces eMMC speed in Linux kernel to 'High Speed' that allows us to flash the rootfs to the UDA partition in Linux kernel. This step is necessary since there are stability issues with MMC device on AM62x. There is ongoing debugging being carried out by TI engineers but for the moment reducing MMC speed should allow us to boot with eMMC boot mode.

    Once U-boot is built, copy 'tiboot3.bin', 'tispl.bin', and 'U-boot.img' to the SD card 'boot' partition which we will use to boot the AM62x board and verify the binaries we built work. Once the DTB is built, copy to SD card /root/boot partition.

    At Linux kernel, verify the eMMC speed is 'high speed' with the following command:

    root@am62xx-evm:~# sudo dmesg | grep mmc0
    [    2.987790] mmc0: CQHCI version 5.10
    [    3.033168] mmc0: SDHCI controller on fa10000.mmc [fa10000.mmc] using ADMA 64-bit
    [    3.118174] mmc0: Command Queue Engine enabled
    [    3.122685] mmc0: new high speed MMC card at address 0001

    Now we could follow the instructions found in AM62x Linux Academy to flash and boot from eMMC on AM62x:

    Additional info:

    eMMC boot mode switch setting is as shown, more info can be found in TRM Section 5.3 Boot Mode Pins.
    - eMMC boot B3:B9 1001000

    ~ Judith