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-AM62A-LP: how to boot from SPI-NAND

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

when I try to use sf command to burn u-boot to ospi , it shows like the log. How can I boot evm from ospi ?

U-Boot 2023.04 (Dec 20 2023 - 11:33:43 +0800)

SoC: AM62AX SR1.0 HS-FS
Model: Texas Instruments AM62A7 SK
DRAM: 2 GiB (effective 4 GiB)
Core: 57 devices, 27 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"
=> mtdparts

device spi-nand0 <spi-nand0>, # parts = 7
#: name size offset mask_flags
0: ospi_nand.tiboot3 0x00080000 0x00000000 0
1: ospi_nand.tispl 0x00200000 0x00080000 0
2: ospi_nand.u-boot 0x00400000 0x00280000 0
3: ospi_nand.env 0x00040000 0x00680000 0
4: ospi_nand.env.backup0x00040000 0x006c0000 0
5: ospi_nand.rootfs 0x05fc0000 0x02000000 0
6: ospi_nand.phypattern0x00040000 0x07fc0000 0

active partition: spi-nand0,0 - (ospi_nand.tiboot3) 0x00080000 @ 0x00000000

defaults:
mtdids :
mtdparts:
=> ls mmc 1
1312287 tispl.bin
346386 tiboot3.bin
1115019 u-boot.img
574 uEnv.txt
System Volume Information/
3795811 RemovableMediaAccessUtility.exe
834088 RemovableMediaAccessUtility.dmg

6 file(s), 1 dir(s)

=> fatload mmc 1 ${loadaddr} tiboot3.bin
346386 bytes read in 34 ms (9.7 MiB/s)
=> sf probe
=> sf erase 0x0 0x80000
ERROR: attempting erase past flash size (0x40)
=> sf write ${loadaddr} 0x0 ${filesize}
Size exceeds partition or device limit
=>

  • Hello ,

    Thanks for your reply!

    I followed the link steps, but after Flashing OSPI-NAND, I can't continue Booting from OSPI-NAND.
    I don't understand BOOTMODE [15:0] = 0003 OR 0103.

    so, I configure BOOTMODE pins as XSPI boot mode according to AM62Ax Academy as picture blow. But it didn't work.

    How can I configure BOOTMODE pins to reach the next step Booting from OSPI-NAND as the FAQ link shows.

  • Hello,
    Can we try the BOOTMODE[15:0] as in the photo?


    Best,
    -Hong

  • Thanks for your reply!

    Using the BOOTMODE above, I can boot from ospi now. 

    I can set uboot environment mmcdev & bootpart to choose where to start kernel, mmc0 or mmc1.  

    but how can I start kernel from ospi , could you please give me some introduction?

  • Thanks for the update, and good to know you're able to boot u-boot from SPI-NAND on your board.
    This is one early e2e on ubi/ubifs on OSPI-NOR on AM64x Linux SDK for your reference.
    e2e.ti.com/.../3769546
    In the meantime, let me check if we have instructions on ubi/ubifs on SPI-NAND, and will share if available.
    Best,
    -Hong

  • hello, Hong!

    refer to the link you provide, I still have some problems about booting kernel from ospi.

    Here are my steps:

    1.create ubi image

    I use AM62a provide filesystem tisdk-edgeai-image-am62axx-evm.tar.xz as my base rootfs. I first unzip it and use the two commands below to make a ubi image.

    mkfs.ubifs -r tiny -o tiny.ubifs -m 4096 -e 253952 -c 383 -v
    ubinize -o tiny.ubi -m 4096 -s 4096 -p 256KiB ubinize.cfg -v

    in the refer link, you used command blow.

    - "mkfs.ubifs -r sdk-tiny-fs -o am6-sdk-tiny-fs.ubifs -m 16 -e 262016 -c 143 -v"
    - "ubinize -o am6-sdk-tiny-fs.ubi -m 16 -s 16 -p 256KiB ubinize.cfg -v"

    I changed -m 16 to 4096 and -c 143 to 383 as the spi_nand mtdinfo shows in my board.

    mtd5
    Name: ospi_nand.rootfs
    Type: nand
    Eraseblock size: 262144 bytes, 256.0 KiB
    Amount of eraseblocks: 383 (100401152 bytes, 95.7 MiB)
    Minimum input/output unit size: 4096 bytes
    Sub-page size: 4096 bytes
    OOB size: 128 bytes
    Character device major/minor: 90:10
    Bad blocks are allowed: true
    Device is writable: true

    I also changed -e 262016 to 253952 because of the error "Error: LEB should be multiple of min. I/O units"

    after that I create a ubi image.

    2.burn the image to ospi rootfs mtd

    I placed image in my TF card and used the commands blow to burning the ubi image to rootfs.

    load mmc 1:2 ${loadaddr}  tiny.ubi

    mtd erase spi-nand0 0x2000000 0x5fc0000.

    mtd write spi-nand0 ${loadaddr} 0x2000000 ${filesize}

    after that I am burning it to mtd5 ospi_nand_rootfs

    3.try to boot from ospi

    run args_all

    run args_ospi_nand

    setenv boot ospi_nand

    boot

     

    => run args_all
    
    => run args_ospi_nand
    
    => setenv boot ospi_nand
    
    => boot
    
    switch to partitions #0, OK
    
    mmc0(part 0) is current device
    
    SD/MMC found on device 0
    
    Failed to load 'boot.scr'
    
    Can't set block device
    
    UBI partition 'ospi_nand.rootfs' already selected
    
    ## Error: "main_cpsw0_qsgmii_phyinit" not defined
    
    Loading file '/boot/Image' to addr 0x82000000...
    
    Done
    
    Loading file '/boot/dtb/ti/k3-am62a7-sk.dtb' to addr 0x88000000...
    
    Done
    
    Working FDT set to 88000000
    
    New length 253 < existing length 55627, ignoring
    
    ## Flattened Device Tree blob at 88000000
    
       Booting using the fdt blob at 0x88000000
    
    Working FDT set to 88000000
    
       Loading Device Tree to 000000008ffef000, end 000000008ffff94a ... OK
    
    Working FDT set to 8ffef000
    
    
    
    Starting kernel ...
    
    
    
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    
    [    0.000000] Linux version 6.1.46-gf8110d9ce8 (oe-user@oe-host) (aarch64-oe-linux-gcc (GCC) 11.3.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Mon Sep  4 04:45:34 UTC 2023
    
    [    0.000000] Machine model: Texas Instruments AM62A7 SK
    
    [    0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    
    [    0.000000] printk: bootconsole [ns16550a0] enabled
    
    [    0.000000] efi: UEFI not found.
    
    [    0.000000] Reserved memory: created CMA memory pool at 0x00000000c0000000, size 576 MiB
    
    [    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
    
    [    0.000000] Reserved memory: created DMA memory pool at 0x0000000099800000, size 1 MiB
    
    [    0.000000] OF: reserved mem: initialized node c7x-dma-memory@99800000, compatible id shared-dma-pool
    
    [    0.000000] Reserved memory: created DMA memory pool at 0x0000000099900000, size 30 MiB
    
    [    0.000000] OF: reserved mem: initialized node c7x-memory@99900000, compatible id shared-dma-pool
    
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009b800000, size 1 MiB
    
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9b800000, compatible id shared-dma-pool
    
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009b900000, size 15 MiB
    
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9b900000, compatible id shared-dma-pool
    
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009c800000, size 1 MiB
    
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9c800000, compatible id shared-dma-pool
    
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009c900000, size 30 MiB
    
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9c900000, compatible id shared-dma-pool
    
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 32 MiB
    
    [    0.000000] OF: reserved mem: initialized node edgeai-dma-memory@a1000000, compatible id shared-dma-pool
    
    [    0.000000] OF: reserved mem: initialized node edgeai_shared-memories, compatible id dma-heap-carveout
    
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000ae000000, size 288 MiB
    
    [    0.000000] OF: reserved mem: initialized node edgeai-core-heap-memory@ae000000, compatible id shared-dma-pool
    
    [    0.000000] Zone ranges:
    
    [    0.000000]   DMA      [mem 0x0000000080000000-0x00000000ffffffff]
    
    [    0.000000]   DMA32    empty
    
    [    0.000000]   Normal   [mem 0x0000000100000000-0x00000008ffffffff]
    
    [    0.000000] Movable zone start for each node
    
    [    0.000000] Early memory node ranges
    
    [    0.000000]   node   0: [mem 0x0000000080000000-0x00000000997fffff]
    
    [    0.000000]   node   0: [mem 0x0000000099800000-0x000000009b7fefff]
    
    [    0.000000]   node   0: [mem 0x000000009b800000-0x000000009e6fffff]
    
    [    0.000000]   node   0: [mem 0x000000009e700000-0x000000009e77ffff]
    
    [    0.000000]   node   0: [mem 0x000000009e780000-0x00000000a2ffffff]
    
    [    0.000000]   node   0: [mem 0x00000000a3000000-0x00000000adffffff]
    
    [    0.000000]   node   0: [mem 0x00000000ae000000-0x00000000bfffffff]
    
    [    0.000000]   node   0: [mem 0x00000000c0000000-0x00000000ffffffff]
    
    [    0.000000]   node   0: [mem 0x0000000880000000-0x00000008ffffffff]
    
    [    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000008ffffffff]
    
    [    0.000000] On node 0, zone DMA: 1 pages in unavailable ranges
    
    [    0.000000] psci: probing for conduit method from DT.
    
    [    0.000000] psci: PSCIv1.1 detected in firmware.
    
    [    0.000000] psci: Using standard PSCI v0.2 function IDs
    
    [    0.000000] psci: Trusted OS migration not required
    
    [    0.000000] psci: SMC Calling Convention v1.2
    
    [    0.000000] percpu: Embedded 19 pages/cpu s38376 r8192 d31256 u77824
    
    [    0.000000] Detected VIPT I-cache on CPU0
    
    [    0.000000] CPU features: detected: GIC system register CPU interface
    
    [    0.000000] CPU features: detected: ARM erratum 845719
    
    [    0.000000] alternatives: applying boot alternatives
    
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 1032191
    
    [    0.000000] Kernel command line: 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),256ks
    
    [    0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
    
    [    0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
    
    [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
    
    [    0.000000] software IO TLB: area num 4.
    
    [    0.000000] software IO TLB: mapped [mem 0x00000000fbfff000-0x00000000fffff000] (64MB)
    
    [    0.000000] Memory: 2807268K/4194300K available (12480K kernel code, 1294K rwdata, 4360K rodata, 2176K init, 498K bss, 797208K reserved, 589824K cma-reserved)
    
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
    
    [    0.000000] rcu: Preemptible hierarchical RCU implementation.
    
    [    0.000000] rcu:     RCU event tracing is enabled.
    
    [    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
    
    [    0.000000]  Trampoline variant of Tasks RCU enabled.
    
    [    0.000000]  Tracing variant of Tasks RCU enabled.
    
    [    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
    
    [    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
    
    [    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
    
    [    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
    
    [    0.000000] GICv3: 256 SPIs implemented
    
    [    0.000000] GICv3: 0 Extended SPIs implemented
    
    [    0.000000] Root IRQ handler: gic_handle_irq
    
    [    0.000000] GICv3: GICv3 features: 16 PPIs
    
    [    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000001880000
    
    [    0.000000] ITS [mem 0x01820000-0x0182ffff]
    
    [    0.000000] GIC: enabling workaround for ITS: Socionext Synquacer pre-ITS
    
    [    0.000000] ITS@0x0000000001820000: Devices Table too large, reduce ids 20->19
    
    [    0.000000] ITS@0x0000000001820000: allocated 524288 Devices @880800000 (flat, esz 8, psz 64K, shr 0)
    
    [    0.000000] ITS: using cache flushing for cmd queue
    
    [    0.000000] GICv3: using LPI property table @0x0000000880040000
    
    [    0.000000] GIC: using cache flushing for LPI property table
    
    [    0.000000] GICv3: CPU0: using allocated LPI pending table @0x0000000880050000
    
    [    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
    
    [    0.000000] arch_timer: cp15 timer(s) running at 200.00MHz (phys).
    
    [    0.000000] clocksource: arch_sys_counter: mask: 0x3ffffffffffffff max_cycles: 0x2e2049d3e8, max_idle_ns: 440795210634 ns
    
    [    0.000000] sched_clock: 58 bits at 200MHz, resolution 5ns, wraps every 4398046511102ns
    
    [    0.008482] Console: colour dummy device 80x25
    
    [    0.013065] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=800000)
    
    [    0.023746] pid_max: default: 32768 minimum: 301
    
    [    0.028514] LSM: Security Framework initializing
    
    [    0.033334] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
    
    [    0.040913] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
    
    [    0.050324] cblist_init_generic: Setting adjustable number of callback queues.
    
    [    0.057759] cblist_init_generic: Setting shift to 2 and lim to 1.
    
    [    0.064050] cblist_init_generic: Setting adjustable number of callback queues.
    
    [    0.071443] cblist_init_generic: Setting shift to 2 and lim to 1.
    
    [    0.077809] rcu: Hierarchical SRCU implementation.
    
    [    0.082714] rcu:     Max phase no-delay instances is 1000.
    
    [    0.088270] Platform MSI: msi-controller@1820000 domain created
    
    [    0.094519] PCI/MSI: /bus@f0000/interrupt-controller@1800000/msi-controller@1820000 domain created
    
    [    0.104371] EFI services will not be available.
    
    [    0.109224] smp: Bringing up secondary CPUs ...
    
    [    0.114418] Detected VIPT I-cache on CPU1
    
    [    0.114509] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000
    
    [    0.114524] GICv3: CPU1: using allocated LPI pending table @0x0000000880060000
    
    [    0.114569] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
    
    [    0.115166] Detected VIPT I-cache on CPU2
    
    [    0.115231] GICv3: CPU2: found redistributor 2 region 0:0x00000000018c0000
    
    [    0.115244] GICv3: CPU2: using allocated LPI pending table @0x0000000880070000
    
    [    0.115275] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
    
    [    0.115822] Detected VIPT I-cache on CPU3
    
    [    0.115892] GICv3: CPU3: found redistributor 3 region 0:0x00000000018e0000
    
    [    0.115905] GICv3: CPU3: using allocated LPI pending table @0x0000000880080000
    
    [    0.115935] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
    
    [    0.115994] smp: Brought up 1 node, 4 CPUs
    
    [    0.195709] SMP: Total of 4 processors activated.
    
    [    0.200523] CPU features: detected: 32-bit EL0 Support
    
    [    0.205792] CPU features: detected: CRC32 instructions
    
    [    0.211103] CPU: All CPU(s) started at EL2
    
    [    0.215300] alternatives: applying system-wide alternatives
    
    [    0.222488] devtmpfs: initialized
    
    [    0.233594] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
    
    [    0.243600] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
    
    [    0.263796] pinctrl core: initialized pinctrl subsystem
    
    [    0.269672] DMI not present or invalid.
    
    [    0.274128] NET: Registered PF_NETLINK/PF_ROUTE protocol family
    
    [    0.281055] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations
    
    [    0.288492] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
    
    [    0.296570] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
    
    [    0.304729] audit: initializing netlink subsys (disabled)
    
    [    0.310372] audit: type=2000 audit(0.200:1): state=initialized audit_enabled=0 res=1
    
    [    0.310773] thermal_sys: Registered thermal governor 'step_wise'
    
    [    0.318299] thermal_sys: Registered thermal governor 'power_allocator'
    
    [    0.324474] cpuidle: using governor menu
    
    [    0.335312] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
    
    [    0.342328] ASID allocator initialised with 65536 entries
    
    [    0.358392] platform 30200000.dss: Fixed dependency cycle(s) with /bus@f0000/i2c@20010000/sii9022@3b
    
    [    0.369601] platform connector: Fixed dependency cycle(s) with /bus@f0000/i2c@20010000/sii9022@3b
    
    [    0.379068] KASLR disabled due to lack of seed
    
    [    0.390097] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages
    
    [    0.397061] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page
    
    [    0.403470] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages
    
    [    0.410410] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page
    
    [    0.416817] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages
    
    [    0.423757] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page
    
    [    0.430165] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages
    
    [    0.437103] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page
    
    [    0.444937] k3-chipinfo 43000014.chipid: Family:AM62AX rev:SR1.0 JTAGID[0x0bb8d02f] Detected
    
    [    0.454861] iommu: Default domain type: Translated 
    
    [    0.459869] iommu: DMA domain TLB invalidation policy: strict mode 
    
    [    0.466535] SCSI subsystem initialized
    
    [    0.470674] usbcore: registered new interface driver usbfs
    
    [    0.476316] usbcore: registered new interface driver hub
    
    [    0.481770] usbcore: registered new device driver usb
    
    [    0.487387] pps_core: LinuxPPS API ver. 1 registered
    
    [    0.492465] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    
    [    0.501816] PTP clock support registered
    
    [    0.505937] EDAC MC: Ver: 3.0.0
    
    [    0.509900] omap-mailbox 29000000.mailbox: omap mailbox rev 0x66fca100
    
    [    0.516720] omap-mailbox 29010000.mailbox: omap mailbox rev 0x66fca100
    
    [    0.523522] omap-mailbox 29020000.mailbox: omap mailbox rev 0x66fca100
    
    [    0.530250] omap-mailbox 29030000.mailbox: no available mbox devices found
    
    [    0.537636] FPGA manager framework
    
    [    0.541178] Advanced Linux Sound Architecture Driver Initialized.
    
    [    0.548239] clocksource: Switched to clocksource arch_sys_counter
    
    [    0.554682] VFS: Disk quotas dquot_6.6.0
    
    [    0.558728] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
    
    [    0.571288] Carveout Heap: Exported 176 MiB at 0x00000000a3000000
    
    [    0.577631] NET: Registered PF_INET protocol family
    
    [    0.582801] IP idents hash table entries: 65536 (order: 7, 524288 bytes, linear)
    
    [    0.593146] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear)
    
    [    0.601953] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
    
    [    0.609889] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear)
    
    [    0.618186] TCP bind hash table entries: 32768 (order: 8, 1048576 bytes, linear)
    
    [    0.626527] TCP: Hash tables configured (established 32768 bind 32768)
    
    [    0.633368] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear)
    
    [    0.640321] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear)
    
    [    0.647832] NET: Registered PF_UNIX/PF_LOCAL protocol family
    
    [    0.654005] RPC: Registered named UNIX socket transport module.
    
    [    0.660080] RPC: Registered udp transport module.
    
    [    0.664889] RPC: Registered tcp transport module.
    
    [    0.669697] RPC: Registered tcp NFSv4.1 backchannel transport module.
    
    [    0.676287] NET: Registered PF_XDP protocol family
    
    [    0.681196] PCI: CLS 0 bytes, default 64
    
    [    0.685811] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
    
    [    0.695583] Initialise system trusted keyrings
    
    [    0.700337] workingset: timestamp_bits=46 max_order=20 bucket_order=0
    
    [    0.712367] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    
    [    0.718915] NFS: Registering the id_resolver key type
    
    [    0.724122] Key type id_resolver registered
    
    [    0.728400] Key type id_legacy registered
    
    [    0.732560] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
    
    [    0.739416] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
    
    [    0.747138] 9p: Installing v9fs 9p2000 file system support
    
    [    0.787014] Key type asymmetric registered
    
    [    0.791204] Asymmetric key parser 'x509' registered
    
    [    0.796240] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
    
    [    0.803936] io scheduler mq-deadline registered
    
    [    0.808574] io scheduler kyber registered
    
    [    0.815406] pinctrl-single 4084000.pinctrl: 34 pins, size 136
    
    [    0.821718] pinctrl-single f4000.pinctrl: 171 pins, size 684
    
    [    0.828517] pinctrl-single a40000.pinctrl: 512 pins, size 2048
    
    [    0.841360] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    
    [    0.854885] loop: module loaded
    
    [    0.859344] megasas: 07.719.03.00-rc1
    
    [    0.866789] tun: Universal TUN/TAP device driver, 1.6
    
    [    0.872667] thunder_xcv, ver 1.0
    
    [    0.876008] thunder_bgx, ver 1.0
    
    [    0.879338] nicpf, ver 1.0
    
    [    0.882488] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
    
    [    0.889880] hns3: Copyright (c) 2017 Huawei Corporation.
    
    [    0.895360] hclge is initializing
    
    [    0.898763] e1000: Intel(R) PRO/1000 Network Driver
    
    [    0.903750] e1000: Copyright (c) 1999-2006 Intel Corporation.
    
    [    0.909659] e1000e: Intel(R) PRO/1000 Network Driver
    
    [    0.914734] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
    
    [    0.920816] igb: Intel(R) Gigabit Ethernet Network Driver
    
    [    0.926336] igb: Copyright (c) 2007-2014 Intel Corporation.
    
    [    0.932055] igbvf: Intel(R) Gigabit Virtual Function Network Driver
    
    [    0.938463] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
    
    [    0.944633] sky2: driver version 1.30
    
    [    0.949030] VFIO - User Level meta-driver version: 0.3
    
    [    0.954935] usbcore: registered new interface driver usb-storage
    
    [    0.961754] i2c_dev: i2c /dev entries driver
    
    [    0.968159] sdhci: Secure Digital Host Controller Interface driver
    
    [    0.974502] sdhci: Copyright(c) Pierre Ossman
    
    [    0.979423] Synopsys Designware Multimedia Card Interface Driver
    
    [    0.985985] sdhci-pltfm: SDHCI platform and OF driver helper
    
    [    0.992748] ledtrig-cpu: registered to indicate activity on CPUs
    
    [    0.999064] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
    
    [    1.005998] usbcore: registered new interface driver usbhid
    
    [    1.011702] usbhid: USB HID core driver
    
    [    1.016809] optee: probing for conduit method.
    
    [    1.021384] optee: revision 3.20 (8e74d476)
    
    [    1.021644] optee: dynamic shared memory is enabled
    
    [    1.031262] optee: initialized driver
    
    [    1.036573] Initializing XFRM netlink socket
    
    [    1.040980] NET: Registered PF_PACKET protocol family
    
    [    1.046269] 9pnet: Installing 9P2000 support
    
    [    1.050690] Key type dns_resolver registered
    
    [    1.055409] registered taskstats version 1
    
    [    1.059625] Loading compiled-in X.509 certificates
    
    [    1.071846] ti-sci 44043000.system-controller: ABI: 3.1 (firmware rev 0x0009 '9.0.7--v09.00.07 (Kool Koala)')
    
    [    1.111086] omap_i2c 20000000.i2c: bus 0 rev0.12 at 400 kHz
    
    [    1.118078] pca953x 1-0023: supply vcc not found, using dummy regulator
    
    [    1.124958] pca953x 1-0023: using AI
    
    [    1.154821] omap_i2c 20010000.i2c: bus 1 rev0.12 at 100 kHz
    
    [    1.161569] omap_i2c 20020000.i2c: bus 2 rev0.12 at 400 kHz
    
    [    1.167490] ti-sci-intr 4210000.interrupt-controller: Interrupt Router 5 domain created
    
    [    1.175814] ti-sci-intr bus@f0000:interrupt-controller@a00000: Interrupt Router 3 domain created
    
    [    1.185007] ti-sci-inta 48000000.interrupt-controller: Interrupt Aggregator domain 28 created
    
    [    1.193984] ti-sci-inta 4e0a0000.interrupt-controller: Interrupt Aggregator domain 200 created
    
    [    1.203690] ti-udma 485c0100.dma-controller: Number of rings: 82
    
    [    1.211703] ti-udma 485c0100.dma-controller: Channels: 48 (bchan: 18, tchan: 12, rchan: 18)
    
    [    1.222454] ti-udma 485c0000.dma-controller: Number of rings: 150
    
    [    1.232100] ti-udma 485c0000.dma-controller: Channels: 35 (tchan: 20, rchan: 15)
    
    [    1.241403] ti-udma 4e230000.dma-controller: Number of rings: 6
    
    [    1.247854] ti-udma 4e230000.dma-controller: Channels: 6 (bchan: 0, tchan: 0, rchan: 6)
    
    [    1.257070] printk: console [ttyS2] disabled
    
    [    1.261500] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 252, base_baud = 3000000) is a 8250
    
    [    1.270378] printk: console [ttyS2] enabled
    
    [    1.270378] printk: console [ttyS2] enabled
    
    [    1.278838] printk: bootconsole [ns16550a0] disabled
    
    [    1.278838] printk: bootconsole [ns16550a0] disabled
    
    [    1.290897] spi-nand spi0.0: Winbond SPI NAND was found.
    
    [    1.296254] spi-nand spi0.0: 128 MiB, block size: 256 KiB, page size: 4096, OOB size: 128
    
    [    1.304593] 7 fixed-partitions partitions found on MTD device spi0.0
    
    [    1.310946] Creating 7 MTD partitions on "spi0.0":
    
    [    1.315732] 0x000000000000-0x000000080000 : "ospi_nand.tiboot3"
    
    [    1.322938] 0x000000080000-0x000000280000 : "ospi_nand.tispl"
    
    [    1.330473] 0x000000280000-0x000000680000 : "ospi_nand.u-boot"
    
    [    1.338829] 0x000000680000-0x0000006c0000 : "ospi_nand.env"
    
    [    1.345471] 0x0000006c0000-0x000000700000 : "ospi_nand.env.backup"
    
    [    1.352722] 0x000002000000-0x000007fc0000 : "ospi_nand.rootfs"
    
    [    1.396595] 0x000007fc0000-0x000008000000 : "ospi_nand.phypattern"
    
    [    1.444276] davinci_mdio 8000f00.mdio: davinci mdio revision 9.7, bus freq 1000000
    
    [    1.453320] davinci_mdio 8000f00.mdio: phy[0]: device 8000f00.mdio:00, driver TI DP83867
    
    [    1.461450] am65-cpsw-nuss 8000000.ethernet: initializing am65 cpsw nuss version 0x6BA01103, cpsw version 0x6BA81103 Ports: 3 quirks:00000006
    
    [    1.474213] am65-cpsw-nuss 8000000.ethernet: initialized cpsw ale version 1.5
    
    [    1.481341] am65-cpsw-nuss 8000000.ethernet: ALE Table size 512
    
    [    1.487691] pps pps0: new PPS source ptp0
    
    [    1.491968] am65-cpsw-nuss 8000000.ethernet: CPTS ver 0x4e8a010c, freq:500000000, add_val:1 pps:1
    
    [    1.501975] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19
    
    [    1.612731] mmc0: CQHCI version 5.10
    
    [    1.657519] mmc0: SDHCI controller on fa10000.mmc [fa10000.mmc] using ADMA 64-bit
    
    [    1.766388] mmc0: Command Queue Engine enabled
    
    [    1.770881] mmc0: new HS200 MMC card at address 0001
    
    [    1.776591] mmcblk0: mmc0:0001 S0J56X 14.8 GiB 
    
    [    1.784325]  mmcblk0: p1 p2 p3
    
    [    1.788061] mmcblk0boot0: mmc0:0001 S0J56X 31.5 MiB 
    
    [    1.793959] mmcblk0boot1: mmc0:0001 S0J56X 31.5 MiB 
    
    [    1.799731] mmcblk0rpmb: mmc0:0001 S0J56X 4.00 MiB, chardev (240:0)
    
    [    1.983359] pca953x 1-0022: supply vcc not found, using dummy regulator
    
    [    1.990104] pca953x 1-0022: using AI
    
    [    2.000977] debugfs: Directory 'pd:182' with parent 'pm_genpd' already present!
    
    [    2.009179] mmc1: CQHCI version 5.10
    
    [    2.009432] debugfs: Directory 'pd:182' with parent 'pm_genpd' already present!
    
    [    2.020176] debugfs: Directory 'pd:182' with parent 'pm_genpd' already present!
    
    [    2.032994] ALSA device list:
    
    [    2.035975]   No soundcards found.
    
    [    3.529351] sdhci-am654 fa00000.mmc: Power on failed
    
    [    3.565490] mmc1: SDHCI controller on fa00000.mmc [fa00000.mmc] using ADMA 64-bit
    
    [    3.573612] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19
    
    [    3.581636] Please append a correct "root=" boot option; here are the available partitions:
    
    [    3.590030] 1f00             512 mtdblock0 
    
    [    3.590042]  (driver?)
    
    [    3.596595] 1f01            2048 mtdblock1 
    
    [    3.596605]  (driver?)
    
    [    3.603145] 1f02            4096 mtdblock2 
    
    [    3.603155]  (driver?)
    
    [    3.609722] 1f03             256 mtdblock3 
    
    [    3.609731]  (driver?)
    
    [    3.616289] 1f04             256 mtdblock4 
    
    [    3.616297]  (driver?)
    
    [    3.622828] 1f05           98048 mtdblock5 
    
    [    3.622836]  (driver?)
    
    [    3.629388] 1f06             256 mtdblock6 
    
    [    3.629396]  (driver?)
    
    [    3.635946] b300        15540224 mmcblk0 
    
    [    3.635953]  driver: mmcblk
    
    [    3.642747]   b301         5179045 mmcblk0p1 42a63848-58f9-ca4c-8aca-2b5669b82b78
    
    [    3.642755] 
    
    [    3.651720]   b302         5180069 mmcblk0p2 6d676b0d-5c7d-0f45-9c4f-2057d1fa59c6
    
    [    3.651727] 
    
    [    3.660695]   b303         5179375 mmcblk0p3 e70255da-68ad-7642-80b3-3465a71b78c8
    
    [    3.660700] 
    
    [    3.669659] b320           32256 mmcblk0boot0 
    
    [    3.669664]  (driver?)
    
    [    3.676453] b340           32256 mmcblk0boot1 
    
    [    3.676458]  (driver?)
    
    [    3.683244] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
    
    [    3.691490] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.1.46-gf8110d9ce8 #1
    
    [    3.698437] Hardware name: Texas Instruments AM62A7 SK (DT)
    
    [    3.703994] Call trace:
    
    [    3.706430]  dump_backtrace.part.0+0xdc/0xf0
    
    [    3.710702]  show_stack+0x18/0x30
    
    [    3.714010]  dump_stack_lvl+0x68/0x84
    
    [    3.717665]  dump_stack+0x18/0x34
    
    [    3.720969]  panic+0x184/0x344
    
    [    3.724018]  mount_block_root+0x184/0x234
    
    [    3.728019]  prepare_namespace+0x90/0x170
    
    [    3.732018]  kernel_init_freeable+0x258/0x284
    
    [    3.736365]  kernel_init+0x24/0x130
    
    [    3.739845]  ret_from_fork+0x10/0x20
    
    [    3.743415] SMP: stopping secondary CPUs
    
    [    3.747327] Kernel Offset: disabled
    
    [    3.750802] CPU features: 0x00000,00800084,0000420b
    
    [    3.755666] Memory Limit: none
    
    [    3.758712] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
    
    
    
    

    It shows

    [ 3.573612] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19

    [ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block (0,0)].

    In uboot ,when I use ubifsmount , it is error.

    U-Boot 2023.04-gbd74e615a6 (Sep 06 2023 - 10:09:25 +0000)
    
    
    
    SoC:   AM62AX SR1.0 HS-FS
    
    Model: Texas Instruments AM62A7 SK
    
    DRAM:  2 GiB (effective 4 GiB)
    
    Core:  57 devices, 27 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"
    
    => ubi part ospi_nand.rootfs
    
    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: 1/0, WL threshold: 4096, image sequence number: 767762267
    
    ubi0: available PEBs: 0, total reserved PEBs: 383, PEBs reserved for bad PEB handling: 10
    
    => ubi part                 
    
    Device 0: ubi0, MTD partition ospi_nand.rootfs
    
    => ubifsmount ospi_nand.rootfs
    
    UBIFS error (pid: 1): cannot open "ospi_nand.rootfs", error -22
    
    Error reading superblock on volume 'ospi_nand.rootfs' errno=-22!
    
    => 
    
    

    are the 3 steps above ok or not?

    how can I solve the problems above?

    Looking forward to your reply!

  • Hello Cheng,
    Thanks for the update.
    I've not got chance trying out ubi/ubifs on AM62x SPI-NAND yet so I'm not able to tell the exact issue you have.
    In the referenced e2e,
    e2e.ti.com/.../3769546
    "
    3. Flash the generated UBI rootfs file "am6-sdk-tiny-fs.ubi" to OSPI in kernel from SD card boot as an example:
    I used "ubiformat /dev/mtd7 -f am6-sdk-tiny-fs.ubi" at kernel to flash/format the UBI rootfs file to MTD7 (ospi.rootfs).
    Refer to the attached log file "am6_ubiformat_ospi.txt" for more details.
    I also attached another log file "am6_ubiattach_ospi.txt" to show attaching MDT7 (ospi.rootfs) for testing.
    "
    Have we checked attaching mtd rootfs @kernel as shown in "am6_ubiattach_ospi.txt"?
    This is to check if ubi/ubifs is created ok, and can be attached @kernel.
    Best,
    -Hong

  • Hello Hong,

    Thanks for your direction.

    This problem has been solved, the root cause of

    "[ 3.573612] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19"

    is kernel don't insert ubi drivers.

    In the current SDK version, the ubi driver is compiled into ubi.ko as a module.

    I modified the kernel compilation configuration to integrate the ubi driver into Image, and this issue was solved.

  • Hello Cheng,
    It is very good to know full Linux boot works on SPI-NAND on your setup.
    Thanks for sharing your findings on the kernel ubi driver is currently built as an module.
    Best,
    -Hong