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.

SK-AM62: How to hardcode to boot from backup boot

Part Number: SK-AM62

Hi,

I'm using ti-processor-sdk-linux-am62xx-evm-08.04.01.03, and I need to have backup boot if boot 1 is failed. 

1. I'm able to boot from boot 1 and UDA (backup boot mode) by simply switch the boot mode but It can't boot into kernel and shows the failure.
Below shows my boot up log:

2. U-boot always boot from boot 1.
2.1 The yellow highlighted shows the u-boot from boot 1 which I built on 11 Jul 2023 10:48:32

3. When I erase partition in boot 1, it can boot from UDA, but stuck at R5 SPL:

By refer to boot process below, may I have some guide to hardcode backup boot mode?

  • Hi,

    I cannot see the images. But I recommend using as backup, MMCSD Boot (eMMC boot from UDA) using FS mode. The process to do this should be the following:

    root@am62xx-evm:~# lsblk
    NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    mtdblock0     31:0    0   512K  0 disk 
    mtdblock1     31:1    0     2M  0 disk 
    mtdblock2     31:2    0     4M  0 disk 
    mtdblock3     31:3    0   256K  0 disk 
    mtdblock4     31:4    0   256K  0 disk 
    mtdblock5     31:5    0  55.8M  0 disk 
    mtdblock6     31:6    0   256K  0 disk 
    mmcblk0      179:0    0  29.7G  0 disk 
    mmcblk0boot0 179:32   0  31.5M  1 disk 
    mmcblk0boot1 179:64   0  31.5M  1 disk 
    mmcblk1      179:96   0  58.2G  0 disk 
    |-mmcblk1p1  179:97   0 133.6M  0 part /run/media/mmcblk1p1
    `-mmcblk1p2  179:98   0  58.1G  0 part /
    root@am62xx-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.
    
    Command (m for help): o
    Created a new DOS disklabel with disk identifier 0x850b0832.
    
    Command (m for help): n
    Partition type
       p   primary (0 primary, 0 extended, 4 free)
       e   extended (container for logical partitions)
    Select (default p): p
    Partition number (1-4, default 1): 
    First sector (2048-31080447, default 2048): 
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-31080447, default 31080447): +300M
    
    Created a new partition 1 of type 'Linux' and of size 300 MiB.
    
    Command (m for help): t
    
    Selected partition 1
    Hex code (type L to list all codes): c
    Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.
    
    Command (m for help): a
    
    Selected partition 1
    The bootable flag on partition 1 is enabled now.
    
    Command (m for help): w
    The partition table has been altered.
    [   64.704177]  mmcblk0: p1
    Calling ioctl() to re-read partition table.
    Syncing disks.
    
    root@am62xx-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.
    
    [   66.368502]  mmcblk0: p1
    
    Command (m for help): n
    Partition type
       p   primary (1 primary, 0 extended, 3 free)
       e   extended (container for logical partitions)
    Select (default p): p
    Partition number (2-4, default 2): 2
    First sector (616448-31080447, default 616448): 
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (616448-31080447, default 31080447): 
    
    Created a new partition 2 of type 'Linux' and of size 14.5 GiB.
    
    Command (m for help): w
    The partition table has been altered.
    Calling ioctl() to re-read partition table.
    [   74.282888]  mmcblk0: p1 p2
    Syncing disks.
    [   74.291604]  mmcblk0: p1 p2
    
    root@am62xx-evm:~# lsblk
    NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    mtdblock0     31:0    0   512K  0 disk 
    mtdblock1     31:1    0     2M  0 disk 
    mtdblock2     31:2    0     4M  0 disk 
    mtdblock3     31:3    0   256K  0 disk 
    mtdblock4     31:4    0   256K  0 disk 
    mtdblock5     31:5    0  55.8M  0 disk 
    mtdblock6     31:6    0   256K  0 disk 
    mmcblk0      179:0    0  29.7G  0 disk 
    |-mmcblk0p1  179:1    0   300M  0 part 
    `-mmcblk0p2  179:2    0  29.4G  0 part 
    mmcblk0boot0 179:32   0  31.5M  1 disk 
    mmcblk0boot1 179:64   0  31.5M  1 disk 
    mmcblk1      179:96   0  58.2G  0 disk 
    |-mmcblk1p1  179:97   0 133.6M  0 part /run/media/mmcblk1p1
    `-mmcblk1p2  179:98   0  58.1G  0 part /
    root@am62xx-evm:~# sudo mkfs -t vfat /dev/mmcblk0p1
    mkfs.fat 4.1 (2017-01-24)
    root@am62xx-evm:~# sudo mkfs -t ext4 /dev/mmcblk0p2
    mke2fs 1.45.7 (28-Jan-2021)
    Discarding device blocks: done                            
    Creating filesystem with 7693056 4k blocks and 1925120 inodes
    Filesystem UUID: ba391073-e931-4f90-8156-d19a2d0721b2
    Superblock backups stored on blocks: 
    	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    	4096000
    
    Allocating group tables: done                            
    Writing inode tables: done                            
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done   
    
    root@am62xx-evm:~# ls
    root@am62xx-evm:~# mkdir sdboot
    root@am62xx-evm:~# mkdir sdroot
    root@am62xx-evm:~# mkdir emmcboot
    root@am62xx-evm:~# mkdir emmcroot
    root@am62xx-evm:~# mount /dev/mmcblk1p1 sdboot/
    root@am62xx-evm:~# mount /dev/mmcblk0p1 emmcboot/
    root@am62xx-evm:~# cd sdboot/
    root@am62xx-evm:~/sdboot# ls
    4194304  linux.txt  new.txt  tiboot3-am62x-gp-evm.bin  tiboot3-am62x-hs-evm.bin  tiboot3.bin  tispl.bin  u-boot.img  uEnv.txt  wificfg
    root@am62xx-evm:~/sdboot# cp tiboot3.bin tispl.bin u-boot.img ../emmcboot/
    root@am62xx-evm:~/sdboot# cd ../
    root@am62xx-evm:~# umount emmcboot/
    root@am62xx-evm:~# umount sdboot/
    root@am62xx-evm:~# mount /dev/mmcblk1p2 sdroot
    root@am62xx-evm:~# mount /dev/mmcblk0p2 emmcroot
    [  293.336025] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    root@am62xx-evm:~# cd sdroot
    root@am62xx-evm:~/sdroot# ls
    bin  boot  dev	etc  home  include  init  lib  linuxrc	lost+found  media  mnt	opt  proc  run	sbin  sys  tisdk-base-image-am62xx-evm.tar.xz  tmp  usr  var  www
    root@am62xx-evm:~/sdroot# cd ../emmcroot
    root@am62xx-evm:~/emmcroot# tar xvf ../sdroot/tisdk-base-image-am62xx-evm.tar.xz 
    ............
    tar: ./etc/rc3.d: time stamp 2023-02-24 08:56:47.745388194 is 14215.386930199 s in the future
    tar: ./etc/rc2.d: time stamp 2023-02-24 08:56:47.689388374 is 14215.330874409 s in the future
    tar: ./etc/rc1.d: time stamp 2023-02-24 08:56:47.881387756 is 14215.522815836 s in the future
    tar: ./etc/rc0.d: time stamp 2023-02-24 08:56:47.861387821 is 14215.502757786 s in the future
    tar: ./etc: time stamp 2023-02-24 08:57:20.789281837 is 14248.430593877 s in the future
    tar: ./bin: time stamp 2023-02-24 08:56:25.965458296 is 14193.606711766 s in the future
    tar: .: time stamp 2023-02-24 08:54:22.205856637 is 14069.847050247 s in the future
    root@am62xx-evm:~/emmcroot# 
    root@am62xx-evm:~/emmcroot# cd ../
    root@am62xx-evm:~# ls
    emmcboot  emmcroot  sdboot  sdroot
    root@am62xx-evm:~# umount emmcroot
    root@am62xx-evm:~# umount sdroot
    root@am62xx-evm:~# lsblk
    NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    mtdblock0     31:0    0   512K  0 disk 
    mtdblock1     31:1    0     2M  0 disk 
    mtdblock2     31:2    0     4M  0 disk 
    mtdblock3     31:3    0   256K  0 disk 
    mtdblock4     31:4    0   256K  0 disk 
    mtdblock5     31:5    0  55.8M  0 disk 
    mtdblock6     31:6    0   256K  0 disk 
    mmcblk0      179:0    0  14.8G  0 disk 
    |-mmcblk0p1  179:1    0   300M  0 part 
    `-mmcblk0p2  179:2    0  14.5G  0 part 
    mmcblk0boot0 179:32   0  31.5M  1 disk 
    mmcblk0boot1 179:64   0  31.5M  1 disk 
    mmcblk1      179:96   0  14.6G  0 disk 
    |-mmcblk1p1  179:97   0 133.6M  0 part /run/media/mmcblk1p1
    `-mmcblk1p2  179:98   0  14.4G  0 part /
    root@am62xx-evm:~# 
    root@am62xx-evm:~# fdisk -l
    ........
    
    Disk /dev/mmcblk0: 14.84 GiB, 15913189376 bytes, 31080448 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: dos
    Disk identifier: 0x32874f10
    
    Device         Boot  Start      End  Sectors  Size Id Type
    /dev/mmcblk0p1 *      2048   616447   614400  300M  c W95 FAT32 (LBA)
    /dev/mmcblk0p2      616448 31080447 30464000 14.5G 83 Linux
    
    
    Disk /dev/mmcblk1: 14.57 GiB, 15634268160 bytes, 30535680 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: dos
    Disk identifier: 0xc879998c
    
    Device         Boot  Start      End  Sectors   Size Id Type
    /dev/mmcblk1p1 *      2048   275571   273524 133.6M  c W95 FAT32 (LBA)
    /dev/mmcblk1p2      276480 30535679 30259200  14.4G 83 Linux
    root@am62xx-evm:~# 
    U-Boot SPL 2021.01-g2ee8efd654 (Feb 24 2023 - 05:59:23 +0000)
    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 MMC2
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Loading Environment from MMC... *** Warning - No MMC card found, using default environment
    
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
    NOTICE:  BL31: Built : 05:06:58, Feb 24 2023
    
    U-Boot SPL 2021.01-g2ee8efd654 (Feb 24 2023 - 05:29:33 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
    Trying to boot from MMC2
    Authentication passed
    Authentication passed
    
    
    U-Boot 2021.01-g2ee8efd654 (Feb 24 2023 - 05:29:33 +0000)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62B-SKEVM-P1 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-P1 in eeprom header
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0 
    => mmc partconf 0 1 7 1
    => mmc bootbus 0 2 0 0
    => 
    
    U-Boot SPL 2021.01-g2ee8efd654 (Feb 24 2023 - 05:59:23 +0000)
    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-g2fcd408bb3-dirty
    NOTICE:  BL31: Built : 05:06:58, Feb 24 2023
    
    U-Boot SPL 2021.01-g2ee8efd654 (Feb 24 2023 - 05:29:33 +0000)
    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-g2ee8efd654 (Feb 24 2023 - 05:29:33 +0000)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62B-SKEVM-P1 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-P1 in eeprom header
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0 
    =>
    => setenv bootpart 0:2
    => mmc dev 0
    switch to partitions #0, OK
    mmc0(part 0) is current device
    => boot
    MMC: no card present
    SD/MMC found on device 1
    MMC: no card present
    MMC: no card present
    19147264 bytes read in 110 ms (166 MiB/s)
    55666 bytes read in 4 ms (13.3 MiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 000000008feef000, end 000000008fffffff ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 5.10.168-g2c23e6c538 (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.20191209) #1 SMP PREEMPT Fri Feb 24 05:59:04 UTC 2023
    [    0.000000] Machine model: Texas Instruments AM625 SK
    [    0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    [    0.000000] printk: bootconsole [ns16550a0] enabled
    [    0.000000] efi: UEFI not found.
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009c800000, size 3 MiB
    [    0.000000] OF: reserved mem: initialized node ipc-memories@9c800000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009cb00000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node m4f-dma-memory@9cb00000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009cc00000, size 14 MiB
    [    0.000000] OF: reserved mem: initialized node m4f-memory@9cc00000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009da00000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9da00000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009db00000, size 12 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@9db00000, compatible id shared-dma-pool
    [    0.000000] Zone ranges:
    [    0.000000]   DMA      [mem 0x0000000080000000-0x00000000ffffffff]
    [    0.000000]   DMA32    empty
    [    0.000000]   Normal   empty
    [    0.000000] Movable zone start for each node
    [    0.000000] Early memory node ranges
    [    0.000000]   node   0: [mem 0x0000000080000000-0x000000009c7fffff]
    [    0.000000]   node   0: [mem 0x000000009c800000-0x000000009e6fffff]
    [    0.000000]   node   0: [mem 0x000000009e700000-0x000000009e77ffff]
    [    0.000000]   node   0: [mem 0x000000009e780000-0x000000009fffffff]
    [    0.000000]   node   0: [mem 0x00000000a0000000-0x00000000ffffffff]
    .........
    [  OK  ] Started File System Check on /dev/mmcblk0p1.
             Mounting /run/media/mmcblk0p1...
    [  OK  ] Mounted /run/media/mmcblk0p1.
    
     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            
    
    Arago Project am62xx-evm ttyS2
    
    Arago 2021.09 am62xx-evm ttyS2
    
    am62xx-evm login: root
    root@am62xx-evm:~# fdisk -l
    .....
    Disk /dev/mmcblk0: 14.84 GiB, 15913189376 bytes, 31080448 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: dos
    Disk identifier: 0x32874f10
    
    Device         Boot  Start      End  Sectors  Size Id Type
    /dev/mmcblk0p1 *      2048   616447   614400  300M  c W95 FAT32 (LBA)
    /dev/mmcblk0p2      616448 31080447 30464000 14.5G 83 Linux
    root@am62xx-evm:~# lsblk
    -sh: lsblk: command not found
    root@am62xx-evm:~# 


    I have not tested on 8.5 SDK, but have heard no issues for eMMC on 08.05. Let me know if you do run into any issues.

    ~ Judith