经过自己的实际移植发现,mini2440附带的《Mini2440 Linux移植开发实战指南》存在着几个问题
1)其中修改mach-mini2440.c部分
应该再在mini2440_machine_init函数中添加几点
static void __init mini2440_machine_init(void)
{
s3c24xx_fb_set_platdata(&mini2440_fb_info);
s3c_i2c0_set_platdata(NULL);
s3c2410_gpio_cfgpin(S3C2410_GPC(0), S3C2410_GPC0_LEND);
s3c_device_nand.dev.platform_data = &friendly_arm_nand_info;
s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg;
platform_add_devices(mini2440_devices, ARRAY_SIZE(mini2440_devices));
s3c_pm_init();
}
其中
s3c_device_nand.dev.platform_data = &friendly_arm_nand_info; 这句话很重要,这也是我做时,系统出现崩溃的地方,当时系统oops报错为
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 : [<c01da58c>]
lr : [<c01da458>]
psr: 60000013
sp : c3823f08 ip : 00000000
fp : 00000001
r10: 00000000 r9 : 00000000
r8 : 00000000
r7 : c03cf388 r6 : 00000000
r5 : c39ae8c0
r4 : c3881800
r3 : 00000001 r2 : c3881988
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 c03cf390
3f20: c03cf390 c03e5d38 c39a2ae0 c03e47f0 00000000 00000000 00000000 c01b5780
3f40: c03cf390 c01b496c c03cf390 c03cf3c4 c03e5d38 c39a2ae0 c03e47f0 c01b4a7c
3f60: 00000000 c01b4a20 c03e5d38 c01b424c c3804938 c38474b0 c0022178 c03e5d38
3f80: c03e5d38 c01b3bac c037bfbe c037bfbe 00000006 c0022178 00000000 c03e5d38
3fa0: c001a920 00000000 00000000 c01b4d48 c0022178 00000000 00000000 c001a920
3fc0: 00000000 c002937c c001a920 c03e9c2c c03f1740 c00222e0 c0022178 00000000
3fe0: 00000000 00000000 00000000 c00083f8 00000000 c002a854 00000001 00000000
[<c01da58c>] (s3c24xx_nand_probe+0x2d8/0x514) from [<c01b5780>] (platform_drv_probe+0x18/0x1c)
[<c01b5780>] (platform_drv_probe+0x18/0x1c) from [<c01b496c>] (driver_probe_device+0xa8/0x15c)
[<c01b496c>] (driver_probe_device+0xa8/0x15c) from [<c01b4a7c>] (__driver_attach+0x5c/0x7c)
[<c01b4a7c>] (__driver_attach+0x5c/0x7c) from [<c01b424c>] (bus_for_each_dev+0x48/0x78)
[<c01b424c>] (bus_for_each_dev+0x48/0x78) from [<c01b3bac>] (bus_add_driver+0x98/0x21c)
[<c01b3bac>] (bus_add_driver+0x98/0x21c) from [<c01b4d48>] (driver_register+0xa4/0x130)
[<c01b4d48>] (driver_register+0xa4/0x130) from [<c002937c>] (do_one_initcall+0x5c/0x1b4)
开始我还一直以为是platform_drv_probe这个函数附近出的问题,又是分析反汇编后的代码,又是核对c源代码的,很是费了番周折。转机出现在我不小心把我做了好几天mach-mini2440.c文件给覆盖掉了。我就干脆用随板带的源码里的这个文件烤过来了。虽然我当时用的是2.6.36的代码,带的是2.6.32的,这个问题就解决了。我就开始比对这两个文件的区别并进行实验才找到了这里。
2)移植根文件系统中
有必要在根目录手动添加sys这个文件夹
而etc/profile文件应该是
#Ash profile
#vim:syntax=sh
#No core file by defaults
#ulimit -S -c 0>/dev/null 2>&1
USER="`id -un`"
LOGNAME=$USER
PS1='[\u@\h\W]# '
PATH=$PATH
HOSTNAME='/bin/hostname'
export USER LOGNAME PS1 PATH
1)其中修改mach-mini2440.c部分
应该再在mini2440_machine_init函数中添加几点
static void __init mini2440_machine_init(void)
{
}
其中
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
PC is at s3c24xx_nand_probe+0x2d8/0x514
LR is at s3c24xx_nand_probe+0x1a4/0x514
pc : [<c01da58c>]
sp : c3823f08
r10: 00000000
r7 : c03cf388
r3 : 00000001
Flags: nZCv
Control: c000717f
Process swapper (pid: 1, stack limit = 0xc3822270)
Stack: (0xc3823f08 to 0xc3824000)
3f00:
3f20: c03cf390 c03e5d38 c39a2ae0 c03e47f0 00000000 00000000 00000000 c01b5780
3f40: c03cf390 c01b496c c03cf390 c03cf3c4 c03e5d38 c39a2ae0 c03e47f0 c01b4a7c
3f60: 00000000 c01b4a20 c03e5d38 c01b424c c3804938 c38474b0 c0022178 c03e5d38
3f80: c03e5d38 c01b3bac c037bfbe c037bfbe 00000006 c0022178 00000000 c03e5d38
3fa0: c001a920 00000000 00000000 c01b4d48 c0022178 00000000 00000000 c001a920
3fc0: 00000000 c002937c c001a920 c03e9c2c c03f1740 c00222e0 c0022178 00000000
3fe0: 00000000 00000000 00000000 c00083f8 00000000 c002a854 00000001 00000000
[<c01da58c>] (s3c24xx_nand_probe+0x2d8/0x514) from [<c01b5780>] (platform_drv_probe+0x18/0x1c)
[<c01b5780>] (platform_drv_probe+0x18/0x1c) from [<c01b496c>] (driver_probe_device+0xa8/0x15c)
[<c01b496c>] (driver_probe_device+0xa8/0x15c) from [<c01b4a7c>] (__driver_attach+0x5c/0x7c)
[<c01b4a7c>] (__driver_attach+0x5c/0x7c) from [<c01b424c>] (bus_for_each_dev+0x48/0x78)
[<c01b424c>] (bus_for_each_dev+0x48/0x78) from [<c01b3bac>] (bus_add_driver+0x98/0x21c)
[<c01b3bac>] (bus_add_driver+0x98/0x21c) from [<c01b4d48>] (driver_register+0xa4/0x130)
[<c01b4d48>] (driver_register+0xa4/0x130) from [<c002937c>] (do_one_initcall+0x5c/0x1b4)
开始我还一直以为是platform_drv_probe这个函数附近出的问题,又是分析反汇编后的代码,又是核对c源代码的,很是费了番周折。转机出现在我不小心把我做了好几天mach-mini2440.c文件给覆盖掉了。我就干脆用随板带的源码里的这个文件烤过来了。虽然我当时用的是2.6.36的代码,带的是2.6.32的,这个问题就解决了。我就开始比对这两个文件的区别并进行实验才找到了这里。
2)移植根文件系统中
有必要在根目录手动添加sys这个文件夹
而etc/profile文件应该是
#Ash profile
#vim:syntax=sh
#No core file by defaults
#ulimit -S -c 0>/dev/null 2>&1
USER="`id -un`"
LOGNAME=$USER
PS1='[\u@\h\W]# '
PATH=$PATH
HOSTNAME='/bin/hostname'
export USER LOGNAME PS1 PATH