移植最新uboot的总结
s3c2440_hwcontrol
chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);
*maf_id = chip->read_byte(mtd);
*dev_id = chip->read_byte(mtd);
3.8 修改UBOOT支持DM9000网卡
eth_initialize
board_eth_init
cs8900_initialize
*** ERROR: `ethaddr not set
set ipaddr 192.168.1.17
set ethaddr 00:0c:29:4d:e4:f4
set serverip 192.168.1.3
4. 易用性修裁剪及制作补丁
内核打印出来的分区信息
0x00000000-0x00040000 : "bootloader"
0x00040000-0x00060000 : "params"
0x00060000-0x00260000 : "kernel"
0x00260000-0x10000000 : "root"
nand erase 60000 200000
nand write 30000000 60000 200000
tftp 30000000 uImage
nand erase.part kernel
nand write 30000000 kernel
烧写JFFS2
tftp 30000000 fs_mini_mdev.jffs2
nand erase.part rootfs
nand write.jffs2 30000000 0x00260000 5b89a8
set bootargs console=ttySAC0,115200 root=/dev/mtdblock3 rootfstype=jffs2
烧写YAFFS
tftp 30000000 fs_mini_mdev.yaffs2
nand erase.part rootfs
nand write.yaffs 30000000 260000
更新UBOOT:
tftp 30000000 u-boot_new.bin; protect off all; erase 0 3ffff; cp.b 30000000 0 40000
制作补丁:
diff -urN u-boot-2012.04.01 u-boot-2012.04.01_100ask > u-boot-2012.04.01_100ask.patch
分析"重定位之修改代码为新地址":
#ifndef CONFIG_SPL_BUILD
ldr r0, _TEXT_BASE
// r0=0, 代码基地址
sub r9, r6, r0
// r9 = r6-r0 = 0x33f41000 - 0 = 0x33f41000
ldr r10, _dynsym_start_ofs
// r10 = 00073608
add r10, r10, r0
// r10 = 00073608 + 0 = 00073608
ldr r2, _rel_dyn_start_ofs
// r2=0006b568
add r2, r2, r0
// r2=r2+r0=0006b568
ldr r3, _rel_dyn_end_ofs
// r3=00073608
add r3, r3, r0
// r3=r3+r0=00073608
fixloop:
ldr r0, [r2]
1. r0=[0006b568]=00000020
add r0, r0, r9
1. r0=r0+r9=00000020 + 0x33f41000 = 0x33f41020
ldr r1, [r2, #4]
1. r1=[0006b568+4]=00000017
and r7, r1, #0xff
1. r7=r1&0xff=00000017
cmp r7, #23
1. r7 == 23(0x17)
beq fixrel
cmp r7, #2
beq fixabs
b fixnext
fixabs:
mov r1, r1, LSR #4
add r1, r10, r1
ldr r1, [r1, #4]
add r1, r1, r9
b fixnext
fixrel:
ldr r1, [r0]
1. r1=[00000020]=000001e0
add r1, r1, r9
1. r1=r1+r9=000001e0 + 0x33f41000 = 33F411E0
fixnext:
str r1, [r0]
1. [0x33f41020] = 33F411E0
add r2, r2, #8
1. r2=r2+8=0006b568+8=6B570
cmp r2, r3
1.
blo fixloop
#endif
移植uboo 相关文章:
- minis3c2440移植之uboot移植(11-24)
- 移植uboot2010.09到S3C2440二(11-20)
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)