LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 02-21-2012, 01:04 PM   #1
will.larson
LQ Newbie
 
Registered: Feb 2012
Posts: 10

Rep: Reputation: Disabled
Unable to mount rootfs - just want a shell prompt


Hello all,

I am getting this error on boot of the kernel
Code:
VFS: Cannot open root device "mtd1" or unknown-block(2,0)

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
My current configuartion is this
U-boot 1.3.2 (open moko) - this is for the samsung s3c2410 chip
Kernel 3.2.4
rootfs types: cramfs jffs2 cpio.gz (made using buildroot)

In uboot: mtdparts shows
Code:
device nand0 <synergy-nand>, # parts = 5
 #: name                        size            offset          mask_flags
 0: u-boot              0x00040000      0x00000000      0
 1: u-boot_env          0x00004000      0x00040000      0
 2: kernel              0x00300000      0x00044000      0
 3: splash              0x000a0000      0x00344000      0
 4: rootfs              0x03c1c000      0x003e4000      0

active partition: nand0,0 - (u-boot) 0x00040000 @ 0x00000000

defaults:
mtdids  : nand0=synergy-nand
mtdparts: <NULL>
Uboot bootargs: bootargs=console=ttySAC0,115200 rootfstype=cramfs root=/dev/mtd1

In boot args I have tried: /dev/mtdblock[dev] dev=1-4
/dev/mtd[dev] 1-4

The Kernel Log is as follows:
Code:
Loading from NAND 64MiB 3,3V 8-bit, offset 0x44000
   Image Name:   Linux-3.2.4
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2611536 Bytes =  2.5 MB
   Load Address: 30108000
   Entry Point:  30108000
