Tuesday, September 2, 2008

Porting linux 2.6.26.3 to S3C2440

1. 修改NAND FLASH分区信息. 保持和bootloader的配置一致。arch/arm/plat_s3c24xx/common-smdk.c:

smdk_default_nand_part[] = {
...
}

2. 修改NAND FLASH的物理特性。

2.1 In arch/arm/plat_s3c24xx/common-smdk.c , change the the code as following:

smdk_nand_info = {
.tacls = 0, // default 20,
.twrph0 = 30, // default 60
.twrph1 = 0, // defualt 20
}

2.2 Disable NAND FLASH ECC check. Enable的话,kernel启动会出现错误,原因未知。drivers/mtd/nand/s3c2410.c, line:673,

chip->ecc.mode = NAND_ECC_NONE; // default NAND_ECC_SOFT;


3. Modify the clock parameter. In file arch/arm/mach-s3c2440/mach-smdk2440.c, modifiy it as below:

s3c24xx_init_clocks(12000000); //default is 16934400, changed by xiao

4. Build the 2.6.26.3 kernel.

4.1 在Makefile中,修改 "ARCH=arm",然后根据自己的环境配置"CROSS_COMPILE";

4.2 Build zImage.

make menuconfig
make zImage

5. Create rootfs.
5.1 build the busybox, make sure mdev support is enabled.
#make menuconfig
#make install
#arm-linux-readelf -a ./busybox grep "Shared library"
copy the share lib to the $install/lib

5.2 配置udev.
#mkdir $install/dev
cd dev
mknod -m 600 console c 5 1
mknod -m 666 null c 1 3

编辑文件/etc/init.d/rcS
mkdir /dev/pts
mount -t devpts devpts /dev/pts

mkdir /dev/shm
mount -t tmpfs tmpfs /dev/shm

echo /bin/mdev > /proc/sys/kernel/hotplug
mdev -s

使用udev的缺省配置就可以了,所以没有必要修改/etc/udev.conf文件

配置完成

No comments: