Wandboard SATA boot in yocto

From Wandboard Wiki
Jump to: navigation, search
Hardware modification

For SATA boot, we need to change boot mode of hardware from SD to SATA.

Follow the guide on official wandboard website to hack your wandboard:

http://wandboard.org/?start=29

Verify your Hardware modification

Download image "Yocto 1.5 armhf with Qt5" from wandboard website:

http://wandboard.org/index.php/downloads

The image with SPL u-boot can detect your boot mode and boot from SATA without modifying the code.

But the u-boot environment can't save into SATA storage, we just use this image to verify hardware modification.

Flash this image to SATA storge:
(You can put the source image to usb storage)
dd if=yocto-1.5_qt5_wandboard.img of=/dev/<your SATA device> bs=1M
sync

After boot into u-boot prompt:

setenv bootcmd 'sata read ${loadaddr} 0x800 0x1a00;bootm'
setenv bootargs 'console=ttymxc0,115200 root=/dev/sda1 rootwait rw'
run bootcmd

Then, it can boot into rootfs in SATA storage.

It verifies that your hardware modification works.


Add SATA boot support in Yocto u-boot

Download File:Wandboard quad sata boot.patch

cd <yocto_directory>/sources/meta-fsl-arm/recipes-bsp/u-boot
mkdir u-boot-fslc
cp Wandboard_quad_sata_boot.patch u-boot-fslc

vim u-boot-fslc_2013.10.bb

Add SATA boot patch into SRC_URI.

SRC_URI_append_mx6 = " \
   file://Wandboard_quad_sata_boot.patch \   
"

Then bitbake new image with SATA boot support.

bitbake fsl-image-gui

Flash new image into SATA storage

Flash this image to SATA storge:
(You can put the source image to usb storage)
dd if=fsl-image-gui.sdcard of=/dev/<your SATA device> bs=1M
sync

In u-boot prompt: Modify default bootcmd from mmc to sata.

Hit any key to stop autoboot:  0
=> setenv bootcmd 'fatload sata 0:1 ${loadaddr} uImage; setenv bootargs console=${console},${baudrate} root=/dev/sda2; bootm'
=> saveenv
Saving Environment to SATA...
Writing to SATA(0)... done

Then, SATA boot works.