Linux内核 网卡 和 jffs2 移植(2)

移植nandflash驱动
根据您自己的情况,修改分区,比如
root@linuxidc:/source/kernel/linux-2.6.22.6# vim arch/arm/plat-s3c24xx/common-smdk.c
修改数组
109 static struct mtd_partition smdk_default_nand_part[]
改为
109 static struct mtd_partition smdk_default_nand_part[] = {
110         [0] = {
111                 .name   = "u-boot 1.3.1",
112                 .size   = 0x40000,
113                 .offset = 0,
114         },
115         [1] = {
116                 .name   = "kernel",
117                 .offset = 0x00040000,
118                 .size   = 0x001c0000,
119         },
120         [2] = {
121                 .name   = "root",
122                 .offset = 0x00200000,
123                 .size   = 0x00800000,
124         },
125         [3] = {
126                 .name   = "user_rootfs",
127                 .offset = 0x02500000,
128                 .size   = 0x01b00000,
129         }
130 };

关闭内核的ECC
由于u-boot的ECC算法和内核的ECC算法不一致,所以这里把内核中的ECC校验关闭
root@linuxidc:/source/kernel/linux-2.6.22.6# vim drivers/mtd/nand/s3c2410.c
在函数
577 static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
578                                    struct s3c2410_nand_mtd *nmtd,
579                                    struct s3c2410_nand_set *set)
580 {
的最后添加
657         chip->ecc.mode = NAND_ECC_NONE;
make menuconfig
  Device Drivers  --->
    <*> Memory Technology Device (MTD) support  --->  
       <*>   NAND Device Support  --->
          <*>   NAND Flash support for S3C2410/S3C2440 SoC

[ ]   S3C2410 NAND Hardware ECC  (默认是不加的,可查看一下若选上了进行去掉)
然后退出并保存
然后就是make
root@linuxidc:/source/kernel/linux-2.6.22.6# make zImage

编译完成后,最后面打印到终端的是
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
root@linuxidc:/source/kernel/linux-2.6.22.6#
这表明,编译通过了
将zImage复制到tftp服务器的共享目录
root@linuxidc:/source/kernel/linux-2.6.22.6# cp arch/arm/boot/zImage /tftpboot/

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

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