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.

AM62A7: Booting from emmc userarea partition using RAW mode

Part Number: AM62A7

Hi,

We are testing custom board based on AM62A7 SOC.

We are testing booting from emmc using raw mode and using below commands u-boot is successfully loaded properly from emmc userarea.

fatload mmc 1 ${loadaddr} tiboot3-am62ax-gp-evm.bin
mmc write ${loadaddr} 0x0 0x400
fatload mmc 1 ${loadaddr} tispl.bin
mmc write ${loadaddr} 0x400 0x1000
fatload mmc 1 ${loadaddr} u-boot.img
mmc write ${loadaddr} 0x1400 0x2000
mmc partconf 0 1 7 1

we are creating partition table as below in Uboot.

editenv partitions
uuid_disk=${uuid_gpt_disk};name=rootfs,start=20MiB,size=-,uuid=${uuid_gpt_rootfs}

setenv uuid_gpt_disk 91f4e9e3-9048-486a-8897-b827290e5a83
setenv uuid_gpt_rootfs 05978e1d-ba93-4e03-9e82-faab932bdfcd
gpt write mmc 0 ${partitions}

But the partition table in emmc is getting erased after flashing the tiboot3.bin to offset 0.

How to flash all binaries to emmc userarea without erasing the partition table in emmc?

  • Hi,

    Try flashing tiboot3.bin at offset 0x2000.

    So the first command would be:
    fatload mmc 1 ${loadaddr} tiboot3-am62ax-gp-evm.bin
    mmc write ${loadaddr} 0x2000 0x400

    Lets see if ROM can boot tiboot3.bin from this offset then proceed to the rest of the binaries.

    ~ Judith

  • Hi,

    tiboot3.bin is not loading from offset 0x2000.

    We are using emmc-boot (BOOTMODE[6:3]=1001b) mode for booting.

    which other offset can be used for flashing tiboot3.bin?

  • Hi,

    As far as I know. ROM will look at address 0x0 and if fails, at the backup address 0x2000.

    Boot mode seems fine according to the TRM.

    Did you make sure to do the following in U-boot:

    => mmc partconf 0 1 1 1
    => mmc bootbus 0 2 0 0

    Right before booting with eMMC boot?

    Please provide a log that shows how you are flashing and where you execute these commands right before attempting eMMC boot.

    ~ Judith

  • Hi,

    below are the commands used for flashing u-boot

    mmc dev 0 1
    mmc erase 0x0 0x4000

    fatload mmc 1 ${loadaddr} tiboot3-am62ax-gp-evm.bin
    mmc write ${loadaddr} 0x2000 0x400
    fatload mmc 1 ${loadaddr} tispl.bin
    mmc write ${loadaddr} 0x400 0x1000

    fatload mmc 1 ${loadaddr} u-boot.img
    mmc write ${loadaddr} 0x1400 0x2000

    mmc bootbus 0 2 0 0
    mmc partconf 0 1 1 1

    but when switched to boot mode boot fails and falls back to backup boot mode

  • Hi,

    Sorry sent the wrong command, it should be:

    $ mmc partconf 0 1 7 1
    $ mmc bootbus 0 2 0 0

    ~ Judith

  • Hi Vinay,

    Here is the process that worked for me:

    Rebuild U-boot with patch:

    diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
    index d9bf9a5b7d..48a8e6f6e0 100644
    --- a/configs/am62x_evm_a53_defconfig
    +++ b/configs/am62x_evm_a53_defconfig
    @@ -41,7 +41,7 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
     CONFIG_SPL_STACK_R=y
     CONFIG_SPL_SEPARATE_BSS=y
     CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
    -CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1400
    +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x3400
     CONFIG_SPL_DMA=y
     CONFIG_SPL_ETH_SUPPORT=y
     CONFIG_SPL_ENV_SUPPORT=y
    diff --git a/configs/am62x_evm_r5_defconfig b/configs/am62x_evm_r5_defconfig
    index 18a619cdc1..a9e790edea 100644
    --- a/configs/am62x_evm_r5_defconfig
    +++ b/configs/am62x_evm_r5_defconfig
    @@ -37,7 +37,7 @@ CONFIG_SPL_STACK_R=y
     CONFIG_SPL_SEPARATE_BSS=y
     CONFIG_SPL_EARLY_BSS=y
     CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
    -CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x400
    +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x2400
     CONFIG_SPL_DMA=y
     CONFIG_SPL_ENV_SUPPORT=y
     CONFIG_SPL_I2C_SUPPORT=y
    

    //Boot previous binaries using SD card boot mode first

    => fatload mmc 1 ${loadaddr} tiboot3.bin
    335026 bytes read in 7 ms (45.6 MiB/s)
    => mmc write ${loadaddr} 0x2000 0x400

    MMC write: dev # 0, block # 8192, count 1024 ... 1024 blocks written: OK
    => fatload mmc 1 ${loadaddr} tispl.bin
    970228 bytes read in 13 ms (71.2 MiB/s)
    =>  mmc write ${loadaddr} 0x2400 0x1000

    MMC write: dev # 0, block # 9216, count 4096 ... 4096 blocks written: OK
    => fatload mmc 1 ${loadaddr} u-boot.img
    897888 bytes read in 13 ms (65.9 MiB/s)
    => mmc write ${loadaddr} 0x3400 0x2000

    MMC write: dev # 0, block # 13312, count 8192 ... 8192 blocks written: OK
    => mmc partconf 0 1 7 1
    => mmc bootbus 0 2 0 0

    Boot with eMMC Boot using UDA (raw mode) B3:B9 0001100

    U-Boot SPL 2021.01-00003-g6021c48697 (Jul 21 2023 - 11:29:42 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
    SPL initial stack usage: 13424 bytes
    Trying to boot from MMC1
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Loading Environment from MMC... OK
    init_env from device 9 not supported!
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.8(release):v2.8-226-g2fcd408bb
    NOTICE:  BL31: Built : 11:29:47, Jul 21 2023
    I/TC: 
    I/TC: OP-TEE version: 3.20.0-rc1 (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 Fri Jul 21 16:29:52 UTC 2023 aarch64
    I/TC: WARNING: This OP-TEE configuration might be insecure!
    I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
    I/TC: Primary CPU initializing
    I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
    I/TC: HUK Initialized
    I/TC: Activated SA2UL device
    I/TC: Enabled firewalls for SA2UL TRNG device
    I/TC: SA2UL TRNG initialized
    I/TC: SA2UL Drivers initialized
    I/TC: Primary CPU switching to normal world boot
    
    U-Boot SPL 2021.01-00003-g6021c48697 (Jul 21 2023 - 11:29:58 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
    Trying to boot from MMC1
    Authentication passed
    Authentication passed
    
    
    U-Boot 2021.01-00003-g6021c48697 (Jul 21 2023 - 11:29:58 -0500)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62B-SKEVM rev A
    DRAM:  2 GiB
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
    Loading Environment from MMC... OK
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Unidentified board claims AM62B-SKEVM in eeprom header
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0 
    =>

    ~ Judith