Linux-2.6.30.4在2440上的移植之内核

本人实践:

· 主  机:VMWare—ubuntu10.04

· 开发板:Mini2440--128MBNand

· 编译器:arm-linux-gcc-4.3.2

Copy linux kernel from 0x00060000 to 0x30008000, size = 0x00500000 ...done

zImage magic = 0x016f2818

Setup linux parameters at 0x30000100

linux command line is: "noinitrd root=/dev/mtdblock3 init=/linuxrcconsole=ttySA

C0"

MACH_TYPE = 1999

NOW, Booting Linux......

Uncompressing Linux.............................................................

................................................................. done,booting

the kernel.

 

Error: unrecognized/unsupported machine ID (r1 =0x000007cf).

 

Available machine support:

 

ID (hex)        NAME

000000c1       SMDK2410

000005d2        JIVE

0000030e        SMDK2440

 

Please check your kernel config and/or bootloader.

(可以改进:)

ID (hex)        NAME.....erine d

USB hos

000000c1        SMDK2410 download.2010 12:48:0

[

000005d2        JIVE+0000]

 

Now, Downlo

 

Please check your kernel configand/or bootloader. suppo  

alg: No te

Linux version 2.

RECEIVED FIL

 

 

##### FriendlyARM BIOS 2.0 for2440 #####y G++ Ldefault)          

Downloaded fil

[x] format NAND FLASH forLinuxbytesto activate this console.)

[v] Download vivi2:06 CS

Found blo

[k] Download linux kernel /]#3c2410fb fram

CPU:

E

[y] Download root_yaffs imageor2440 #####

Writing...    .

[a] Absolute UserApplicationWritten 1930860 bytes Linuxda

[n] Download Nboot for WinCEARMBIOS 2.0 for 2440 #####

 

[l] Download WinCE boot-logornelndlyARM

[x] format NAND

[w] Download WinCENK.binimagert.0: s3c2410_s

[v]

[d] Download & Runute User Ap

[k] Do

[z] Download zImage into RAM 

[n] Download

[y] Download

[g] Boot linux from RAM

s3

Mem

[l] Download W

 

[f] Format the nand flashionkisteredfor

[w] Downl

[b] Boot the s           

Uncompressing Li

[s] Setparameter.................

[v] View the parametertable............................

[w] Write the parameter table toflash memeoryR_IRQ

........................................

[q] Quit........

Enter your selection:w.......................

Found block size =0x00020000..................00400000

he

Erasing...    ... doneor: unrecognized/unsup

Writing...    ... done 0x000007cf)..........

Written 49152bytes...................

Saved vivi private data machinesupport:MIPS (

 

##### Parameter Menu #####x)        NAMEcated to 0x1

[r] Reset parameter table todefault table..............

000005d2        JIVE...r

CP

[s] Set parameterase check yourke

[v] View the parametertable.:90:90:90st

              

[a] Absolute User Application

-------------------------------------------------------------....................bcor

[l] Download WinCE boot-logoel 3at

mach_type               :       000005d2                 1490.........

[d] Download & Run..................

[z] Download z

media_type              :       00000003                    3 RAMitializedus

...........

[f] Format the nand flash........

boot_mem_base           :       30000000            805306368et the bootparametersistered new interface drive

[u] Backup

baudrate                :       0001c200              115200...........er usb fo

ohci

[r] Restore NAND Flash from HOSTth

xmodem                  :       00000001           

[q] Goto shell of                

 

##### FriendlyARM BIOS 2.0 for2440 #####................

[n] Download Nboot for W

[x] format NAND FLASH for Linux

[l] Download WinCE boot-logor

[v] Download vivi........

[w] Down

[k] Download linuxkernel................

[l] Download WinCE boot-logo

[w] Download WinCE NK.bin

[d] Download & Run

[z] Download zImage into RAM

[g] Boot linux from RAM

[f] Format the nand flash

[b] Boot the system

[s] Set the boot parameters

[u] Backup NAND Flash to HOSTthrough USB(upload)

[r] Restore NAND Flash from HOSTthrough USB

[q] Goto shell of vivi

[i] Version: 0945-2K

Enter your selection: b

Copy linux kernel from 0x00060000to 0x30008000, size = 0x00500000 ... done

zImage magic = 0x016f2818

Setup linux parameters at0x30000100

linux command line is:"noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySA

C0"

MACH_TYPE = 1490

NOW, Booting Linux......

UncompressingLinux.............................................................

................................................................done, booting t

he kernel.


在QQ2440开机时出现unrecognized/unsupported machine ID

 

来源: ChinaUnix博客  日期: 2008.03.25 17:06 (共有0条评论) 我要评论

 

移植新内核到QQ2440友善之臂的开发板上,开机出现了:
Uncompressing Linux...................................................................... done, booting the kernel.
Error: unrecognized/unsupported machine ID (r1 = 0x0000030e).
Available machine support:
ID (hex) NAME
000000c1 SMDK2410
0000016a SMDK2440
Please check your kernel config and/or bootloader.

看到网上许多网友说修改内核或者vivi,我后来试了一下,可以通过修改vivi的mach_type解决,具体办法如下:
Supervivi> menu
##### FriendlyARM BIOS for 2440 #####
[v] Download vivi 
[k] Download linux kernel 
[y] Download root_yaffs image 
[c] Download root_cramfs image 
[n] Download Nboot 
[e] Download Eboot 
Download WinCE NK.nb0 
[w] Download WinCE NK.bin 
[d] Download & Run 
[f] Format the nand flash 
[p] Partition for Linux 
Boot the system
 
[s] Set the boot parameters 
[t] Print the TOC struct of wince 
[q] Goto shell of vivi 
Enter your selection: s
##### Parameter Menu #####
[r] Reset parameter table to default table 
[s] Set parameter 
[v] View the parameter table  
[w] Write the parameter table to flash memeory 
[q] Quit 
Enter your selection: s
Enter the parameter's name(mach_type, media_type, linux_cmd_line, etc): mach_type
Enter the parameter's value(if the value contains space, enclose it with "): 362
Change 'mach_type' value. 0x0000030e(782) to 0x0000016a(362)
因为看了一下刚才启动报的:0000016a SMDK2440,0x16a=362故才设置了mach_type=362,然后下边保存
##### Parameter Menu #####
[r] Reset parameter table to default table 
[s] Set parameter 
[v] View the parameter table  
[w] Write the parameter table to flash memeory 
[q] Quit 
Enter your selection: w
Found block size = 0x0000c000
Erasing...    ... done
Writing...    ... done
Written 49152 bytes
Saved vivi private data
##### Parameter Menu #####
[r] Reset parameter table to default table 
[s] Set parameter 
[v] View the parameter table  
[w] Write the parameter table to flash memeory 
[q] Quit 
Enter your selection: v
Number of parameters: 9
name                    :    hex     integer
-------------------------------------------------------------
mach_type               : 0000016a           362
media_type              : 00000003             3
boot_mem_base           : 30000000     805306368
baudrate                : 0001c200        115200
xmodem                  : 00000001             1
xmodem_one_nak          : 00000000             0
xmodem_initial_timeout  : 000493e0        300000
xmodem_timeout          : 000f4240       1000000
boot_delay              : 01000000      16777216
Linux command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200
##### Parameter Menu #####
[r] Reset parameter table to default table 
[s] Set parameter 
[v] View the parameter table  
[w] Write the parameter table to flash memeory 
[q] Quit 
Enter your selection: q
##### FriendlyARM BIOS for 2440 #####
[v] Download vivi 
[k] Download linux kernel 
[y] Download root_yaffs image 
[c] Download root_cramfs image 
[n] Download Nboot 
[e] Download Eboot 
Download WinCE NK.nb0 
[w] Download WinCE NK.bin 
[d] Download & Run 
[f] Format the nand flash 
[p] Partition for Linux 
Boot the system 
[s] Set the boot parameters 
[t] Print the TOC struct of wince 
[q] Goto shell of vivi 
Enter your selection: b
Copy linux kernel from 0x00050000 to 0x30008000, size = 0x00200000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200"
MACH_TYPE = 362
NOW, Booting Linux......
Uncompressing Linux...................................................................... done, booting the kernel.
Linux version 2.6.22.2 (
root@localhost6.localdomain6
) (gcc version 4.1.1) #9 Sat Mar 22 06:51:38 CST 2008
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SMDK2440
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists.  Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200
irq: clearing pending ext status 00000200
irq: clearing subpending status 00000007
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00000000, tcnt a4ca, tcfg 00000200,00000000, usec 00001e57
Console: colour dummy device 80x30
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: 62592KB available (1952K code, 241K data, 100K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C2440: Clock Support, DVS off
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c48000c0, irq 36
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
fuse init (API version 7.8)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 80x40
fb0: s3c2410fb frame buffer device
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: module loaded
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=1, 9ns Twrph0=4 39ns, Twrph1=1 9ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00030000 : "bootloader"
0x00050000-0x00250000 : "kernel"
0x00250000-0x03ffc000 : "root"
下边省略,内核启动成功,看到了小企鹅


错误分析:

原来是machine的ID和Supervivi传递进来的ID不匹配~
关于machine ID,可以参考一下这篇文章
<2.6.18-2内核中对S3C2440的引导启动分析>
虽然版本老了点,但是核心思想还是没有变

vimarch/arm/mach-s3c2440/mach-smdk2440.c
在最后一段有这句 MACHINE_START(S3C2440 , ”SMDK2440”)
这里S3C2440就是machine ID的代号~ 呢具体值是多少呢?~ 
在arch/arm/tools/mach-types中
s3c2440 ARCH_S3C2440 S3C2440 362
原来我们的machine ID是362~
呢bootloader传递进来的值是多少呢?~
Error:unrecognized/unsupported machine ID (r1 = 0x000007cf).
注意到没有?~ 0x7CF转换成10进制也就是1999
修改mach-types中的对应项
s3c2440 ARCH_S3C2440 S3C2440 1999
虽然这样就和下面MINI2440的1999冲突了,但是只要不加入MINI2440的配置就没事

修改后编译,再执行zImage后得下列输出

(结果转至http://blogold.chinaunix.net/u1/57901/showart_2019107.html移植2.6.30.4到MINI2440的学习笔记

zImagemagic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrcconsole=ttySAC0"
MACH_TYPE = 1999
NOW, Booting Linux......
Uncompressing Linux........................................................................................................done, booting the kernel.


后附:全贴---

移植2.6.30.4到MINI2440的学习笔记

 

 

近来找工作连连碰壁~ 感觉自己的实力还不足,所以打算移植2.6.30.4到MINI2440上锻炼一下自己

这篇学习笔记以失败为基础向前推进~ 重点在于如何发现问题和解决问题的方法,因为我硬件基础还不足,所以像DM9000这样的硬件初始化我会以”暴力”方法来解决~ 哈哈~

下面开始和大家分享我的失败过程~:

解压缩内核压缩文件后进入到目录中,然后修改Makefile,找到
ARCH ?=
CROSS_COMPILE ?=
这两项,不修改这两项的话将会默认使用x86的配置,这里修改为
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-
arm-linux- 是交叉编译器~ 这里我使用的交叉编译器为友善送的arm-linux-gcc-4.3.2.tgz,带EABI

然后执行make menuconfig,然后进入System Type中看看是否为ARM体系~
第一行为ARM system type 说明没错~  然后在ARM system type中选择SamSung “S3C2410...”
随后在下面出现的S3C2440 Machines中选择SMDK2440

退出保存~ 执行make zImage
出现ERROR 
drivers/video/console/vgacon.c:510:error “PCIMEM_BASE undeclared”
是在vgacon_startup中,vgacon是啥?~ 不认识~ 应该是不必要的东西~ 去掉它~
vim drivers/video/console/Makefile
在里面看见了这句
obj-$(CONFIG_VGA_CONSOLE) += vgacon.o
然后执行 find ./ -name “Kconfig” | xargs grep “VGA_CONSOLE”
看见config VGA_CONSOLE 在driver/video/console/Kconfig中
也就是说在驱动->视频->终端中,执行make menuconfig
在Device Drivers->Graphics Support->Console display driver support中发现了VGA text console
去掉它,保存设置后再编译

编译完成后将在arch/arm/boot中得到zImage文件

使用SuperVivi的USB加载功能启动这个内核文件~ 得到下列输出

zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 1999
NOW, Booting Linux......
Uncompressing Linux........................................................................................................ done, booting the kernel.

失败
信息不够丰富~ 根据kasim大大的指点,在配置中进入Kernel hacking
打开Kernel debugging和Kernel low-level debugging functions 还有 Kernel low-level debugging messages via S3C UART
保存后再编译

运行zImage后得下列输出
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 1999
NOW, Booting Linux......
Uncompressing Linux........................................................................................................ done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x000007cf).

Available machine support:

ID (hex)        NAME
0000016a        SMDK2440

Please check your kernel config and/or bootloader.

失败
原来是machine的ID和Supervivi传递进来的ID不匹配~
关于machine ID,可以参考一下这篇文章
<2.6.18-2内核中对S3C2440的引导启动分析>
虽然版本老了点,但是核心思想还是没有变

vim arch/arm/mach-s3c2440/mach-smdk2440.c
在最后一段有这句 MACHINE_START(S3C2440 , ”SMDK2440”)
这里S3C2440就是machine ID的代号~ 呢具体值是多少呢?~ 
在arch/arm/tools/mach-types中
s3c2440 ARCH_S3C2440 S3C2440 362
原来我们的machine ID是362~
呢bootloader传递进来的值是多少呢?~
Error: unrecognized/unsupported machine ID (r1 = 0x000007cf).
注意到没有?~ 0x7CF转换成10进制也就是1999
修改mach-types中的对应项
s3c2440 ARCH_S3C2440 S3C2440 1999
虽然这样就和下面MINI2440的1999冲突了,但是只要不加入MINI2440的配置就没事

修改后编译,再执行zImage后得下列输出

zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 1999
NOW, Booting Linux......
Uncompressing Linux........................................................................................................ done, booting the kernel.

失败
咦?~ 啥都没有?~ 最起码也应该有个乱码吧  这时候我的第一反应是会不会没有跳入到start_kernel中
所以马上编辑init/main.c,在start_kernel的前部加上printk(KERN_INFO “in start_kernel \n”);
但是这个时候内核还没有初始化,所以printk是没有作用的~
继续得到kasim大大的指点,编辑kernel/printk.c中的printk函数
{
    va_list args;
    int r;

#ifdef CONFIG_DEBUG_LL
    extern void printascii(const char *);
    char buff[256];
#endif
    va_start(args, fmt);
    r = vprintk(fmt, args);
#ifdef CONFIG_DEBUG_LL
    vsprintf(buff, fmt, args);
#endif
    va_end(args);

#ifdef CONFIG_DEBUG_LL
    printascii(buff);
#endif
return r;
}

编译后执行zImage,得下列输出

zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 1999
NOW, Booting Linux......
Uncompressing Linux........................................................................................................ done, booting the kernel.
<6>in start_kernel
<6>Initializing cgroup subsys cpuset
<6>Initializing cgroup subsys cpu
<5>Linux version 2.6.30.3 (wolf@ubuntu) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #4 Wed Aug 5 16:54:49 CST 2009
.........................
.........................

失败
虽然正常输出了~ 有进入start_kernel~ 但是为什么之前每输出呢?~ 会不会是没有找到输出设备
在输出中看到这行
<5>Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
console=ttySAC0 会不会是没有ttySAC0这个设备呢~ 在内核中搜索ttySAC 在driver/serial/samsung.c中得到对应项目
这时候我猜想会不会没有加载samsung.c , 经过一轮Makefile和Kconfig的查询 , 发现对应选项在Device Drivers->Character devices->Serial drivers中
一看,原来根本就没有加载Samsung SoC serial support , 选成静态编译之后又出现了Support for console on Samsung SoC serial port ,就是它了,选上, 退出的时候顺便把Kernel low-level debugging functions给取消了
否则我们设置的printk会自行输出,就不知道ttySAC有没有加载成功了

编译后执行,得下列输出
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 1999
NOW, Booting Linux......
Uncompressing Linux......................................................................................................... done, booting the kernel.
w# €DpñGpGp´ó70ÇC¼ØûÛ»›3ó•ó¸Û0ƒw# €DpñGpGp´ó•tØ›•p¸›7¿³ó•\@û7¼¿[£¼Û3•¼ó;£¸ÀÛ;[7û;D°•€D@GoGpGpíó•t›7•{ð#ßóÄ;›•770ÄÄ3Çß;GoDh}û7wœ´{„[ó7ûÛ›30°ôܸ‡#_sÄ;›•770Øijœ¼DG@ÁôÛ•ûÄ;•sÄ›£Ø›•DŽ³ÃÛ70ÄGpÁ4ßœ»ôGã›30³D˜ßF[s˜£ÀÛû70ÛD8ßÄ4G8ôGv£°ÇÃGpÍ´0ƒ÷# €DpñGš´;óC„[4¸F¸ÄÛtÜàGp}4GGÇ4tD@Ä38ÀGpG߀ôØ Û›Ÿ€ÄÛD\Cûƒ£¸ƒ;7v›Ã30Ü›4Û´£ô¼;C3[;7ù³û770‡¸°[•4tD@Ä38ÀGpG߀´´p‡ƒ•ô¼Û7Ÿ€tÛG»4œØ„Çpíƒw# 
.......................................

失败
但这说明ttySAC加载成功了~  不过为什么是乱码呢?~
这时候就需要对比友善的配置和我们的配置有什么不同了~
打开友善送的linux-2.6.29,观察arch/arm/mach-s3c2440/mach-mini2440.c和我们的2.6.30.4下面的arch/arm/mach-s3c2440/mach-smdk2440.c有什么不同
由于乱码主要是时钟问题,所以我们重点观察UART的设置和基本设置,其它什么NAND LCD的就不看先

修改smdk2440_uartcfgs[]
[2] = {
 .ulcon = 0x03,
}

修改s3c24xx_init_clocks(12000000);

然后编译再运行,输出为
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 1999
NOW, Booting Linux......
Uncompressing Linux......................................................................................................... done, booting the kernel.
[    0.000000] in start_kernel
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
...........................
最后为
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

失败
终于可以正常输出了,但是根文件系统挂载失败
因为板子上的根文件系统为yaffs2 这时候内核还没有这个文件系统的支持,需要我们加上去
拷贝友善的送的2.6.29下的fs/yaffs2目录 到我们的fs目录下
然后修改观察一下友善的送的2.6.29下的fs/Kconfig 和 fs/Makefile和我们的有什么不同
在我们的Kconfig中的 source “fs/jffs2/Kconfig” 上面加上 source “fs/yaffs2/Kconfig”
在Makefile中的 obj-$(CONFIG_FAT_FS) += fat/ 上面加上 obj-$(CONFIG_YAFFS_FS) += yaffs2/

然后在配置的 File systems->Miscellaneous filesystems 中选上 “YAFFS2 file system support”  “Autoselect yaffs2 format”  “Cache short names in RAM”

然后编译运行,输出如下
......................
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

失败
还是不行,往上看几行
VFS: Cannot open root device "mtdblock2" or unknown-block(0,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(0,0)
原来是没有可用的分区
这个时候就要更正我们的NAND配置了
还是对照友善送的linux-2.6.29,观察arch/arm/plat-s3c24xx/common-friendly-smdk.c来修改我们的arch/arm/plat-s3c24xx/common-smdk.c

主要修改smdk_default_nand_part[] 
{
 [0] = {
  .name = “supervivi”,
  .size = 0x00060000,
  .offset = 0,
},
[1] = {
 .name = “Kernel”,
 .offset = 0x00060000,
 .size = 0x00200000,
},
[2] = {
 .name = “root”,
 .offset = 0x00260000,
 .size = 1024*1024*1024,
},
[3] = {
 .name = “nand”,
 .offset = 0x00000000,
 .size = 1024*1024*1024,
}
};

编译后运行,输出
VFS: Cannot open root device "mtdblock2" or unknown-block(0,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(0,0)

失败
还是不行,连最起码的分区都没有看见,会不会是MTD没有加载呢?~
打开配置进入Device Drivers
Memory Technology Device ......... 前面是个M~ 说明这个模块是动态加载的,而我们编译的zImage里面只有静态模块
将MTD选为静态加载,然后进入MTD配置中看看还有什么需要选的
NAND Device Support 这个也是动态,选为静态加载
进入NAND Device Support
原来连NAND Flash support for S3C2410/S3C2440 SoC都没选,马上选为静态加载

保存配置后编译运行,再运行输出如下:
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 4 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x000000000000-0x000000060000 : "supervivi"
0x000000060000-0x000000260000 : "Kernel"
0x000000260000-0x000040260000 : "root"
mtd: partition "root" extends beyond the end of device "NAND 128MiB 3,3V 8-bit" -- size truncated to 0x7da0000
0x000000000000-0x000040000000 : "nand"
mtd: partition "nand" extends beyond the end of device "NAND 128MiB 3,3V 8-bit" -- size truncated to 0x8000000
...............................
VFS: Cannot open root device "mtdblock2" or unknown-block(0,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(0,0)

失败
还是没有可用分区,虽然成功分辨了分区,但是没有加载成功,估计还是在MTD的模块选择上
这时候需要对照友善的配置,经过对比,发现在友善的配置中静态编译了MTD中的下面3个模块
Direct char device access to MTD devices
Common interface to block layer for MTD ‘translation layers’
Caching block device access to MTD devices
我们也选为静态编译
保存配置后编译运行,输出如下

List of all partitions:
1f00             384 mtdblock0 (driver?)
1f01            2048 mtdblock1 (driver?)
1f02          128640 mtdblock2 (driver?)
1f03          131072 mtdblock3 (driver?)
No filesystem could mount root, tried:  cramfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)

分区加载成功了,但是文件系统却不能识别,我们之前不是已经加入了yaffs2么?~
回到配置中再看,原来是动态编译,并没有真正进入到内核之中,选为静态编译~

保存配置后编译,输出为

yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: auto selecting yaffs2
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) on device 31:2.
Freeing init memory: 128K
Kernel panic - not syncing: Attempted to kill init!

失败
依然错误,这个时候懵了,哪里错呢~ 没办法,只能对照着友善的配置一个个大模块对着来改
当改到Kernel Features的时候错误消失了,原来需要选上
Use the ARM EABI to compile the kernel
Allow old ABI binaries to run with thie Kernel
为什么呢?~ Google了一下,原来友善的根文件系统在编译的时候也启用了EABI特性,内核和文件系统需要对上
文件系统用了EABI 内核也要用EABI 内核不用EABI 也只能读取不用EABI的文件系统
选上这两项之后再编译,运行,输出如下
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: auto selecting yaffs2
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) on device 31:2.
Freeing init memory: 128K
mount: mounting none on /proc/bus/usb failed: No such file or directory
hwclock: can't open '/dev/misc/rtc': No such file or directory
[01/Jan/1970:00:00:13 +0000] boa: server version Boa/0.94.13
[01/Jan/1970:00:00:13 +0000] boa: server built Mar 26 2009 at 15:28:42.
[01/Jan/1970:00:00:13 +0000] boa: starting server pid=845, port 80

open device leds: No such file or directory
Try to bring eth0 interface up......ifconfig: SIOCGIFFLAGS: No such device
ifconfig: SIOCSIFHWADDR: No such device
ifconfig: SIOCSIFADDR: No such device
route: SIOCADDRT: No such process
Done
ifconfig: SIOCSIFADDR: No such device

Please press Enter to activate this console.
[root@FriendlyARM /]#
成功了,ls后输出如下
bin         home        lost+found  proc        sys         var
dev         lib         mini2440    root        tmp         www
etc         linuxrc     opt         sbin        usr

不过ifconfig命令没有成功,继续来配置网卡
对比友善的mach-mini2440.c文件,发现我们的mach-smdk2440.c中的smdk2440_devices[]数组并没有&s3c_device_dm9k这个结构,加上,追踪发现该数据结构在arch/arm/plat-s3c24xx/devs.c中,我们的devs.c中没有该数据结构的定义,加上
#include <linux/dm9000.h>

static struct resource s3c_dm9k_resource[] = {
 [0] = {
 .start = S3C2410_CS4,
 .end = S3C2410_CS4 + 3,
 .flags = IORESOURCE_MEM,
},
 [1] = {
 .start = S3C2410_CS4 + 4,
 .end = S3C2410_CS4 + 4 + 3,
 .flags = IORESOURCE_MEM,
},
 [2] = {
 .start = IRQ_EINT7,
 .end = IRQ_EINT7,
 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
},
};

static struct dm9000_plat_data s3c_dm9k_platdata = {
 .flags = DM9000_PLATF_16BITONLY,
};

struct platform_device s3c_device_dm9k = {
 .name = “dm9000”,
 .id = 0;
 .num_resources = ARRAY_SIZE(s3c_dm9k_resource),
 .resource = s3c_dm9k_resource,
 .dev = {
 .platform_data = &s3c_dm9k_platdata,
}
};
EXPORT_SYMBOL(s3c_device_dm9k);

编译,出错,
error : s3c_device_dm9k undeclared here
找不到结构?~ 打开mach-smdk2440.c看看有什么头文件
比较显眼的就是<plat/s3c2410.h><plat/s3c2440.h><plat/devs.h>,我们刚才编辑的文件是devs.c呢么devs.h的可能性较高,通过搜索,这个devs.h在/arch/arm/plat-s3c/include/plat/中,打开,BINGO,里面都是devs.c的数据定义
加上我们的s3c_device_dm9k
extern struct platform_device s3c_device_dm9k;

再编译,通过了,不过这个时候先别急,我们只添加了设备,驱动有没有静态加载呢?~ 打开配置
Device Drivers->Networks device support->Ethernet(10 or 100Mbit)
DM9000 support没选上,马上选为静态编译
保存配置,编译后运行,输出如下
Try to bring eth0 interface up......
说明DM9000配置成功
使用ping命令进行测试,发现丢包率高达78%
是不是驱动没设置好呢?~ 比较了一下友善的driver/net/dm9000.c和2.6.30.4的dm9000.c,发现明显不同
直接拷贝友善的dm9000.c和dm9000.h过来
编译后运行,顺利进入终端,然后运行PING
丢包改善,基本无丢包

我对这次内核移植的总结是:
一步步来~ 先做好终端输出 再挂载好根文件系统 最后才考虑其它驱动的配置

到此移植就基本结束了 = 3=)/ 感谢阅读


网友评论 

 

网友: 本站网友

时间:2009-08-22 22:09:03 IP地址:222.65.104.★

 

 

 

博主 linux2.6.30的内核在mini2440上uda1341能正常驱动么,移植了一下发现不是没声音就是全是噪音

Blog作者的回复:
UDA1341部分还没计划做~

不过想快点实现的话我猜把MINI2440下面 linux-2.6.29\sound\soc\s3c24xx\s3c24xx_uda134x.c和相关文件复制过去并添加相应选项就OK了~

 

 

 

 

网友: 本站网友

时间:2009-09-09 13:29:36 IP地址:218.242.190.★

 

 

 

帅哥,我按照你上面的做法,还是系统还是启不来,这么回事?出现以下错误

yaffs Aug 18 2009 06:04:14 Installing.

msgmni has been set to 109

BUG: MAX_STACK_TRACE_ENTRIES too low!

turning off the locking correctness validator.

[<c002d600>] (unwind_backtrace+0x0/0xdc) from [<c005a540>] (save_trace+0x88/0xa4

)

[<c005a540>] (save_trace+0x88/0xa4) from [<c005a5c8>] (add_lock_to_list+0x6c/0xb

8)

[<c005a5c8>] (add_lock_to_list+0x6c/0xb8) from [<c005d7c8>] (__lock_acquire+0x12

a8/0x1630)

[<c005d7c8>] (__lock_acquire+0x12a8/0x1630) from [<c005dc28>] (lock_acquire+0xd8

/0xf0)

Blog作者的回复:
BUG: MAX_STACK_TRACE_ENTRIES too low!

加大它~ = 3= 加哪就要自己试试了~

 

 

 

 

网友: 本站网友

时间:2009-09-10 15:15:35 IP地址:123.112.64.★

 

 

 

你很厉害。。。自己能够解决这么多问题。。佩服。

Blog作者的回复:
没啦~ 看了很多人的BLOG~ 觉得自己还什么都不会~ 还要继续努力学习啊~ T 3T

 

 

 

 

网友:jackz705477241

时间:2009-10-11 10:21:14 IP地址:120.196.50.★

 

 

 

太强大了,学习,呵

 

 

 

 

网友:wo379776966

时间:2010-03-27 11:24:02 IP地址:125.39.143.★

 

 

 

qq号有吗

Blog作者的回复:
QQ少上~ 邮件联系吧~

lyzsuper@163.com

 

 

 

移植文件系统后出现错误分析改正如下:

Enter your selection: b

Copy linux kernel from 0x00060000 to 0x30008000, size = 0x00500000 ...done

zImage magic = 0x016f2818

Setup linux parameters at 0x30000100

linux command line is: "noinitrd root=/dev/mtdblock3 init=/linuxrcconsole=ttySAC0"

MACH_TYPE = 1490

NOW, Booting Linux......

UncompressingLinux.......................................................................................................................done, booting the kernel.

Linux version 2.6.30.4(root@localhost.localdomain) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) )#6 Fri Mar 25 23:56:49 CST 2011

CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177

CPU: VIVT data cache, VIVT instruction cache

Machine: JIVE

ATAG_INITRD is deprecated; please update your bootloader.

Memory policy: ECC disabled, Data cache writeback

CPU S3C2440A (id 0x32440001)

S3C24XX Clocks, (c) 2004Simtec Electronics

S3C244X: core 405.000 MHz,memory 101.250 MHz, peripheral 50.625 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/mtdblock3 init=/linuxrcconsole=ttySAC0

NR_IRQS:85

irq: clearing subpending status 00000003

irq: clearing subpending status 00000002

PID hash table entries: 256 (order: 8, 1024 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: 60980KB available (3432K code, 316K data, 132K init, 0K highmem)

Calibrating delay loop... 201.93 BogoMIPS (lpj=504832)

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

net_namespace: 936 bytes

NET: Registered protocol family 16

S3C Power Management,Copyright 2004 Simtec Electronics

S3C2440: Initialisingarchitecture

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 0x00

s3c2440-i2c s3c2440-i2c: bus frequency set to 49 KHz

s3c2440-i2c s3c2440-i2c: i2c-0:S3C I2C adapter

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 renoregistered

NET: Registered protocol family 1

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.

yaffs Mar 25 2011 22:54:44 Installing.

msgmni has been set to 119

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler deadline registered

io scheduler cfq registered

Console: switching to colour frame buffer device 30x40

fb0: s3c2410fbframe buffer device

lp: driver loaded but no devices found

ppdev: user-space parallel port driver

Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled

s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq =70) is a S3C2440

s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq =73) is a S3C2440

s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq =76) is a S3C2440

brd: module loaded

loop: module loaded

Uniform Multi-Platform E-IDE driver

ide-gd driver 1.18

ide-cd driver 5.00

Driver 'sd' needs updating - please use bus_type methods

dm9000 Ethernet Driver, V1.31

S3C24XX NAND Driver, (c)2004 Simtec Electronics

s3c2440-nand s3c2440-nand: Tacls=4, 39ns Twrph0=6 59ns,Twrph1=5 49ns

NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB3,3V 8-bit)

Scanning device for bad blocks

Bad eraseblock 609 at 0x000004c20000

Bad eraseblock 868 at 0x000006c80000

Bad eraseblock 1543 at 0x00000c0e0000

Creating 8 MTD partitions on "NAND 256MiB 3,3V 8-bit":

0x000000000000-0x000000028000 : "uboot"

0x00000002c000-0x000000030000: "spare"

mtd: partition "spare" doesn't start on an erase block boundary-- force read-only

0x000000030000-0x000000200000 : "kernel (ro)"

0x000000200000-0x000001600000 : "root (ro)"

0x000002c00000-0x000004000000: "yaffs"

0x000000028000-0x00000002c000: "env"

mtd: partition "env" doesn't start on an erase block boundary --force read-only

