beaglebone black EZSDK linux从EMMC中启动一

参考这位兄弟的博客做的http://my.oschina.net/234148609/blog/201861
  1. eZsdk增加emmc支持 
      Chipsee提供的BSP是基于TI提供的eZSDK5.7版本,而且没有对BBB的emmc进行支持,如果想从BBB的emmc启动,则需要在内核中增加emmc支持。 
    3.1 内核emmc支持 
      在Chipsee提供的linux3.2基础上增加对BBB上emmc的支持(eZSDK5.7到eZSDK6.0的区别) 
    编辑board-am335xevm.c,增加mmc1_emmc_init初始化:

beaglebone black EZSDK linux从EMMC中启动一_第1张图片 
然后在板卡配置结构体中增加mmc1_emmc_init调用: 
beaglebone black EZSDK linux从EMMC中启动一_第2张图片 
(上图有误:mmc1_emmc_init应该在mmc0_init之前)

重新编译内核后从SD卡启动,可以看到: 
beaglebone black EZSDK linux从EMMC中启动一_第3张图片 
mmcblk1p2 mount失败。 
注意:

  • mmc0: SD卡接口
  • mmc1: BBB板载emmc接口
  • mmcblk1p1:emmc fat分区
  • mmcblk1p2:emmc ext3分区

通过df -H 可以看到mmcblk1p2文件系统是ext4,在内核编译选项增加ext4支持:

1 编辑 .config文件,增加CONFIG_EXT4_FS=y,重新编译内核。

beaglebone black EZSDK linux从EMMC中启动一_第4张图片

1 挂载成功:

beaglebone black EZSDK linux从EMMC中启动一_第5张图片

3.2 uboot emmc支持 
  

1 1). Chipsee提供的uboot支持从emmc和sd卡启动,如需从emmc启动则需要对uEnv.txt稍作修改:

  将 fatload mmc 0 81000000 改为fatload mmc 1 81000000

1 2). eZsdk提供的uboot支持从emmc启动的,只是无法识别emmc中文件系统所在的ext4分区,而出厂的BBB默认安装angstrom,并且文件系统被格式化成了ext4分区(eZsdk提供的creatSD.sh是将SD卡分为fat和ext3分区)

BBB的emmc出厂默认带angstrom系统分为fat32和ext4,如果不想改动emmc分区则需要在Chipsee的uboot中增加对ext4支持: 
beaglebone black EZSDK linux从EMMC中启动一_第6张图片

1 3). 在uboot的am335x_evm.h头文件中使能storage_emmc可有可无,使能storage_emmc的目的是给fastboot使用。

4.更新emmc 
  将emmc中默认的angstrom更新为eZsdk5.7,步骤:

  • 1) 从SD卡启动(Chipsee预装的、或者用Chipsee提供的mksdcard.sh制作的,但是uImage替换掉,支持emmc),进入shell
  • 2) 格式化emmc的ext4分区

  在shell窗口中执行: 
  

1 mkfs.ext3 -j -L “rootfs” /dev/mmcblk1p2

  重启,重启后/dev/mmcblk1p2会被挂载到 /media/mmcblk1p2

  • 3) 通过wget将eZsdk提供的rootfs.tar.gz(或者是Chipsee的)拷贝到本地:

  在shell窗口中执行: 
  

1 wget ftp://zr:[email protected]/rootfs.tar.gz
  • 4) 将文件系统解压到emmc的ext分区:

  

1 tar -zxvf rootfs.tar.gz -C /media/mmcblk1p2
  • 5) 将之前编译好的MLO UBOOT以及kernel和uEnv.txt拷贝到 /media/mmcblk1p1中
  • 6) Chipsee提供的uEnv内容如下:

  

1 bootargs=console=ttyO1,115200n8 mem=512M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait rootdelay=1 init=/init ip=off consoleblank=0
2
3 bootcmd=mmc rescan ; fatload mmc 0 81000000 uImage ; bootm 81000000
4
5 uenvcmd=boot

  将 fatload mmc 0 81000000 改为fatload mmc 1 81000000即可

  • 7)这样emmc更新完毕。
