devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Guo <shawnguo@kernel.org>
To: Tim Harvey <tharvey@gateworks.com>
Cc: Rob Herring <robh@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Frank Rowand <frank.rowand@sony.com>,
	Device Tree Mailing List <devicetree@vger.kernel.org>
Subject: Re: [PATCH 2/2] arm64: dts: freescale: Use overlay target for simplicity
Date: Fri, 11 Feb 2022 17:10:19 +0800	[thread overview]
Message-ID: <20220211091019.GS4909@dragon> (raw)
In-Reply-To: <CAJ+vNU0CNFeEp0B92mUjV7RrwAHjk9iJ703zEYofkducfFzvGw@mail.gmail.com>

On Wed, Feb 09, 2022 at 02:10:11PM -0800, Tim Harvey wrote:
> On Fri, Jan 28, 2022 at 11:10 PM Shawn Guo <shawnguo@kernel.org> wrote:
> >
> > With commit 15d16d6dadf6 ("kbuild: Add generic rule to apply
> > fdtoverlay"), overlay target can be used to simplify the build of DTB
> > overlays.  It also performs a cross check to ensure base DT and overlay
> > actually match.
> >
> > Signed-off-by: Shawn Guo <shawnguo@kernel.org>
> > ---
> >  arch/arm64/boot/dts/freescale/Makefile | 29 +++++++++++++-------------
> >  1 file changed, 14 insertions(+), 15 deletions(-)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
> > index 6d8f0a532587..c521ac2b00ca 100644
> > --- a/arch/arm64/boot/dts/freescale/Makefile
> > +++ b/arch/arm64/boot/dts/freescale/Makefile
> > @@ -1,14 +1,5 @@
> >  # SPDX-License-Identifier: GPL-2.0
> >
> > -# required for overlay support
> > -DTC_FLAGS_fsl-ls1028a-qds := -@
> > -DTC_FLAGS_fsl-ls1028a-qds-13bb := -@
> > -DTC_FLAGS_fsl-ls1028a-qds-65bb := -@
> > -DTC_FLAGS_fsl-ls1028a-qds-7777 := -@
> > -DTC_FLAGS_fsl-ls1028a-qds-85bb := -@
> > -DTC_FLAGS_fsl-ls1028a-qds-899b := -@
> > -DTC_FLAGS_fsl-ls1028a-qds-9999 := -@
> > -
> >  dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1012a-frdm.dtb
> >  dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1012a-frwy.dtb
> >  dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1012a-oxalis.dtb
> > @@ -21,12 +12,6 @@ dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-kontron-sl28-var2.dtb
> >  dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-kontron-sl28-var3-ads2.dtb
> >  dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-kontron-sl28-var4.dtb
> >  dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds.dtb
> > -dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-13bb.dtb
> > -dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-65bb.dtb
> > -dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-7777.dtb
> > -dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-85bb.dtb
> > -dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-899b.dtb
> > -dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-9999.dtb
> >  dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-rdb.dtb
> >  dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1043a-qds.dtb
> >  dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1043a-rdb.dtb
> > @@ -49,6 +34,20 @@ dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-lx2160a-qds.dtb
> >  dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-lx2160a-rdb.dtb
> >  dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-lx2162a-qds.dtb
> >
> > +fsl-ls1028a-qds-13bb-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-13bb.dtbo
> > +fsl-ls1028a-qds-65bb-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-65bb.dtbo
> > +fsl-ls1028a-qds-7777-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-7777.dtbo
> > +fsl-ls1028a-qds-85bb-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-85bb.dtbo
> > +fsl-ls1028a-qds-899b-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-899b.dtbo
> > +fsl-ls1028a-qds-9999-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-9999.dtbo
> > +
> > +dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-13bb.dtb
> > +dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-65bb.dtb
> > +dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-7777.dtb
> > +dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-85bb.dtb
> > +dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-899b.dtb
> > +dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-9999.dtb
> > +
> >  dtb-$(CONFIG_ARCH_MXC) += imx8mm-beacon-kit.dtb
> >  dtb-$(CONFIG_ARCH_MXC) += imx8mm-evk.dtb
> >  dtb-$(CONFIG_ARCH_MXC) += imx8mm-ddr4-evk.dtb
> > --
> > 2.17.1
> 
> Shawn and Rob
> 
> I tried to adapt my patch 'arm64: dts: imx8mm-venice-gw73xx-0x: add dt
> overlays for serial modes' [1] and it results in a build failure:
> $ make dtbs W=1
>   UPD     include/config/kernel.release
>   DTC     arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dtbo
>   DTOVL   arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dtb
> 
> Overlay 'scripts/dtc/include-prefixes/dt-bindings/gpio/gpio.h' is
> incomplete (2048 / 1346656301 bytes read)
> scripts/Makefile.lib:360: recipe for target
> 'arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dtb'
> failed
> make[2]: *** [arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dtb]
> Error 1
> scripts/Makefile.build:550: recipe for target
> 'arch/arm64/boot/dts/freescale' failed
> make[1]: *** [arch/arm64/boot/dts/freescale] Error 2
> Makefile:1370: recipe for target 'dtbs' failed
> make: *** [dtbs] Error 2
> 
> It seems that it chokes on the include. The dts is:
> // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> /*
>  * Copyright 2022 Gateworks Corporation
>  *
>  * GW73xx RS232 with RTS/CTS hardware flow control:
>  *  - GPIO4_0 rs485_en needs to be driven low (in-active)
>  *  - UART4_TX becomes RTS
>  *  - UART4_RX becomes CTS
>  */
> 
> #include <dt-bindings/gpio/gpio.h>
> 
> #include "imx8mm-pinfunc.h"
> 
> /dts-v1/;
> /plugin/;
> 
> &{/} {
>         compatible = "gw,imx8mm-gw73xx-0x";
> };
> 
> &gpio4 {
>         rs485_en {
>                 gpio-hog;
>                 gpios = <0 GPIO_ACTIVE_HIGH>;
>                 output-low;
>                 line-name = "rs485_en";
>         };
> };
> 
> &uart2 {
>         pinctrl-names = "default";
>         pinctrl-0 = <&pinctrl_uart2>;
>         rts-gpios = <&gpio5 29 GPIO_ACTIVE_LOW>;
>         cts-gpios = <&gpio5 28 GPIO_ACTIVE_LOW>;
>         uart-has-rtscts;
>         status = "okay";
> };
> 
> &uart4 {
>         status = "disabled";
> };
> 
> &iomuxc {
>         pinctrl_uart2: uart2grp {
>                 fsl,pins = <
>                         MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX     0x140
>                         MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX     0x140
>                         MX8MM_IOMUXC_UART4_TXD_GPIO5_IO29       0x140
>                         MX8MM_IOMUXC_UART4_RXD_GPIO5_IO28       0x140
>                 >;
>         };
> };
> 
> Could you explain what is wrong here? It compiled fine before trying
> to adapt the Makefile to what is described in 15d16d6dadf6 ("kbuild:
> Add generic rule to applyfdt overlay"


With the following changes on top of your patch, I can build the dtbo
without error.

---8<-------
diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
index 4611f66096a7..d42a9e03f014 100644
--- a/arch/arm64/boot/dts/freescale/Makefile
+++ b/arch/arm64/boot/dts/freescale/Makefile
@@ -61,9 +61,6 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mm-var-som-symphony.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw71xx-0x.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw72xx-0x.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x.dtb
-dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs232-rts.dtbo
-dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs422.dtbo
-dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs485.dtbo
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw7901.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw7902.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mn-beacon-kit.dtb
@@ -97,6 +94,14 @@ dtb-$(CONFIG_ARCH_MXC) += imx8qxp-colibri-eval-v3.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8qxp-mek.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8ulp-evk.dtb
 
+imx8mm-venice-gw73xx-0x-rs232-rts-dtbs := imx8mm-venice-gw73xx-0x.dtb imx8mm-venice-gw73xx-0x-rs232-rts.dtbo
+imx8mm-venice-gw73xx-0x-rs422-dtbs := imx8mm-venice-gw73xx-0x.dtb imx8mm-venice-gw73xx-0x-rs422.dtbo
+imx8mm-venice-gw73xx-0x-rs485-dtbs := imx8mm-venice-gw73xx-0x.dtb imx8mm-venice-gw73xx-0x-rs485.dtbo
+
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs232-rts.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs422.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs485.dtb
+
 dtb-$(CONFIG_ARCH_S32) += s32g274a-evb.dtb
 dtb-$(CONFIG_ARCH_S32) += s32g274a-rdb2.dtb
 dtb-$(CONFIG_ARCH_S32) += s32v234-evb.dtb

  reply	other threads:[~2022-02-11  9:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-29  7:09 [PATCH 0/2] Improve fsl-ls1028a-qds device tree overlay build Shawn Guo
2022-01-29  7:09 ` [PATCH 1/2] arm64: dts: fsl-ls1028a-qds: Drop overlay syntax hard coding Shawn Guo
2022-01-31 11:07   ` Vladimir Oltean
2022-02-11  8:57     ` Shawn Guo
2022-01-29  7:09 ` [PATCH 2/2] arm64: dts: freescale: Use overlay target for simplicity Shawn Guo
2022-01-31 11:07   ` Vladimir Oltean
2022-02-09 22:10   ` Tim Harvey
2022-02-11  9:10     ` Shawn Guo [this message]
2022-02-11 23:23       ` Tim Harvey
2022-02-12  4:00         ` Shawn Guo
2022-02-14 23:09           ` Tim Harvey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220211091019.GS4909@dragon \
    --to=shawnguo@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frank.rowand@sony.com \
    --cc=masahiroy@kernel.org \
    --cc=robh@kernel.org \
    --cc=tharvey@gateworks.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).