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.

AM6548: Can't boot on OSPI on the EVK

Part Number: AM6548

Hi,

I'm trying to boot my AM648 EVK board from the MT35X NOR flash on OSPI. Currently the situations is:

- I was successfully able to generate a .wic with yocto.
- That .wic, once flashed on an SD card, boots normally.
- I added support in U-Boot for MT35X nor flash using CONFIG_SPI_FLASH_MT35XU=y.
- The flash is then correctly detected in U-Boot:

=> sf probe 
SF: Detected mt35xu512aba with page size 256 Bytes, erase size 128 KiB, total 64 MiB

- I am able to write/read in the OSPI correctly.
- From U-Boot I flash tiboot3.bin, tispl.bin, u-boot.img, sysfw.itb onto the OSPI nor using:

fatload mmc 1 ${loadaddr} tiboot3.bin; sf update $loadaddr 0x0 $filesize; fatload mmc 1 ${loadaddr} tispl.bin; sf update $loadaddr 0x80000 $filesize; fatload mmc 1 ${loadaddr} u-boot.img; sf update $loadaddr 0x280000 $filesize; fatload mmc 1 ${loadaddr} sysfw.itb; sf update $loadaddr 0x6C0000 $filesize

Where MMC 1 is my SD card as shown in:

=> mmc list
mmc@4f80000: 0
mmc@4fa0000: 1 (SD)

- I set the bootmode switch as follow:

  • [3..0]     0001         : OSPI primary boot
  • [6..4]     100           : MMCSD backup boot mode
  • [7]         0               : No min mode
  • [15..8]   11000101 : Octal fast read 32/I clock (loop back clock) external source, same as DQS/CS=0/33 MHz SDR with delay line/32-bit address bus <= I've got doubts about this
  • [18..16] 010           : Backup SD on port 1

But the system only boot on the backup SD, if I remove it the terminal stays blank.

Do I need to modify something else in order to boot on the OSPI ?

Also the generated .wic has 2 different .itb in the boot partition:

=> fatls mmc 1
            EFI/
 19984896   Image
   267766   sysfw-am65x-evm.itb
   267770   sysfw.itb
   149121   tiboot3.bin
   759488   tispl.bin
   979484   u-boot.img
      574   uEnv.txt

7 file(s), 1 dir(s)

looking at the sizes they seem slightly different. I tried to flash both, no luck.

I must also admit that the more I read about the boot process on AM65 the less I understand it. I read the TRM sections regarding boot process, but I currently just don't understand where these binary comes from..

Any help is welcome, thanks in advance.

Regards
Pierre Buffo

  • Hello Pierre,
    First it is good to know you're able to boot from SD card, and the new OSPI-NOR is deteced @u-boot booting from SD.
    1. SR1.0 SoC vs SR2.0 SoC on your board:
    - The two sysfw.itb: one for SR1.0, and the other one for SR2.0
    - AM65x TRM
    Table 1-4. Device JTAG ID Values
    CTRLMMR_WKUP_JTAGID @0x43000014
    For example, @u-booot
    md.l 043000014 1
    0BB5A02F => SR1.0

    2. Another view on AM65x boot flow
    git.ti.com/gitweb

    Best,
    -Hong

  • Hi Hong,

    I've got the SR2.0 revision as shown in U-Boot:

    [...]
    U-Boot 2023.01-g62e2ad1cea (Jan 09 2023 - 16:07:33 +0000)
    
    SoC:   AM65X SR2.0 GP
    Model: Texas Instruments AM654 Base Board
    Board: AM6-COMPROCEVM rev B
    DRAM:  4 GiB
    [...]

    and:

    => md.l 43000014 1 
    43000014: 1bb5a02f 

    I already checked the U-Boot readme that you sent. It sure is very concise, but sadly doesn't help with my issue.

    Is there something I should change in U-Boot conf ?

    Regards
    Pierre Buffo

  • I went a bit further,

    Turns out that the boot was configured correctly, the main issue is that U-Boot isn't able to read/write from the OSPI. I had to use flashcp from linux to write into the nor. Although now the system stays stuck before U-Boot:

    U-Boot SPL 2023.01-g62e2ad1cea (Jan 09 2023 - 16:07:33 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0016 '22.1.1--v2022.01 (Terrific Llam')
    SPL initial stack usage: 1432 bytes
    Trying to boot from SPI
    spl_load_fit_image: Skip load 'dm': image size is 0!
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.7(release):v2.7.0-359-g1309c6c805-dirty
    NOTICE:  BL31: Built : 11:40:36, Sep  8 2022
    I/TC: 
    I/TC: OP-TEE version: 3.19.0 (gcc version 11.3.0 (GCC)) #1 Fri Oct 14 19:00:05 UTC 2022 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 0x0016 '22.1.1--v2022.01 (Terrific Llam')
    E/TC:0 0 tee_otp_get_hw_unique_key:87 Could not get HUK
    E/TC:0 0 call_initcalls:43 Initcall __text_start + 0x00060808 failed
    I/TC: Activated SA2UL device
    I/TC: Fixing SA2UL firewall owner for GP device
    I/TC: Enabled firewalls for SA2UL TRNG device
    I/TC: SA2UL TRNG initialized
    I/TC: SA2UL Drivers initialized
    I/TC: Primary CPU switching to normal world boot
    
    U-Boot SPL 2023.01-g62e2ad1cea (Jan 09 2023 - 16:07:33 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0016 '22.1.1--v2022.01 (Terrific Llam')
    Trying to boot from SPI
    k3-navss-ringacc ringacc@2b800000: Ring Accelerator probed rings:286, gp-rings[96,32] sci-dev-id:195
    k3-navss-ringacc ringacc@2b800000: dma-ring-reset-quirk: enabled
    

    I will now start investigating the U-Boot conf

  • Hello Pierre,
    It is good to know the progress on enabling the new flash on your board...From your latest log,
    - r5-spl, atf, optee are loaded from OSPI-NOR, and runs;
    - a53-spl are loaded from OSPI-NOR, starts to run... then lockup somehow...
    Best,
    -Hong

  • Hi Hong,

    Is it the A53 SPL that locks up ? Or U-Boot right when it starts ?

    Any idea regarding what to try next ? I've been making various attempts the whole day, but nothing worked. I tried to add a few options in U-Boot, but it only made things worse as seen above:

    U-Boot SPL 2023.01-g62e2ad1cea (Jan 09 2023 - 16:07:33 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0016 '22.1.1--v2022.01 (Terrific Llam')
    SPL initial stack usage: 1432 bytes
    Trying to boot from SPI
    spl_load_fit_image: Skip load 'dm': image size is 0!
    SPL: failed to boot from all boot devices (err=-6)
    ### ERROR ### Please RESET the board ###

    So I ended up reversing those changes.

    As I said before I'm having issues with read/write operation from U-Boot, maybe that's where the problem comes from ?

    sf test confirms the read/write issues:

    => sf test 0 1000
    SPI flash test:
    Erase failed (err = -22)
    Test failed
    

  • Hello Pierre,
    The lockup point is around boundary, either before u-boot loaded/run, or u-boot runs, but not yet printing out u-boot banner...
    Given a53-spl is loaded from OSPI-NOR by r5-spl => dtb in tiboot3.bin "should" be good on flash configuration...
    You may cross check the dtbs in tispl.bin, u-boot.img...
    Best,
    -Hong