需要注意的完成上面的这些步骤我的板子仍然没启动起来,不知道为什么,uboot似乎没有读uEnv.txt。最后在uboot下输入命令行去读的内核,并设置相应的bootargs和bootcmd:
setenv bootargs console=ttyO1,115200n8 mem=512M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait rootdelay=1 init=/init ip=off;
mmc dev 1;
fatload mmc 1 81000000 uImage ;
bootm 81000000
uenvcmd=boot
附上串口消息:


U-Boot SPL 2011.09 (Mar 26 2014 - 18:38:48)
Chipsee AM335x EVM Board


U-Boot SPL 2011.09 (Mar 26 2014 - 18:38:48)
Chipsee AM335x EVM Board
OMAP SD/MMC: 1
reading u-boot.img
reading u-boot.img




U-Boot 2011.09 (Mar 26 2014 - 00:09:00)


I2C:   ready
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  HW ECC Hamming Code selected
No NAND device found!!!
0 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment


Net:   cpsw
Hit any key to stop autoboot:  0
Card did not respond to voltage select!
Booting from nand ...
HW ECC BCH8 Selected


no devices available
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot# setenv bootargs console=ttyO1,115200n8 mem=512M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait rootdelay=1 init=/init ip=off;
U-Boot# mmc dev 1;
mmc1(part 0) is current device
U-Boot# fatload mmc 1 81000000 uImage ;
reading uImage


3327856 bytes read
U-Boot# bootm 81000000
## Booting kernel from Legacy Image at 81000000 ...
   Image Name:   Linux-3.2.0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3327792 Bytes = 3.2 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK


Starting kernel ...


[    0.000000] Linux version 3.2.0 (ubuntu@ubuntu) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #1 Wed Mar 26 19:03:22 PDT 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: am335xevm
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] AM335X ES2.0 (sgx neon )
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: console=ttyO1,115200n8 mem=512M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait rootdelay=1 init=/init ip=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: 512MB = 512MB total
[    0.000000] Memory: 512848k/512848k available, 11440k 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]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc05ea000   (6024 kB)
[    0.000000]       .init : 0xc05ea000 - 0xc0626000   ( 240 kB)
[    0.000000]       .data : 0xc0626000 - 0xc068e9d0   ( 419 kB)
[    0.000000]        .bss : 0xc068e9f4 - 0xc06bd8e4   ( 188 kB)
[    0.000000] NR_IRQS:396
[    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: GPTIMER2 at 24000000 Hz
[    0.000000] omap_dm_timer_switch_src: Switching to HW default clocksource(sys_clkin_ck) for timer1, this may impact timekeeping in low power state
[    0.000000] OMAP clocksource: GPTIMER1 at 24000000 Hz
[    0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[    0.000000] Console: colour dummy device 80x30
[    0.000145] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
[    0.087754] pid_max: default: 32768 minimum: 301
[    0.087845] Security Framework initialized
[    0.087929] Mount-cache hash table entries: 512
[    0.088235] CPU: Testing write buffer coherency: ok
[    0.107532] omap_hwmod: pruss: failed to hardreset
[    0.108439] print_constraints: dummy:
[    0.108718] NET: Registered protocol family 16
[    0.110352] OMAP GPIO hardware version 0.1
[    0.112287] omap_mux_init: Add partition: #1: core, flags: 0
[    0.113756]  omap_i2c.1: alias fck already exists
[    0.114437]  omap2_mcspi.1: alias fck already exists
[    0.114607]  omap2_mcspi.2: alias fck already exists
[    0.115302]  edma.0: alias fck already exists
[    0.115317]  edma.0: alias fck already exists
[    0.115331]  edma.0: alias fck already exists
[    0.135225] bio: create slab at 0
[    0.136929] SCSI subsystem initialized
[    0.138198] usbcore: registered new interface driver usbfs
[    0.138434] usbcore: registered new interface driver hub
[    0.138584] usbcore: registered new device driver usb
[    0.138713] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3
[    0.138928] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1
[    0.157769] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz
[    0.177732] tps65910 1-002d: could not be detected
[    0.178739] Advanced Linux Sound Architecture Driver Version 1.0.24.
[    0.179589] Switching to clocksource gp timer
[    0.191070] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
[    0.191218] musb-hdrc musb-hdrc.0: dma type: pio
[    0.191480] MUSB0 controller's USBSS revision = 4ea20800
[    0.191499] musb0: Enabled SW babble control
[    0.192010] musb-hdrc musb-hdrc.0: USB OTG mode controller at e083c000 using PIO, IRQ 18
[    0.192136] musb-hdrc musb-hdrc.1: dma type: pio
[    0.192379] MUSB1 controller's USBSS revision = 4ea20800
[    0.192394] musb1: Enabled SW babble control
[    0.192520] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
[    0.192580] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1
[    0.192683] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.192695] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.192705] usb usb1: Product: MUSB HDRC host driver
[    0.192713] usb usb1: Manufacturer: Linux 3.2.0 musb-hcd
[    0.192721] usb usb1: SerialNumber: musb-hdrc.1
[    0.193365] hub 1-0:1.0: USB hub found
[    0.193388] hub 1-0:1.0: 1 port detected
[    0.193819] musb-hdrc musb-hdrc.1: USB Host mode controller at e083e800 using PIO, IRQ 19
[    0.194154] NET: Registered protocol family 2
[    0.194302] IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.194540] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    0.194756] TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
[    0.194882] TCP: Hash tables configured (established 16384 bind 16384)
[    0.194891] TCP reno registered
[    0.194900] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.194917] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.195056] NET: Registered protocol family 1
[    0.195246] RPC: Registered named UNIX socket transport module.
[    0.195256] RPC: Registered udp transport module.
[    0.195262] RPC: Registered tcp transport module.
[    0.195269] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.195448] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.212274] VFS: Disk quotas dquot_6.5.2
[    0.212329] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.212944] msgmni has been set to 1001
[    0.215369] alg: No test for stdrng (krng)
[    0.215910] io scheduler noop registered
[    0.215921] io scheduler deadline registered
[    0.215975] io scheduler cfq registered (default)
[    0.216884] Could not set LED4 to fully on
[    0.250473] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
[    0.250816] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
[    0.833541] console [ttyO1] enabled
[    0.837619] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
[    0.845340] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
[    0.853029] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
[    0.860719] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
[    0.868729] omap4_rng omap4_rng: OMAP4 Random Number Generator ver. 2.00
[    0.882736] brd: module loaded
[    0.889678] loop: module loaded
[    0.893110] i2c-core: driver [tsl2550] using legacy suspend method
[    0.899569] i2c-core: driver [tsl2550] using legacy resume method
[    0.906003] at24 1-0051: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[    1.009621] No daughter card found
[    1.013204] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[    1.020490] The board is a Chipsee Beaglebone Black Expansion.
[    1.026934]  omap_hsmmc.0: alias fck already exists
[    1.032388]  omap_hsmmc.1: alias fck already exists
[    1.038000]  da8xx_lcdc.0: alias fck already exists
[    1.043544] da8xx_lcdc da8xx_lcdc.0: GLCD: Found HJ070NA13A panel
[    1.068848] Console: switching to colour frame buffer device 128x37
[    1.085343]  omap_i2c.2: alias fck already exists
[    1.109663] omap_i2c omap_i2c.2: bus 2 rev2.4.0 at 100 kHz
[    1.116419]  davinci-mcasp.0: alias fck already exists
[    1.122647]  d_can.0: alias fck already exists
[    1.129947] mtdoops: mtd device (mtddev=name/number) must be supplied
[    1.136990] omap2-nand driver initializing
[    1.141422] OneNAND driver initializing
[    1.146392] CAN device driver interface
[    1.150424] CAN bus driver for Bosch D_CAN controller 1.0
[    1.156716] d_can d_can.0: device registered (irq=52, irq_obj=53)
[    1.209638] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
[    1.216105] davinci_mdio davinci_mdio.0: detected phy mask fffffffe
[    1.223264] davinci_mdio.0: probed
[    1.226821] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver SMSC LAN8710/LAN8720
[    1.235634] usbcore: registered new interface driver zd1201
[    1.241625] usbcore: registered new interface driver cdc_ether
[    1.247842] usbcore: registered new interface driver cdc_eem
[    1.253933] usbcore: registered new interface driver dm9601
[    1.259810] cdc_ncm: 04-Aug-2011
[    1.263306] usbcore: registered new interface driver cdc_ncm
[    1.269221] Initializing USB Mass Storage driver...
[    1.274500] usbcore: registered new interface driver usb-storage
[    1.280792] USB Mass Storage support registered.
[    1.285956] mousedev: PS/2 mouse device common for all mice
[    1.293225] input: ft5x06_ts as /devices/virtual/input/input0
[    1.300140] input: ti-tsc as /devices/platform/omap/ti_tscadc/tsc/input/input1
[    1.308373] i2c /dev entries driver
[    1.312516] Linux video capture interface: v2.00
[    1.317597] usbcore: registered new interface driver uvcvideo
[    1.323621] USB Video Class driver (1.1.1)
[    1.600402] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[    1.606883] _regulator_get: deviceless supply vdd_mpu not found, using dummy regulator
[    1.615543] cpuidle: using governor ladder
[    1.620223] cpuidle: using governor menu
[    1.628054] omap4_aes_mod_init: loading AM33X AES driver
[    1.633739] omap4-aes omap4-aes: AM33X AES hw accel rev: 3.02
[    1.640396] omap4_aes_probe: probe() done
[    1.644781] omap4_sham_mod_init: loading AM33X SHA/MD5 driver
[    1.650922] omap4-sham omap4-sham: AM33X SHA/MD5 hw accel rev: 4.03
[    1.664493] omap4_sham_probe: probe() done
[    1.670879] usbcore: registered new interface driver usbhid
[    1.676738] usbhid: USB HID core driver
[    1.681282] tiadc tiadc: attached adc driver
[    1.689365] usbcore: registered new interface driver snd-usb-audio
[    1.697354] _regulator_get: 2-001b supply IOVDD not found, using dummy regulator
[    1.705176] _regulator_get: 2-001b supply DVDD not found, using dummy regulator
[    1.712857] _regulator_get: 2-001b supply AVDD not found, using dummy regulator
[    1.720540] _regulator_get: 2-001b supply DRVDD not found, using dummy regulator
[    1.730359] asoc: tlv320aic3x-hifi <-> davinci-mcasp.0 mapping ok
[    1.737777] ALSA device list:
[    1.740917]   #0: AM335X EVM
[    1.743927] oprofile: hardware counters not available
[    1.749203] oprofile: using timer interrupt.
[    1.753693] nf_conntrack version 0.5.0 (8013 buckets, 32052 max)
[    1.760443] ip_tables: (C) 2000-2006 Netfilter Core Team
[    1.766092] TCP cubic registered
[    1.769467] NET: Registered protocol family 17
[    1.774139] can: controller area network core (rev 20090105 abi 8)
[    1.780684] NET: Registered protocol family 29
[    1.785344] can: raw protocol (rev 20090105)
[    1.789818] can: broadcast manager protocol (rev 20090105 t)
[    1.795761] Registering the dns_resolver key type
[    1.800745] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    1.808759] ThumbEE CPU extension supported.
[    1.813292] mux: Failed to setup hwmod io irq -22
[    1.818743] Power Management for AM33XX family
[    1.823583] Trying to load am335x-pm-firmware.bin (60 secs timeout)
[    1.830274] Copied the M3 firmware to UMEM
[    1.834628] Cortex M3 Firmware Version = 0x18
[    1.839690] sr_init: platform driver register failed
[    1.847622] clock: disabling unused clocks to save power
[    1.862884] Detected MACID=1c:ba:8c:e1:8:a8
[    1.868155] cpsw: Detected MACID = 1c:ba:8c:e1:08:aa
[    1.874237] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[    1.881110] Waiting 1sec before mounting root device...
[    1.887812] mmc1: new high speed MMC card at address 0001
[    1.893979] mmcblk0: mmc1:0001 MMC02G 1.78 GiB
[    1.898818] mmcblk0boot0: mmc1:0001 MMC02G partition 1 1.00 MiB
[    1.905115] mmcblk0boot1: mmc1:0001 MMC02G partition 2 1.00 MiB
[    1.913168]  mmcblk0: p1 p2
[    1.918030]  mmcblk0boot1: unknown partition table
[    1.924615]  mmcblk0boot0: unknown partition table
[    2.956196] kjournald starting.  Commit interval 5 seconds
[    2.965618] EXT3-fs (mmcblk0p2): using internal journal
[    2.971095] EXT3-fs (mmcblk0p2): recovery complete
[    2.978254] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
[    2.985496] VFS: Mounted root (ext3 filesystem) on device 179:2.
[    2.992049] Freeing init memory: 240K
[    2.998013] Failed to execute /init.  Attempting defaults...
INIT: version 2.88 booting
Starting udev
Starting Bootlog daemon: bootlogd: cannot allocate pseudo tty: No such file or directory
bootlogd.
ALSA: Restoring mixer settings...
No state is present for card EVM
Found hardware: "AM335X_EVM" "" "" "" ""
Hardware is initialized using a generic method
No state is present for card EVM
Configuring network interfaces... [    8.069008] net eth0: CPSW phy found : id is : 0x7c0f1
udhcpc (v1.20.2) started
Sending discover...
Sending discover...
Sending discover...
No lease, failing
done.
hwclock: can't open '/dev/misc/rtc': No such file or directory
Fri Apr  5 12:35:00 UTC 2013
hwclock: can't open '/dev/misc/rtc': No such file or directory
INIT: Entering runlevel: 5
Failed to open "/etc/machine-id": No such file or directory
Starting Dropbear SSH server: dropbear.
Starting telnet daemon.
Performing wifi calibration...
rm: can't remove '/lib/firmware/ti-connectivity/wl1271-nvs.bin': No such file or directory
Error: Module wl12xx_sdio is not currently loaded
nl80211 not found.
[   17.452340] Disabling lock debugging due to kernel taint
hwclock: can't open '/dev/misc/rtc': No such file or directory
Starting network benchmark server: netserver.
Starting syslogd/klogd: done
Starting thttpd.
Starting PVR
Starting Lighttpd Web Server: lighttpd.
2013-04-05 12:35:00: (log.c.166) server started
/
Starting Matrix GUI application.
[   19.451238]  gadget: Mass Storage Function, version: 2009/09/11
[   19.457463]  gadget: Number of LUNs=1
[   19.461335]  lun0: LUN: removable file: /dev/mmcblk0p1
[   19.466732]  gadget: Mass Storage Gadget, version: 2009/09/11
[   19.472757]  gadget: userspace failed to provide iSerialNumber
[   19.478866]  gadget: g_mass_storage ready
[   19.483077] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
[   19.488658] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 2
[   19.496494] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[   19.503605] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   19.511162] usb usb2: Product: MUSB HDRC host driver
[   19.516350] usb usb2: Manufacturer: Linux 3.2.0 musb-hcd
[   19.521907] usb usb2: SerialNumber: musb-hdrc.0
[   19.527076] hub 2-0:1.0: USB hub found
[   19.531041] hub 2-0:1.0: 1 port detected
Stopping Bootlog daemon: bootlogd.


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


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


Arago 2013.02 am335x-evm ttyO1


am335x-evm login:

你可能感兴趣的:(android底层驱动)