Mounting NAND flash as the root file system

Jatin Sharma sharmaj at gmail.com
Tue Apr 28 20:22:20 EDT 2009


After turning on JFFS2 debug, I found that kernel is trying to mount
/dev/root even though I gave "root=/dev/mtdblock0" in my command line.
Is the command line correct:

Command line="root=/dev/mtdblock0 rootfstype=jffs2 rw"

Here is the error:
IP-Config: Complete:
      device=WP-SED, addr=10.100.54.179, mask=255.255.255.0, gw=10.100.54.33,
     host=10.100.54.179, domain=, nis-domain=(none),
     bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
<7>jffs2_get_sb(): dev_name "/dev/root"
<7>jffs2_get_sb(): path_lookup() returned 0, inode 81731c94
<0>Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(0,255)

I have attached complete kernel log with this email. Thanks for helping.

Regards,
Jatin

2009/4/28 Ricard Wanderlof <ricard.wanderlof at axis.com>:
>
> On Tue, 28 Apr 2009, Jatin Sharma wrote:
>
>> Actually, I was mounting the block device but wrote it wrong in the email.
>>
>> WDS# mount -t jffs2 /dev/mtdblock0 /mnt
>> mount: mounting /dev/mtdblock0 on /mnt failed
>
> Ok. Well I don't really have any other ideas, it's just a typical mistake
> that people make (I do it all the time...).
>
>> Since the flash_eraseall and nandwrite tools are working on the NAND
>> device, NAND driver is working fine. Would you agree? I don't have the
>> nanddump tools on my file system but will include it to make sure NAND
>> is getting updating after being written by nandwrite.
>
> What happens if you erase the flash and the mount it directly (without
> writing an image to it). An empty flash is a valid jffs2 file system, so if
> this works, but mounting the partition with an image in it doesn't, there
> could be something wrong with your image.
>
> /Ricard
> --
> Ricard Wolf Wanderlöf                           ricardw(at)axis.com
> Axis Communications AB, Lund, Sweden            www.axis.com
> Phone +46 46 272 2016                           Fax +46 46 13 61 30
>
-------------- next part --------------


uWinMon ver 3.6 rc 5
MICRO WINMON - Normal
Jumping to 0xbfc00000
******************************* POST  ****************************************
001 - Test Boot Firmware compatibility ................................ OK
******************************* POST OK **************************************

----------------------------------------
iSPAN36WBS Boot Firmware Version 0.03.12
Copyright (c) 2009 Interphase Corp.
----------------------------------------
Commands' categories:
  I : Information
  C : Configuration
  T : Tests
  U : Utilities
To show all commands on a category, type corresponding letter

>go 0x812fd000Linux version 2.6.10_dev-malta-mips2_fp_be (jsharma at lab-171) (gcc version 3.4.3 (MontaVista 3.4.3-25.0.30.0501131 2005-07-23)) #76 Tue Apr 28 18:17:37 CDT 2009

LINUX started...
(a)read cmd line from FFFFFFFF
No cmd line provided in the flash
Command line="root=/dev/mtdblock0 rootfstype=jffs2 rw"
(b)memsize = 262144 Kbytes
36WBS MEMORY DESCRIPTOR dump:
[0,8131b860]: base<00000000> size<01346000> type<00000000>
[0,8131b86c]: base<01346000> size<0c1ba000> type<00000002>
[0,8131b878]: base<0d500000> size<02b00000> type<00000000>
(c)CPU revision is: 00019365
Compiled with MONTA_VISTA 4.0 environment
Gigabit Ethernet Port 0 : Mac Address : 0.0.77.b3.61.b8 
Gigabit Ethernet Port 1 : Mac Address : 0.0.77.b3.61.b9 
Gigabit Ethernet Port 2 : Mac Address : 0.0.77.b3.61.ba 
Gigabit Ethernet Port 3 : Mac Address : 0.0.77.b3.61.bb 
No Ethernet Port 0 is used for management
Local Ip Address = 10.100.54.179
Mask  = 255.255.255.0
Gateway  = 10.100.54.33
Determined physical RAM map:
 memory: 01346000 @ 00000000 (reserved)
 memory: 0c1ba000 @ 01346000 (usable)
 memory: 02b00000 @ 0d500000 (reserved)
