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.

AM6442: fail to boot from emmc

Part Number: AM6442

Hi ,

We have an am6442 board and getting error "** Unrecognized filesystem type **"when trying to boot from emmc.

Please find the log below

**********************************************************

ERROR

=> setenv mmcdev 0
=> setenv bootpart 0:1
=> saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
=> boot
switch to partitions #0, OK
mmc0(part 0) is current device
SD/MMC found on device 0
** Unrecognized filesystem type **
Bad Linux ARM64 Image magic!

*************************************************************

Please find below the output of partitions and mmc commands

***********************************************************************

=> mmc list
sdhci@fa10000: 0 (eMMC)
sdhci@fa00000: 1
=> mmc part

Partition Map for MMC device 0  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000800      0x0766ffde      ""
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   9f74cc9b-7a4e-1940-a4eb-b6cb4e806673
=> printenv partitions
partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
=> 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}
baudrate=115200
board=am64x
board_name=am64x_gpevm
boot=mmc
boot_fdt=try
bootargs=console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),57088k@8m(ospi.rootfs),256k(ospi.phypattern) root=PARTUUID=9f74cc9b-7a4e-1940-a4eb-b6cb4e806673 rw rootfstype=ext4 rootwait
bootcmd=run findfdt; run envboot; run init_${boot}; run get_kern_${boot}; run get_fdt_${boot}; run run_kern
bootdelay=2
bootdir=/boot
bootenvfile=uEnv.txt
bootm_size=0x10000000
bootpart=0:1
bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
console=ttyS2,115200n8
cpu=armv8
dtboaddr=0x89000000
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;
ethaddr=f4:84:4c:f9:5e:3a
fdt_addr_r=0x88000000
fdtaddr=0x88000000
fdtcontroladdr=fdef5e38
fdtfile=k3-am642-evm.dtb
findfdt=if test $board_name = am64x_gpevm; then setenv fdtfile k3-am642-evm.dtb; fi; if test $board_name = am64x_skevm; then setenv fdtfile k3-am642-sk.dtb; fi;if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
finduuid=part uuid mmc ${bootpart} uuid
get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
get_fit_mmc=load mmc ${bootpart} ${addr_fit} ${bootdir}/${name_fit}
get_kern_mmc=load mmc ${bootpart} ${loadaddr} ${bootdir}/${name_kern}
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;
importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
init_mmc=run args_all args_mmc
ipaddr=192.168.2.25
kernel_addr_r=0x82000000
loadaddr=0x82000000
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
mmcboot=mmc dev ${mmcdev}; devnum=${mmcdev}; setenv devtype mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadimage; then run args_mmc; if test ${boot_fit} -eq 1; then run run_fit; else run mmcloados;fi;fi;fi;
mmcdev=0
mmcloados=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=fc40000.spi.0
mtdparts=mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),57088k@8m(ospi.rootfs),256k(ospi.phypattern)
name_kern=Image
optargs=earlycon=ns16550a,mmio32,0x02800000 mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),57088k@8m(ospi.rootfs),256k(ospi.phypattern)
partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
pxefile_addr_r=0x80100000
ramdisk_addr_r=0x88080000
rd_spec=-
rdaddr=0x88080000
run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
scriptaddr=0x80000000
serial#=0000000000000000
serverip=192.168.2.44
soc=k3
stderr=serial@2800000
stdin=serial@2800000
stdout=serial@2800000
uuid=9f74cc9b-7a4e-1940-a4eb-b6cb4e806673
vendor=ti

Environment size: 3719/131068 bytes

***************************************************************************************************************************

Any help is appreciated.NEed to solve this as soon as possible.

Thanks and Regards,

