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.

Kernel not able to mount ubifs file system from NAND after detection of SPI flash.

Other Parts Discussed in Thread: AM3352

Hi All,

I am using two flash in my board with AM3352 processor.

1. SPI nor flash for password protection.

2. NAND flash for system booting.

kernel command line is

Kernel command line: console=ttyO0,115200n8 consoleblank=0 init=/etc/preinit root=ubi0:rootfs rw ubi.mtd=12,2048 noinitrd rootfstype=ubifs rootflags=sync user_debug=31 mem=128M mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1m(U-Boot),512k(U-Boot-Env),1m(dtb),8m(Recv-Kernel),20m(Recv-Fs),1m(hwtst),16m(data),8m(Kernel),-(Rootfs) ethaddr=00:05:D7:09:7A:49

My all binaries are being preset in NAND flash.

U-boot is able to read kernel image from nand flash but the after when my kernel is detecting SPI flash and NAND flash at that time my kernel is not able to mount ubifs file system..

Kernel log is as :

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 3.14.26-gb9df364-dirty (root@localhost.localdomain) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #14 Wed Apr 20 15:29:14 IST 2016
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: MATRIX: ETERNITY_NEV3
[    0.000000] cma: CMA: reserved 16 MiB at 86800000
[    0.000000] Memory policy: Data cache writeback
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (neon )
[    0.000000] Kernel command line: console=ttyO0,115200n8 consoleblank=0 init=/etc/preinit root=ubi0:rootfs rw ubi.mtd=12,2048 noinitrd rootfstype=ubifs rootflags=sync user_debug=31 mem=128M mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1m(U-Boot),512k(U-Boot-Env),1m(dtb),8m(Recv-Kernel),20m(Recv-Fs),1m(hwtst),16m(data),8m(Kernel),-(Rootfs) ethaddr=00:05:D7:09:7A:49
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc069e6f0   (6746 kB)
[    0.000000]       .init : 0xc069f000 - 0xc06d382c   ( 211 kB)
[    0.000000]       .data : 0xc06d4000 - 0xc0710600   ( 242 kB)
[    0.000000]        .bss : 0xc0710600 - 0xc0744e18   ( 211 kB)
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[    0.000000] Total of 128 interrupts on 1 active controller
[    0.000000] OMAP clockevent source: timer2 at 25000000 Hz
[    0.000014] sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 171798691800ns
[    0.000031] OMAP clocksource: timer1 at 25000000 Hz
[    0.000288] Console: colour dummy device 80x30
[    0.000311] Calibrating delay loop... 795.44 BogoMIPS (lpj=3977216)
[    0.089520] pid_max: default: 32768 minimum: 301
[    0.089609] Security Framework initialized
[    0.089664] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.089674] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.095920] CPU: Testing write buffer coherency: ok
[    0.096297] Setting up static identity map for 0x804c8668 - 0x804c86c0
[    0.097262] devtmpfs: initialized
[    0.105604] omap_hwmod: tptc0 using broken dt data from edma
[    0.105669] omap_hwmod: tptc1 using broken dt data from edma
[    0.105730] omap_hwmod: tptc2 using broken dt data from edma
[    0.109783] omap_hwmod: debugss: _wait_target_disable failed
[    0.165231] pinctrl core: initialized pinctrl subsystem
[    0.166093] regulator-dummy: no parameters
[    0.167787] NET: Registered protocol family 16
[    0.169749] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.171490] cpuidle: using governor ladder
[    0.171506] cpuidle: using governor menu
[    0.177479] syscon 44e10000.control_module: regmap [mem 0x44e10000-0x44e107fb] registered
[    0.178756] platform 49000000.edma: alias fck already exists
[    0.178778] platform 49000000.edma: alias fck already exists
[    0.178791] platform 49000000.edma: alias fck already exists
[    0.179831] OMAP GPIO hardware version 0.1
[    0.187913] omap-gpmc 50000000.gpmc: could not find pctldev for node /pinmux@44e10800/nandflash_pins_default, deferring probe
[    0.187946] platform 50000000.gpmc: Driver omap-gpmc requests probe deferral
[    0.189017] MATRIX NEV3: Registering i2c_board_info at Bus number 1
[    0.189033] MATRIX NEV3: Registering spi_register_board_info at SPI Bus number 1
[    0.189040] MATRIX: SPI register fucntion is being called
[    0.189609] No ATAGs?
[    0.189622] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.206476] bio: create slab <bio-0> at 0
[    0.219687] edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine driver
[    0.221035] SCSI subsystem initialized
[    0.221903] usbcore: registered new interface driver usbfs
[    0.222070] usbcore: registered new interface driver hub
[    0.222288] usbcore: registered new device driver usb
[    0.222955] omap_i2c 4802a000.i2c: could not find pctldev for node /pinmux@44e10800/i2c1_pins_default, deferring probe
[    0.222983] platform 4802a000.i2c: Driver omap_i2c requests probe deferral
[    0.223289] pps_core: LinuxPPS API ver. 1 registered
[    0.223299] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.223412] PTP clock support registered
[    0.224735] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[    0.226022] Switched to clocksource timer1
[    0.242783] NET: Registered protocol family 2
[    0.243608] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.243632] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.243650] TCP: Hash tables configured (established 1024 bind 1024)
[    0.243735] TCP: reno registered
[    0.243749] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.243766] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.243979] NET: Registered protocol family 1
[    0.244288] RPC: Registered named UNIX socket transport module.
[    0.244299] RPC: Registered udp transport module.
[    0.244304] RPC: Registered tcp transport module.
[    0.244311] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.245360] hw perfevents: enabled with ARMv7 Cortex-A8 PMU driver, 5 counters available
[    0.247898] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.249430] VFS: Disk quotas dquot_6.5.2
[    0.250005] NFS: Registering the id_resolver key type
[    0.250081] Key type id_resolver registered
[    0.250089] Key type id_legacy registered
[    0.250141] msgmni has been set to 236
[    0.251407] io scheduler noop registered
[    0.251420] io scheduler deadline registered
[    0.251440] io scheduler cfq registered (default)
[    0.252929] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[    0.254329] omap_uart 44e09000.serial: no wakeirq for uart0
[    0.254494] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 88, base_baud = 3000000) is a OMAP UART0
[    0.905726] console [ttyO0] enabled
[    0.910098] omap_uart 48022000.serial: no wakeirq for uart0
[    0.916078] 48022000.serial: ttyO1 at MMIO 0x48022000 (irq = 89, base_baud = 3000000) is a OMAP UART1
[    0.926320] omap_uart 48024000.serial: no wakeirq for uart0
[    0.932243] 48024000.serial: ttyO2 at MMIO 0x48024000 (irq = 90, base_baud = 3000000) is a OMAP UART2
[    0.943076] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
[    0.959894] brd: module loaded
[    0.968374] loop: module loaded
[    0.972736] mtdoops: mtd device (mtddev=name/number) must be supplied
[    0.992837] m25p80 spi1.0: s25fl128s0 (16384 Kbytes)
[    1.000990] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.007879] ehci-omap: OMAP-EHCI Host Controller driver
[    1.013572] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.020282] usbcore: registered new interface driver cdc_acm
[    1.026220] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    1.034761] usbcore: registered new interface driver usblp
[    1.040656] usbcore: registered new interface driver cdc_wdm
[    1.046736] usbcore: registered new interface driver usbtmc
[    1.052719] usbcore: registered new interface driver usb-storage
[    1.059165] usbcore: registered new interface driver usbtest
[    1.066797] 47401300.usb-phy supply vcc not found, using dummy regulator
[    1.076142] musb-hdrc musb-hdrc.0.auto: MUSB HDRC host driver
[    1.082564] musb-hdrc musb-hdrc.0.auto: new USB bus registered, assigned bus number 1
[    1.090976] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.098101] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.105659] usb usb1: Product: MUSB HDRC host driver
[    1.110861] usb usb1: Manufacturer: Linux 3.14.26-gb9df364-dirty musb-hcd
[    1.117971] usb usb1: SerialNumber: musb-hdrc.0.auto
[    1.124058] hub 1-0:1.0: USB hub found
[    1.128053] hub 1-0:1.0: 1 port detected
[    1.133140] 47401b00.usb-phy supply vcc not found, using dummy regulator
[    1.142441] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.148891] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 2
[    1.157270] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    1.164375] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.171948] usb usb2: Product: MUSB HDRC host driver
[    1.177150] usb usb2: Manufacturer: Linux 3.14.26-gb9df364-dirty musb-hcd
[    1.184251] usb usb2: SerialNumber: musb-hdrc.1.auto
[    1.190347] hub 2-0:1.0: USB hub found
[    1.194313] hub 2-0:1.0: 1 port detected
[    1.211731] i2c /dev entries driver
[    1.216426] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
[    1.224918] usbcore: registered new interface driver usbhid
[    1.230802] usbhid: USB HID core driver
[    1.234984] platform 44d00000.wkup_m3: Driver wkup_m3 requests probe deferral
[    1.243325] oprofile: using arm/armv7
[    1.247303] Netfilter messages via NETLINK v0.30.
[    1.252251] nf_conntrack version 0.5.0 (1895 buckets, 7580 max)
[    1.258653] ctnetlink v0.93: registering with nfnetlink.
[    1.264469] ipip: IPv4 over IPv4 tunneling driver
[    1.270816] ip_tables: (C) 2000-2006 Netfilter Core Team
[    1.276587] ipt_CLUSTERIP: ClusterIP Version 0.8 loaded successfully
[    1.283282] TCP: cubic registered
[    1.286761] Initializing XFRM netlink socket
[    1.291293] NET: Registered protocol family 10
[    1.297202] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    1.303086] sit: IPv6 over IPv4 tunneling driver
[    1.309166] NET: Registered protocol family 17
[    1.313861] NET: Registered protocol family 15
[    1.318616] Bridge firewalling registered
[    1.322879] 8021q: 802.1Q VLAN Support v1.8
[    1.327326] Key type dns_resolver registered
[    1.332932] PM: Voltage scaling data blob not provided from DT.
[    1.339277] PM: no-rtc available, rtc-only mode disabled.
[    1.344925] ThumbEE CPU extension supported.
[    1.350864] regulator-dummy: disabling
[    1.355174] omap-gpmc 50000000.gpmc: GPMC revision 6.0
[    1.360606] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    1.368154] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xf1
[    1.374809] nand: AMD/Spansion S34ML01G2
[    1.378947] nand: 128MiB, SLC, page size: 2048, OOB size: 64
[    1.384865] nand: using OMAP_ECC_BCH8_CODE_HW ECC scheme
[    1.390481] 13 cmdlinepart partitions found on MTD device omap2-nand.0
[    1.397318] Creating 13 MTD partitions on "omap2-nand.0":
[    1.402971] 0x000000000000-0x000000020000 : "SPL"
[    1.409609] 0x000000020000-0x000000040000 : "SPL.backup1"
[    1.416677] 0x000000040000-0x000000060000 : "SPL.backup2"
[    1.423690] 0x000000060000-0x000000080000 : "SPL.backup3"
[    1.430749] 0x000000080000-0x000000180000 : "U-Boot"
[    1.438071] 0x000000180000-0x000000200000 : "U-Boot-Env"
[    1.445315] 0x000000200000-0x000000300000 : "dtb"
[    1.452428] 0x000000300000-0x000000b00000 : "Recv-Kernel"
[    1.465919] 0x000000b00000-0x000001f00000 : "Recv-Fs"
[    1.488845] 0x000001f00000-0x000002000000 : "hwtst"
[    1.496079] 0x000002000000-0x000003000000 : "data"
[    1.515381] 0x000003000000-0x000003800000 : "Kernel"
[    1.528382] 0x000003800000-0x000008000000 : "Rootfs"
[    1.598514] rtc-s35390a 1-0030: rtc core: registered rtc-s35390a as rtc0
[    1.605557] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 400 kHz
[    1.611811]  remoteproc0: wkup_m3 is available
[    1.616495]  remoteproc0: Note: remoteproc is still under development and considered experimental.
[    1.625868]  remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
[    1.637027]  remoteproc0: powering up wkup_m3
[    1.641592]  remoteproc0: Booting fw image am335x-pm-firmware.elf, size 154412
[    1.649509] PM: CM3 Firmware Version = 0x190
[    1.654085]  remoteproc0: remote processor wkup_m3 is now up
[    1.660622] UBI: attaching mtd12 to ubi0
[    1.694682] UBI: scanning is finished
[    1.698530] UBI error: ubi_read_volume_table: the layout volume was not found
[    1.706034] UBI error: ubi_attach_mtd_dev: failed to attach mtd12, error -22
[    1.713437] UBI error: ubi_init: cannot attach mtd12
[    1.776072] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[    1.782461] davinci_mdio 4a101000.mdio: detected phy mask ffffff7e
[    1.790130] libphy: 4a101000.mdio: probed
[    1.794334] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver unknown
[    1.802733] davinci_mdio 4a101000.mdio: phy[7]: device 4a101000.mdio:07, driver unknown
[    1.811673] cpsw 4a100000.ethernet: Detected MACID = 00:05:d7:09:7a:49
[    1.820462] rtc-s35390a 1-0030: setting system clock to 2000-01-09 00:24:26 UTC (947377466)
[    1.832644] UBIFS error (pid 1): ubifs_mount: cannot open "ubi0:rootfs", error -19
[    1.840866] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.849522] CPU: 0 PID: 1 Comm: swapper Tainted: G        W    3.14.26-gb9df364-dirty #14
[    1.858123] [<c0013bc8>] (unwind_backtrace) from [<c0011120>] (show_stack+0x10/0x14)
[    1.866242] [<c0011120>] (show_stack) from [<c04c30d8>] (panic+0x7c/0x1d4)
[    1.873453] [<c04c30d8>] (panic) from [<c069ff24>] (mount_block_root+0x184/0x230)
[    1.881289] [<c069ff24>] (mount_block_root) from [<c06a025c>] (prepare_namespace+0x8c/0x1c4)
[    1.890121] [<c06a025c>] (prepare_namespace) from [<c069fbc8>] (kernel_init_freeable+0x16c/0x1b0)
[    1.899408] [<c069fbc8>] (kernel_init_freeable) from [<c04c1dd4>] (kernel_init+0x8/0xec)
[    1.907878] [<c04c1dd4>] (kernel_init) from [<c000e458>] (ret_from_fork+0x14/0x3c)

Please, HELP!

Rgs,

Santosh

 

 

 

  • I will forward this to the software team.
  • Hello Santosh,

    Could you post the output of this command?

    U-Boot# printenv nandroot

    Best regards,
    Kemal

  • HI All,

    Problem is with mtd number.
    Because as per NAND partition rootfs is present at partition no.12.
    But after deetction of SPI flash by kernel rootfs mtd part becomes as 13. and SPI is mounted as mtd0.
    So in cmdline if you will pass as 13 for rootfs it will run successfully.
    Query: 
    When I am opening mtd0 and going to do any action of read/write at that time I an getting an error as:
    spi master spi1:failed to transfer one message from queue.
     
    Please check and tell why this issue is occuring?
     
    Rgs,
    Santosh