0x000001600000-0x0000017d0000 : "zimage"

mtd: partition "zimage" doesn't end on an erase block -- forceread-only

0x0000017d0000-0x000002bd0000 : "cramfs"

mtd: partition "cramfs" doesn't start on an erase block boundary-- force read-only

usbmon: debugfs is not available

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

usb usb1: configuration #1 chosen from 1 choice

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.4.3:USB FTDI Serial ConvertersDriver

USB Serial support registered for pl2303

usbcore: registered new interface driver pl2303

pl2303: Prolific PL2303 USB to serial adaptor driver

mice: PS/2 mouse device common for all mice

S3C24XX RTC, (c) 2004,2006Simtec Electronics

s3c2410-rtc s3c2410-rtc: rtc disabled, re-enabling

s3c2410-rtc s3c2410-rtc: rtc core: registered s3c as rtc0

S3C2410 Watchdog Timer,(c) 2004 Simtec Electronics

s3c2410-wdt s3c2410-wdt: watchdog inactive, resetdisabled, irq enabled

Advanced Linux Sound Architecture Driver Version 1.0.20.

ALSA device list:

  No soundcards found.

TCP cubic registered

NET: Registered protocol family 17

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

s3c2410-rtc s3c2410-rtc: setting system clock to2165-12-12 06:29:37 UTC (1888531281)

