Beaglebone Black——实践篇beaglebone black启动——从串口获得SPL、U-BOOT,TFTP服务器获得内核,NFS服务器挂载根文件系统

                  准备工作:

1)TFTP服务器目录下存放u-boot-spl.bin-am335x-evm、u-boot-am335x-evm.img、zImage、dtbs/am335x-boneblack.dtb。服务器工作目录为/tftpboot。

2)NFS服务器目录下是根文件系统。服务器工作目录为/opt/ti-sdk-am335x-evm-07.00.00.00/targetNFS/

3)虚拟机、目标板IP分别为192.168.1.105、192.168.1.106,虚拟机串口工具为secureCRT.

NOTE:上述SPL和u-boot文件名可以随意,但是内核镜像和设备树文件名以及目录位置都必须和u-boot环境变量nfsboot中的保持一致。上述所有文件包括根文件系统都采用TI官方的SDK包里面的文件。

 

step1:断电并拔掉板子上的SD卡,接上5VDC,网线,串口线,按住boot按键,然后开始上电,结果如下,

Beaglebone Black——实践篇beaglebone black启动——从串口获得SPL、U-BOOT,TFTP服务器获得内核,NFS服务器挂载根文件系统_第1张图片

 

step2:通过Xmoden协议传送SPL文件,注意不能是MLO文件。

Beaglebone Black——实践篇beaglebone black启动——从串口获得SPL、U-BOOT,TFTP服务器获得内核,NFS服务器挂载根文件系统_第2张图片

 

 

step3:通过Ymoden协议,向串口传送u-boot.img文件。

Beaglebone Black——实践篇beaglebone black启动——从串口获得SPL、U-BOOT,TFTP服务器获得内核,NFS服务器挂载根文件系统_第3张图片

 

 

step4:设置环境变量,如何设置参考对应的理论篇

 

step5:设置好变量之后,run nfsboot,开始启动系统,结果如下,

 

U-Boot# setenv server_ip 192.168.1.105
U-Boot# setenv client_ip 192.168.1.106
U-Boot# setenv root_dir /opt/ti-sdk-am335x-evm-07.00.00.00/targetNFS/
U-Boot# run findfdt
U-Boot# run nfsboot
Booting from 192.168.1.105 ...
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.105; our IP address is 192.168.1.106
Filename 'zImage'.
Load address: 0x82000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #####################
         1.3 MiB/s
done
Bytes transferred = 4117616 (3ed470 hex)
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.105; our IP address is 192.168.1.106
Filename 'dtbs/am335x-boneblack.dtb'.
Load address: 0x88000000
Loading: ###
         352.5 KiB/s
done
Bytes transferred = 34352 (8630 hex)
Kernel image @ 0x82000000 [ 0x000000 - 0x3ed470 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8fff4000, end 8ffff62f ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 3.12.10-ti2013.12.01 (jenkins@sdit-build02) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #1 Sun Mar 30 20:55:31 CDT 2014
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: Generic AM33XX (Flattened Device Tree), model: TI AM335x BeagleBone
[    0.000000] cma: CMA: reserved 24 MiB at 9e000000
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.0 (sgx neon )
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129280
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/nfs rw rootfstype=ext4 rootwait fixrtc nfsroot=192.168.1.105:/opt/ti-sdk-am335x-evm-07.00.00.00/targetNFS/,vers=3 ip=192.168.1.106:192.168.1.105:192.168.1.1:255.255.255.0::eth0:off
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 483352K/521216K available (5555K kernel code, 559K rwdata, 1876K rodata, 345K init, 225K bss, 37864K reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc074a04c   (7433 kB)
[    0.000000]       .init : 0xc074b000 - 0xc07a15f0   ( 346 kB)
[    0.000000]       .data : 0xc07a2000 - 0xc082ddd8   ( 560 kB)
[    0.000000]        .bss : 0xc082ddd8 - 0xc0866400   ( 226 kB)
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[    0.000000] Total of 128 interrupts on 1 active controller
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[    0.000000] OMAP clocksource: timer1 at 24000000 Hz
[    0.000000] Console: colour dummy device 80x30
[    0.000245] Calibrating delay loop... 663.55 BogoMIPS (lpj=3317760)
[    0.049786] pid_max: default: 32768 minimum: 301
[    0.049870] Security Framework initialized
[    0.049910] Mount-cache hash table entries: 512
[    0.055707] CPU: Testing write buffer coherency: ok
[    0.056032] Setting up static identity map for 0xc0572e68 - 0xc0572ed8
[    0.056733] devtmpfs: initialized
[    0.058246] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.117917] omap_hwmod: debugss: _wait_target_disable failed
[    0.118504] pinctrl core: initialized pinctrl subsystem
[    0.119201] regulator-dummy: no parameters
[    0.121213] NET: Registered protocol family 16
[    0.122946] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.124936] cpuidle: using governor ladder
[    0.124949] cpuidle: using governor menu
[    0.131378] platform mpu.1: FIXME: clock-name 'fck' DOES NOT exist in dt!
[    0.132208] platform 49000000.edma: FIXME: clock-name 'fck' DOES NOT exist in dt!
[    0.133151] OMAP GPIO hardware version 0.1
[    0.139209] platform 56000000.sgx: FIXME: clock-name 'fck' DOES NOT exist in dt!
[    0.140719] DSS not supported on this SoC
[    0.140733] No ATAGs?
[    0.140741] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.158332] bio: create slab <bio-0> at 0
[    0.169149] edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine driver
[    0.169838] vmmcsd_fixed: 3300 mV 
[    0.171925] vgaarb: loaded
[    0.172906] SCSI subsystem initialized
[    0.173926] usbcore: registered new interface driver usbfs
[    0.174061] usbcore: registered new interface driver hub
[    0.174209] usbcore: registered new device driver usb
[    0.174905] omap_i2c 44e0b000.i2c: could not find pctldev for node /pinmux@44e10800/pinmux_i2c0_pins, deferring probe
[    0.174927] platform 44e0b000.i2c: Driver omap_i2c requests probe deferral
[    0.175090] media: Linux media interface: v0.10
[    0.175222] Linux video capture interface: v2.00
[    0.175425] pps_core: LinuxPPS API ver. 1 registered
[    0.175433] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[    0.175531] PTP clock support registered
[    0.177523] Switched to clocksource timer1
[    0.191455] NET: Registered protocol family 2
[    0.191966] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[    0.192034] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[    0.192072] TCP: Hash tables configured (established 4096 bind 4096)
[    0.192126] TCP: reno registered
[    0.192137] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.192153] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.192318] NET: Registered protocol family 1
[    0.192637] RPC: Registered named UNIX socket transport module.
[    0.192648] RPC: Registered udp transport module.
[    0.192653] RPC: Registered tcp transport module.
[    0.192659] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.193412] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.193877] PM: Loading am335x-pm-firmware.bin
[    0.308051] VFS: Disk quotas dquot_6.5.2
[    0.308113] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.308598] NFS: Registering the id_resolver key type
[    0.308670] Key type id_resolver registered
[    0.308677] Key type id_legacy registered
[    0.308710] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.308864] msgmni has been set to 992
[    0.310079] NET: Registered protocol family 38
[    0.310113] io scheduler noop registered
[    0.310121] io scheduler deadline registered
[    0.310138] io scheduler cfq registered (default)
[    0.311626] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[    0.315268] platform 4830e000.lcdc: Driver da8xx_lcdc requests probe deferral
[    0.316521] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.318695] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 88, base_baud = 3000000) is a OMAP UART0
[    0.931660] console [ttyO0] enabled
[    0.936381] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
[    0.950781] brd: module loaded
[    0.957886] loop: module loaded
[    0.963591] mtdoops: mtd device (mtddev=name/number) must be supplied
[    0.972939] usbcore: registered new interface driver asix
[    0.978795] usbcore: registered new interface driver ax88179_178a
[    0.985324] usbcore: registered new interface driver cdc_ether
[    0.991560] usbcore: registered new interface driver r815x
[    0.997456] usbcore: registered new interface driver smsc95xx
[    1.003603] usbcore: registered new interface driver net1080
[    1.009675] usbcore: registered new interface driver cdc_subset
[    1.016013] usbcore: registered new interface driver zaurus
[    1.022022] usbcore: registered new interface driver cdc_ncm
[    1.028365] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.035214] ehci-pci: EHCI PCI platform driver
[    1.040041] ehci-omap: OMAP-EHCI Host Controller driver
[    1.046150] usbcore: registered new interface driver cdc_wdm
[    1.052260] usbcore: registered new interface driver usb-storage
[    1.059341] mousedev: PS/2 mouse device common for all mice
[    1.067255] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
[    1.075309] i2c /dev entries driver
[    1.079406] Driver for 1-wire Dallas network protocol.
[    1.086599] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[    1.095233] edma-dma-engine edma-dma-engine.0: allocated channel for 0:25
[    1.102482] edma-dma-engine edma-dma-engine.0: allocated channel for 0:24
[    1.147820] edma-dma-engine edma-dma-engine.0: allocated channel for 0:3
[    1.154861] edma-dma-engine edma-dma-engine.0: allocated channel for 0:2
[    1.202727] ledtrig-cpu: registered to indicate activity on CPUs
[    1.209397] edma-dma-engine edma-dma-engine.0: allocated channel for 0:36
[    1.216621] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
[    1.223735] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
[    1.229910] edma-dma-engine edma-dma-engine.0: allocated channel for 0:5
[    1.237005] edma-dma-engine edma-dma-engine.0: allocated channel for 0:6
[    1.248175] usbcore: registered new interface driver usbhid
[    1.254023] usbhid: USB HID core driver
[    1.259784] oprofile: no performance counters
[    1.264663] oprofile: using timer interrupt.
[    1.269479] TCP: cubic registered
[    1.272972] Initializing XFRM netlink socket
[    1.277471] NET: Registered protocol family 17
[    1.282191] NET: Registered protocol family 15
[    1.286888] 8021q: 802.1Q VLAN Support v1.8
[    1.291374] Key type dns_resolver registered
[    1.296420] cpu cpu0: cpu0 regulator not ready, retry
[    1.301828] platform cpufreq-cpu0.0: Driver cpufreq-cpu0 requests probe deferral
[    1.310092] ThumbEE CPU extension supported.
[    1.318320] DCDC1: at 1500 mV 
[    1.322370] vdd_mpu: 925 <--> 1375 mV at 1325 mV 
[    1.328159] vdd_core: 925 <--> 1150 mV at 1125 mV 
[    1.333977] LDO1: at 1800 mV 
[    1.337861] LDO2: at 3300 mV 
[    1.342235] LDO3: 1800 mV 
[    1.345838] LDO4: at 3300 mV 
[    1.349610] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[    1.469670] tda998x 0-0070: found TDA19988
[    1.474369] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    1.541295] Console: switching to colour frame buffer device 160x45
[    1.600708] mmc1: BKOPS_EN bit is not set
[    1.607289] mmc1: new high speed MMC card at address 0001
[    1.613502] mmcblk0: mmc1:0001 MMC02G 1.78 GiB 
[    1.618306] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[    1.624699] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[    1.631331] mmcblk0boot0: mmc1:0001 MMC02G partition 1 1.00 MiB
[    1.637664] mmcblk0boot1: mmc1:0001 MMC02G partition 2 1.00 MiB
[    1.645199] libphy: 4a101000.mdio: probed
[    1.649480] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[    1.659170]  mmcblk0: p1 p2
[    1.663244] Detected MACID = c8:a0:30:ac:7f:cf
[    1.670671] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
[    1.679834]  mmcblk0boot1: unknown partition table
[    1.688812]  mmcblk0boot0: unknown partition table
[    1.694101] net eth0: initializing cpsw version 1.12 (0)
[    1.702353] net eth0: phy found : id is : 0x7c0f1
[    1.712289] 8021q: adding VLAN 0 to HW filter on device eth0
[    4.778026] libphy: 4a101000.mdio:00 - Link is Up - 100/Full
[    4.797732] IP-Config: Complete:
[    4.801143]      device=eth0, hwaddr=c8:a0:30:ac:7f:cf, ipaddr=192.168.1.106, mask=255.255.255.0, gw=192.168.1.1
[    4.811902]      host=192.168.1.106, domain=, nis-domain=(none)
[    4.818123]      bootserver=192.168.1.105, rootserver=192.168.1.105, rootpath=
[    4.856864] VFS: Mounted root (nfs filesystem) on device 0:13.
[    4.876973] devtmpfs: mounted
[    4.880559] Freeing unused kernel memory: 344K (c074b000 - c07a1000)
INIT: version 2.88 booting
Starting udev
[    6.154699] udevd[803]: starting version 182
[    7.870241] PM: CM3 Firmware Version = 0x186
[   10.065827] musb-hdrc musb-hdrc.0.auto: Enabled SW babble control
[   10.140118] musb-hdrc musb-hdrc.0.auto: MUSB HDRC host driver
[   10.207724] musb-hdrc musb-hdrc.0.auto: new USB bus registered, assigned bus number 1
[   10.285828] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   10.293042] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   10.300639] usb usb1: Product: MUSB HDRC host driver
[   10.305844] usb usb1: Manufacturer: Linux 3.12.10-ti2013.12.01 musb-hcd
[   10.312794] usb usb1: SerialNumber: musb-hdrc.0.auto
[   10.401460] hub 1-0:1.0: USB hub found
[   10.411473] hub 1-0:1.0: 1 port detected
[   10.419941] musb-hdrc musb-hdrc.1.auto: Enabled SW babble control
[   10.435308] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[   10.457149] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 2
[   10.468046] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[   10.475260] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   10.482873] usb usb2: Product: MUSB HDRC host driver
[   10.488089] usb usb2: Manufacturer: Linux 3.12.10-ti2013.12.01 musb-hcd
[   10.495025] usb usb2: SerialNumber: musb-hdrc.1.auto
[   10.504720] hub 2-0:1.0: USB hub found
[   10.512687] hub 2-0:1.0: 1 port detected
[   10.736711] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   11.200124] cryptodev: driver 1.6 loaded.
Starting Bootlog daemon: bootlogd: cannot allocate pseudo tty: No such file or directory
bootlogd.
ALSA: Restoring mixer settings...
NOT configuring network interfaces: / is an NFS mount
/usr/sbin/alsactl: load_state:1696: No soundcards found...
Mon Mar 31 03:14:00 UTC 2014
INIT: Entering runlevel: 5
Starting system message bus: dbus.
UIM SYSFS Node Not Found
Starting Dropbear SSH server: dropbear.
Starting telnet daemon.
Starting syslogd/klogd: done
Starting thttpd.
Starting PVR
Starting Lighttpd Web Server: 2014-03-31 03:14:02: (log.c.166) server started 
lighttpd.
/
Starting Matrix GUI application.
[   16.172895] Number of LUNs=8
[   16.176299] Mass Storage Function, version: 2009/09/11
[   16.182284] LUN: removable file: (no medium)
[   16.187355] Number of LUNs=1
[   16.190843] LUN: file: /dev/mmcblk0p1
[   16.194823] Number of LUNs=1
[   16.199364] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
[   16.207046] g_mass_storage gadget: userspace failed to provide iSerialNumber
[   16.214492] g_mass_storage gadget: g_mass_storage ready
***************************************************************
***************************************************************
NOTICE: This file system contains the followin GPLv3 packages:
        binutils-symlinks
        binutils
        gdbserver

