微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > TE2410移植linux-2.6.14及调试过程总结(1)

TE2410移植linux-2.6.14及调试过程总结(1)

时间:11-10 来源:互联网 点击:

VFS: Cannot open root device "mtdblock3" or unknown-block(2,0)

Please append a correct "root=" boot option

<0>Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

那么就说明内核没有问题,而是commandline参数有问题,仔细看,才发现

noinitrd root=/dev/mtdblock3 init=/linuxrcconsole= ttySAC0,115200 mem=

64M

console=之后多了一个空格,但是不确定是否是这个原因,重新设置bootargs参数,去掉空格

setenv bootargs noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttyS

AC0,115200 mem=64M

重新下载,启动成功.

在网上查到有说u-boot和内核频率不一致可能导致串口没有打印信息,最好将u-boot的频率设为200M,不过我试过了,202.800 MHz也没有问题

Uncompressing Linux............................................................ done, booting the kernel.

Linux version 2.6.14 (root@localhost.localdomain) (gcc version 3.4.1) #3 Mon Jul 14 04:59:17 EDT 2008

CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)

Machine: SMDK2410

Memory policy: ECC disabled, Data cache writeback

CPU S3C2410A (id 0x32410002)

S3C2410: core202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHz

Starting kernel ...

Uncompressing Linux................................................................... done, booting the kernel.

Linux version 2.6.14 (root@localhost.localdomain) (gcc version 3.4.1) #20 Sat Jul 5 10:01:30 EDT 2008

CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)

Machine: SMDK2410

Memory policy: ECC disabled, Data cache writeback

CPU S3C2410A (id 0x32410002)

S3C2410: core200.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz

1.S3C24XX NAND Driver, (c) 2004 Simtec Electronics

s3c2410-nand: mapped registers at c4980000

s3c2410-nand: timing: Tacls 10ns, Twrph0 10ns, Twrph1 10ns

No NAND device found!!!

usbmon: debugfs is not available

mice: PS/2 mouse device common for all mice

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 4096 (order: 2, 16384 bytes)

TCP bind hash table entries: 4096 (order: 2, 16384 bytes)

TCP: Hash tables configured (established 4096 bind 4096)

TCP reno registered

TCP bic registered

NET: Registered protocol family 1

Root-NFS: No NFS server available, giving up.

VFS: Unable to mount root fs via NFS, trying floppy.

VFS:Cannot open root device "mtdblock3" or unknown-block(2,0)

Please append a correct "root=" boot option

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

原因可能是一下几点:

(1)commandline中的root=/dev/mtdblock3表示rootfs在Flash的第4分区,检查确认rootfs是否是Flash的第4分区(第一个分区号为0)

(2)Flash的rootfs分区中没有下载好的根文件系统,确认是否下载好根文件系统

(3)Flash的驱动有问题,无法对Flash进行读写

我的NAND Flash分区如下:

mtdpart info. (5 partitions)

nameoffsetsizeflag

------------------------------------------------

vivi: 0x000000000x000200000128k

param: 0x000200000x00010000064k

kernel: 0x000300000x001c000001M+768k

rootfs: 0x002000000x02000000032M

user: 0x022000000x01e00000030M

所以commandline中的mtdblock3没有错误

我已下载好根文件系统至rootfs分区,再看看串口的打印信息,注意红色的部分

No NAND device found!!!

有点奇怪,其实我不太相信linux的源代码会有问题,就在根文件系统的加载这一步拖了好多天,一开始由于自己的疏忽,make menuconfig时把有些选项选成模块了,也没有搞清楚<*>和的差别,串口打印信息也是到这一步,但是没有No NAND device found!!!提示,因为NAND Flash的驱动没有编译进内核.后来才发现make menuconfig配置时出了问题,修改后,发现是NAND Flash驱动有问题,进入内核跟踪发现

linux-2.6.14\drivers\mtd\nand\s3c2410.c中s3c2410_nand_init函数对NAND Flash初始化

static int __init s3c2410_nand_init(void)

{

printk("S3C24XX NAND Driver, (c) 2004 Simtec Electronics\n");

driver_register(&s3c2440_nand_driver);

returndriver_register(&s3c241

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top