<7>On node 0 totalpages: 54528
<7>  DMA zone: 54528 pages, LIFO batch:13
<7>  Normal zone: 0 pages, LIFO batch:1
<7>  HighMem zone: 0 pages, LIFO batch:1
Built 1 zonelists
Kernel command line: root=/dev/mtdblock0 rootfstype=jffs2 rw ip=10.100.54.179::10.100.54.33:255.255.255.0
init/do_mounts.c::root_dev_setup() - Entering with line = /dev/mtdblock0
Primary instruction cache 16kB, physically tagged, 4-way, linesize 32 bytes.
Primary data cache 16kB, 4-way, linesize 32 bytes.
Synthesized TLB refill handler (20 instructions).
Synthesized TLB load handler fastpath (32 instructions).
Synthesized TLB store handler fastpath (32 instructions).
Synthesized TLB modify handler fastpath (31 instructions).
<6>Disable cache parity protection for MIPS 24K CPU.
Initializing interrupt controller
PID hash table entries: 1024 (order: 10, 16384 bytes)
CPU frequency 600.06 MHz
Using 300.032 MHz high precision timer.
Console: colour dummy device 80x25
************ console setupu************ /drivers/serial/serial_core.c:uart_set_options - returning from uart_set_options() with 0
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
<6>Memory: 196300k/198376k available (2612k kernel code, 1932k reserved, 443k data, 120k init, 0k highmem)
<7>Calibrating delay loop... 398.33 BogoMIPS (lpj=199168)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Checking for 'wait' instruction...  unavailable.
spawn_desched_task(00000000)
desched cpu_callback 3/00000000
ksoftirqd started up.
desched cpu_callback 2/00000000
desched thread 0 started up.
<6>NET: Registered protocol family 16
Can't analyze prologue code at 8128b224
IPHSYS: Registering IPHSYS driver with major 242
<6>Installing knfsd (copyright (C) 1996 okir at monad.swb.de).
EFS: 1.0a - http://aeschi.ch.eu.org/efs/
<6>JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
<7>Allocated 267964 bytes for deflate workspace
<7>Allocated 46912 bytes for inflate workspace
<7>Registering JFFS2 compressor "zlib"
<7>Compressor "zlib", prio 60
<7>Registering JFFS2 compressor "rtime"
<7>Compressor "zlib", prio 60
<7>Compressor "rtime", prio 50
<6>JFFS2: default compression mode: priority
<6>Initializing Cryptographic API
<6>Serial: 8250/16550 driver $Revision: 1.4 $ 5 ports, IRQ sharing disabled
ttyS0 at MMIO 0x0 (irq = 16) is a 16550
<6>io scheduler noop registered
<6>io scheduler anticipatory registered
<6>io scheduler deadline registered
<6>io scheduler cfq registered
<6>loop: loaded (max 8 devices)
WP-SED: Initializing Ethernet card...
get_ethernet_addr: 00:00:77:b3:61:b8
WP-SED: Ethernet card initialized.
BCM> Registering BCM driver with major 244
<6>elevator: using anticipatory as default io scheduler
<5>Interphase NAND Flash chip @ bd400000 CE  <5>(using Interphase NAND command handler)
Nand Base address = bd400000
Device ready = 1
Read NAND Status Register = 0xe0
Set NAND protection and read status  = 0x60
Clear NAND protection and read status  = 0xe0
<5>NAND Clear Write protect
<6>NAND device: Manufacturer ID: 0x20, Chip ID: 0xd3 (ST Micro NAND 1GiB 3,3V 8-bit)
<6>Scanning device for bad blocks
<4>Bad eraseblock 290 at 0x02440000
<4>Bad eraseblock 1058 at 0x08440000
<4>Bad eraseblock 2328 at 0x12300000
<4>Bad eraseblock 3049 at 0x17d20000
<4>Bad eraseblock 3780 at 0x1d880000
<4>Bad eraseblock 5249 at 0x29020000
<4>Bad eraseblock 7051 at 0x37160000
<5>Using static partition definition
<5>Creating 1 MTD partitions on "NAND 1GiB 3,3V 8-bit":
<5>0x00000000-0x20000000 : "NAND Flash0"
[add_mtd_partitions]: Erase size is single
[add_mtd_partitions]: Calling add_mtd_device to register the partition
[add_mtd_device]mtd: Giving out device 0 to NAND Flash0
<5>Sizes: page=2048B OOB=64B Chip=1024MB (8b wide)
SFP> Registering SFP driver with major 243
sfp_dev.dev = 0F300000
<6>NET: Registered protocol family 2
<6>IP: routing cache hash table of 2048 buckets, 16Kbytes
<6>TCP: Hash tables configured (established 16384 bind 32768)
<6>NET: Registered protocol family 1
<6>NET: Registered protocol family 17
drivers/net/wintegra/winpath2/sed/enet.c::enet_init_mac() - port = 2, mode = 5
WP-SED: found, using IRQ 51.
IP-Config: Complete:
      device=WP-SED, addr=10.100.54.179, mask=255.255.255.0, gw=10.100.54.33,
     host=10.100.54.179, domain=, nis-domain=(none),
     bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
<7>jffs2_get_sb(): dev_name "/dev/root"
<7>jffs2_get_sb(): path_lookup() returned 0, inode 81731c94
<0>Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255)
 


More information about the linux-mtd mailing list