您的位置:首页 > 运维架构 > Linux

Linux-2.6.30内核在TE2410上的移植

2010-11-28 23:07 369 查看
Linux-2.6.30内核在TE2410上的移植

在网上看到linux.2.6.30内核的socket的时间戳比较好,数据包的接收和发送都加盖了时间戳,而以后的版本,只有数据包的接收才会加盖时间戳,而且还支持硬件时间戳!这以后会用到,所以开始先把linux2.6.30移植好!

硬件是:TE2410
软件环境:UBUNTU 10.14
arm-linux-gcc 4.3.2

先下载一个linux.2.6.30内核源码

一、先修改Makefile

ARCH ?= $(SUBARCH)

CROSS_COMPILE ?=

改为:

ARCH ?= arm

CROSS_COMPILE ?=/usr/local/arm/4.3.2/bin/arm-linux-

二、修改分区
根据vivi里的分区信息修改文件:
~/arch/arm/plat-s3c24xx/common-smdk.c

修改1
static struct mtd_partition smdk_default_nand_part[] = {

[0] = {

.name = "vivi",

.size = 0x00020000,

.offset = 0,

},

[1] = {

.name = "param",

.offset = 0x00020000,

.size = 0x00010000,

},

[2] = {

.name = "kernel",

.offset = 0x00030000,

.size = 0x001c0000,

},

[3] = {

.name = "root",

.offset = 0x00200000,

.size = 0x00400000,

},

[4] = {

.name = "user",

.offset = 0x00600000,

.size = 0x03a00000,

}

};

修改2
static struct s3c2410_platform_nand smdk_nand_info = {

.tacls = 0, //default is 20

.twrph0 = 30, //default is 60

.twrph1 = 0, //default is 20

.nr_sets = ARRAY_SIZE(smdk_nand_sets),

.sets = smdk_nand_sets,

};

修改3
static struct platform_device __initdata *smdk_devs[] = {

&s3c_device_nand,

&smdk_led4,

&smdk_led5,

&smdk_led6,

&smdk_led7,

};

三、修改时钟频率
修改文件
~/arch/arm/mach-s3c2410/mach-smdk2410.c

static void __init smdk2410_map_io(void)

{

s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));

s3c24xx_init_clocks(12000000);

s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));

}

四、修改ECC (是否必要呢? 我还没确定)
修改~/drivers/mtd/nand/s3c2410.c
在这个 static void s3c2410_nand_init_chip()函数中

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

}

if (set->ecc_layout != NULL)

chip->ecc.layout = set->ecc_layout;

if (set->disable_ecc)

chip->ecc.mode = NAND_ECC_NONE;

要修改的文件就这四个,其它的要通过配置内核来完成的

五、、
然后用S3C2410的默认配置文件
命令:

#make s3c2410_defconfig

六、
#make menuconfig

1.system type ->
ARM system type (Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443) ---> │ │

│ │ [*] PWM device support │ │

│ │ [*] S3C2410 DMA support │ │

│ │ [ ] S3C2410 DMA support debug │ │

│ │ [*] ADC common driver support │ │

│ │ *** Boot options *** │ │

│ │ [ ] S3C Initialisation watchdog │ │

│ │ [*] S3C Reboot on decompression error │ │

│ │ [*] Force UART FIFO on during boot process │ │

│ │ *** Power management *** │ │

│ │ [ ] S3C2410 PM Suspend debug │ │

│ │ [ ] S3C2410 PM Suspend Memory CRC │ │

│ │ (0) S3C UART to use for low-level messages │ │

│ │ (0) Space between gpio banks
S3C2400 Machines ---> │ │

│ │ S3C2410 Machines ---> │ │

│ │ S3C2412 Machines ---> │ │

│ │ S3C2440 Machines ---> │ │

│ │ S3C2442 Machines ---> │ │

│ │ S3C2443 Machines --->

最后那几个Machines 除了S3C2410 Machines用默认的选择外,其余的Machines 全部不要选

File system->
<*> Second extended fs support │ │

│ │ [*] Ext2 extended attributes │ │

│ │ [*] Ext2 POSIX Access Control Lists │ │

│ │ [*] Ext2 Security Labels │ │

│ │ [ ] Ext2 execute in place support │ │

│ │ <*> Ext3 journalling file system support │ │

│ │ [ ] Default to 'data=ordered' in ext3 (legacy option) │ │

│ │ [*] Ext3 extended attributes │ │

│ │ [*] Ext3 POSIX Access Control Lists │ │

│ │ [ ] Ext3 Security Labels │ │

│ │ < > The Extended 4 (ext4) filesystem │ │

│ │ < > Reiserfs support │ │

│ │ < > JFS filesystem support │ │

│ │ < > XFS filesystem support │ │

│ │ < > OCFS2 file system support │ │

│ │ < > Btrfs filesystem (EXPERIMENTAL) Unstable disk format │ │

│ │ [*] Dnotify support │ │

│ │ [*] Inotify file change notification support │ │

│ │ [*] Inotify support for userspace │ │

│ │ [ ] Quota support │ │

│ │ <M> Kernel automounter support │ │

│ │ <M> Kernel automounter version 4 support (also supports v3) │ │

│ │ <M> FUSE (Filesystem in Userspace) support │ │

│ │ Caches ---> │ │

│ │ CD-ROM/DVD Filesystems --->

--- Miscellaneous filesystems │ │

│ │ < > ADFS file system support (EXPERIMENTAL) │ │

│ │ < > Amiga FFS file system support (EXPERIMENTAL) │ │

│ │ < > Apple Macintosh file system support (EXPERIMENTAL) │ │

│ │ < > Apple Extended HFS file system support │ │

│ │ < > BeOS file system (BeFS) support (read only) (EXPERIMENTAL) │ │

│ │ < > BFS file system support (EXPERIMENTAL) │ │

│ │ < > EFS file system support (read only) (EXPERIMENTAL) │ │

│ │ < > YAFFS2 file system support │ │

│ │ < > Journalling Flash File System v2 (JFFS2) support │ │

│ │ <*> Compressed ROM file system support (cramfs) │ │

│ │ < > SquashFS 4.0 - Squashed file system support │ │

│ │ < > FreeVxFS file system support (VERITAS VxFS(TM) compatible) │ │

│ │ < > Minix file system support │ │

│ │ < > SonicBlue Optimized MPEG File System support │ │

│ │ < > OS/2 HPFS file system support │ │

│ │ < > QNX4 file system support (read only) │ │

│ │ <*> ROM file system support │ │

│ │ RomFS backing stores (Block device-backed ROM file system support) ---> │ │

│ │ < > System V/Xenix/V7/Coherent file system support │ │

│ │ < > UFS file system support (read only) │ │

│ │ < > NILFS2 file system support (EXPERIMENTAL)

--- Network File Systems │ │

│ │ <*> NFS client support │ │

│ │ [*] NFS client support for NFS version 3 │ │

│ │ [*] NFS client support for the NFSv3 ACL protocol extension │ │

│ │ [ ] NFS client support for NFS version 4 (EXPERIMENTAL) │ │

│ │ [ ] Root file system on NFS │ │

│ │ < > NFS server support │ │

│ │ <M> Secure RPC: Kerberos V mechanism (EXPERIMENTAL) │ │

│ │ < > Secure RPC: SPKM3 mechanism (EXPERIMENTAL) │ │

│ │ < > SMB file system support (OBSOLETE, please use CIFS) │ │

│ │ < > CIFS support (advanced network filesystem, SMBFS successor) │ │

│ │ < > NCP file system support (to mount NetWare volumes) │ │

│ │ < > Coda file system support (advanced network fs) │ │

│ │ < > Andrew File System support (AFS) (EXPERIMENTAL) │ │

│ │ │ │

│ │

--- Memory Technology Device (MTD) support │ │

│ │ [ ] Debugging │ │

│ │ < > MTD concatenating support │ │

│ │ [*] MTD partitioning support │ │

│ │ < > MTD tests support │ │

│ │ <*> RedBoot partition table parsing │ │

│ │ (-1) Location of RedBoot partition table │ │

│ │ [*] Include unallocated flash regions │ │

│ │ [ ] Force read-only for RedBoot system images │ │

│ │ [*] Command line partition table parsing │ │

│ │ < > ARM Firmware Suite partition parsing │ │

│ │ < > TI AR7 partitioning support │ │

│ │ *** User Modules And Translation Layers *** │ │

│ │ <*> Direct char device access to MTD devices │ │

│ │ -*- Common interface to block layer for MTD 'translation layers' │ │

│ │ <*> Caching block device access to MTD devices │ │

│ │ < > FTL (Flash Translation Layer) support │ │

│ │ < > NFTL (NAND Flash Translation Layer) support │ │

│ │ < > INFTL (Inverse NAND Flash Translation Layer) support │ │

│ │ < > Resident Flash Disk (Flash Translation Layer) support │ │

│ │ < > NAND SSFDC (SmartMedia) read only translation layer │ │

│ │ < > Log panic/oops to an MTD buffer │ │

│ │ RAM/ROM/Flash chip drivers ---> │ │

│ │ Mapping drivers for chip access ---> │ │

│ │ Self-contained MTD device drivers --->
<*> NAND Device Support ---> │ │

│ │ < > OneNAND Device Support ---> │ │

│ │ LPDDR flash memory drivers ---> │ │

│ │ UBI - Unsorted block images ---

--- NAND Device Support │ │

│ │ [ ] Verify NAND page writes │ │

│ │ [ ] NAND ECC Smart Media byte order │ │

│ │ [ ] Enable chip ids for obsolete ancient NAND devices │ │

│ │ < > GPIO NAND Flash driver │ │

│ │ <*> NAND Flash support for S3C2410/S3C2440 SoC │ │

│ │ [ ] S3C2410 NAND driver debug │ │

│ │ [ ] S3C2410 NAND Hardware ECC │ │

│ │ [ ] S3C2410 NAND IDLE clock stop │ │

│ │ < > DiskOnChip 2000, Millennium and Millennium Plus (NAND reimplementation) (EXPERIMENTAL)│ │

│ │ < > Support for NAND Flash Simulator │ │

