我的mini2440 Linux2.9.32 移植问题记录(2)

static void __init mini2440_machine_init(void)
{
    s3c24xx_fb_set_platdata(&mini2440_fb_info);
    s3c_i2c0_set_platdata(NULL);
       s3c_device_nand.dev.platform_data = &mini2440_nand_info;  //添加内容
    platform_add_devices(mini2440_devices, ARRAY_SIZE(mini2440_devices));
    //smdk_machine_init();
}

static struct platform_device *mini2440_devices[] __initdata = {

&s3c_device_usb,

&s3c_device_lcd,

&s3c_device_wdt,

&s3c_device_i2c0,

&s3c_device_iis,

&s3c_device_nand,   // 把 nand flash 设备添加到开发板的设备列表结构

};

更改drivers/mtd/nand/s3c2410.c关闭ecc校验

chip->ecc.mode        = NAND_ECC_SOFT;

改为:chip->ecc.mode        = NAND_ECC_NONE;


      注意:否则将会出现很多问题Unable to handle kernel NULL pointer dereference at virtual address 00000018
pgd = c0004000
[00000018] *pgd=00000000
Internal error: Oops: 5 [#1]

make zIamge下载后报错


出现一大堆错误:

arch/arm/mach-s3c2440/mach-mini2440.c:84: error: array type has incomplete element type
arch/arm/mach-s3c2440/mach-mini2440.c:85: error: array index in non-array initializer
arch/arm/mach-s3c2440/mach-mini2440.c:85: error: (near initialization for 'mini2440_nand_sets')
arch/arm/mach-s3c2440/mach-mini2440.c:86: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:86: error: (near initialization for 'mini2440_nand_sets')
arch/arm/mach-s3c2440/mach-mini2440.c:87: error: field name not in record or union initializer

在macn-mini2440中添加头文件

#include <plat/common-smdk.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/nand_ecc.h>
#include <linux/mtd/partitions.h>
#include <plat/nand.h>//这个也不能少的哦  

编译后下载:

affs: 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的文件系统

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/26131.html