x210项目重新回顾之七uboot_2013.10之nfs方式启动内核-问题排查

参考我之前的:s5pv210的学习之路(21)x210的kernel的NFS的根文件系统编译,使用_weixin_43097675的博客-CSDN博客

uboot:九鼎x210(而不是goni aston_u-boot-2013.10)

问题总结:

1)bootargs的nfsroot=192.168.254.33:/tftpboot/nfs没有添加proto=tcp,nfsvers=3,nolock

   应该是:nfsroot=192.168.254.33:/tftpboot/nfs,proto=tcp,nfsvers=3,nolock

2)linux内核没有配置nfs选项:

A)make menuconfig
(a)*] Networking support —>
Networking options —>
[*] IP: kernel level autoconfiguration
[*] IP: DHCP support
[*] IP: BOOTP support
[*] IP: RARP support

(b)File systems —>
[*] Network File Systems —>
[*] Root file system on NFS

B) vi .config
CONFIG_CMDLINE=”noinitrd mem=512M console=ttySAC2,115200 root=/dev/nfs nfsroot=172.16.96.215:/arm-nfs ip=172.16.96.250:172.16.96.215:172.16.96.215:255.255.254.0::eth0:off”

C)make menuconfig

general setup->
[ ] Initial RAM filesystem and RAM disk (initramfs/initrd) support(取消)

D)
make ;
uboot> tftp 30008000 zImage
uboot> bootm 30008000

结果如下:
Boot with zImage
The input address don’t need a virtual-to-physical translation : 30008000

Starting kernel …

Uncompressing Linux… done, booting the kernel.
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.35.7+ ([email protected]) (gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67) ) #9 PREEMPT Fri Sep 14 17:37:04 CST 2018
[ 0.000000] CPU: ARMv7 Processor [412fc082] revision 2 (ARMv7), cr=10c53c7f
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] Machine: SMDKV210
[ 0.000000] @@@@@@@ atags_pointer not null
[ 0.000000] @@@@@@@linter#####boot_params:c0000100,mdesc->boot_params:40000002
[ 0.000000] Ignoring unrecognised tag 0x41001099
[ 0.000000]

Please press Enter to activate this console.
/ # ls
bin driver-xiong jimmy-driver linux_driver sbin usr
build driver_test jimmy_test proc sys
dev etc lib root tmp

-----------------------------------------------------------------------------------------

3)注意事项:

A)虽然我们用的时从mmc2卡启动uboot,但是启动后3秒不动,默认从inand下载启动linux:
#setenv bootcmd "movi read kernel 30008000; movi read rootfs 30B00000 300000; bootm 30008000 30B00000"

B)我们可以改为nfs 启动:
setenv bootargs "root=/dev/nfs rw nfsroot=192.168.254.33:/tftpboot/nfs,proto=tcp,nfsvers=3,nolock  ip=192.168.254.39:192.168.254.33:192.168.254.254:255.255.255.0::eth0:off console=ttySAC2,115200 init=/linuxrc"

或者linux的.config文件 CMD_LINE:noinitrd mem=512M console=ttySAC2,115200 root=/dev/nfs nfsroot=172.16.96.215:/arm-nfs ip=192.168.254.39:192.168.254.33:192.168.254.33:255.255.255.0::eth0:off

并且保存linux到inand(如果有movi的话,还是可以操作inand)
movi write kernel 30008000
并且设置uboot环境变量
setenv bootcmd "movi read kernel 30008000; bootm 30008000"
 

C)如果想用mmc保存linux到mmc2卡,可以先移植mmc命令:
uboot大小:161332 bytes (161 kB, 158 KiB) copied, 2.17452 s, 74.2 kB/s
linux: 3633388 (3770ec hex)=400000*2/1K (1个扇区512字节 0.5k)=8k
规划
mbr 0-1 扇区
bl0 1-49 扇区
uboot  49 500扇区
linux    500-8196(十进制)扇区
那么我们可以烧写(注意我用的x210的uboot是没有mmc命令的):
x210》mmc write 1 30008000 500# 8196
x210》mmc read  1 30008000 500# 8196

你可能感兴趣的:(#,uboot,linux,网络,tcp/ip)