Radhika

  • Hi Radhika,

    Can you please provide the details of how the eMMC is programmed?

  • Hi Bin Liu,
    Thanks for your reply.
    The steps we tried for programming the emmc is as below
    ******************************************************
        1. Copy the <tisdk-filesystem.tar.xz> to <nfs_root_folder>/home/root in
            the NFS server and replace the Image and dtb file in the
                "/boot" folder of the <tisdk-filesystem.tar.xz> with the latest
                files.
       
       2. Boot the board via NFS boot
        3. Login and run the following commands from the board,

            $ fdisk /dev/mmcblk0

                a. Enter “p” to display current partitions
                b. Enter “n” to create a new partition (or enter “d” first to
                     delete existing partitions)
                c. Use default for all the options (press enter for all options)
                d. Enter “w” to write table to disk and exit

            $ mkfs.ext4 /dev/mmcblk0p1      
            $ mkdir /mnt/temp
            $ mount -t ext4 /dev/mmcblk0p1 /mnt/temp
            $ cd /mnt/temp
            $ tar xvf ~/<tisdk-filesystem.tar.xz>
            $ cd /mnt
            $ umount temp

        4. Restart the board

        5. From U-boot console, run the following commands

            $ env default -a
            $ setenv mmcdev 0
            $ setenv bootpart 0:1
            $ saveenv

        6. Reboot the board or run "boot" from the U-boot console
    **************************************************************************************
    Thanks and Regards,
    Radhika
  • Hello Radhika,

    From what you described, it seems to me that you didn't program U-Boot to eMMC. Is that right?

    Thanks and regards,

    Jianzhong

  • Hi Jianzhong,

    Thanks for your reply.

    We have loaded the uboot and the initial loaders in the qspi and loading rootfs from emmc.

    Could you please suggest if there is any issue in this.

    We can boot succesfully by nfs boot but getting issue while booting from emmc.

    Thanks and Regards,

    Radhika

  • Hi Radhika,

    You'll need to flash the U-Boot to eMMC boot0 partition. Please follow the steps listed below to do that:

    1. Boot your board to Linux by nfs.

    2. Enable write access to boot0 partition. Please refer to Linux kernel documentation regarding this. Use the command below to enable write access:

     # echo 0 > /sys/block/mmcblk0boot0/force_ro

    3. Copy the U-Boot binaries from <Processor SDK folder>/boardsupport/prebuilt-images on the host to your board:

    • tiboot3.bin
    • tispl.bin
    • u-boot.img

    4. Use command ``dd`` to write the binaries to eMMC boot0. Please refer to eMMC layout for offset numbers for dd command.

        # dd if=tiboot3.bin of=/dev/mmcblk0boot0 seek=0
        # dd if=tispl.bin of=/dev/mmcblk0boot0 seek=1024
        # dd if=u-boot.img of=/dev/mmcblk0boot0 seek=5120
    

    Then proceed to steps 4, 5, and 6 of the procedure you described earlier. Your board should be able to boot from eMMC now.

    By the way, which version of the Processor SDK do you have? The latest version (8.0) has some issues with saving the boot env.

    Regards,

    Jianzhong

  • , does QSPI (tiboot3.bin, tispl.bin & u-boot.img) + eMMC (RFS containing the DTB and kernel image) boot require these steps ?

  • Hi Jianzhong,

    Thanks for your reply. We tried this steps but getting the same errors.No change in the errors.

    Is there any other steps to resolve this issue.

    Thanks and Regards,

    Radhika

  • Hi Jianzhong,

    While doing the steps you mentioned, we are also getting the error below.

    Is there any way to resolve this.

    ************************************************************************************

    root@am64xx-evm:/# dd if=tispl.bin of=/dev/mmcblk0boot0 seek=1024
    1376+1 records in
    1376+1 records out
    [  960.726361] mmc0: running CQE recovery
    root@am64xx-evm:/# [  960.742326] mmc0: running CQE recovery
    [  960.758312] mmc0: running CQE recovery
    [  960.762394] blk_update_request: I/O error, dev mmcblk0boot0, sector 512 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
    [  960.786331] mmc0: running CQE recovery
    [  960.802319] mmc0: running CQE recovery
    [  960.818317] mmc0: running CQE recovery
    [  960.822252] blk_update_request: I/O error, dev mmcblk0boot0, sector 512 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
    [  960.833430] Buffer I/O error on dev mmcblk0boot0, logical block 4, async page read

    *************************************************************************************************

    Thanks and Regards,

    Radhika

  • Hi Radhika,

    Looks like the "dd" command had some errors. Did command "echo 0 > /sys/block/mmcblk0boot0/force_ro" execute successfully? 

    Thanks,

    Jianzhong

  • Hi Jianzhong,

    We are getting this error while doing the echo command and also in the dmesg output.

    We are using linux 5.10.

    Please find the logs of dmesg and echo below.

    ****************************************************************************************

    root@am64xx-evm:~# dmesg | grep -ri CQE
    [   15.883234] mmc0: running CQE recovery
    [   15.907729] mmc0: running CQE recovery
    [   15.930362] mmc0: running CQE recovery
    [   16.018218] mmc0: running CQE recovery
    [   16.042181] mmc0: running CQE recovery
    [   16.066253] mmc0: running CQE recovery
    [   16.125356] mmc0: running CQE recovery
    [   16.147171] mmc0: running CQE recovery
    [   16.172714] mmc0: running CQE recovery
    [   20.929880] mmc0: running CQE recovery

    -----------------------------------------------------------------


    root@am64xx-evm:~# dmesg | grep -ri error
    [    0.980435] pca953x: probe of 3-0022 failed with error -121
    [    1.198489] spi-nor: probe of spi0.0 failed with error -2
    [   10.980226] rti-wdt: probe of bus@f4000:watchdog@e000000 failed with error -22
    [   11.079701] rti-wdt: probe of bus@f4000:watchdog@e010000 failed with error -22
    [   11.182020] remoteproc remoteproc12: Direct firmware load for am64-main-r5f0_0-fw failed with error -2
    [   11.201941] remoteproc remoteproc12: Direct firmware load for am64-main-r5f0_0-fw failed with error -2
    [   11.354174] remoteproc remoteproc13: Direct firmware load for am64-main-r5f0_1-fw failed with error -2
    [   11.372329] remoteproc remoteproc13: Direct firmware load for am64-main-r5f0_1-fw failed with error -2
    [   11.608054] remoteproc remoteproc14: Direct firmware load for am64-main-r5f1_0-fw failed with error -2
    [   11.627149] remoteproc remoteproc14: Direct firmware load for am64-main-r5f1_0-fw failed with error -2
    [   11.803321] remoteproc remoteproc15: Direct firmware load for am64-main-r5f1_1-fw failed with error -2
    [   11.820417] remoteproc remoteproc15: Direct firmware load for am64-main-r5f1_1-fw failed with error -2
    [   15.934624] blk_update_request: I/O error, dev mmcblk0boot0, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
    [   16.071116] blk_update_request: I/O error, dev mmcblk0boot0, sector 512 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
    [   16.177831] blk_update_request: I/O error, dev mmcblk0boot0, sector 512 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
    [   16.190647] Buffer I/O error on dev mmcblk0boot0, logical block 4, async page read
    root@am64xx-evm:~#

    ----------------------------------------------------------------------------

    root@am64xx-evm:~# echo 0 > /sys/block/mmcblk0boot0/force_ro
    root@am64xx-evm:~# [ 1767.656907] mmc0: running CQE recovery
    [ 1767.673496] mmc0: running CQE recovery
    [ 1767.690583] mmc0: running CQE recovery
    [ 1767.694529] blk_update_request: I/O error, dev mmcblk0boot0, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
    [ 1767.717967] mmc0: running CQE recovery
    [ 1767.733953] mmc0: running CQE recovery
    [ 1767.749955] mmc0: running CQE recovery
    [ 1767.753900] blk_update_request: I/O error, dev mmcblk0boot0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
    [ 1767.764550] Buffer I/O error on dev mmcblk0boot0, logical block 0, async page read

    ***************************************************************************

    Thanks and Regards,

    Radhika

  • Radhika,

    This seems indicating some problem with the eMMC. Let me check internally and get back to you.

    Regards,

    Jianzhong

  • Hi Jianzhong,

    Thank you for your response.Were you able to get any update on the issue?

    Could you please help us solve this issue asap .

    Thanks and Regards,

    Radhika

  • does QSPI (tiboot3.bin, tispl.bin & u-boot.img) + eMMC (RFS containing the DTB and kernel image) boot require these steps ?

    QSPI (U-Boot) + eMMC (RFS) should work without programming U-Boot to eMMC.

    ** Unrecognized filesystem type **
    Bad Linux ARM64 Image magic!

    This indicates the Linux rfs was not written to eMMC user partition properly. When you did "tar xvf ~/<tisdk-filesystem.tar.xz>" to eMMC partition 1, was there any error? Can you double check if the rfs is in partition 1? 

    I assume this is your custom board. There may be some problems in your eMMC which prompted the driver to do CQE recovery.

    Regards,

    Jianzhong

  • Hi Jianzhong,

    I deleted the partition and created again and untarred the file.But still getting the same error.

    Please find the fdisk output .

    Any help is appreciated.

    ******************************************************************

    ./var/tmp
    ./var/volatile/
    root@am64xx-evm:/mnt/temp# ls -rtl
    drwxrwxrwt    2 root     root          4096 Aug 10 21:45 tmp
    dr-xr-xr-x    2 root     root          4096 Aug 10 21:45 sys
    dr-xr-xr-x    2 root     root          4096 Aug 10 21:45 proc
    drwxr-xr-x    2 root     root          4096 Aug 10 21:45 mnt
    drwxr-xr-x    2 root     root          4096 Aug 10 21:45 media
    drwxr-xr-x    2 root     root          4096 Aug 10 21:45 dev
    drwx------    2 root     root         16384 Aug 10 22:08 lost+found
    drwxr-xr-x    2 root     root          4096 Aug 10 22:09 boot
    drwxr-xr-x    3 root     root          4096 Aug 10 22:09 home
    drwxr-xr-x    9 root     root          4096 Aug 10 22:09 lib
    drwxr-xr-x   10 root     root          4096 Aug 10 22:09 usr
    drwxr-xr-x    8 root     root          4096 Aug 10 22:10 var
    drwxr-xr-x    2 root     root          4096 Aug 10 22:10 sbin
    lrwxrwxrwx    1 root     root            19 Aug 10 22:10 linuxrc -> /bin/busybox.nosuid
    lrwxrwxrwx    1 root     root            20 Aug 10 22:10 init -> /lib/systemd/systemd
    drwxr-xr-x   35 root     root          4096 Aug 10 22:10 etc
    drwxr-xr-x    2 root     root          4096 Aug 10 22:10 bin
    drwxr-xr-x    2 root     root          4096 Aug 10 22:21 run
    root@am64xx-evm:/mnt/temp# cd boot
    root@am64xx-evm:/mnt/temp/boot# ls -rtl
    -rw-r--r--    1 root     root       8993739 Aug 10 21:57 vmlinux.gz-5.10.41-g4c2eade9f7
    -rw-r--r--    1 root     root         50833 Aug 10 21:57 k3-am642-sk.dtb
    -rw-r--r--    1 root     root         53223 Aug 10 21:57 k3-am642-evm.dtb
    -rw-r--r--    1 root     root          2284 Aug 10 21:57 k3-am642-evm-icssg1-dualemac.dtbo
    -rw-r--r--    1 root     root      19137024 Aug 10 21:57 Image-5.10.41-g4c2eade9f7
    lrwxrwxrwx    1 root     root            25 Aug 10 22:09 Image -> Image-5.10.41-g4c2eade9f7
    lrwxrwxrwx    1 root     root            30 Aug 10 22:09 vmlinux.gz -> vmlinux.gz-5.10.41-g4c2eade9f7

    root@am64xx-evm:~# fdisk /dev/mmcblk0

    Welcome to fdisk (util-linux 2.35.1).
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.

    [  384.748902]  mmcblk0: p1

    Command (m for help): p
    Disk /dev/mmcblk0: 59.22 GiB, 63585648640 bytes, 124190720 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: 2427F22F-4FC7-4409-B994-80B43619E365

    Device         Start       End   Sectors  Size Type
    /dev/mmcblk0p1  2048 124190686 124188639 59.2G Linux filesystem

    *********************************************************************

    Thanks and Regards,

    Radhika

  • Hi Jianzhong,

    Thanks for your reply.

    We are using Hynix chip.Could you please let us know if there is any chip settings required for this?

    Thanks and Regards,

    Radhika

  • Hi Radhika,

    I'm not sure about that particular chip.

    Which version of the SDK are you using? I noticed that you were able to save the boot env. For SDK 8.0.0.21, "saveenv" is not working. Did you do anything to make "saveenv" work?

    I was able to boot from eMMC on my AM64x GP EVM. I also got the message "Unrecognized filesystem type", but not "Bad Linux ARM64 Image magic!". Do you have a GP EVM to try SDK 8.0.0.21?

    => setenv mmcdev 0
    => setenv bootpart 0:1
    => boot
    switch to partitions #0, OK
    mmc0(part 0) is current device
    SD/MMC found on device 0
    Failed to load 'boot.scr'
    ** Unrecognized filesystem type **
    19137024 bytes read in 62 ms (294.4 MiB/s)
    53223 bytes read in 4 ms (12.7 MiB/s)
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 000000008fff0000, end 000000008fffffe6 ... OK
    
    Starting kernel ...
    
    
    [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [ 0.000000] Linux version 5.10.41-g4c2eade9f7 (oe-user@oe-host) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 9.2.1 20191025, GNU ld (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 2.33.1.2

    Regards,

    Jianzhong

  • Hi Jianzhong,

    Thanks for you response.

    We are using uboot from sdk 7.03.00.001 and linux from sdk 8.0.0.21.

    When we solved the rfs problem , we are still stcuk when booting from emmc with the errors below,

    Any help is appreciated

    ********************************************************

    U-Boot 2020.01-00016-ge995ed0ec1-dirty (Sep 12 2021 - 10:32:35 +0530)

    SoC:   AM64X SR1.0
    Model: Texas Instruments AM642 EVM
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed 1
    DRAM:  2 GiB
    not found for dev mux
    MMC:   sdhci@fa10000: 0, sdhci@fa00000: 1
    Loading Environment from MMC... OK
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed 1
    Net:   eth0: ethernet@8000000
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0(part 0) is current device
    SD/MMC found on device 0
    ** Unrecognized filesystem type **
     ** fs_devread read error - block
    ** No partition table - mmc 0 **
    ERROR: Did not find a cmdline Flattened Device Tree

    Starting kernel ...

    unable to select a mode
    device_remove: Device 'sdhci@fa10000.blk' failed to remove, but children are gone
    "Synchronous Abort" handler, esr 0x02000000
    elr: 0000000003802000 lr : 00000000808024e8 (reloc)
    elr: 0000000082f20000 lr : 00000000fff204e8
    x0 : 0000000000000000 x1 : 0000000000000000
    x2 : 0000000000000000 x3 : 0000000000000000
    x4 : 0000000082000000 x5 : 0000000000000001
    x6 : 0000000000000008 x7 : 0000000000000000
    x8 : 00000000fdef5e38 x9 : 0000000000000002
    x10: 000000000a200023 x11: 0000000000000002
    x12: 0000000000000002 x13: 00000000fdefddee
    x14: 0000000000000000 x15: 00000000fff1fa1c
    x16: 00000000fff5895c x17: 0000000000000000
    x18: 00000000fdefddd8 x19: 00000000fffe0b50
    x20: 0000000000000000 x21: 0000000000000400
    x22: 0000000000000003 x23: 00000000fdf0ced8
    x24: 00000000fdf0ced8 x25: 00000000fffc9de0
    x26: 0000000000000000 x27: 00000000fff20510
    x28: 00000000fdf0cf00 x29: 00000000fdef55a0

    Code: a5a5a5a5 a5a5a5a5 a5a5a5a5 a5a5a5a5 (ffffffff)
    Resetting CPU ...

    resetting ...

    *******************************************************************

    Thanks and Regards,

    Radhika

  • Hi Radhika,

    I would recommend you to first validate the procedure on an AM64x GP EVM, and then try it on your custom board.

    Regards,

    Jianzhong