设为首页 加入收藏

TOP

TQ2440 Linux 系统移植(一)
2014-11-24 08:14:54 来源: 作者: 【 】 浏览:0
Tags:TQ2440 Linux 系统 移植

一、u-boot基本常用命令
1. 基本环境设置
setenv serverip 192.168.1.115
setenv ipaddr 192.168.1.211
setenv gatewayip 192.168.1.1
setenv ethaddr 1E:23:37:48:5A:6B


setenv bootargs root=/dev/mtdblock2 rootfstype=yaffs init=/linuxrc mem=64M console=ttySAC0,115200


setenv bootcmd nand read 30008000 80000 200000 \; bootm


saveenv


2. 烧写Boot
tftp 30008000 u-boot-tq.bin
nand erase 0 60000
nand write 30008000 0 60000


3. 加载内核
tftp 30008000 zImage.img
bootm


4. 烧写rootfs
(1)如果是256MB的Nand Flash,使用如下命令烧写:
tftp 30008000 root_tq2440.yaffs2
nand erase 480000 FB60000
nand write.yaffs 30008000 480000 $(filesize)


(2)如果是64MB的Nand Flash,使用如下命令烧写:
tftp 30008000 root_tq2440.yaffs2
nand erase 480000 3B60000
nand write.yaffs 30008000 480000 $(filesize)


5. 烧写内核


tftp 30008000 zImage.img
nand erase 80000 400000
nand write 30008000 80000 200000


6. 使用nfs配置:


setenv bootargs root=nfs nfsroot=192.168.1.115:/source/rootfs ip=192.168.1.211 console=ttySAC0,115200 init=/linuxrc mem=64M


二、Linux 2.6.32.10在tq2440开发板上的移植


明确相关板级配置:
(1) CPU -- s3c2440, 外部晶振12M
(2) SDRAM -- 64MB
(3) Nand Flash -- 64MB[K9F1208] 或 256MB[K9F2G08]
(4) 网卡 -- DM9000, 映射在BANK4



0. 外部晶振频率修改
static void __init smdk2440_map_io(void)
{
s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
s3c24xx_init_clocks(16934400);
s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
}


=》


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));
}


1.修改nand flash分区:
arch/arm/plat-s3c24xx/common-smdk.c



(1)如果是256MB的Nand,按如下修改 [256MB -- 0x10000000]


/* NAND parititon from 2.4.18-swl5 */
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "BootLoader",
.size = 0x00060000, /* 3 Blocks -- 384K*/
.offset = 0,
},
[1] = {
.name = "Kernel",
.size = 0x00400000, /* 32 Blocks -- 4MB */
.offset = 0x00080000,
},
[2] = {
.name = "Rootfs",
.size = 0x0FB80000, /* 251MB + 512KB*/
.offset = 0x00480000,
}
};


如果是256MB的Nand,使用uboot擦出分区命令如下:
//Erase Kernel Partition
nand erase 80000 400000


//Erase Rootfs Partition
nand erase 480000 FB80000


(2) 如果是64MB的Nand,按如下修改 [64MB -- 0x4000000]


/* NAND parititon from 2.4.18-swl5 */
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "BootLoader",
.size = 0x00060000, /* 24 Blocks -- 384K*/
.offset = 0,
},
[1] = {
.name = "Kernel",
.size = 0x00400000, /* 256 Blocks -- 4MB */
.offset = 0x00080000,
},
[2] = {
.name = "Rootfs",
.size = 0x03B80000, /* 59MB + 512KB*/
.offset = 0x00480000,
}
};


如果是64MB的Nand,使用uboot擦出分区命令如下:
//Erase Kernel Partition
nand erase 80000 400000


//Erase Rootfs Partition
nand erase 480000 3B80000



2. yaffs2补丁:


./patch-ker.sh c ../linux-2.6.32.10


3. DM9000网络驱动移植
(1)
arch/arm/mach-s3c2440/mach-smdk2440.c
增加


#include


/* DM9000 */
static struct resource s3c_dm9k_resource[] = {
[0] = {
.start = S3C241

首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Android开机画面制作(Bootloader.. 下一篇烧写2410-S Linux 操作系统

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Linux_百度百科 (2025-12-26 12:51:52)
·Shell 流程控制 | 菜 (2025-12-26 12:51:49)
·TCP/UDP协议_百度百科 (2025-12-26 12:20:11)
·什么是TCP和UDP协议 (2025-12-26 12:20:09)
·TCP和UDP详解 (非常 (2025-12-26 12:20:06)