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.

booting from eMMC from boot0 partition

Part Number: TDA4VH-Q1

My SDK version:

        linux:  ti-processor-sdk-linux-adas-j784s4-evm-09_01_00_06 

        rtos:  ti-processor-sdk-rtos-j784s4-evm-09_01_00_06

I want to set the system to boot from eMMC.

I found the emmc layout of j7200/j721e from the Linux SDK, but I did not find j784s4.

May I ask where is the emmc layout belonging to j784s4?

  • Sorry, I followed the manual to set up but did not succeed, here are my Settings and logs:

    Hit any key to stop autoboot: 0
    =>
    => mmc dev 0 1
    sd_send_op_cond mmc_send_cmd 1:-110
    switch to partitions #1, OK
    mmc0(part 1) is current device
    =>
    => fatload mmc 1 ${loadaddr} tiboot3.bin
    516381 bytes read in 46 ms (10.7 MiB/s)
    => mmc write ${loadaddr} 0x0 0x400

    MMC write: dev # 0, block # 0, count 1024 ... 1024 blocks written: OK
    =>
    => fatload mmc 1 ${loadaddr} tispl.bin
    1078443 bytes read in 71 ms (14.5 MiB/s)
    => mmc write ${loadaddr} 0x400 0x1000

    MMC write: dev # 0, block # 1024, count 4096 ... 4096 blocks written: OK
    => fatload mmc 1 ${loadaddr} u-boot.img
    1332203 bytes read in 81 ms (15.7 MiB/s)
    => mmc write ${loadaddr} 0x1400 0x2000

    MMC write: dev # 0, block # 5120, count 8192 ... 8192 blocks written: OK
    => mmc partconf 0 1 1 1
    => mmc bootbus 0 2 0 0
    Set to BOOT_BUS_WIDTH = 0x2, RESET = 0x0, BOOT_MODE = 0x0
    => mmc partconf 0 1 7 1
    =>
    => mmc bootbus 0 2 0 0
    Set to BOOT_BUS_WIDTH = 0x2, RESET = 0x0, BOOT_MODE = 0x0
    =>
    =>
    =>
    => setenv mmcdev 0
    => setenv bootpart 0
    => boot
    sd_send_op_cond mmc_send_cmd 1:-110
    switch to partitions #0, OK
    mmc0(part 0) is current device
    sd_send_op_cond mmc_send_cmd 1:-110
    SD/MMC found on device 0
    Can't set block device
    Can't set block device
    (omap24xx)i2c_write: error waiting for data ACK (status=0x116)
    pca953x gpio@20: Error reading output register:-121
    (omap24xx)i2c_write: error waiting for data ACK (status=0x116)
    pca953x gpio@22: Error reading output register:-121
    GPIO: 'gpio@22_17' not found
    Command 'gpio' failed: Error -22
    (omap24xx)i2c_write: error waiting for data ACK (status=0x116)
    pca953x gpio@20: Error reading output register:-121
    (omap24xx)i2c_write: error waiting for data ACK (status=0x116)
    pca953x gpio@22: Error reading output register:-121
    GPIO: 'gpio@22_16' not found
    Command 'gpio' failed: Error -22
    k3_r5f_rproc r5f@41000000: Core 1 is already in use. No rproc commands work
    Can't set block device
    Can't set block device
    Can't set block device
    Can't set block device
    Can't set block device
    Can't set block device
    Can't set block device
    Can't set block device
    Can't set block device
    Can't set block device
    Can't set block device
    Can't set block device
    Can't set block device
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    No FDT memory address configured. Please configure
    the FDT address via "fdt addr <address>" command.
    Aborting!
    Bad Linux ARM64 Image magic!
    sd_send_op_cond mmc_send_cmd 1:-110
    switch to partitions #0, OK
    mmc0(part 0) is current device
    switch to partitions #0, OK
    mmc1 is current device
    Scanning mmc 1:1...
    No EFI system partition
    No EFI system partition
    Failed to persist EFI variables
    BootOrder not defined
    EFI boot manager: Cannot load any image
    starting USB...
    No working controllers found
    USB is stopped. Please issue 'usb start' first.
    starting USB...
    No working controllers found
    k3-navss-ringacc ringacc@2b800000: Ring Accelerator probed rings:286, gp-rings[96,20] sci-dev-id:328
    k3-navss-ringacc ringacc@2b800000: dma-ring-reset-quirk: disabled
    am65_cpsw_nuss_port ethernet@46000000port@1: K3 CPSW: rflow_id_base: 2
    ethernet@46000000port@1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
    am65_cpsw_nuss_port ethernet@46000000port@1: phy_startup failed
    am65_cpsw_nuss_port ethernet@46000000port@1: am65_cpsw_start end error

  • Hello,

    You need to power off the board. Change your dip switch settings to eMMC boot0 partition or what you are asking is something else.

    - Keerthy

  • Can you explain in detail how it should be changed? I never managed to set it up

    The MMC0 device does not appear to be found in the log:

        sd_send_op_cond mmc_send_cmd 1:-110
        switch to partitions #0, OK
        mmc0(part 0) is current device
        MMC: no card present
        mmc_init: -123, time 2002

  • Hi,

    Is this a custom board or a TI EVM? Also are you using pre-built binaries or building your own bootloaders with custom software changes?

    - Keerthy

  • custom board, and I built bootloaders . 

    I tried using EMMC to boot on TI EVM

  • The following logs are generated after the power-on:

     

    U-Boot SPL 2023.04 (Apr 19 2024 - 16:55:07 +0800)
    (j784s4)The board we use does not have eeprom!
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.2--v09.01.02 (Kool Koala)')
    SPL initial stack usage: 13424 bytes
    Trying to boot from MMC1
    sd_send_op_cond mmc_send_cmd 1:-110
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Loading Environment from nowhere... OK
    init_env from device 17 not supported!
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.9(release):v2.9.0-614-gd7a7135d32-dirty
    NOTICE: BL31: Built : 09:34:15, Aug 24 2023
    I/TC:
    I/TC: OP-TEE version: 4.0.0 (gcc version 11.4.0 (GCC)) #1 Fri Oct 20 18:29:31 UTC 2023 aarch64
    I/TC: WARNING: This OP-TEE configuration might be insecure!
    I/TC: WARNING: Please check optee.readthedocs.io/.../porting_guidelines.html
    I/TC: Primary CPU initializing
    I/TC: SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.2--v09.01.02 (Kool Koala)')
    I/TC: HUK Initialized
    I/TC: Activated SA2UL device
    I/TC: Fixing SA2UL firewall owner for GP 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 2023.04 (Apr 19 2024 - 16:55:21 +0800)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.2--v09.01.02 (Kool Koala)')
    Trying to boot from MMC1
    sd_send_op_cond mmc_send_cmd 1:-110
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted


    U-Boot 2023.04 (Apr 19 2024 - 16:55:21 +0800)

    SoC: J784S4 SR1.0 GP
    Model: Texas Instruments J784S4 EVM
    (j784s4)The board we use does not have eeprom!
    Board: J784S4-EVM rev E1
    DRAM: 8 GiB
    idle-statesCore: 91 devices, 33 uclasses, devicetree: separate
    Flash: 0 Bytes
    MMC: mmc@4f80000: 0, mmc@4fb0000: 1
    Loading Environment from nowhere... OK
    In: serial@2880000
    Out: serial@2880000
    Err: serial@2880000
    am65_cpsw_nuss ethernet@46000000: K3 CPSW: nuss_ver: 0x6BA02102 cpsw_ver: 0x6BA82102 ale_ver: 0x00293904 Ports:1 mdio_freq:1000000
    (j784s4)The board we use does not have eeprom!
    Net: eth0: ethernet@46000000port@1
    Hit any key to stop autoboot: 0
    MMC: no card present
    mmc_init: -123, time 2002
    sd_send_op_cond mmc_send_cmd 1:-110
    SD/MMC found on device 1
    MMC: no card present
    mmc_init: -123, time 2002
    ** (device)Bad device specification mmc 1 **
    Couldn't find partition mmc 1
    Can't set block device
    MMC: no card present
    mmc_init: -123, time 2002
    ** (device)Bad device specification mmc 1 **
    Couldn't find partition mmc 1
    Can't set block device

  • Hi,

    The following logs are generated after the power-on:

    These are on the EVM?

    Trying to boot from MMC1

    So you are able to boot from eMMC here.

    - Keerthy

  • TI EVM log :

    U-Boot SPL 2021.01-g1c0d06c606 (Oct 30 2022 - 20:19:37 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.4.5--v08.04.05 (Jolly Jellyfi')
    Trying to boot from MMC1


    U-Boot 2021.01-g1c0d06c606 (Oct 30 2022 - 20:19:37 +0000)

    SoC: J784S4 SR1.0 GP
    Model: Texas Instruments J784S4 EVM
    DRAM: 32 GiB
    Flash: 0 Bytes
    MMC: mmc@4f80000: 0, mmc@4fb0000: 1
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    In: serial@2880000
    Out: serial@2880000
    Err: serial@2880000
    am65_cpsw_nuss ethernet@46000000: K3 CPSW: nuss_ver: 0x6BA02102 cpsw_ver: 0x6BA82102 ale_ver: 0x00293904 Ports:1 mdio_freq:1000000
    Net: eth0: ethernet@46000000port@1
    Hit any key to stop autoboot: 0
    Card did not respond to voltage select! : -110
    mmc_init: -95, time 43
    SD/MMC found on device 1
    Card did not respond to voltage select! : -110
    mmc_init: -95, time 38
    Card did not respond to voltage select! : -110
    mmc_init: -95, time 38
    Card did not respond to voltage select! : -110
    mmc_init: -95, time 38
    Card did not respond to voltage select! : -110
    mmc_init: -95, time 38
    Card did not respond to voltage select! : -110
    mmc_init: -95, time 38
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    No FDT memory address configured. Please configure
    the FDT address via "fdt addr <address>" command.
    Aborting!
    Bad Linux ARM64 Image magic!
    =>

  • What I did on the TI EVM board:

    mmc partconf 0 1 1 1

    mmc bootbus 0 2 0 0

    mmc dev 0 1

    fatload mmc 1 ${loadaddr} tiboot3.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

  • Hi,

    So the boot loaders are booting from eMMC boot partition. Where is your rootfs file system hosted? Is it in eMMC or SD card?
    By default It is trying to access SD card.

    Try the command from U-Boot prompt:

    setenv bootdev 0

    - Keerthy

  • Thank you

    My file system is in eMMC

    After I set the boot parameters, the Linux system ran successfully.

    Commands:
    setenv mmcdev 1
    setenv bootpart 0:1

    However, the saveenv command is missing in my uboot command,

    so I need to manually input startup parameters during each startup to normally read the file system in emmc.

    My uboot is compiled using the SDK.

  • Hi,

    However, the saveenv command is missing in my uboot command,

    so I need to manually input startup parameters during each startup to normally read the file system in emmc.

    saveenv is deprecated in the 9.x SDKs. You can try to use the same commands in uEnv.txt.

    Closing this thread.

    - Keerthy

  • Wait a minute,

    I add the command to the end of uEnv.txt and use the command:

        mmc dev 0 1

        fatload mmc 1 ${loadaddr} uEnv.txt

        mmc write ${loadaddr} 0x3400 0x100

    The Settings do not take effect after power-on. What should I do?

  • Hi,

    Is the U-boot reading the uEnv.txt from the eMMC boot partition? For raw partition typical uEnv.raw needs to be written. Can you share the logs?

    - Keerthy

  • Hi Jin 

    Can you apply the below changes to the defconfig to enable the support for the saveenv.

    diff --git a/configs/j784s4_evm_a72_defconfig b/configs/j784s4_evm_a72_defconfig
    index 4c958a95..2b14d070 100644
    --- a/configs/j784s4_evm_a72_defconfig
    +++ b/configs/j784s4_evm_a72_defconfig
    @@ -17,6 +17,8 @@ CONFIG_SPL_MMC=y
     CONFIG_SPL_SERIAL=y
     CONFIG_SPL_DRIVERS_MISC=y
     CONFIG_SPL_STACK_R_ADDR=0x82000000
    +CONFIG_ENV_OFFSET_REDUND=0x6A0000
     CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
     CONFIG_SPL_FS_FAT=y
     CONFIG_SPL_LIBDISK_SUPPORT=y
    @@ -92,6 +94,8 @@ CONFIG_SPL_OF_CONTROL=y
     CONFIG_SPL_MULTI_DTB_FIT=y
     CONFIG_OF_LIST="k3-j784s4-evm k3-am69-sk"
     CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
    +CONFIG_ENV_OVERWRITE=y
    +CONFIG_ENV_IS_IN_MMC=y
     CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
     CONFIG_SYS_RELOC_GD_ENV_ADDR=y
     CONFIG_NET_RANDOM_ETHADDR=y

    Regards
    Diwakar

  • Thank you.

    The saveenv command can take effect after referring to your modification.

    A setup option (ENV_OFFSET) came up at compile time and I typed in 0, but I don't know what the effect is.

  • No uEnv.txt in the eMMC boot partition, and I am not sure how to write uEnv.raw. 

  • HI Jin 

    Are you able to save your environment variable now ?

    Regards
    Diwakar

  • Yes, I saved it successfully, thank you.

  • HI Jin

    Can we close this ticket then or do you still have some concerns on the above topic ?

    Regards
    Diwakar

  • Hi, Diwakar

    I found an issue that when I execute the command 'saveenv', it breaks the partition I created in eMMC

    When I execute 'ext4ls' I can see my partition, after I execute 'saveenv' the partition can't be found.

    'saveenv' command appears to store a region that conflicts with the eMMC partition table.

  • HI Jin 

    can you apply the below changes and see if its works now.

    diff --git a/configs/j721s2_evm_a72_defconfig b/configs/j721s2_evm_a72_defconfig
    index c489d67d..1ab74164 100644
    --- a/configs/j721s2_evm_a72_defconfig
    +++ b/configs/j721s2_evm_a72_defconfig
    @@ -11,6 +11,8 @@ CONFIG_TARGET_J721S2_A72_EVM=y
     CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
     CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
     CONFIG_ENV_SIZE=0x40000
    +CONFIG_ENV_SIZE=0x20000
    +CONFIG_ENV_OFFSET=0x680000
     CONFIG_DM_GPIO=y
     CONFIG_SPL_DM_SPI=y
     CONFIG_DEFAULT_DEVICE_TREE="k3-j721s2-common-proc-board"
    @@ -20,6 +22,7 @@ CONFIG_SPL_MMC=y
     CONFIG_SPL_SERIAL=y
     CONFIG_SPL_DRIVERS_MISC=y
     CONFIG_SPL_STACK_R_ADDR=0x82000000
    +CONFIG_ENV_OFFSET_REDUND=0x6A0000
     CONFIG_SPL_FS_FAT=y
     CONFIG_SPL_LIBDISK_SUPPORT=y
     CONFIG_SPL_SPI_FLASH_SUPPORT=y
    @@ -88,6 +91,8 @@ CONFIG_SPL_OF_CONTROL=y
     CONFIG_OF_LIST="k3-j721s2-common-proc-board k3-am68-sk-base-board"
     CONFIG_SPL_MULTI_DTB_FIT=y
     CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
    +CONFIG_ENV_OVERWRITE=y
    +CONFIG_ENV_IS_IN_MMC=y
     CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
     CONFIG_SYS_RELOC_GD_ENV_ADDR=y
     CONFIG_NET_RANDOM_ETHADDR=y
    

    Regards
    Diwakar

  • Thank you very much, I have solved this problem, I put in a specific address to ensure that it does not overlap with other areas.