Skip to contentSkip to conversation

configs/toradex_colibri_imx6: initial commit

PATCH In review Hanspeter Portner 3 participants 3 messages Jun 10, 2021 – Jul 25, 2022 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs/toradex_colibri_imx6: initial commit

Based on configs/toradex_apalis_imx6 with Toradex' mainline linux/uboot branches.

Tested on:
Module: 'Toradex Col IMX6DL 512MB V1.0A'
Evalboard: 'Toradex Col Evaluation V3.2A'

---
 board/toradex/colibri-imx6/genimage.cfg  | 15 +++++++
 board/toradex/colibri-imx6/post-image.sh | 20 +++++++++
 board/toradex/colibri-imx6/readme.txt    | 53 ++++++++++++++++++++++++
 board/toradex/colibri-imx6/uEnv.txt      |  7 ++++
 configs/toradex_colibri_imx6_defconfig   | 25 +++++++++++
 5 files changed, 120 insertions(+)
 create mode 100644 board/toradex/colibri-imx6/genimage.cfg
 create mode 100755 board/toradex/colibri-imx6/post-image.sh
 create mode 100644 board/toradex/colibri-imx6/readme.txt
 create mode 100644 board/toradex/colibri-imx6/uEnv.txt
 create mode 100644 configs/toradex_colibri_imx6_defconfig
board/toradex/colibri-imx6/genimage.cfg new file +15 -0
new file mode 100644
index 0000000000..91c927c723
@@ -0,0 +1,15 @@
+# Minimal SD card image for the Toradex Colibri i.MX6 COM
+#
+# It does not need a boot section for a bootloader since it is booted
+# from its internal flash memory (eMMC).
+
+image sdcard.img {
+  hdimage {
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext2"
+    size = 512M
+  }
+}
board/toradex/colibri-imx6/post-image.sh new file +20 -0
new file mode 100755
index 0000000000..b95e175a29
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+GENIMAGE_CFG="$(dirname $0)/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+# copy the uEnv.txt to the output/images directory
+cp board/toradex/colibri-imx6/uEnv.txt $BINARIES_DIR/uEnv.txt
+
+rm -rf "${GENIMAGE_TMP}"
+
+# generate rootfs.img
+genimage \
+  --rootpath "${TARGET_DIR}" \
+  --tmppath "${GENIMAGE_TMP}" \
+  --inputpath "${BINARIES_DIR}" \
+  --outputpath "${BINARIES_DIR}" \
+  --config "${GENIMAGE_CFG}"
+
+RET=${?}
+exit ${RET}
board/toradex/colibri-imx6/readme.txt new file +53 -0

53 lines not on this page · raw message

board/toradex/colibri-imx6/uEnv.txt new file +7 -0
new file mode 100644
index 0000000000..e8fec787aa
@@ -0,0 +1,7 @@
+setenv boot_file 'zImage'
+setenv fdt_file 'imx6dl-colibri-eval-v3.dtb'
+setenv sdargs 'ip=off root=/dev/mmcblk0p1 rw,noatime rootfstype=ext4 rootwait'
+setenv sddtbload 'ext2load mmc 1:1 ${fdt_addr_r} boot/${fdt_file}'
+setenv sdkernelload 'ext2load mmc 1:1 ${kernel_addr_r} boot/${boot_file}'
+setenv bootcmd 'run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} ${vidargs}; echo Booting from SD card...; run sddtbload; run sdkernelload; bootz ${kernel_addr_r} - ${fdt_addr_r}'
+run bootcmd
configs/toradex_colibri_imx6_defconfig new file +25 -0
new file mode 100644
index 0000000000..0e50381579
@@ -0,0 +1,25 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/toradex/colibri-imx6/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.toradex.com/linux-toradex.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="toradex_5.4.y"
+BR2_LINUX_KERNEL_DEFCONFIG="toradex-imx_v6_v7"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6dl-colibri-eval-v3"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://git.toradex.com/u-boot-toradex.git"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="toradex_2020.07"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="colibri_imx6"
+BR2_TARGET_UBOOT_FORMAT_IMG=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="SPL"
+BR2_PACKAGE_HOST_GENIMAGE=y
Signature · 1 line
2.31.1
#1 lore raw

Hi Hanspeter,

Quoted 6 lines · Hanspeter Portner

Based on configs/toradex_apalis_imx6 with Toradex' mainline linux/uboot branches.

Tested on:
Module: 'Toradex Col IMX6DL 512MB V1.0A'
Evalboard: 'Toradex Col Evaluation V3.2A'

Overall commit log is not that clear. This patch "adds initial support(is it complete?) for toradex_colibri_imx6".

Can you please reword this commit log?

And...

Quoted 20 lines
---
  board/toradex/colibri-imx6/genimage.cfg  | 15 +++++++
  board/toradex/colibri-imx6/post-image.sh | 20 +++++++++
  board/toradex/colibri-imx6/readme.txt    | 53 ++++++++++++++++++++++++
  board/toradex/colibri-imx6/uEnv.txt      |  7 ++++
  configs/toradex_colibri_imx6_defconfig   | 25 +++++++++++
  5 files changed, 120 insertions(+)

create mode 100644 board/toradex/colibri-imx6/genimage.cfg create mode 100755 board/toradex/colibri-imx6/post-image.sh create mode 100644 board/toradex/colibri-imx6/readme.txt create mode 100644 board/toradex/colibri-imx6/uEnv.txt create mode 100644 configs/toradex_colibri_imx6_defconfig

board/toradex/colibri-imx6/genimage.cfg new file +0 -0
new file mode 100644
index 0000000000..91c927c723

board/toradex/colibri-imx6/genimage.cfg line 4

Quoted 4 lines
board/toradex/colibri-imx6/genimage.cfg new file +4 -0
@@ -0,0 +1,15 @@
+# Minimal SD card image for the Toradex Colibri i.MX6 COM
+#
+# It does not need a boot section for a bootloader since it is booted
+# from its internal flash memory (eMMC).

I'm not used to imx6 anymore for many years, so I don't remember how bootloader can automatically load u-boot and linux. Maybe here you didn't explain well what's going on and this should go for sure on commit log too.

Quoted 65 lines
board/toradex/colibri-imx6/genimage.cfg new file +11 -0
+
+image sdcard.img {
+  hdimage {
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext2"
+    size = 512M
+  }
+}
board/toradex/colibri-imx6/post-image.sh new file +20 -0
new file mode 100755
index 0000000000..b95e175a29
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+GENIMAGE_CFG="$(dirname $0)/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+# copy the uEnv.txt to the output/images directory
+cp board/toradex/colibri-imx6/uEnv.txt $BINARIES_DIR/uEnv.txt
+
+rm -rf "${GENIMAGE_TMP}"
+
+# generate rootfs.img
+genimage \
+  --rootpath "${TARGET_DIR}" \
+  --tmppath "${GENIMAGE_TMP}" \
+  --inputpath "${BINARIES_DIR}" \
+  --outputpath "${BINARIES_DIR}" \
+  --config "${GENIMAGE_CFG}"
+
+RET=${?}
+exit ${RET}
board/toradex/colibri-imx6/readme.txt new file +22 -0
new file mode 100644
index 0000000000..50078db173
@@ -0,0 +1,53 @@
+Toradex Colibri i.MX6 Computer on Module
+
+Intro
+=====
+
+The Colibri iMX6 is a SODIMM sized computer module based on NXP®/Freescale
+i.MX 6 SoC. The module targets a wide range of applications, including:
+Medical Devices, Navigation, Industrial Automation, HMIs, Avionics,
+Entertainment system, POS, Data Acquisition, Thin Clients, Robotics, Gaming
+and much more. It offers a wide range of interfaces from simple GPIOs, industry
+standard I2C, SPI, CAN, and UART buses through to high speed USB 2.0 interfaces
+and a 16/32bit external memory bus (parallel bus). The HDMI interface makes it
+very easy to connect large, full HD resolution displays
+
+https://www.toradex.com/computer-on-modules/colibri-arm-family/nxp-freescale-imx6
+
+It supports one carrier boards:
+
+Colibri Evaluation Board
+https://www.toradex.com/products/carrier-board/colibri-evaluation-board
+
+How to build it

board/toradex/colibri-imx6/readme.txt line 32

Quoted 10 lines
board/toradex/colibri-imx6/readme.txt new file +10 -0
+===============
+
+Configure Buildroot:
+
+    $ make toradex_colibri_imx6_defconfig
+
+Compile everything and build the rootfs image:
+
+    $ make
+

So here basically you only build the rootfs.

Quoted 11 lines
board/toradex/colibri-imx6/readme.txt new file +11 -0
+How to boot the image
+=====================
+
+The board only boots from its internal flash memory eMMC, so the
+bootloader image should be copied to it, following the procedures
+described in Toradex website.
+
+http://developer.toradex.com/knowledge-base/flashing-linux-on-imx6-modules
+
+Buildroot prepares a "sdcard.img" in output/images/ with the kernel
+image, device tree and a root filesystem, ready to be dumped on an SD

board/toradex/colibri-imx6/readme.txt line 53

Quoted 10 lines
board/toradex/colibri-imx6/readme.txt new file +10 -0
+card.
+
+    $ dd if=output/images/sdcard.img of=/dev/sdX bs=1M
+
+To boot from the SD card, you should change the U-Boot
+environment. Since U-Boot is running from internal eMMC, you will need
+to access its command line prompt and manually set the necessary
+variables to boot from the external SD card. For convenience, you can
+use uEnv.txt provided in output/images/ as a reference to create the
+necessary U-Boot variables to boot from the SD card.

Ah here it's clarified. But this only creates a rootfs and need some external intervention.

Couldn't you create support including u-boot in the genimage.cfg?

Because what I expect from a defconfig that produces a sdcard.img is that I flash it and it simply works.

Otherwise, please rename the defconfig by placing _rootfs_only suffix at the end. But I'd go for having a unique image with u-boot included.

Quoted 33 lines
board/toradex/colibri-imx6/uEnv.txt new file +7 -0
new file mode 100644
index 0000000000..e8fec787aa
@@ -0,0 +1,7 @@
+setenv boot_file 'zImage'
+setenv fdt_file 'imx6dl-colibri-eval-v3.dtb'
+setenv sdargs 'ip=off root=/dev/mmcblk0p1 rw,noatime rootfstype=ext4 rootwait'
+setenv sddtbload 'ext2load mmc 1:1 ${fdt_addr_r} boot/${fdt_file}'
+setenv sdkernelload 'ext2load mmc 1:1 ${kernel_addr_r} boot/${boot_file}'
+setenv bootcmd 'run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} ${vidargs}; echo Booting from SD card...; run sddtbload; run sdkernelload; bootz ${kernel_addr_r} - ${fdt_addr_r}'
+run bootcmd
configs/toradex_colibri_imx6_defconfig new file +14 -0
new file mode 100644
index 0000000000..0e50381579
@@ -0,0 +1,25 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/toradex/colibri-imx6/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.toradex.com/linux-toradex.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="toradex_5.4.y"
+BR2_LINUX_KERNEL_DEFCONFIG="toradex-imx_v6_v7"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6dl-colibri-eval-v3"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y

configs/toradex_colibri_imx6_defconfig line 24

Quoted 10 lines
configs/toradex_colibri_imx6_defconfig new file +10 -0
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://git.toradex.com/u-boot-toradex.git"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="toradex_2020.07"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="colibri_imx6"
+BR2_TARGET_UBOOT_FORMAT_IMG=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="SPL"

Where does u-boot binary goes into memory? Because as I can see, eMMC u-boot will be used instead of the sd-card one. So in case you only want to produce a rootfs with linux inside, I would also remove the uboot building here.

Thank you!
Best regards

Signature · 6 lines
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Hanspeter Portner

Hello Hanspeter,

Quoted 8 lines · On Thu, 10 Jun 2021 12:57:39 +0200 Hanspeter Portner…

Based on configs/toradex_apalis_imx6 with Toradex' mainline linux/uboot branches.

Tested on:
Module: 'Toradex Col IMX6DL 512MB V1.0A'
Evalboard: 'Toradex Col Evaluation V3.2A'

Quoted 12 lines
---
 board/toradex/colibri-imx6/genimage.cfg  | 15 +++++++
 board/toradex/colibri-imx6/post-image.sh | 20 +++++++++
 board/toradex/colibri-imx6/readme.txt    | 53 ++++++++++++++++++++++++
 board/toradex/colibri-imx6/uEnv.txt      |  7 ++++
 configs/toradex_colibri_imx6_defconfig   | 25 +++++++++++
 5 files changed, 120 insertions(+)
 create mode 100644 board/toradex/colibri-imx6/genimage.cfg
 create mode 100755 board/toradex/colibri-imx6/post-image.sh
 create mode 100644 board/toradex/colibri-imx6/readme.txt
 create mode 100644 board/toradex/colibri-imx6/uEnv.txt
 create mode 100644 configs/toradex_colibri_imx6_defconfig

Thanks for your contribution. However, you got some feedback in January 2022, which requested some changes/improvements, but unless we missed it, we did not receive an updated version of your patch.

I will now mark your patch as "Changes Requested" in our patch tracking system.

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot