| 嵌入式linux--u-boot移植到2410上面 [message #218557] |
Mi, 28 Juni 2006 06:39 |
|
粗略总结一下u-boot怎么移植到2410上面。
内核:linux2.4.18
硬件环境:s3c2410
nor flash:2M
nand flash:64M
__________________________________
NOR flash启动
首先给予u-boot-1.1.2.tar.bz2
1.在board下
#mkdir s3c2410
#cp ./smdk2410/* ./s3c2410
2.在include/configs/目录下复制smdk2410.h(cp smdk2410.h s3c2410.h)
3.修改makefile
s3c2410_config : unconfig
[at] ./mkconfig $( [at] :_config=) arm arm920t smdk2410 NULL s3c24x0
修改ARM编译器的目录名及前缀
本人ARM编译器的目录是在:/usr/local/arm/2.95.3/bin/arm-linux -
把CROSS-COMPILE = arm-linux- 改为实际目录:如
CROSS-COMPILE =/usr/local/arm/2.95.3/bin/arm-linux-
完成之后,可以测试一下你的配置:
#make s3c2410_config
#make
4.修改processor.h中: //
(/usr/wjc/u-boot/u-boot-1.1.0.3/include/asm-arm/processor.h/ /)
union debug_insn
{
u32 arm;
u16 thumb;
}
修改成:
union debug_insn
{
u32 arm_mode;
u16 thumb_mode
}
6.修改程序连接地址:
在board/s3c2410中有一个config.mk文件,用于设置程序连接的起始 地址,因为会在u-boot中增加功能,所以留下6M的空间,修改33F800 00为33A00000。
7。修改flash.c
按照flash来修改自己的板子
8。按照给定的flash修改/include/s3c2410.h
/
1〉#define CONFIG_CMDLINE_TAG如果没有这个宏,环境变量里定义的参数将无法 传递到kernel
2〉把
/*#define CONFIG_BOOTARGS "root=ramfs devfs=mount console=ttySA0,9600" */
/*#define CONFIG_ETHADDR 08:00:3e:26:0a:5b */
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 10.0.0.110
#define CONFIG_SERVERIP 10.0.0.1
/*#define CONFIG_BOOTFILE "elinos-lart" */
/*#define CONFIG_BOOTCOMMAND "tftp; bootm" */
修改成
(注:板子资料Set boot params = root=/dev/mtdblock2 load_ramdisk=0 init=/linuxrc console=ttyS0 mem=64M devfs=mount)
#define CONFIG_BOOTARGS "root=/dev/mtdblock2 load_ramdisk=0 init=/linuxrc console=ttyS0 mem=64M devfs=mount"
//(传递内核参数的问题)
// (怎么设置的,root代表什么,以后补上)
#define CONFIG_ETHADDR 00:00:c0:ff:ee:08
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 192.168.0.25
#define CONFIG_SERVERIP 192.168.0.24
#define CONFIG_BOOTFILE "uImage"
#define CONFIG_BOOTCOMMAND "tftp; bootm"
3〉把#define CFG_LOAD_ADDR 0x33000000 /* default load address */
改成
#define CFG_LOAD_ADDR 0x30007fc0 /* default load address */
4〉
#if 0
#define CONFIG_AMD_LV800 1 /* uncomment this if you have a LV800 flash */
#endif
#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
#ifdef CONFIG_AMD_LV800
#define PHYS_FLASH_SIZE 0x00100000 /* 1MB */
#define CFG_MAX_FLASH_SECT (19) /* max number of sectors on one chip */
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x0F0000) /* addr of environment */
#endif
#ifdef CONFIG_AMD_LV400
#define PHYS_FLASH_SIZE 0x00080000 /* 512KB */
#define CFG_MAX_FLASH_SECT (11) /* max number of sectors on one chip */
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x070000) /* addr of environment */
#endif
改成
//#if 0
//#define CONFIG_AMD_LV800 1 /* uncomment this if you have a LV800 flash */
//#endif
#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
//#ifdef CONFIG_AMD_LV800
//#define PHYS_FLASH_SIZE 0x00200000 /* 2MB */
//#define CFG_MAX_FLASH_SECT (2) /* max number of sectors on one chip */
//#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x00010000) /* addr of environment */
//#endif
#ifdef CONFIG_AMD_LV400
#define PHYS_FLASH_SIZE 0x00200000 /* 2mB */
#define CFG_MAX_FLASH_SECT (4) /* max number of sectors on one chip */#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x00010000) /* addr of environment */
#endif
(注;查询一下环境变量的地址怎么设置)
把#define CFG_ENV_SIZE 0x10000 /* Total Size of Environment Sector */
改成
把#define CFG_ENV_SIZE 0x40000 /* Total Size of Environment Sector */
9..检查一下MPLLCON寄存器的配置,uboot114smdk2410配置成0x000a 1031,计算出来的Mpll = 202Mhz。我手头上的kernel是按照200Mhz来初始化串口的,所以要修 改成0x0005c040
在./board/s3c2410/smdk2410.c
改写#define FCLK_SPEED 1
#if FCLK_SPEED==0 /* Fout = 203MHz, Fin = 12MHz for Audio */
#define M_MDIV 0xC3
#define M_PDIV 0x4
#define M_SDIV 0x1
#elif FCLK_SPEED==1 /* Fout = 202.8MHz */
#define M_MDIV 0xA1
#define M_PDIV 0x3
#define M_SDIV 0x1
#endif
改成5c40(注:怎么算出来的,以后补上)
(终于知道怎么算出来的了,
)
改成
#elif FCLK_SPEED==1 /* Fout = 200MHz */
#define M_MDIV 0x5C
#define M_PDIV 0x4
#define M_SDIV 0x0
#endif
10./mkimage -A arm -O linux -T kernel -C none -a 0x30007fc0 -e 0x30008000 -n ' linux-2.4.18 ' -d zImage uimage
其中' linux-2.4。18 '随便起名
uImage随便起名
-a 0x30007fc0 -e 0x30008000
这两个地址比较重要
uImage和zImage相比增加了64字节
所以加载的时候
tftp 0x30007fc0 uimage
bootm 0x30007fc0
成功okkokokokpokokoko
搞定了
—————————————————————————
--
[1;36m※ 来源:.天大求实BBS http://bbs.tju.edu.cn [FROM: 60.25.133.110][m
|
|
|
| Re: 嵌入式linux--u-boot移植到2410上面 [message #218763 ] |
Mi, 28 Juni 2006 15:01 |
|
好贴啊
为何不m上?
【 在 benove (benben) 的大作中提到: 】
: 粗略总结一下u-boot怎么移植到2410上面。
: 内核:linux2.4.18
: 硬件环境:s3c2410
: nor flash:2M
: nand flash:64M
: ...................
--
<<Kanon>>重新制作期待中...
http://www.bs-i.co.jp/anime/kanon/
http://ibm.tju.edu.cn/~Rinrin/images/Random.jpg
http://ibm.tju.edu.cn/~Rinrin/images/Kanon.jpg http://ibm.tju.edu.cn/~Rinrin/images/Air.jpg
http://ibm.tju.edu.cn/~Rinrin/images/Planetarian.jpg http://ibm.tju.edu.cn/~Rinrin/images/MemoriesOff-Ayaka_Hizuk i.gif http://ibm.tju.edu.cn/~Rinrin/images/MemoriesOff2nd.jpg
[m[1;36m※ 来源:.天大求实BBS bbs.tju.edu.cn.[FROM: 202.113.13.188][m
|
|
|