Skip to contentSkip to conversation

board/udoo: bsp updates and cleanup

PATCH New Sergey Matyukevich 2 participants 5 messages Oct 13, 2020 – Oct 15, 2020

lore
Share & tools
lore
#0 lore raw

v2 cover board/udoo: bsp updates and cleanup

Hello Thomas, Fabio and all,

Here is a v2 patch series for Udoo boards with BSP updates and several cleanups required to make updated BSP work out of the box. Major changes include:

- bump Udoo Quad/Dual Linux kernel to 5.8.13
- bump Udoo Quad/Dual U-Boot to 2020.10
- udoo/mx6qdl: disable usbh1 in dts rather than in kernel configuration
- use common freescale image infrastructure for all the Udoo boards

Regards,
Sergey

Changes v1 -> v2:
- Udoo Neo BSP update patch has been already applied
- rework: switch all Udoo boards to freescale common infrastructure

Sergey Matyukevich (3):
configs/mx6udoo_defconfig: bump kernel and U-Boot versions board/udoo/mx6qdl: disable usb host in device tree board/udoo: use common freescale infrastructure

 board/udoo/{neo => common}/boot.scr.txt       |  2 +-
 board/udoo/common/post-build.sh               |  3 ++
 board/udoo/mx6qdl/linux.fragment              |  1 -
 .../linux/0000-udoo-disable-usbh1.patch       | 26 +++++++++++++++
 board/udoo/mx6qdl/readme.txt                  |  2 +-
 board/udoo/neo/genimage.cfg                   | 32 -------------------
 board/udoo/neo/post-build.sh                  |  7 ----
 board/udoo/neo/post-image.sh                  | 15 ---------
 board/udoo/neo/readme.txt                     |  2 +-
 configs/mx6sx_udoo_neo_defconfig              |  6 ++--
 configs/mx6udoo_defconfig                     | 15 ++++++---
 11 files changed, 46 insertions(+), 65 deletions(-)
 rename board/udoo/{neo => common}/boot.scr.txt (66%)
 create mode 100755 board/udoo/common/post-build.sh
 delete mode 100644 board/udoo/mx6qdl/linux.fragment
 create mode 100644 board/udoo/mx6qdl/patches/linux/0000-udoo-disable-usbh1.patch
 delete mode 100644 board/udoo/neo/genimage.cfg
 delete mode 100755 board/udoo/neo/post-build.sh
 delete mode 100755 board/udoo/neo/post-image.sh
Signature · 1 line
2.28.0
#1 lore raw

PATCH v2 1/3 configs/mx6udoo_defconfig: bump kernel and U-Boot versions

Bump Linux kernel to 5.8.13 and U-Boot to 2020.10.

---
 configs/mx6udoo_defconfig | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
configs/mx6udoo_defconfig +4 -4
index 86ad13bbf3..d208f5846e 100644
@@ -3,8 +3,8 @@ BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
 BR2_ARM_ENABLE_VFP=y
 BR2_ARM_FPU_VFPV3=y
-# Linux headers same as kernel, a 4.14 series
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_14=y
+# Linux headers same as kernel, a 5.8 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
@@ -12,13 +12,13 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="udoo"
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2018.01"
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.10"
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="SPL"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.13"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7"
 BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/udoo/mx6qdl/linux.fragment"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
Signature · 1 line
2.28.0
#2 lore raw

PATCH v2 2/3 board/udoo/mx6qdl: disable usb host in device tree

In reply to Sergey Matyukevich

After BSP update Udoo Quad/Dual board once again hangs on boot. On a new kernel disabling CONFIG_USB option is not enough to work around the troublesome usb host on Udoo Quad/Dual board. So in order to be future-proof it makes sense to disable usbh1 block in device tree rather than fine-tune kernel configuration after BSP updates.

---
 board/udoo/mx6qdl/linux.fragment              |  1 -
 .../linux/0000-udoo-disable-usbh1.patch       | 26 +++++++++++++++++++
 configs/mx6udoo_defconfig                     |  2 +-
 3 files changed, 27 insertions(+), 2 deletions(-)
 delete mode 100644 board/udoo/mx6qdl/linux.fragment
 create mode 100644 board/udoo/mx6qdl/patches/linux/0000-udoo-disable-usbh1.patch
board/udoo/mx6qdl/linux.fragment deleted +0 -1
deleted file mode 100644
index 1d2509982b..0000000000
@@ -1 +0,0 @@
-# CONFIG_USB is not set
board/udoo/mx6qdl/patches/linux/0000-udoo-disable-usbh1.patch new file +26 -0
new file mode 100644
index 0000000000..d151a40d6e
@@ -0,0 +1,26 @@
+[PATCH] ARM: dts: imx6qdl-udoo: Disable usbh1 to avoid kernel hang
+
+Currently the kernel hangs when USB Host1 is enabled due to the lack of
+support for controlling the USB hub clock and GPIO reset line.
+
+Peter Chen has made several attempts to fix this problem, but his series
+has not been applied yet, so better disable USB host1 for now to avoid
+the kernel hang.
+
+Signed-off-by: Fabio Estevam <[email protected]>
+---
+
+diff --git a/arch/arm/boot/dts/imx6qdl-udoo.dtsi b/arch/arm/boot/dts/imx6qdl-udoo.dtsi
+index 828dd20cd27d..c9e122865312 100644
+--- a/arch/arm/boot/dts/imx6qdl-udoo.dtsi
++++ b/arch/arm/boot/dts/imx6qdl-udoo.dtsi
+@@ -292,7 +292,8 @@ &usbh1 {
+ 	pinctrl-0 = <&pinctrl_usbh>;
+ 	vbus-supply = <&reg_usb_h1_vbus>;
+ 	clocks = <&clks IMX6QDL_CLK_CKO>;
+-	status = "okay";
++	/* currently USB support causes a kernel hang. Disable it for now */
++	status = "disabled";
+ };
+ 
+ &usbotg {
configs/mx6udoo_defconfig +1 -1
index d208f5846e..be56f3014e 100644
@@ -3,6 +3,7 @@ BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
 BR2_ARM_ENABLE_VFP=y
 BR2_ARM_FPU_VFPV3=y
+BR2_GLOBAL_PATCH_DIR="board/udoo/mx6qdl/patches"
 # Linux headers same as kernel, a 5.8 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
@@ -20,7 +21,6 @@ BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7"
-BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/udoo/mx6qdl/linux.fragment"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-udoo imx6dl-udoo"
 # required tools to create the SD card image
Signature · 1 line
2.28.0
#3 lore raw

PATCH v2 3/3 board/udoo: use common freescale infrastructure

In reply to Sergey Matyukevich

U-Boot 2020.10 no longer provides boot command in default environment for Udoo Quad/Dual board. Boot script needs to be added to the image. In order to keep using common infrastructure for freescale boards, move boot files to root filesystem and add boot script there. Also switch Udoo Neo board to common freescale infrastructure to simplify maintenance.

---
 board/udoo/{neo => common}/boot.scr.txt |  2 +-
 board/udoo/common/post-build.sh         |  3 +++
 board/udoo/mx6qdl/readme.txt            |  2 +-
 board/udoo/neo/genimage.cfg             | 32 -------------------------
 board/udoo/neo/post-build.sh            |  7 ------
 board/udoo/neo/post-image.sh            | 15 ------------
 board/udoo/neo/readme.txt               |  2 +-
 configs/mx6sx_udoo_neo_defconfig        |  6 +++--
 configs/mx6udoo_defconfig               |  5 ++++
 9 files changed, 15 insertions(+), 59 deletions(-)
 rename board/udoo/{neo => common}/boot.scr.txt (66%)
 create mode 100755 board/udoo/common/post-build.sh
 delete mode 100644 board/udoo/neo/genimage.cfg
 delete mode 100755 board/udoo/neo/post-build.sh
 delete mode 100755 board/udoo/neo/post-image.sh
board/udoo/common/boot.scr.txt renamed from board/udoo/neo/boot.scr.txt +1 -1
similarity index 66%
rename from board/udoo/neo/boot.scr.txt
rename to board/udoo/common/boot.scr.txt
index 7a8aa4bd54..7acceed0fb 100644
@@ -1,7 +1,7 @@
 setenv finduuid "part uuid mmc 0:1 uuid"
 run finduuid
 run findfdt
-setenv bootargs "console=ttymxc0,115200 root=PARTUUID=${uuid} rootwait rootfstype=ext4"
+setenv bootargs "console=${console} root=PARTUUID=${uuid} rootwait rootfstype=ext4"
 load mmc 0:1 ${fdt_addr} boot/${fdtfile}
 load mmc 0:1 ${loadaddr} boot/zImage
 bootz ${loadaddr} - ${fdt_addr}
board/udoo/common/post-build.sh new file +3 -0
new file mode 100755
index 0000000000..d3f612f811
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+cp $BINARIES_DIR/boot.scr $TARGET_DIR/boot/boot.scr
board/udoo/mx6qdl/readme.txt +1 -1
index cf1a610421..a7ca98cc8a 100644
@@ -14,4 +14,4 @@ directory, ready to be dumped on a micro SD card:
 dd if=output/images/sdcard.img of=/dev/<your-microsd-device>
 
 For details about the medium image layout, see the definition in
-board/udoo/mx6qdl/genimage.cfg.
+board/freescale/common/imx/genimage.cfg.template_no_boot_part_spl.
board/udoo/neo/genimage.cfg deleted +0 -32
deleted file mode 100644
index 46209120f0..0000000000
@@ -1,32 +0,0 @@
-# Minimal SD card image for the MX6SX Udoo Neo board
-#
-# The SD card must have at least 1 MB free at the beginning.
-# U-Boot and its environment are dumped as is.
-# A single root filesystem partition is required (Ext4 in this case).
-#
-# For details about the layout, see:
-# http://wiki.wandboard.org/index.php/Boot-process
-
-image sdcard.img {
-  hdimage {
-  }
-
-  partition spl {
-    in-partition-table = "no"
-    image = "SPL"
-    offset = 1K
-  }
-
-  partition u-boot {
-    in-partition-table = "no"
-    image = "u-boot.img"
-    offset = 69K
-  }
-
-  partition rootfs {
-    partition-type = 0x83
-    image = "rootfs.ext4"
-    offset = 1M
-    size = 512M
-  }
-}
board/udoo/neo/post-build.sh deleted +0 -7
deleted file mode 100755
index 6ccd87fafd..0000000000
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-BOARD_DIR="$(dirname $0)"
-
-install -d -m 755 $TARGET_DIR/boot
-$HOST_DIR/bin/mkimage -A arm -O linux -T script -C none  \
-	-n "boot script" -d $BOARD_DIR/boot.scr.txt $TARGET_DIR/boot/boot.scr
board/udoo/neo/post-image.sh deleted +0 -15
deleted file mode 100755
index 18e76aa40d..0000000000
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage \
-  --rootpath "${TARGET_DIR}" \
-  --tmppath "${GENIMAGE_TMP}" \
-  --inputpath "${BINARIES_DIR}" \
-  --outputpath "${BINARIES_DIR}" \
-  --config "${GENIMAGE_CFG}"
-
board/udoo/neo/readme.txt +1 -1
index f037ad484a..94ebcc12f2 100644
@@ -13,4 +13,4 @@ directory, ready to be dumped on an SD card:
 dd if=output/images/sdcard.img of=/dev/<your-microsd-device>
 
 For details about the medium image layout, see the definition in
-board/udoo/neo/genimage.cfg.
+board/freescale/common/imx/genimage.cfg.template_no_boot_part_spl.
configs/mx6sx_udoo_neo_defconfig +4 -2
index 57b9562c06..4a2f8b0bc0 100644
@@ -5,8 +5,8 @@ BR2_ARM_ENABLE_VFP=y
 BR2_ARM_FPU_VFPV3=y
 # Linux headers same as kernel, a 5.8 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
-BR2_ROOTFS_POST_BUILD_SCRIPT="board/udoo/neo/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/udoo/neo/post-image.sh"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/udoo/common/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 BR2_TARGET_UBOOT=y
@@ -28,3 +28,5 @@ BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/udoo/common/boot.scr.txt"
configs/mx6udoo_defconfig +5 -0
index be56f3014e..058dc4534d 100644
@@ -7,6 +7,7 @@ BR2_GLOBAL_PATCH_DIR="board/udoo/mx6qdl/patches"
 # Linux headers same as kernel, a 5.8 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/udoo/common/post-build.sh"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
@@ -23,7 +24,11 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-udoo imx6dl-udoo"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
 # required tools to create the SD card image
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/udoo/common/boot.scr.txt"
Signature · 1 line
2.28.0
#4 lore raw

v2 cover board/udoo: bsp updates and cleanup

In reply to Sergey Matyukevich
Quoted 4 lines · On Tue, 13 Oct 2020 23:16:18 +0300 Sergey Matyukevich <[email protected]>…

Sergey Matyukevich (3):
configs/mx6udoo_defconfig: bump kernel and U-Boot versions board/udoo/mx6qdl: disable usb host in device tree board/udoo: use common freescale infrastructure

Thanks, applied!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com