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.

AM625: how to boot from eMMC without doing env setting after burning eMMC?

Part Number: AM625

Dear TI Community,

I have successfully burned eMMC from an SD boot, following the method outlined in the documentation found at
https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/08_06_00_42/exports/docs/linux/Foundational_Components/U-Boot/UG-Memory.html.

It needs to type following cmd once manually to boot from eMMC. 

Fullscreen
1
2
=> setenv mmcdev 0
=> setenv bootpart 0
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

This manual intervention is not acceptable for my product development's compatibility.

There may be a need to revise or update the ENV variables when upgrading the product in the customer's factory. There is a risk of unexpectedly reverting ENV to boot from SD.

Is there a method available to automatically determine different values for "mmcdev" and "bootpart" based on whether it's an SD boot or an eMMC boot?

For example:
      sd boot -> mmcdev = 1, bootpart = 1:2
      eMMC boot -> mmcdev = 0, bootpart = 0:2 or 0:3

I appreciate your prompt response.

  • I'd probably update the U-Boot default environment directly to whatever is your preferred boot method by updating this (or equivalent) source section below, which is usually done during the board port process:

    https://git.ti.com/cgit/ti-u-boot/ti-u-boot/tree/include/configs/am62x_evm.h?h=ti-u-boot-2021.01#n140

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /* U-Boot MMC-specific configuration */
    #define EXTRA_ENV_AM625_BOARD_SETTINGS_MMC \
    "boot=mmc\0" \
    "mmcdev=1\0" \
    "bootpart=1:2\0" \
    "bootdir=/boot\0" \
    "rd_spec=-\0" \
    "init_mmc=run args_all args_mmc\0" \
    "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \
    "get_overlay_mmc=" \
    "fdt address ${fdtaddr};" \
    "fdt resize 0x100000;" \
    "for overlay in $name_overlays;" \
    "do;" \
    "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
    "fdt apply ${dtboaddr};" \
    "done;\0" \
    "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
    "${bootdir}/${name_kern}\0" \
    "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \
    "${bootdir}/${name_fit}\0" \
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Is there a method available to automatically determine different values for "mmcdev" and "bootpart" based on whether it's an SD boot or an eMMC boot?

    You'd need to add some code to do this; this isn't readily available. On a high-level, it could work as follows:

    • Leverage the board_late_init() function located at board/ti/am62x/evm.c to add your code to customize the ENV based on boot type
    • Leverage the spl_boot_device() function located in arch/arm/mach-k3/am625_init.c to allow checking the boot mode at runtime
    • Use the env_set_ulong("mmcdev", <value>) API function to set mmcdev, and env_set("bootpart", "<string>")  to set bootpart according to your needs for the different boot modes

    Regards, Andreas