Vfs:cannot Open Root Device "Mtdblock2" or Unknown-block (0,0)

Source: Internet
Author: User
Tags andrew morton bind hash

Porting the Linux kernel to the Development Board today is really a problem, first of all, the machine code is wrong, and then the NIC driver is wrong, followed by a file system regardless of the mount, thanks to many netizens in the online generous contribution of their own transplant process experience, let me finally adhere to go on. Below I also share the following solution:

Start Linux ...

Copy Linux kernel from 0x00240000 to 0x30008000, size = 0x00200000 ... Copy Kernel to SDRAM done,now, booting Linux ...

Uncompressing Linux ....................................................................................................................... Done, booting the kernel.
Linux version 2.6.30.4-gtstudio (root@localhost.localdomain) (GCC version 4.3.3 (sourcery g++ Lite 2009q1-203)) #1 Sun Au G 4 17:27:48 CST 2013
cpu:arm920t [41129200] revision 0 (ARMV4T), cr=c0007177
CPU:VIVT data cache, VIVT instruction cache
machine:gt2440
ATAG_INITRD is deprecated; Please update your bootloader.
Memory POLICY:ECC Disabled, Data cache writeback
CPU s3c2440a (ID 0x32440001)
s3c24xx clocks, (c) 2004 Simtec Electronics
S3c244x:core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 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:NOINITRD root=/dev/mtdblock2 INIT=/LINUXRC console=ttysac0
Nr_irqs:85
Irq:clearing Pending EXT Status 00000200
irq:clearing subpending Status 00000003
irq:clearing subpending Status 00000002
PID Hash Table entries:256 (order:8, 1024x768 bytes)
Console:colour Dummy Device 80x30
console [ttySAC0] enabled
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:60956KB available (3432K code, 374K data, 104K init, 0K highmem)
slub:genslabs=11, hwalign=32, order=0-3, Minobjects=0, Cpus=1, Nodes=1
Calibrating delay loop ... 199.47 bogomips (lpj=498688)
Mount-cache Hash Table entries:512
Cpu:testing Write Buffer Coherency:ok
net_namespace:296 bytes
Net:registered Protocol Family 16
S3c2440:initialising Architecture
S3C2440:IRQ Support
S3c24xx DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA Channel 0 at c4808000, IRQ 33
DMA Channel 1 at c4808040, IRQ 34
DMA Channel 2 at c4808080, IRQ 35
DMA Channel 3 at C48080C0, IRQ 36
S3c244x:clock support, DVS off
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
S3C2440-I2C S3c2440-i2c:slave Address 0x10
S3C2440-I2C S3c2440-i2c:bus Frequency set to + KHz
S3C2440-I2C s3c2440-i2c:i2c-0: s3c i²c Adapter
cfg80211:calling Crda to update World regulatory domain
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
Net:registered Protocol Family 1
Yaffs 4 17:24:00 Installing.
Msgmni have been set to 119
Alg:no test for STDRNG (KRNG)
IO Scheduler NoOp registered (default)
LEDs initialized
Buttons initialized
ADC initialized
S3c2440-uart.0:s3c2410_serial0 at MMIO 0x50000000 (IRQ = All) is a s3c2440
S3c2440-uart.1:s3c2410_serial1 at MMIO 0x50004000 (IRQ = $) is a s3c2440
S3c2440-uart.2:s3c2410_serial2 at MMIO 0x50008000 (IRQ = ON) is a s3c2440
Loop:module Loaded
Driver ' SD ' needs updating-please use bus_type methods
Cs89x0:cs89x0_probe (0x0)
Cs89x0.c:v2.4.3-pre1 Russell Nelson <nelson@crynwr.com&gt, Andrew Morton
eth0:cs8900 Rev J found at 0xc4a00300
cs89x0:extended EEPROM checksum Bad and no Cirrus EEPROM, relying on command line
Cs89x0 Media IRQ, programmed I/O, MAC 08:89:89:89:89:89
CS89X0_PROBE1 () successful
S3c24xx NAND Driver, (c) 2004 Simtec Electronics
S3c2440-nand s3c2440-nand:tacls=3, 30ns twrph0=7 70ns, twrph1=3 30ns
NAND device:manufacturer id:0xec, Chip id:0xda (Samsung NAND 256MiB 3,3v 8-bit)
Scanning device for bad blocks
Bad Eraseblock 162 at 0x000001440000
Bad Eraseblock 219 at 0x000001b60000
Bad Eraseblock 581 at 0x0000048a0000
Bad Eraseblock 1322 at 0x00000a540000
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, io mem 0x49000000
USB usb1:new USB device found, idvendor=1d6b, idproduct=0001
USB usb1:new USB Device strings:mfr=3, product=2, serialnumber=1
USB Usb1:Product:S3C24XX OHCI
USB Usb1:Manufacturer:Linux 2.6.30.4-gtstudio OHCI_HCD
USB usb1:SerialNumber:s3c24xx
USB Usb1:configuration #1 chosen from 1 choice
Hub 1-0:1.0:USB Hub found
Hub 1-0:1.0:2 Ports detected
Initializing USB Mass Storage driver ...
Usbcore:registered New Interface Driver Usb-storage
USB Mass Storage support registered.
Usbcore:registered New Interface Driver usbserial
USBSERIAL:USB Serial Driver Core
USB Serial support registered for pl2303
Usbcore:registered New Interface Driver pl2303
Pl2303:prolific PL2303 USB to serial adaptor driver
S3c2410_udc:debugfs dir creation failed-19
S3c2440-usbgadget s3c2440-usbgadget:s3c2440:increasing FIFO to bytes
MICE:PS/2 mouse device common for all mice
GT2440 touchscreen successfully loaded
input:gt2440 touchscreen as/devices/virtual/input/input0
S3c24xx RTC, (c) 2004,2006 Simtec Electronics
S3C2410-RTC S3C2410-RTC:RTC Disabled, re-enabling
S3C2410-RTC S3C2410-RTC:RTC core:registered s3c as Rtc0
I2c/dev Entries Driver
Linux Video Capture interface:v2.00
ZC0301:V4L2 driver for Zc0301[p] Image Processor and Control Chip v1:1.10
Usbcore:registered New Interface Driver zc0301
Gspca:main v2.5.0 Registered
Usbcore:registered New Interface Driver zc3xx
Zc3xx:registered
Usbcore:registered New Interface Driver Uvcvideo
USB Video Class Driver (v0.1.0)
s3c2410 Watchdog Timer, (c) 2004 Simtec Electronics
S3C2410-WDT s3c2410-wdt:watchdog Inactive, reset disabled, IRQ enabled
S3C2440-SDI S3c2440-sdi:host detect has no IRQ available
Mapped channel 0 to 0
S3C2440-SDI s3c2440-sdi:powered down.
S3C2440-SDI s3c2440-sdi:initialisation done.
S3C2440-SDI s3c2440-sdi:running at 0kHz (requested:0khz).
S3C2440-SDI s3c2440-sdi:running at 196kHz (requested:195khz).
S3C2440-SDI s3c2440-sdi:running at 196kHz (requested:195khz).
S3C2440-SDI s3c2440-sdi:running at 196kHz (requested:195khz).
S3C2440-SDI s3c2440-sdi:powered down.
Usbcore:registered New Interface Driver Usbhid
USBHID:V2.6:USB HID Core Driver
Advanced Linux Sound Architecture Driver Version 1.0.20.
No Device for DAI uda134x
No Device for DAI s3c24xx-i2s
s3c24xx_uda134x SoC Audio Driver
uda134x SoC Audio Codec
asoc:uda134x <-> s3c24xx-i2s Mapping OK
ALSA Device List:
#0: s3c24xx_uda134x (uda134x)
TCP Cubic Registered
Rpc:registered UDP Transport module.
Rpc:registered TCP Transport module.
Lib80211:common Routines for IEEE802.11 drivers
S3C2410-RTC s3c2410-rtc:setting system clock to 2009-03-05 18:52:59 UTC (1236279179)
Root-nfs:no NFS server available, giving up.
Vfs:unable to mount Root FS via NFS, trying floppy.
Vfs:cannot Open Root Device "Mtdblock2" or Unknown-block (2,0)
Please append a correct "root=" boot option; Here is the available partitions:
1F00 262144 mtdblock0 (driver?)
Kernel Panic-not syncing:VFS:Unable to mount Root fs on Unknown-block (2,0)
BackTrace:
[<c0026fd4>] (dump_backtrace+0x0/0x10c) from [<c029bbfc>] (dump_stack+0x18/0x1c)
R7:C380A0CB r6:c03a8060 r5:c380a000 R4:c381df40
[<c029bbe4>] (dump_stack+0x0/0x1c) from [<c029bc4c>] (panic+0x4c/0x124)
[<c029bc00>] (panic+0x0/0x124) from [<c0008e30>] (mount_block_root+0x178/0x234)
r3:00000000 R2:c38553ec R1:c381df40 r0:c03298a8
[<c0008cb8>] (mount_block_root+0x0/0x234) from [<c0008f9c>] (MOUNT_ROOT+0XB0/0XF4)
[<c0008eec>] (Mount_root+0x0/0xf4) from [<c00090d8>] (prepare_namespace+0xf8/0x18c)
R7:c03a7a44 r6:c001e83c r5:c001e83c r4:c001e84c
[<c0008fe0>] (prepare_namespace+0x0/0x18c) from [<c0008478>] (KERNEL_INIT+0XC8/0XF4)
r7:00000000 R6:C001DDF4 r5:c001da9c R4:c001ddf4
[<c00083b0>] (Kernel_init+0x0/0xf4) from [<c0037f30>] (do_exit+0x0/0x620)
r7:00000000 r6:00000000 r5:00000000 r4:00000000

