在这要说明的:1. 在./driver/mtd/nand目录下是关于nand的驱动,与硬件相关的文件是s3c2410.c。如果使用其他的硬件的话可以替换此文件。2. ./driver/mtd/nand/s3c2410.c中的s3c2410_nand_driver的.driver中的name字段一定要与./arch/arm/plat-samsung/dev_nand.c(平台设备)中的s3c_device_nand中的name字段保持一致,这样才能进行调用。否则可能会出现nand设备驱动不成功的现象。我的内核打印错误信息如下:[<c01469cc>] (strnlen+0x0/0x58) from [<c0148150>] (string+0x44/0xfc)[<c0148110>] (string+0x4/0xfc) from [<c0149270>] (vsnprintf+0x458/0xa28) r9:c033a5b0 r8:c7c27dd0 r7:c02efb56 r6:c02efb56 r5:c02efb57r4:00000000[<c0148e18>] (vsnprintf+0x0/0xa28) from [<c0149914>] (vscnprintf+0x14/0x20)[<c0149900>] (vscnprintf+0x0/0x20) from [<c003f6d4>] (vprintk+0x80/0x38c) r5:00000000 r4:c033a0f8[<c003f654>] (vprintk+0x0/0x38c) from [<c023cbf0>] (printk+0x28/0x30)[<c023cbc8>] (printk+0x0/0x30) from [<c017a1bc>] (add_mtd_partitions+0x2e0/0x7c0) r3:c031b578 r2:c031c1bc r1:70200000 r0:c02efb3c[<c0179edc>] (add_mtd_partitions+0x0/0x7c0) from [<c018487c>] (s3c24xx_nand_probe+0x4b4/0x774)[<c01843c8>] (s3c24xx_nand_probe+0x0/0x774) from [<c017167c>] (platform_drv_probe+0x20/0x24)[<c017165c>] (platform_drv_probe+0x0/0x24) from [<c01704b0>] (driver_probe_device+0x80/0x18c)[<c0170430>] (driver_probe_device+0x0/0x18c) from [<c0170650>] (__driver_attach+0x94/0x98)[<c01705bc>] (__driver_attach+0x0/0x98) from [<c016fcc8>] (bus_for_each_dev+0x68/0x94) r7:c01705bc r6:c0333834 r5:c7c27ee0 r4:00000000[<c016fc60>] (bus_for_each_dev+0x0/0x94) from [<c017033c>] (driver_attach+0x20/0x28) r7:c0333834 r6:c7c26000 r5:c0333834 r4:c02d872c[<c017031c>] (driver_attach+0x0/0x28) from [<c016f46c>] (bus_add_driver+0xa4/0x260)[<c016f3c8>] (bus_add_driver+0x0/0x260) from [<c0170914>] (driver_register+0x74/0x15c)[<c01708a0>] (driver_register+0x0/0x15c) from [<c0171968>] (platform_driver_register+0x4c/0x60) r7:c03393c0 r6:c7c26000 r5:c001db58 r4:c001dae0[<c017191c>] (platform_driver_register+0x0/0x60) from [<c0017638>] (s3c2410_nand_init+0x1c/0x28)[<c001761c>] (s3c2410_nand_init+0x0/0x28) from [<c0021368>] (do_one_initcall+0x38/0x1c4)[<c0021330>] (do_one_initcall+0x0/0x1c4) from [<c0008480>] (kernel_init+0xac/0x160)[<c00083d4>] (kernel_init+0x0/0x160) from [<c0041c44>] (do_exit+0x0/0x640) r7:00000000 r6:00000000 r5:00000000 r4:00000000Code: e24cb004 e3510000 e1a02000 0a00000d (e5d03000) ---[ end trace 48c84fc47f611133 ]---Kernel panic - not syncing: Attempted to kill init!Backtrace: [<c0025c34>] (dump_backtrace+0x0/0x10c) from [<c023caf4>] (dump_stack+0x18/0x1c) r7:c7c24000 r6:c01469e4 r5:c0339cb0 r4:0000000b[<c023cadc>] (dump_stack+0x0/0x1c) from [<c023cb44>] (panic+0x4c/0xd0)[<c023caf8>] (panic+0x0/0xd0) from [<c004218c>] (do_exit+0x548/0x640) r3:c031d408 r2:c7c279a8 r1:c7c27884 r0:c02d8ea4[<c0041c44>] (do_exit+0x0/0x640) from [<c0025fd0>] (die+0x290/0x2dc)[<c0025d40>] (die+0x0/0x2dc) from [<c00282f8>] (__do_kernel_fault+0x6c/0x8c)[<c002828c>] (__do_kernel_fault+0x0/0x8c) from [<c0028460>] (do_page_fault+0x148/0x200) r9:00000005 r8:c7c27c20 r7:c7c24000 r6:70200000 r5:00000000r4:c7c27c20[<c0028318>] (do_page_fault+0x0/0x200) from [<c002862c>] (do_translation_fault+0x6c/0xa4)[<c00285c0>] (do_translation_fault+0x0/0xa4) from [<c00212cc>] (do_DataAbort+0x40/0xa4) r7:c0318590 r6:00000005 r5:c7c27c54 r4:c0318540[<c002128c>] (do_DataAbort+0x0/0xa4) from [<c0021aac>] (__dabt_svc+0x4c/0x60)Exception stack(0xc7c27c20 to 0xc7c27c68)7c20: 70200000 ffffffff 70200000 ff0a0004 00000000 c033a1dc c033a5b0 0000ffff7c40: 70200000 c033a5b0 c033a1dc c7c27c74 c7c27c78 c7c27c68 c0148150 c01469e47c60: a0000093 ffffffff[<c01469cc>] (strnlen+0x0/0x58) from [<c0148150>] (string+0x44/0xfc)[<c0148110>] (string+0x4/0xfc) from [<c0149270>] (vsnprintf+0x458/0xa28) r9:c033a5b0 r8:c7c27dd0 r7:c02efb56 r6:c02efb56 r5:c02efb57r4:00000000[<c0148e18>] (vsnprintf+0x0/0xa28) from [<c0149914>] (vscnprintf+0x14/0x20)[<c0149900>] (vscnprintf+0x0/0x20) from [<c003f6d4>] (vprintk+0x80/0x38c) r5:00000000 r4:c033a0f8[<c003f654>] (vprintk+0x0/0x38c) from [<c023cbf0>] (printk+0x28/0x30)[<c023cbc8>] (printk+0x0/0x30) from [<c017a1bc>] (add_mtd_partitions+0x2e0/0x7c0) r3:c031b578 r2:c031c1bc r1:70200000 r0:c02efb3c[<c0179edc>] (add_mtd_partitions+0x0/0x7c0) from [<c018487c>] (s3c24xx_nand_probe+0x4b4/0x774)[<c01843c8>] (s3c24xx_nand_probe+0x0/0x774) from [<c017167c>] (platform_drv_probe+0x20/0x24)[<c017165c>] (platform_drv_probe+0x0/0x24) from [<c01704b0>] (driver_probe_device+0x80/0x18c)[<c0170430>] (driver_probe_device+0x0/0x18c) from [<c0170650>] (__driver_attach+0x94/0x98)[<c01705bc>] (__driver_attach+0x0/0x98) from [<c016fcc8>] (bus_for_each_dev+0x68/0x94) r7:c01705bc r6:c0333834 r5:c7c27ee0 r4:00000000[<c016fc60>] (bus_for_each_dev+0x0/0x94) from [<c017033c>] (driver_attach+0x20/0x28) r7:c0333834 r6:c7c26000 r5:c0333834 r4:c02d872c[<c017031c>] (driver_attach+0x0/0x28) from [<c016f46c>] (bus_add_driver+0xa4/0x260)[<c016f3c8>] (bus_add_driver+0x0/0x260) from [<c0170914>] (driver_register+0x74/0x15c)[<c01708a0>] (driver_register+0x0/0x15c) from [<c0171968>] (platform_driver_register+0x4c/0x60) r7:c03393c0 r6:c7c26000 r5:c001db58 r4:c001dae0[<c017191c>] (platform_driver_register+0x0/0x60) from [<c0017638>] (s3c2410_nand_init+0x1c/0x28)[<c001761c>] (s3c2410_nand_init+0x0/0x28) from [<c0021368>] (do_one_initcall+0x38/0x1c4)[<c0021330>] (do_one_initcall+0x0/0x1c4) from [<c0008480>] (kernel_init+0xac/0x160)[<c00083d4>] (kernel_init+0x0/0x160) from [<c0041c44>] (do_exit+0x0/0x640) r7:00000000 r6:00000000 r5:00000000 r4:000000007.添加yaffs文件系统的支持:1、下载Yaffs2
2、解压Yaffs2并将其加入Linux内核(打补丁的方式)
#cd yaffs2
#./patch-ker.sh c /linux-2.6.34.2/
Linux2.6.34.2在TQ6410上的移植详解(4)
内容版权声明:除非注明,否则皆为本站原创文章。