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.

PROCESSOR-SDK-AM65X: How to have different env for u-boot?

Part Number: PROCESSOR-SDK-AM65X

Hi Ti,

We are using AM65x EVM board and try to modify u-boot with eMMC and SD card boot.

We want to know how to modify uEnv.txt either in eMMC or SD card.

Can we add "setenv mmcdev 0" and "setenv bootpart 0:2" in uEnv.txt in eMMC and add "setenv mmcdev 1" and "setenv bootpart 1:2" in uEnv.txt in SD card?

Will uEnv.txt be referenced in AM65x?   We use the prebuild uEnv.txt you provided.

If not, how can we achieve this?

Thanks.

Eric

  • Hi Eric,

    uEnv.txt is a normal text file. It needs to have an empty line at the end, otherwise it is a unix format normal text file and can be edited in any linux text editor.

  • Hi Dwarakesh R.

    Not very clear what you mean.

    Thus, can I add "mmcdev=0" and "bootpart=0:2" for eMMC boot?

    Thanks.

    Eric

  • Hi Eric,

    If you need commands to be executed, then you can have a line as below inside the file using uenvcmd. example for uEnv.txt file for SDCard:

    uenvcmd=setenv mmcdev 1;setenv bootpart 1:2

    Infact as you said, you can just have

    mmcdev=0

    bootpart=0:2

    which uEnv.txt inherently does setting environment

  • Hi Dwarakesh R.

    As you told, I add the line "uenvcmd=setenv mmcdev 0;setenv bootpart 0:2" into my uEnv.txt as attached screen shot.

    However, no matter I set "mmcdev 1 and bootpart 1:2" or "mmc dev 0 and bootpart 0:2", I always get the logs almost the same.

    The difference is only the speed.

    I'm not sure if it's right.

    Or could you let me know how can I make sure uEnv.txt has beed executed? via logs or anything else?

    Thanks.

    Eric

  • Hi Eric,

    You can add I believe

    uenvcmd=echo Eric's cmd;setenv mmcdev 0;setenv bootpart 0:2

    Ok, I got what you are trying. I thought it was just about adding commands. But looks like you would need to set commands to boot from either SDCard or eMMC.

    Can you send the output of command in uboot(stop uboot autoboot)? . Generally uenvcmd would be executed with bootcmd and hence you would not be able to note the effect of it.

    # pri

  • Hi Dwarakesh R,

    What I want is auto boot from eMMC or SD card. This is for user scenario after shipping.

    It's not possible for user to enter command to change where it boot from.

    The boot command should as below, please take a look.


    U-Boot SPL 2019.01-ga141f7abfd (Jan 05 2020 - 03:55:36 +0000)
    SYSFW ABI: 2.7 (firmware rev 0x0013 '19.9.0-v2019.09 (Terrific Llama')
    Trying to boot from MMC2
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.2(release):ti2019.05-rc1
    NOTICE: BL31: Built : 03:29:45, Jan 5 2020
    I/TC:
    I/TC: OP-TEE version: ti2019.05-rc1-dev (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #1 Sun Jan 5 03:28:58 UTC 2020 aarch64
    I/TC: Initialized

    U-Boot SPL 2019.01-ga141f7abfd (Jan 05 2020 - 03:53:46 +0000)
    Detected: AM6-IDKAPPEVM rev E4
    Trying to boot from MMC2


    U-Boot 2019.01-ga141f7abfd (Jan 05 2020 - 03:53:46 +0000)

    SoC: AM654 PG 1.0
    Model: Texas Instruments AM654 Base Board
    Board: AM6-COMPROCEVM rev E4
    DRAM: 4 GiB
    MMC: sdhci@4f80000: 0, sdhci@04FA0000: 1
    Loading Environment from MMC... OK
    In: serial
    Out: serial
    Err: serial
    Detected: AM6-IDKAPPEVM rev E4
    Net: eth3: pruss1_eth, eth2: pruss0_eth, eth0: cpsw_nuss@046000000, eth1: pruss2_eth
    Hit any key to stop autoboot: 0
    => print
    arch=arm
    args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 ${mtdparts}
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    args_ubi=setenv bootargs console=${console} ${optargs} rootfstype=ubifs root=ubi0:rootfs rw ubi.mtd=ospi.rootfs
    baudrate=115200
    board=am65x
    board_name=am65x
    board_rev=E4
    board_serial=0129
    board_software_revision=01
    boot=mmc
    boot_fit=0
    boot_rprocs=if test ${dorprocboot} -eq 1 && test ${boot} = mmc; then rproc init;run boot_rprocs_mmc;fi;
    boot_rprocs_mmc=env set rproc_id;env set rproc_fw;for i in ${rproc_fw_binaries} ; do if test -z "${rproc_id}" ; then env set rproc_id $i;else env set rproc_fw $i;run rproc_load_and_boot_one;env set rproc_id;env set rproc_fw;fi;done
    bootargs=androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=am65xevmboard
    bootcmd=run check_dofastboot; run findfdt; run check_android; if test $is_android -eq 1; then run emmc_android_boot; fi; setenv mmcdev 1; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern
    bootdelay=2
    bootdir=/boot
    bootenvfile=uEnv.txt
    bootpart=0:2
    bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
    check_android=setenv mmcdev 0; env delete boot_start; part start mmc ${mmcdev} boot boot_start; if test "$boot_start" = ""; then env set is_android 0; else env set is_android 1; fi; env delete boot_start
    check_dofastboot=if test ${dofastboot} -eq 1; then echo Boot fastboot requested, resetting dofastboot ...;setenv dofastboot 0; env save; echo Booting into fastboot ...; fastboot 0; fi
    console=ttyS2,115200n8
    cpu=armv8
    dfu_alt_info_emmc=rawemmc raw 0 0x800000 mmcpart 1;rootfs part 0 1 mmcpart 0;tiboot3.bin.raw raw 0x0 0x400 mmcpart 1;tispl.bin.raw raw 0x400 0x1000 mmcpart 1;u-boot.img.raw raw 0x1400 0x2000 mmcpart 1;u-env.raw raw 0x3400 0x100 mmcpart 1;sysfw.itb.raw raw 0x3600 0x800 mmcpart 1
    dfu_alt_info_mmc=boot part 1 1;rootfs part 1 2;tiboot3.bin fat 1 1;tispl.bin fat 1 1;u-boot.img fat 1 1;uEnv.txt fat 1 1;sysfw.itb fat 1 1
    dfu_alt_info_ospi=tiboot3.bin raw 0x0 0x080000;tispl.bin raw 0x080000 0x200000;u-boot.img raw 0x280000 0x400000;u-boot-env raw 0x680000 0x020000;sysfw.itb raw 0x6c0000 0x100000;rootfs raw 0x800000 0x3800000
    dfu_bufsiz=0x20000
    dofastboot=0
    dorprocboot=0
    emmc_android_boot=echo Trying to boot Android from eMMC ...; run update_to_fit; setenv eval_bootargs setenv bootargs $bootargs; run eval_bootargs; setenv mmcdev 0; mmc dev $mmcdev; mmc rescan; part start mmc ${mmcdev} boot boot_start; part size mmc ${mmcdev} boot boot_size; mmc read ${fit_loadaddr} ${boot_start} ${boot_size}; run get_overlaystring; run run_fit
    envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;
    eth1addr=70:ff:76:1d:5c:bc
    eth2addr=70:ff:76:1d:5c:bd
    eth3addr=70:ff:76:1d:5f:34
    eth4addr=70:ff:76:1d:5f:35
    eth5addr=70:ff:76:1d:5f:36
    eth6addr=70:ff:76:1d:5f:37
    ethaddr=4c:24:98:fc:09:d6
    fastboot.board_rev=E4
    fastboot.cpu=AM654
    fastboot.secure=GP
    fdtaddr=0x82000000
    fdtcontroladdr=fdeca178
    findfdt=setenv name_fdt k3-am654-base-board.dtb;setenv fdtfile ${name_fdt};setenv overlay_files ${name_overlays}
    finduuid=part uuid mmc ${bootpart} uuid
    fit_bootfile=fitImage
    fit_loadaddr=0x90000000
    get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
    get_fdt_ubi=ubifsload ${fdtaddr} ${bootdir}/${name_fdt}
    get_fit_mmc=load mmc ${bootpart} ${fit_loadaddr} ${bootdir}/${fit_bootfile}
    get_kern_mmc=load mmc ${bootpart} ${loadaddr} ${bootdir}/${name_kern}
    get_kern_ubi=ubifsload ${loadaddr} ${bootdir}/${name_kern}
    get_overlay_mmc=fdt address ${fdtaddr};fdt resize 0x100000;for overlay in $overlay_files;do;load mmc ${bootpart} ${overlayaddr} ${bootdir}/${overlay};fdt apply ${overlayaddr};done;
    get_overlaystring=for overlay in $overlay_files;do;setenv overlaystring ${overlaystring}'#'${overlay};done;
    importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
    init_mmc=run args_all args_mmc
    init_ubi=run args_all args_ubi; sf probe; ubi part ospi.rootfs; ubifsmount ubi:rootfs;
    loadaddr=0x80080000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
    loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
    loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadfit=run args_mmc; run run_fit;
    loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadimage; then if test ${boot_fit} -eq 1; then run loadfit; else run mmcloados;fi;fi;fi;
    mmcdev=0
    mmcloados=run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
    mmcrootfstype=ext4 rootwait
    mtdids=nor0=47040000.spi.0
    mtdparts=mtdparts=47040000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),128k(ospi.env),128k(ospi.env.backup),1m(ospi.sysfw),-@8m(ospi.rootfs)
    name_kern=Image
    name_overlays=k3-am654-idk.dtbo
    overlayaddr=0x83000000
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
    partitions_android=uuid_disk=${uuid_gpt_disk};name=bootloader,start=5M,size=8M,uuid=${uuid_gpt_bootloader};name=tiboot3,start=4M,size=1M,uuid=${uuid_gpt_tiboot3};name=boot,start=13M,size=40M,uuid=${uuid_gpt_boot};name=vendor,size=512M,uuid=${uuid_gpt_vendor};name=system,size=2048M,uuid=${uuid_gpt_system};name=userdata,size=-,uuid=${uuid_gpt_userdata}
    rd_spec=-
    rproc_fw_binaries=0 /lib/firmware/am65x-mcu-r5f0_0-fw 1 /lib/firmware/am65x-mcu-r5f0_1-fw
    rproc_load_and_boot_one=if load mmc ${bootpart} $loadaddr ${rproc_fw}; then if rproc load ${rproc_id} ${loadaddr} ${filesize}; then rproc start ${rproc_id};fi;fi
    run_fit=bootm ${fit_loadaddr}#${fdtfile}${overlaystring}
    run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
    serial#=0000000000000129
    soc=k3
    stdin=serial,usbkbd
    update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}
    vendor=ti

    Environment size: 6391/131067 bytes
    =>

    Thanks.

    Eric

  • Hi Eric,

    So you want uboot to be booted from the same location(SDCard I believe and also uEnv.txt from SDCard), whatever you have configured in boot switch and want kernel and filesystems to come from either eMMC or SDCard ?

    One suggestion is to make uenvcmd as a single line. I see two uenvcmd in uEnv.txt, merge them and have as single line command separated with semi-colon(and also add mmc rescan command as below example I have given)

    Also as I mentioned earlier you can print using echo e.g.

    uenvcmd=if run check_psdk_setup;then echo "   " ................;setenv mmcdev 0;setenv bootpart 0:2; mmc rescan; echo Eric's uenvcmd is ${uenvcmd}; echo Eric's bootcmd is ${bootcmd} 

  • Hi Dwarakesh R,

    Yes, no matter where I boot uboot, I want to put two uEnv.txt in both eMMC and SD card.

    In uEnv.txt in eMMC, I want to load filesystem from eMMC.

    In uEnv.txt in SD, I want to load it from SD.

    That's why I want to have 2 uEnv.txt to set different filesystem load location. 

    I modified uEnv.txt again for example and put it into my SD card.

    Please help to check if anything mistake.

    However, I cannot see any echo log from console below.

    So, I doubt if uEnv.txt been loaded or not. 

    Or it's not work in AM65x EVM board?


    U-Boot SPL 2019.01-gd938690-dirty (May 26 2020 - 10:55:49 +0800)
    SYSFW ABI: 2.7 (firmware rev 0x0013 '19.9.0-v2019.09 (Terrific Llama')
    Trying to boot from MMC2
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.2(release):ti2019.05-rc1
    NOTICE: BL31: Built : 03:29:45, Jan 5 2020
    I/TC:
    I/TC: OP-TEE version: ti2019.05-rc1-dev (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #1 Sun Jan 5 03:28:58 UTC 2020 aarch64
    I/TC: Initialized

    U-Boot SPL 2019.01-gd938690-dirty (May 26 2020 - 10:54:36 +0800)
    Detected: AM6-IDKAPPEVM rev E4
    Trying to boot from MMC2


    U-Boot 2019.01-gd938690-dirty (May 26 2020 - 10:54:36 +0800)

    SoC: AM654 PG 1.0
    Model: Texas Instruments AM654 Base Board
    Board: AM6-COMPROCEVM rev E4
    DRAM: 4 GiB
    MMC: sdhci@4f80000: 0, sdhci@04FA0000: 1
    Loading Environment from MMC... OK
    In: serial
    Out: serial
    Err: serial
    Detected: AM6-IDKAPPEVM rev E4
    Net: eth3: pruss1_eth, eth2: pruss0_eth, eth0: cpsw_nuss@046000000, eth1: pruss2_eth
    Hit any key to stop autoboot: 0
    =>
    => print
    arch=arm
    args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 ${mtdparts}
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    args_ubi=setenv bootargs console=${console} ${optargs} rootfstype=ubifs root=ubi0:rootfs rw ubi.mtd=ospi.rootfs
    baudrate=115200
    board=am65x
    board_name=am65x
    board_rev=E4
    board_serial=0129
    board_software_revision=01
    boot=mmc
    boot_fit=0
    boot_rprocs=if test ${dorprocboot} -eq 1 && test ${boot} = mmc; then rproc init;run boot_rprocs_mmc;fi;
    boot_rprocs_mmc=env set rproc_id;env set rproc_fw;for i in ${rproc_fw_binaries} ; do if test -z "${rproc_id}" ; then env set rproc_id $i;else env set rproc_fw $i;run rproc_load_and_boot_one;env set rproc_id;env set rproc_fw;fi;done
    bootargs=androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=am65xevmboard
    bootcmd=run check_dofastboot; run findfdt; run check_android; if test $is_android -eq 1; then run emmc_android_boot; fi; setenv mmcdev 0; setenv bootpart 0:2; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern
    bootdelay=2
    bootdir=/boot
    bootenvfile=uEnv.txt
    bootpart=1:2
    bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
    check_android=setenv mmcdev 0; env delete boot_start; part start mmc ${mmcdev} boot boot_start; if test "$boot_start" = ""; then env set is_android 0; else env set is_android 1; fi; env delete boot_start
    check_dofastboot=if test ${dofastboot} -eq 1; then echo Boot fastboot requested, resetting dofastboot ...;setenv dofastboot 0; env save; echo Booting into fastboot ...; fastboot 0; fi
    console=ttyS2,115200n8
    cpu=armv8
    dfu_alt_info_emmc=rawemmc raw 0 0x800000 mmcpart 1;rootfs part 0 1 mmcpart 0;tiboot3.bin.raw raw 0x0 0x400 mmcpart 1;tispl.bin.raw raw 0x400 0x1000 mmcpart 1;u-boot.img.raw raw 0x1400 0x2000 mmcpart 1;u-env.raw raw 0x3400 0x100 mmcpart 1;sysfw.itb.raw raw 0x3600 0x800 mmcpart 1
    dfu_alt_info_mmc=boot part 1 1;rootfs part 1 2;tiboot3.bin fat 1 1;tispl.bin fat 1 1;u-boot.img fat 1 1;uEnv.txt fat 1 1;sysfw.itb fat 1 1
    dfu_alt_info_ospi=tiboot3.bin raw 0x0 0x080000;tispl.bin raw 0x080000 0x200000;u-boot.img raw 0x280000 0x400000;u-boot-env raw 0x680000 0x020000;sysfw.itb raw 0x6c0000 0x100000;rootfs raw 0x800000 0x3800000
    dfu_bufsiz=0x20000
    dofastboot=0
    dorprocboot=0
    emmc_android_boot=echo Trying to boot Android from eMMC ...; run update_to_fit; setenv eval_bootargs setenv bootargs $bootargs; run eval_bootargs; setenv mmcdev 0; setenv bootpart 0:2mmc dev $mmcdev; mmc rescan; part start mmc ${mmcdev} boot boot_start; part size mmc ${mmcdev} boot boot_size; mmc read ${fit_loadaddr} ${boot_start} ${boot_size}; run get_overlaystring; run run_fit
    envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;
    eth1addr=70:ff:76:1d:5c:bc
    eth2addr=70:ff:76:1d:5c:bd
    eth3addr=70:ff:76:1d:5f:34
    eth4addr=70:ff:76:1d:5f:35
    eth5addr=70:ff:76:1d:5f:36
    eth6addr=70:ff:76:1d:5f:37
    ethaddr=4c:24:98:fc:09:d6
    fastboot.board_rev=E4
    fastboot.cpu=AM654
    fastboot.secure=GP
    fdtaddr=0x82000000
    fdtcontroladdr=fdeca178
    findfdt=setenv name_fdt k3-am654-base-board.dtb;setenv fdtfile ${name_fdt};setenv overlay_files ${name_overlays}
    finduuid=part uuid mmc ${bootpart} uuid
    fit_bootfile=fitImage
    fit_loadaddr=0x90000000
    get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
    get_fdt_ubi=ubifsload ${fdtaddr} ${bootdir}/${name_fdt}
    get_fit_mmc=load mmc ${bootpart} ${fit_loadaddr} ${bootdir}/${fit_bootfile}
    get_kern_mmc=load mmc ${bootpart} ${loadaddr} ${bootdir}/${name_kern}
    get_kern_ubi=ubifsload ${loadaddr} ${bootdir}/${name_kern}
    get_overlay_mmc=fdt address ${fdtaddr};fdt resize 0x100000;for overlay in $overlay_files;do;load mmc ${bootpart} ${overlayaddr} ${bootdir}/${overlay};fdt apply ${overlayaddr};done;
    get_overlaystring=for overlay in $overlay_files;do;setenv overlaystring ${overlaystring}'#'${overlay};done;
    importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
    init_mmc=run args_all args_mmc
    init_ubi=run args_all args_ubi; sf probe; ubi part ospi.rootfs; ubifsmount ubi:rootfs;
    loadaddr=0x80080000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
    loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
    loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadfit=run args_mmc; run run_fit;
    loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadimage; then if test ${boot_fit} -eq 1; then run loadfit; else run mmcloados;fi;fi;fi;
    mmcdev=0
    mmcloados=run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
    mmcrootfstype=ext4 rootwait
    mtdids=nor0=47040000.spi.0
    mtdparts=mtdparts=47040000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),128k(ospi.env),128k(ospi.env.backup),1m(ospi.sysfw),-@8m(ospi.rootfs)
    name_kern=Image
    name_overlays=k3-am654-idk.dtbo
    overlayaddr=0x83000000
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
    partitions_android=uuid_disk=${uuid_gpt_disk};name=bootloader,start=5M,size=8M,uuid=${uuid_gpt_bootloader};name=tiboot3,start=4M,size=1M,uuid=${uuid_gpt_tiboot3};name=boot,start=13M,size=40M,uuid=${uuid_gpt_boot};name=vendor,size=512M,uuid=${uuid_gpt_vendor};name=system,size=2048M,uuid=${uuid_gpt_system};name=userdata,size=-,uuid=${uuid_gpt_userdata}
    rd_spec=-
    rproc_fw_binaries=0 /lib/firmware/am65x-mcu-r5f0_0-fw 1 /lib/firmware/am65x-mcu-r5f0_1-fw
    rproc_load_and_boot_one=if load mmc ${bootpart} $loadaddr ${rproc_fw}; then if rproc load ${rproc_id} ${loadaddr} ${filesize}; then rproc start ${rproc_id};fi;fi
    run_fit=bootm ${fit_loadaddr}#${fdtfile}${overlaystring}
    run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
    serial#=0000000000000129
    soc=k3
    stdin=serial,usbkbd
    update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}
    vendor=ti

    Environment size: 6431/131067 bytes
    =>

    Thanks.

    Eric

  • Hi Dwarakesh R,

    When I look into am65x_evm.h, I didn't see any code as below to load uEvn.txt,

    "bootenv=uEnv.txt\0" \

    Is that necessary to load uEnv.txt?

    Thanks.

    Eric

  • Hi Eric,

    You should allow it to boot. The uenvcmd gets executed as a part of bootcmd. Please don't stop autoboot. I had asked to stop to just get the pri command executed.

  • Hi Dwarakesh R,

    The log is as below.

    Please have a look.


    U-Boot SPL 2019.01-gd938690-dirty (May 26 2020 - 16:13:08 +0800)
    SYSFW ABI: 2.7 (firmware rev 0x0013 '19.9.0-v2019.09 (Terrific Llama')
    Trying to boot from MMC2
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.2(release):ti2019.05-rc1
    NOTICE: BL31: Built : 03:29:45, Jan 5 2020
    I/TC:
    I/TC: OP-TEE version: ti2019.05-rc1-dev (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #1 Sun Jan 5 03:28:58 UTC 2020 aarch64
    I/TC: Initialized

    U-Boot SPL 2019.01-gd938690-dirty (May 26 2020 - 16:17:29 +0800)
    Detected: AM6-IDKAPPEVM rev E4
    Trying to boot from MMC2


    U-Boot 2019.01-gd938690-dirty (May 26 2020 - 16:17:29 +0800)

    SoC: AM654 PG 1.0
    Model: Texas Instruments AM654 Base Board
    Board: AM6-COMPROCEVM rev E4
    DRAM: 4 GiB
    MMC: sdhci@4f80000: 0, sdhci@04FA0000: 1
    Loading Environment from MMC... OK
    In: serial
    Out: serial
    Err: serial
    Detected: AM6-IDKAPPEVM rev E4
    Net: eth3: pruss1_eth, eth2: pruss0_eth, eth0: cpsw_nuss@046000000, eth1: pruss2_eth
    Hit any key to stop autoboot: 0
    switch to partitions #0, OK
    mmc0(part 0) is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    1490 bytes read in 7 ms (207 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc0 ...
    Running uenvcmd ...
    1 bytes read in 2 ms (0 Bytes/s)
    Already setup.
    12644360 bytes read in 79 ms (152.6 MiB/s)
    73168 bytes read in 5 ms (14 MiB/s)
    11325 bytes read in 1 ms (10.8 MiB/s)
    ## Flattened Device Tree blob at 82000000
    Booting using the fdt blob at 0x82000000
    Loading Device Tree to 00000000fddb3000, end 00000000fdec7fff ... OK

    Starting kernel ...

    [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [ 0.000000] Linux version 4.19.79-rt28-g5baf382c8f (oe-user@oe-host) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #1 SMP PREEMPT RT Sun Jan 5 02:57:52 UTC 2020
    [ 0.000000] Machine model: Texas Instruments AM654 Base Board
    [ 0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    [ 0.000000] bootconsole [ns16550a0] enabled
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, size 1 MiB
    [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@a0000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0100000, size 15 MiB
    [ 0.000000] OF: reserved mem: initialized node r5f-memory@a0100000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 1 MiB
    [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@a1000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a1100000, size 15 MiB
    [ 0.000000] OF: reserved mem: initialized node r5f-memory@a1100000, compatible id shared-dma-pool
    [ 0.000000] cma: Reserved 24 MiB at 0x00000000fe800000
    [ 0.000000] psci: probing for conduit method from DT.
    [ 0.000000] psci: PSCIv1.1 detected in firmware.
    [ 0.000000] psci: Using standard PSCI v0.2 function IDs
    [ 0.000000] psci: Trusted OS migration not required
    [ 0.000000] psci: SMC Calling Convention v1.1
    [ 0.000000] random: get_random_bytes called from start_kernel+0x94/0x3ec with crng_init=0
    [ 0.000000] percpu: Embedded 22 pages/cpu s50560 r8192 d31360 u90112
    [ 0.000000] Detected VIPT I-cache on CPU0
    [ 0.000000] CPU features: enabling workaround for ARM erratum 845719
    [ 0.000000] Speculative Store Bypass Disable mitigation not required
    [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 1017344
    [ 0.000000] Kernel command line: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=47040000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),128k(ospi.env),128k(ospi.env.backup),1m(ospi.sysfw),-@8m(ospi.rootfs) root=PARTUUID=87d0789d-02 rw rootfstype=ext4 rootwait
    [ 0.000000] Dentry cache hash table entries: 524288 (order: 11, 8388608 bytes)
    [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
    [ 0.000000] software IO TLB: mapped [mem 0xf9db3000-0xfddb3000] (64MB)
    [ 0.000000] Memory: 3954720K/4134912K available (8190K kernel code, 572K rwdata, 2948K rodata, 576K init, 369K bss, 155616K reserved, 24576K cma-reserved)
    [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
    [ 0.000000] rcu: Preemptible hierarchical RCU implementation.
    [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
    [ 0.000000] rcu: RCU priority boosting: priority 1 delay 500 ms.
    [ 0.000000] No expedited grace period (rcu_normal_after_boot).
    [ 0.000000] Tasks RCU enabled.
    [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
    [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
    [ 0.000000] GICv3: GIC: Using split EOI/Deactivate mode
    [ 0.000000] GICv3: Distributor has no Range Selector support
    [ 0.000000] GICv3: no VLPI support, no direct LPI support
    [ 0.000000] ITS [mem 0x01820000-0x0182ffff]
    [ 0.000000] GIC: enabling workaround for ITS: Socionext Synquacer pre-ITS
    [ 0.000000] ITS@0x0000000001820000: Devices Table too large, reduce ids 20->19
    [ 0.000000] ITS@0x0000000001820000: allocated 524288 Devices @8fa400000 (flat, esz 8, psz 64K, shr 0)
    [ 0.000000] ITS: using cache flushing for cmd queue
    [ 0.000000] GIC: using LPI property table @0x00000008fac30000
    [ 0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000001880000
    [ 0.000000] GIC: using cache flushing for LPI property table
    [ 0.000000] GICv3: CPU0: using LPI pending table @0x00000008fac40000
    [ 0.000000] arch_timer: cp15 timer(s) running at 200.00MHz (phys).
    [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2e2049d3e8, max_idle_ns: 440795210634 ns
    [ 0.000006] sched_clock: 56 bits at 200MHz, resolution 5ns, wraps every 4398046511102ns
    [ 0.000479] Console: colour dummy device 80x25
    [ 0.356858] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=800000)
    [ 0.356867] pid_max: default: 32768 minimum: 301
    [ 0.356986] Security Framework initialized
    [ 0.357092] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes)
    [ 0.357118] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes)
    [ 0.380334] ASID allocator initialised with 32768 entries
    [ 0.432387] rcu: Hierarchical SRCU implementation.
    [ 0.460589] Platform MSI: gic-its@1820000 domain created
    [ 0.466301] PCI/MSI: /interconnect@100000/interrupt-controller@1800000/gic-its@1820000 domain created
    [ 0.480520] smp: Bringing up secondary CPUs ...
    [ 0.541057] Detected VIPT I-cache on CPU1
    [ 0.541093] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000
    [ 0.541103] GICv3: CPU1: using LPI pending table @0x00000008fac50000
    [ 0.541149] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
    [ 0.626829] Detected VIPT I-cache on CPU2
    [ 0.626868] GICv3: CPU2: found redistributor 100 region 0:0x00000000018c0000
    [ 0.626878] GICv3: CPU2: using LPI pending table @0x00000008fac60000
    [ 0.626925] CPU2: Booted secondary processor 0x0000000100 [0x410fd034]
    [ 0.683296] Detected VIPT I-cache on CPU3
    [ 0.683320] GICv3: CPU3: found redistributor 101 region 0:0x00000000018e0000
    [ 0.683328] GICv3: CPU3: using LPI pending table @0x00000008fac70000
    [ 0.683355] CPU3: Booted secondary processor 0x0000000101 [0x410fd034]
    [ 0.683509] smp: Brought up 1 node, 4 CPUs
    [ 0.760954] SMP: Total of 4 processors activated.
    [ 0.765768] CPU features: detected: GIC system register CPU interface
    [ 0.772356] CPU features: detected: 32-bit EL0 Support
    [ 0.778065] CPU: All CPU(s) started at EL2
    [ 0.782274] alternatives: patching kernel code
    [ 0.783757] devtmpfs: initialized
    [ 0.809445] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
    [ 0.819446] futex hash table entries: 1024 (order: 4, 65536 bytes)
    [ 0.826893] pinctrl core: initialized pinctrl subsystem
    [ 0.833473] NET: Registered protocol family 16
    [ 0.839594] vdso: 2 pages (1 code @ (____ptrval____), 1 data @ (____ptrval____))
    [ 0.847166] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
    [ 0.856495] DMA: preallocated 256 KiB pool for atomic allocations
    [ 0.890272] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
    [ 0.900150] SCSI subsystem initialized
    [ 0.904859] media: Linux media interface: v0.10
    [ 0.909563] videodev: Linux video capture interface: v2.00
    [ 0.915220] pps_core: LinuxPPS API ver. 1 registered
    [ 0.920297] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [ 0.929667] PTP clock support registered
    [ 0.933705] EDAC MC: Ver: 3.0.0
    [ 0.938756] Advanced Linux Sound Architecture Driver Initialized.
    [ 0.946047] clocksource: Switched to clocksource arch_sys_counter
    [ 0.952512] VFS: Disk quotas dquot_6.6.0
    [ 0.956595] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
    [ 0.973967] NET: Registered protocol family 2
    [ 0.979216] tcp_listen_portaddr_hash hash table entries: 2048 (order: 5, 131072 bytes)
    [ 0.987481] TCP established hash table entries: 32768 (order: 6, 262144 bytes)
    [ 0.995305] TCP bind hash table entries: 32768 (order: 8, 1835008 bytes)
    [ 1.003993] TCP: Hash tables configured (established 32768 bind 32768)
    [ 1.011037] UDP hash table entries: 2048 (order: 6, 262144 bytes)
    [ 1.017556] UDP-Lite hash table entries: 2048 (order: 6, 262144 bytes)
    [ 1.024773] NET: Registered protocol family 1
    [ 1.029920] RPC: Registered named UNIX socket transport module.
    [ 1.035975] RPC: Registered udp transport module.
    [ 1.040785] RPC: Registered tcp transport module.
    [ 1.045611] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [ 1.053465] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
    [ 1.063560] Initialise system trusted keyrings
    [ 1.068361] workingset: timestamp_bits=46 max_order=20 bucket_order=0
    [ 1.083731] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [ 1.090675] NFS: Registering the id_resolver key type
    [ 1.095893] Key type id_resolver registered
    [ 1.100191] Key type id_legacy registered
    [ 1.104302] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
    [ 1.111401] 9p: Installing v9fs 9p2000 file system support
    [ 1.121973] Key type asymmetric registered
    [ 1.126190] Asymmetric key parser 'x509' registered
    [ 1.131240] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
    [ 1.138809] io scheduler noop registered
    [ 1.142819] io scheduler deadline registered
    [ 1.147349] io scheduler cfq registered (default)
    [ 1.152161] io scheduler mq-deadline registered
    [ 1.156825] io scheduler kyber registered
    [ 1.164065] pinctrl-single 4301c000.pinmux: 70 pins, size 280
    [ 1.170814] pinctrl-single 11c000.pinmux: 185 pins, size 740
    [ 1.176837] pinctrl-single 11c2e8.pinmux: 9 pins, size 36
    [ 1.183737] pinctrl-single a40000.timesync_router: 512 pins, size 2048
    [ 1.206667] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled
    [ 1.235646] brd: module loaded
    [ 1.251312] loop: module loaded
    [ 1.259145] libphy: Fixed MDIO Bus: probed
    [ 1.264191] tun: Universal TUN/TAP device driver, 1.6
    [ 1.270380] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
    [ 1.278440] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
    [ 1.284565] sky2: driver version 1.30
    [ 1.290677] VFIO - User Level meta-driver version: 0.3
    [ 1.297376] i2c /dev entries driver
    [ 1.303172] sdhci: Secure Digital Host Controller Interface driver
    [ 1.309492] sdhci: Copyright(c) Pierre Ossman
    [ 1.314808] sdhci-pltfm: SDHCI platform and OF driver helper
    [ 1.322660] ti-sci interconnect@100000:interconnect@28380000:interconnect@42040000:dmsc: invalid resource
    [ 1.335176] optee: probing for conduit method from DT.
    [ 1.340508] optee: revision 3.7 (5208e5c1)
    [ 1.340929] optee: initialized driver
    [ 1.351392] NET: Registered protocol family 17
    [ 1.356177] 9pnet: Installing 9P2000 support
    [ 1.360644] Key type dns_resolver registered
    [ 1.365956] registered taskstats version 1
    [ 1.370179] Loading compiled-in X.509 certificates
    [ 1.399083] ti-sci interconnect@100000:interconnect@28380000:interconnect@42040000:dmsc: invalid resource
    [ 1.409308] ti-sci interconnect@100000:interconnect@28380000:interconnect@42040000:dmsc: ABI: 2.7 (firmware rev 0x0013 '19.9.0-v2019.09 (Terrific Llama')
    [ 1.449351] random: fast init done
    [ 2.029752] omap_i2c 42120000.i2c: bus 0 rev0.12 at 400 kHz
    [ 2.036436] omap_i2c 40b00000.i2c: bus 1 rev0.12 at 100 kHz
    [ 2.043215] pca953x 2-0041: 2-0041 supply vcc not found, using dummy regulator
    [ 2.050754] pca953x 2-0041: Linked as a consumer to regulator.0
    [ 2.079012] pca953x 2-0021: 2-0021 supply vcc not found, using dummy regulator
    [ 2.086515] pca953x 2-0021: Linked as a consumer to regulator.0
    [ 2.093391] omap_i2c 2000000.i2c: bus 2 rev0.12 at 400 kHz
    [ 2.099892] omap_i2c 2010000.i2c: bus 3 rev0.12 at 400 kHz
    [ 2.106483] omap_i2c 2020000.i2c: bus 4 rev0.12 at 400 kHz
    [ 2.112931] omap_i2c 2030000.i2c: bus 5 rev0.12 at 100 kHz
    [ 2.125019] k3-ringacc 2b800000.ringacc: Ring Accelerator probed rings:286, gp-rings[96,160] sci-dev-id:195
    [ 2.134991] k3-ringacc 2b800000.ringacc: dma-ring-reset-quirk: enabled
    [ 2.141670] k3-ringacc 2b800000.ringacc: RA Proxy rev. 66344100, num_proxies:64
    [ 2.149702] k3-ringacc 3c000000.ringacc: Ring Accelerator probed rings:818, gp-rings[304,464] sci-dev-id:187
    [ 2.159781] k3-ringacc 3c000000.ringacc: dma-ring-reset-quirk: enabled
    [ 2.166461] k3-ringacc 3c000000.ringacc: RA Proxy rev. 66344100, num_proxies:64
    [ 2.174383] omap8250 40a00000.serial: PM domain pd:149 will not be powered off
    [ 2.182331] 40a00000.serial: ttyS1 at MMIO 0x40a00000 (irq = 8, base_baud = 6000000) is a 8250
    [ 2.192369] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 22, base_baud = 3000000) is a 8250
    [ 2.201155] console [ttyS2] enabled
    [ 2.201155] console [ttyS2] enabled
    [ 2.208202] bootconsole [ns16550a0] disabled
    [ 2.208202] bootconsole [ns16550a0] disabled
    [ 2.217843] 2810000.serial: ttyS3 at MMIO 0x2810000 (irq = 23, base_baud = 3000000) is a 8250
    [ 2.227347] 2820000.serial: ttyS4 at MMIO 0x2820000 (irq = 24, base_baud = 3000000) is a 8250
    [ 2.239870] cadence-qspi 47040000.spi: mt35xu512aba (65536 Kbytes)
    [ 2.246080] 7 cmdlinepart partitions found on MTD device 47040000.spi.0
    [ 2.252684] Creating 7 MTD partitions on "47040000.spi.0":
    [ 2.258166] 0x000000000000-0x000000080000 : "ospi.tiboot3"
    [ 2.264892] 0x000000080000-0x000000280000 : "ospi.tispl"
    [ 2.271258] 0x000000280000-0x000000680000 : "ospi.u-boot"
    [ 2.277699] 0x000000680000-0x0000006a0000 : "ospi.env"
    [ 2.283894] 0x0000006a0000-0x0000006c0000 : "ospi.env.backup"
    [ 2.290770] 0x0000006c0000-0x0000007c0000 : "ospi.sysfw"
    [ 2.297125] 0x000000800000-0x000004000000 : "ospi.rootfs"
    [ 2.518483] cadence-qspi 47040000.spi: Cadence QSPI NOR probe failed -517
    [ 2.536651] am65-cpsw-nuss 46000000.ethernet: rx-flow-id-base is not set -22
    [ 2.543752] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss version 0x6BA07100, cpsw version 0x6BA80100 Ports: 2
    [ 2.555426] UDMA has not been proped
    [ 2.559002] am65-cpsw-nuss 46000000.ethernet: Failed to request tx dma channel -517
    [ 2.569438] am65-cpts 310d0000.cpts: CPTS ver 0x4e8a2109, freq:200000000, add_val:4 pps:0
    [ 2.578306] thermal thermal_zone1: failed to read out thermal zone (-22)
    [ 2.585021] thermal thermal_zone2: failed to read out thermal zone (-22)
    [ 2.592775] keystone-wdt 40610000.rti: heartbeat 60 sec
    [ 2.599378] mmc0: Unknown controller version (4). You may experience problems.
    [ 2.638092] mmc0: SDHCI controller on 4f80000.sdhci [4f80000.sdhci] using ADMA 64-bit
    [ 2.646999] mmc1: Unknown controller version (4). You may experience problems.
    [ 2.683172] mmc1: SDHCI controller on 4fa0000.sdhci [4fa0000.sdhci] using ADMA 64-bit
    [ 2.693092] mmc0: new HS200 MMC card at address 0001
    [ 2.699392] mmcblk0: mmc0:0001 S0J56X 14.8 GiB
    [ 2.704842] mmcblk0boot0: mmc0:0001 S0J56X partition 1 31.5 MiB
    [ 2.714865] mmcblk0boot1: mmc0:0001 S0J56X partition 2 31.5 MiB
    [ 2.725219] mmcblk0rpmb: mmc0:0001 S0J56X partition 3 4.00 MiB, chardev (243:0)
    [ 2.737474] pca953x 0-0039: 0-0039 supply vcc not found, using dummy regulator
    [ 2.744817] pca953x 0-0039: Linked as a consumer to regulator.0
    [ 2.752583] mmcblk0: p1 p2
    [ 2.775965] omap-mailbox 31f80000.mailbox: omap mailbox rev 0x66fc5900
    [ 2.783060] omap-mailbox 31f81000.mailbox: omap mailbox rev 0x66fc5900
    [ 2.790866] ti-udma 285c0000.udmap: Channels: 96 (tchan: 48, echan: 0, rchan: 48, rflow: 96)
    [ 2.808853] ti-udma 31150000.udmap: Channels: 267 (tchan: 120, echan: 32, rchan: 150, rflow: 300)
    [ 2.843191] cadence-qspi 47040000.spi: mt35xu512aba (65536 Kbytes)
    [ 2.849390] 7 cmdlinepart partitions found on MTD device 47040000.spi.0
    [ 2.855992] Creating 7 MTD partitions on "47040000.spi.0":
    [ 2.861473] 0x000000000000-0x000000080000 : "ospi.tiboot3"
    [ 2.868265] 0x000000080000-0x000000280000 : "ospi.tispl"
    [ 2.874725] 0x000000280000-0x000000680000 : "ospi.u-boot"
    [ 2.881158] 0x000000680000-0x0000006a0000 : "ospi.env"
    [ 2.887337] 0x0000006a0000-0x0000006c0000 : "ospi.env.backup"
    [ 2.894164] 0x0000006c0000-0x0000007c0000 : "ospi.sysfw"
    [ 2.900548] 0x000000800000-0x000004000000 : "ospi.rootfs"
    [ 2.916197] m25p80 spi7.0: n25q128a13 (16384 Kbytes)
    [ 2.923268] am65-cpsw-nuss 46000000.ethernet: rx-flow-id-base is not set -22
    [ 2.930364] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss version 0x6BA07100, cpsw version 0x6BA80100 Ports: 2
    [ 2.954371] am65-cpsw-nuss 46000000.ethernet: set new flow-id-base 48
    [ 2.969284] pps pps0: new PPS source ptp1
    [ 2.973521] am65-cpsw-nuss 46000000.ethernet: CPTS ver 0x4e8a2109, freq:200000000, add_val:4 pps:1
    [ 2.982471] am65-cpsw-nuss 46000000.ethernet: initialized cpsw ale version 0.4
    [ 2.989683] am65-cpsw-nuss 46000000.ethernet: ALE Table size 64
    [ 3.034088] am65-cpsw-nuss 46000000.ethernet: davinci mdio revision 9.7, bus freq 1000000
    [ 3.042252] libphy: 46000000.ethernet: probed

    Thanks.

    Eric

  • Hi Eric,

    Looks like you have modified and added prints in only the SDCard(MMC1) uEnv.txt. But looks like eMMC(MMC0) uEnv.txt is picked up with below log

    Hit any key to stop autoboot: 0
    switch to partitions #0, OK
    mmc0(part 0) is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    1490 bytes read in 7 ms (207 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc0 ...
    Running uenvcmd ...
    1 bytes read in 2 ms (0 Bytes/s)
    Already setup.

     


    Initial logs that you shared picked up uEnv.txt from SDCard as you can see the same highlighted logs in the below screenshot to be mmc1

    Do you know the difference ? Otherwise you can stop at autoboot and manually set(mmcdev) and check if your script uEnv.txt is loading from mmc1

  • Hi Dwarakesh R.

    Sorry for reply late. I only have EVM board test on Monday.

    Let me clear the question first.

    1.I set the SW to SD boot.

    2.In the uEnv.txt in SD card, I add this.

    And in uEnv.txt in emmc, I add this.

    You can see different debug message between "SD boot" and "emmc boot".

    Then, I boot device and get the log below.

    We can know "Trying to boot from MMC" is due to we set the SW to SD boot. This is no question.

    But, why is log show "Importing environment from mmc0"?

    In my thought, I boot from SD card, and it should load uEnv.txt from SD card, and suppose to see the log

    "Eric: SD boot Already setup!!"

    Please let me know if my question is wrong.

    Thanks.

    Eric

  • Hi Eric,

    The boot switch decides from where to pick the uboot SPL. And before Uenv.txt sets the mmcdev, the same mmcdev from the environment is used for picking he Uenv.txt and it appears to be 0 in even SDCard case. Generally the place where environment saved is also depends on from where the uboot is picked up(either SDCard or eMMC). Can you try the in the above step once to stop the autoboot and set the following

    # setenv mmcdev 1

    # saveenv 

    And try from next time if it picks up correctly. Also please check eMMC case too.

    Does the end customer have the option of selecting the switch(SW) that you changed for SDCard or eMMC ? I am just trying to understand further.

  • Hi Dwarakesh R,

    I got two logs as below.

    1. SW choose SD boot

    2. SW to emmc boot

    You can see the boot partition is no question changed accordingly.

    However, the environment to load uEnv.txt is always mmc0 in both case.

    After I set the command you mentioned, and reboot the EVM board, I always got mmcdev is 0 in both SD and emmc case.

    # setenv mmcdev 1

    # saveenv 

    I doubt if there is any hard code to prevent uEnv.txt overwrite it.

    Thanks.

    Eric

  • Hi Eric,

    You are right. It is hardcoded here for some reason

    bootcmd=run check_dofastboot; run findfdt; run check_android; if test $is_android -eq 1; then run emmc_android_boot; fi; setenv mmcdev 0; setenv bootpart 0:2; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run

    run envboot -> will actually load the uEnv.txt

    You can change it in SDCard boot switch mode as below and give a try:

    # setenv bootcmd 'run check_dofastboot; run findfdt; run check_android; if test $is_android -eq 1; then run emmc_android_boot; fi; setenv mmcdev 1; setenv bootpart 1:2; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run'

    # saveenv

    Can you also let me know how have you planned the end customer to change the boot modes ? Do you have this SD/eMMC switch available for the end customer too for them to change and boot ?

  • Hi Dwarakesh R,

    If it' hardcode here, we must select one boot partition, and can not overwrite it by uEvn.txt. Right?

    In our product, we will not provide switch for user to choose, so that's not a problem.

    My plan is emmc boot will be the default mode.

    And we will use SD boot as backup mode by setting the SW2 and SW3.

    With default emmc mode, uEvn.txt will be load from emmc and run kernel from mmcdev 0.

    under backup mode, uEvn.txt will be load from SD, and run kernel from mmcdev1.

    Do you think it's possible?

    Thanks.

    Eric 

  • Hi Eric,

    This hardcoding can be changed in the code. You can have different booting options and I could think of the following:1

    1. Remove this hardcoding and read the SW2 and SW3 switches in the uboot from CTRLMMR_MAIN_DEVSTAT register and decide to boot from either SDCard or eMMC (if test;then,else)

    2. If you want to use uEnv.txt, then we can reload the uEnv.txt again by reading the CTRLMMR_MAIN_DEVSTAT register ((if test;then,else)) and picking up from the other MMC/eMMC

    3. Maintain 2 uboots, one for SDCard with mmcdev hardcoded for it or eMMC with mmcdev hardcoded for eMMC. This way only switch will decide and load the respective uboots without uEnv.txt