All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Guo <shawnguo@kernel.org>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Tim Harvey <tharvey@gateworks.com>,
	Rob Herring <robh+dt@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Device Tree Mailing List <devicetree@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Linux ARM Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: (EXT) Re: (EXT) Re: [PATCH] arm64: dts: imx8mm-venice-gw73xx-0x: add dt overlays for serial modes
Date: Wed, 26 Jan 2022 15:44:32 +0800	[thread overview]
Message-ID: <20220126074432.GF4686@dragon> (raw)
In-Reply-To: <6686721.lOV4Wx5bFT@steina-w>

On Wed, Jan 12, 2022 at 07:58:00AM +0100, Alexander Stein wrote:
> Am Dienstag, 11. Januar 2022, 18:53:29 CET schrieb Tim Harvey:
> > On Mon, Jan 10, 2022 at 11:20 PM Alexander Stein
> > 
> > <alexander.stein@ew.tq-group.com> wrote:
> > > Am Dienstag, 11. Januar 2022, 01:00:21 CET schrieb Tim Harvey:
> > > > [SNIP]
> > > > 
> > > > > diff --git a/arch/arm64/boot/dts/freescale/Makefile
> > > > > b/arch/arm64/boot/dts/freescale/Makefile index
> > > > > a14a6173b765..5ec8d59347b6
> > > > > 100644
> > > > > --- a/arch/arm64/boot/dts/freescale/Makefile
> > > > > +++ b/arch/arm64/boot/dts/freescale/Makefile
> > > > > @@ -44,6 +44,9 @@ 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
> > > > 
> > > > [SNIP]
> > > > I'm mostly interested to see if my approach to dt fragments here and
> > > > the naming of the files makes sense to others.
> > > > 
> > > > This patch causes the kernel to build dtbo files for:
> > > > arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dtbo
> > > > arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs422.dtbo
> > > > arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs485.dtbo
> > > > 
> > > > The intention is that these files are used by boot firmware (U-Boot)
> > > > to adjust the dtb before passing it to the kernel.
> > > 
> > > Hi Tim,
> > > 
> > > do these dtbo actually work? I'm wondering because I was trying to
> > > useoverlays myself and noticed that the had to be compiled with -@ for
> > > u-boot to be able
> > > to apply them. Apparently there are 2 possibilities:
> > Alexander,
> > 
> > Yes, they work, but I do manually set DTC_FLAGS=-@ when building
> > kernel dtbs to make them work.
> 
> I see, I expected something like this. That's why I responded to you.
> 
> > > * Set "DTC_FLAGS_[dtb] := -@" yourself
> > > See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
> > > commit/?id=e426d63e752bdbe7d5ba2d872319dde9ab844a07
> > > 
> > > * Use dedicated overlay target
> > > See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
> > > commit/?id=15d16d6dadf6947ac7f9a686c615995c5a426ce2
> > > 
> > > You use neither of them. IIRC just naming the target file .dtbo will not
> > > apply symbols (-Q) during dtc call. Can you verify using 'V=1'
> > > Also I'm wondering which way is the best to go.
> > 
> > I wasn't aware there was a way to do this via Makefiles. It seems that
> > perhaps Rob's approach with 'kbuild: Add generic rule to apply
> > fdtoverlay' is a way to avoid having to add them all manually in the
> > first approach? I must admit I'm not sure how to use that.
> 
> I tried using this myself for my custom board. I feel it is a bit cumbersome 
> to get it right.
> See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/
> arch/arm64/boot/dts/xilinx/Makefile for an example.
> 
> Essentially you define your .dtb as before and add another target (e.g. sm-
> k26-revA-sck-kv-g-revA-dtbs) where you add your .dtbo _after_ the original 
> .dtb. This target needs to be added to 'dtb-y' as before.
> 
> I suspect this way is needed to check the .dtbo against the base .dtb if it 
> actually matches.

Yeah, I like this check.  Tim, could you update your patch to follow
this pattern?

Shawn

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Shawn Guo <shawnguo@kernel.org>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Tim Harvey <tharvey@gateworks.com>,
	Rob Herring <robh+dt@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Device Tree Mailing List <devicetree@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Linux ARM Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: (EXT) Re: (EXT) Re: [PATCH] arm64: dts: imx8mm-venice-gw73xx-0x: add dt overlays for serial modes
Date: Wed, 26 Jan 2022 15:44:32 +0800	[thread overview]
Message-ID: <20220126074432.GF4686@dragon> (raw)
In-Reply-To: <6686721.lOV4Wx5bFT@steina-w>