If you do not wish to distribute GPLv3 components please remove
the above packages prior to distribution.  This can be done using
the opkg remove command.  i.e.:
    opkg remove <package>
Where <package> is the name printed in the list above

NOTE: If the package is a dependency of another package you
      will be notified of the dependent packages.  You should
      use the --force-removal-of-dependent-packages option to
      also remove the dependent packages as well
***************************************************************
***************************************************************
Stopping Bootlog daemon: bootlogd.

 _____                    _____           _         _   
|  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
|     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
|__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
              |___|                    |___|            

Arago Project http://arago-project.org am335x-evm ttyO0

Arago 2013.12 am335x-evm ttyO0

am335x-evm login:

登陆进去,然后查看系统文件系统情况,如下

am335x-evm login: root
root@am335x-evm:~# [  200.307785] mmc0: host does not support reading read-only switch. assuming write-enable.
[  200.320781] mmc0: new high speed SDHC card at address e624
[  200.327365] mmcblk1: mmc0:e624 SU08G 7.40 GiB 
[  200.345413]  mmcblk1: p1 p2
[  200.945190] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)

root@am335x-evm:~# df -h
Filesystem                Size      Used Available Use% Mounted on
192.168.1.105:/opt/ti-sdk-am335x-evm-07.00.00.00/targetNFS/
                          9.3G      8.3G    468.8M  95% /
