linux-2.6.14移植到S3C2440
嵌入式开发交流群2:289195589,欢迎加入!
现在应该很少使用2.6.14的内核了,但由于项目需要,最近移植了2.6.版本的内核到S3C2440上,并移植了CS8900网卡驱动(网卡驱动移植参考http://blog.csdn.net/ce123/article/details/8424399)。之所以移植网卡驱动,是因为yaffs2格式的文件系统一直挂载不成功,启动后的错误信息如下:
ARCH ?= arm CROSS_COMPILE ?= arm-linux-交叉编译器的使用请参考 http://blog.csdn.net/ce123/article/details/8333421
static void __init smdk2440_map_io(void) { s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc)); s3c24xx_init_clocks(12000000);//12M s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs)); s3c24xx_set_board(&smdk2440_board); }
#include <linux/mtd/partitions.h> #include <linux/mtd/nand.h> #include <asm/arch/nand.h> /* NAND parititon */ static struct mtd_partition smdk_default_nand_part[] = { [0]= { .name = "Board_uboot", .offset = 0x00000000, .size = 0x00080000, }, [1]= { .name = "Board_kernel", .offset= 0x00240000, .size = 0x00200000, }, [2]= { .name = "Board_yaffs2", .offset= 0x00440000, .size = 0x0FB40000, } };name:代表分区名字
static struct s3c2410_nand_set smdk_nand_sets[] = { [0] = { .name = "NAND", .nr_chips = 1, .nr_partitions = ARRAY_SIZE(smdk_default_nand_part), .partitions = smdk_default_nand_part, }, };nr_partitions: 指明partition_info中定义的分区数目
static struct s3c2410_platform_nand smdk_nand_info = { .tacls = 20, .twrph0 = 60, .twrph1 = 20, .nr_sets = ARRAY_SIZE(smdk_nand_sets), .sets = smdk_nand_sets, };tacls,twrph0,twrph1的意思见S3C2440的数据手册,这3个值最后会被设置到NFCONF中。
struct platform_device s3c_device_nand = { .name = "s3c2410-nand", .id = -1, .num_resources = ARRAY_SIZE(s3c_nand_resource), .resource = s3c_nand_resource, .dev = { .platform_data = &smdk_nand_info } };
static struct platform_device *smdk2440_devices[] __initdata = { &s3c_device_usb, &s3c_device_lcd, &s3c_device_wdt, &s3c_device_i2c, &s3c_device_iis, &s3c_device_nand,//增加 };
chip->eccmode = NAND_ECC_NONE;
config DEVFS_FS bool "/dev file system support (OBSOLETE)" depends on EXPERIMENTAL help This is support for devfs, a virtual file system (like /proc) which provides the file system interface to device drivers, normally found in /dev. Devfs does not depend on major and minor number allocations. Device drivers register entries in /dev which then appear automatically, which means that the system administrator does not have to create character and block special device files in the /dev directory using the mknod command (or MAKEDEV script) anymore. This is work in progress. If you want to use this, you *must* read the material in <file:Documentation/filesystems/devfs/>, especially the file README there. Note that devfs no longer manages /dev/pts! If you are using UNIX98 ptys, you will also need to mount the /dev/pts filesystem (devpts). Note that devfs has been obsoleted by udev, <http://www.kernel.org/pub/linux/utils/kernel/hotplug/>. It has been stripped down to a bare minimum and is only provided for legacy installations that use its naming scheme which is unfortunately different from the names normal Linux installations use. If unsure, say N. config DEVFS_MOUNT bool "Automatically mount at boot" depends on DEVFS_FS help This option appears if you have CONFIG_DEVFS_FS enabled. Setting this to 'Y' will make the kernel automatically mount devfs onto /dev when the system is booted, before the init thread is started. You can override this with the "devfs=nomount" boot option. If unsure, say N. config DEVFS_DEBUG bool "Debug devfs" depends on DEVFS_FS help If you say Y here, then the /dev file system code will generate debugging messages. See the file <file:Documentation/filesystems/devfs/boot-options> for more details. If unsure, say N. config DEVPTS_FS_XATTR bool "/dev/pts Extended Attributes" depends on UNIX98_PTYS help Extended attributes are name:value pairs associated with inodes by the kernel or by users (see the attr(5) manual page, or visit <http://acl.bestbits.at/> for details). If unsure, say N. config DEVPTS_FS_SECURITY bool "/dev/pts Security Labels" depends on DEVPTS_FS_XATTR help Security labels support alternative access control models implemented by security modules like SELinux. This option enables an extended attribute handler for file security labels in the /dev/pts filesystem. If you are not using a security module that requires using extended attributes for file security labels, say N. config TMPFS bool "Virtual memory file system support (former shm fs)" help Tmpfs is a file system which keeps all files in virtual memory. Everything in tmpfs is temporary in the sense that no files will be created on your hard drive. The files live in memory and swap space. If you unmount a tmpfs instance, everything stored therein is lost. See <file:Documentation/filesystems/tmpfs.txt> for details.