From: Luca Ceresoli Date: Fri, 19 Sep 2014 14:12:51 +0000 (+0200) Subject: freescale/imx6-sabresd: document how to create a bootable SD X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7aff66f5b5225b2010a91f375d02159355b44104;p=buildroot.git freescale/imx6-sabresd: document how to create a bootable SD Document how to create a bootable SD card for the two supported SABRESD cards: i.MX6Q and i.MX6DL. The SD card creation relies on an ad-hoc script. Signed-off-by: Luca Ceresoli Cc: Gilles Talis Cc: Gary Bisson Cc: Vincent Stehlé Signed-off-by: Thomas Petazzoni --- diff --git a/board/freescale/imx6sabresd/create-boot-sd.sh b/board/freescale/imx6sabresd/create-boot-sd.sh new file mode 100755 index 0000000000..9930b1eed3 --- /dev/null +++ b/board/freescale/imx6sabresd/create-boot-sd.sh @@ -0,0 +1,95 @@ +#!/bin/sh + +set -u +set -e + +PROGNAME=$(basename $0) + +usage() +{ + echo "Create an SD card that boots on an i.MX6DL SABRESD board." + echo "It is supposed to work also for the i.MX6Q SABRESD board, but" + echo "it this is not tested." + echo + echo "Note: all data on the the card will be completely deleted!" + echo "Use with care!" + echo "Superuser permissions may be required to write to the device." + echo + echo "Usage: ${PROGNAME} " + echo "Arguments:" + echo " The device to be written to" + echo + echo "Example: ${PROGNAME} /dev/mmcblk0" + echo +} + +if [ $# -ne 1 ]; then + usage + exit 1 +fi + +if [ $(id -u) -ne 0 ]; then + echo "${PROGNAME} must be run as root" + exit 1 +fi + +DEV=${1} + +# The partition name prefix depends on the device name: +# - /dev/sde -> /dev/sde1 +# - /dev/mmcblk0 -> /dev/mmcblk0p1 +if echo ${DEV}|grep -q mmcblk ; then + PART="p" +else + PART="" +fi + +PART1=${DEV}${PART}1 +PART2=${DEV}${PART}2 + +# Unmount the partitions if mounted +umount ${PART1} || true +umount ${PART2} || true + +# First, clear the card +dd if=/dev/zero of=${DEV} bs=1M count=20 + +sync + +# Partition the card. +# SD layout for i.MX6 boot: +# - Bootloader at offset 1024 +# - FAT partition starting at 1MB offset, containing uImage and *.dtb +# - ext2/3 partition formatted as ext2 or ext3, containing the root filesystem. +sfdisk ${DEV} < + +Boot the SABRESD board +====================== + +To boot your newly created system (refer to the SABRESD Quick Start Guide for +guidance): +- insert the SD card in the SD3 slot of the board; +- locate the BOOT dip switches (SW6), set dips 2 and 7 to ON, all others to OFF; +- connect a Micro USB cable to Debug Port and connect using a terminal emulator + at 115200 bps, 8n1; +- power on the board. + +Enjoy! + +References +========== + +https://community.freescale.com/docs/DOC-95015 +https://community.freescale.com/docs/DOC-95017 +https://community.freescale.com/docs/DOC-99218