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 parallel GPMC NAND on AM62L

Part Number: AM62L

Tool/software:

AM62L ROM supports boot from ONFI 1.0 compatible 8-bit parallel NAND memory of 2Gbytes or less in size connected to GPMC CS0 with the following geometries and features
• 2Kbyte page and spare area of at least 64 bytes or
• 4Kbyte page size and spare area of at least 128 bytes.
• Non-ECC part only
- ROM uses ELM to handle ECC.
- ECC is BCH8 using D7:0 for data
- The param page CRC is checked and in case of failure the redundant page is used.

The FAQ lists how to (1) flash u-boot to GPMC-NAND from SD boot mode, and (2) boot u-boot from GPMC-NAND on AM62L EVM + NAND daughter card with AM62L Linux EA release, where MT29F8G08ADAFAH4 is on the gpmc-nand daughter card as listed
[ 2.759530] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xd3
[ 2.768643] nand: Micron MT29F8G08ADAFAH4
[ 2.774662] nand: 1024 MiB, SLC, erase size: 256 KiB, page size: 4096, OOB size: 256
[ 2.782546] nand: using OMAP_ECC_BCH8_CODE_HW ECC scheme

There's companion FAQ on how to flash u-boot to GPMC-NAND with USB-DFU

https://e2e.ti.com/support/processors-group/processors/f/791/t/1468493

  • Build u-boot to support GPMC-NAND
    - apply the u-boot gpmc-nand patch <0001-add-enabling-u-boot-gpmc-nand-on-AM62L-EVM-nand-daug.patch>
    The gpmc-nand drivers are included in AM62L Linux EA release, but GPMC-NAND is disabled in u-boot by default as the nand daughter card is an optional component.
    - build the u-boot with <am62lx_evm_defconfig> with the gpmc-nand patch.

    Flash u-boot to GPMC-NAND from SD boot
    - configure BOOTMODE pins as MMC boot mode
    - power on the board
    - stop @u-boot prompt
    - run u-boot cmds as listed in the log file to flash u-boot to GPMC-NAND
    - the log file: am62l_ea3_nand_flash_boot.log

    Boot u-boot from GPMC-NAND
    - run u-boot cmd <mw.l 0x43010030 0x025b> to reconfigure BOOTMODE pins as NAND boot mode: BOOTMODE[15:0] = 025B
    - issue <reset> cmd to WARMRESET the SoC
    - the log file: am62l_ea3_nand_flash_boot.log

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/1651.0001_2D00_add_2D00_enabling_2D00_u_2D00_boot_2D00_gpmc_2D00_nand_2D00_on_2D00_AM62L_2D00_EVM_2D00_nand_2D00_daug.patch

    NOTICE:  Booting Trusted Firmware
    NOTICE:  BL1: v2.11.0(release):11.00.00.02-6-gd6f5db4d9
    NOTICE:  BL1: Built : 16:31:47, Nov 24 2024
    NOTICE:  bl1_platform_setup DDR init done
    NOTICE:  k3_bl1_handoff ENTERING WFI - end of PreBL \tispl.bin
    NOTICE:  BL31: v2.11.0(release):11.00.00.02-6-gd6f5db4d9
    NOTICE:  BL31: Built : 16:31:47, Nov 24 2024
    NOTICE:  k3_sysctrler_boot_notification_response: boot notification recevied from TIFS: 0x70815000
    NOTICE:  SYSFW ABI: 3.1 (firmware rev 0x0000 '0.0.0-w2024.01-am62lx (WAKUP)')
    NOTICE:  Upgrade Firmwares for Power off functionality
    ERROR:   Agent 0 Protocol 0x10 Message 0x7: not supported
    
    U-Boot SPL 2024.10-rc5-gc8de66a7a8d3-dirty (Nov 24 2024 - 11:21:22 -0600)
    SPL initial stack usage: 1872 bytes
    Trying to boot from MMC2
    
    
    U-Boot 2024.10-rc5-gc8de66a7a8d3-dirty (Nov 24 2024 - 11:21:22 -0600)
    
    SoC:   AM62LX SR1.0 HS-FS
    Model: Texas Instruments AM62L3 EVM
    DRAM:  2 GiB
    ERROR:   Agent 0 Protocol 0x10 Message 0x7: not supported
    Core:  62 devices, 31 uclasses, devicetree: separate
    NAND:  512 MiB
    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
    Warning: ethernet@8000000port@2 (eth1) using random MAC address - 22:1d:d7:95:6d:1d
    , eth1: ethernet@8000000port@2
    Hit any key to stop autoboot:  2  0
    => 
    => md.l 0x43010030 1
    43010030: 00000e43                             C...
    => mtd list
    List of MTD devices:
    * nand0
      - device: nand@0,0
      - parent: memory-controller@3b000000
      - driver: gpmc-nand
      - path: /bus@f0000/memory-controller@3b000000/nand@0,0
      - type: NAND flash
      - block size: 0x40000 bytes
      - min I/O: 0x1000 bytes
      - OOB size: 128 bytes
      - OOB available: 142 bytes
      - ECC strength: 8 bits
      - ECC step size: 512 bytes
      - bitflip threshold: 6 bits
      - 0x000000000000-0x000020000000 : "nand0"
    	  - 0x000000000000-0x000000080000 : "NAND.tiboot3"
    	  - 0x000000080000-0x000000200000 : "NAND.tispl"
    	  - 0x000000200000-0x000000400000 : "NAND.u-boot"
    	  - 0x000000400000-0x000000480000 : "NAND.tiboot3.backup"
    	  - 0x000000480000-0x000000600000 : "NAND.tispl.bin.backup"
    	  - 0x000000600000-0x000000800000 : "NAND.u-boot.backup"
    	  - 0x000000800000-0x000000840000 : "NAND.u-boot-env"
    	  - 0x000000840000-0x000000880000 : "NAND.u-boot-env.backup"
    	  - 0x000000880000-0x000020000000 : "NAND.file-system"
    * spi-nand0
      - device: flash@3
      - parent: spi@fc40000
      - driver: spi_nand
      - path: /bus@f0000/bus@fc00000/spi@fc40000/flash@3
      - type: NAND flash
      - block size: 0x20000 bytes
      - min I/O: 0x800 bytes
      - OOB size: 64 bytes
      - OOB available: 40 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"
    => nand info
    
    Device 0: nand0, sector size 256 KiB
      Page size         4096 b
      OOB size           128 b
      Erase size      262144 b
      ecc strength         8 bits
      ecc step size      512 b
      subpagesize       1024 b
      options       0x4000400c
      bbt options   0x00000000
    => nand erase.chip
    
    NAND erase.chip: device 0 whole chip
    
    Erasing at 0x0 --   0% complete.
    Erasing at 0x500000 --   1% complete.
    Erasing at 0xa00000 --   2% complete.
    Erasing at 0xf40000 --   3% complete.
    Erasing at 0x1440000 --   4% complete.
    Erasing at 0x1980000 --   5% complete.
    Erasing at 0x1e80000 --   6% complete.
    Erasing at 0x23c0000 --   7% complete.
    Erasing at 0x28c0000 --   8% complete.
    Erasing at 0x2e00000 --   9% complete.
    Erasing at 0x3300000 --  10% complete.
    Erasing at 0x3840000 --  11% complete.
    Erasing at 0x3d40000 --  12% complete.
    Erasing at 0x4280000 --  13% complete.
    Erasing at 0x4780000 --  14% complete.
    Erasing at 0x4cc0000 --  15% complete.
    Erasing at 0x51c0000 --  16% complete.
    Erasing at 0x5700000 --  17% complete.
    Erasing at 0x5c00000 --  18% complete.
    Erasing at 0x6140000 --  19% complete.
    Erasing at 0x6640000 --  20% complete.
    Erasing at 0x6b80000 --  21% complete.
    Erasing at 0x7080000 --  22% complete.
    Erasing at 0x75c0000 --  23% complete.
    Erasing at 0x7ac0000 --  24% complete.
    Erasing at 0x7fc0000 --  25% complete.
    Erasing at 0x8500000 --  26% complete.
    Erasing at 0x8a00000 --  27% complete.
    Erasing at 0x8f40000 --  28% complete.
    Erasing at 0x9440000 --  29% complete.
    Erasing at 0x9980000 --  30% complete.
    Erasing at 0x9e80000 --  31% complete.
    Erasing at 0xa3c0000 --  32% complete.
    Erasing at 0xa8c0000 --  33% complete.
    Erasing at 0xae00000 --  34% complete.
    Erasing at 0xb300000 --  35% complete.
    Erasing at 0xb840000 --  36% complete.
    Erasing at 0xbd40000 --  37% complete.
    Erasing at 0xc280000 --  38% complete.
    Erasing at 0xc780000 --  39% complete.
    Erasing at 0xccc0000 --  40% complete.
    Erasing at 0xd1c0000 --  41% complete.
    Erasing at 0xd700000 --  42% complete.
    Erasing at 0xdc00000 --  43% complete.
    Erasing at 0xe140000 --  44% complete.
    Erasing at 0xe640000 --  45% complete.
    Erasing at 0xeb80000 --  46% complete.
    Erasing at 0xf080000 --  47% complete.
    Erasing at 0xf5c0000 --  48% complete.
    Erasing at 0xfac0000 --  49% complete.
    Erasing at 0xffc0000 --  50% complete.
    Erasing at 0x10500000 --  51% complete.
    Erasing at 0x10a00000 --  52% complete.
    Erasing at 0x10f40000 --  53% complete.
    Erasing at 0x11440000 --  54% complete.
    Erasing at 0x11980000 --  55% complete.
    Erasing at 0x11e80000 --  56% complete.
    Erasing at 0x123c0000 --  57% complete.
    Erasing at 0x128c0000 --  58% complete.
    Erasing at 0x12e00000 --  59% complete.
    Erasing at 0x13300000 --  60% complete.
    Erasing at 0x13840000 --  61% complete.
    Erasing at 0x13d40000 --  62% complete.
    Erasing at 0x14280000 --  63% complete.
    Erasing at 0x14780000 --  64% complete.
    Erasing at 0x14cc0000 --  65% complete.
    Erasing at 0x151c0000 --  66% complete.
    Erasing at 0x15700000 --  67% complete.
    Erasing at 0x15c00000 --  68% complete.
    Erasing at 0x16140000 --  69% complete.
    Erasing at 0x16640000 --  70% complete.
    Erasing at 0x16b80000 --  71% complete.
    Erasing at 0x17080000 --  72% complete.
    Erasing at 0x175c0000 --  73% complete.
    Erasing at 0x17ac0000 --  74% complete.
    Erasing at 0x17fc0000 --  75% complete.
    Erasing at 0x18500000 --  76% complete.
    Erasing at 0x18a00000 --  77% complete.
    Erasing at 0x18f40000 --  78% complete.
    Erasing at 0x19440000 --  79% complete.
    Erasing at 0x19980000 --  80% complete.
    Erasing at 0x19e80000 --  81% complete.
    Erasing at 0x1a3c0000 --  82% complete.
    Erasing at 0x1a8c0000 --  83% complete.
    Erasing at 0x1ae00000 --  84% complete.
    Erasing at 0x1b300000 --  85% complete.
    Erasing at 0x1b840000 --  86% complete.
    Erasing at 0x1bd40000 --  87% complete.
    Erasing at 0x1c280000 --  88% complete.
    Erasing at 0x1c780000 --  89% complete.
    Erasing at 0x1ccc0000 --  90% complete.
    Erasing at 0x1d1c0000 --  91% complete.
    Erasing at 0x1d700000 --  92% complete.
    Erasing at 0x1dc00000 --  93% complete.
    Erasing at 0x1e140000 --  94% complete.
    Erasing at 0x1e640000 --  95% complete.
    Erasing at 0x1eb80000 --  96% complete.
    Erasing at 0x1f080000 --  97% complete.
    Erasing at 0x1f5c0000 --  98% complete.
    Erasing at 0x1fac0000 --  99% complete.
    Erasing at 0x1ffc0000 -- 100% complete.
    OK
    => ls mmc 1
      1390600   tispl.bin
       222467   tiboot3-am62lx-gp-evm.bin
       225024   tiboot3-am62lx-hs-fs-evm.bin
       225024   tiboot3.bin
      1424971   u-boot.img
          574   uEnv.txt
                am62l_ea3_prebuilt/
    
    6 file(s), 1 dir(s)
    
    => load mmc 1 ${loadaddr} tiboot3.bin
    225024 bytes read in 14 ms (15.3 MiB/s)
    => nand write ${loadaddr} 0x0 ${filesize}
    
    NAND write: device 0 offset 0x0, size 0x36f00
     225024 bytes written: OK
    => load mmc 1 ${loadaddr} tispl.bin
    1390600 bytes read in 63 ms (21.1 MiB/s)
    => nand write ${loadaddr} 0x80000 ${filesize}
    
    NAND write: device 0 offset 0x80000, size 0x153808
     1390600 bytes written: OK
    => load mmc 1 ${loadaddr} u-boot.img
    1424971 bytes read in 65 ms (20.9 MiB/s)
    => nand write ${loadaddr} 0x200000 ${filesize}
    
    NAND write: device 0 offset 0x200000, size 0x15be4b
     1424971 bytes written: OK
    => mw.l 0x43010030 0x025b
    => md.l 0x43010030 1
    43010030: 0000025b                             [...
    => reset
    resetting ...
    NOTICE:  Booting Trusted Firmware
    NOTICE:  BL1: v2.11.0(release):11.00.00.02-6-gd6f5db4d9
    NOTICE:  BL1: Built : 16:31:47, Nov 24 2024
    NOTICE:  bl1_platform_setup DDR init done
    NOTICE:  k3_bl1_handoff ENTERING WFI - end of PreBL 
    NOTICE:  BL31: v2.11.0(release):11.00.00.02-6-gd6f5db4d9
    NOTICE:  BL31: Built : 16:31:47, Nov 24 2024
    NOTICE:  k3_sysctrler_boot_notification_response: boot notification recevied from TIFS: 0x70815000
    NOTICE:  SYSFW ABI: 3.1 (firmware rev 0x0000 '0.0.0-w2024.01-am62lx (WAKUP)')
    NOTICE:  Upgrade Firmwares for Power off functionality
    ERROR:   Agent 0 Protocol 0x10 Message 0x7: not supported
    
    U-Boot SPL 2024.10-rc5-gc8de66a7a8d3-dirty (Nov 24 2024 - 11:21:22 -0600)
    SPL initial stack usage: 1872 bytes
    Trying to boot from NAND
    
    
    U-Boot 2024.10-rc5-gc8de66a7a8d3-dirty (Nov 24 2024 - 11:21:22 -0600)
    
    SoC:   AM62LX SR1.0 HS-FS
    Model: Texas Instruments AM62L3 EVM
    DRAM:  2 GiB
    ERROR:   Agent 0 Protocol 0x10 Message 0x7: not supported
    Core:  62 devices, 31 uclasses, devicetree: separate
    NAND:  512 MiB
    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
    Warning: ethernet@8000000port@2 (eth1) using random MAC address - de:d3:44:66:9a:46
    , eth1: ethernet@8000000port@2
    Hit any key to stop autoboot:  2  0
    => md.l 0x43010030 1
    43010030: 0000025b                             [...
    =>