Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1371454
  • 博文数量: 244
  • 博客积分: 10311
  • 博客等级: 上将
  • 技术积分: 3341
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-14 21:50
文章分类

全部博文(244)

文章存档

2013年(6)

2012年(5)

2011年(16)

2010年(11)

2009年(172)

2008年(34)

分类: LINUX

2009-05-14 11:30:51

 
将该内核移植到S3C2440平台上,下面是我们移植的第一步:
编译内核:
1) 解压内核,当前目录为/new_disk/weiyan/
tar jxf /new_disk/weiyan/linux-2.6.25.tar.bz2
cd linux-2.6.25
2) 修改体系架构并指定交叉编译器
vi Makefile ,将193行和194行的
#ARCH            ?= $(SUBARCH)
#CROSS_COMPILE   ?=
修改为
ARCH            ?= arm
CROSS_COMPILE   ?= arm-linux- #最后有“—”,Makefile会调用arm-linux-gcc
3) 载入默认配置
make s3c2410_defconfig
make menuconfig
按Esc键保存退出。
4) 添加生成U-Boot镜像的工具
cp /new_disk/weiyan/mkimage ./
vi scripts/mkuboot.sh ,将
MKIMAGE=$(type -path "${CROSS_COMPILE}mkimage")
修改为MKIMAGE=$PWD/mkimage
vi arch/arm/mach-s3c2440/mach-smdk2440.c
5) 添加nand划分信息
static struct mtd_partition wy_nand_part[] = {
        [0] = { //u-boot及内存存放的分区
                .name   = "BOOT",
                .size   = SZ_2M,
                .offset = 0,
        },
        [1] = { //文件系统存放的分区
                .name   = "ROOTFS",
                .offset = SZ_2M,
                .size   = SZ_32M,
        },
        [2] = { //剩余空间
                .name   = "BACKUP",
                .offset = SZ_32M + SZ_2M,
                .size   = SZ_32M - SZ_2M,
        },
};
static struct s3c2410_nand_set wy_nand_sets[] = {
        [0] = {
                .name        = "NAND",
                .nr_chips     = 1,
                .nr_partitions  = ARRAY_SIZE(wy_nand_part),
6) 添加nand flash的读写匹配时间,各时间定义如图
static struct s3c2410_platform_nand wy_nand_info = {
        .tacls          = 10,
        .twrph0         = 25,
        .twrph1         = 10,
        .nr_sets        = ARRAY_SIZE(wy_nand_sets),
        .sets           = wy_nand_sets,
};
                .partitions     = wy_nand_part,
        },
};
7) 添加支持硬件校验:
   
make menuconfig
Device Drivers  --->
<*> Memory Technology Device (MTD) support  --->
<*>   NAND Device Support  --->
[*]     S3C2410 NAND Hardware ECC
8) 编译并拷贝到tftp下载目录
make uImage && cp arch/arm/boot/uImage /new_disk/tftp
 
……
Image Name:   Linux-2.6.25
Created:      Mon Apr  7 13:50:19 2008
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    1591184 Bytes = 1553.89 kB = 1.52 MB
Load Address: 0x30008000
Entry Point:  0x30008000
  Image arch/arm/boot/uImage is ready
启动新内核:
dm9000 i/o: 0x18000300, id: 0x90000a46
MAC: 00:0c:20:02:0a:5b
TFTP from server 192.168.1.5; our IP address is 192.168.1.6
Filename 'uImage'.
Load address: 0x31000000
Loading: #################################################################
         #############################################
done
Bytes transferred = 1591268 (1847e4 hex)
## Booting image at 31000000 ...
   Image Name:   Linux-2.6.25
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1591204 Bytes =  1.5 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
OK
Starting kernel ...
Uncompressing Linux....................................................................................................... done, booting the kernel.
Linux version 2.6.25 () (gcc version 3.4.1) #4 Mon Apr 21 04:28:37 CST 2008
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SMDK2440
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C244X: core 406.425 MHz, memory 135.475 MHz, peripheral 67.737 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (2.116 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 byte lines, 8 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: root=/dev/mtdblock1 rootfstype=jffs2 console=ttySAC0 ip=192.168.1.6:192.168.1.5:192.168.1.5:255.255.255.0:WEIYAN:eth0:off
…….
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=2, 14ns Twrph0=4 29ns, Twrph1=2 14ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00200000 : "BOOT"
0x00200000-0x02200000 : "ROOTFS"
0x02200000-0x04000000 : "BACKUP"
……
Empty flash at 0x0096200c ends at 0x00962200
Empty flash at 0x01470628 ends at 0x01470800
jffs2_scan_eraseblock(): Node at 0x01470dfc {0x1985, 0xe001, 0xe0021985) has invalid CRC 0x00000044 (calculated 0x515918d5)
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 140K
JFFS2 notice: (775) check_node_data: wrong data CRC in data node at 0x01470578: read 0x5cc80399, calculated 0x36a47240.
init started: BusyBox v1.9.1 (2008-04-19 19:49:32 CST)
starting pid 777, tty '': '/etc/init.d/rcS'
starting initial script, WEIYAN
Please press Enter to activate this console.
starting pid 795, tty '': '/bin/sh'
[root@WEIYAN /]$ ls
bin      etc      linuxrc  opt      sbin     tmp      var
dev      lib      mnt      proc     sys      usr
[root@WEIYAN /]$
 
阅读(1733) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

newcch2009-06-17 23:03:56

转载只是参考,动手才是重要的/成不成功是调试的结果,写得再清楚,你按步就班不一定行. 欢迎各路朋友一起进步!

chinaunix网友2009-06-17 17:20:43

你又确确实实照此步骤移成功么,还是转载的吧