详细的boorloader的移植四
(
6
)
lowlevel_init.S
#define B1_BWSCON
(DW32)
修改为
#define B1_BWSCON
(DW
16
)
#define B5_BWSCON
(DW
16
)
修改为
#define B5_BWSCON
(DW8)
#define REFCNT
1113
/* period=15.6us, HCLK=60Mhz, (2048+1-15.6*60) */
修改为
#define REFCNT
0x4f4/*period=7.8125us,HCLK=100Mhz, (2048+1-7.8125*100) */
二
.
头文件修改
include/configs/tq2440.h
(
1
)
cp include/configs/smdk2410.h include/configs/tq2440.h
(
2
)
增加宏定义:
#define CONFIG_DRIVER_DM9000
1
#define CONFIG_DM9000_BASE
0x20000300
#define DM9000_IO
CONFIG_DM9000_BASE
#define DM9000_DATA
(CONFIG_DM9000_BASE + 4)
#define CONFIG_DM9000_USE_16BIT
#define CONFIG_SETUP_MEMORY_TAGS 1
#define CONFIG_CMDLINE_TAG 1
(
3
)
#define CONFIG_COMMANDS \
中增加如下三项:
CFG_CMD_PING | \
CFG_CMD_JFFS2 | \
CFG_CMD_NAND
| \
(
4
)修改网络相关参数:
#define CONFIG_BOOTDELAY
1
#define CONFIG_BOOTARGS
"noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
#define CONFIG_ETHADDR
0a:1b:2c:3d:4e:5f
#define CONFIG_NETMASK
255.255.255.0
#define CONFIG_IPADDR
192.168.1.6
#define CONFIG_SERVERIP
192.168.1.8
(
5
)
#define CONFIG_AMD_LV400
1
/* uncomment this if you have a LV400 flash */
#if 0
#define CONFIG_AMD_LV800
1
/* uncomment this if you have a LV800 flash */
#endif
修改为:
#if 0
#define CONFIG_AMD_LV400
1
/* uncomment this if you have a LV400 flash */
#endif
#define CONFIG_AMD_LV800
1
/* uncomment this if you have a LV800 flash */
(
6
) 在最后
#endif
/* __CONFIG_H */
前增加
NAND
相关宏定义:
#define CFG_NAND_BASE 0
#define CFG_MAX_NAND_DEVICE 1
#define NAND_MAX_CHIPS 1
三
.
修改cpu/arm920t/
start.S
(1)
#elif defined(CONFIG_S3C2410)
后添加:
# define INTMOD 0X4A000004
(2)将
/* FCLK:HCLK:PCLK = 1:2:4 */
/* default FCLK is 120 MHz ! */
ldr
r0, =CLKDIVN
mov
r1, #3
str
r1, [r0]
修改为:
#if 0
/* FCLK:HCLK:PCLK = 1:2:4 */
/* default FCLK is 120 MHz ! */
ldr
r0, =CLKDIVN
mov
r1, #3
str
r1, [r0]
#endif
(3) 在
bl
cpu_init_crit
#endif
后面加上
/* Set up the stack
*/
stack_setup:
ldr
r0, _TEXT_BASE
/* upper 128 KiB: relocated uboot */
sub
r0, r0, #CFG_MALLOC_LEN
/* malloc area */
sub
r0, r0, #CFG_GBL_DATA_SIZE /* bdinfo */
sub
sp, r0, #12
/* leave 3 words for abort-stack */
bl clock_init
(4) 将下列代码替换
#ifndef CONFIG_SKIP_RELOCATE_UBOOT
relocate:
/* relocate U-Boot to RAM
*/
adr
r0, _start
/* r0 <- current position of code */
ldr
r1, _TEXT_BASE
/* test if we run from flash or RAM */
cmp r0, r1 /* don't reloc during debug */
beq stack_setup
ldr
r2, _armboot_start
ldr
r3, _bss_start
sub
r2, r3, r2
/* r2 <- size of armboot */
add
r2, r0, r2
/* r2 <- source end address */
copy_loop:
ldmia
r0!, {r3-r10}
/* copy from source address [r0] */
stmia
r1!, {r3-r10}
/* copy to target address [r1] */
cmp
r0, r2
/* until source end addreee [r2] */
ble
copy_loop
#endif
/* CONFIG_SKIP_RELOCATE_UBOOT */
/* Set up the stack
*/
stack_setup:
ldr
r0, _TEXT_BASE
/* upper 128 KiB: relocated uboot */
sub
r0, r0, #CFG_MALLOC_LEN
/* malloc area */
sub
r0, r0, #CFG_GBL_DATA_SIZE /* bdinfo */
#ifdef CONFIG_USE_IRQ
sub
r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
|