imx: add support for Toradex Colibri iMX6ULL Aster
authorPetr Štetiar <ynezz@true.cz>
Wed, 2 Jun 2021 13:30:59 +0000 (15:30 +0200)
committerPetr Štetiar <ynezz@true.cz>
Thu, 25 Aug 2022 20:08:13 +0000 (22:08 +0200)
Add support for Toradex Colibri iMX6ULL 256MB module on Aster carrier
board. The Colibri iMX6ULL is a SODIMM-sized SoM based on NXP i.MX 6ULL
application processor, featuring a power-efficient Arm Cortex-A7 core.
Aster is a carrier board for the Colibri Family of Computer on Modules.
Aster carrier board has headers compatible with Arduino Uno and
Raspberry Pi (RPi) maker board, thus enabling users to use a huge
variety of third party shields/add-on boards.

Specifications of iMX6ULL:

 - CPU: i.MX 6ULL, 1x Arm Cortex-A7 (528-900MHz)
 - RAM: 256-512MB DDR3L (16 Bit)
 - Flash: 512MB SLC NAND (MX30LF4G28AC)

Specifications of Aster carrier board:

 - USB 2.0: 2x Host, 1x Client (Shared)
 - 10/100 Mbit Ethernet (KSZ8041)
 - 1x I2C, 1x SPI, 4x PWM, 4x ADC, 1x CAN, up to 3x LEDs, up to 39 GPIOs
 - Audio out: 1x (Stereo), Audio in: 1x (Stereo)
 - 1x Camera Parallel Interface, 4-wire Resistive Touch
 - Battery backed M41T0M6 RTC module
 - JTAG

Flashing instructions:

 1. Boot initramfs image from U-Boot

    setenv bootfile openwrt-imx-cortexa7-toradex_colibri-imx6ull-aster-initramfs-fit-zImage.itb
    run setup && tftpboot ${kernel_addr_r} ${bootfile} && bootm ${kernel_addr_r}

 2. Download openwrt-imx-cortexa7-toradex_colibri-imx6ull-aster-squashfs-sysupgrade.tar to device
 3. Run sysupgrade

Signed-off-by: Petr Štetiar <ynezz@true.cz>
package/boot/uboot-envtools/files/imx_cortexa9
package/boot/uboot-imx/Makefile
package/boot/uboot-imx/patches/0002-Makefile-add-u-boot-nand.imx-target.patch [new file with mode: 0644]
target/linux/imx/Makefile
target/linux/imx/cortexa7/base-files/etc/board.d/02_network
target/linux/imx/cortexa7/base-files/lib/upgrade/platform.sh
target/linux/imx/cortexa7/config-default
target/linux/imx/image/cortexa7.mk
target/linux/imx/patches-5.10/500-ARM-dts-imx6ull-add-support-for-Toradex-Aster-carrie.patch [new file with mode: 0644]

index c6d6d94d1642c9652ca61c0d3f618e788e765a3f..89204f0ade777002f02b14097ace958d6463424f 100644 (file)
@@ -53,6 +53,9 @@ toradex,apalis_imx6q-ixora|\
 toradex,apalis_imx6q-ixora-v1.1)
        ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10
        ;;
+toradex,colibri-imx6ull-aster)
+       ubootenv_add_uci_config /dev/mtd3 0 0x00020000 0x20000
+       ;;
 wand,imx6dl-wandboard)
        ubootenv_add_uci_config "/dev/mmcblk0" "0x60000" "0x2000" "0x2000"
        ;;
index ade26db768658758fdf747880d8a085c4d940d4c..1e9c50ad5dd10c9abb1d7353ef12b707aa722710 100644 (file)
@@ -28,6 +28,14 @@ define U-Boot/apalis_imx6
   BUILD_DEVICES:=toradex_apalis
 endef
 
+define U-Boot/colibri-imx6ull
+  NAME:=Toradex Colibri iMX6ULL
+  UBOOT_IMAGE:=u-boot-nand.imx
+  UBOOT_MAKE_FLAGS+=u-boot-nand.imx CONFIG_IMX_NAND=y
+  BUILD_SUBTARGET:=cortexa7
+  BUILD_DEVICES:=colibri-imx6ull
+endef
+
 define U-Boot/mx6cuboxi
   NAME:=SolidRun Cubox-i boards
   UBOOT_IMAGE:=SPL u-boot-dtb.img
@@ -52,6 +60,7 @@ endef
 
 UBOOT_TARGETS := \
        apalis_imx6 \
+       colibri-imx6ull \
        mx6cuboxi \
        pico-pi-imx7d \
        wandboard
diff --git a/package/boot/uboot-imx/patches/0002-Makefile-add-u-boot-nand.imx-target.patch b/package/boot/uboot-imx/patches/0002-Makefile-add-u-boot-nand.imx-target.patch
new file mode 100644 (file)
index 0000000..c45bff3
--- /dev/null
@@ -0,0 +1,72 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
+Date: Thu, 13 May 2021 23:09:35 +0300
+Subject: [PATCH] Makefile: add u-boot-nand.imx target
+
+NAND modules (Colibri Vybrid, iMX7, iMX6ULL) require the images with
+1024 prepending bytes.
+Add the u-boot-nand.imx target which enables with CONFIG_IMX_NAND
+option.
+
+Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
+---
+ Makefile                   | 4 ++++
+ arch/arm/config.mk         | 4 ++++
+ arch/arm/mach-imx/Makefile | 8 ++++++++
+ 3 files changed, 16 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 7b526f4f5a88..3e3e6ff9ffab 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1166,6 +1166,10 @@ ifeq ($(CONFIG_MULTI_DTB_FIT),y)
+ IMX_DEPS = u-boot-fit-dtb.bin
+ endif
++u-boot-nand.imx: u-boot.imx
++      $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
++      $(BOARD_SIZE_CHECK)
++
+ %.imx: $(IMX_DEPS) %.bin
+       $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
+       $(BOARD_SIZE_CHECK)
+diff --git a/arch/arm/config.mk b/arch/arm/config.mk
+index 4153f7e37130..5993827cdd66 100644
+--- a/arch/arm/config.mk
++++ b/arch/arm/config.mk
+@@ -157,12 +157,16 @@ ifndef CONFIG_SPL_BUILD
+ INPUTS-y += SPL
+ endif
+ else
++ifeq ($(CONFIG_IMX_NAND),y)
++ALL-y += u-boot-nand.imx
++else
+ ifeq ($(CONFIG_OF_SEPARATE),y)
+ INPUTS-y += u-boot-dtb.imx
+ else
+ INPUTS-y += u-boot.imx
+ endif
+ endif
++endif
+ ifneq ($(CONFIG_VF610),)
+ INPUTS-y += u-boot.vyb
+ endif
+diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
+index e6b4654cd358..a2fdbdd6387c 100644
+--- a/arch/arm/mach-imx/Makefile
++++ b/arch/arm/mach-imx/Makefile
+@@ -121,6 +121,14 @@ u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
+ u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
+       $(call if_changed,mkimage)
++ifeq ($(CONFIG_IMX_NAND),y)
++cmd_u-boot-nand_imx = (dd bs=1024 count=1 if=/dev/zero 2>/dev/null) | \
++      cat - $< > $@
++
++u-boot-nand.imx: u-boot.imx FORCE
++      $(call if_changed,u-boot-nand_imx)
++endif
++
+ ifeq ($(CONFIG_MULTI_DTB_FIT),y)
+ MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
+       -T $(IMAGE_TYPE) -e $(CONFIG_SYS_TEXT_BASE)
index 5fb7a4d339ef54402ee6dc48af9095c6e15a9a9d..753065f540298246dd7f015a0b0faaa7f1f36561 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 ARCH:=arm
 BOARD:=imx
 BOARDNAME:=NXP i.MX
-FEATURES:=audio display fpu gpio pcie rtc usb usbgadget squashfs targz nand ubifs boot-part rootfs-part
+FEATURES:=audio display fpu gpio pcie rtc usb usbgadget squashfs targz nand ubifs boot-part rootfs-part separate_ramdisk
 SUBTARGETS:=cortexa7 cortexa9
 
 KERNEL_PATCHVER:=5.15
index 8ada58e6c1f6add4e8228de57acb543d8958976c..e260af7d4afaf10333379fa8e968e58004b8591e 100644 (file)
@@ -5,7 +5,8 @@ board=$(board_name)
 board_config_update
 
 case "$board" in
-technexion,imx7d-pico-pi)
+technexion,imx7d-pico-pi|\
+toradex,colibri-imx6ull-aster)
        ucidef_set_interface_lan "eth0"
        ;;
 *)
index 1bdc2aa4b930f6ccfea474e80894f782a15a02e9..3656378fbff8df9b55fa2d1bd6620b56bb4ca921 100644 (file)
@@ -4,7 +4,8 @@ RAMFS_COPY_BIN='blkid jffs2reset'
 
 enable_image_metadata_check() {
        case "$(board_name)" in
-       technexion,imx7d-pico-pi)
+       technexion,imx7d-pico-pi|\
+       toradex,colibri-imx6ull-aster)
                REQUIRE_IMAGE_METADATA=1
                ;;
        esac
