summaryrefslogtreecommitdiff
path: root/board/freescale
diff options
context:
space:
mode:
authorVincent Stehlé <vincent.stehle@freescale.com>2015-03-22 14:25:15 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-04-03 17:26:00 +0200
commit0eb659d04e7854a25be09c5358212a7bfcc39b2b (patch)
tree9df0306e8e0c6acca93c42ad12c0b2b1be4b19ec /board/freescale
parent1536362eff8f5d5a20e2f6d486fa5027cf63fdec (diff)
config: Add defconfig for Freescale i.MX28 EVK
The i.MX28 Evaluation Kit (or EVK) is Freescale's evaluation board based on the i.MX287 Applications Processor. This defconfig is based on mainline u-boot and Linux kernel. Also, we add an SD card creation script and documentation, shamelessly based on the ones for i.MX5/6 by Luca Ceresoli. [Arnout: fixate U-Boot and kernel (headers) versions] Signed-off-by: Vincent Stehlé <vincent.stehle@freescale.com> Cc: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'board/freescale')
-rwxr-xr-xboard/freescale/imx28evk/create-boot-sd.sh97
-rw-r--r--board/freescale/imx28evk/readme.txt58
2 files changed, 155 insertions, 0 deletions
diff --git a/board/freescale/imx28evk/create-boot-sd.sh b/board/freescale/imx28evk/create-boot-sd.sh
new file mode 100755
index 000000000..5e050cbad
--- /dev/null
+++ b/board/freescale/imx28evk/create-boot-sd.sh
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+set -u
+set -e
+
+PROGNAME=$(basename $0)
+
+usage()
+{
+ echo "Create an SD card that boots on an i.MX28 EVK board."
+ 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} <sd_block_device>"
+ echo "Arguments:"
+ echo " <sd_block_device> 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
+PART3=${DEV}${PART}3
+
+# Unmount the partitions if mounted
+umount ${PART1} || true
+umount ${PART2} || true
+umount ${PART3} || true
+
+# First, clear the card
+dd if=/dev/zero of=${DEV} bs=1M count=20
+
+sync
+
+# Partition the card.
+# SD layout for i.MX28 boot:
+# - Special partition type 53 at sector 2048, containing an SD-SB-encapsulated u-boot
+# - FAT partition containing zImage
+# - ext2/3 partition formatted as ext2 or ext3, containing the root filesystem.
+sfdisk --force -u S ${DEV} <<EOF
+2048,2000,53
+4048,16000,b
+20048,,L
+EOF
+
+sync
+
+# Copy the bootloader at offset 2048
+# (We need to skip the partition table in the .sd, too.)
+dd if=output/images/u-boot.sd of=${DEV}1 bs=1M
+
+# Prepare a temp dir for mounting partitions
+TMPDIR=$(mktemp -d)
+
+# FAT partition: kernel
+mkfs.vfat ${PART2}
+mount ${PART2} ${TMPDIR}
+cp output/images/*Image ${TMPDIR}/
+cp output/images/*.dtb ${TMPDIR}/ || true
+sync
+umount ${TMPDIR}
+
+# ext2 partition: root filesystem
+mkfs.ext2 ${PART3}
+mount ${PART3} ${TMPDIR}
+tar -C ${TMPDIR}/ -xf output/images/rootfs.tar
+sync
+umount ${TMPDIR}
+
+# Cleanup
+rmdir ${TMPDIR}
+sync
+echo Done
diff --git a/board/freescale/imx28evk/readme.txt b/board/freescale/imx28evk/readme.txt
new file mode 100644
index 000000000..cbf6aae88
--- /dev/null
+++ b/board/freescale/imx28evk/readme.txt
@@ -0,0 +1,58 @@
+**************************
+Freescale i.MX28 EVK board
+**************************
+
+This file documents the Buildroot support for the Freescale i.MX28 EVK board.
+
+Read the i.MX28 Evaluation Kit Quick Start Guide [1] for an introduction to the
+board.
+
+Build
+=====
+
+First, configure Buildroot for your i.MX28 EVK board:
+
+ make freescale_imx28evk_defconfig
+
+Build all components:
+
+ make
+
+You will find in ./output/images/ the following files:
+ - imx28-evk.dtb
+ - rootfs.tar
+ - u-boot.sd
+ - zImage
+
+Create a bootable SD card
+=========================
+
+To determine the device associated to the SD card have a look in the
+/proc/partitions file:
+
+ cat /proc/partitions
+
+Run the following script as root on your SD card. This will partition the card
+and copy the bootloader, kernel and root filesystem as needed.
+
+*** WARNING! The script will destroy all the card content. Use with care! ***
+
+ ./board/freescale/imx28evk/create-boot-sd.sh <your-sd-device>
+
+Boot the i.MX28 EVK board
+=========================
+
+To boot your newly created system (refer to the i.MX28 EVK Quick Start Guide
+[1] for guidance):
+- insert the SD card in the SD Card Socket 0 of the board;
+- verify that your i.MX28 EVK board jumpers and switches are set as mentioned
+ in the i.MX28 EVK Quick Start Guide [1];
+- connect an RS232 UART cable to the Debug UART Port and connect using a
+ terminal emulator at 115200 bps, 8n1;
+- power on the board.
+
+Enjoy!
+
+References
+==========
+[1] http://cache.freescale.com/files/32bit/doc/user_guide/EVK_imx28_QuickStart.pdf