硬件平台:tq2440
开发环境:Ubuntu-3.11
u-boot版本:2014.10
本文允许转载,请注明出处:http://blog.csdn.net/fulinus
TQ2440 # flinfo Bank # 1: EON EN29LV160AB flash (16 x 16) Size: 2 MB in 35 Sectors AMD Legacy command set, Manufacturer ID: 0x1C, Device ID: 0x2249 Erase timeout: 30000 ms, write timeout: 100 ms Sector Start Addresses: 00000000 RO 00004000 RO 00006000 RO 00008000 RO 00010000 RO 00020000 RO 00030000 00040000 00050000 00060000 00070000 RO 00080000 00090000 000A0000 000B0000 000C0000 000D0000 000E0000 000F0000 00100000 00110000 00120000 00130000 00140000 00150000 00160000 00170000 00180000 00190000 001A0000 001B0000 001C0000 001D0000 001E0000 001F0000带有RO标识的块使能了写保护,是u-boot自己给这些块写保护的。通过下面的命令将所有的块解保护,不过重启又会有:
TQ2440 # protect off all Un-Protect Flash Bank # 1 TQ2440 # flinfo Bank # 1: EON EN29LV160AB flash (16 x 16) Size: 2 MB in 35 Sectors AMD Legacy command set, Manufacturer ID: 0x1C, Device ID: 0x2249 Erase timeout: 30000 ms, write timeout: 100 ms Sector Start Addresses: 00000000 00004000 00006000 00008000 00010000 00020000 00030000 00040000 00050000 00060000 00070000 00080000 00090000 000A0000 000B0000 000C0000 000D0000 000E0000 000F0000 00100000 00110000 00120000 00130000 00140000 00150000 00160000 00170000 00180000 00190000 001A0000 001B0000 001C0000 001D0000 001E0000 001F0000 TQ2440 #
TQ2440 # cp.b 33f80000 0 10如果你没有关闭DEBUG定义,会有下面的信息:
TQ2440 # cmp.b 0 33f80000 10 Total of 16 byte(s) were the samesame说明写进去了。
TQ2440 # md.b 33f80000 33f80000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 33f80010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 33f80020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 33f80030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ TQ2440 #
TQ2440 # md.b 33FBFFF0 33fbfff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 33fc0000: be 00 00 ea 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 ................ 33fc0010: 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 ................ 33fc0020: 60 00 f8 33 c0 00 f8 33 20 01 f8 33 80 01 f8 33 `..3...3 ..3...3可见从0x33FC0000开始才是u-boot 的代码的起始位置。我们修改一下tq2440.h文件中CONFIG_SYS_TEXT_BASE的值,让代码直接从重定向的位置运行,这样u-boot就不需要重定向操作了:
#define CONFIG_SYS_TEXT_BASE 0x33FC0000编译、烧录、运行。注意烧录和运行地址也要变。u-boot打印的信息是和上面一样的:
TQ2440 # erase all