First, I compare this code with the normal Linux boot code and find two missing places that are already marked in the startup code:

1.yaffs may31,2006 Installing

2.

Creating 3 MTD partitions on "NAND256MB 3,3v 8-bit":

0x000000000000-0x000000080000: "Uboot"

0x000000240000-0x000000640000: "Kernel"

0x000000440000-0x000010000000: "YAFFS2" to the online search, there are probably two kinds of statements:

1, yaffs file system is not configured successfully, file system->miscellaneous files systems->yaffs2 file Systemsupport is configured in front of "M", not "*", The error is due to the wrong configuration here. The previous configuration of the kernel when the configuration as "M" and "*" is not affected, the original is wrong, some configuration must be "*", the system can start normally.

2. Configure device drivers, Memory technology device (MTD) support to "*" while at device drivers, memory technology device (MTD ) Support--->

There's an option in there: Caching block device access to MTD devices, which also needs to be configured as "*" however, neither of these scenarios solves my problem because I'm worried that my kconfig file is not written right, So in the compiled Linux kernel directory under the FS/YAFFS2 directory under the view, found that there is a YAFFS_FS.O file, which proves that my linxu kernel has added support for YAFFS2 files, but why does not show Creating 3 MTD Partitions on "nand256mb3,3v 8-bit": this sentence. is very tangled, so carefully looked at my comm-gt2440.c file, and then compared with other people's files, found less NAND flash configuration:

static struct Mtd_partition smdk_default_nand_part[] = {

#if defined (Config_64m_nand)

[0] = {

. Name = "Boot",

. Offset = 0,

. Size = sz_1m,

},

[1] = {

. Name = "Kernel",

. offset = sz_1m + sz_128k,

. Size = sz_4m,

},

[2] = {

. Name = "YAFFS2",

. offset = sz_1m + sz_128k + sz_4m,

. Size = sz_64m-sz_4m-sz_1m-sz_128k,

}

#elif defined (Config_256m_nand)

[0] = {

. Name = "Boot",

. Offset = 0,

. Size = sz_1m,

},

[1] = {

. Name = "Kernel",

. offset = sz_1m + sz_128k,

. Size = sz_4m,

},

[2] = {

. Name = "YAFFS2",

. offset = sz_1m + sz_128k + sz_4m,

. Size = sz_256m-sz_4m-sz_1m-sz_128k,

}

#endif};

However, remember that my configuration is placed in the plat-s3c24xx file directory, so to the directory under the view of the following COMMON-GTSTUDIO.C file has the following NAND flash initialization configuration:

static struct Mtd_partition gtstudio_default_nand_part[] = {
#if defined (Config_gtstudio_64mb_nand)
[0] = {
. Name = "Uboot",
. offset = 0x00000000,
. Size = 0x00040000,
},
[1] = {
. Name = "Kernel",
. offset = 0x00200000,
. Size = 0x00200000,
},
[2] = {
. Name = "YAFFS2",
. offset = 0x00200000,
. Size = 0x03bf8000,
}
#elif defined (Config_gtstudio_more_than_256mb_nand)
[0] = {
. Name = "Uboot",
. offset = 0x00000000,
. Size = 0x00080000,
},
[1] = {
. Name = "Kernel",
. offset = 0x00240000,
. Size = 0x00200000,
},
[2] = {
. Name = "YAFFS2",
. offset = 0x00440000,
. Size = 0x0fb40000,
}
#endif
};

But here the uboot,kernel,yaffs2 words let me have a familiar hurry, this is not the boot code missing 3 MTD blocks. The problem is then targeted to the Config_gtstudio_more_than_256mb_nand

Definition, obviously, my Linux kernel does not have this macro definition, so add the following definition, as follows:

->CD Linux-2.6.30.4/drivers/mtd/nand

->vi Kconfig

; Jump to line 165, edit to add the following configuration:

Choice
Prompt "Nand Flash capacity Select"
Depends on MTD
Help
Gtstudio Board Nand Flash Capacity Select

Config Gtstudio_64mb_nand
Boolean "64MB Nand for Gtstudio Board"
Depends on MTD
Help
Set 64MB Nand Parts

Config Gtstudio_more_than_256mb_nand
Boolean "256MB~1GB Nand for Gtstudio Board"
Depends on MTD
Help
Set 256MB~1GB Nand Parts

Endchoice

->CD. /.. /.. /.. /; Configure Linux kernel add 256MB NAND flash support

->make Menuconfig Arch=arm

Select NAND under Device drivers->momory technology Device (MTD) Support->nand device support->s3c2410 NAND hardware ECC Flash capacity Select, also select 256MB~1GB Nand for Gtstudio Board,ok, recompile, everything Ok.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.