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.
Can current Processor SDK support ubifs on SPI NOR flash? if yes, where can I find the procedure to make it work?
Customer tried as below, but failed.
SPI flash: w25q64cv: 8Mbyte, erase size 4KB, page size: 256byte.
ubiattach a mtd got below:
make ubifs image procedure:
mkfs.ubifs -r ./sdk/ -m 1 -e 65408 -c 43 -o test_ubi.img -F
ubinize -o ubi_test.ubi -m 1 -p 64KiB test_ubinize.cfg
test_ubinize.cfg as below:
[ubifs]
mode=ubi
image=./test_ubi.img
vol_id=5
vol_size=2818048
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize
bootargs setting in UBoot: setenv bootargs console= console=ttyO3,115200n8 ubi.mtd=5 rootfstye=ubifs rw root=ubi0:rootfs rw init=/linuxrc
Kernel configuration:
booting log:
U-Boot 2020.01-dirty (Aug 26 2021 - 14:13:16 +0800) CPU : AM335X-GP rev 2.1 Model: TI AM3359 ICE-V2 DRAM: 256 MiB ETH0, CPSW ETH1, CPSW WDT: Started with servicing (60s timeout) NAND: 0 MiB MMC: OMAP SD/MMC: 0 Loading Environment from SPI Flash... SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB OK Net: eth0: ethernet@4a100000 Hit any key to stop autoboot: 0 SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB device 0 offset 0x120000, size 0x3c0000 SF: 3932160 bytes @ 0x120000 Read: OK device 0 offset 0x4e0000, size 0x10000 SF: 65536 bytes @ 0x4e0000 Read: OK ## Flattened Device Tree blob at 88000000 Booting using the fdt blob at 0x88000000 Loading Device Tree to 8df23000, end 8df35095 ... OK Starting kernel ... [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 5.4.106-g023faefa70 (inovance@10007999HLV-01.inovance.local) (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 PREEMPT Wed Sep 1 19:39:03 CST 2021 [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache [ 0.000000] OF: fdt: Machine model: TI AM3359 ICE-V2 [ 0.000000] Memory policy: Data cache writeback [ 0.000000] CPU: All CPU(s) started in SVC mode. [ 0.000000] AM335X ES2.1 (sgx neon) [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 64770 [ 0.000000] Kernel command line: console=ttyO3,115200n8 rootwait=1 rw ubi.mtd=5 rootfstye=ubifs rw root=ubi0:rootfs [ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear) [ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] Memory: 246560K/261120K available (7168K kernel code, 262K rwdata, 1964K rodata, 1024K init, 494K bss, 14560K reserved, 0K cma-reserved, 0K highmem) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies. [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts [ 0.000000] random: get_random_bytes called from start_kernel+0x2b4/0x454 with crng_init=0 [ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz [ 0.000022] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [ 0.000051] I-pipe, 24.000 MHz clocksource, wrap in 178956 ms [ 0.000075] clocksource: ipipe_tsc: mask: 0xffffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns [ 0.000102] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [ 0.000112] OMAP clocksource: timer1 at 24000000 Hz [ 0.000474] timer_probe: no matching timers found [ 0.000870] Interrupt pipeline (release #1) [ 0.001044] printk: console [rawcon-1] enabled [ 0.001202] Console: colour dummy device 80x30 [ 0.001243] WARNING: Your 'console=ttyO3' has been replaced by 'ttyS3' [ 0.001251] This ensures that you still see kernel messages. Please [ 0.001258] update your kernel commandline. [ 0.001320] Calibrating delay loop... 597.60 BogoMIPS (lpj=2988032) [ 0.118804] pid_max: default: 32768 minimum: 301 [ 0.119023] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.119041] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.119841] CPU: Testing write buffer coherency: ok [ 0.119919] CPU0: Spectre v2: using BPIALL workaround [ 0.120874] Setting up static identity map for 0x80100000 - 0x80100060 [ 0.121057] rcu: Hierarchical SRCU implementation. [ 0.121527] devtmpfs: initialized [ 0.137015] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3 [ 0.137508] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.137544] futex hash table entries: 256 (order: -1, 3072 bytes, linear) [ 0.137703] pinctrl core: initialized pinctrl subsystem [ 0.139039] NET: Registered protocol family 16 [ 0.139740] DMA: preallocated 256 KiB pool for atomic coherent allocations [ 0.167252] l3-aon-clkctrl:0000:0: failed to disable [ 0.188690] No ATAGs? [ 0.188704] hw-breakpoint: debug architecture 0x4 unsupported. [ 0.198380] cryptd: max_cpu_qlen set to 1000 [ 0.208512] debugfs: Directory '49000000.edma' with parent 'dmaengine' already present! [ 0.208558] edma 49000000.edma: TI EDMA DMA engine driver [ 0.210933] iommu: Default domain type: Translated [ 0.213022] pps_core: LinuxPPS API ver. 1 registered [ 0.213041] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it> [ 0.213074] PTP clock support registered [ 0.213102] EDAC MC: Ver: 3.0.0 [ 0.215223] clocksource: Switched to clocksource ipipe_tsc [ 0.225479] thermal_sys: Registered thermal governor 'fair_share' [ 0.225491] thermal_sys: Registered thermal governor 'step_wise' [ 0.225515] thermal_sys: Registered thermal governor 'user_space' [ 0.226230] NET: Registered protocol family 2 [ 0.227135] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear) [ 0.227170] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear) [ 0.227210] TCP bind hash table entries: 2048 (order: 1, 8192 bytes, linear) [ 0.227246] TCP: Hash tables configured (established 2048 bind 2048) [ 0.227369] UDP hash table entries: 256 (order: 0, 4096 bytes, linear) [ 0.227398] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear) [ 0.227575] NET: Registered protocol family 1 [ 0.228396] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available [ 0.232631] [Xenomai] scheduling class idle registered. [ 0.232653] [Xenomai] scheduling class rt registered. [ 0.232795] I-pipe: head domain Xenomai registered. [ 0.240795] [Xenomai] Cobalt v3.1.1 [ 0.240826] Initialise system trusted keyrings [ 0.240974] workingset: timestamp_bits=30 max_order=16 bucket_order=0 [ 0.300843] NET: Registered protocol family 38 [ 0.300876] Key type asymmetric registered [ 0.300887] Asymmetric key parser 'x509' registered [ 0.300966] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245) [ 0.300980] io scheduler mq-deadline registered [ 0.300989] io scheduler kyber registered [ 0.306943] OMAP GPIO hardware version 0.1 [ 0.335992] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400 [ 0.354731] GPIO line 100 (PR1_MII_CTRL) hogged as output/high [ 0.354771] GPIO line 106 (MUX_MII_CTL1) hogged as output/high [ 0.363515] pinctrl-single 44e10800.pinmux: 142 pins, size 568 [ 0.368220] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled [ 0.372705] 481a6000.serial: ttyS3 at MMIO 0x481a6000 (irq = 44, base_baud = 3000000) is a 8250 [ 0.940720] printk: console [ttyS3] enabled [ 0.948661] omap_rng 48310000.rng: Random Number Generator ver. 20 [ 0.955474] random: fast init done [ 0.959150] random: crng init done [ 0.974407] brd: module loaded [ 0.986783] loop: module loaded [ 0.996156] spi-nor spi0.0: found s25fl064k, expected w25q64 [ 1.001911] spi-nor spi0.0: s25fl064k (8192 Kbytes) [ 1.007001] 6 fixed-partitions partitions found on MTD device spi0.0 [ 1.013387] Creating 6 MTD partitions on "spi0.0": [ 1.018245] 0x000000000000-0x000000020000 : "u-boot-spl" [ 1.036158] 0x000000020000-0x000000100000 : "u-boot" [ 1.046179] 0x000000100000-0x000000120000 : "u-boot-env" [ 1.056180] 0x000000120000-0x0000004e0000 : "kernel" [ 1.066183] 0x0000004e0000-0x0000004f0000 : "dtb" [ 1.076177] 0x000000500000-0x000000800000 : "rootfs" [ 1.087832] libphy: Fixed MDIO Bus: probed [ 1.155286] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000 [ 1.163000] libphy: 4a101000.mdio: probed [ 1.170094] davinci_mdio 4a101000.mdio: phy[1]: device 4a101000.mdio:01, driver TI TLK10X 10/100 Mbps PHY [ 1.179822] davinci_mdio 4a101000.mdio: phy[3]: device 4a101000.mdio:03, driver TI TLK10X 10/100 Mbps PHY [ 1.189732] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4 [ 1.196226] cpsw 4a100000.ethernet: ALE Table size 1024 [ 1.201598] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies) [ 1.208923] cpsw 4a100000.ethernet: Detected MACID = 84:eb:18:ad:94:88 [ 1.218464] omap_rtc 44e3e000.rtc: already running [ 1.224221] omap_rtc 44e3e000.rtc: registered as rtc0 [ 1.229789] i2c /dev entries driver [ 1.234578] sdhci: Secure Digital Host Controller Interface driver [ 1.240862] sdhci: Copyright(c) Pierre Ossman [ 1.248242] omap_hsmmc 47810000.mmc: RX DMA channel request failed [ 1.254643] sdhci-pltfm: SDHCI platform and OF driver helper [ 1.262016] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2 [ 1.268189] omap-aes 53500000.aes: will run requests pump with realtime priority [ 1.277850] omap-sham 53100000.sham: hw accel on OMAP rev 4.3 [ 1.312164] Initializing XFRM netlink socket [ 1.316714] NET: Registered protocol family 17 [ 1.321225] NET: Registered protocol family 15 [ 1.325835] 8021q: 802.1Q VLAN Support v1.8 [ 1.330205] ThumbEE CPU extension supported. [ 1.336232] omap_voltage_late_init: Voltage driver support not added [ 1.343352] Loading compiled-in X.509 certificates [ 1.395504] tps65910 0-002d: No interrupt support, no core IRQ [ 1.406143] vrtc: supplied by vbat [ 1.411202] vio: supplied by vbat [ 1.416508] vdd_mpu: supplied by vbat [ 1.422104] vdd_core: supplied by vbat [ 1.428724] vdig1: supplied by vbat [ 1.433724] vdig2: supplied by vbat [ 1.438755] vpll: supplied by vbat [ 1.443636] vdac: supplied by vbat [ 1.448594] vaux1: supplied by vbat [ 1.453573] vaux2: supplied by vbat [ 1.458591] vaux33: supplied by vbat [ 1.463661] vmmc: supplied by vbat [ 1.468525] vbb: supplied by vbat [ 1.472921] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz [ 1.508399] ubi0: attaching mtd5 [ 1.520324] ubi0: scanning is finished [ 1.548357] mmc0: host does not support reading read-only switch, assuming write-enable [ 1.565326] mmc0: new high speed SDHC card at address 1234 [ 1.577900] mmcblk0: mmc0:1234 SA08G 7.21 GiB [ 1.594429] mmcblk0: p1 p2 [ 2.025392] ubi0: volume 5 ("rootfs") re-sized from 44 to 44 LEBs [ 2.032283] ubi0: attached mtd5 (name "rootfs", size 3 MiB) [ 2.037947] ubi0: PEB size: 65536 bytes (64 KiB), LEB size: 65408 bytes [ 2.044593] ubi0: min./max. I/O unit sizes: 1/256, sub-page size 1 [ 2.050822] ubi0: VID header offset: 64 (aligned 64), data offset: 128 [ 2.057399] ubi0: good PEBs: 48, bad PEBs: 0, corrupted PEBs: 0 [ 2.063347] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128 [ 2.070622] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 910164381 [ 2.079728] ubi0: available PEBs: 0, total reserved PEBs: 48, PEBs reserved for bad PEB handling: 0 [ 2.088850] ubi0: background thread "ubi_bgt0d" started, PID 108 [ 2.095270] printk: console [netcon0] enabled [ 2.099653] netconsole: network logging started [ 2.104274] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:01:57 UTC (946684917) [ 2.136118] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -2 [ 2.144087] Please append a correct "root=" boot option; here are the available partitions: [ 2.175104] 0100 65536 ram0 [ 2.175109] (driver?) [ 2.189672] 0101 65536 ram1 [ 2.189676] (driver?) [ 2.204199] 0102 65536 ram2 [ 2.204202] (driver?) [ 2.218745] 0103 65536 ram3 [ 2.218748] (driver?) [ 2.224881] 0104 65536 ram4 [ 2.224884] (driver?) [ 2.247631] 0105 65536 ram5 [ 2.247635] (driver?) [ 2.253771] 0106 65536 ram6 [ 2.253774] (driver?) [ 2.276582] 0107 65536 ram7 [ 2.276586] (driver?) [ 2.282720] 0108 65536 ram8 [ 2.282723] (driver?) [ 2.305500] 0109 65536 ram9 [ 2.305503] (driver?) [ 2.311636] 010a 65536 ram10 [ 2.311639] (driver?) [ 2.334633] 010b 65536 ram11 [ 2.334636] (driver?) [ 2.349281] 010c 65536 ram12 [ 2.349284] (driver?) [ 2.363996] 010d 65536 ram13 [ 2.363999] (driver?) [ 2.378718] 010e 65536 ram14 [ 2.378722] (driver?) [ 2.384943] 010f 65536 ram15 [ 2.384946] (driver?) [ 2.408078] 1f00 128 mtdblock0 [ 2.408082] (driver?) [ 2.414652] 1f01 896 mtdblock1 [ 2.414656] (driver?) [ 2.439077] 1f02 128 mtdblock2 [ 2.439080] (driver?) [ 2.454541] 1f03 3840 mtdblock3 [ 2.454545] (driver?) [ 2.470088] 1f04 64 mtdblock4 [ 2.470092] (driver?) [ 2.485601] 1f05 3072 mtdblock5 [ 2.485605] (driver?) [ 2.492176] b300 7565312 mmcblk0 [ 2.492180] driver: mmcblk [ 2.517293] b301 511999 mmcblk0p1 e4bc8b5e-01 [ 2.517297] [ 2.524130] b302 7053312 mmcblk0p2 e4bc8b5e-02 [ 2.524133] [ 2.547543] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 2.555861] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
[ 2.136118] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -2
Operate in command line:
Hi Tony,
Some useful reference on NAND/MTD/UBI in Linux SDK user guide:
[1]. software-dl.ti.com/.../Foundational_Components_U-Boot.html
[2]. software-dl.ti.com/.../NAND.html
where
[1] booting kernel/rootfs from NAND
[2] how to generate UBIFS/UBI rootfs for NAND
There're also useful reference on MTD/UBI/UBIFS:
www.linux-mtd.infradead.org/.../ubi.html
www.linux-mtd.infradead.org/.../ubifs.html
Best,
-Hong
Guan,
Customer wants to use SPI NOR flash, not NAND flash. They used NAND on some AM335x based product already.
Hi Tony,
It seems you were trying for full Linux boot from 8MiB SPI flash.
Some of logs in your post were not consistent, where 3MiB (MTD5) or 5MiB(MTD3) was mounted as rootfs.
Anyway, it is practically challenge to use 3MiB/5MiB MTD partition for rootfs.
For your reference, I wrote the steps to boot full Linux from OSPI (64MiB) on AM64x GP EVM.
The procedure should apply to SPI/QSPI/OSPI MTD/UBI/UBIFS Linux booting in general.
e2e.ti.com/.../3769546
Hope it helps!
Best,
-Hong