imx: cortexa9: add support for Apalis on Gaben FlexiSBC carrier board
authorPetr Štetiar <ynezz@true.cz>
Sat, 13 Nov 2021 13:23:16 +0000 (14:23 +0100)
committerPetr Štetiar <ynezz@true.cz>
Thu, 25 Aug 2022 20:08:13 +0000 (22:08 +0200)
!!! TODO !!!

Gaben FlexiSBC is custom carrier board utilizing Toradex Apalis i.MX6
family of modules. It's being developed, sold and supported by gaben.cz.

Features:

* 1x ADV7180
* 1x CAN (terminator)
* 1x galvanically isolated RS485/RS232 (terminator, protection diodes)
* 1x RS232 with DB9 connector with all signals (missing RI)
* 4x digital inputs, optically isolated, surge protection
* 4x digital outputs, using Omron G5V2 relays with max. 2A switching current
* microSD card slot, 4-bit SDIO, GPIO for card detect
* LVDS (3x data and clock pairs), usually not populated
* MCP9800 thermometer on I2C1
* 4x buttons, RGB LED
* Secondary watchdog using external MCU
* Dog128 LCD connected to SPI1 with PWM backlight
* 4x extension slots using miniPCIe connector format:
  - GSM&GPS, including SIM card slot for standard sized SIMs
    - user controllable power source VCC-GSM (GPIO expander)
    - UART3 signals shared with RFID (jumper select)
  - PCIe standard slot usually used for WiFi cards
    - 3x Rx,Tx,CLK diff pairs, WAKE, RESET (PRsT), USB, I2C signals
    - user controllable power source VCC-PCIE (GPIO expander)
  - CUSTOM with CAN2, UART4, SPI2, USB, I2C3, 3x GPIO
    - user controllable power source VCC-CUSTOM (GPIO expander)
  - RFID with USB, UART3, and WAKEUP/RESET GPIOs
    - UART3 signals shared with GSM&GPS (jumper select)

Factory flashing instructions:

Press and hold buttons marked 1 and 2 under the LCD, insert power
connector and USB for OTG. Device should start blink with green LED with
1 Hz frequency, start flashing:

 1. Download and compile imx_loader for OpenWrt from https://github.com/ynezz/imx_loader
 2. Enter recovery mode https://developer.toradex.com/knowledge-base/imx-recovery-mode
 3. Connect board via USB to the host computer, check that it's connected by lsusb
    15a2:0054 Freescale Semiconductor, Inc. i.MX 6Dual/6Quad SystemOnChip in RecoveryMode
 4. Copy following OpenWrt images to imx_loader directory:
     SPL
     u-boot.img
     u-boot-with-spl.imx
     openwrt-imx6-apalis_flexisbc-recovery.scr
     openwrt-imx6-apalis_flexisbc-squashfs.combined.bin
 5. Run imx_usb in imx_loader directory

Upgrade in U-Boot over USB:

 Unpack openwrt-imx6-gaben_flexisbc-squashfs.combined.bin to FAT32
 formated USB flash disk, insert disk into board, press and hold buttons
 3&4 and insert power.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
package/boot/uboot-envtools/files/imx_cortexa9
target/linux/imx/Makefile
target/linux/imx/cortexa9/base-files/lib/preinit/79_move_config
target/linux/imx/cortexa9/base-files/lib/upgrade/platform.sh
target/linux/imx/image/bootscript-gaben_flexisbc [new file with mode: 0644]
target/linux/imx/image/cortexa9.mk
target/linux/imx/image/recovery-gaben_flexisbc [new file with mode: 0644]
target/linux/imx/patches-5.15/902-ARM-dts-imx-add-support-for-Gaben-FlexiSBC.patch [new file with mode: 0644]

index 89204f0ade777002f02b14097ace958d6463424f..833d25a2f67e8cf34153e51c76907c545642925e 100644 (file)
@@ -48,6 +48,7 @@ gw,imx6q-gw5913)
                ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x20000
        fi
        ;;
+gaben,flexisbc|\
 toradex,apalis_imx6q-eval|\
 toradex,apalis_imx6q-ixora|\
 toradex,apalis_imx6q-ixora-v1.1)
index 753065f540298246dd7f015a0b0faaa7f1f36561..0ef1dd3676abb6e8fc8f981844c588dff36c8e39 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 separate_ramdisk
+FEATURES:=audio display fpu gpio pcie pwm rtc usb usbgadget squashfs targz nand ubifs boot-part rootfs-part separate_ramdisk
 SUBTARGETS:=cortexa7 cortexa9
 
 KERNEL_PATCHVER:=5.15
index a2e3aa3b86c56b50076345f97af0de2fe85ee2bd..c3977fdadc8cec6641a4cbb657d24392c359b324 100644 (file)
@@ -6,6 +6,7 @@ move_config() {
        local board=$(board_name)
 
        case "$board" in
+       gaben,flexisbc|\
        toradex,apalis_imx6q-eval|\
        toradex,apalis_imx6q-ixora|\
        toradex,apalis_imx6q-ixora-v1.1)
index dc2bf9cf493d5bdd8e0bb47e47b47b2e77a10b1f..3e6a5642d0a9c7f6b06737b7e7711c62ec42937c 100755 (executable)
@@ -8,6 +8,7 @@ RAMFS_COPY_BIN='blkid jffs2reset'
 
 enable_image_metadata_check() {
        case "$(board_name)" in
+       gaben,flexisbc|\
        toradex,apalis_imx6q-eval|\
        toradex,apalis_imx6q-ixora|\
        toradex,apalis_imx6q-ixora-v1.1)
@@ -49,6 +50,7 @@ platform_check_image() {
                nand_do_platform_check $board $1
                return $?;
                ;;
+       gaben,flexisbc |\
        toradex,apalis_imx6q-eval|\
        toradex,apalis_imx6q-ixora|\
        toradex,apalis_imx6q-ixora-v1.1)
@@ -91,6 +93,7 @@ platform_do_upgrade() {
        gw,imx6q-gw5913)
                nand_do_upgrade "$1"
                ;;
+       gaben,flexisbc|\
        toradex,apalis_imx6q-eval|\
        toradex,apalis_imx6q-ixora|\
        toradex,apalis_imx6q-ixora-v1.1)
@@ -103,6 +106,7 @@ platform_copy_config() {
        local board=$(board_name)
 
        case "$board" in
+       gaben,flexisbc|\
        toradex,apalis_imx6q-eval|\
        toradex,apalis_imx6q-ixora|\
        toradex,apalis_imx6q-ixora-v1.1)
@@ -115,6 +119,7 @@ platform_pre_upgrade() {
        local board=$(board_name)
 
        case "$board" in
+       gaben,flexisbc|\
        toradex,apalis_imx6q-eval|\
        toradex,apalis_imx6q-ixora|\
        toradex,apalis_imx6q-ixora-v1.1)
diff --git a/target/linux/imx/image/bootscript-gaben_flexisbc b/target/linux/imx/image/bootscript-gaben_flexisbc
new file mode 100644 (file)
index 0000000..58a8b42
--- /dev/null
@@ -0,0 +1,21 @@
+echo "Gaben FlexiSBC OpenWrt Boot script v1.0"
+
+run finduuid
+
+setenv nextcon 0
+setenv fdt_file imx6q-apalis-gaben-flexisbc.dtb
+setenv root root=PARTUUID=${uuid} rootfstype=squashfs rootwait
+setenv bootargs earlyprintk console=${console},${baudrate}n8 ${root}
+setenv fsload ext4load mmc ${mmcbootdev}:${bootpart}
+
+if ${fsload} ${kernel_addr_r} ${boot_file}; then
+       if ${fsload} ${fdt_addr_r} ${fdt_file}; then
+               test -n "$fdt_fixup" && run fdt_fixup
+               bootm ${kernel_addr_r} - ${fdt_addr_r}
+       else
+               echo "Error loading device-tree"
+       fi
+else
+       echo "Error loading kernel image"
+       sdp 0
+fi
index 78079aa746b9ec5982dc3f28c6be5259b454264b..baf5120cc31bfba4d5b999a618da21994f2736a0 100644 (file)
@@ -161,6 +161,21 @@ define Device/toradex_apalis
 endef
 TARGET_DEVICES += toradex_apalis
 
