各位高手,小弟正在移植linux内核到友善之臂的mini6410平台,linux内核版本2.6.39。移植完成NAND FLASH驱动后,进行测试,发现系统未运行s3c6410_nand_probe函数。请教其中的原因,谢谢。平台设备已经添加,代码如下:
代码所在文件:arch/arm/plat_samsung/dev-nand.c。
static struct resource s3c_nand_resource[] = {
[0] = {
.start = S3C_PA_NAND,
.end = S3C_PA_NAND + SZ_1M,
.flags = IORESOURCE_MEM,
}
};
struct platform_device s3c_device_nand = {
.name = "s3c6410-nand",
.id = -1,
.num_resources = ARRAY_SIZE(s3c_nand_resource),
.resource = s3c_nand_resource,
};
代码所在文件:arch/arm/mach-s3c64xx/mach-th6410.c。
static struct platform_device *th6410_devices[] __initdata = {
……
&s3c_device_nand, /*添加NAND设备*/
……
};
static void __init th6410_machine_init(void)
{
……
s3c_ide_set_platdata(&th6410_ide_pdata);
ret = platform_add_devices(th6410_devices, ARRAY_SIZE(th6410_devices));
if (ret == 0)
{
printk ("\n platform_add_devices = 0 \n");
}
//BUG_ON (!ret);
}
驱动程序已经添加,代码如下:
代码所在文件:drivers/mtd/nand/s3c_nand.c。
staticstruct platform_driver s3c6410_nand_driver= {
.probe =s3c6410_nand_probe,
.remove =s3c_nand_remove,
.suspend = s3c_nand_suspend,
.resume =s3c_nand_resume,
.driver ={
.name ="s3c6410-nand",
.owner =THIS_MODULE,
},
};
static int __init s3c_nand_init(void)
{
printk("S3C NAND Driver, (c) 2008 Samsung Electronics\n");
platform_driver_register(&s3c2450_nand_driver);
platform_driver_register(&s3c6400_nand_driver);
platform_driver_register(&s3c6410_nand_driver);
return platform_driver_register(&s5pc100_nand_driver);
// returnplatform_driver_register(&s3c6410_nand_driver); }
|