Linux内核(2.6.14) + 根文件系统 + Qt4 移植 for S3C2410


/*********************************************************/
LarryChan   阿牛哥(亮)  
chenliang_43@sina.com    http://blog.sina.com.cn/mimimomoll
2008.5.7. 桂林电子科技大学 正平科技馆机器人中心
衷心感谢所有对本文有所帮助的人。本文仅供交流,无意侵权
/*********************************************************/

 
TARGET
CPU:   S3C2410X
SDRAM: HY57V561620(32MB) × 2
FLASH: K9F1208(64MB)
NET:   CS8900
HOST
Linux Realse Version: Fecora Core 6
CrossCompiler: gcc-4.1.1/arm-linux-gcc-3.4.1

一、内核移植(2.6.14)
1   修改linux2.6.14下面的makefile文件
    找到ARCH和CROSS_COMPILE,修改
    ARCH ?= arm
    CROSS_COMPILE ?= /usr/local/arm/3.4.1/bin/arm-linux- 
(此处为你交叉编译的路径)
 
2  设置flash分区
    在arch/arm/machs3c2410/devs.c文件中添加头文件
    #include <linux/mtd/partitions.h>
    #include <linux/mtd/nand.h>
    #include <asm/arch/nand.h> 
    然后建立分区表
    /* 一个Nand Flash总共64MB, 按如下大小进行分区 分区大小自己看着办*/
    static struct mtd_partition partition_info[] ={
        { /* 1MB */
            name: "bootloader",
            size: 0x00100000,
            offset: 0x0,
        },{ /* 3MB */
            name: "kernel",
            size: 0x00300000,
            offset: 0x00100000,
        }, { /* 40MB */
            name: "root",
            size: 0x02800000,
            offset: 0x00400000,
        }, { /* 20MB */
        name: "user",
        size: 0x00f00000,
        offset: 0x02d00000,
        }
    };
 
    /*加入Nand Flash分区*/
    struct s3c2410_nand_set nandset ={
    nr_partitions: 4, /*指明partition_info中定义的分区数目*/
    partitions: partition_info, /* partition table分区信息表*/
    };
 
    /*建立Nand Flash芯片支持*/
    struct s3c2410_platform_nand superlpplatform={
        tacls:0,
        twrph0:30,
        twrph1:0,
        sets: &nandset,
        nr_sets: 1,
    };
    tacls, twrph0, twrph1的意思见S3C2410手册的63,
    这3个值最后会被设置到NFCONF中,见S3C2410手册66.
    sets: 支持的分区集        nr_set:分区集的个数
   
    /*加入Nand Flash芯片支持到Nand Flash驱动
    另外,还要修改此文件中的s3c_device_nand结构体变量,添加对dev成员的赋值*/
    struct platform_device s3c_device_nand = {
        .name = "s3c2410-nand",
            /* Device name */
        .id = -1,
            /* Device ID */
        .num_resources = ARRAY_SIZE(s3c_nand_resource),
        .resource = s3c_nand_resource, /* Nand Flash Controller Registers */
            /* Add the Nand Flash device */
        .dev = {
        .platform_data = &superlpplatform
        }
    };
    指定启动时初始化
    arch/arm/machs-3c2410/mach-smdk2410.c文件
    找到platform_device *smdk2410_devices[] __initdata
函数,在该函数体最后加上一条语句:
    &s3c_device_nand,
 
    禁用禁止Flash ECC校验(有不同说法)
    修改drivers/mtd/nand/s3c2410.c
    找到chip->eccmode = NAND_ECC_SOFT;
    改为chip->eccmode = NAND_ECC_NONE;
   
    支持启动挂载devfs
    修改fs/Kconfig文件 
    找到menu "Pseudo filesystems" 添加
    config DEVFS_FS
        bool "/dev file system support (OBSOLETE)"
        default y
 
    config DEVFS_MOUNT
        bool "Automatically mount at boot"
        default y
        depends on DEVFS_FS

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9..
  • 12
  • 下一页

相关内容