Skip to contentSkip to conversation

configs/freescale_imx6dlsabresd: add defconfig for iMX6DL SabreSD

PATCH Superseded Luca Ceresoli 2 participants 5 messages Aug 14, 2014 Arm i.MX and Layerscape

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 configs/freescale_imx6dlsabresd: add defconfig for iMX6DL SabreSD

This is very similar to freescale_imx6sabresd_defconfig, which supports the i.MX6Q ("Quad", quad core CPU) version of the board, except it supports the i.MX6DL (DualLite, dual core CPU) version.

The differences are in the U-boot configuration and the device tree file.

Cc Gilles Talis <[email protected]>
Cc Gary Bisson <[email protected]>
Cc Vincent Stehl? <[email protected]>
---
 configs/freescale_imx6dlsabresd_defconfig | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 configs/freescale_imx6dlsabresd_defconfig
configs/freescale_imx6dlsabresd_defconfig new file +27 -0
new file mode 100644
index 0000000..4177e16
@@ -0,0 +1,27 @@
+# architecture
+BR2_arm=y
+BR2_cortex_a9=y
+
+# system
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
+
+# kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.freescale.com/imx/linux-2.6-imx.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="rel_imx_3.10.17_1.0.0_ga"
+BR2_LINUX_KERNEL_DEFCONFIG="imx_v7"
+BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x10008000"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6dl-sabresd"
+
+# filesystem
+BR2_TARGET_ROOTFS_EXT2=y
+
+# bootloader
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARDNAME="mx6dlsabresd"
+BR2_TARGET_UBOOT_FORMAT_IMX=y
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://git.freescale.com/imx/uboot-imx.git"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_imx_3.10.17_1.0.0_ga"
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 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.

Cc Gilles Talis <[email protected]>
Cc Gary Bisson <[email protected]>
Cc Vincent Stehl? <[email protected]>
---
 board/freescale/imx6sabresd/create-boot-sd.sh | 85 +++++++++++++++++++++++++++
 board/freescale/imx6sabresd/readme.txt        | 66 +++++++++++++++++++++
 2 files changed, 151 insertions(+)
 create mode 100755 board/freescale/imx6sabresd/create-boot-sd.sh
 create mode 100644 board/freescale/imx6sabresd/readme.txt
board/freescale/imx6sabresd/create-boot-sd.sh new file +85 -0
new file mode 100755
index 0000000..ebe3002
@@ -0,0 +1,85 @@
+#!/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} <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}
+PART1=${DEV}p1
+PART2=${DEV}p2
+
+# 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} <<EOF
+32,480,b
+512,,L
+EOF
+
+sync
+
+# Copy the bootloader@offset 1024
+dd if=output/images/u-boot.imx of=${DEV} obs=512 seek=2
+
+# Prepare a temp dir for mounting partitions
+TMPDIR=$(mktemp -d)
+
+# FAT partition: kernel and DTBs
+mkfs.vfat ${PART1}
+mount ${PART1} ${TMPDIR}
+cp output/images/uImage ${TMPDIR}/
+cp output/images/*.dtb  ${TMPDIR}/
+sync
+umount ${TMPDIR}
+
+# ext2 partition: root filesystem
+mkfs.ext2 ${PART2}
+mount ${PART2} ${TMPDIR}
+tar -C ${TMPDIR}/ -xf output/images/rootfs.tar
+sync
+umount ${TMPDIR}
+
+# Cleanup
+rmdir ${TMPDIR}
+sync
+echo Done
board/freescale/imx6sabresd/readme.txt new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 freescale/imx6-sabresd: document how to create a bootable SD

Quoted 2 lines · Luca Ceresoli

Document how to create a bootable SD card for the two supported SABRESD cards:
i.MX6Q and i.MX6DL.

Hi Luca,

Thanks for the script and documentation!

A few comments below:

Quoted 22 lines

The SD card creation relies on an ad-hoc script.

Cc Gilles Talis <[email protected]>
Cc Gary Bisson <[email protected]>
Cc Vincent Stehl? <[email protected]>
---
 board/freescale/imx6sabresd/create-boot-sd.sh | 85 +++++++++++++++++++++++++++
 board/freescale/imx6sabresd/readme.txt        | 66 +++++++++++++++++++++
 2 files changed, 151 insertions(+)
 create mode 100755 board/freescale/imx6sabresd/create-boot-sd.sh
 create mode 100644 board/freescale/imx6sabresd/readme.txt
board/freescale/imx6sabresd/create-boot-sd.sh new file +2 -0
new file mode 100755
index 0000000..ebe3002
@@ -0,0 +1,85 @@
+#!/bin/sh
+

board/freescale/imx6sabresd/create-boot-sd.sh line 12

Quoted 10 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +10 -0
+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."

It is now, and the resulting SD card boots fine :)

I needed to do just one change, though: the partitions names (see below).

Quoted 16 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +16 -0
+    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

board/freescale/imx6sabresd/create-boot-sd.sh line 38

Quoted 10 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +10 -0
+fi
+
+if [ $(id -u) -ne 0 ]; then
+    echo "${PROGNAME} must be run as root"
+    exit 1
+fi
+
+DEV=${1}
+PART1=${DEV}p1
+PART2=${DEV}p2

This naming is not fully true: with my USB SD card reader for example I have /dev/sde1, /dev/sde2.

That makes the mkfs step (and the script) fail for me. If I change just this naming, it works fine.

Quoted 20 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +20 -0
+
+# 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} <<EOF
+32,480,b
+512,,L
+EOF
+

board/freescale/imx6sabresd/create-boot-sd.sh line 68

Quoted 10 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +10 -0
+sync
+
+# Copy the bootloader at offset 1024
+dd if=output/images/u-boot.imx of=${DEV} obs=512 seek=2
+
+# Prepare a temp dir for mounting partitions
+TMPDIR=$(mktemp -d)
+
+# FAT partition: kernel and DTBs
+mkfs.vfat ${PART1}

First step to fails if part name is bad (see above).

board/freescale/imx6sabresd/create-boot-sd.sh line 80

Quoted 12 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +12 -0
+mount ${PART1} ${TMPDIR}
+cp output/images/uImage ${TMPDIR}/
+cp output/images/*.dtb  ${TMPDIR}/
+sync
+umount ${TMPDIR}
+
+# ext2 partition: root filesystem
+mkfs.ext2 ${PART2}
+mount ${PART2} ${TMPDIR}
+tar -C ${TMPDIR}/ -xf output/images/rootfs.tar
+sync
+umount ${TMPDIR}

Maybe you want to mention somewhere that your script uses the rootfs.tar and not the rootfs.ext2 as of now?

And if one day you support both the rootfs.ext2 and the rootfs.tar, I suggest you use the rootfs.ext2 in priority when both are generated (and maybe a resize2fs step). This way, you will benefit from the tune2fs done by buildroot.

Quoted 57 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +5 -0
+
+# Cleanup
+rmdir ${TMPDIR}
+sync
+echo Done
board/freescale/imx6sabresd/readme.txt new file +46 -0
new file mode 100644
index 0000000..c93347f
@@ -0,0 +1,66 @@
+*******************************************************
+Freescale i.MX6Q and i.MX6DL SABRESD development boards
+*******************************************************
+
+This file documents the Buildroot support for the Freescale SABRE Board for
+Smart Devices Based on the i.MX 6 Series (SABRESD).
+
+Read the SABRESD Quick Start Guide for an introduction to the board:
+http://cache.freescale.com/files/32bit/doc/quick_start_guide/SABRESDB_IMX6_QSG.pdf
+
+Build
+=====
+
+First, configure Buildroot for your SABRESD board.
+For i.MX6Q:
+
+  make freescale_imx6sabresd_defconfig
+
+For i.MX6DL:
+
+  make freescale_imx6dlsabresd_defconfig
+
+Build all components:
+
+  make
+
+You will find in ./output/images/ the following files:
+  - imx6dl-sabresd.dtb or imx6q-sabresd.dtb
+  - rootfs.ext2
+  - rootfs.tar
+  - u-boot.imx
+  - uImage
+
+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, DTBs and root filesystem as needed.
+
+*** WARNING! The script will destroy all the card content. Use with care! ***
+

board/freescale/imx6sabresd/readme.txt line 56

Quoted 10 lines
board/freescale/imx6sabresd/readme.txt new file +10 -0
+  ./board/freescale/imx6sabresd/create-boot-sd.sh <your-sd-device>
+
+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;

You might want to mention 115200n8.

board/freescale/imx6sabresd/readme.txt line 66

Quoted 10 lines
board/freescale/imx6sabresd/readme.txt new file +10 -0
+- 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

I am honored :)

Best regards,

V.

#3 lore raw

PATCH 2/2 freescale/imx6-sabresd: document how to create a bootable SD

Dear Vincent,

Quoted 10 lines · Vincent Stehl?
Quoted 2 lines · Luca Ceresoli

Document how to create a bootable SD card for the two supported SABRESD cards:
i.MX6Q and i.MX6DL.

Hi Luca,

Thanks for the script and documentation!

A few comments below:

[...]

Quoted 50 lines
Quoted 5 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +2 -0
@@ -0,0 +1,85 @@
+#!/bin/sh
+

board/freescale/imx6sabresd/create-boot-sd.sh line 12

Quoted 10 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +10 -0
+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."

It is now, and the resulting SD card boots fine :)

I needed to do just one change, though: the partitions names (see below).

Quoted 16 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +16 -0
+    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

board/freescale/imx6sabresd/create-boot-sd.sh line 38

Quoted 10 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +10 -0
+fi
+
+if [ $(id -u) -ne 0 ]; then
+    echo "${PROGNAME} must be run as root"
+    exit 1
+fi
+
+DEV=${1}
+PART1=${DEV}p1
+PART2=${DEV}p2

This naming is not fully true: with my USB SD card reader for example I have /dev/sde1, /dev/sde2.

Quoted 2 lines

That makes the mkfs step (and the script) fail for me. If I change just this naming, it works fine.

Yup, right.

[...]

Quoted 10 lines

board/freescale/imx6sabresd/create-boot-sd.sh line 80

Quoted 6 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +6 -0
+# ext2 partition: root filesystem
+mkfs.ext2 ${PART2}
+mount ${PART2} ${TMPDIR}
+tar -C ${TMPDIR}/ -xf output/images/rootfs.tar
+sync
+umount ${TMPDIR}

Maybe you want to mention somewhere that your script uses the rootfs.tar and not the rootfs.ext2 as of now?

Quoted 4 lines

And if one day you support both the rootfs.ext2 and the rootfs.tar, I suggest you use the rootfs.ext2 in priority when both are generated (and maybe a resize2fs step). This way, you will benefit from the tune2fs done by buildroot.

I'll have a look at this as soon as I can.

Quoted 62 lines
Quoted 62 lines
board/freescale/imx6sabresd/create-boot-sd.sh new file +5 -0
+
+# Cleanup
+rmdir ${TMPDIR}
+sync
+echo Done
board/freescale/imx6sabresd/readme.txt new file +50 -0
new file mode 100644
index 0000000..c93347f
@@ -0,0 +1,66 @@
+*******************************************************
+Freescale i.MX6Q and i.MX6DL SABRESD development boards
+*******************************************************
+
+This file documents the Buildroot support for the Freescale SABRE Board for
+Smart Devices Based on the i.MX 6 Series (SABRESD).
+
+Read the SABRESD Quick Start Guide for an introduction to the board:
+http://cache.freescale.com/files/32bit/doc/quick_start_guide/SABRESDB_IMX6_QSG.pdf
+
+Build
+=====
+
+First, configure Buildroot for your SABRESD board.
+For i.MX6Q:
+
+  make freescale_imx6sabresd_defconfig
+
+For i.MX6DL:
+
+  make freescale_imx6dlsabresd_defconfig
+
+Build all components:
+
+  make
+
+You will find in ./output/images/ the following files:
+  - imx6dl-sabresd.dtb or imx6q-sabresd.dtb
+  - rootfs.ext2
+  - rootfs.tar
+  - u-boot.imx
+  - uImage
+
+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, DTBs and root filesystem as needed.
+
+*** WARNING! The script will destroy all the card content. Use with care! ***
+
+  ./board/freescale/imx6sabresd/create-boot-sd.sh <your-sd-device>
+
+Boot the SABRESD board
+======================
Quoted 8 lines

board/freescale/imx6sabresd/readme.txt line 56

Quoted 6 lines
board/freescale/imx6sabresd/readme.txt new file +6 -0
+
+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;

You might want to mention 115200n8.

I just sent a v2 patchset with this change as well as a fix to the partition naming, since it may take some time before I can test the ext2 change.

Signature · 1 line
Luca
#4 lore raw

PATCH 1/2 configs/freescale_imx6dlsabresd: add defconfig for iMX6DL SabreSD

In reply to Luca Ceresoli
Quoted 1 line · Luca Ceresoli

This is very similar to freescale_imx6sabresd_defconfig

Hi Luca,

Thanks for adding this board!

It does build fine for me on top of 86b830d70a079f3b935b6afc8f429961fb738027. (I can't try to boot it though, as I only have an i.MX6 quad.)

Best regards,

V.