主题 : 关于《Mini2440之Linux移植开发实战指南》的问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 3451
精华: 0
发帖: 16
金钱: 85 两
威望: 25 点
贡献值: 0 点
综合积分: 32 分
注册时间: 2009-01-12
最后登录: 2013-10-30
楼主  发表于: 2010-06-03 17:33

 关于《Mini2440之Linux移植开发实战指南》的问题

朋友们下载这个手册,有谁按照手册调试完成了。我认真按照手册的步骤做下来,在移植nandflash这步的时候出现问题,编译都通过了,但是下载到板子里,总是感觉分区不对
load Image of Linux...Uncompressing Linux................................................................................................................................... done, booting the kernel.
Linux version 2.6.32.2 (root@localhost.localdomain) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #4 Thu Jun 3 17:01:52 CST 2010
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: My mini2440 Development board
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 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=/linuxrc console=ttySAC0
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: 60500KB available (3672K code, 417K data, 132K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:85
irq: clearing subpending status 00000002
Console: colour dummy device 80x30
console [ttySAC0] enabled
Calibrating delay loop... 201.93 BogoMIPS (lpj=504832)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
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
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c-i2c s3c2440-i2c: slave address 0x10
s3c-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c-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 reno registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 118
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 60x53
fb0: s3c2410fb frame buffer device
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
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c24xx-nand s3c2440-nand: Tacls=4, 39ns Twrph0=8 79ns, Twrph1=8 79ns
Unable to handle kernel NULL pointer dereference at virtual address 00000018
pgd = c0004000
[00000018] *pgd=00000000
Internal error: Oops: 5 [#1]
last sysfs file:
Modules linked in:
CPU: 0    Not tainted  (2.6.32.2 #4)
PC is at s3c24xx_nand_probe+0x2d8/0x514
LR is at s3c24xx_nand_probe+0x1a4/0x514
pc : [<c01e9fe4>]    lr : [<c01e9eb0>]    psr: 60000013
sp : c3823f08  ip : 00000000  fp : 00000001
r10: 00000000  r9 : 00000000  r8 : 00000000
r7 : c03e5388  r6 : 00000000  r5 : c39b0640  r4 : c3863800
r3 : 00000001  r2 : c3863988  r1 : c4c00000  r0 : 00000002
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: c000717f  Table: 30004000  DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc3822270)
Stack: (0xc3823f08 to 0xc3824000)
3f00:                   00000000 c00d398c c385a2d0 00000000 00000000 c03e5390
3f20: c03e5390 c03fbb40 c39ad960 c03fa5f8 00000000 00000000 00000000 c01c51d8
3f40: c03e5390 c01c43c4 c03e5390 c03e53c4 c03fbb40 c39ad960 c03fa5f8 c01c44d4
3f60: 00000000 c01c4478 c03fbb40 c01c3ca4 c3804938 c38474b0 c00220dc c03fbb40
3f80: c03fbb40 c01c3604 c039066f c039066f 00000006 c00220dc 00000000 c03fbb40
3fa0: c001a8b4 00000000 00000000 c01c47a0 c00220dc 00000000 00000000 c001a8b4
3fc0: 00000000 c002937c c001a8b4 c03ffa34 c0407540 c0022244 c00220dc 00000000
3fe0: 00000000 00000000 00000000 c00083f8 00000000 c002a854 33cc33cc 33cc33cc
[<c01e9fe4>] (s3c24xx_nand_probe+0x2d8/0x514) from [<c01c51d8>] (platform_drv_probe+0x18/0x1c)
[<c01c51d8>] (platform_drv_probe+0x18/0x1c) from [<c01c43c4>] (driver_probe_device+0xa8/0x15c)
[<c01c43c4>] (driver_probe_device+0xa8/0x15c) from [<c01c44d4>] (__driver_attach+0x5c/0x7c)
[<c01c44d4>] (__driver_attach+0x5c/0x7c) from [<c01c3ca4>] (bus_for_each_dev+0x48/0x78)
[<c01c3ca4>] (bus_for_each_dev+0x48/0x78) from [<c01c3604>] (bus_add_driver+0x98/0x21c)
[<c01c3604>] (bus_add_driver+0x98/0x21c) from [<c01c47a0>] (driver_register+0xa4/0x130)
[<c01c47a0>] (driver_register+0xa4/0x130) from [<c002937c>] (do_one_initcall+0x5c/0x1b4)
[<c002937c>] (do_one_initcall+0x5c/0x1b4) from [<c00083f8>] (kernel_init+0x94/0x10c)
[<c00083f8>] (kernel_init+0x94/0x10c) from [<c002a854>] (kernel_thread_exit+0x0/0x8)
Code: e584321c e58420c4 e58452ac e58482a8 (e5983018)
---[ end trace fef4b2b65d07ac6c ]---
Kernel panic - not syncing: Attempted to kill init!
[<c002e9f8>] (unwind_backtrace+0x0/0xdc) from [<c02e0450>] (panic+0x40/0x120)
[<c02e0450>] (panic+0x40/0x120) from [<c003ebe0>] (do_exit+0x64/0x58c)
[<c003ebe0>] (do_exit+0x64/0x58c) from [<c002d70c>] (die+0x15c/0x180)
[<c002d70c>] (die+0x15c/0x180) from [<c002f780>] (__do_kernel_fault+0x64/0x74)
[<c002f780>] (__do_kernel_fault+0x64/0x74) from [<c002f948>] (do_page_fault+0x1b8/0x1cc)
[<c002f948>] (do_page_fault+0x1b8/0x1cc) from [<c00292c0>] (do_DataAbort+0x34/0x94)
[<c00292c0>] (do_DataAbort+0x34/0x94) from [<c0029a40>] (__dabt_svc+0x40/0x60)
Exception stack(0xc3823ec0 to 0xc3823f08)
3ec0: 00000002 c4c00000 c3863988 00000001 c3863800 c39b0640 00000000 c03e5388
3ee0: 00000000 00000000 00000000 00000001 00000000 c3823f08 c01e9eb0 c01e9fe4
3f00: 60000013 ffffffff
[<c0029a40>] (__dabt_svc+0x40/0x60) from [<c01e9fe4>] (s3c24xx_nand_probe+0x2d8/0x514)
[<c01e9fe4>] (s3c24xx_nand_probe+0x2d8/0x514) from [<c01c51d8>] (platform_drv_probe+0x18/0x1c)
[<c01c51d8>] (platform_drv_probe+0x18/0x1c) from [<c01c43c4>] (driver_probe_device+0xa8/0x15c)
[<c01c43c4>] (driver_probe_device+0xa8/0x15c) from [<c01c44d4>] (__driver_attach+0x5c/0x7c)
[<c01c44d4>] (__driver_attach+0x5c/0x7c) from [<c01c3ca4>] (bus_for_each_dev+0x48/0x78)
[<c01c3ca4>] (bus_for_each_dev+0x48/0x78) from [<c01c3604>] (bus_add_driver+0x98/0x21c)
[<c01c3604>] (bus_add_driver+0x98/0x21c) from [<c01c47a0>] (driver_register+0xa4/0x130)
[<c01c47a0>] (driver_register+0xa4/0x130) from [<c002937c>] (do_one_initcall+0x5c/0x1b4)
[<c002937c>] (do_one_initcall+0x5c/0x1b4) from [<c00083f8>] (kernel_init+0x94/0x10c)
[<c00083f8>] (kernel_init+0x94/0x10c) from [<c002a854>] (kernel_thread_exit+0x0/0x8)
这个是移植后的信息,高手帮忙分析下   等待。。。。。。。。。
级别: 新手上路
UID: 3451
精华: 0
发帖: 16
金钱: 85 两
威望: 25 点
贡献值: 0 点
综合积分: 32 分
注册时间: 2009-01-12
最后登录: 2013-10-30
1楼  发表于: 2010-06-04 13:50
解决方法:
只需在mach-mini2440.c的初始化函数mini2440_machine_init(void)里加入s3c_nand_set_platdata(&mini2440_nand_info);即可。
添加了这个函数后编译出现错误
arch/arm/mach-s3c2440/mach-mini2440.c: In function 'mini2440_machine_init':
arch/arm/mach-s3c2440/mach-mini2440.c:217: error: implicit declaration of function 's3c_nand_set_platdata'
级别: 侠客
UID: 13429
精华: 0
发帖: 51
金钱: 255 两
威望: 51 点
贡献值: 0 点
综合积分: 102 分
注册时间: 2010-01-24
最后登录: 2015-05-25
2楼  发表于: 2010-06-06 08:48
好啊!楼主@
级别: 新手上路
UID: 10272
精华: 0
发帖: 2
金钱: 15 两
威望: 6 点
贡献值: 0 点
综合积分: 4 分
注册时间: 2009-10-29
最后登录: 2010-07-09
3楼  发表于: 2010-06-21 16:25
我也遇到了这样的问题,不知道该如何解决?
级别: 侠客
UID: 21258
精华: 1
发帖: 120
金钱: 655 两
威望: 131 点
贡献值: 1 点
综合积分: 260 分
注册时间: 2010-05-13
最后登录: 2023-11-17
4楼  发表于: 2010-07-10 21:12
看了一下4楼的精彩回答。思路是非常的正确。但是改的地方可能讲得不是 2.6.32版本,这个版本里是没有s3c_nand_set_platdata这个函数的。在2.6.34里有。

在2.6.32里,还是不得不直接初始化数据结构。mini2440_machine_init()函数中增加s3c_device_nand.dev.platform_data = &mini240_nand_info;就可以了。

原理和四楼讲得一样的。
级别: 新手上路
UID: 60304
精华: 0
发帖: 15
金钱: 85 两
威望: 17 点
贡献值: 0 点
综合积分: 30 分
注册时间: 2011-12-08
最后登录: 2012-04-15
5楼  发表于: 2011-12-08 13:29
大家好,我按文章中说的做但在nand移植修改后进行“make zImage"报错,请问大家有没有遇到这样的问题,求解,谢谢!