On Wed, Jan 12, 2022 at 07:58:00AM +0100, Alexander Stein wrote:
> Am Dienstag, 11. Januar 2022, 18:53:29 CET schrieb Tim Harvey:
> > On Mon, Jan 10, 2022 at 11:20 PM Alexander Stein
> > 
> > <alexander.stein@ew.tq-group.com> wrote:
> > > Am Dienstag, 11. Januar 2022, 01:00:21 CET schrieb Tim Harvey:
> > > > [SNIP]
> > > > 
> > > > > diff --git a/arch/arm64/boot/dts/freescale/Makefile
> > > > > b/arch/arm64/boot/dts/freescale/Makefile index
> > > > > a14a6173b765..5ec8d59347b6
> > > > > 100644
> > > > > --- a/arch/arm64/boot/dts/freescale/Makefile
> > > > > +++ b/arch/arm64/boot/dts/freescale/Makefile
> > > > > @@ -44,6 +44,9 @@ 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
> > > > 
> > > > [SNIP]
> > > > I'm mostly interested to see if my approach to dt fragments here and
> > > > the naming of the files makes sense to others.
> > > > 
> > > > This patch causes the kernel to build dtbo files for:
> > > > arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dtbo
> > > > arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs422.dtbo
> > > > arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs485.dtbo
> > > > 
> > > > The intention is that these files are used by boot firmware (U-Boot)
> > > > to adjust the dtb before passing it to the kernel.
> > > 
> > > Hi Tim,
> > > 
> > > do these dtbo actually work? I'm wondering because I was trying to
> > > useoverlays myself and noticed that the had to be compiled with -@ for
> > > u-boot to be able
> > > to apply them. Apparently there are 2 possibilities:
> > Alexander,
> > 
> > Yes, they work, but I do manually set DTC_FLAGS=-@ when building
> > kernel dtbs to make them work.
> 
> I see, I expected something like this. That's why I responded to you.
> 
> > > * Set "DTC_FLAGS_[dtb] := -@" yourself
> > > See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
> > > commit/?id=e426d63e752bdbe7d5ba2d872319dde9ab844a07
> > > 
> > > * Use dedicated overlay target
> > > See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
> > > commit/?id=15d16d6dadf6947ac7f9a686c615995c5a426ce2
> > > 
> > > You use neither of them. IIRC just naming the target file .dtbo will not
> > > apply symbols (-Q) during dtc call. Can you verify using 'V=1'
> > > Also I'm wondering which way is the best to go.
> > 
> > I wasn't aware there was a way to do this via Makefiles. It seems that
> > perhaps Rob's approach with 'kbuild: Add generic rule to apply
> > fdtoverlay' is a way to avoid having to add them all manually in the
> > first approach? I must admit I'm not sure how to use that.
> 
> I tried using this myself for my custom board. I feel it is a bit cumbersome 
> to get it right.
> See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/
> arch/arm64/boot/dts/xilinx/Makefile for an example.
> 
> Essentially you define your .dtb as before and add another target (e.g. sm-
> k26-revA-sck-kv-g-revA-dtbs) where you add your .dtbo _after_ the original 
> .dtb. This target needs to be added to 'dtb-y' as before.
> 
> I suspect this way is needed to check the .dtbo against the base .dtb if it 
> actually matches.

Yeah, I like this check.  Tim, could you update your patch to follow
this pattern?

Shawn

  reply	other threads:[~2022-01-26  7:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 21:36 [PATCH] arm64: dts: imx8mm-venice-gw73xx-0x: add dt overlays for serial modes Tim Harvey
2021-12-14 21:36 ` Tim Harvey
2022-01-11  0:00 ` Tim Harvey
2022-01-11  0:00   ` Tim Harvey
2022-01-11  7:20   ` (EXT) " Alexander Stein
2022-01-11  7:20     ` Alexander Stein
2022-01-11 17:53     ` Tim Harvey
2022-01-11 17:53       ` Tim Harvey
2022-01-12  6:58       ` (EXT) " Alexander Stein
2022-01-12  6:58         ` Alexander Stein
2022-01-26  7:44         ` Shawn Guo [this message]
2022-01-26  7:44           ` Shawn Guo
2022-01-11  9:26   ` Lothar Waßmann
2022-01-12 19:42     ` 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=20220126074432.GF4686@dragon \
    --to=shawnguo@kernel.org \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=tharvey@gateworks.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.