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.

[FAQ] How to flash and boot u-boot from serial-NAND on AM62x/AM62Ax

Other Parts Discussed in Thread: SK-AM62, SK-AM62-LP, SK-AM62A-LP

AM62x/AM62Ax Boot ROM supports booting from (x)SPI-NOR and Serial-NAND. Please refer to AM62x/AM62Ax TRM "Chapter 5 Initialization" for details.
The OSPI-NOR and OSPI-NAND are installed on TI AM62x/AM62Ax EVMs as listed below:
[1]. SK-AM62 board (www.ti.com/.../SK-AM62B)
OSPI-NOR: Cypress S28HS512T
[2]. SK-AM62-LP board (www.ti.com/.../SK-AM62-LP)
OSPI-NAND: Winbond W35N01JWTBAG
[3]. SK-AM62A-LP board (www.ti.com/.../SK-AM62A-LP)
OSPI-NAND: Winbond W35N01JWTBAG

Flashing u-boot to OSPI-NOR via "sf..." u-boot cmds on SK-AM62 board [1] is listed in Linux SDK online user guide
software-dl.ti.com/.../UG-QSPI.html

The FAQ lists how to flash u-boot to OSPI-NAND via u-boot cmds on SK-AM62-LP board [2]
The same steps would be applicable to flash u-boot to OSPI-NAND on SK-AM62A-LP board [3] as well.

  • Flashing OSPI-NAND:
    - configure BOOTMODE pins as MMC boot mode: BOOTMODE[15:0] = 0243
    - power on the board
    - stop @u-boot prompt
    - run u-boot cmds as listed the the log file to flash u-boot binary (tiboot3.bin/tispl.bin/u-boot.img) to OSPI-NAND
    - the log file: am62-lp_9.0.0.3_spinand_flash.log

    Booting from OSPI-NAND:
    - reconfigure BOOTMODE pins as serial-NAND boot mode: BOOTMODE[15:0] = 0003 OR 0103
    - power on the board
    - the log file: am62-lp_9.0.0.3_spinand_boot.log

    Note from the serial-NAND boot log file:
    - configure BOOTMODE[15:0] = 0103 initially
    - boot u-boot from serial-NAND
    - stop @u-boot prompt
    - reconfigure BOOTMODE[15:0] = 0003
    - issue SW WarmReset via "reset" cmd @u-boot
    - u-boot boot from serial-NAND

    4035.am62-lp_9.0.0.3_spinand_flash.log
    U-Boot SPL 2023.04-ga3595f1e3e (Jun 15 2023 - 08:14:46 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
    SPL initial stack usage: 13376 bytes
    Trying to boot from MMC2
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
    NOTICE:  BL31: Built : 00:42:57, Jan 13 2023
    
    U-Boot SPL 2023.04-ga3595f1e3e (Jun 15 2023 - 08:14:46 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
    Trying to boot from MMC2
    Authentication passed
    Authentication passed
    
    
    U-Boot 2023.04-ga3595f1e3e (Jun 15 2023 - 08:14:46 +0000)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: Texas Instruments AM62x LP SK
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed -1
    DRAM:  2 GiB
    Core:  70 devices, 26 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed -1
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  2  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
                am62a_otp_wr/
       357316   tiboot3-am62ax-gp-evm.bin
       359905   tiboot3-am62ax-hs-evm.bin
                .Trash-1000/
                System Volume Information/
            1   .psdk_setup
                am62a_8.6/
          486   uEnv.txt
                am62a_otp_rd_0/
                am62x_otp_rd/
                am62x-lp_8.6/
                am62x-lp_9.0.0.3/
       311336   tiboot3.bin
       937579   u-boot.img
      1017171   tispl.bin
    
    7 file(s), 8 dir(s)
    
    => load mmc 1 ${loadaddr} tiboot3.bin
    311336 bytes read in 19 ms (15.6 MiB/s)
    => mtd write spi-nand0 ${loadaddr} 0x0 $filesize
    Size not on a page boundary (0x1000), rounding to 0x4d000
    Writing 315392 byte(s) (77 page(s)) at offset 0x00000000
    => load mmc 1 ${loadaddr} tispl.bin
    1017171 bytes read in 34 ms (28.5 MiB/s)
    => mtd write spi-nand0 ${loadaddr} 0x80000 $filesize
    Size not on a page boundary (0x1000), rounding to 0xf9000
    Writing 1019904 byte(s) (249 page(s)) at offset 0x00080000
    => load mmc 1 ${loadaddr} u-boot.img
    937579 bytes read in 32 ms (27.9 MiB/s)
    => mtd write spi-nand0 ${loadaddr} 0x280000 $filesize
    Size not on a page boundary (0x1000), rounding to 0xe5000
    Writing 937984 byte(s) (229 page(s)) at offset 0x00280000
    => 

    4035.am62-lp_9.0.0.3_spinand_boot.log
    U-Boot SPL 2023.04-ga3595f1e3e (Jun 15 2023 - 08:14:46 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
    SPL initial stack usage: 13376 bytes
    Trying to boot from SPINAND
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
    NOTICE:  BL31: Built : 00:42:57, Jan 13 2023
    
    U-Boot SPL 2023.04-ga3595f1e3e (Jun 15 2023 - 08:14:46 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
    Trying to boot from SPINAND
    
    
    U-Boot 2023.04-ga3595f1e3e (Jun 15 2023 - 08:14:46 +0000)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: Texas Instruments AM62x LP SK
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed -1
    DRAM:  2 GiB
    Core:  70 devices, 26 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed -1
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  2  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: 00000103                             ....
    => mw.l 0x43000030 0x0003
    => md.l 0x43000030 1
    43000030: 00000003                             ....
    => reset
    resetting ...
    
    U-Boot SPL 2023.04-ga3595f1e3e (Jun 15 2023 - 08:14:46 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
    SPL initial stack usage: 13376 bytes
    Trying to boot from SPINAND
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
    NOTICE:  BL31: Built : 00:42:57, Jan 13 2023
    
    U-Boot SPL 2023.04-ga3595f1e3e (Jun 15 2023 - 08:14:46 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
    Trying to boot from SPINAND
    
    
    U-Boot 2023.04-ga3595f1e3e (Jun 15 2023 - 08:14:46 +0000)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: Texas Instruments AM62x LP SK
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed -1
    DRAM:  2 GiB
    Core:  70 devices, 26 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed -1
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  2  0 
    => md.l 0x43000030 1
    43000030: 00000003                             ....
    =>