if [ -f "$PREFIX/usr/share/uboot/$TARGET/SPL" ]; then
# write a SPL uboot if it's present
echo "= Writing SPL ...."
dd if=$PREFIX/usr/share/uboot/$TARGET/SPL of=$MEDIA seek=1 bs=1k
echo "= Writing u-boot.img ...."
dd if=$PREFIX/usr/share/uboot/$TARGET/u-boot.img of=$MEDIA bs=1k seek=69 conv=fsync; sync
else
# else fail back to traditional uboot
echo "= Writing u-boot.imx ...."
dd if=$PREFIX/usr/share/uboot/$TARGET/u-boot.imx of=$MEDIA bs=1k seek=1 conv=fsync; sync
fi
# set console for imx6
SYSCON=ttymxc0,115200
