环境:ubuntu13.04
开发板:S3c6410
先介绍一下
型号:S3C(up-)6410
DDR(内存)地址范围:0x5000,0000~0x5800,0000
NAND flash地址范围:0~0x1000,0000
细分为以下四部分:
bootloade:$PATHr: 0~0x4,0000
kernel: 0x4,0000~0x30,0000
Rootfs: 0x30,0000~0x540,0000 //根文件系统
File System:0x540,0000~0x1000,0000
这些地址范围决定装载bootloader,kernel等可用的地址范围。
ARM:
bootloader -- /dev/mtdblock0
kernel -- /dev/mtdblock1
Rootfs -- /dev/mtdblock2
File Sysetm -- /dev/mtdblock3
在内核启动过程中会输出:
观看启动是否正确
0x00000000-0x00040000 : "Bootloader"
/dev/mtdblock0
0x00040000-0x00400000 : "Kernel"
/dev/mtdblock1
0x00400000-0x05400000 : "Rootfs"
/dev/mtdblock2
0x05400000-0x10000000 : "File System"
/dev/mtdblock3
注意:[u-boot-sd]字样代表在sd卡启动模式下;[u-boot-nand]字样代表在nand flash启动模式下
把 uboot 写到 nand:
[u-boot-sd]# nand erase
[u-boot-sd]# nand scrub
y enter
[u-boot-sd]# tftp 50000000 u-boot-nand.bin
[u-boot-sd]# nand write 50000000 0 40000
关掉电源,切换为 nand 启动,上电,如果成功出现:
[u-boot-nand]#,这时候会有 ECC 错误, 解决办法:
[u-boot-nand]# set serverip 192.168.1.253 //你的主机IP
[u-boot-nand]# tftp 50000000 u-boot-nand.bin
[u-boot-nand]# nand erase 0 40000
[u-boot-nand]# nand write 50000000 0 40000
[u-boot-nand]# reset
把 linux 内核写到 nand
[u-boot-nand]# set serverip 192.168.1.253
[u-boot-nand]# sav
[u-boot-nand]# tftp 50000000 zImage
[u-boot-nand]# nand erase 40000 300000
[u-boot-nand]# nand write 50000000 40000 300000
测试:
[u-boot-nand]# nand read 50008000 40000 300000
[u-boot-nand]# bootm 50008000
启动成功会出现小企鹅
把跟文件系统写到 nand
[u-boot-nand]# set bootargs root=/dev/nfs
nfsroot=192.168.,1.253:/nfsroot ip=192.168.1.20
console=ttySAC0,115200
[u-boot-nand]# sav
[u-boot-nand]# nand read 50008000 40000 300000
[u-boot-nand]# bootm 50008000
启动成功后:
[root@uplooking]# mount /dev/mtdblock2 /mnt
[root]# cp <path>/rootfs/rootfs20101220.tar /nfsroot
[root@uplooking]# tar -xvf rootfs20101220.tar -C /mnt
重启开发板
[u-boot-nand]# set bootargs root=/dev/mtdbloc2 consloe=ttySAC0,115200
[u-boot-nand]# sav
[u-boot-nand]# nand read 50008000 40000 300000
[u-boot-nand]# bootm 50008000
设置自动启动
[u- boot-nand]# set bootcmd “nand read 50008000 40000 300000;bootm 50008000”
[u-boot-nand]# sav
[u-boot-nand]# reset