错误点:

uncorrectable error : <3>uncorrectable error : <3>end_request:I/O error, dev mtdblock3, sector 0

Buffer I/O error on device mtdblock3, logical block 0

uncorrectable error : <3>uncorrectable error : <3>end_request:I/O error, dev mtdblock3, sector 0

Buffer I/O error on device mtdblock3, logical block 0

uncorrectable error : <3>end_request: I/O error, dev mtdblock3,sector 8

Buffer I/O error on device mtdblock3, logical block 1

uncorrectable error : <3>end_request: I/O error, dev mtdblock3,sector 8

Buffer I/O error on device mtdblock3, logical block 1

end_request: I/O error, dev mtdblock3, sector 16

Buffer I/O error on device mtdblock3, logical block 2

end_request: I/O error, dev mtdblock3, sector 16

Buffer I/O error on device mtdblock3, logical block 2

uncorrectable error : <3>end_request: I/O error, dev mtdblock3,sector 24

Buffer I/O error on device mtdblock3, logical block 3

uncorrectable error : <3>end_request: I/O error, dev mtdblock3,sector 24

Buffer I/O error on device mtdblock3, logical block 3

uncorrectable error : <3>uncorrectable error : <3>end_request:I/O error, dev mtdblock3, sector 0

FAT: unable to read boot sector

VFS: Cannot open root device "mtdblock3" or unknown-block(31,3)

Please append a correct "root=" boot option; here are theavailable partitions:

1f00            160 mtdblock0 (driver?)

1f01             16 mtdblock1 (driver?)

1f02           1856 mtdblock2 (driver?)

1f03          20480 mtdblock3 (driver?)

1f04          20480 mtdblock4 (driver?)

1f05             16 mtdblock5 (driver?)

1f06            1856 mtdblock6 (driver?)

1f07          20480 mtdblock7 (driver?)

Kernel panic - not syncing: VFS: Unable to mount root fs onunknown-block(31,3)

Backtrace:

[<c002da1c>](dump_backtrace+0x0/0x114) from [<c02b94ec>] (dump_stack+0x18/0x1c)

 r7:00008001 r6:c3859000 r5:c002483c r4:c03a6c14

[<c02b94d4>] (dump_stack+0x0/0x1c)from [<c02b953c>](panic+0x4c/0x11c)

[<c02b94f0>](panic+0x0/0x11c)from [<c00090d0>] (mount_block_root+0x1e0/0x220)

 r3:00000000 r2:20000013 r1:c3817f6cr0:c032d8bd

[<c0008ef0>] (mount_block_root+0x0/0x220) from [<c00091d4>](mount_root+0xc4/0xfc)

 r8:00000000 r7:00000000 r6:00000000r5:c002483c r4:01f00003

[<c0009110>] (mount_root+0x0/0xfc) from [<c000937c>] (prepare_namespace+0x170/0x1c4)

 r5:c002483c r4:c03a6504

[<c000920c>](prepare_namespace+0x0/0x1c4)from [<c000860c>](kernel_init+0xbc/0xe8)

 r5:00000000 r4:c03a64e0

[<c0008550>] (kernel_init+0x0/0xe8) from [<c004cce8>](do_exit+0x0/0x58c)

 r4:00000000


错误原因

2.6.14 ECC问题和ramdisk! 收藏

 ECC问题,如果不把

    Device Drivers  --->

     Memory Technology Devices (MTD)  --->

        NAND Flash Device Drivers  --->

            [*]   S3C2410NAND Hardware ECC

    去掉会出现如下的问题:

end_request: I/O error, dev mtdblock3, sector 2

EXT3-fs: unable to read superblock

end_request: I/O error, dev mtdblock3, sector 0

Buffer I/O error on device mtdblock3, logical block 0

end_request: I/O error, dev mtdblock3, sector 0

Buffer I/O error on device mtdblock3, logical block 0

end_request: I/O error, dev mtdblock3, sector 8

Buffer I/O error on device mtdblock3, logical block 1

end_request: I/O error, dev mtdblock3, sector 8

Buffer I/O error on device mtdblock3, logical block 1

end_request: I/O error, dev mtdblock3, sector 16

Buffer I/O error on device mtdblock3, logical block 2

end_request: I/O error, dev mtdblock3, sector 16

Buffer I/O error on device mtdblock3, logical block 2

end_request: I/O error, dev mtdblock3, sector 24

Buffer I/O error on device mtdblock3, logical block 3

end_request: I/O error, dev mtdblock3, sector 24

Buffer I/O error on device mtdblock3, logical block 3

end_request: I/O error, dev mtdblock3, sector 0

FAT: unable to read boot sector

VFS: Cannot open root device "mtdblock3" or unknown-block(31,3)

Please append a correct "root=" boot option

Kernel panic - not syncing: VFS: Unable to mount root fs onunknown-block(31,3)

 另外,还要在在/linux-2.6.14.1/drivers/mtd/nand/s3c_2410.c中将

chip->eccmode =NAND_ECC_SOFT 改为 chip->eccmode = NAND_ECC_NONE;(我的开发板就是这个错误)

 

关于initrd及RamDisk的问题

       在做2.6.14内核移植之前,我本来是想移植2.6.15的,但是出现了如是的一些问题:就是无法打开根文件系统,        终端显示的信息如下:

        VFS: Cannot open root device"mtdblock3" or unknown-block(31,3)

        Please append a correct"root=" boot option

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

       后来改成2.6.14,同样的配置,却不会出现如上的问题。但是在这个过程中我却对RamDisk有了较好的掌握,        包括它也initrd的关系。

                Ramdisk是用来挂载根文件系统而在内存中开辟的地块区域,如果你需要你的内核支持Ramdisk,那么你需要作以下的更改:

   1). 首先,设置vivi的linux_cmd_line为:

    param set linux_cmd_line  "initrd=0x30800000,0x400000root=/dev/ram0 init=/linuxrc        console=ttySAC0  max=00:0e:3a:aa:bb:cc"

    如果你的bootloader不可以设置启动参数,也可以在

    Boot options  --->  中的第三个选项中按回车进行设置。      

    我通过多次的测试,发现initrd=0x30800000,0x400000的作用就是在RAM中开辟一块始起地址为0x30800000,大小为    4MB的Ramdisk.

   2). 其次还要在配置内核的时候注意以下的选项:

     Device Drivers  --->

         Block devices  --->

            <*> RAM disksupport                                    │ │ 

  │ │           (16)  Default number of RAM disks(NEW)                  │ │ 

  │ │           (4096) Default RAM disk size (kbytes) (NEW)              │ │ 

  │ │           [*]   Initial RAM disk (initrd)support

    这样内核就可以支持从Ramdisk启动了。其中4096KB要与上面设置的Ramdisk大小一致,这里为4MB。

    编译内核之后,这样子启动:

    net tftp 192.168.1.100 30008000zImage

    net tftp 192.168.1.100 30800000root_china.cramfs

    boot ram 30008000 0x12fee8      

    如果你不想用Ramdisk来挂载文件系统,直接从Flash中打开文件系统,那么在配置内核的时候,可以将RAM     disksupport支持去掉。

 

 

http://blogold.chinaunix.net/u2/77230/showart_1171688.html

 

移植内核时出现了这种错误,这种错误通常是由校验造成的.这种情况的解决办法为:

 

禁止Flash ECC校验

我们的内核都是通过UBOOT写到Nand Flash的, UBOOT通过的软件ECC算法产生ECC校验码, 这与内核校验的ECC码不一样, 内核中的ECC码是由S3C2410中Nand Flash控制器产生的. 所以, 我们在这里选择禁止内核ECC校验.

修改drivers/mtd/nand/s3c2410.c文件:

vi drivers/mtd/nand/s3c2410.c

找到s3c2410_nand_init_chip()函数,在该函数体最后加上一条语句:

chip->eccmode = NAND_ECC_NONE;



完整启动过程:

Copy linux kernel from 0x00060000 to 0x30008000, size= 0x00500000

... done

zImage magic = 0x016f2818

Setup linux parameters at 0x30000100

linux command line is: "noinitrdroot=/dev/mtdblock3 init=/linuxrc

console=ttySAC0"

MACH_TYPE = 1490

NOW, Booting Linux......

Uncompressing

Linux.............................................................

..........................................................done,

booting the kernel.

Linux version 2.6.30.4(root@localhost.localdomain) (gcc version

4.3.2 (Sourcery G++ Lite 2008q3-72) ) #7 Sat Mar 26 17:43:16 CST

2011

CPU: ARM920T [41129200] revision 0 (ARMv4T),cr=c0007177

CPU: VIVT data cache, VIVT instruction cache

Machine: JIVE

ATAG_INITRD is deprecated; please update yourbootloader.

Memory policy: ECC disabled, Data cache writeback

CPU S3C2440A (id 0x32440001)

S3C24XXClocks, (c) 2004 Simtec Electronics

S3C244X:core 405.000 MHz, memory 101.250 MHz, peripheral 50.625

MHz

CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on

Built 1 zonelists in Zone order, mobility groupingon.  Total

pages: 16256

Kernel command line: noinitrd root=/dev/mtdblock3init=/linuxrc

console=ttySAC0

NR_IRQS:85

irq: clearing subpending status 00000003

