All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chester Lin <clin@suse.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	s32@nxp.com, linux-gpio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	"Larisa Grigore" <larisa.grigore@nxp.com>,
	"Ghennadi Procopciuc" <Ghennadi.Procopciuc@nxp.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Matthias Brugger" <mbrugger@suse.com>
Subject: Re: [PATCH 1/2] dt-bindings: pinctrl: add schema for NXP S32 SoCs
Date: Thu, 10 Nov 2022 00:45:25 +0800	[thread overview]
Message-ID: <Y2vZJaoWThP2aipE@linux-8mug> (raw)
In-Reply-To: <CACRpkdY-uaQ--vFM+vVPbwa-q9nbSU0rQB+qbL=9m0wVMwA3Aw@mail.gmail.com>

Hi Linus,

On Tue, Nov 08, 2022 at 01:31:16PM +0100, Linus Walleij wrote:
> Hi Chester,
> 
> thanks for your patch!
> 

Thanks for reviewing this patch series as well!

> On Mon, Oct 31, 2022 at 11:09 AM Chester Lin <clin@suse.com> wrote:
> 
> > Add DT schema for the pinctrl driver of NXP S32 SoC family.
> >
> > Signed-off-by: Larisa Grigore <larisa.grigore@nxp.com>
> > Signed-off-by: Ghennadi Procopciuc <Ghennadi.Procopciuc@nxp.com>
> > Signed-off-by: Chester Lin <clin@suse.com>
> (...)
> > +  nxp,pins:
> > +    $ref: /schemas/types.yaml#/definitions/uint32-array
> > +    description:
> > +      A list of [start, end] pin ID boundaries that correspond to each of
> > +      the register regions reserved.
> 
> That's an interesting approach.
> 
> But what about just hardcoding this into the driver instead?
> 
> If you have the compatible, surely you know these indexes from
> that compatible string?
> 

The nxp,pins property is more like a common language that both kernel and
u-boot can share with. Of course hardcoding indexes can be achieved as well
but that also means the index matrices in both kernel driver and u-boot driver
must be revised and synchronized if new boards may have different reg and
nxp,pins. IMHO, having these ID ranges in DT could be more intuitive, developers
can easily compare every pair with the corresponding reg entry in the same dts
file since reg maps are fragmented as I mentioned in Rob's code review[1].
Based on this approach, both kernel driver and u-boot driver can reuse the
same parser to acquire pin ID ranges from different boards, which can also
simplify codes and have less patches in the future.

Regards,
Chester

[1] https://lkml.org/lkml/2022/11/9/722

> Yours,
> Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: Chester Lin <clin@suse.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	s32@nxp.com, linux-gpio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	"Larisa Grigore" <larisa.grigore@nxp.com>,
	"Ghennadi Procopciuc" <Ghennadi.Procopciuc@nxp.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Matthias Brugger" <mbrugger@suse.com>
Subject: Re: [PATCH 1/2] dt-bindings: pinctrl: add schema for NXP S32 SoCs
Date: Thu, 10 Nov 2022 00:45:25 +0800	[thread overview]
Message-ID: <Y2vZJaoWThP2aipE@linux-8mug> (raw)
In-Reply-To: <CACRpkdY-uaQ--vFM+vVPbwa-q9nbSU0rQB+qbL=9m0wVMwA3Aw@mail.gmail.com>

Hi Linus,

On Tue, Nov 08, 2022 at 01:31:16PM +0100, Linus Walleij wrote:
> Hi Chester,
> 
> thanks for your patch!
> 

Thanks for reviewing this patch series as well!

> On Mon, Oct 31, 2022 at 11:09 AM Chester Lin <clin@suse.com> wrote:
> 
> > Add DT schema for the pinctrl driver of NXP S32 SoC family.
> >
> > Signed-off-by: Larisa Grigore <larisa.grigore@nxp.com>
> > Signed-off-by: Ghennadi Procopciuc <Ghennadi.Procopciuc@nxp.com>
> > Signed-off-by: Chester Lin <clin@suse.com>
> (...)
> > +  nxp,pins:
> > +    $ref: /schemas/types.yaml#/definitions/uint32-array
> > +    description:
> > +      A list of [start, end] pin ID boundaries that correspond to each of
> > +      the register regions reserved.
> 
> That's an interesting approach.
> 
> But what about just hardcoding this into the driver instead?
> 
> If you have the compatible, surely you know these indexes from
> that compatible string?
> 

The nxp,pins property is more like a common language that both kernel and
u-boot can share with. Of course hardcoding indexes can be achieved as well
but that also means the index matrices in both kernel driver and u-boot driver
must be revised and synchronized if new boards may have different reg and
nxp,pins. IMHO, having these ID ranges in DT could be more intuitive, developers
can easily compare every pair with the corresponding reg entry in the same dts
file since reg maps are fragmented as I mentioned in Rob's code review[1].
Based on this approach, both kernel driver and u-boot driver can reuse the
same parser to acquire pin ID ranges from different boards, which can also
simplify codes and have less patches in the future.

Regards,
Chester

[1] https://lkml.org/lkml/2022/11/9/722

> Yours,
> Linus Walleij

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

  reply	other threads:[~2022-11-09 16:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31 10:08 [PATCH 0/2] Add pinctrl support for S32 SoC family Chester Lin
2022-10-31 10:08 ` Chester Lin
2022-10-31 10:08 ` [PATCH 1/2] dt-bindings: pinctrl: add schema for NXP S32 SoCs Chester Lin
2022-10-31 10:08   ` Chester Lin
2022-11-02 15:49   ` Rob Herring
2022-11-02 15:49     ` Rob Herring
2022-11-09 15:04     ` Chester Lin
2022-11-09 15:04       ` Chester Lin
2022-11-08 12:31   ` Linus Walleij
2022-11-08 12:31     ` Linus Walleij
2022-11-09 16:45     ` Chester Lin [this message]
2022-11-09 16:45       ` Chester Lin
2022-11-10 10:00       ` Linus Walleij
2022-11-10 10:00         ` Linus Walleij
2022-11-10 11:18         ` Andrei Stefanescu
2022-11-10 11:18           ` Andrei Stefanescu
2022-10-31 10:08 ` [PATCH 2/2] pinctrl: add NXP S32 SoC family support Chester Lin
2022-10-31 10:08   ` Chester Lin
2022-11-08 12:35   ` Linus Walleij
2022-11-08 12:35     ` Linus Walleij
2022-11-08 14:54   ` Andrei Stefanescu
2022-11-08 14:54     ` Andrei Stefanescu
2022-11-08 16:51     ` Andreas Färber
2022-11-08 16:51       ` Andreas Färber
2022-11-09  9:06       ` Andrei Stefanescu
2022-11-09  9:06         ` Andrei Stefanescu
2022-11-09  9:18         ` Chester Lin
2022-11-09  9:18           ` Chester Lin

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=Y2vZJaoWThP2aipE@linux-8mug \
    --to=clin@suse.com \
    --cc=Ghennadi.Procopciuc@nxp.com \
    --cc=afaerber@suse.de \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=larisa.grigore@nxp.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbrugger@suse.com \
    --cc=robh+dt@kernel.org \
    --cc=s32@nxp.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.