devtmpfs                236.0M      4.0K    236.0M   0% /dev
tmpfs                    16.0M    548.0K     15.5M   3% /var/volatile
tmpfs                   248.2M         0    248.2M   0% /dev/shm
tmpfs                    16.0M         0     16.0M   0% /media/ram
/dev/mmcblk0p2            1.6G    463.3M      1.1G  29% /var/volatile/run/media/mmcblk0p2
/dev/mmcblk0p1           95.8M     62.3M     33.5M  65% /var/volatile/run/media/mmcblk0p1
/dev/mmcblk1p2            1.5G    500.7M    949.0M  35% /var/volatile/run/media/mmcblk1p2
/dev/mmcblk1p1           95.8M     62.3M     33.5M  65% /var/volatile/run/media/mmcblk1p1
root@am335x-evm:~# 

         启动后,插入了一张SD卡,可以看到根文件系统是从NFS服务器192.168.1.105:/opt/ti-sdk-am335x-evm-07.00.00.00/targetNFS/挂载而来,最后的mmcblk0和 mmcblk1分别为板子的eMMC和SD卡。

          Done !


note:有时候有的u-boot可能缺少相关的环境变量,这个不是问题,只要自己手动添加进去即可。格式也可以自己选择,很灵活。

 

你可能感兴趣的:(Beaglebone Black——实践篇beaglebone black启动——从串口获得SPL、U-BOOT,TFTP服务器获得内核,NFS服务器挂载根文件系统)