## Booting kernel from Legacy Image at 32000000 ...
   Image Name:   Linux-3.2.4
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2611536 Bytes =  2.5 MB
   Load Address: 30108000
   Entry Point:  30108000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 3.2.4 (root@william.tacorp) (gcc version 4.5.2 (Sourcery G++ Lite 2011.03-41) ) #2 Tue Feb 21 08:53:22
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: Synergy
Memory policy: ECC disabled, Data cache writeback
BUG: mapping for 0x19000000 at 0xe0000000 overlaps vmalloc space
CPU S3C2410A (id 0x32410002)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
S3C2410: core 202.666 MHz, memory 101.333 MHz, peripheral 50.666 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttySAC0,115200 rootfstype=cramfs root=/dev/mtd1
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 59904k/59904k available, 5632k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xc4800000 - 0xf6000000   ( 792 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0108000 - 0xc05683b8   (4481 kB)
      .init : 0xc0569000 - 0xc0590000   ( 156 kB)
      .data : 0xc0590000 - 0xc05c0f40   ( 196 kB)
       .bss : 0xc05c0f64 - 0xc05e9d50   ( 164 kB)
NR_IRQS:99
irq: clearing pending ext status 00000200
irq: clearing subpending status 00000002
Console: colour dummy device 80x30
Calibrating delay loop... 100.76 BogoMIPS (lpj=251904)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C Power Management, Copyright 2004 Simtec Electronics
S3C2410: Initialising architecture
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Advanced Linux Sound Architecture Driver Version 1.0.24.
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (extended precision)
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 117
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Console: switching to colour frame buffer device 40x30
fb0: s3c2410fb frame buffer device
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
s3c2410-uart.0: ttySAC0 at MMIO 0x50000000 (irq = 70) is a S3C2410
console [ttySAC0] enabled
s3c2410-uart.1: ttySAC1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410-uart.2: ttySAC2 at MMIO 0x50008000 (irq = 76) is a S3C2410
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
brd: module loaded
loop: module loaded
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
ide-cd driver 5.00
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
dm9000 Ethernet Driver, V1.31
eth0: dm9000a at c4860200,c4862204 IRQ 53 MAC: 80:e2:66:60:00:01 (platform data)
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver libusual
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mousedev: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq disabled
s3c-sdi s3c2410-sdi: powered down.
s3c-sdi s3c2410-sdi: mmc0 - using pio, sw SDIO IRQ
ALSA device list:
  No soundcards found.
TCP cubic registered
NET: Registered protocol family 17
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Root-NFS: no NFS server address
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "mtd1" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[<c0119b74>] (unwind_backtrace+0x0/0xf0) from [<c045af84>] (panic+0x58/0x18c)
[<c045af84>] (panic+0x58/0x18c) from [<c0569b74>] (mount_block_root+0x15c/0x20c)
[<c0569b74>] (mount_block_root+0x15c/0x20c) from [<c0569df4>] (mount_root+0xd4/0xf8)
[<c0569df4>] (mount_root+0xd4/0xf8) from [<c0569f78>] (prepare_namespace+0x160/0x1b8)
[<c0569f78>] (prepare_namespace+0x160/0x1b8) from [<c0569830>] (kernel_init+0xe0/0x114)
[<c0569830>] (kernel_init+0xe0/0x114) from [<c0115264>] (kernel_thread_exit+0x0/0x8)
The Nand driver is loading

S3C24XX NAND Driver, (c) 2004 Simtec Electronics

i have written the rootfs.jffs2 image generated by build root using the nand write.e command

I just want a command prompt I will take anything

Please help
 
Old 02-21-2012, 11:33 PM   #2
cnxsoft
Member
 
Registered: Nov 2010
Location: Thailand
Distribution: Fedora 12, Ubuntu 10.10
Posts: 167

Rep: Reputation: 29
Your kernel command line is:

Quote:
Uboot bootargs: bootargs=console=ttySAC0,115200 rootfstype=cramfs root=/dev/mtd1
But you said your rootfs is using jffs2. mtdparts shows the rootfs is in partition 4.

Try:
Quote:
bootargs=console=ttySAC0,115200 rootfstype=jffs2 root=/dev/mtdblock4
 
Old 02-22-2012, 12:05 AM   #3
will.larson
LQ Newbie
 
Registered: Feb 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
I have tried the boot command as you have specified still no dice. When using build root I can use a default device tree or udev. What is the difference?
 
Old 02-23-2012, 09:21 AM   #4
cnxsoft
Member
 
Registered: Nov 2010
Location: Thailand
Distribution: Fedora 12, Ubuntu 10.10
Posts: 167

Rep: Reputation: 29
Do you get the same error message with the boot arguments I gave you ?
Is jffs2 built as a module or built-in in the kernel ?

Device tree is a new method to detect device, and udev is the old way, but I guess it's not the issue here.
 
Old 02-23-2012, 10:19 AM   #5
will.larson
LQ Newbie
 
Registered: Feb 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Ok so I figured it out a little bit. In my config file I did not initialize my nand partitions. I have a patch file with:
Code:
+ static struct mtd_partition __initdata synergy_nand_part[] = {
+ 	[0] = {
+ 		.name	= "u-boot",
+ 		.offset	= 0x0,
+ 		.size	= 0x40000,
+ 	},
+ 	[1] = {
+ 		.name	= "u-boot_env",
+ 		.offset = 0x40000,
+ 		.size	= 0x4000,
+ 	},
+ 	[2] = {
+ 		.name	= "kernel",
+ 		.offset = 0x44000,
+ 		.size	= 0x300000,
+ 	},
+ 	[3] = {
+ 		.name	= "splash",
+ 		.offset	= 0x344000,
+ 		.size	= 0xA0000,
+ 	},
+ 	[4] = {
+ 		.name	= "jffs2",
+ 		.offset = 0x3e4000,
+ 		.size	= 0x3925000,
+ 	},
+ };
This data structure gets called by another structure called synergy devices

Code:
+ static struct platform_device *synergy_devices[] __initdata = {
+ 	&s3c_device_ohci,
+ 	&s3c_device_nand, // I was Missing this 
+ 	&s3c_device_lcd,
+ 	&s3c_device_wdt,
+ 	&s3c_device_iis,
+ 	&s3c_device_sdi,
+ //	&s3c_device_spi0,
+ //	&synergy_spi,
+ 	&synergy_dm9k,
+ 	&synergy_led0,
+ 	&synergy_led1,
+ 	&synergy_backlight,
+ 	&synergy_uda1341,
+ 	&synergy_i2c_gpio,
+ };
Which is then passed executed by the method board init
Code:
+ static void __init synergy_machine_init(void)
+ {
+ platform_add_devices(synergy_devices, ARRAY_SIZE(synergy_devices));
Now my partitions are recognized

And I can get a command prompt via a kernel with an InitRD so I am just in Ram not on the partitons


****HOWEVER******

I still cannot get a rootfs to boot from my nand flash via a jffs2 partition

It throws a bunch of errors

I have tried Jtag Flashing it and writing it via u-Boot

Still not working
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x006b8000: 0x9d48 instead
I have my erase size set to 0x4000 which is the correct value of my nand flash and I have the right page size of 512 bytes.

Going to play around with it more. Will let you know.

Last edited by will.larson; 02-23-2012 at 10:20 AM. Reason: Because
 
Old 02-24-2012, 01:42 PM   #6
will.larson
LQ Newbie
 
Registered: Feb 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
*****solved****

I am writing this for anyone else working with the s3c2410. I don't have a blog or anything (don't have time)

What I learned-

If you use u-boot with this board you must use a fork which takes into account the stepping stone code:
Openmoko has a project to use this however it is using a very very old version and assumes you have wiring for usb device mode (i.e. dfu)
However your board must be wired for usb device mode and if not it won't work. I wanted to enable usb mass storage though via uboot.

http://repo.or.cz/w/u-boot-openmoko/...ea79aa2.tar.gz

This is the uboot I used (it has fixed FAT file support unlike the old openmoko branch)

Code:
#define CONFIG_USB_OHCI		1
#define CONFIG_USB_STORAGE	1
#define CONFIG_DOS_PARTITION    1
#define LITTLEENDIAN
Then the dynpart array must match the array declared in the Linux Board C file

Example:
Uboot Dynparts-
Code:
unsigned int dynpart_size[] = {
    CFG_UBOOT_SIZE, 0x4000, 0x300000, 0xa0000, 0xffffffff, 0 }; //0xffffffff on a 64MB chip is 3c1c000 for linux mtd_partition struct
char *dynpart_names[] = {
    "u-boot", "u-boot_env", "kernel", "splash", "rootfs", NULL };
Board C File-
Code:
+ static struct mtd_partition __initdata synergy_nand_part[] = {
+ 	[0] = {
+ 		.name	= "u-boot",
+ 		.offset	= 0x0,
+ 		.size	= 0x40000,
+ 	},
+ 	[1] = {
+ 		.name	= "u-boot_env",
+ 		.offset = 0x40000,
+ 		.size	= 0x4000,
+ 	},
+ 	[2] = {
+ 		.name	= "kernel",
+ 		.offset = 0x44000,
+ 		.size	= 0x300000,
+ 	},
+ 	[3] = {
+ 		.name	= "splash",
+ 		.offset	= 0x344000,
+ 		.size	= 0xA0000,
+ 	},
+ 	[4] = {
+ 		.name	= "jffs2",
+ 		.offset = 0x3e4000,
+ 		.size	= 0x3c1c000,
+ 	},
+ };
Then I found that my problems with the rootfs stemmed from NAND ECC - If you in linux-menuconfig disable Hardware ECC on the s3c2410 nand chip. Software checking is enabled which again throws the errors. I had to disable the software checking by editing the drivers/mtd/nand/s3c2410.c driver
Code:
chip->ecc.mode	    = /*NAND_ECC_SOFT*/ NAND_ECC_NONE;
Now my root jffs2 boots with linux 3.2.4 on the s3c2410 64mb with 512B 16kib erase block.

Thanks for your replies.

Last edited by will.larson; 02-24-2012 at 02:25 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
qemu - run Linux from Scracth gives a cannot mount rootfs hda - unkown device MarcosPauloBR Linux - Virtualization and Cloud 3 10-17-2011 08:47 AM
kernal panic error in LFS: not syncing unable to mount rootfs on unknown block (2,0) barhate.rahul Linux - Kernel 5 02-05-2011 02:04 AM
passing parameters from a unix shell prompt into a windows cmd.exe prompt nano2 Programming 1 09-01-2009 11:26 AM
Weird rootfs mount error FraGGod Linux - Kernel 1 04-22-2008 09:06 AM
Kernel Panic :VFS :unable to mount rootfs 16:02 abirami Linux - Software 5 01-02-2006 11:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 05:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration