From: Conor Dooley <conor@kernel.org>
To: Changhuang Liang <changhuang.liang@starfivetech.com>
Cc: Linus Walleij <linusw@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Emil Renner Berthing <kernel@esmil.dk>,
Paul Walmsley <pjw@kernel.org>, Albert Ou <aou@eecs.berkeley.edu>,
Palmer Dabbelt <palmer@dabbelt.com>,
Alexandre Ghiti <alex@ghiti.fr>,
Philipp Zabel <p.zabel@pengutronix.de>,
Bartosz Golaszewski <brgl@kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>,
Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com>
Subject: Re: [PATCH v1 11/20] dt-bindings: pinctrl: Add starfive,jhb100-per1-pinctrl
Date: Tue, 28 Apr 2026 19:51:09 +0100 [thread overview]
Message-ID: <20260428-hardhat-both-1c9aa594a45a@spud> (raw)
In-Reply-To: <ZQ4PR01MB120229BE0DAC2658164C066AF2372@ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn>
[-- Attachment #1: Type: text/plain, Size: 3345 bytes --]
On Tue, Apr 28, 2026 at 01:28:05AM +0000, Changhuang Liang wrote:
> > On Fri, Apr 24, 2026 at 04:13:21AM -0700, Changhuang Liang wrote:
> > > Add pinctrl bindings for StarFive JHB100 SoC Peripheral-1(per1)
> > > pinctrl controller.
> > >
> > > Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
> > > + properties:
> > > + pinmux:
> > > + description: |
> > > + The list of GPIOs and their function select.
> > > + The PINMUX macros are used to configure the
> > > + function selection.
> >
> > Why is the pinmux property needed?
> > Can you use pins and function instead?
> >
> > Looking at the defines that you have added, it appears that lots of defines for
> > the same peripheral share the same numerical values, suggesting that across
> > peripheral, all (or most) pins would share the same mux setting/"function
> > select", suggesting that pins/function would suffice.
> >
> > I'd like to see some justification for pinmux being the right solution here, like
> > the "function select" used by one peripheral being significantly different for
> > many of its pins.
>
> We think that implementing this in the pinmux will be relatively simple. It avoids
> the need to create a large number of mapping relationships in the driver, which
> simplifies our driver implementation. I'm not sure if you'll find this explanation
> acceptable.
I don't really see how pins + functions would require lots of "mapping
relationships". Instead of having
+/* pinctrl_sys2 pad function selection */
+#define FUNC_SYS2_UART_CTS 1
+#define FUNC_SYS2_UART_RTS 1
+#define FUNC_SYS2_UART_DCD 1
+#define FUNC_SYS2_UART_DSR 1
+#define FUNC_SYS2_UART_DTR 1
+#define FUNC_SYS2_UART_RI 1
+#define FUNC_SYS2_UART0_TX 1
+#define FUNC_SYS2_UART0_RX 1
+#define FUNC_SYS2_UART1_TX 1
+#define FUNC_SYS2_UART1_RX 1
+#define FUNC_SYS2_UART2_TX 1
+#define FUNC_SYS2_UART2_RX 1
+#define FUNC_SYS2_UART3_TX 1
+#define FUNC_SYS2_UART3_RX 1
+#define FUNC_SYS2_UART4_TX 1
+#define FUNC_SYS2_UART4_RX 1
+#define FUNC_SYS2_UART5_TX 1
+#define FUNC_SYS2_UART5_RX 1
+#define FUNC_SYS2_UART6_TX 1
+#define FUNC_SYS2_UART6_RX 1
+#define FUNC_SYS2_UART7_TX 1
+#define FUNC_SYS2_UART7_RX 1
+#define FUNC_SYS2_UART8_TX 1
+#define FUNC_SYS2_UART8_RX 1
+#define FUNC_SYS2_UART9_TX 1
+#define FUNC_SYS2_UART9_RX 1
+#define FUNC_SYS2_UART10_TX 1
+#define FUNC_SYS2_UART10_RX 1
+#define FUNC_SYS2_UART11_TX 1
+#define FUNC_SYS2_UART11_RX 1
+#define FUNC_SYS2_UART12_TX 1
+#define FUNC_SYS2_UART12_RX 1
+#define FUNC_SYS2_UART13_TX 1
+#define FUNC_SYS2_UART13_RX 1
+#define FUNC_SYS2_UART14_TX 1
+#define FUNC_SYS2_UART14_RX 1
you just define a function called "uart" and have a simple map of
that string to the number 1. You end up with a single array with the
relationships, not lots.
Frankly, pinmux just does not seem appropriate to me when it looks like
90%+ of the pin mappings for a peripheral share the same function value.
There appears only to be a rare number of cases where that doesn't
apply, but that could be handled by having them represented by a
different group/pins node with a different function.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-04-28 18:51 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-24 11:13 [PATCH v1 00/20] Add basic pinctrl drivers for JHB100 SoC Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 01/20] dt-bindings: pinctrl: Add starfive,jhb100-sys0-pinctrl Changhuang Liang
2026-04-28 10:34 ` Linus Walleij
2026-04-24 11:13 ` [PATCH v1 02/20] pinctrl: starfive: Add StarFive JHB100 sys0 controller driver Changhuang Liang
2026-04-28 10:29 ` Linus Walleij
2026-04-24 11:13 ` [PATCH v1 03/20] dt-bindings: pinctrl: Add starfive,jhb100-sys0h-pinctrl Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 04/20] pinctrl: starfive: Add StarFive JHB100 sys0h controller driver Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 05/20] dt-bindings: pinctrl: Add starfive,jhb100-sys1-pinctrl Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 06/20] pinctrl: starfive: Add StarFive JHB100 sys1 controller driver Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 07/20] dt-bindings: pinctrl: Add starfive,jhb100-sys2-pinctrl Changhuang Liang
2026-04-25 10:28 ` Krzysztof Kozlowski
2026-04-24 11:13 ` [PATCH v1 08/20] pinctrl: starfive: Add StarFive JHB100 sys2 controller driver Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 09/20] dt-bindings: pinctrl: Add starfive,jhb100-per0-pinctrl Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 10/20] pinctrl: starfive: Add StarFive JHB100 per0 controller driver Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 11/20] dt-bindings: pinctrl: Add starfive,jhb100-per1-pinctrl Changhuang Liang
2026-04-24 16:56 ` Conor Dooley
2026-04-28 1:28 ` Changhuang Liang
2026-04-28 18:51 ` Conor Dooley [this message]
2026-04-28 11:08 ` Linus Walleij
2026-04-24 11:13 ` [PATCH v1 12/20] pinctrl: starfive: Add StarFive JHB100 per1 controller driver Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 13/20] dt-bindings: pinctrl: Add starfive,jhb100-per2-pinctrl Changhuang Liang
2026-04-24 13:17 ` Rob Herring (Arm)
2026-04-24 11:13 ` [PATCH v1 14/20] pinctrl: starfive: Add StarFive JHB100 per2 controller driver Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 15/20] dt-bindings: pinctrl: Add starfive,jhb100-per2pok-pinctrl Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 16/20] pinctrl: starfive: Add StarFive JHB100 per2pok controller driver Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 17/20] dt-bindings: pinctrl: Add starfive,jhb100-per3-pinctrl Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 18/20] pinctrl: starfive: Add StarFive JHB100 per3 controller driver Changhuang Liang
2026-04-24 11:13 ` [PATCH v1 19/20] riscv: dts: starfive: Add StarFive JHB100 pin function definitions Changhuang Liang
2026-04-24 17:00 ` Conor Dooley
2026-04-24 11:13 ` [PATCH v1 20/20] riscv: dts: starfive: jhb100: Add pinctrl nodes Changhuang Liang
2026-04-24 17:01 ` Conor Dooley
2026-04-28 1:53 ` Changhuang Liang
2026-04-28 10:11 ` [PATCH v1 00/20] Add basic pinctrl drivers for JHB100 SoC Linus Walleij
2026-04-29 0:53 ` Changhuang Liang
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=20260428-hardhat-both-1c9aa594a45a@spud \
--to=conor@kernel.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=brgl@kernel.org \
--cc=changhuang.liang@starfivetech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@esmil.dk \
--cc=krzk+dt@kernel.org \
--cc=lianfeng.ouyang@starfivetech.com \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=robh@kernel.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