|
本帖最后由 danshi126 于 2012-2-4 22:04 编辑
如题,
UBOOT已经移植完成,已支持NAND Flash,Nor Falsh,DM9000,支持NAND启动,
现我把编译好的内核通过TFTP加载到内存中,再把经写入NAND Flash 可启动时提示:Bad Magic Number
下面是整个过程(内核镜像是天嵌出厂源码):
wangping # tftp 0x32000000 embed.bin
dm9000 i/o: 0x20000300, id: 0x90000a46
MAC: 08:00:3e:26:0a:5b
TFTP from server 192.168.1.100; our IP address is 192.168.1.6
Filename 'embed.bin'.
Load address: 0x32000000
Loading: T #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
##############################################
done
Bytes transferred = 1895256 (1ceb58 hex)
wangping # nand erase 0x00600000 0x00200000
NAND erase: device 0 offset 0x600000, size 0x200000
d
Erasing at 0x600000 -- 6% complete.d
Erasing at 0x620000 -- 12% complete.d
Erasing at 0x640000 -- 18% complete.d
Erasing at 0x660000 -- 25% complete.d
Erasing at 0x680000 -- 31% complete.d
Erasing at 0x6a0000 -- 37% complete.d
Erasing at 0x6c0000 -- 43% complete.d
Erasing at 0x6e0000 -- 50% complete.d
Erasing at 0x700000 -- 56% complete.d
Erasing at 0x720000 -- 62% complete.d
Erasing at 0x740000 -- 68% complete.d
Erasing at 0x760000 -- 75% complete.d
Erasing at 0x780000 -- 81% complete.d
Erasing at 0x7a0000 -- 87% complete.d
Erasing at 0x7c0000 -- 93% complete.d
Erasing at 0x7e0000 -- 100% complete.
OK
wangping # nand write.jffs2 0x32000000 0x00600000 0x1ceb58
NAND write: device 0 offset 0x600000, size 0x1ceb58
Writing data at 0x7ce800 -- 100% complete.
1895256 bytes written: OK
wangping # bootm
## Booting image at 32000000 ...
Bad Magic Number
重启开发板:
U-Boot 1.2.0 (Dec 25 2011 - 17:57:17)
DRAM: 64 MB
Flash: 2 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x60000, size 0x200000
Reading data from 0x25f800 -- 100% complete.
2097152 bytes read: OK
## Booting image at 32000000 ...
Bad Magic Number
uboot 环境变量:
bootargs=root=ramfs devfs=mount console=ttySA0,9600
bootcmd=nand read.jffs2 0x32000000 0x00060000 0x00200000; bootm 0x32000000
bootdelay=3
baudrate=115200
ethaddr=08:00:3e:26:0a:5b
filesize=1ceb58
fileaddr=32000000
netmask=255.255.255.0
ipaddr=192.168.1.6
serverip=192.168.1.100
stdin=serial
stdout=serial
stderr=serial
环境变量存放地址没有与内核冲突:
#define CFG_ENV_OFFSET 0x40000
|
|