│ │ < > Support for generic platform NAND driver │ │

│ │ │ │

│ │

2. boot Options
│ │noinitrd init=/linuxrc root=/dev/mtdblock3 console=ttySAC0,115200

3.
对于其它的驱动和文件系统能不要的尽量不要(如:USB,RTC,CS8900,DM900,LCD,ATA),
要点就是先把Linux启动起来,以后再慢慢添加其它要用到的东西,千万不要急于求成,一下子把很多模块
一并加进来,这样找错非常难。

我就是把网络驱动全部去掉,文件系统也全部去掉,只留下Cramfs 文件系统支持,还有一些看着没用的驱动一并不要了,主要是减小内核,内核过大也会造成很多问题的,总之就是越简单越好。

如果途中有错,认真看一下错的模块,然后通过

make menuconfig 将出错的模块暂时不要,这样一步一步的消除错误!

七、

make zImage

下载内核, 大功造成:

S3C2410 DEVELOP KIT

VIVI version 0.1.4 (root@localhost.localdomain) (gcc version 2.95.2 20000516 (release

) [Rebel.com]) #0.1.4 �� 12�� 24 13:09:55 CST 2006

MMU table base address = 0x33DFC000

Succeed memory mapping.

NAND device: Manufacture ID: 0xec, Chip ID: 0x76 (Samsung K9D1208V0M)

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 vivi

Copy linux kernel from 0x00030000 to 0x30008000, size = 0x001c0000 ... done

zImage magic = 0x016f2818

Setup linux parameters at 0x30000100

linux command line is: "noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,11

5200"

MACH_TYPE = 193

NOW, Booting Linux......

Uncompressing Linux..................................................................

............................ done, booting the kernel.

Linux version 2.6.30 (eleday@eleday-desktop) (gcc version 4.3.2 (Sourcery G++ Lite 20

08q3-72) ) #11 Sun Nov 28 22:55:19 CST 2010

CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177

CPU: VIVT data cache, VIVT instruction cache

Machine: SMDK2410

ATAG_INITRD is deprecated; please update your bootloader.

Memory policy: ECC disabled, Data cache writeback

CPU S3C2410A (id 0x32410002)

S3C24XX Clocks, (c) 2004 Simtec Electronics

S3C2410: core 200.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz

CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on

Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256

Kernel command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,11520

0

NR_IRQS:85

irq: clearing subpending status 00000003

irq: clearing subpending status 00000002

PID hash table entries: 256 (order: 8, 1024 bytes)

Console: colour dummy device 80x30

console [ttySAC0] enabled

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory: 64MB = 64MB total

Memory: 61804KB available (2584K code, 278K data, 108K init, 0K highmem)

Calibrating delay loop... 99.73 BogoMIPS (lpj=249344)

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

net_namespace: 724 bytes

NET: Registered protocol family 16

S3C Power Management, Copyright 2004 Simtec Electronics

S3C2410: Initialising architecture

S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics

DMA channel 0 at c4808000, irq 33

DMA channel 1 at c4808040, irq 34

DMA channel 2 at c4808080, irq 35

DMA channel 3 at c48080c0, irq 36

bio: create slab <bio-0> at 0

s3c2410-i2c s3c2410-i2c: slave address 0x10

s3c2410-i2c s3c2410-i2c: bus frequency set to 97 KHz

s3c2410-i2c s3c2410-i2c: i2c-0: S3C I2C adapter

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

NET: Registered protocol family 1

NetWinder Floating Point Emulator V0.97 (extended precision)

ROMFS MTD (C) 2007 Red Hat, Inc.

msgmni has been set to 120

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler deadline registered

io scheduler cfq registered

s3c2410-lcd s3c2410-lcd: no platform data for lcd, cannot attach

s3c2410-lcd: probe of s3c2410-lcd failed with error -22

Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled

s3c2410-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410

s3c2410-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410

s3c2410-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410

brd: module loaded

eth0 (): not using net_device_ops yet

Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)

eth0: CS8900A rev E at 0xe0000300 irq=53, addr: 00: 2:3E:28:0A: 0

S3C24XX NAND Driver, (c) 2004 Simtec Electronics

s3c2410-nand s3c2410-nand: Tacls=1, 10ns Twrph0=4 40ns, Twrph1=1 10ns

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

Bad eraseblock 385 at 0x000000604000

Bad eraseblock 3840 at 0x000003c00000

Bad eraseblock 3848 at 0x000003c20000

Bad eraseblock 3857 at 0x000003c44000

Bad eraseblock 4052 at 0x000003f50000

Creating 5 MTD partitions on "NAND 64MiB 3,3V 8-bit":

0x000000000000-0x000000020000 : "vivi"

0x000000020000-0x000000030000 : "param"

0x000000030000-0x0000001f0000 : "kernel"

0x000000200000-0x000000600000 : "root"

0x000000600000-0x000004000000 : "user"

mice: PS/2 mouse device common for all mice

S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics

s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled

TCP cubic registered

NET: Registered protocol family 17

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

VFS: Mounted root (cramfs filesystem) readonly on device 31:3.

Freeing init memory: 108K

Please press Enter to activate this console.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: