[OpenWrt-Devel] [PATCH 1/2] imx6: kernel: Add support for Toradex Apalis modules

Tim Harvey tharvey at gateworks.com
Wed Nov 11 09:28:09 EST 2015


On Wed, Nov 11, 2015 at 5:28 AM, Petr Štetiar <ynezz at true.cz> wrote:
> Tested on Toradex Apalis iMX6 Quad 2GB IT V1.1A module on Ixora board
> with Mikrotik R11e-2HnD and Quectel EC20 Mini PCIe modules.
>
> Signed-off-by: Petr Štetiar <ynezz at true.cz>
> ---
>  target/linux/imx6/image/Makefile                   |    2 +
>  ...6-Add-support-for-Toradex-Apalis-modules-.patch | 1996 ++++++++++++++++++++
>  ...dd-reset-function-for-reseting-downstream.patch |   79 +
>  target/linux/imx6/profiles/130-toradex.mk          |   27 +
>  4 files changed, 2104 insertions(+)
>  create mode 100644 target/linux/imx6/patches-4.1/200-ARM-dts-imx6-Add-support-for-Toradex-Apalis-modules-.patch
>  create mode 100644 target/linux/imx6/patches-4.1/300-pcie-imx6-add-reset-function-for-reseting-downstream.patch
>  create mode 100644 target/linux/imx6/profiles/130-toradex.mk
>
> diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile
> index d5bab30..0dadf0b 100644
> --- a/target/linux/imx6/image/Makefile
> +++ b/target/linux/imx6/image/Makefile
> @@ -110,6 +110,8 @@ Image/BuildKernel/Template/VENTANA=$(foreach dts,$(shell echo $(VENTANA_DTS)),$(
>  Image/InstallKernel/Template/VENTANA=$(call Image/InstallKernel/Template,$(VENTANA_DTS))
>  Image/ubifs/VENTANA=$(call ubifs_imx_gateworks_ventana)
>
> +Image/BuildKernel/Template/APALIS=$(foreach dts,$(shell echo $(APALIS_DTS)),$(call Image/BuildKernel/Template,$(dts)))
> +Image/InstallKernel/Template/APALIS=$(call Image/InstallKernel/Template,$(APALIS_DTS))
>
>  define Image/BuildKernel
>         $(call Image/BuildKernel/Template/$(PROFILE))

Hi Petr,

As Felix mentioned, I've posted a couple of patches that re-write the
imx6/image/Makefile using the newew TARGET_DEVICE notation which is
much cleaner and easier to build off of.

I expect those patches to be merged perhaps this week and I think
you'll find it very easy to use the example of the Wandboard device
there to create a device for your board that includes APALIS_DTS.

> diff --git a/target/linux/imx6/patches-4.1/200-ARM-dts-imx6-Add-support-for-Toradex-Apalis-modules-.patch b/target/linux/imx6/patches-4.1/200-ARM-dts-imx6-Add-support-for-Toradex-Apalis-modules-.patch
> new file mode 100644
> index 0000000..74c2718
> --- /dev/null
> +++ b/target/linux/imx6/patches-4.1/200-ARM-dts-imx6-Add-support-for-Toradex-Apalis-modules-.patch
> @@ -0,0 +1,1996 @@
> +From a9b5bec66c768274493a4d583b7adba366c80470 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz at true.cz>
> +Date: Wed, 14 Oct 2015 16:37:43 +0200
> +Subject: [PATCH 1/3] ARM: dts: imx6: Add support for Toradex Apalis modules
> + and boards
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +* includes support for Eval and Ixora boards
> +* hand picked from toradex_imx_3.14.28_1.0.0_ga-next branch
> +
> +Signed-off-by: Petr Štetiar <ynezz at true.cz>
> +---
> + arch/arm/boot/dts/Makefile                    |    4 +
> + arch/arm/boot/dts/imx6q-apalis-eval.dts       |   25 +
> + arch/arm/boot/dts/imx6q-apalis-ixora.dts      |   25 +
> + arch/arm/boot/dts/imx6q-apalis_v1_0-eval.dts  |   29 +
> + arch/arm/boot/dts/imx6q-apalis_v1_0-ixora.dts |   29 +
> + arch/arm/boot/dts/imx6qdl-apalis-eval.dtsi    |  357 ++++++++
> + arch/arm/boot/dts/imx6qdl-apalis-ixora.dtsi   |  333 ++++++++
> + arch/arm/boot/dts/imx6qdl-apalis.dtsi         | 1107 +++++++++++++++++++++++++
> + 8 files changed, 1909 insertions(+)
> + create mode 100644 arch/arm/boot/dts/imx6q-apalis-eval.dts
> + create mode 100644 arch/arm/boot/dts/imx6q-apalis-ixora.dts
> + create mode 100644 arch/arm/boot/dts/imx6q-apalis_v1_0-eval.dts
> + create mode 100644 arch/arm/boot/dts/imx6q-apalis_v1_0-ixora.dts
> + create mode 100644 arch/arm/boot/dts/imx6qdl-apalis-eval.dtsi
> + create mode 100644 arch/arm/boot/dts/imx6qdl-apalis-ixora.dtsi
> + create mode 100644 arch/arm/boot/dts/imx6qdl-apalis.dtsi
<snip>

The OpenWrt tradition is to add a patch to add yoru dtb's to the
Makefile (as you have done with archarm/boot/dts/Makefile but to put
'added' files into target/linux/imx6/files-4.1/

Also, I would recommend first posting your dts patches to the
arm-linux maillist first to have them reviewed fully by the experts
there before adding them to OpenWrt. The benefit other than being
reviewed by the proper group is that they will also get mainlined and
make future maintenance of the imx6 target much simpler. I've cc'd
Luka so he can voice his opinion or desire as the imx6 maintainer as
well.

<snip>
> diff --git a/target/linux/imx6/patches-4.1/300-pcie-imx6-add-reset-function-for-reseting-downstream.patch b/target/linux/imx6/patches-4.1/300-pcie-imx6-add-reset-function-for-reseting-downstream.patch
> new file mode 100644
> index 0000000..c1bbaa8
> --- /dev/null
> +++ b/target/linux/imx6/patches-4.1/300-pcie-imx6-add-reset-function-for-reseting-downstream.patch
> @@ -0,0 +1,79 @@
> +From 37f31601d32cfec48c0b69bc6e08f2aff08d4c6a Mon Sep 17 00:00:00 2001
> +From: Max Krummenacher <max.krummenacher at toradex.com>
> +Date: Fri, 21 Nov 2014 18:58:02 +0100
> +Subject: [PATCH 2/3] pcie-imx6: add reset function for reseting downstream EP
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +With the following dtb node one can define a gpio to reset
> +downstream endpoints.
> +reset-ep-gpio = <...>;
> +Currently the logic is 1 for reset asserted
> +and 0 for reset deasserted.
> +
> +Some pcie switches require their downstream endpoints to be kept in reset
> +for an additonal millisecond after their reset has been deasserted.
> +(cherry picked from commit 94a60e7f645965b1e422e4e80aa8ccb9e0ec845c)
> +
> +Conflicts:
> +
> +       drivers/pci/host/pci-imx6.c
> +
> +Signed-off-by: Petr Štetiar <ynezz at true.cz>

I don't know what tree this was cherry-picked from - its certainly not
mainline linux as there is no IMX6 EP support there.

Can you explain a bit more what is going on here? Are you saying that
reset_gpio goes to a switch and a different reset_ep_gpio goes to the
PCIe device behind the switch?

<snip>
> diff --git a/target/linux/imx6/profiles/130-toradex.mk b/target/linux/imx6/profiles/130-toradex.mk
> new file mode 100644
> index 0000000..45cf4ac
> --- /dev/null
> +++ b/target/linux/imx6/profiles/130-toradex.mk
> @@ -0,0 +1,27 @@
> +#
> +# Copyright (C) 2015 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/APALIS
> +  NAME:=Toradex Apalis family
> +  PACKAGES:= \
> +       kmod-thermal-imx kmod-usb-chipidea-imx kmod-usb-mxs-phy \
> +       kmod-can kmod-can-flexcan kmod-can-raw \
> +       kmod-leds-gpio kmod-pps-gpio \
> +       kobs-ng
> +endef

you can drop kobs-ng as I didn't see nand on your board.

> +
> +define Profile/APALIS/Description
> + The Toradex Apalis family of products are based on the Freescale i.MX6 Quad/DualLite SoCs
> +endef
> +
> +APALIS_DTS:= \
> +       imx6q-apalis-eval \
> +       imx6q-apalis_v1_0-eval \
> +       imx6q-apalis-ixora \
> +       imx6q-apalis_v1_0-ixora
> +
> +$(eval $(call Profile,APALIS))

I think with the new TARGET_DEVICE image/Makefile the DTS's are better
specified within the image/Makefile itself.

Regards,

Tim
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list