+define Device/gaben_flexisbc
+  $(Device/toradex_apalis)
+  DEVICE_TITLE := Gaben FlexiSBC
+  SUPPORTED_DEVICES := gaben,flexisbc
+  DEVICE_DTS := imx6q-apalis-gaben-flexisbc
+  BOOT_SCRIPT := bootscript-gaben_flexisbc
+  # UBOOT := gaben_flexisbc
+  DEVICE_PACKAGES := \
+       kmod-can kmod-can-flexcan kmod-can-raw kmod-pps-gpio \
+       kmod-leds-gpio kmod-leds-pwm kmod-backlight-pwm kmod-pwm-beeper \
+       kmod-rtc-ds1307 kmod-ledtrig-heartbeat kmod-gpio-mcp23s08 \
+       kmod-input-gpio-keys kmod-hwmon-lm75 kmod-input-evdev
+endef
+TARGET_DEVICES += gaben_flexisbc
+
 define Device/wandboard_dual
   DEVICE_VENDOR := Wandboard
   DEVICE_MODEL := Dual
diff --git a/target/linux/imx/image/recovery-gaben_flexisbc b/target/linux/imx/image/recovery-gaben_flexisbc
new file mode 100644 (file)
index 0000000..3fb1812
--- /dev/null
@@ -0,0 +1,60 @@
+echo "Running Gaben FlexiSBC recovery script v1.0"
+
+drive=0
+interface=usb
+uboot_img=u-boot-with-spl.imx
+src_dir=openwrt-gaben-flexisbc
+owrt_img=openwrt-imx6-gaben_flexisbc-squashfs.combined.bin
+
+if gpio input $btn3_gpio; then
+       echo "Flashing from USB flash"
+
+       run led_blue_off
+       run led_blue_on
+       sleep 1
+       run led_blue_off
+       sleep 1
+
+       run led_blue_on
+
+       if load ${interface} ${drive}:1 ${loadaddr} ${src_dir}/${uboot_img}; then
+               run led_blue_off
+               echo "Flashing ${uboot_img}"
+               mmc dev 0 1 && run set_blkcnt && mmc write ${loadaddr} 2 ${blkcnt}
+       fi
+
+       run led_blue_on
+
+       if load ${interface} ${drive}:1 ${loadaddr} ${src_dir}/${owrt_img}; then
+               run led_blue_off
+               echo "Flashing ${owrt_img}"
+               mmc dev 0 0 && run set_blkcnt && mmc write ${loadaddr} 0 ${blkcnt}
+       fi
+
+       run led_green_on
+       sleep 1
+       run led_green_off
+       sleep 1
+       run led_green_on
+       sleep 1
+       run led_green_off
+       reset
+fi
+
+echo "Flashing from USB bootloader"
+
+# flash u-boot-with-spl.imx
+# using fixed size of 1M for U-Boot + SPL
+mmc dev 0 1
+mmc write 0x12100000 0x2 0x800
+
+# flash openwrt-imx6-apalis-squashfs.combined.bin
+run set_blkcnt
+mmc dev 0 0
+mmc write 0x12500000 0 ${blkcnt}
+
+mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0
+env default -f -a
+saveenv
+
+reset
diff --git a/target/linux/imx/patches-5.15/902-ARM-dts-imx-add-support-for-Gaben-FlexiSBC.patch b/target/linux/imx/patches-5.15/902-ARM-dts-imx-add-support-for-Gaben-FlexiSBC.patch
new file mode 100644 (file)
index 0000000..6593631
--- /dev/null
@@ -0,0 +1,495 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz>
+Date: Thu, 11 Nov 2021 16:32:46 +0100
+Subject: [PATCH] ARM: dts: imx: add support for Gaben FlexiSBC
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+!!! TODO !!!
+
+Gaben FlexiSBC is custom carrier board utilizing Toradex Apalis i.MX6
+family of modules. It's being developed, sold and supported by gaben.cz.
+
+Features:
+
+* 1x ADV7180
+* 1x CAN (terminator)
+* 1x galvanically isolated RS485/RS232 (terminator, protection diodes)
+* 1x RS232 with DB9 connector with all signals (missing RI)
+* 4x digital inputs, optically isolated, surge protection
+* 4x digital outputs, using Omron G5V2 relays with max. 2A switching current
+* microSD card slot, 4-bit SDIO, GPIO for card detect
+* LVDS (3x data and clock pairs), usually not populated
+* MCP9800 thermometer on I2C1
+* 4x buttons, RGB LED
+* Secondary watchdog using external MCU
+* Dog128 LCD connected to SPI1 with PWM backlight
+* 4x extension slots using miniPCIe connector format:
+  - GSM&GPS, including SIM card slot for standard sized SIMs
+    - user controllable power source VCC-GSM (GPIO expander)
+    - UART3 signals shared with RFID (jumper select)
+  - PCIe standard slot usually used for WiFi cards
+    - 3x Rx,Tx,CLK diff pairs, WAKE, RESET (PRsT), USB, I2C signals
+    - user controllable power source VCC-PCIE (GPIO expander)
+  - CUSTOM with CAN2, UART4, SPI2, USB, I2C3, 3x GPIO
+    - user controllable power source VCC-CUSTOM (GPIO expander)
+  - RFID with USB, UART3, and WAKEUP/RESET GPIOs
+    - UART3 signals shared with GSM&GPS (jumper select)
+
+Signed-off-by: Petr Štetiar <ynezz@true.cz>
+---
+ arch/arm/boot/dts/Makefile                    |   1 +
+ .../boot/dts/imx6q-apalis-gaben-flexisbc.dts  | 431 ++++++++++++++++++
+ 2 files changed, 432 insertions(+)
+ create mode 100644 arch/arm/boot/dts/imx6q-apalis-gaben-flexisbc.dts
+
+diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
+index 2ea850a50f60..6cd3c308398e 100644
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -488,6 +488,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
+       imx6dl-yapp4-hydra.dtb \
+       imx6dl-yapp4-orion.dtb \
+       imx6dl-yapp4-ursa.dtb \
++      imx6q-apalis-gaben-flexisbc.dtb \
+       imx6q-apalis-eval.dtb \
+       imx6q-apalis-ixora.dtb \
+       imx6q-apalis-ixora-v1.1.dtb \
+diff --git a/arch/arm/boot/dts/imx6q-apalis-gaben-flexisbc.dts b/arch/arm/boot/dts/imx6q-apalis-gaben-flexisbc.dts
+new file mode 100644
+index 000000000000..4c4460a8b241
+--- /dev/null
++++ b/arch/arm/boot/dts/imx6q-apalis-gaben-flexisbc.dts
+@@ -0,0 +1,431 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++/dts-v1/;
++
++#include <dt-bindings/input/input.h>
++#include <dt-bindings/interrupt-controller/irq.h>
++#include "imx6q.dtsi"
++#include "imx6qdl-apalis.dtsi"
++
++/ {
++      model = "Toradex Apalis iMX6Q/D Module on Gaben Flexi SBC";
++      compatible = "gaben,flexisbc", "toradex,apalis_imx6q", "fsl,imx6q";
++
++      aliases {
++              i2c1 = &i2c1;
++              i2c2 = &i2c2;
++              i2c3 = &i2c3;
++
++              rtc0 = &mcp_rtc;
++              rtc1 = &snvs_rtc;
++
++              led-boot = &led_system;
++              led-failsafe = &led_system;
++              led-upgrade = &led_system;
++      };
++
++      keys {
++              compatible = "gpio-keys";
++              pinctrl-names = "default";
++              pinctrl-0 = <&pinctrl_gpio_buttons &pinctrl_gpio_keys>;
++
++              /* S1-S4 buttons on top board under LCD */
++              s1 {
++                      label = "button-s1";
++                      gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
++                      linux,code = <BTN_A>;
++                      debounce-interval = <10>;
++              };
++
++              s2 {
++                      label = "button-s2";
++                      gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
++                      linux,code = <BTN_B>;
++                      debounce-interval = <10>;
++              };
++
++              s3 {
++                      label = "button-s3";
++                      gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
++                      linux,code = <BTN_C>;
++                      debounce-interval = <10>;
++              };
++
++              s4 {
++                      label = "button-s4";
++                      gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
++                      linux,code = <BTN_X>;
++                      debounce-interval = <10>;
++              };
++
++              /* IN0-IN3 digital inputs */
++              in0 {
++                      label = "dio-in0";
++                      gpios = <&gpio7 9 GPIO_ACTIVE_LOW>;
++                      linux,code = <BTN_0>;
++                      debounce-interval = <10>;
++              };
++
++              in1 {
++                      label = "dio-in1";
++                      gpios = <&gpio6 8 GPIO_ACTIVE_LOW>;
++                      linux,code = <BTN_1>;
++                      debounce-interval = <10>;
++              };
++
++              in2 {
++                      label = "dio-in2";
++                      gpios = <&gpio7 10 GPIO_ACTIVE_LOW>;
++                      linux,code = <BTN_2>;
++                      debounce-interval = <10>;
++              };
++
++              in3 {
++                      label = "dio-in3";
++                      gpios = <&gpio6 11 GPIO_ACTIVE_LOW>;
++                      linux,code = <BTN_3>;
++                      debounce-interval = <10>;
++              };
++
++              /* Wake-up signal from miniPCIe/GSM slot */
++              wakeup {
++                      label = "wake-up";
++                      gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
++                      linux,code = <KEY_WAKEUP>;
++                      debounce-interval = <10>;
++                      wakeup-source;
++              };
++      };
++
++      leds {
++              compatible = "gpio-leds";
++              pinctrl-names = "default";
++              pinctrl-0 = <&pinctrl_gpio_leds>;
++
++              heartbeat {
++                      label = "heartbeat";
++                      gpios = <&gpio3 22 GPIO_ACTIVE_HIGH>;
++                      linux,default-trigger = "heartbeat";
++              };
++
++              led_system: rgb-red {
++                      label = "rgb-red";
++                      gpios = <&gpio4 18 GPIO_ACTIVE_LOW>;
++              };
++
++              rgb-green {
++                      label = "rgb-green";
++                      gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
++              };
++
++              rgb-blue {
++                      label = "rgb-blue";
++                      gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
++              };
++
++              led-in0 {
++                      label = "in0";
++                      gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
++              };
++
++              led-in1 {
++                      label = "in1";
++                      gpios = <&gpio6 16 GPIO_ACTIVE_HIGH>;
++              };
++
++              led-in2 {
++                      label = "in2";
++                      gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>;
++              };
++
++              led-in3 {
++                      label = "in3";
++                      gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
++              };
++
++              /*
++               * TODO: For nodes bellow we're currently abusing LEDs, but we
++               * should fix it correctly with libgpiod
++               */
++
++              relay-rfid-power {
++                      label = "relay-rfid-power";
++                      gpios = <&gpio3 31 GPIO_ACTIVE_LOW>;
++                      linux,default-trigger = "default-on";
++              };
++
++              relay0 {
++                      label = "relay0";
++                      gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;
++              };
++
++              relay1 {
++                      label = "relay1";
++                      gpios = <&gpio5 11 GPIO_ACTIVE_HIGH>;
++              };
++
++              relay2 {
++                      label = "relay2";
++                      gpios = <&gpio2 27 GPIO_ACTIVE_HIGH>;
++              };
++
++              relay3 {
++                      label = "relay3";
++                      gpios = <&gpio5 10 GPIO_ACTIVE_HIGH>;
++              };
++
++              /* USB HUB CY7C65632 reset, not connected currently */
++              reset-usb-hub2 {
++                      label = "reset-usb-hub2";
++                      gpios = <&gpio6 15 GPIO_ACTIVE_HIGH>;
++                      linux,default-trigger = "default-on";
++              };
++
++              /* adv7180@i2c3 reset */
++              reset-adv7180 {
++                      label = "reset-adv7180";
++                      gpios = <&gpio7 12 GPIO_ACTIVE_HIGH>;
++                      linux,default-trigger = "default-on";
++              };
++
++              rfid-wakeup {
++                      label = "rfid-wakeup";
++                      gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
++              };
++
++              rfid-reset {
++                      label = "rfid-reset";
++                      gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
++                      linux,default-trigger = "default-on";
++              };
++      };
++
++      pwm-beeper {
++              compatible = "pwm-beeper";
++              pwms = <&pwm2 0 1000 0>;
++              beeper-hz = <900>;
++      };
++
++      dog8-backlight {
++              status = "okay";
++              compatible = "pwm-backlight";
++              pwms = <&pwm1 0 50000 0 >;
++              brightness-levels = <0 10 20 30 40
++                              50 60 70 80 90
++                              100 110 120 127 255
++                              >;
++              default-brightness-level = <0>;
++      };
++
++      lvds-backlight {
++              compatible = "pwm-backlight";
++              pwms = <&pwm3 0 50000 0>;
++              brightness-levels = <0 10 20 30 40
++                              50 60 70 80 90
++                              100 110 120 127 255
++                              >;
++              default-brightness-level = <0>;
++      };
++};
++
++&can1 {
++      status = "okay";
++};
++
++&gpio3 {
++      /* mcp23009@i2c3 reset */
++      expander-reset {
++              gpio-hog;
++              gpios = <29 GPIO_ACTIVE_HIGH>;
++              output-high;
++              line-name = "expander-reset";
++      };
++};
++
++&i2c1 {
++      status = "okay";
++
++      sensor: lm75@48 {
++              compatible = "national,lm75";
++              reg = <0x48>;
++      };
++};
++
++&i2c3 {
++      status = "okay";
++
++      gpio_expander: mcp23009@20 {
++              compatible = "microchip,mcp23008";
++              gpio-controller;
++              #gpio-cells = <2>;
++              reg = <0x20>;
++      };
++
++      adv7180: adv7180@21 {
++              compatible = "adv,adv7180";
++              reg = <0x21>;
++              pinctrl-names = "default";
++              pinctrl-0 = <&pinctrl_ipu1_csi0>;
++              clocks = <&clks 200>;
++              clock-names = "csi_mclk";
++              csi_id = <0>;
++              mclk = <24000000>;
++              mclk_source = <1>;
++              cvbs = <1>;
++              status = "okay";
++      };
++
++      mcp_rtc: mcp7941x@6f {
++              compatible = "microchip,mcp7941x";
++              reg = <0x6f>;
++      };
++};
++
++&iomuxc {
++      pinctrl-names = "default";
++      pinctrl-0 = <&pinctrl_apalis_gpio1 &pinctrl_apalis_gpio2
++                   &pinctrl_apalis_gpio3 &pinctrl_apalis_gpio4
++                   &pinctrl_apalis_gpio5 &pinctrl_apalis_gpio6
++                   &pinctrl_apalis_gpio7 &pinctrl_apalis_gpio8
++                   &pinctrl_rs485_dr &pinctrl_misc_gpio &pinctrl_revision>;
++
++      /*
++       * BTN0 is in pinctrl_misc_gpio, because we need to init it ASAP. BTN0
++       * is being used as reset via IC11/ATTiny if being held down for more
++       * then 8 seconds. If the gpio-keys is compiled as module and we boot
++       * over NFS, then it can take more then 8 seconds to init the GPIO and
++       * the board would get stuck in the reboot loop forever.
++       */
++      pinctrl_gpio_buttons: gpio-buttons {
++              fsl,pins = <
++                      MX6QDL_PAD_NANDF_D2__GPIO2_IO02         0x1b0b0 /* BTN1 */
++                      MX6QDL_PAD_NANDF_D3__GPIO2_IO03         0x1b0b0 /* BTN2 */
++                      MX6QDL_PAD_SD1_DAT0__GPIO1_IO16         0x1b0b0 /* BTN3 */
++                      >;
++      };
++
++      pinctrl_rs485_dr: rs485dr {
++              fsl,pins = <
++                      MX6QDL_PAD_EIM_WAIT__GPIO5_IO00         0x130b0 /* 485-DR */
++                      >;
++      };
++
++      pinctrl_misc_gpio: misc-gpio {
++              fsl,pins = <
++                      MX6QDL_PAD_SD1_CLK__GPIO1_IO20          0x1b0b0 /* BTN0 */
++                      MX6QDL_PAD_EIM_DA14__GPIO3_IO14         0x130b0 /* LVDS-BLK_PWM */
++                      MX6QDL_PAD_SD1_DAT2__GPIO1_IO19         0x130b0 /* CS_PCIE / RFID_WAKEUP */
++                      MX6QDL_PAD_SD1_DAT3__GPIO1_IO21         0x130b0 /* RING */
++                      MX6QDL_PAD_NANDF_D0__GPIO2_IO00         0x130b0 /* WDIS */
++                      MX6QDL_PAD_SD1_CMD__GPIO1_IO18          0x130b0 /* PERST */
++                      MX6QDL_PAD_NANDF_CS2__GPIO6_IO15        0x130b0 /* RHUB */
++                      MX6QDL_PAD_EIM_EB3__GPIO2_IO31          0x1b0b1 /* RFID_RESET */
++                      >;
++      };
++
++      pinctrl_revision: revision {
++              fsl,pins = <
++                      MX6QDL_PAD_EIM_A21__GPIO2_IO17          0 /* SJ2 bit0 */
++                      MX6QDL_PAD_EIM_A22__GPIO2_IO16          0 /* SJ3 bit1 */
++                      MX6QDL_PAD_EIM_A23__GPIO6_IO06          0 /* SJ4 bit2 */
++                      MX6QDL_PAD_EIM_A24__GPIO5_IO04          0 /* SJ5 bit3 */
++              >;
++      };
++
++      pinctrl_gpio_leds: gpio-leds {
++              fsl,pins = <
++                      MX6QDL_PAD_EIM_D22__GPIO3_IO22          0x130b0 /* Heartbeat LED */
++
++                      MX6QDL_PAD_DI0_PIN2__GPIO4_IO18         0x1b0b0 /* RGB-R */
++                      MX6QDL_PAD_DI0_PIN3__GPIO4_IO19         0x1b0b0 /* RGB-G */
++                      MX6QDL_PAD_SD1_DAT1__GPIO1_IO17         0x1b0b0 /* RGB-B */
++
++                      MX6QDL_PAD_NANDF_CLE__GPIO6_IO07        0x130b0 /* LED-IN0 */
++                      MX6QDL_PAD_NANDF_CS3__GPIO6_IO16        0x130b0 /* LED-IN1 */
++                      MX6QDL_PAD_SD4_DAT0__GPIO2_IO08         0x130b0 /* LED-IN2 */
++                      MX6QDL_PAD_SD4_DAT3__GPIO2_IO11         0x130b0 /* LED-IN3 */
++
++                      MX6QDL_PAD_GPIO_19__GPIO4_IO05          0x130b0 /* RELAY0 */
++                      MX6QDL_PAD_DISP0_DAT17__GPIO5_IO11      0x130b0 /* RELAY1 */
++                      MX6QDL_PAD_EIM_LBA__GPIO2_IO27          0x130b0 /* RELAY2 */
++                      MX6QDL_PAD_DISP0_DAT16__GPIO5_IO10      0x130b0 /* RELAY3 */
++                      MX6QDL_PAD_EIM_D31__GPIO3_IO31          0x1b0b0 /* RFID_PWR_RELAY */
++                      >;
++      };
++};
++
++&ldb {
++      status = "disabled";
++};
++
++&sata {
++      status = "disabled";
++};
++
++&pcie {
++      /* active-high meaning opposite of regular PERST# active-low polarity */
++      reset-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
++      reset-gpio-active-high;
++      status = "okay";
++};
++
++&pwm1 {
++      status = "okay";
++};
++
++&pwm2 {
++      status = "okay";
++};
++
++&pwm3 {
++      status = "okay";
++};
++
++&pwm4 {
++      status = "okay";
++};
++
++&uart1 {
++      status = "okay";
++};
++
++&uart2 {
++      status = "okay";
++};
++
++&uart4 {
++      status = "okay";
++};
++
++&uart5 {
++      status = "okay";
++};
++
++&usbotg {
++      status = "okay";
++};
++
++&reg_usb_host_vbus {
++      status = "okay";
++};
++
++&usbh1 {
++      vbus-supply = <&reg_usb_host_vbus>;
++      status = "okay";
++};
++
++/* SD1 */
++&usdhc2 {
++      status = "okay";
++};
++
++&ecspi1 {
++      status = "okay";
++
++      /* dogm128 LCD */
++      spidev0: spi@0 {
++               compatible = "spidev";
++               reg = <0>;
++               spi-max-frequency = <50000000>;
++       };
++};