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: AM62x - Backup Boot with SPI

Part Number: SK-AM62

Hello,

I have some questions regarding backup boot on the AM62x using the SK-AM62 evaluation board. I have my board configured for primary boot with eMMC and backup boot with SPI. I'm able to use primary boot to boot from either media source but when I change the switches to use SPI as the backup boot, corrupt the tiboot3.bin file on eMMC and restart my board nothing happens. 

I'm writing the Uboot files to the SPI flash using USB DFU as described here:

https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/08_06_00_42/exports/docs/linux/Foundational_Components/U-Boot/UG-DFU.html

and here

https://u-boot.readthedocs.io/en/latest/usage/dfu.html

Then I issue the following commands to write the Uboot files to the SPI flash:

setenv dfu_alt_info ${dfu_alt_info_ospi}
sf probe
sf erase 0x0 0x4000000
dfu 0 sf "0:0:25000000:0"
.\dfu-util.exe -a 0 -D .\tiboot3.bin
.\dfu-util.exe -a 1 -D .\tispl.bin
.\dfu-util.exe -a 2 -D .\u-boot.img

Then I change the backup boot pins to the following according to Table 5-5 in the AM62 TRM:

B10 - 0, B11 - 1, B12 - 1

I know the Uboot files are good because I can boot from SPI in primary boot using the boot mode pins described here: https://software-dl.ti.com/mcu-plus-sdk/esd/AM62X/08_06_00_18/exports/docs/api_guide_am62x/EVM_SETUP_PAGE.html#BOOTMODE_OSPI

