linux移植.doc
文本预览下载声明
Linux2.6.14在s3c2410上的移植
2.6.10以后对s3c2410支持了,不用patch,更改一些文件就可以使用。
2.6.13以后不使用devfs管理/dev,而是使用udev(基于sysfs),移植的时候将2.6.14目录下的fs/Kconfig换成2.6.11的即可。
移植交叉编译器,armlinux-gcc3.4.1。 安装目录为/usr/local/arm/3.4.1
下载内核源代码2.6.14,解压
更改2.6.14根目录下的Makefile
#ARCH ?= $(SUBARCH)
#CROSS_COMPILE ?=
ARCH ?= arm
CROSS_COMPILE ?= /usr/local/arm/3.4.1/bin/arm-linux-
更改nand driver
添加nand的分区信息,这个分区信息中的size和offset要和vivi中的一致,后面将介绍到
先更改arch/arm/mach-s3c2410/devs.c
/***********add here*************/ #include linux/mtd/partitions.h #include asm/arch/nand.h #include linux/mtd/nand.h/***********end add*************/ ... /*****************************add here***************************/ static struct mtd_partition partition_info[] ={ { name: loader, size: 0 offset: 0, }, { name: param, size: 0 offset: 0 }, { name: kernel, size: 0 offset: 0 }, { name: root, size: 0 offset: 0 mask_flags: MTD_WRITEABLE, }, { name: user, size: 0x03bd0000, offset: 0 } }; struct s3c2410_nand_set nandset ={ nr_partitions: 5 , partitions: partition_info , }; struct s3c2410_platform_nand nandplatform={ tacls:0, twrph0:30, twrph1:0, sets: nandset, nr_sets: 1, }; /********************************end add****************************/ struct platform_device s3c_device_nand = { .name = s3c2410-nand, .id = 0xec, .num_resources = ARRAY_SIZE(s3c_nand_resource), .resource = s3c_nand_resource, .dev = { .platform_data = nandplatform //在这添加一项} }; 然后更改arch/arm/mach-s3c2410/mach-smdk2410.c
static struct platform_device *smdk2410_devices[] __initdata = {
s3c_device_usb,
s3c_device_lcd,
s3c_device_wdt,
s3c_device_i2c,
s3c_device_iis,
s3c_device_nand, //在这添加一项
};
最后去掉NAND ECC,这项在启动时会出错,不过不建议使用,会造成nand坏块drivers/mtd/nand/s3c2410.c static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
显示全部