From patchwork Thu Aug 14 12:36:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 379920 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id E0FB91400DE for ; Thu, 14 Aug 2014 22:37:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E4C6688B11; Thu, 14 Aug 2014 12:37:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aIxcvc6ojiOR; Thu, 14 Aug 2014 12:37:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 29DE38A14D; Thu, 14 Aug 2014 12:37:17 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 6820C1BF97D for ; Thu, 14 Aug 2014 12:37:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 63DAA8B08A for ; Thu, 14 Aug 2014 12:37:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tuQyQHt31kRQ for ; Thu, 14 Aug 2014 12:37:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from srv-hp10.netsons.net (unknown [94.141.22.72]) by whitealder.osuosl.org (Postfix) with ESMTPS id C2AC78AFE4 for ; Thu, 14 Aug 2014 12:37:13 +0000 (UTC) Received: from host138-62-static.18-80-b.business.telecomitalia.it ([80.18.62.138]:49147 helo=wallace.comelit.it) by srv-hp10.netsons.net with esmtpa (Exim 4.82) (envelope-from ) id 1XHuHC-001mTI-Mm; Thu, 14 Aug 2014 14:37:06 +0200 From: Luca Ceresoli To: buildroot@busybox.net Date: Thu, 14 Aug 2014 14:36:53 +0200 Message-Id: <1408019813-17702-2-git-send-email-luca@lucaceresoli.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408019813-17702-1-git-send-email-luca@lucaceresoli.net> References: <1408019813-17702-1-git-send-email-luca@lucaceresoli.net> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - srv-hp10.netsons.net X-AntiAbuse: Original Domain - busybox.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: srv-hp10.netsons.net: authenticated_id: luca+lucaceresoli.net/only user confirmed/virtual account not confirmed X-Source: X-Source-Args: X-Source-Dir: Cc: Luca Ceresoli , Gary Bisson Subject: [Buildroot] [PATCH v2 2/2] freescale/imx6-sabresd: document how to create a bootable SD X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net 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é --- Changes since v1: - properly handle SD/MMC devices that don't need the "p" prefix before the partition number (reported by Vincent Stehlé); - mention serial terminal parameters in readme.txt (suggested by Vincent Stehlé). --- board/freescale/imx6sabresd/create-boot-sd.sh | 95 +++++++++++++++++++++++++++ board/freescale/imx6sabresd/readme.txt | 67 +++++++++++++++++++ 2 files changed, 162 insertions(+) create mode 100755 board/freescale/imx6sabresd/create-boot-sd.sh create mode 100644 board/freescale/imx6sabresd/readme.txt diff --git a/board/freescale/imx6sabresd/create-boot-sd.sh b/board/freescale/imx6sabresd/create-boot-sd.sh new file mode 100755 index 0000000..f82f7b3 --- /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=2 + +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