irq: clearing subpending status 00000002

PID hash table entries: 256 (order: 8, 1024 bytes)

Console: colour dummy device 80x30

console [ttySAC0] enabled

Dentrycache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cachehash table entries: 4096 (order: 2, 16384 bytes)

Memory:64MB = 64MB total

Memory:60980KB available (3432K code, 316K data, 132K init, 0K

highmem)--------------------------------------------------和原配的不同点

Calibrating delay loop... 201.93 BogoMIPS (lpj=504832)

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

net_namespace: 936 bytes

NET: Registered protocol family 16

S3CPower Management, Copyright 2004 Simtec Electronics

S3C2440:Initialising architecture

S3C2440:IRQ Support

S3C24XXDMA 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 0x00

s3c2440-i2c s3c2440-i2c: bus frequency set to 49 KHz

s3c2440-i2c s3c2440-i2c: i2c-0: S3CI2C adapter

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, 8192bytes)

TCP: Hash tables configured (established 2048 bind2048)

TCP renoregistered

NET: Registered protocol family 1

NetWinder Floating Point Emulator V0.97 (extendedprecision)

JFFS2 version 2.2. (NAND) (SUMMARY)  漏 2001-2006 Red Hat, Inc.

ROMFS MTD (C) 2007 Red Hat, Inc.

yaffs Mar 25 2011 22:54:44 Installing.

msgmni has been set to 119

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler deadline registered

io scheduler cfq registered

Console: switching to colour frame buffer device 30x40

fb0: s3c2410fbframe buffer device

lp: driver loaded but no devices found

ppdev: user-space parallel port driver

Serial: 8250/16550 driver, 4 ports, IRQ sharingenabled

s3c2440-uart.0:s3c2410_serial0 at MMIO0x50000000 (irq = 70) is a

S3C2440

s3c2440-uart.1:s3c2410_serial1 at MMIO0x50004000 (irq = 73) is a

S3C2440

s3c2440-uart.2:s3c2410_serial2 at MMIO0x50008000 (irq = 76) is a

S3C2440

brd: module loaded

loop: module loaded

Uniform Multi-Platform E-IDE driver

ide-gd driver 1.18

ide-cd driver 5.00

Driver 'sd' needs updating - please use bus_typemethods

dm9000 Ethernet Driver, V1.31

S3C24XXNAND Driver, (c) 2004 Simtec Electronics

s3c2440-nands3c2440-nand: Tacls=4, 39nsTwrph0=6 59ns, Twrph1=5

49ns

NAND device: Manufacturer ID: 0xec, Chip ID: 0xda(Samsung NAND

256MiB 3,3V 8-bit)

NAND_ECC_NONE selected by board driver. This is notrecommended !!

Scanning device for bad blocks

Bad eraseblock 609 at 0x000004c20000

Bad eraseblock 868 at 0x000006c80000

Bad eraseblock 1543 at 0x00000c0e0000

Creating 8 MTD partitions on "NAND 256MiB 3,3V8-bit":

0x000000000000-0x000000028000 : "uboot"

0x00000002c000-0x000000030000: "spare"

mtd: partition "spare" doesn't start on anerase block boundary --

force read-only

0x000000030000-0x000000200000 : "kernel(ro)"

0x000000200000-0x000001600000 : "root (ro)"

0x000002c00000-0x000004000000: "yaffs"

0x000000028000-0x00000002c000 : "env"

mtd: partition "env" doesn't start on anerase block boundary --

force read-only

0x000001600000-0x0000017d0000 : "zimage"

mtd: partition "zimage" doesn't end on anerase block -- force

read-only

0x0000017d0000-0x000002bd0000 : "cramfs"

mtd: partition "cramfs" doesn't start on anerase block boundary

-- force read-only

usbmon: debugfs is not available

ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

s3c2410-ohcis3c2410-ohci: S3C24XX OHCI

s3c2410-ohcis3c2410-ohci: new USB busregistered, assigned bus

number 1

s3c2410-ohcis3c2410-ohci: irq 42, io mem0x49000000

usb usb1: configuration #1 chosen from 1 choice

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 driverusbserial_generic

usbserial: USB Serial Driver core

USB Serial support registered for FTDI USB SerialDevice

usbcore: registered new interface driver ftdi_sio

ftdi_sio: v1.4.3:USB FTDISerial Converters Driver

USB Serial support registered for pl2303

usbcore: registered new interface driver pl2303

pl2303: Prolific PL2303 USB to serial adaptor driver

mice: PS/2 mouse device common for all mice

S3C24XXRTC, (c) 2004,2006 Simtec Electronics

s3c2410-rtcs3c2410-rtc: rtc disabled,re-enabling

s3c2410-rtcs3c2410-rtc: rtc core:registered s3c as rtc0

S3C2410Watchdog Timer, (c) 2004 Simtec Electronics

s3c2410-wdts3c2410-wdt: watchdog inactive,reset disabled, irq

enabled

Advanced Linux Sound Architecture Driver Version 1.0.20.

ALSA device list:

  No soundcardsfound.

TCP cubic registered

NET: Registered protocol family 17

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

s3c2410-rtcs3c2410-rtc: setting systemclock to 2165-12-13

00:16:21 UTC (1888595285)

yaffs: dev is 32505859 name is "mtdblock3"

yaffs: passed flags ""

yaffs: Attempting MTD mount on 31.3,"mtdblock3"

yaffs: auto selecting yaffs2

yaffs_read_super: isCheckpointed 0

VFS: Mounted root (yaffs filesystem) readonly ondevice 31:3.

Freeing init memory: 132K

cannot run '/etc/init.d/rcS': Permission denie

 

Please press Enter to activate this console.

第三次改动就是利用:

static struct mtd_partition smdk_default_nand_part[] = {
        [0]= {
                .name  = "vivi",
                .size  = 0x00040000,
                .offset= 0x00000000,
        },
        [1]= {
                .name  = "param",
                .offset= 0x00040000,
                .size  = 0x00020000,
        },
        [2]= {
                .name  = "kernel",
                .offset= 0x00060000,
                .size  = 0x00200000,
        },
        [3]= {
                .name  = "root",
                .offset= 0x00560000,
                .size  = 0x3fd80000,
        },
};

得到:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值