基于TE2410移植2.6.14
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://mazhijing.blog.51cto.com/215535/40760 |
基于TE2410移植2.6.14
内核移植是一个非常繁琐的工作,本人总结了一些经验希望能给大家提供一些帮助.
大体工作步骤如下:
一. 准备必要的文件
首先去官方网站下载最新的 llinux 内核
因为 linux
二. 安装文件
把 gcc 安装在 /usr/local/arm/
接下来需要解压 linux 内核,输入命令:
[root · localhost hfrk]# tar jxvf linux-
内核被解压到 linux-
三. 修改 makefile 文件
内核的编译是根据 makefile 文件的指示进行的, Makefile 文件来组织内核的各模块之间的关系,记录了各个模块之间的相互联系和依赖关系。
我们首先修改 linux-
#ARCH ?= $(SUBARCH)
#CROSS_COMPILE ?=
增加如下内容:
ARCH : = arm
CROSS_COMPILE =/usr/local/arm/
四. 修改相关的文件。
1. 修改 arch\arm\mach-s
增加头文件定义
/***********add here***********/
#include <linux/mtd/partitions.h>
#include <asm/arch/nand.h>
#include <linux/mtd/nand.h>
/**************end add********/
增加 nand flash 分区信息
/***********add here***********/
static struct mtd_partition partition_info[] ={
{
name: "vivi",
size: 0x00020000,
offset: 0,
}, {
name: "param",
size: 0x00010000,
offset: 0x00020000,
}, {
name: "kernel",
size: 0x
offset: 0x00030000,
}, {
name: "root",
size: 0x00400000,
offset: 0x00200000,
mask_flags: MTD_WRITEABLE,
}, {
name: "usr",
size: 0x
offset: 0x00600000,
}
}; /*这部分很重要,千万要跟vivi里的分区信息相同*/
/*加入NAND FLASH 分区*/
struct s
nr_partitions: 5 ,
partitions: partition_info ,
};
/*建立芯片支持*/
struct s
tacls:0,
twrph0:30,
twrph1:0,
sets: &nandset,
nr_sets: 1,
};
/**************end add********/
struct platform_device s
.name = "s
.id = -1,
.num_resources = ARRAY_SIZE(s
.resource = s
/***********add here****************/
.dev = {
.platform_data = &superlpplatform
}
/**************end here************/
};
2. 修改 arch\arm\mach-s
Startic struct platform_device *smdk2410_devices[] __initdata={
&s
&s
&s
&s
&s
&s
};
3.修改drivers/mtd/nand/s
找到s
chip->ecc.mode = NAND_ECC_NONE;
4. 支持启动时挂载devfs
为了我们的内核支持devfs以及在启动时并在/sbin/init运行之前能自动挂载/dev为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
五. 做完以上修改以后,内核编译以后就可以在te2410 开发板上运行了。
打开终端窗口,切换到 linux-
[root · localhost linux-
[root · localhost linux-
增删的内核配置选项如下:
Loadable module suport--->
System Type--->
Boot options --->Default kernel command string:
noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200
mtdblock3 代表第四个flash分区,为root分区
Floating point emulation---->
#MTD子系统的配置
Device Drivers--->
Memory Technology Devices(MTD)--->
............................................
............................................
NAND Flash Device Drivers--->
................................
<*>NAND Device Support
<*>NAND Flash support foe S
Character devices--->
.............................
File systems--->
<>Second extended fs support #去除ext2支持
Pseudo filesystems--->
Miscellaneous filesystems--->
............................
<*>cramfs
.............................
Network File Systems---->
<*>NFS file system support
[root · localhost linux-
编译完成以后,会生成镜像文件 arch/arm/boot/zImage ,把这个文件下载到开发板上!
六 .修改vivi串口参数
在 2.6 内核中, 2410 的串口由原来的 ttyS0 变为 ttySAC0。启动te2410目标板,进入vivi,在vivi提示符下输入:
vivi>param set linux_cmd_line "noinitrd root=/dev/mtdblock/3 init=/linuxrc console=ttySAC0,115200"
vivi>param save
七.启动信息
welcome
S
VIVI version
lease) [Rebel.com]) #
MMU table base address = 0x33DFC000
Succeed memory mapping.
NAND device: Manufacture ID: 0xec, Chip ID: 0x76 (Samsung K9D1208V
Found saved vivi parameters.
CS8900 - type: 630e, rev: a00
CS8900 - status: ad6 (EEPROM present)
Setting MAC address...
Display format changed to VGA 640X480 mode
Press Return to start the LINUX now, any other key for
Copy linux kernel from 0x00030000 to 0x30008000, size = 0x
zImage magic = 0x
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock/3 init=/linuxrc console=ttySAC0,115200"
MACH_TYPE = 193
NOW, Booting Linux......
Uncompressing Linux...........................................................
....... done, booting the kernel.
Linux version
CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)
Machine: SMDK2410
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S
S
S
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32
Built 1 zonelists
Kernel command line: noinitrd root=/dev/mtdblock/3 init=/linuxrc console=ttySAC0,115200
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 512 (order: 9, 8192 bytes)
timer tcon=00000000, tcnt a
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 64MB = 64MB total
Memory: 62592KB available (1700K code, 379K data, 88K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
softlockup thread 0 started up.
NET: Registered protocol family 16
S
S
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c
NetWinder Floating Point Emulator V0.97 (double precision)
devfs:
devfs: boot_options: 0x1
Console: switching to colour frame buffer device 80x25
fb0: Virtual frame buffer device, using 1024K of video memory
S
s
s
s
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
S
s
s
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 5 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00020000 : "vivi"
0x00020000-0x00030000 : "param
|