@@ -15,7 +16,8 @@ platform_check_image() {
        local board=$(board_name)
 
        case "$board" in
-       technexion,imx7d-pico-pi)
+       technexion,imx7d-pico-pi|\
+       toradex,colibri-imx6ull-aster)
                return 0
                ;;
        esac
@@ -31,6 +33,9 @@ platform_do_upgrade() {
        technexion,imx7d-pico-pi)
                imx_sdcard_do_upgrade "$1"
                ;;
+       toradex,colibri-imx6ull-aster)
+               nand_do_upgrade "$1"
+               ;;
        esac
 }
 
index 10f23be435d7457d83b14941b6c9ff83c6fed10f..52d1913940ffeb022ae352d3ec4864b32448c4a9 100644 (file)
@@ -64,6 +64,7 @@ CONFIG_JFFS2_FS=y
 CONFIG_KCMP=y
 CONFIG_LEDS_GPIO=y
 CONFIG_MEMORY_ISOLATION=y
+CONFIG_MICREL_PHY=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
index b4ac1b6904d571d4c0703c32933939f17e8351d2..f57456baba49b500456027b5a3e002727025e093 100644 (file)
@@ -28,3 +28,27 @@ define Device/technexion_imx7d-pico-pi
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 endef
 TARGET_DEVICES += technexion_imx7d-pico-pi
