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-LP: Processors forum

Part Number: SK-AM62-LP
Other Parts Discussed in Thread: SK-AM62A-LP

Hi,

I have and SK-AM62A-LP board.

I downloaded the SD-CARD image, configured the switches and I can boot all the way from uboot to Linux. 

I tried several ways to boot from QSPI flash, but without success.

This is my Uboot output:

U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
am62a_init: board_init_f done
SPL initial stack usage: 17040 bytes
am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
Trying to boot from SPINAND
am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
Authentication passed
am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
Authentication passed
am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
Authentication passed
am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
Authentication passed
am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
Authentication passed
Starting ATF on ARM64 core...

NOTICE:  BL31: v2.9(release):v2.9.0-614-gd7a7135d32-dirty
NOTICE:  BL31: Built : 09:34:15, Aug 24 2023

U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
am62a_init: board_init_f done
am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
Trying to boot from SPINAND
am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
Authentication passed
am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
Authentication passed


U-Boot 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)

SoC:   AM62AX SR1.0 HS-FS
Model: Texas Instruments AM62A7 SK
DRAM:  2 GiB (effective 4 GiB)
Core:  58 devices, 28 uclasses, devicetree: separate
MMC:   mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from nowhere... OK
In:    serial@2800000
Out:   serial@2800000
Err:   serial@2800000
Net:   eth0: ethernet@8000000port@1
Hit any key to stop autoboot:  0 

The mtd list output

=> mtd list
List of MTD devices:
* spi-nand0
  - device: flash@0
  - parent: spi@fc40000
  - driver: spi_nand
  - path: /bus@f0000/bus@fc00000/spi@fc40000/flash@0
  - type: NAND flash
  - block size: 0x40000 bytes
  - min I/O: 0x1000 bytes
  - OOB size: 128 bytes
  - OOB available: 80 bytes
  - 0x000000000000-0x000008000000 : "spi-nand0"
          - 0x000000000000-0x000000080000 : "ospi_nand.tiboot3"
          - 0x000000080000-0x000000280000 : "ospi_nand.tispl"
          - 0x000000280000-0x000000680000 : "ospi_nand.u-boot"
          - 0x000000680000-0x0000006c0000 : "ospi_nand.env"
          - 0x0000006c0000-0x000000700000 : "ospi_nand.env.backup"
          - 0x000002000000-0x000007fc0000 : "ospi_nand.rootfs"
          - 0x000007fc0000-0x000008000000 : "ospi_nand.phypattern"

boot command output: (SD-CARD not inserted)

=> boot
MMC: no card present
SD/MMC found on device 1
MMC: no card present
** Bad device specification mmc 1 **
Couldn't find partition mmc 1
Can't set block device
MMC: no card present
** Bad device specification mmc 1 **
Couldn't find partition mmc 1
Can't set block device
MMC: no card present
** Bad device specification mmc 1 **
## Error: "main_cpsw0_qsgmii_phyinit" not defined
MMC: no card present
** Bad device specification mmc 1 **
Couldn't find partition mmc 1:2
Can't set block device
MMC: no card present
** Bad device specification mmc 1 **
Couldn't find partition mmc 1:2
Can't set block device
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
Bad Linux ARM64 Image magic!
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
MMC: no card present
No EFI system partition
No EFI system partition
Failed to persist EFI variables
BootOrder not defined
EFI boot manager: Cannot load any image
MMC: no card present
starting USB...
No working controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No working controllers found
link up on port 1, speed 1000, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
*** Unhandled DHCP Option in OFFER/ACK: 42
*** Unhandled DHCP Option in OFFER/ACK: 224
*** Unhandled DHCP Option in OFFER/ACK: 42
*** Unhandled DHCP Option in OFFER/ACK: 224
DHCP client bound to address 10.11.80.62 (1012 ms)
*** ERROR: `serverip' not set
Cannot autoload with TFTPGET
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/01-1c-63-49-15-92-64
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0A0B503E
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0A0B503
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0A0B50
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0A0B5
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0A0B
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0A0
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0A
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/0
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default-arm-k3-am62ax
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default-arm-k3
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default-arm
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Retrieving file: pxelinux.cfg/default
link up on port 1, speed 1000, full duplex
*** ERROR: `serverip' not set
Config file not found
starting USB...
No working controllers found
link up on port 1, speed 1000, full duplex
BOOTP broadcast 1
*** Unhandled DHCP Option in OFFER/ACK: 42
*** Unhandled DHCP Option in OFFER/ACK: 224
*** Unhandled DHCP Option in OFFER/ACK: 42
*** Unhandled DHCP Option in OFFER/ACK: 224
DHCP client bound to address 10.11.80.62 (17 ms)
*** ERROR: `serverip' not set
Cannot autoload with TFTPGET
link up on port 1, speed 1000, full duplex
BOOTP broadcast 1
*** Unhandled DHCP Option in OFFER/ACK: 42
*** Unhandled DHCP Option in OFFER/ACK: 224
*** Unhandled DHCP Option in OFFER/ACK: 42
*** Unhandled DHCP Option in OFFER/ACK: 224
DHCP client bound to address 10.11.80.62 (17 ms)
*** ERROR: `serverip' not set
Cannot autoload with TFTPGET

Please advice

  • Hi,

    A small update.

    I found a link: https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM62X/09_01_00_08/exports/docs/linux/Foundational_Components/U-Boot/UG-QSPI.html?highlight=ospi%20nand

    I'm trying to execute the Flashing images to OSPI using SD card (from the link)

    Switches are configured to OSPI NAND BOOT MODE

    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    am62a_init: board_init_f done
    SPL initial stack usage: 17040 bytes
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Trying to boot from SPINAND
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.9(release):v2.9.0-614-gd7a7135d32-dirty
    NOTICE:  BL31: Built : 09:34:15, Aug 24 2023
    
    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    am62a_init: board_init_f done
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Trying to boot from SPINAND
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    
    
    U-Boot 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    
    SoC:   AM62AX SR1.0 HS-FS
    Model: Texas Instruments AM62A7 SK
    DRAM:  2 GiB (effective 4 GiB)
    Core:  58 devices, 28 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0 
    => sf probe
    => fatload mmc 1 ${loadaddr} tiboot3.bin
    318154 bytes read in 112 ms (2.7 MiB/s)
    => sf update $loadaddr 0x0 $filesize
    device 0 offset 0x0, size 0x4daca
    "Synchronous Abort" handler, esr 0x8a000000
    elr: 305f3136e3bf6132 lr : 000000008081eb68 (reloc)
    elr: 305f3137632d6132 lr : 00000000ffefeb68
    x0 : 00000000fdeaa100 x1 : 0000000000000000
    x2 : 000000000004daca x3 : 305f3137632d6132
    x4 : 0000000000000001 x5 : 00000000fdeb4c60
    x6 : 0000000000000072 x7 : 00000000fde93380
    x8 : 0000000000000010 x9 : 0000000000000008
    x10: 00000000ffffffd8 x11: 0000000000000010
    x12: 0000000000000000 x13: 0000000000000200
    x14: 000000000000000e x15: 0000000000000020
    x16: 00000000fff4127c x17: 0000000000000000
    x18: 00000000fde9fdb0 x19: 0000000000000005
    x20: 00000000fdeb4cc0 x21: 00000000fffe3000
    x22: 00000000fdeb4c60 x23: 0000000000000004
    x24: 0000000082000000 x25: 00000000fffb3c1e
    x26: 0000000000000005 x27: 0000000000000000
    x28: 00000000fdeb4d00 x29: 00000000fde933d0
    
    Code: "Synchronous Abort" handler, esr 0x96000004
    elr: 0000000080802b08 lr : 0000000080802ae8 (reloc)
    elr: 00000000ffee2b08 lr : 00000000ffee2ae8
    x0 : 00000000fffa811e x1 : 0000000000000000
    x2 : 0000000000000020 x3 : 0000000002800000
    x4 : 0000000002800000 x5 : 00000000fde92ddb
    x6 : 0000000000000030 x7 : 00000000fde93260
    x8 : 0000000000000001 x9 : 0000000000000008
    x10: 00000000ffffffe8 x11: 0000000000000010
    x12: 000000000001869f x13: 0000000000000200
    x14: 000000000000000e x15: 0000000000000021
    x16: 00000000fff4127c x17: 0000000000000000
    x18: 00000000fde9fdb0 x19: 305f3137632d6120
    x20: 00000000fffb1c89 x21: 00000000fffffffc
    x22: 00000000fffb37be x23: 00000000fffa811e
    x24: 0000000082000000 x25: 00000000fffb3c1e
    x26: 0000000000000005 x27: 0000000000000000
    x28: 00000000fdeb4d00 x29: 00000000fde93260
    
    Code: d1004273 911efad6 aa0003f7 12800075 (b9400261) 
    Resetting CPU ...
    
    resetting ...
    

  • Hi Daniel,

    The documentation mentioned above is for AM62x, and there are variations in OSPI flash used in AM62x and AM62A, hence the commands will be different based on NAND or NOR flash used.
    Please refer to AM62A documentation: https://software-dl.ti.com/processor-sdk-linux/esd/AM62AX/09_02_00/exports/docs/linux/Foundational_Components/U-Boot/UG-QSPI.html

    There are no instructions provided, hence booting from OSPI NAND is not tested in case of AM62A.
    I will look into the same, and get back to you if there are any further updates.

    Regards,
    Aparna

  • Hello Aparna,

    I'm sorry, but your link didn't help me at all.

    I did find several links on your forum:

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1018036/am6442-how-to-create-ospi-rootfs-ubifs-and-boot-linux-from-ospi-without-sd/3769546#3769546

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1309635/sk-am62a-lp-how-to-boot-from-spi-nand

    I have tried to follow the explanation there, but so far without success.

    Can you point me to any valid TI's document, that may help me?

    Regards

  • Hello Aparna,

    Not sure which commands you are asked about, so I'll try to post each of them, as mentioned in the link.

    Flashing OSPI-NAND:

    SYSFW Firmware Version 9.2.7--v09.02.07 (Kool Koala)
    SYSFW Firmware revision 0x9
    SYSFW ABI revision 3.1
    
    [BOOTLOADER_PROFILE] Boot Media       : FLASH 
    [BOOTLOADER_PROFILE] Boot Media Clock : 166.667 MHz 
    [BOOTLOADER_PROFILE] Boot Image Size  : 185 KB 
    [BOOTLOADER_PROFILE] Cores present    : 
    mcu-r5f0-0
    r5f0-0
    [BOOTLOADER PROFILE] System_init                      :      38020us 
    [BOOTLOADER PROFILE] Board_init                       :          0us 
    [BOOTLOADER PROFILE] Drivers_open                     :        193us 
    [BOOTLOADER PROFILE] Board_driversOpen                :      11411us 
    [BOOTLOADER PROFILE] Sciclient Get Version            :      10183us 
    [BOOTLOADER PROFILE] App_waitForMcuPbist              :          5us 
    [BOOTLOADER PROFILE] App_loadImages                   :       3396us 
    [BOOTLOADER PROFILE] App_loadSelfcoreImage            :       6495us 
    [BOOTLOADER_PROFILE] SBL Total Time Taken             :      69706us 
    
    Image loading done, switching to application ...
    Starting MCU-r5f and 2nd stage bootloader
    
    SYSFW Firmware Version 9.2.7--v09.02.07 (Kool Koala)
    SYSFW Firmware revision 0x9
    SYSFW ABI revision 3.1
    
    [BOOTLOADER_PROFILE] Boot Media       : FLASH 
    [BOOTLOADER_PROFILE] Boot Media Clock : 166.667 MHz 
    [BOOTLOADER_PROFILE] Boot Image Size  : 1106 KB 
    [BOOTLOADER_PROFILE] Cores present    : 
    hsm-m4f0-0
    r5f0-0
    a530-0
    c75ss0
    [BOOTLOADER PROFILE] System_init                      :       1804us 
    [BOOTLOADER PROFILE] Board_init                       :          0us 
    [BOOTLOADER PROFILE] Drivers_open                     :        218us 
    [BOOTLOADER PROFILE] Board_driversOpen                :      50395us 
    [BOOTLOADER PROFILE] Sciclient Get Version            :      10283us 
    [BOOTLOADER PROFILE] App_loadImages                   :       2044us 
    [BOOTLOADER PROFILE] App_loadSelfcoreImage            :       6850us 
    [BOOTLOADER PROFILE] App_loadLinuxImages              :      28164us 
    [BOOTLOADER PROFILE] App_loadDSPImages                :      13068us 
    [BOOTLOADER_PROFILE] SBL Total Time Taken             :     112830us 
    
    Image loading done, switching to application ...
    Starting linux and RTOS/Baremetal applications
    NOTICE:  BL31: v2.9(release):v2.9.0-614-gd7a7135d32-dirty
    NOTICE:  BL31: Built : 09:34:15, Aug 24 2023
    
    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.7--v09.02.07 (Kool Koala)')
    am62a_init: board_init_f done
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Trying to boot from SPINAND
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    
    
    U-Boot 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    
    SoC:   AM62AX SR1.0 HS-FS
    Model: Texas Instruments AM62A7 SK
    DRAM:  2 GiB (effective 4 GiB)
    Core:  58 devices, 28 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0 
    => mtd list
    List of MTD devices:
    * spi-nand0
      - device: flash@0
      - parent: spi@fc40000
      - driver: spi_nand
      - path: /bus@f0000/bus@fc00000/spi@fc40000/flash@0
      - type: NAND flash
      - block size: 0x40000 bytes
      - min I/O: 0x1000 bytes
      - OOB size: 128 bytes
      - OOB available: 80 bytes
      - 0x000000000000-0x000008000000 : "spi-nand0"
              - 0x000000000000-0x000000080000 : "ospi_nand.tiboot3"
              - 0x000000080000-0x000000280000 : "ospi_nand.tispl"
              - 0x000000280000-0x000000680000 : "ospi_nand.u-boot"
              - 0x000000680000-0x0000006c0000 : "ospi_nand.env"
              - 0x0000006c0000-0x000000700000 : "ospi_nand.env.backup"
              - 0x000002000000-0x000007fc0000 : "ospi_nand.rootfs"
              - 0x000007fc0000-0x000008000000 : "ospi_nand.phypattern"
    => mtd erase spi-nand0
    Erasing 0x00000000 ... 0x07ffffff (512 eraseblock(s))
    => ls mmc 1
       315565   tiboot3-am62ax-gp-evm.bin
       318154   tiboot3-am62ax-hs-evm.bin
       318154   tiboot3-am62ax-hs-fs-evm.bin
       318154   tiboot3.bin
      1424087   tispl.bin
      1125699   u-boot.img
          639   uEnv.txt
    
    7 file(s), 0 dir(s)
    
    => load mmc 1 ${loadaddr} tiboot3.bin
    318154 bytes read in 118 ms (2.6 MiB/s)
    => mtd write spi-nand0 ${loadaddr} 0x0 $filesize
    Size not on a page boundary (0x1000), rounding to 0x4e000
    Writing 319488 byte(s) (78 page(s)) at offset 0x00000000
    => load mmc 1 ${loadaddr} tispl.bin
    1424087 bytes read in 389 ms (3.5 MiB/s)
    => mtd write spi-nand0 ${loadaddr} 0x80000 $filesize
    Size not on a page boundary (0x1000), rounding to 0x15c000
    Writing 1425408 byte(s) (348 page(s)) at offset 0x00080000
    => load mmc 1 ${loadaddr} u-boot.img
    1125699 bytes read in 338 ms (3.2 MiB/s)
    => mtd write spi-nand0 ${loadaddr} 0x280000 $filesize
    Size not on a page boundary (0x1000), rounding to 0x113000
    Writing 1126400 byte(s) (275 page(s)) at offset 0x00280000
    => 

    End of first part with commands, as executed by me.

    Booting from OSPI-NAND:

    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    am62a_init: board_init_f done
    SPL initial stack usage: 17040 bytes
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Trying to boot from SPINAND
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.9(release):v2.9.0-614-gd7a7135d32-dirty
    NOTICE:  BL31: Built : 09:34:15, Aug 24 2023
    
    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    am62a_init: board_init_f done
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Trying to boot from SPINAND
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    
    
    U-Boot 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    
    SoC:   AM62AX SR1.0 HS-FS
    Model: Texas Instruments AM62A7 SK
    DRAM:  2 GiB (effective 4 GiB)
    Core:  58 devices, 28 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0 
    => mtd list
    List of MTD devices:
    * spi-nand0
      - device: flash@0
      - parent: spi@fc40000
      - driver: spi_nand
      - path: /bus@f0000/bus@fc00000/spi@fc40000/flash@0
      - type: NAND flash
      - block size: 0x40000 bytes
      - min I/O: 0x1000 bytes
      - OOB size: 128 bytes
      - OOB available: 80 bytes
      - 0x000000000000-0x000008000000 : "spi-nand0"
              - 0x000000000000-0x000000080000 : "ospi_nand.tiboot3"
              - 0x000000080000-0x000000280000 : "ospi_nand.tispl"
              - 0x000000280000-0x000000680000 : "ospi_nand.u-boot"
              - 0x000000680000-0x0000006c0000 : "ospi_nand.env"
              - 0x0000006c0000-0x000000700000 : "ospi_nand.env.backup"
              - 0x000002000000-0x000007fc0000 : "ospi_nand.rootfs"
              - 0x000007fc0000-0x000008000000 : "ospi_nand.phypattern"
    => md.l 0x43000030 1
    43000030: 00000003                             ....
    => mw.l 0x43000030 0x0003
    => md.l 0x43000030 1
    43000030: 00000003                             ....
    => reset
    resetting ...
    
    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    am62a_init: board_init_f done
    SPL initial stack usage: 17040 bytes
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Trying to boot from SPINAND
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.9(release):v2.9.0-614-gd7a7135d32-dirty
    NOTICE:  BL31: Built : 09:34:15, Aug 24 2023
    
    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    am62a_init: board_init_f done
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Trying to boot from SPINAND
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    
    
    U-Boot 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    
    SoC:   AM62AX SR1.0 HS-FS
    Model: Texas Instruments AM62A7 SK
    DRAM:  2 GiB (effective 4 GiB)
    Core:  58 devices, 28 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    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: 00000003                             ....
    

    I can boot U-Boot from SPINAND.

    I want to be able to boot Linux from SPINAND.

    Regards

  • Hi Daniel,

    Have you created OSPI MTD re-partition as mentioned here and generated the UBI rootfs file?

    Regards,
    Aparna

  • Hi Aparna,

    Which part are you talking about?

    I started from:

     1. Bootup Linux from SD card and create the ubifs filesystem on mtd5 partition of SNOR.

    root@am62axx-evm:/opt/edgeai-gst-apps# ubiattach /dev/ubi_ctrl -m 5
    [   24.128959] ubi0: attaching mtd5
    [   24.333384] ubi0: scanning is finished
    [   24.343082] ubi0: attached mtd5 (name "ospi_nand.rootfs", size 95 MiB)
    [   24.349676] ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
    [   24.357029] ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
    [   24.363913] ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
    [   24.370907] ubi0: good PEBs: 383, bad PEBs: 0, corrupted PEBs: 0
    [   24.376936] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    [   24.384173] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
    [   24.392534] ubi0: available PEBs: 38, total reserved PEBs: 345, PEBs reserved for bad PEB handling: 10
    [   24.401859] ubi0: background thread "ubi_bgt0d" started, PID 1423
    UBI device number 0, total 383 LEBs (97263616 bytes, 92.7 MiB), available 38 LEBs (9650176 bytes, 9.2 MiB), LEB size 253952 bytes (248.0 KiB)
    root@am62axx-evm:/opt/edgeai-gst-apps# mount -t ubifs ubi0:rootfs /home/root/rootfs.ubi/                                                                                      
    [   37.832068] UBIFS (ubi0:0): Mounting in unauthenticated mode
    [   37.837969] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 1434
    [   37.899124] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
    [   37.906583] UBIFS (ubi0:0): LEB size: 253952 bytes (248 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes
    [   37.916513] UBIFS (ubi0:0): FS size: 81518592 bytes (77 MiB, 321 LEBs), max 331 LEBs, journal size 4063232 bytes (3 MiB, 16 LEBs)
    [   37.928206] UBIFS (ubi0:0): reserved for root: 3850324 bytes (3760 KiB)
    [   37.934836] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID C440D9EC-C158-4004-AC94-CDEDC1E2798F, small LPT model
    root@am62axx-evm:/opt/edgeai-gst-apps# ls -al /home/root/rootfs.ubi/boot/
    total 28312
    drwxr-xr-x  4 root root      600 Mar  9  2018 .
    drwxr-xr-x 18 root root     1248 Mar  9  2018 ..
    drwxr-xr-x  3 root root      224 Mar  9  2018 EFI
    lrwxrwxrwx  1 root root       24 Mar  9  2018 Image -> Image-6.1.46-g247b2535b2
    -rw-r--r--  1 root root 20302336 Mar  9  2018 Image-6.1.46-g247b2535b2
    drwxr-xr-x  3 root root      224 Mar  9  2018 dtb
    lrwxrwxrwx  1 root root       27 Mar  9  2018 fitImage -> fitImage-6.1.46-g247b2535b2
    -rw-r--r--  1 root root  8686514 Mar  9  2018 fitImage-6.1.46-g247b2535b2
    

    I followed the steps and this is a content of my mtd5 after reboot.

    The step :"3.2 Run some the following commands:" failed

    So what should I do next?

    In the thread, Hong changed the mtd partition from 7 to 9 inside U-Boot, kernel and DTB, so since there are no examples there I can't do the same.

    I think that in my current situation, I just need a set of correct U-Boot env variables, but I can't find those for now.

    One more think, in U-Boot how I can store env variables? 

    saveenv command is not present.

    Regards

  • Hi Aparna,

    Wanted to ask you one more thing.

    If you have in your facilities a working evb board that is booting all the way to Linux ( without SD CARD), just print me your U-Boot environment variables from that setup. I suspect that I missing some variable definitions.

    Thanks in advance,

     

  • Hi Daniel,

    Do you need the U-boot env variables for booting from OSPI NAND?
    I will need some time to try this on my setup. I will get back in two business days, with updates if I am able to get Linux running successfully from OSPI NAND.

    Regards,
    Aparna

  • Hello Aparna,

    Thank you very much and good luck!

    Regards

  • Hello Daniel,
    What is the size of the filesystem being used to create the .ubifs image ?

    One more think, in U-Boot how I can store env variables? 

    You can edit the uEnv.txt file in the boot partition to store the U-boot env variables.

    Regards,
    Aparna

  • Hello Aparna,

    I have a *.ubifs file which is around 50M size.

    Thanks for uEnv.txt solution.

    Regards

  • Hi Daniel,

    Could you follow along the steps mentioned in the below thread, as it looks very similar to your requirements.
    Edit: Removed broken link

    Regards,
    Aparna

  • Hello Aparna,

    Sorry for the late response, was out of the office.

    The link is broken 

    Regards

  • Hi Daniel,

    Apologies for sharing the link from an internal forum!
    I will summarize the steps if you are still unable to get Linux running from OSPI.

    Regards,
    Aparna

  • Hello Aparna,

    Yes please, if you can share U-Boot environment variables it would be great.

    Regards

  • Hello,

    Any progress there?

    Aparma, or somebody else, please help.

  • Hi Daniel,

    Apologies, I was in full day training for the past weeks.

    I have asked the concerned expert to comment on this, expect an answer soon.
    Meanwhile please refer the following for setting environment variables: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j721s2/09_01_00_06/exports/docs/linux/Foundational_Components/U-Boot/UG-NAND.html#booting-kernel-and-filesystem-from-nand

    Regards,
    Aparna

  • Hello Aparna,

    I'm glad you are back to save me!

    I'll take a look at the link

    Regards

  • Hi,

    AM62A has OSPI NAND flash part.
    The environment variables mentioned in the link should be same for AM62A.

    Regards,
    Aparna

  • Hi,

    OK, thanks, learning the link instructions.

  • Could you share the ubi image you had created to flash into mtd5 partition?
    It was created with 9.1 SDK tiny filesystem, right?

  • Hi,

    Meanwhile, I'm trying to configure U-Boot Environment in NAND according to the link from Processor SDK Linux for J721s2.

    I would like to  "Build U-Boot Using the U-Boot Top Level Makefile" according to link: https://dev.ti.com/tirex/explore/node?node=A__AfKXAKA65PRXsXvmJ-pTfw__AM62A-ACADEMY__WeZ9SsL__LATEST

    # cd PATH_TO_SDK/ti-processor-sdk-linux-rt-edgeai-am62axx-evm-09_02_00_01/

    Next is: Set Toolchain Path

    # source Rules.make
    # source Rules.make 
    bash: ti/k3-fpdlink: No such file or directory
    bash: ti/k3-am62x-sk: No such file or directory
    bash: ti/k3-v3link: No such file or directory
    MAKE_ALL_TARGETS?=: command not found
    CFLAGS?=: command not found
    INSTALL_MOD_STRIP?=1: command not found
    EXEC_DIR?=__EXEC_DIR__: command not found
    ROOTFS_PART?=__ROOTFS_PART__: command not found
    BOOT_PART?=__BOOT_PART__: command not found
    MAKE_JOBS?=1: command not found
    bash: export: `TI_SDK_PATH?=SDK_PATH/ti-processor-sdk-linux-rt-edgeai-am62axx-evm-09_02_00_01': not a valid identifier
    TI_SDK_PATH: command not found
    TI_SDK_PATH: command not found
    TI_SDK_PATH: command not found
    LINUX_DEVKIT_PATH: command not found
    CROSS_COMPILE: command not found
    SDK_PATH_TARGET: command not found
    bash: export: `--sysroot=': not a valid identifier
    TI_SDK_PATH: command not found
    Command 'shell' not found, did you mean:
      command 'jshell' from deb openjdk-11-jdk-headless (11.0.20.1+1-0ubuntu1~22.04)
      command 'jshell' from deb openjdk-17-jdk-headless (17.0.8.1+1~us1-0ubuntu1~22.04)
      command 'jshell' from deb openjdk-18-jdk-headless (18.0.2+9-2~22.04)
      command 'jshell' from deb openjdk-19-jdk-headless (19.0.2+7-0ubuntu3~22.04)
      command 'spell' from deb spell (1.0-24.2)
      command 'shelr' from deb shelr (0.16.3-2.1)
      command 'bshell' from deb avahi-ui-utils (0.8-5ubuntu5.1)
      command 'rshell' from deb pyboard-rshell (0.0.31-0ubuntu1)
    Try: apt install <deb name>
    TI_SDK_PATH: command not found
    Command 'shell' not found, did you mean:
      command 'spell' from deb spell (1.0-24.2)
      command 'shelr' from deb shelr (0.16.3-2.1)
      command 'rshell' from deb pyboard-rshell (0.0.31-0ubuntu1)
      command 'jshell' from deb openjdk-11-jdk-headless (11.0.20.1+1-0ubuntu1~22.04)
      command 'jshell' from deb openjdk-17-jdk-headless (17.0.8.1+1~us1-0ubuntu1~22.04)
      command 'jshell' from deb openjdk-18-jdk-headless (18.0.2+9-2~22.04)
      command 'jshell' from deb openjdk-19-jdk-headless (19.0.2+7-0ubuntu3~22.04)
      command 'bshell' from deb avahi-ui-utils (0.8-5ubuntu5.1)
    Try: apt install <deb name>
    TI_SDK_PATH: command not found
    Command 'shell' not found, did you mean:
      command 'spell' from deb spell (1.0-24.2)
      command 'shelr' from deb shelr (0.16.3-2.1)
      command 'jshell' from deb openjdk-11-jdk-headless (11.0.20.1+1-0ubuntu1~22.04)
      command 'jshell' from deb openjdk-17-jdk-headless (17.0.8.1+1~us1-0ubuntu1~22.04)
      command 'jshell' from deb openjdk-18-jdk-headless (18.0.2+9-2~22.04)
      command 'jshell' from deb openjdk-19-jdk-headless (19.0.2+7-0ubuntu3~22.04)
      command 'bshell' from deb avahi-ui-utils (0.8-5ubuntu5.1)
      command 'rshell' from deb pyboard-rshell (0.0.31-0ubuntu1)
    Try: apt install <deb name>
    TI_SDK_PATH: command not found
    Command 'shell' not found, did you mean:
      command 'rshell' from deb pyboard-rshell (0.0.31-0ubuntu1)
      command 'spell' from deb spell (1.0-24.2)
      command 'shelr' from deb shelr (0.16.3-2.1)
      command 'jshell' from deb openjdk-11-jdk-headless (11.0.20.1+1-0ubuntu1~22.04)
      command 'jshell' from deb openjdk-17-jdk-headless (17.0.8.1+1~us1-0ubuntu1~22.04)
      command 'jshell' from deb openjdk-18-jdk-headless (18.0.2+9-2~22.04)
      command 'jshell' from deb openjdk-19-jdk-headless (19.0.2+7-0ubuntu3~22.04)
      command 'bshell' from deb avahi-ui-utils (0.8-5ubuntu5.1)
    Try: apt install <deb name>
    TI_SDK_PATH: command not found
    Command 'shell' not found, did you mean:
      command 'rshell' from deb pyboard-rshell (0.0.31-0ubuntu1)
      command 'jshell' from deb openjdk-11-jdk-headless (11.0.20.1+1-0ubuntu1~22.04)
      command 'jshell' from deb openjdk-17-jdk-headless (17.0.8.1+1~us1-0ubuntu1~22.04)
      command 'jshell' from deb openjdk-18-jdk-headless (18.0.2+9-2~22.04)
      command 'jshell' from deb openjdk-19-jdk-headless (19.0.2+7-0ubuntu3~22.04)
      command 'shelr' from deb shelr (0.16.3-2.1)
      command 'bshell' from deb avahi-ui-utils (0.8-5ubuntu5.1)
      command 'spell' from deb spell (1.0-24.2)
    Try: apt install <deb name>
    TI_SDK_PATH: command not found
    bash: UBOOT_ATF?=/board-support/prebuilt-images/bl31.bin: No such file or directory
    TI_SDK_PATH: command not found
    bash: UBOOT_TEE?=/board-support/prebuilt-images/bl32.bin: No such file or directory
    TI_SDK_PATH: command not found
    bash: TI_LINUX_FIRMWARE?=/board-support/prebuilt-images: No such file or directory
    TI_SDK_PATH: command not found
    bash: fitImage_its?=/board-support/prebuilt-images/fitImage.its: No such file or directory
    UBOOT_SRC_DIR: command not found
    ARMV8: command not found
    bash: UBOOT_ARMV8_BUILD?=/build/: No such file or directory
    UBOOT_SRC_DIR: command not found
    bash: UBOOT_R5_BUILD?=/build/r5: No such file or directory
    TI_SDK_PATH: command not found
    bash: STAGING_DIR?=/board-support/built-images: No such file or directory

    After that I can make a menuconfig, but I can't compile the source.
    Please advice
  • Hi Daniel,

    Could you provide the complete SDK installation path and run the command.

    Please note that Using the SDK top level Makefile is convenient as it wraps the build steps in a single command.

    make a menuconfig

    make menuconfig can be compiled even if you build from SDK top level make file.

    Regards,
    Aparna

  • Good day Aparna,

    make menuconfig can be compiled even if you build from SDK top level make file.

    How?

    I tried from <SDK_PATH>

    make u-boot menuconfig

    It builds U-Boot and then:

    ...
     LD      u-boot
      OBJCOPY u-boot.srec
      OBJCOPY u-boot-nodtb.bin
      SYM     u-boot.sym
      CAT     u-boot-dtb.bin
      MKIMAGE u-boot.img
      MKIMAGE u-boot-dtb.img
      COPY    u-boot.bin
      CC      spl/common/spl/spl.o
      AR      spl/common/spl/built-in.o
      LD      spl/u-boot-spl
      OBJCOPY spl/u-boot-spl-nodtb.bin
      SYM     spl/u-boot-spl.sym
      CAT     spl/u-boot-spl-dtb.bin
      COPY    spl/u-boot-spl.bin
      BINMAN  .binman_stamp
      OFCHK   .config
    make[2]: Leaving directory 'SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/build/r5'
    make[1]: Leaving directory 'SDK_PATH//board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674'
    make: *** No rule to make target 'menuconfig'.  Stop.

    Also tried to write in another way:

    from <SDK_PATH> make menuconfig u-boot
    make: *** No rule to make target 'menuconfig'. Stop.

    Regards

  • Hi again,

    My SDK_PATH is not a default /home/user/ti location

    It's a PATH_TO_WORK_FOLDER/ti-processor-sdk-linux-rt-edgeai-am62axx-evm-09_02_00_01

  • Hi Daniel,

    make menuconfig should be run from respective U-boot directory:

    To build U-boot:
    /home/aparna/ti/ti-processor-sdk-linux-edgeai-am62axx-evm-09_01_00_07/$ make u-boot
    
    
    To open menuconfig:
    /home/aparna/ti/ti-processor-sdk-linux-edgeai-am62axx-evm-09_01_00_07/board-support/ti-u-boot-2023.04+gitAUTOINC+b0d717b732-gb0d717b732/$ make menuconfig
    
    
    To r-build U-boot after making menuconfig changes:
    /home/aparna/ti/ti-processor-sdk-linux-edgeai-am62axx-evm-09_01_00_07/$ make u-boot


    Regards,
    Aparna

  • Hello Aparna,

    Thanks for the U-Boot build explanations, noted and I'll follow it.

    The last open issue is U-Boot environment variables as I asked before.

    Regards

  • One more question regarding the UBoot compilation.

    The O=build/a53 is required?

    According to the explanation in Academy:

    $ cd <UBOOT_DIR>/
    $ export ARCH=arm
    $ make am62ax_evm_a53_defconfig O=build/a53
    $ make -j8 BINMAN_INDIRS=$(pwd)/../prebuilt-images BL31=../prebuilt-images/bl31.bin TEE=../prebuilt-images/bl32.bin O=build/a53

    Please advice

  • Hi Daniel,

    O=build/a53 indicated the directory to store the output images. You can modify it according to your use-case.

    Regards,
    Aparna

  • Hi Apana,

    Yes, I'm aware of such an explanation.

    I have difficulty compiling UBoot from the UBoot folder ( for A53).

    I suspect that "make u-boot" command from SDK_PATH is overwriting the .config .

    If I'm trying to follow the instructions from: https://dev.ti.com/tirex/explore/node?node=A__AfKXAKA65PRXsXvmJ-pTfw__AM62A-ACADEMY__WeZ9SsL__LATEST

    What are the required steps?

    I can't execute the Set Toolchain Path step, it fails ( if it is needed, how can I successfully execute it)?

    If I'm skipping this step and continuing to Compile ARM64 Image

    In the last step, the compilation fails with some errors:

    make -j8 BINMAN_INDIRS=$(pwd)/../prebuilt-images BL31=../prebuilt-images/bl31.bin TEE=../prebuilt-images/bl32.bin O=build/a53
    make[1]: Entering directory 'SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/build/a53'
      GEN     Makefile
    arch/../configs/am62ax_evm_a53_defconfig:167:warning: override: reassigning to symbol SUPPORT_EMMC_BOOT
    #
    # configuration written to .config
    #
    make[1]: Leaving directory 'SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/build/a53'
    root@daniel-Latitude-7430:SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674# make -j8 BINMAN_INDIRS=$(pwd)/../prebuilt-images BL31=../prebuilt-images/bl31.bin TEE=../prebuilt-images/bl32.bin O=build/a53
    make[1]: Entering directory 'SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/build/a53'
      GEN     Makefile
    scripts/kconfig/conf  --syncconfig Kconfig
      CFG     u-boot.cfg
      GEN     include/autoconf.mk.dep
      CFG     spl/u-boot.cfg
    cc1: warning: unknown register name: x18
    cc1: warning: unknown register name: x18
    cc1: warning: unknown register name: x18
      GEN     include/autoconf.mk
      GEN     spl/include/autoconf.mk
      GEN     Makefile
      ENVC    include/generated/env.txt
      UPD     include/generated/timestamp_autogenerated.h
      Using SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674 as source for U-Boot
      ENVP    include/generated/env.in
      UPD     include/generated/version_autogenerated.h
      ENVT    include/generated/environment.h
      CC      lib/asm-offsets.s
      CC      arch/arm/lib/asm-offsets.s
    cc1: warning: unknown register name: x18
    cc1: error: bad value (‘armv8-a+crc’) for ‘-march=’ switch
    cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 native
    cc1: warning: unknown register name: x18
    cc1: error: bad value (‘armv8-a+crc’) for ‘-march=’ switch
    cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 native
    make[2]: *** [SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/scripts/Makefile.build:146: lib/asm-offsets.s] Error 1
    make[2]: *** Waiting for unfinished jobs....
    make[2]: *** [SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/scripts/Makefile.build:146: arch/arm/lib/asm-offsets.s] Error 1
    make[1]: *** [SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/Makefile:1907: prepare0] Error 2
    make[1]: Leaving directory 'SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/build/a53'
    make: *** [Makefile:177: sub-make] Error 2
    

    I made another export

    I added

    export CROSS_COMPILE=SDK_PATH/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-

    and tried to compile again, with the same command.

    This time I failed in the linkage stage:

    CC      lib/rtc-lib.o
    CC      lib/elf.o
    AR      lib/built-in.o
    LD      u-boot
    SDK_PATH/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-ld.bfd: cannot find -lgcc: No such file or directory
    make[1]: *** [SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/Makefile:1755: u-boot] Error 1
    make[1]: Leaving directory 'SDK_PATH/board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/build/a53'
    make: *** [Makefile:177: sub-make] Error 2
    

    It looks like, the Academy page is missing some info.

    Can you help me with this issue, please?

  • Hi Daniel,

    Steps to re-build U-boot manually:

    $ export UBOOT_DIR=/home/aparna/ti/ti-processor-sdk-linux-edgeai-am62axx-evm-09_01_00_07/board-support/ti-u-boot-2023.04+gitAUTOINC+b0d717b732-gb0d717b732/
    $ export TI_LINUX_FW_DIR=/home/aparna/ti/ti-processor-sdk-linux-edgeai-am62axx-evm-09_01_00_07/board-support/prebuilt-images/
    
    R5
    To build tiboot3.bin. Saved in $UBOOT_DIR/out/r5.
    $ make ARCH=arm CROSS_COMPILE=/home/aparna/Downloads/sdk/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf- am62ax_evm_r5_defconfig O=$UBOOT_DIR/out/r5
    $ make ARCH=arm CROSS_COMPILE=/home/aparna/Downloads/sdk/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf- O=$UBOOT_DIR/out/r5 BINMAN_INDIRS=$TI_LINUX_FW_DIR
    
    A53
    To build tispl.bin and u-boot.img. Saved in $UBOOT_DIR/out/a53. Requires bl31.bin, tee-pager_v2.bin.
    $ make ARCH=arm CROSS_COMPILE=/home/aparna/Downloads/sdk/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- am62ax_evm_a53_defconfig O=$UBOOT_DIR/out/a53
    $ make ARCH=arm CROSS_COMPILE=/home/aparna/Downloads/sdk/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- BL31=$TI_LINUX_FW_DIR/bl31.bin TEE=$TI_LINUX_FW_DIR/bl32.bin O=$UBOOT_DIR/out/a53 BINMAN_INDIRS=$TI_LINUX_FW_DIR

    Regards,
    Aparna

  • Hello Aparna,

    I downloaded

    from https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads.

    Defined all the exports, and the compilation passed. Thank you for a detailed explanation.

    Are you sure, that an external GCC download is required? Because when you run make u-boot from SDK_FOLDER it succeeds and without need of external GCC.

    But it's fine with me to compile the source this way.

    So as far as I can see, there is only the UBoot environment variables issue that is still open.

    Regards

  • Hi Daniel,

    You can provide the path to any GCC compiler, not necessarily an external one. 

    Could you summarize the steps you have followed to flash the UBI image and kernel images into OSPI NAND?

    If you have the ubi filesystem correctly flashed:

    # Inspect the MTD partition map
    root@am62axx-evm:~# cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 00080000 00040000 "ospi.tiboot3"
    mtd1: 00200000 00040000 "ospi.tispl"
    mtd2: 00400000 00040000 "ospi.u-boot"
    mtd3: 00040000 00040000 "ospi.env"
    mtd4: 00040000 00040000 "ospi.env.backup"
    mtd5: 05fc0000 00040000 "ospi.rootfs"
    mtd6: 00040000 00040000 "ospi.phypattern"
    
    # Formatting the MTD device as an UBI device while programming an UBI image
    root@am62axx-evm:~# ubiformat /dev/mtd5 -f <filename>.ubi                                                                                                                                                                                                     ubiformat: mtd5 (nand), size 100401152 bytes (95.7 MiB), 383 eraseblocks of 262144 bytes (256.0 KiB), min. I/O size 4096 bytes                                                                                                                              libscan: scanning eraseblock 382 -- 100 % complete                                                                                                                                                                                                          ubiformat: 383 eraseblocks have valid erase counter, mean value is 5                                                                                                                                                                                        ubiformat: flashing eraseblock 29 -- 100 % complete                                                                                                                                                                                                         ubiformat: formatting eraseblock 382 -- 100 % complete
    ubiformat: mtd5 (nand), size 100401152 bytes (95.7 MiB), 383 eraseblocks of 262144 bytes (256.0 KiB), min. I/O size 4096 bytes
    libscan: scanning eraseblock 382 -- 100 % complete
    ubiformat: 383 eraseblocks have valid erase counter, mean value is 5
    ubiformat: flashing eraseblock 29 -- 100 % complete
    ubiformat: formatting eraseblock 382 -- 100 % complete
    
    # Attaching the MTD device will create /dev/ubi* device nodes
    root@am62axx-evm:~# ubiattach -p /dev/mtd5
    [ 2009.147831] ubi0: attaching mtd5
    [ 2009.300433] ubi0: scanning is finished
    [ 2009.313789] ubi0: volume 0 ("rootfs") re-sized from 265 to 369 LEBs
    [ 2009.320655] ubi0: attached mtd5 (name "ospi.rootfs", size 95 MiB)
    [ 2009.326802] ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
    [ 2009.333852] ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
    [ 2009.340666] ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
    [ 2009.347744] ubi0: good PEBs: 383, bad PEBs: 0, corrupted PEBs: 0
    [ 2009.353766] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    [ 2009.361166] ubi0: max/mean erase counter: 6/6, WL threshold: 4096, image sequence number: 1657132304
    [ 2009.370313] ubi0: available PEBs: 0, total reserved PEBs: 383, PEBs reserved for bad PEB handling: 10
    [ 2009.379808] ubi0: background thread "ubi_bgt0d" started, PID 2402
    UBI device number 0, total 383 LEBs (97263616 bytes, 92.7 MiB), available 0 LEBs (0 bytes), LEB size 253952 bytes (248.0 KiB)
    
    # Mount the UBI partition the standard way
    root@am62axx-evm:~# mount /dev/ubi0_0 /mnt/flash/
    [ 2131.720861] UBIFS error (pid: 2477): cannot open "ubi0:flash_fs", error -19
    [ 2156.594590] UBIFS (ubi0:0): Mounting in unauthenticated mode
    [ 2156.607442] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 2496
    [ 2156.663049] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
    [ 2156.670466] UBIFS (ubi0:0): LEB size: 253952 bytes (248 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes
    [ 2156.680533] UBIFS (ubi0:0): FS size: 91168768 bytes (86 MiB, 359 LEBs), journal size 9404416 bytes (8 MiB, 38 LEBs)
    [ 2156.690984] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
    [ 2156.696963] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 7D1E559B-5F0E-4639-80D2-14221ACE3B9E, small LPT model
    
    # We can now access the partition!!
    root@am62axx-evm:~# ls -al /mnt/flash/
    total 4
    drwxr-xr-x 17 1001 1001 1184 Feb 27  2023 .
    drwxr-xr-x  3 root root 4096 Feb 27 11:13 ..
    drwxr-xr-x  2 1001 1001 5128 Feb 27  2023 bin
    drwxr-xr-x  2 1001 1001  160 Feb 27 10:59 boot
    drwxr-xr-x  2 1001 1001  160 Feb 27 10:59 dev
    drwxr-xr-x 19 1001 1001 3496 Feb 27  2023 etc
    drwxr-xr-x  3 1001 1001  224 Feb 27 10:59 home
    drwxr-xr-x  4 1001 1001 3168 Feb 27  2023 lib
    lrwxrwxrwx  1 1001 1001   19 Feb 27  2023 linuxrc -> /bin/busybox.nosuid
    drwxr-xr-x  2 1001 1001  160 Feb 27 10:59 media
    drwxr-xr-x  2 1001 1001  160 Feb 27 10:59 mnt
    dr-xr-xr-x  2 1001 1001  160 Feb 27 10:59 proc
    drwxr-xr-x  2 1001 1001  160 Feb 27  2023 run
    drwxr-xr-x  2 1001 1001 4520 Feb 27  2023 sbin
    dr-xr-xr-x  2 1001 1001  160 Feb 27 10:59 sys
    drwxrwxr-x  2 1001 1001  160 Feb 27 10:59 tmp
    drwxr-xr-x  9 1001 1001  608 Feb 27  2023 usr
    drwxr-xr-x  8 1001 1001  808 Feb 27  2023 var

    Burn the ubi image to mtd partition:

    load mmc 1:2 ${loadaddr}  <filename>.ubi
    
    mtd erase spi-nand0 0x2000000 0x5fc0000.
    
    mtd write spi-nand0 ${loadaddr} 0x2000000 ${filesize}

    SD card has the Image and dtb files in root/boot partition, you can try the following at U-boot prompt:

    # In order to boot from UBIFS in NAND, first boot the
    # tisdk-default-image-am62axx-evm.wic from SD card on
    # an SK-AM62A board. Then, stop the U-Boot autoboot
    # countdown and issue the below command. This will
    # load Kernel and FDT from SD card, while mounting the
    # UBIFS in NAND as rootfs.
    => run findfdt args_all args_ospi_nand ubi_init get_kern_mmc get_fdt_mmc run_kern

    Regards,
    Aparna

  • Hi Aparna,

    I'll need to verify that I made the steps you are mentioned.

    Meanwhile, the reason I asked you to send the UBoot env is:

    => run findfdt args_all args_ospi_nand ubi_init get_kern_mmc get_fdt_mmc run_kern
    ## Error: "ubi_init" not defined
    => run ubi_init
    ## Error: "ubi_init" not defined
     

    I'm missing the ubi_init command. I know that it's not env variable, but a command.

    I'm sharing my printenv UBoot command output

    addr_fit=0x90000000
    arch=arm
    args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 ${mtdparts}
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    args_ospi_nand=setenv bootargs console=${console} ${optargs} ubi.mtd=${ospi_nand_bootpart} root=${ospi_nand_bootvolume} rootfstype=ubifs
    baudrate=115200
    board=am62ax
    board_name=am62ax
    boot=mmc
    boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
    boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr -q ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_ri
    boot_efi_bootmgr=if fdt addr -q ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
    boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
    boot_fdt=try
    boot_fit=0
    boot_net_usb_start=usb start
    boot_prefixes=/ /boot/
    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; env set secure_suffix; if test ${secure_rprocs} -eq 1; then env set secure_suffix -sec; fi; for i in ${rproc_fw_binaries} ; do if test -z "${rproc_id}"e
    boot_script_dhcp=boot.scr.uimg
    boot_scripts=boot.scr.uimg boot.scr
    boot_syslinux_conf=extlinux/extlinux.conf
    boot_targets=ti_mmc mmc0 mmc1 usb0 pxe dhcp 
    bootargs=console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=spi-nand0:512k(ospi_nand.tiboot3),2m(ospi_nand.tispl),4m(ospi_nand.u-boot),256k(ospi_nand.env),256k(ospi_nand.env.backup),9804s
    bootcmd=run envboot; run distro_bootcmd;
    bootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_a;
    bootcmd_mmc0=devnum=0; run mmc_boot
    bootcmd_mmc1=devnum=1; run mmc_boot
    bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
    bootcmd_ti_mmc=run findfdt; run init_${boot}; if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1; then run main_cpsw0_qsgmii_phyinit; fi; run boot_rprocs; if test ${boot_fit} -eq 1; then run get_fit_${boot}; ;
    bootcmd_usb0=devnum=0; run usb_boot
    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
    default_device_tree=ti/k3-am62a7-sk.dtb
    dfu_alt_info_emmc=rawemmc raw 0 0x800000 mmcpart 1; rootfs part 0 1; 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.r1
    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_nand=NAND.tiboot3 part 0 1; NAND.tispl part 0 2; NAND.tiboot3.backup part 0 3; NAND.u-boot part 0 4; NAND.u-boot-env part 0 5; NAND.u-boot-env.backup part 0 6; NAND.file-system part 0 7
    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 00
    dfu_alt_info_ospi_nand=ospi_nand.tiboot3 part 1; ospi_nand.tispl part 2; ospi_nand.u-boot part 3; ospi_nand.env part 4; ospi_nand.env.backup part 5; ospi_nand.rootfs part 6; ospi_nand.phypattern part 7
    dfu_alt_info_ram=tispl.bin ram 0x80080000 0x200000; u-boot.img ram 0x81000000 0x400000
    distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
    dorprocboot=0
    dtboaddr=0x89000000
    efi_dtb_prefixes=/ /dtb/ /dtb/current/
    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 im;
    ethaddr=1c:63:49:15:92:64
    fdt_addr_r=0x88000000
    fdtaddr=0x88000000
    fdtcontroladdr=fde918d0
    fdtfile=ti/k3-am62a7-sk.dtb
    fdtoverlay_addr_r=0x89000000
    findfdt=setenv name_fdt ${default_device_tree}; setenv fdtfile ${name_fdt}
    finduuid=part uuid ${boot} ${bootpart} uuid
    get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt}
    get_fdt_ospi_nand=ubifsload ${fdtaddr} ${bootdir}/dtb/${fdtfile};
    get_fit_config=setexpr name_fit_config gsub / _ conf-${fdtfile}
    get_fit_mmc=load mmc ${bootpart} ${addr_fit} ${bootdir}/${name_fit}
    get_fit_ospi_nand=ubifsload ${addr_fit} ${bootdir}/${name_fit}
    get_fit_overlaystring=for overlay in $name_overlays; do; setexpr name_fit_overlay gsub / _ conf-${overlay}; setenv overlaystring ${overlaystring}'#'${name_fit_overlay}; done;
    get_kern_mmc=load mmc ${bootpart} ${loadaddr} ${bootdir}/${name_kern}
    get_kern_ospi_nand=ubifsload ${loadaddr} ${bootdir}/${name_kern}
    get_overlay_mmc=fdt address ${fdtaddr}; fdt resize 0x100000; for overlay in $name_overlays; do; load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/ti/${overlay} && fdt apply ${dtboaddr}; done;
    get_overlay_ospi_nand=fdt address ${fdtaddr} fdt resize 0x100000; for overlay in $name_overlays; do; ubifsload ${dtboaddr} ${bootdir}/dtb/${overlay} && fdt apply ${dtboaddr}; done;
    importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
    init_mmc=run args_all args_mmc
    init_ospi_nand=run args_all args_ospi_nand ospi_nand_ubi_init
    ipaddr=10.11.80.67
    kernel_addr_r=0x82000000
    load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
    loadaddr=0x82000000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
    loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
    loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile}
    loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
    mmcboot=mmc dev ${mmcdev}; devnum=${mmcdev}; 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;
    mmcdev=0
    mmcloados=if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run get_fdt_mmc; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT;
    mmcrootfstype=ext4 rootwait
    mtdids=spi-nand0=spi-nand0
    mtdparts=mtdparts=spi-nand0:512k(ospi_nand.tiboot3),2m(ospi_nand.tispl),4m(ospi_nand.u-boot),256k(ospi_nand.env),256k(ospi_nand.env.backup),98048k@32m(ospi_nand.rootfs),256k@130816k(ospi_nand.phypattern)
    name_fdt=ti/k3-am62a7-sk.dtb
    name_fit=fitImage
    name_kern=Image
    optargs=earlycon=ns16550a,mmio32,0x02800000 mtdparts=spi-nand0:512k(ospi_nand.tiboot3),2m(ospi_nand.tispl),4m(ospi_nand.u-boot),256k(ospi_nand.env),256k(ospi_nand.env.backup),98048k@32m(ospi_nand.rootfs))
    ospi_nand_bootpart=ospi_nand.rootfs
    ospi_nand_bootvolume=ubi0:rootfs
    ospi_nand_ubi_init=ubi part ${ospi_nand_bootpart}; ubifsmount ${ospi_nand_bootvolume};
    partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
    pxefile_addr_r=0x80100000
    ramdisk_addr_r=0x88080000
    rd_spec=-
    rdaddr=0x88080000
    rproc_fw_binaries= 0 /lib/firmware/am62a-mcu-r5f0_0-fw 1 /lib/firmware/am62a-c71_0-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=run get_fit_config; bootm ${addr_fit}#${name_fit_config}${overlaystring}
    run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
    scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
    scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpartt
    scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_ee
    scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo EXTLINUX FAILED: continuini
    scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRe
    scriptaddr=0x80000000
    secure_rprocs=0
    serverip=10.11.80.44
    soc=k3
    stderr=serial@2800000
    stdin=serial@2800000
    stdout=serial@2800000
    ubifs_boot=if ubi part ${bootubipart} ${bootubioff} && ubifsmount ubi0:${bootubivol}; then devtype=ubi; devnum=ubi0; bootfstype=ubifs; distro_bootpart=${bootubivol}; run scan_dev_for_boot; ubifsumount; fi
    update_to_fit=setenv loadaddr ${addr_fit}; setenv bootfile ${name_fit}
    usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
    vendor=ti
    
    Environment size: 10579/262140 bytes
    

    Maybe you'll find in my list some missing commands.

    Regards

  • HI Daniel,

    let me look into this. I'm out of the office today but will look soon after I return.

    Regards, Andreas

  • Thanks Daniel! I will check this.

  • Hello Aparna,

    I managed to reproduce the ubi image creation and partially succeeded in booting from OSPI.

    Switches configured to xSPI BOOT MODE (according to https://dev.ti.com/tirex/explore/content/am62ax_academy_9_01_00_00_v1/_build_am62ax_academy_9_01_00_00_v1/source/linux/ch-develop/dev-evm-bootmodesw.html#dev-evm-bootmode-switches)

    UBoot prints:

    NOTICE:  BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
    NOTICE:  BL31: Built : 16:09:05, Feb  9 2024
    
    U-Boot SPL 2023.04-ti-gf9b966c67473 (Mar 19 2024 - 20:31:40 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.7--v09.02.07 (Kool Koala)')
    am62a_init: board_init_f done
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Trying to boot from SPINAND
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x10 bootindex = 0
    Authentication passed
    
    
    U-Boot 2023.04-ti-gf9b966c67473 (Mar 19 2024 - 20:31:40 +0000)
    
    SoC:   AM62AX SR1.0 HS-FS
    Model: Texas Instruments AM62A7 SK
    DRAM:  2 GiB (effective 4 GiB)
    Core:  58 devices, 28 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0 
    =>

    Those are my steps:

    1. Took a file tisdk-tiny-image-am62axx-evm.tar.xz from SDK/filesystems folder and extracted it.

    2. Created ubi.cfg file and placed it 1 folder above extracted folder with rootfs files.

    [rootfs]
    mode=ubi
    image=rootfs.ubifs
    vol_id=0
    vol_size=91MiB   # Adjust according to your rootfs size
    vol_type=dynamic
    vol_name=rootfs
    vol_flags=autoresize

    On PC:

    3. Create rootfs.ubifs

     mkfs.ubifs -r EXTRACTED_FODLER/ -o rootfs.ubifs -m 4096 -e 253952 -c 364

    4. Create the UBI Image

    ubinize -o rootfs.ubi -m 4096 -p 256KiB -s 4096 ubi.cfg

    5. Copied rootfs.ubi over SSH, while EVB is booted to Linux from SDARD.

    On TI AM62a EVB: (as you suggested in your last reply)

    6.  Formatting the MTD device as an UBI device while programming an UBI image
    ubiformat /dev/mtd5 -f rootfs.ubi

    7. Attaching the MTD device will create /dev/ubi* device nodes
    ubiattach /dev/ubi_ctrl -m 5

    8. Mount the UBI partition the standard way to a created /mnt/flash folder
    mount /dev/ubi0_0 /mnt/flash/

    9. Now we can access the partition

    root@am62axx-evm:~# ls -al /mnt/flash/
    total 8
    drwxr-xr-x 18 root root 1328 Jun  2  2024 .
    drwxr-xr-x  4 root root 4096 May 27 23:19 ..
    drwxr-xr-x  2 root root 6464 Mar  9  2018 bin
    drwxr-xr-x  4 root root  600 Mar  9  2018 boot
    drwxr-xr-x  2 root root  160 Mar  9  2018 dev
    drwxr-xr-x 20 root root 3816 Mar  9  2018 etc
    drwxr-xr-x  3 root root  224 Mar  9  2018 home
    drwxr-xr-x  9 root root 3416 Mar  9  2018 lib
    lrwxrwxrwx  1 root root   19 Mar  9  2018 linuxrc -> /bin/busybox.nosuid
    drwxr-xr-x  2 root root  160 Mar  9  2018 media
    drwxr-xr-x  2 root root  160 Mar  9  2018 mnt
    dr-xr-xr-x  2 root root  160 Mar  9  2018 proc
    drwxr-xr-x  2 root root  160 Mar  9  2018 run
    drwxr-xr-x  2 root root 4824 Mar  9  2018 sbin
    drwxr-xr-x  2 root root  160 Mar  9  2018 srv
    dr-xr-xr-x  2 root root  160 Mar  9  2018 sys
    drwxrwxrwt  2 root root  160 Mar  9  2018 tmp
    drwxr-xr-x 10 root root  672 Mar  9  2018 usr
    drwxr-xr-x  8 root root  808 Mar  9  2018 var

    10. Last step, from UBoot prompt (with SDCARD)

    run findfdt args_all args_ospi_nand get_kern_mmc get_fdt_mmc run_kern

    The system boots to Tiny FS Linux.

    So I managed to achieve :

    "# load Kernel and FDT from SD card, while mounting the
    # UBIFS in NAND as rootfs." 

    Burn the ubi image to mtd partition:

    I failed in this stage.

    What next? Please advice

  • Hello Daniel, is the dtb and Image file flashed into MTD partition using mtd write command?

  • Hello Aparna,

    Please share with me the commands for doing that and as well the correct configuration of UBoot env variables.

    Regards

  • Burn the ubi image to mtd partition:

    I failed in this stage.

    What next? Please advice

    Can you provide a log that shows what failed here?

    Regards, Andreas

  • Hello Andreas,

    I tried one more time to execute those commands and it worked OK this time:

    tftp  ${loadaddr} tiny_image.ubi
    link up on port 1, speed 1000, full duplex
    Using ethernet@8000000port@1 device
    TFTP from server 10.11.80.82; our IP address is 10.11.80.67
    Filename 'tiny_image.ubi'.
    Load address: 0x82000000
    Loading: ####T ##############################################  53 MiB
             5.3 MiB/s
    done
    Bytes transferred = 55574528 (3500000 hex)
    
    => mtd erase spi-nand0 0x2000000 0x5fc0000
    Erasing 0x02000000 ... 0x07fbffff (383 eraseblock(s))
    
    => mtd write spi-nand0 ${loadaddr} 0x2000000 ${filesize}
    Writing 55574528 byte(s) (13568 page(s)) at offset 0x02000000
    
    

    The open issues, for now, are the UBoot env variables and maybe some other needed stages.

    The goal is to be able to boot only from OSPI NAND.

    As Aparna mentioned the mtd command, can you please share those with me, so we can be synchronized? 

    Right now I need an SDCARD with kernel and DTB. The rootfs is booting from OSPI.

    Regards

  • Hi Daniel,

    The goal is to be able to boot only from OSPI NAND.

    You need to be loading kernel and dtb from the NAND rootfs, and the environment that's part of your U-Boot should allow you to do that. Here's a summary of relevant commands so we can see what they do, directly taken from the U-Boot source..

    a0797059@dasso:~/git/u-boot (ti-u-boot-2023.04)
    $ cat include/environment/ti/ospi_nand.env
    mtdids=spi-nand0=spi-nand0
    mtdparts=mtdparts=spi-nand0:512k(ospi_nand.tiboot3),2m(ospi_nand.tispl),4m(ospi_nand.u-boot),256k(ospi_nand.env),256k(ospi_nand.env.backup),98048k@32m(ospi_nand.rootfs),256k@130816k(ospi_nand.phypattern)
    
    ospi_nand_bootpart=ospi_nand.rootfs
    ospi_nand_bootvolume=ubi0:rootfs
    ospi_nand_ubi_init=ubi part ${ospi_nand_bootpart}; ubifsmount ${ospi_nand_bootvolume};
    args_ospi_nand=setenv bootargs console=${console}
            ${optargs} ubi.mtd=${ospi_nand_bootpart}
            root=${ospi_nand_bootvolume} rootfstype=ubifs
    init_ospi_nand=run args_all args_ospi_nand ospi_nand_ubi_init
    get_fdt_ospi_nand=ubifsload ${fdtaddr} ${bootdir}/dtb/${fdtfile};
    get_overlay_ospi_nand=
            fdt address ${fdtaddr}
            fdt resize 0x100000;
            for overlay in $name_overlays;
            do;
            ubifsload ${dtboaddr} ${bootdir}/dtb/${overlay} &&
            fdt apply ${dtboaddr};
            done;
    get_kern_ospi_nand=ubifsload ${loadaddr} ${bootdir}/${name_kern}
    get_fit_ospi_nand=ubifsload ${addr_fit} ${bootdir}/${name_fit}

    So you can see (bottom 2 lines) that you'll need to use get_kern_ospi_nand and get_fit_ospi_nand. You can either update the command line Aparna provided earlier, or use the higher-level commands that do everything.

    => env set boot ospi_nand
    => boot
    switch to partitions #0, OK
    mmc1 is current device
    SD/MMC found on device 1
    Failed to load 'boot.scr'
    574 bytes read in 25 ms (21.5 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    ubi0: attaching mtd6
    ubi0: scanning is finished
    ubi0: attached mtd6 (name "ospi_nand.rootfs", size 95 MiB)
    ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
    ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
    ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
    ubi0: good PEBs: 383, bad PEBs: 0, corrupted PEBs: 0
    ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    ubi0: max/mean erase counter: 1309/793, WL threshold: 4096, image sequence number: 1657132304
    ubi0: available PEBs: 0, total reserved PEBs: 383, PEBs reserved for bad PEB handling: 10
    <...snip...>

    Then, you can (and probably should) also skip the access to MMC trying to load the bootscript, so you can be completely MMC access-free, by also editing the bootcmd as follows:

    => env set boot ospi_nand
    => env set bootcmd run distro_bootcmd
    => boot
    ubi0: attaching mtd6
    ubi0: scanning is finished
    ubi0: attached mtd6 (name "ospi_nand.rootfs", size 95 MiB)
    ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
    ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
    ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
    ubi0: good PEBs: 383, bad PEBs: 0, corrupted PEBs: 0
    ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    ubi0: max/mean erase counter: 1309/793, WL threshold: 4096, image sequence number: 1657132304
    ubi0: available PEBs: 0, total reserved PEBs: 383, PEBs reserved for bad PEB handling: 10
    <...snip...>

    If you want to make those changes permanent you can either edit the U-Boot ENV directly by modifying the respective header files, or update U-Boot's CONFIG_BOOTCOMMAND to list the sequence of commands as discussed above (commands separated by semicolons).

    Regards, Andreas

  • Hi,

    Thank you Winston Wolf, sorry I mean Andreas )

    This command (env set boot ospi_nand) did solve my problem!

    Next step I'll try to modify the UBoot and I hope it will boot automatically without SDCARD from OSPI NAND.

    P.S.

    I had some issues with ubifs. But I booted with SDCARD, 

    Executed the following:

    ubiformat /dev/mtd5 -f rootfs.ubi
    ubiattach -p /dev/mtd5
    mount /dev/ubi0_0 /mnt/flash/
    cd /mnt/flash
    rm -rf /boot
    cp -a /boot /mnt/flash

    After the reboot, I managed to boot from NAND. 

    Regards