Do you have any recommendations as to what I can try to get SPI backup boot working? Am I using USB DFU correctly to write the Uboot files to the SPI flash so it works in backup mode? Are any modifications needed to k3_dfu.h or to k3-am62x-lp-sk.dts?  Thank you for your help.

  • Dan,

    Have you tried SPI mode boot with primary boot, which is distinctively different than xSPI or OSPI. Primary boot for SPI mode additionally allows you to configure the CS and Mode, but these are not configurable for backup boot for SPI mode. I think, but not 100% sure, the fixed values are mode 0 and CS0 in SPI backup bootmode.

    On the SK-AM62, the SPI FLASH is connect to CS0.

    Thanks,

    Stuart

  • Dear Stuart,

    Thanks for your quick reply. I just tried booting from SPI with with the following settings according to Table 5-4:

    B3-1, B4-1, B5-0, B6-0, B7-0, B8-0

    As you mentioned CS should be 0for B7 and I used Mode as 0 for B8 and Uboot came up saying that it's trying to boot from SPI:

    U-Boot SPL 2021.01-dirty (Apr 24 2023 - 11:44:02 -0400)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
    Trying to boot from SPI

    From,

    Daniel Fettke

  • Dear Stuart and Experts,

    I've been experimenting with the boot modes and I was finally able to boot into SPI as backup. Originally I was using eMMC Boot using UDA in filesystem mode on port 0

    B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3
    X 1 1 0 0 x 0 1 0 0 0

    but when I switched to eMMC Boot (alternate) then SPI backup boot starting working.

    B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3
    X 1 1 0 x x x 1 0 0 1

    Using eMMC Boot using UDA as the primary boot, the AM62x can boot QNX after I format the eMMC for a FAT32 type 11 partition. However I cannot boot into QNX when I switch over to eMMC bootmode (alternate). I see tiboot3.bin in U-Boot below:

    => fatls mmc 0:1
    936588 tispl.bin
    895732 u-boot.img
    332453 tiboot3.bin

    3 file(s), 0 dir(s)

    => mmc part

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

    Part Start Sector Num Sectors UUID Type
    1     32                411616          00000000-01 0b Boot
    2     411648        30668800      00000000-02 b1

    I have several questions that I could not answer reading chapter 5 of the AM62x TRM:

    1) Why does the AM62x not recognize the SPI backup (or SD Card backup that I've also tested) when the primary boot is set to eMMC Boot using UDA?

    2) What is the criteria that is used by the eMMC bootmode (alternate) that allows it to be the primary boot that is different than eMMC boot using UDA? As I mentioned I can use eMMC boot using UDA but not eMMC bootmode (alternate).

    Thanks,

    Daniel Fettke

  • Hello Dan,
    We missed your early response, and we're looking into it now.

    Using eMMC Boot using UDA as the primary boot, the AM62x can boot QNX after I format the eMMC for a FAT32 type 11 partition

    Will you share 1/. the "qnx-ifs" file, 2/. the working log you tested booting QNX from eMMC UDA on AM62x-SK?
    Best,
    -Hong

  • Dear Hong,

    Thank you for your reply and help with this issue. I'll check with Todd or Stuart how to get those files to you. To clarify, the issue I'm seeing isn't with the qnx-ifs, it is with getting the TI ROM or U-Boot to see that tiboot3.bin doesn't exist or is corrupted on eMMC UDA and to boot off of the SPI backup. I'm using an SK-AM62 E3 EVM board. Thanks again.

    From,

    Daniel Fettke

  • Hello Dan,
    My understanding is you're exploring a robust boot strategy based on combination of primary boot media (+redundancy) + secondary boot media.
    One of failure case in your test: a/. it is possible to move to secondary boot media (SPI) after booting from primary boot media (eMMC boot partition) fails, but b/. booting u-boot binary from eMMC boot partition works, but loading QNX (qnc-ifs) fails... I want to look into the non-working case b/. once I have the "qnx-ifs" you tested working when booting from eMMC UDA.
    BTW, I updated the related e2e.
    e2e.ti.com/.../4647169
    Best,
    -Hong

  • Dear Hong,

    Thanks, you are correct that we are looking at a robust boot strategy with eMMC as the primary boot media and SPI being the secondary/redundant boot media. We are able to boot into the OS from the primary boot media successfully, so loading QNX (qnx-ifs) successfully boots once U-Boot is loaded and runs. We have other checks to ensure our OS always boots, so we are not testing the scenario where we need to boot the OS from the secondary boot media if it fails to boot on the primary.

    The issue we are having is with the TI ROM and U-Boot flow when switching to the secondary boot media if tiboot3.bin is not found or corrupted on the primary boot media (eMMC). Based on the TRM it looked like the TI ROM should perform an image integrity check on tiboot3.bin on the primary boot media and if it fails the image integrity check the TI ROM code will try to load tiboot3.bin on the secondary boot media. But when tiboot3.bin does not exist on the eMMC the EVM board does nothing, it doesn't load the SPL or U-Boot proper. Please see my pin configurations above to see how I have the boot pins configured.

    From,

    Daniel Fettke

  • Hello Dan,
    I'm attaching a log file from my test on AM62x-SK.
    eMMC is pre-flashed as listed below:
    - u-boot binary (tiboot3.bin/tispl.bin/u-boot.img) are pre-flashed in eMMC boot partition
    - Linux root_fs is pre-flashed in eMMC UDA

    OSPI is pre-flashed with
    - u-boot binary (tiboot3.bin/tispl.bin/u-boot.img)

    BOOTMODE[15:0] reconfigurations by modifying CM register + WarmReset
    In "5.2.3 Boot Process Flow in TRM": "The values of BOOTMODE[15:0] pins are latched into the Device Status register CTRLMMR_MAIN_DEVSTAT[15:0] by hardware as the device comes out of global cold reset, sampled after MCU_PORz deassertion."
    In my test, I reconfigure CTRLMMR_MAIN_DEVSTAT register @0x43000030, and then issue "reset" @u-boot which is essentially
    WarmReset. => ROM read CTRLMMR_MAIN_DEVSTAT register as BOOTMODE[15:0]

    Testing sequence as shown in the log file:
    a/. boot from eMMC boot partition
    - BOOTMODE[15:0]=0x18CB (eMMC boot partition + SPI) on  AM62x-SK
    - boot from eMMC boot partition

    b/. boot from SPI
    - stop @u-boot
    - "erase" tiboot3.bin from boot partition
    - "reset" @u-boot
    - boot from SPI

    c/. boot from SPI from BOOTMODE[15:0]=0x1843 (eMMC UDA/FS + SPI)
    - stop @u-boot
    - re-configure CTRLMMR_MAIN_DEVSTAT=0x1843
    - "reset"
    - boot from SPI

    d/. boot from SPI from BOOTMODE[15:0]=0x18C3 (eMMC UDA/RAW + SPI)
    - stop @u-boot
    - re-configure CTRLMMR_MAIN_DEVSTAT=0x18C3
    - "reset"
    - boot from SPI

    Hopefully the info are useful.
    I'll be able to try booting QNX once I have the "qnx-ifs" from you.
    Best,
    -Hong

    5545.am62x_eMMC_SPI.log
    U-Boot SPL 2021.01-g74fc69c889 (May 30 2022 - 16:40:44 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
    Trying to boot from MMC1
    Loading Environment from MMC... OK
    init_env from device 9 not supported!
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.6(release):08.03.00.003-dirty
    NOTICE:  BL31: Built : 16:35:46, May 30 2022
    
    U-Boot SPL 2021.01-g74fc69c889 (May 30 2022 - 16:39:30 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
    Trying to boot from MMC1
    
    
    U-Boot 2021.01-g74fc69c889 (May 30 2022 - 16:39:30 +0000)
    
    SoC:   AM62X SR1.0
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E2
    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
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  2  0 
    => md.l 0x43000030 1
    43000030: 000018cb                               ....
    => mmc list
    mmc@fa10000: 0 (eMMC)
    mmc@fa00000: 1
    mmc@fa20000: 2
    => mmc dev 0
    switch to partitions #0, OK
    mmc0(part 0) is current device
    => mmc info
    Device: mmc@fa10000
    Manufacturer ID: 13
    OEM: 14e
    Name: S0J56 
    Bus Speed: 200000000
    Mode: HS200 (200MHz)
    Rd Block Len: 512
    MMC version 5.1
    High Capacity: Yes
    Capacity: 14.8 GiB
    Bus Width: 8-bit
    Erase Group Size: 512 KiB
    HC WP Group Size: 8 MiB
    User Capacity: 14.8 GiB WRREL
    Boot Capacity: 31.5 MiB ENH
    RPMB Capacity: 4 MiB ENH
    Boot area 0 is not write protected
    Boot area 1 is not write protected
    => mmc part
    
    Partition Map for MMC device 0  --   Partition Type: EFI
    
    Part	Start LBA	End LBA		Name
    	Attributes
    	Type GUID
    	Partition GUID
      1	0x00000022	0x01da3fde	"rootfs"
    	attrs:	0x0000000000000000
    	type:	ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    	guid:	324d6ebf-ccc2-4d67-b291-805f3849d626
    => ls mmc 0:1
    <DIR>       1024 .
    <DIR>       1024 ..
    <DIR>      12288 lost+found
    <DIR>       3072 bin
    <DIR>       1024 boot
    <DIR>       1024 dev
    <DIR>       3072 etc
    <DIR>       1024 home
    <SYM>         20 init
    <DIR>       4096 lib
    <SYM>         19 linuxrc
    <DIR>       1024 media
    <DIR>       1024 mnt
    <DIR>       1024 proc
    <DIR>       1024 run
    <DIR>       3072 sbin
    <DIR>       1024 sys
    <DIR>       1024 tmp
    <DIR>       1024 usr
    <DIR>       1024 var
    => mmc dev 0 1
    switch to partitions #1, OK
    mmc0(part 1) is current device
    => mmc read ${loadaddr} 0x0 0x100
    
    MMC read: dev # 0, block # 0, count 256 ... 256 blocks read: OK
    => md.b ${loadaddr} 0x100
    82000000: 30 82 04 94 30 82 03 fd a0 03 02 01 02 02 14 61    0...0..........a
    82000010: 50 47 62 40 63 29 d9 fa 84 55 7f 34 7d df 36 c1    PGb@c)...U.4}.6.
    82000020: 5d 35 e0 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0d    ]5.0...*.H......
    82000030: 05 00 30 81 9d 31 0b 30 09 06 03 55 04 06 13 02    ..0..1.0...U....
    82000040: 55 53 31 0b 30 09 06 03 55 04 08 0c 02 54 58 31    US1.0...U....TX1
    82000050: 0f 30 0d 06 03 55 04 07 0c 06 44 61 6c 6c 61 73    .0...U....Dallas
    82000060: 31 27 30 25 06 03 55 04 0a 0c 1e 54 65 78 61 73    1'0%..U....Texas
    82000070: 20 49 6e 73 74 72 75 6d 65 6e 74 73 20 49 6e 63     Instruments Inc
    82000080: 6f 72 70 6f 72 61 74 65 64 31 13 30 11 06 03 55    orporated1.0...U
    82000090: 04 0b 0c 0a 50 72 6f 63 65 73 73 6f 72 73 31 13    ....Processors1.
    820000a0: 30 11 06 03 55 04 03 0c 0a 54 49 20 53 75 70 70    0...U....TI Supp
    820000b0: 6f 72 74 31 1d 30 1b 06 09 2a 86 48 86 f7 0d 01    ort1.0...*.H....
    820000c0: 09 01 16 0e 73 75 70 70 6f 72 74 40 74 69 2e 63    ....support@ti.c
    820000d0: 6f 6d 30 1e 17 0d 32 32 30 35 33 30 31 36 34 31    om0...2205301641
    820000e0: 30 35 5a 17 0d 32 32 30 36 32 39 31 36 34 31 30    05Z..22062916410
    820000f0: 35 5a 30 81 9d 31 0b 30 09 06 03 55 04 06 13 02    5Z0..1.0...U....
    => mmc erase 0 0x400
    
    MMC erase: dev # 0, block # 0, count 1024 ... 1024 blocks erased: OK
    => mmc read ${loadaddr} 0x0 0x100
    
    MMC read: dev # 0, block # 0, count 256 ... 256 blocks read: OK
    => md.b ${loadaddr} 0x100
    82000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    82000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    82000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    82000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    82000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    82000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    82000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    82000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    82000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    82000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    820000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    820000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    820000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    820000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    820000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    820000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    => reset
    resetting ...
    
    U-Boot SPL 2021.01-g74fc69c889 (May 30 2022 - 16:40:44 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
    Trying to boot from SPI
    Loading Environment from MMC... *** Warning - No MMC card found, using default environment
    
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.6(release):08.03.00.003-dirty
    NOTICE:  BL31: Built : 16:35:46, May 30 2022
    
    U-Boot SPL 2021.01-00002-g77bcc61-dirty (Jun 23 2022 - 18:14:41 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
    Trying to boot from SPI
    
    
    U-Boot 2021.01-00002-g77bcc61-dirty (Jun 23 2022 - 18:14:41 -0500)
    
    SoC:   AM62X SR1.0
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E2
    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
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  2  0 
    => mw.l 0x43000030 0x1843
    => md.l 0x43000030 1
    43000030: 00001843                               C...
    => reset
    resetting ...
    
    U-Boot SPL 2021.01-g74fc69c889 (May 30 2022 - 16:40:44 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
    Trying to boot from SPI
    Loading Environment from MMC... *** Warning - No MMC card found, using default environment
    
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.6(release):08.03.00.003-dirty
    NOTICE:  BL31: Built : 16:35:46, May 30 2022
    
    U-Boot SPL 2021.01-00002-g77bcc61-dirty (Jun 23 2022 - 18:14:41 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
    Trying to boot from SPI
    
    
    U-Boot 2021.01-00002-g77bcc61-dirty (Jun 23 2022 - 18:14:41 -0500)
    
    SoC:   AM62X SR1.0
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E2
    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
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  2  0 
    => mw.l 0x43000030 0x18C3
    => md.l 0x43000030 1
    43000030: 000018c3                               ....
    => reset
    resetting ...
    
    U-Boot SPL 2021.01-g74fc69c889 (May 30 2022 - 16:40:44 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
    Trying to boot from SPI
    Loading Environment from MMC... *** Warning - No MMC card found, using default environment
    
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.6(release):08.03.00.003-dirty
    NOTICE:  BL31: Built : 16:35:46, May 30 2022
    
    U-Boot SPL 2021.01-00002-g77bcc61-dirty (Jun 23 2022 - 18:14:41 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
    Trying to boot from SPI
    
    
    U-Boot 2021.01-00002-g77bcc61-dirty (Jun 23 2022 - 18:14:41 -0500)
    
    SoC:   AM62X SR1.0
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E2
    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
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  2  0 
    => 

  • Dear Hong,

    Thank you very much for your notes and log. I am still having some trouble but I think there are some hints in your log that I'd like to explore. I am going on vacation so my next reply won't be for a week but I did have a couple of questions.

    1) I see you are using AM62-SKEVM rev E2, I am using the E3 board. Are there any differences between these boards that would cause a difference in booting U-Boot?

    2) When you enter [mmc part] I notice the partition type is EFI, where ours is DOS. We also have two partitions on the eMMC, the boot partition is a FAT32 type 11 partition where we keep the U-Boot files, and another is a QNX partition where the IFS is. Does that make a difference with the boot flow?

    3) I've been experimenting with the SD Card as the primary boot, even though this will not be our primary boot, just to experiment with a different primary boot media and CTRLMMR_MAIN_DEVSTAT=0x1A43. When tiboot3.bin is on the SD card U-Boot comes up fine. When I insert my SD card into my computer and delete tiboot3.bin in Windows and reinsert the SD card into the EVM board, the board does nothing after one minute. When I remove the SD card and reset the board then TI ROM code uses the backup boot media and boots U-Boot. I saw your example where you removed tiboot3.bin, did you do that through U-Boot or Linux? Any reason why TI ROM would not boot into U-Boot when tiboot3.bin is not present?

    Thanks for all of your help!

    From,

    Daniel Fettke

  • Hello Dan,
    For your questions,
    A1. I don't think the board revision delta between E2 vs E3 would make difference here.
    A2. Once SPL/u-boot starts to run on A53, it is flexible on where/how to load the next stage SW, i.e. Linux kernel or QNX. For standard u-boot/Linux in TI SDK, u-boot binary boots from eMMC boot partition, and Linux kernel/root_fs from eMMC UDA with GPT (UEFI) format.
    A3. I erased the raw "tiboot3.bin" from eMMC boot partition @u-boot prompt as shown in the log. On the next POR, "integrity check" on "tiboot3.bin" by ROM fails, and ROM move to secondary boot media (SPI). ONLY the very first R5-BL or "tiboot3.bin" is checked by ROM.

    I verified the QNX boot from eMMC as POC on AM62x-SK for your reference:
    am62x_uboot_qnx_emmc_flash.log:
    - boot u-boot from SD
    - flash u-boot binary (tiboot3.bin/tispl.bin/u-boot.img) to eMMC boot partition
    - flash "qnx-ifs" also to eMMC boot partition
    - where "qnx-ifs" flashed to eMMC boot partition @starting block# = 0x1C00
    - Boot Capacity: 31.5 MiB ENH

    am62x_uboot_qnx_emmc_boot.log:
    - boot u-boot from eMMC
    - stop @u-boot prompt
    - load "qnx-ifs" from eMMC boot partition @starting block# = 0x1C00
    - boot QNX
    Note that it is possible to re-build u-boot or add into the script for the above two steps: loading "qnx-ifs" from eMMC and launching QNX.

    Best,
    -Hong

    am62x_uboot_qnx_emmc_flash.log
    U-Boot SPL 2021.01-g2ee8efd654 (Feb 24 2023 - 05:52:36 +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
    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 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
    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 2021.01-g2ee8efd654 (Feb 24 2023 - 05:29:33 +0000)
    
    SoC:   AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E2
    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
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  2  0 
    => md.l 0x43000030 1
    43000030: 00000243                               C...
    => ls mmc 1
       961988   tispl.bin
       897880   u-boot.img
         1490   uEnv.txt
       332430   tiboot3.bin
       332430   tiboot3-am62x-gp-evm.bin
       335019   tiboot3-am62x-hs-evm.bin
                .Trash-1000/
                am62x_8.6.0.7/
       335019   tiboot3-am62x-fs-evm.bin
     12210956   qnx-ifs
            1   .psdk_setup
                System Volume Information/
    
    9 file(s), 3 dir(s)
    => mmc list
    mmc@fa10000: 0 (eMMC)
    mmc@fa00000: 1
    mmc@fa20000: 2
    => mmc dev 0
    switch to partitions #0, OK
    mmc0(part 0) is current device
    => mmc part
    
    Partition Map for MMC device 0  --   Partition Type: EFI
    
    Part	Start LBA	End LBA		Name
    	Attributes
    	Type GUID
    	Partition GUID
      1	0x00000022	0x01da3fde	"rootfs"
    	attrs:	0x0000000000000000
    	type:	ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    	guid:	324d6ebf-ccc2-4d67-b291-805f3849d626
    => mmc info
    Device: mmc@fa10000
    Manufacturer ID: 13
    OEM: 14e
    Name: S0J56 
    Bus Speed: 200000000
    Mode: HS200 (200MHz)
    Rd Block Len: 512
    MMC version 5.1
    High Capacity: Yes
    Capacity: 14.8 GiB
    Bus Width: 8-bit
    Erase Group Size: 512 KiB
    HC WP Group Size: 8 MiB
    User Capacity: 14.8 GiB WRREL
    Boot Capacity: 31.5 MiB ENH
    RPMB Capacity: 4 MiB ENH
    Boot area 0 is not write protected
    Boot area 1 is not write protected
    => mmc dev 0 1
    switch to partitions #1, OK
    mmc0(part 1) is current device
    => load mmc 1 ${loadaddr} tiboot3.bin
    332430 bytes read in 7 ms (45.3 MiB/s)
    => mmc write ${loadaddr} 0x0 0x400
    
    MMC write: dev # 0, block # 0, count 1024 ... 1024 blocks written: OK
    => load mmc 1 ${loadaddr} tispl.bin
    961988 bytes read in 15 ms (61.2 MiB/s)
    => mmc write ${loadaddr} 0x400 0x1000
    
    MMC write: dev # 0, block # 1024, count 4096 ... 4096 blocks written: OK
    => load mmc 1 ${loadaddr} u-boot.img
    897880 bytes read in 15 ms (57.1 MiB/s)
    => mmc write ${loadaddr} 0x1400 0x2000
    
    MMC write: dev # 0, block # 5120, count 8192 ... 8192 blocks written: OK
    => load mmc 1 ${loadaddr} qnx-ifs
    12210956 bytes read in 143 ms (81.4 MiB/s)
    => mmc write ${loadaddr} 0x1C00 0x6000
    
    MMC write: dev # 0, block # 7168, count 24576 ... 24576 blocks written: OK
    => mmc partconf 0 1 1 1
    => mmc bootbus 0 2 0 0
    => 

    am62x_uboot_qnx_emmc_boot.log
    U-Boot SPL 2021.01-g2ee8efd654 (Feb 24 2023 - 05:52:36 +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
    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 MMC... *** Warning - bad CRC, using default environment
    
    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
    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 2021.01-g2ee8efd654 (Feb 24 2023 - 05:29:33 +0000)
    
    SoC:   AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E2
    DRAM:  2 GiB
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
    Loading Environment from MMC... *** Warning - bad CRC, using default environment
    
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  2  0 
    => md.l 0x43000030 1
    43000030: 000000cb                               ....
    => mmc dev 0 1
    switch to partitions #1, OK
    mmc0(part 1) is current device
    => mmc read 0x80080000 0x1C00 0x6000
    
    MMC read: dev # 0, block # 7168, count 24576 ... 24576 blocks read: OK
    => go 0x80080000
    ## Starting application at 0x80080000 ...
    MMU: 16-bit ASID 40-bit PA TCR_EL1=b5183519
    ARM GIC-500 r1p1, arch v3.0 detected
    gic_v3_lpi_add_entry for vectors 8192 -> 8447, Ok
    gic_v3_lpi_add_entry for vectors 8448 -> 65535, Ok
    No SPI intrinfo. Add default entry for 32 -> 287 vectors, Ok
    LPI config table #1 @ 000000008000f000, callout vaddr: ffffff8040291000
    aarch64_cpuspeed: core speed 1250
    cpu0: MPIDR=80000000
    cpu0: MIDR=410fd034 Cortex-A53 r0p4
    cpu0: CWG=4 ERG=4 Dminline=4 Iminline=4 VIPT
    cpu0: CLIDR=a200023 LoUU=1 LoC=2 LoUIS=1
    cpu0: L1 Icache 32K linesz=64 set/way=256/2
    cpu0: L1 Dcache 32K linesz=64 set/way=128/4
    cpu0: L2 Unified 512K linesz=64 set/way=512/16
    Enabling ITS 0
    ITS queue at 0000000080020000, num slots: 256
    Issue MAPC/SYNC/INVALL commands for ICID 0
    update CWRITER to 0x00000060
    Waiting for all commands to be processed ... Done in 1 tries
    Enable LPIs in GICR_CTLR @ 0000000001880000 for CPU0
    Display set to A72 DSS
    init_usb_host: USB0
    SYSFW ABI: 3.1 (firmware rev 8 '8.6.4--v08.06.04 (Chill Capybar'
    init_usb_host: USB1
    Loading IFS...decompressing...done
    aarch64_cpuspeed: core speed 1250
    cpu1: MPIDR=80000001
    cpu1: MIDR=410fd034 Cortex-A53 r0p4
    cpu1: CWG=4 ERG=4 Dminline=4 Iminline=4 VIPT
    cpu1: CLIDR=a200023 LoUU=1 LoC=2 LoUIS=1
    cpu1: L1 Icache 32K linesz=64 set/way=256/2
    cpu1: L1 Dcache 32K linesz=64 set/way=128/4
    cpu1: L2 Unified 512K linesz=64 set/way=512/16
    ITS 0 already Enabled
    ITS queue at 0000000080020000, num slots: 256
    Issue MAPC/SYNC/INVALL commands for ICID 1
    update CWRITER to 0x000000c0
    Waiting for all commands to be processed ... Done in 1 tries
    Enable LPIs in GICR_CTLR @ 00000000018a0000 for CPU1
    aarch64_cpuspeed: core speed 1250
    cpu2: MPIDR=80000002
    cpu2: MIDR=410fd034 Cortex-A53 r0p4
    cpu2: CWG=4 ERG=4 Dminline=4 Iminline=4 VIPT
    cpu2: CLIDR=a200023 LoUU=1 LoC=2 LoUIS=1
    cpu2: L1 Icache 32K linesz=64 set/way=256/2
    cpu2: L1 Dcache 32K linesz=64 set/way=128/4
    cpu2: L2 Unified 512K linesz=64 set/way=512/16
    ITS 0 already Enabled
    ITS queue at 0000000080020000, num slots: 256
    Issue MAPC/SYNC/INVALL commands for ICID 2
    update CWRITER to 0x00000120
    Waiting for all commands to be processed ... Done in 1 tries
    Enable LPIs in GICR_CTLR @ 00000000018c0000 for CPU2
    aarch64_cpuspeed: core speed 1250
    cpu3: MPIDR=80000003
    cpu3: MIDR=410fd034 Cortex-A53 r0p4
    cpu3: CWG=4 ERG=4 Dminline=4 Iminline=4 VIPT
    cpu3: CLIDR=a200023 LoUU=1 LoC=2 LoUIS=1
    cpu3: L1 Icache 32K linesz=64 set/way=256/2
    cpu3: L1 Dcache 32K linesz=64 set/way=128/4
    cpu3: L2 Unified 512K linesz=64 set/way=512/16
    ITS 0 already Enabled
    ITS queue at 0000000080020000, num slots: 256
    Issue MAPC/SYNC/INVALL commands for ICID 3
    update CWRITER to 0x00000180
    Waiting for all commands to be processed ... Done in 1 tries
    Enable LPIs in GICR_CTLR @ 00000000018e0000 for CPU3
    
    System page at phys:0000000080023000 user:ffffff80402b5000 kern:ffffff80402b2000
    Starting next program at vffffff8060088280
    All ClockCycles offsets within tolerance
    Welcome to QNX Neutrino 7.1.0 on the TI AM62x SK EVM Board!!
    Starting I2C driver ...
    start serial driver
    Starting MMC/SD memory card driver... SD
    Starting Flash driver...
    ldd:FATAL: Could not load library libti-sciclient.so.1
    Starting XHCI driver on USB3SS0 and USB3SS1
    Starting networking ...
    Unable to start "export" (2)
    Unable to start "export" (2)
    Unable to start "export" (2)
    Setting environment variables...
    Mounting the sd ..
    Unable to access /dev/sd0
    mount: Can't mount /boot (type dos) 
    mount: Possible reason: Invalid argument 
    mount: Can't mount /ti_fs (type dos) 
    mount: Possible reason: Invalid argument 
    Looking for user script to run: /ti_fs/scripts/user.sh
    Unable to access /ti_fs/scripts/user.sh
    done...
    AM62xEVM# ls
    
    bin     etc     lib     root    tmp     var
    dev     home    proc    sbin    usr

  • Dear Hong,

    Hello I hope you've been well, thank you for your last reply. I am back from my time off and I was able to reproduce your example by corrupting parts of the tiboot3.bin file and saw that the secondary backup boot began booting into U-Boot.

    Thank you for confirming that you "erased" tiboot3.bin by using the mmc erase command as shown by the logs you sent. According to the U-Boot documentation this command erases blocks of memory on the mmc starting at a block number and providing a number of blocks to erase, but it doesn't seem like it removes the file entry from the file allocation table, is that your understanding as well?

    I still cannot get backup boot to work if the file does not exist on a FAT32 file system after Windows or QNX deleted file file from the FAT32 partition. Do you know if this procedure has been tested with FAT32 file partitions, rather than EFI or UEFI, in filesystem mode? When I do an mmc read and use md to print the bytes read at block zero I do not see the contents of tiboot3.bin. Instead I see the entries of the FAT32 reserved sectors or FAT Region. I see you are booting into QNX from your latest logs. If your U-Boot files are on a FAT32 partition, what happens when you use the "rm" command to remove tiboot3.bin, disconnect the board from its power source, and reconnect power? Thanks.

    From,

    Daniel Fettke

  • Dear Hong,

    I hope you're having a great week so far. Have you had a chance to look at my questions? Thanks.

    From,

    Daniel Fettke

  • Hello Dan,
    Thanks for your reply, and let me add some clarifications on my test setup.
    All u-boot binaries (tiboot3.bin/tispl.bin/u-boot.img) are flashed to eMMC boot partition. In fact eMMC boot partition is RAW.
    You may refer to the eMMC layout in Linux SDK by default (it is still possible for user to customize as necessary though).
    - eMMC boot partition (two partitions boot0/boot1 in RAW): for u-boot binary
    - eMMC UDA (ext4 FS): for Linux root_fs (including Linux kernel...).

    According to the U-Boot documentation this command erases blocks of memory on the mmc starting at a block number and providing a number of blocks to erase, but it doesn't seem like it removes the file entry from the file allocation table, is that your understanding as well?

    There's no "table entry" associated with eMMC boot partition in RAW.

    eMMC boot partition size is 31.5 MiB, and QNX "qnx-ifs" is ~11 MiB.
    I flashed QNX (qnx-ifs) to eMMC boot partition @starting block# = 0x1C00, where 512 bytes/block.

    Hopefully it clarify the questions you have, and we can have a short call to discuss your user case if helpful.

    Best,
    -Hong

  • Dear Hong,

    Hello I hope you've been doing well. I had a chance to try out eMMC using raw mode rather than filesystem mode and I was able to reproduce your results. When I erase the section containing tiboot3.bin, the TI ROM code does default back to the SPI flash.

    A question I wanted to ask you, are there any drawbacks of using eMMC UDA raw mode versus eMMC alternative boot mode aside from being able to use boot0 and boot1? Our eMMC part's boot partition isn't large enough to handle the U-Boot files so we may use eMMC UDA raw mode but we wanted to get your thoughts and perspective. Thanks!

    From,

    Daniel Fettke

  • Hello Dan,
    It is very good to know you're able to boot from eMMC boot partition, and fall back to the backup boot media-SPI in case "tiboot3.bin" is not present @0x0 offset in eMMC boot partition.
    I'd recommend to use eMMC boot partition for user's bootloader if feasible
    - eMMC boot partition is designed for bootloader user case
    - it is possible to write-protect boot0/boot1 as necessary
    - boot0/boot1 are useful for SW update process for image swapping

    u-boot binaries (tiboot3.bin/tispl.bin/u-boot.img) are ~2Mbytes in the default SDK.
    If needed, it is possible to customise the eMMC layout, for example, keeping the very first user BL "tiboot3.bin" only in boot partition, and rest of binary in UDA.

    Best,
    -Hong

  • Dear Hong,

    Hello, I hope you've been doing well. I've been doing some experiments with eMMC raw mode and I have a question for you. When I have the primary boot set to eMMC alternate boot and backup as SPI I'll restart the board. I perform this action either in U-Boot with the reset command or in QNX with the shutdown command. When I do the EVM board boots into SPI, even though the boot mode register hasn't changed. If I power off the board and power it back on it will boot into eMMC. This does not happen if I have the primary boot set to the SD card. Is there anything in the TI ROM code that would cause a reset to go to the backup boot when in raw mode? Thanks for your help.

    From,

    Daniel Fettke

     

    Trying to boot from MMC1
    spl_mmc_load: Raw Part 0 Sector 5120
    spl_mmc_load: mmc->part_config 72 Mask 7
    spl_mmc_load: part 1
    hdr read sector 0x1400, count=1
    
    CONFIG_SPL_LOAD_FIT 1 Magic 0xd00dfeed
    Found FIT 512
    fit read sector 1400, sectors=2, dst=, count=2, size=0x3ec
    spl image size1 0
    spl image size2 866112
    Image OS is U-Boot
    mmc_load_image_raw_sector: mmc block read error 0
    Primary boot was successful, writing that to ROM
    
    
    U-Boot 2021.01-00009-gc8c39ebc1d-dirty (Jul 31 2023 - 15:18:38 -0400)
    
    SoC:   AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E3
    DRAM:  2 GiB
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
    Loading Environment from MMC... *** Warning - bad CRC, using default environment
    
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0
    => md.l 0x43000030 1
    43000030: 000018cb                               ....
    => reset
    resetting ...
    
    U-Boot SPL 2021.01-00007-gfeae1ab63d-dirty (May 25 2023 - 16:35:00 -0400)
    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 SPI
    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 MMC... *** Warning - No MMC card found, using default environment
    
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.7(release):v2.7.0-359-g1309c6c80-dirty
    NOTICE:  BL31: Built : 07:56:58, May  9 2023
    I/TC:
    I/TC: OP-TEE version: 3.19.0-15-gd6c5d003-dev (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #2 Mon Apr 10 12:31:13 UTC 2023 aarch64
    I/TC: WARNING: This OP-TEE configuration might be insecure!
    I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
    I/TC: Primary CPU initializing
    I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
    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 2021.01-00007-gfeae1ab63d-dirty (May 26 2023 - 11:14:39 -0400)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
    Trying to boot from SPI
    
    
    U-Boot 2021.01-00007-gfeae1ab63d-dirty (May 26 2023 - 11:14:39 -0400)
    
    SoC:   AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E3
    DRAM:  2 GiB
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
    Loading Environment from MMC... *** Warning - bad CRC, using default environment
    
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   eth0: ethernet@8000000port@1
    =>
    => md.l 0x43000030 1.
    43000030: 000018cb                               ....
    =>

  • Hello Dan,
    I'm not sure if the attached log captured all booting sequence you described.
    Fyi, I wrote up [FAQ] Redundant boot from eMMC boot partitions on AM62x
    e2e.ti.com/.../faq-redundant-boot-from-emmc-boot-partitions-on-am62x
    Best,
    -Hong

  • Dear Hong,

    Thanks, here are some highlights from the log I attached:

    • On line 1 I show that the SK-AM62 is booting from MMC1 (eMMC) after power is reconnected to the SK-AM62
    • On line 32 U-Boot has loaded and I read the CTRLMMR_MAIN_DEVSTAT register to get the bootmode to show that the primary boot is eMMC alternate mode in raw with SPI as the backup (0x18cb). I do not write to this register.
    • On line 34 I issue the warm reset command
    • On line 40 U-Boot reports that it is trying to boot from SPI
    • On line 83 U-Boot has loaded from SPI, but reading the CTRLMMR_MAIN_DEVSTAT register shows it has not changed.

    Thanks for linking your FAQ description, I went through your procedure to see if there was anything I missed. I have issued [mmc partconf 0 1 1 1] and [mmc bootbus 0 2 0 0] commands. I do observe that when the power is removed and reconnected that I can boot from the eMMC.

    Is there any difference between removing power and a warm reset as far as the TI ROM code is concerned aside from re-loading the CTRLMMR_MAIN_DEVSTAT with the value of the BOOTMODE pins? Thanks again.

    From,

    Daniel Fettke

  • Hello Dan,
    Thanks for your added descriptions and further testing on your board.
    It looks to me there's difference on RESET HW logic between TI AM62x-SK and your customer board.
    On TI AM62x-SK, HW Power-On-Reset (POR) functions "similarly" as SW issued WarmReset (i.e. "reset" cmd @u-boot prompt).
    But it appears HW PoR and SW WarmReset behaves differently on your board.
    Best,
    -Hong