+
+define Device/toradex_colibri-imx6ull-aster
+  DEVICE_VENDOR := Toradex
+  DEVICE_MODEL := Colibri iMX6ULL Aster
+  DEVICE_DTS := imx6ull-colibri-aster
+  DEVICE_PACKAGES := \
+       kmod-can kmod-can-flexcan kmod-can-raw \
+       kmod-leds-gpio kmod-gpio-button-hotplug \
+       kmod-pps-gpio kmod-rtc-ds1307
+  FILESYSTEMS := squashfs
+  KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+  KERNEL_SUFFIX := -fit-zImage.itb
+  KERNEL_INITRAMFS := kernel-bin | gzip | \
+       fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb with-initrd
+  PAGESIZE := 2048
+  BLOCKSIZE := 128k
+  KERNEL_SIZE := 4096k
+  KERNEL_IN_UBI := 1
+  IMAGES := factory.bin sysupgrade.tar
+  IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
+  IMAGE/factory.bin := append-ubi
+  SUPPORTED_DEVICES := toradex,colibri-imx6ull-aster
+endef
+TARGET_DEVICES += toradex_colibri-imx6ull-aster
diff --git a/target/linux/imx/patches-5.10/500-ARM-dts-imx6ull-add-support-for-Toradex-Aster-carrie.patch b/target/linux/imx/patches-5.10/500-ARM-dts-imx6ull-add-support-for-Toradex-Aster-carrie.patch
new file mode 100644 (file)
index 0000000..58e40a6
--- /dev/null
@@ -0,0 +1,190 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz>
+Date: Wed, 2 Jun 2021 15:00:52 +0200
+Subject: [PATCH] ARM: dts: imx6ull: add support for Toradex Aster carrier
+ board
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Add support for iMX6ULL SoM attached to Toradex Aster carrier board.
+
+Signed-off-by: Petr Štetiar <ynezz@true.cz>
+---
+ arch/arm/boot/dts/Makefile                   |   1 +
+ arch/arm/boot/dts/imx6ull-colibri-aster.dts  |  14 ++
+ arch/arm/boot/dts/imx6ull-colibri-aster.dtsi | 132 +++++++++++++++++++
+ 3 files changed, 147 insertions(+)
+ create mode 100644 arch/arm/boot/dts/imx6ull-colibri-aster.dts
+ create mode 100644 arch/arm/boot/dts/imx6ull-colibri-aster.dtsi
+
+diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
+index ce66ffd5a1bb..2ea850a50f60 100644
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -627,6 +627,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
+       imx6ul-tx6ul-0011.dtb \
+       imx6ul-tx6ul-mainboard.dtb \
+       imx6ull-14x14-evk.dtb \
++      imx6ull-colibri-aster.dtb \
+       imx6ull-colibri-eval-v3.dtb \
+       imx6ull-colibri-wifi-eval-v3.dtb \
+       imx6ull-myir-mys-6ulx-eval.dtb \
+diff --git a/arch/arm/boot/dts/imx6ull-colibri-aster.dts b/arch/arm/boot/dts/imx6ull-colibri-aster.dts
+new file mode 100644
+index 000000000000..0a314af5a728
+--- /dev/null
++++ b/arch/arm/boot/dts/imx6ull-colibri-aster.dts
+@@ -0,0 +1,14 @@
++// SPDX-License-Identifier: (GPL-2.0 OR MIT)
++/*
++ * Copyright 2017-2020 Toradex AG
++ *
++ */
++
++/dts-v1/;
++#include "imx6ull-colibri-nonwifi.dtsi"
++#include "imx6ull-colibri-aster.dtsi"
++
++/ {
++      model = "Toradex Colibri iMX6ULL 256MB on Aster Carrier board";
++      compatible = "toradex,colibri-imx6ull-aster", "fsl,imx6ull";
++};
+diff --git a/arch/arm/boot/dts/imx6ull-colibri-aster.dtsi b/arch/arm/boot/dts/imx6ull-colibri-aster.dtsi
+new file mode 100644
+index 000000000000..9ccbb330d528
+--- /dev/null
++++ b/arch/arm/boot/dts/imx6ull-colibri-aster.dtsi
+@@ -0,0 +1,132 @@
++// SPDX-License-Identifier: (GPL-2.0 OR MIT)
++/*
++ * Copyright 2018 Toradex AG
++
++ */
++
++#include <dt-bindings/input/input.h>
++#include <dt-bindings/pwm/pwm.h>
++
++/ {
++      chosen {
++              bootargs = "console=ttymxc0,115200";
++      };
++
++      gpio-keys {
++              compatible = "gpio-keys";
++              pinctrl-names = "default";
++              pinctrl-0 = <&pinctrl_snvs_gpiokeys>;
++
++              power {
++                      label = "Wake-Up";
++                      gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
++                      linux,code = <KEY_WAKEUP>;
++                      debounce-interval = <10>;
++                      gpio-key,wakeup;
++              };
++      };
++
++      extcon_usbc_det: usbc_det {
++              compatible = "linux,extcon-usb-gpio";
++              debounce = <25>;
++              id-gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>;
++              pinctrl-names = "default";
++              pinctrl-0 = <&pinctrl_snvs_usbc_det>;
++      };
++
++      reg_3v3: regulator-3v3 {
++              compatible = "regulator-fixed";
++              regulator-name = "3.3V";
++              regulator-min-microvolt = <3300000>;
++              regulator-max-microvolt = <3300000>;
++              regulator-always-on;
++      };
++
++      reg_5v0: regulator-5v0 {
++              compatible = "regulator-fixed";
++              regulator-name = "5V";
++              regulator-min-microvolt = <5000000>;
++              regulator-max-microvolt = <5000000>;
++      };
++
++      reg_usbh_vbus: regulator-usbh-vbus {
++              compatible = "regulator-fixed";
++              pinctrl-names = "default";
++              pinctrl-0 = <&pinctrl_usbh_reg>;
++              regulator-name = "VCC_USB[1-4]";
++              regulator-min-microvolt = <5000000>;
++              regulator-max-microvolt = <5000000>;
++              gpio = <&gpio1 2 GPIO_ACTIVE_LOW>;
++              vin-supply = <&reg_5v0>;
++      };
++};
++
++&adc1 {
++      status = "okay";
++};
++
++&i2c1 {
++      pinctrl-names = "default", "gpio";
++      pinctrl-0 = <&pinctrl_i2c1>;
++      pinctrl-1 = <&pinctrl_i2c1_gpio>;
++      sda-gpios = <&gpio1 29 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++      scl-gpios = <&gpio1 28 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++      status = "okay";
++
++      /* M41T0M6 real time clock on carrier board */
++      rtc: m41t0m6@68 {
++              compatible = "st,m41t0";
++              reg = <0x68>;
++      };
++};
++
++&pwm4 {
++      status = "okay";
++};
++
++&pwm5 {
++      status = "okay";
++};
++
++&pwm6 {
++      status = "okay";
++};
++
++&pwm7 {
++      status = "okay";
++};
++
++&uart1 {
++      status = "okay";
++};
++
++&uart2 {
++      status = "okay";
++};
++
++&uart5 {
++      status = "okay";
++};
++
++&usbotg1 {
++      status = "okay";
++      extcon = <&extcon_usbc_det &extcon_usbc_det>;
++      vbus-supply = <&reg_usbh_vbus>;
++};
++
++&usbotg2 {
++      status = "okay";
++      vbus-supply = <&reg_usbh_vbus>;
++};
++
++&usdhc1 {
++      status = "okay";
++      pinctrl-names = "default";
++      pinctrl-0 = <&pinctrl_usdhc1 &pinctrl_snvs_usdhc1_cd>;
++      no-1-8-v;
++      cd-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
++      disable-wp;
++      enable-sdio-wakeup;
++      keep-power-in-suspend;
++      vmmc-supply = <&reg_3v3>;
++};