Hello,
We are using MT29F8G08ABABA in our DM365 based custom board.
We are using NAND boot.
RootFS is in UBIFS format,
Below is basic achitecture of the NAND.
I am using following commands to create ubifs,
$(UBIFS_PATH)/mkfs.ubifs -r $(TARGET_FS) -m 4096 -e 520192 -c 75 -o ubifs.img $(UBIFS_PATH)/ubinize -o $(SYSTEM_CFG)_$(HARDWARE_CFG)_ubifs -m 4096 -p 512KiB $(HARDWARE_CFG)_ubinize.cfg
Then i put this ubifs to NAND using following commands,
loady 0x82000000 ---> ubifs is loaded to RAM nand scrub 0x1800000 0x2800000 nand erase 0x1800000 0x2800000 nand write 0x82000000 0x1800000 0x2800000
and when i boot the kernel there is error while detecting UBIFS from kernel,
Below is kernel log for the same,
[ 0.000000] Linux version 2.6.37_IPNC_DM368_5.1.0 (root@test-desktop) (gcc version 4.3.3 (GCC) ) #1 PREEMPT Thu Jan 2 16:36:03 EST 2014 [ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177 [ 0.000000] CPU: VIVT data cache, VIVT instruction cache [ 0.000000] Machine: DaVinci DM36x IPNC [ 0.000000] Memory policy: ECC disabled, Data cache writeback [ 0.000000] DaVinci dm36x_rev1.2 variant 0x8 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 12192 [ 0.000000] Kernel command line: mem=48M console=ttyS0,115200n8 noinitrd ip=off rw ubi.mtd=3,4096 rootfstype=ubifs root=ubi0:rootfs cmemk.phys_start=0x83000000 cmemk.phys_end=0x88000000 cmemk.phys_start_1=0x00001000 cmemk.phys_end_1=0x00008000 cmemk.pools_1=1x28672 cmemk.allowOverlap=1 cmemk.useHeapIfPoolUnavailable=1 nohz=off highres=off clocksource=acpi_pm lpj=1077248 [ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes) [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Memory: 48MB = 48MB total [ 0.000000] Memory: 45108k/45108k available, 4044k reserved, 0K highmem [ 0.000000] Virtual kernel memory layout: [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB) [ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB) [ 0.000000] DMA : 0xff000000 - 0xffe00000 ( 14 MB) [ 0.000000] vmalloc : 0xc3800000 - 0xfea00000 ( 946 MB) [ 0.000000] lowmem : 0xc0000000 - 0xc3000000 ( 48 MB) [ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB) [ 0.000000] .init : 0xc0008000 - 0xc0029000 ( 132 kB) [ 0.000000] .text : 0xc0029000 - 0xc033e000 (3156 kB) [ 0.000000] .data : 0xc033e000 - 0xc03629c0 ( 147 kB) [ 0.000000] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] Preemptable hierarchical RCU implementation. [ 0.000000] RCU-based detection of stalled CPUs is disabled. [ 0.000000] Verbose stalled-CPUs detection is disabled. [ 0.000000] NR_IRQS:245 [ 0.000000] Console: colour dummy device 80x30 [ 0.056324] Calibrating delay loop (skipped) preset value.. 215.44 BogoMIPS (lpj=1077248) [ 0.056408] pid_max: default: 32768 minimum: 301 [ 0.056706] Security Framework initialized [ 0.056904] Mount-cache hash table entries: 512 [ 0.058007] CPU: Testing write buffer coherency: ok [ 0.060305] devtmpfs: initialized [ 0.064317] DaVinci: 8 gpio irqs [ 0.065159] NET: Registered protocol family 16 [ 0.114797] dm365_rmd_cs_rdk_150_wl_init [ 0.209129] bio: create slab <bio-0> at 0 [ 0.215693] SCSI subsystem initialized [ 0.221284] usbcore: registered new interface driver usbfs [ 0.223060] usbcore: registered new interface driver hub [ 0.224234] usbcore: registered new device driver usb [ 0.228551] vpss vpss: dm365_vpss vpss probed [ 0.228639] vpss vpss: dm365_vpss vpss probe success [ 0.238786] Switching to clocksource timer0_1 [ 0.346347] NET: Registered protocol family 2 [ 0.346753] IP route cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.347788] TCP established hash table entries: 2048 (order: 2, 16384 bytes) [ 0.347988] TCP bind hash table entries: 2048 (order: 1, 8192 bytes) [ 0.348116] TCP: Hash tables configured (established 2048 bind 2048) [ 0.348161] TCP reno registered [ 0.348214] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.348307] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.349019] NET: Registered protocol family 1 [ 0.437974] JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc. [ 0.443061] msgmni has been set to 88 [ 0.448190] io scheduler noop registered (default) [ 0.450725] CSL: Module install successful, device major num = 254 [ 0.450791] CSL: Module version 0.10.00, built on Dec 19 2013 15:41:34 [ 0.450864] I2C: Module install successful, device major num = 253 [ 0.450919] DMA: Module install successful, device major num = 252 [ 0.450958] DRV: Module install successful [ 0.450994] DRV: Module built on Dec 19 2013 15:41:35 [ 0.451034] DRV: EDMACC.QUEPRI = 00002777 [ 0.451067] DRV: SYSTEM.MSTPRI0 = 00440011 [ 0.451099] DRV: SYSTEM.MSTPRI1 = 00000444 [ 0.451132] DRV: ISP.BCR = 00000002 [ 0.451164] DRV: SYSTEM.MISC = 00000399 [ 0.451197] EDMAK module: built on Dec 19 2013 at 15:41:17 [ 0.451241] Reference Linux version 2.6.37 [ 0.451276] File /home/rosemount/mridula/IPNC/OV9715_V5/dvsdk_ipnctools/linuxutils_2_26_02_05/packages/ti/sdo/linuxutils/edma/src/module/edmak.c [ 0.453436] IRQK module: built on Dec 19 2013 at 15:41:15 [ 0.453506] Reference Linux version 2.6.37 [ 0.453544] File /home/rosemount/mridula/IPNC/OV9715_V5/dvsdk_ipnctools/linuxutils_2_26_02_05/packages/ti/sdo/linuxutils/irq/src/module/irqk.c [ 0.455774] irqk initialized [ 0.455872] CMEMK module: built on Dec 19 2013 at 15:41:13 [ 0.455928] Reference Linux version 2.6.37 [ 0.455966] File /home/rosemount/mridula/IPNC/OV9715_V5/dvsdk_ipnctools/linuxutils_2_26_02_05/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c [ 0.463265] allocated heap buffer 0xc4000000 of size 0x5000000 [ 0.463324] heap fallback enabled - will try heap if pool buffer is not available [ 0.463384] CMEM Range Overlaps Kernel Physical - allowing overlap [ 0.463434] CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x83000000) [ 0.463630] cmemk initialized [ 0.463703] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled [ 0.570822] serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A [ 1.077387] console [ttyS0] enabled [ 1.150700] serial8250.0: ttyS1 at MMIO 0x1d06000 (irq = 41) is a 16550A [ 1.193883] brd: module loaded [ 1.206107] NAND device: Manufacturer ID: 0x2c, Chip ID: 0x38 (Micron ) [ 1.214915] Bad block table not found for chip 0 [ 1.221181] Bad block table not found for chip 0 [ 1.225835] Scanning device for bad blocks [ 1.621947] Creating 7 MTD partitions on "davinci_nand.0": [ 1.627505] 0x000000000000-0x000000c00000 : "bootloader" [ 1.639165] 0x000000c00000-0x000001400000 : "params" [ 1.650851] 0x000001400000-0x000001800000 : "kernel" [ 1.662507] 0x000001800000-0x000004000000 : "filesystem1" [ 1.674677] 0x000004000000-0x000004800000 : "data1" [ 1.686597] 0x000004800000-0x000007000000 : "filesystem2" [ 1.698564] 0x000007000000-0x000040000000 : "data2" [ 1.711909] davinci_nand davinci_nand.0: controller rev. 2.3 [ 1.721883] UBI: attaching mtd3 to ubi0 [ 1.725771] UBI: physical eraseblock size: 262144 bytes (256 KiB) [ 1.732471] UBI: logical eraseblock size: 256000 bytes [ 1.737910] UBI: smallest flash I/O unit: 2048 [ 1.742797] UBI: sub-page size: 512 [ 1.747451] UBI: VID header offset: 4096 (aligned 4096) [ 1.753616] UBI: data offset: 6144 [ 1.759413] UBI error: validate_ec_hdr: bad data offset 8192, expected 6144 [ 1.766555] UBI error: validate_ec_hdr: bad EC header [ 1.771733] UBI error: ubi_io_read_ec_hdr: validation failed for PEB 0 [ 1.778790] UBI error: ubi_init: cannot attach mtd3 [ 1.786622] spi_davinci spi_davinci.0: Controller at 0xfec66000 [ 1.850151] davinci_mdio davinci_mdio.0: davinci mdio revision 1.4 [ 1.856383] davinci_mdio davinci_mdio.0: no live phy, scanning all [ 1.863539] davinci_mdio: probe of davinci_mdio.0 failed with error -5 [ 1.872423] i2c /dev entries driver [ 1.879044] Linux media interface: v0.10 [ 1.884074] Linux video capture interface: v2.00 [ 1.891696] vpbe-osd vpbe-osd: OSD sub device probe success [ 1.898435] vpbe-venc vpbe-venc: VENC sub device probe success [ 1.905591] vpbe-v4l2 vpbe-v4l2: vpbe v4l2 device registered [ 1.911927] Setting default output to Composite [ 1.916510] Setting default mode to ntsc [ 1.920738] vpbe-v4l2 vpbe-v4l2: Trying to register VPBE display device. [ 1.927479] vpbe-v4l2 vpbe-v4l2: layer=c2894200,layer->video_dev=c28942e8 [ 1.935744] vpbe-v4l2 vpbe-v4l2: Trying to register VPBE display device. [ 1.942764] vpbe-v4l2 vpbe-v4l2: layer=c2897e00,layer->video_dev=c2897ee8 [ 1.952281] watchdog watchdog: heartbeat 60 sec [ 1.960723] nf_conntrack version 0.5.0 (704 buckets, 2816 max) [ 1.969426] ip_tables: (C) 2000-2006 Netfilter Core Team [ 1.975347] TCP cubic registered [ 1.978664] NET: Registered protocol family 17 [ 1.996127] inside kernel_init [ 1.999486] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0) [ 2.006960] Please append a correct "root=" boot option; here are the available partitions: [ 2.015597] 1f00 12288 mtdblock0 (driver?) [ 2.020875] 1f01 8192 mtdblock1 (driver?) [ 2.025992] 1f02 4096 mtdblock2 (driver?) [ 2.031207] 1f03 40960 mtdblock3 (driver?) [ 2.036314] 1f04 8192 mtdblock4 (driver?) [ 2.041517] 1f05 40960 mtdblock5 (driver?) [ 2.046629] 1f06 933888 mtdblock6 (driver?) [ 2.051803] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Now my doubt is why kernel is reporting physical eraseblock size as 256KiB? from architecture of NAND it looks to be 512KiB.
dm368_ubinize.cfg content is as follows,
[ubifs] mode=ubi image=ubifs.img vol_id=0 vol_size=37888KiB vol_type=dynamic vol_name=rootfs vol_flags=autoresize
Any suggestions/pointer for the errors ?
Thank you in advance