Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: gaohan@iscas.ac.cn
Cc: Sudeep Holla <sudeep.holla@kernel.org>,
	Cristian Marussi <cristian.marussi@arm.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Thomas Gleixner <tglx@kernel.org>, Radu Rendec <radu@rendec.net>,
	Samuel Holland <samuel.holland@sifive.com>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	Anup Patel <anup@brainfault.org>, Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Drew Fustini <fustini@kernel.org>, Icenowy Zheng <uwu@icenowy.me>,
	Inochi Amaoto <inochiama@gmail.com>,
	Vivian Wang <wangruikang@iscas.ac.cn>, Yao Zi <me@ziyao.cc>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-riscv@lists.infradead.org, linux-gpio@vger.kernel.org,
	Paul Walmsley <paul.walmsley@sifive.com>,
	linux-clk@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH RFC 06/18] dt-bindings: pinctrl: add Zhihe A210 pin controller
Date: Thu, 29 Oct 2026 19:41:07 +0000	[thread overview]
Message-ID: <20261029-cleft-other-eb7371c8fa3b@spud> (raw)
In-Reply-To: <20261027-a210-scmi-v1-6-74d58ce85bd8@iscas.ac.cn>

[-- Attachment #1: Type: text/plain, Size: 8454 bytes --]

On Tue, Oct 27, 2026 at 11:36:57PM +0800, Han Gao via B4 Relay wrote:
> From: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
> 
> Add bindings for the four A210 pad controllers. Describe the shared
> PERI3 SDIO mux, the per-pad bias controls and the optional pad
> controller reset.
> 
> Signed-off-by: Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
> Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
> ---
>  .../bindings/pinctrl/zhihe,a210-pinctrl.yaml       | 211 +++++++++++++++++++++
>  1 file changed, 211 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/pinctrl/zhihe,a210-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/zhihe,a210-pinctrl.yaml
> new file mode 100644
> index 000000000000..ae8eebbb0be2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pinctrl/zhihe,a210-pinctrl.yaml
> @@ -0,0 +1,211 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pinctrl/zhihe,a210-pinctrl.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ZhiHe A210 pin controller
> +
> +maintainers:
> +  - Zhiguo Zhu <zhiguo.zhu@linux.alibaba.com>
> +
> +description: |
> +  Pinmux and pinconf controller of the ZhiHe A210 RISC-V SoC.
> +
> +  The pads of the A210 are split into four groups, each managed by its
> +  own pad controller with a separate register range:
> +
> +    AON pad controller     -> zhihe,a210-aon-pinctrl
> +    PADCTRL0 (peripheral1) -> zhihe,a210-peri1-pinctrl
> +    PADCTRL1 (peripheral2) -> zhihe,a210-peri2-pinctrl
> +    PADCTRL2 (peripheral3) -> zhihe,a210-peri3-pinctrl
> +
> +  Each pad can be muxed individually to up to 8 different functions,
> +  though for most pads only a few of those configurations are valid.
> +  A few pads in the AON group do not support muxing or configuration
> +  at all.
> +
> +  AON, PERI1 and PERI2 pads support configurable drive strength, bias,
> +  input enable, Schmitt trigger and slew rate.

> PERI3 has a separate pad
> +  layout: its six dedicated SDIO pads, named SDIO_CLK, SDIO_CMD and
> +  SDIO_DAT0..3 in the SoC pin list, share one mux bit that selects SDIO or
> +  GPIO4 for all of them. Select their function with the "sdio" group.
> +  Per-pad bias can be configured independently.

Quite frankly, PERI3 seems just too different and should not actually be
in here at all. That said, I think this should still be just done as
pins + function, and drop the overcomplicated binding. The driver for
peri3 should know how this device works and be able to handle the fact
that all pins share one mux - the set_mux op works on groups and
functions, so you can just apply the setting once and return.

I assume it cannot be just a group and a function because the individual
pins can have different configuration?

> +
> +properties:
> +  compatible:
> +    enum:
> +      - zhihe,a210-aon-pinctrl
> +      - zhihe,a210-peri1-pinctrl
> +      - zhihe,a210-peri2-pinctrl
> +      - zhihe,a210-peri3-pinctrl
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: pclk
> +
> +  resets:
> +    maxItems: 1
> +
> +patternProperties:
> +  '-[0-9]+$':
> +    type: object
> +
> +    description:
> +      A pinmux group referenced by a consumer's pinctrl phandle. It
> +      contains one subnode per set of pads sharing the same pinmux and
> +      pinconf settings.
> +
> +    additionalProperties: false
> +
> +    patternProperties:
> +      '-pins$':
> +        type: object
> +        $ref: /schemas/pinctrl/pincfg-node.yaml#
> +
> +        description:
> +          A pinctrl node describing the pinmux and pinconf settings of
> +          one or more pads.
> +
> +        properties:
> +          pins:
> +            $ref: /schemas/pinctrl/pinmux-node.yaml#/properties/pins
> +            description: List of pads that properties in the node apply to.
> +
> +          groups:
> +            items:
> +              - const: sdio
> +
> +          function:
> +            $ref: /schemas/pinctrl/pinmux-node.yaml#/properties/function
> +            enum: [ aouart, aouart_ir, aogpio0, aogpio1, aoi2c0, aoi2c1,
> +                    aospi, jtag, reset, por, pmic, dvs, uart0, uart1,
> +                    uart2, uart3, uart4, uart5, uart6, uart7, uart8,
> +                    uart9, uart0_ir, uart1_ir, uart2_ir, uart3_ir,
> +                    uart4_ir, uart5_ir, uart6_ir, uart7_ir, uart8_ir,
> +                    uart9_ir, gpio0, gpio1, gpio2, gpio3, gpio4, gmac0,
> +                    gmac1, spi0, spi1, qspi0, qspi1, pwm0, pwm1, pwm2,
> +                    can0, can1, can2, i2s0, i2s1, i2s2, i2s3, i2c0, i2c1,
> +                    i2c2, i2c3, i2c4, i2c5, i2c6, i2c7, i2c7_smb, sdio,
> +                    isp0, dptx, usb31, sata_p0, sata_p1, hdmi, zmac,
> +                    bsel, dbgm, cdbg, pdm, tdm, pcie_x1, pcie_x4,
> +                    sen_vclk ]

Commentary here still applies.

> +            description: The mux function to select for the given pins.
> +
> +          bias-disable: true
> +
> +          bias-pull-up: true
> +
> +          bias-pull-down: true
> +
> +          drive-strength:
> +            enum: [ 1, 2, 3, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23,
> +                    25 ]
> +            description: Drive strength in mA.
> +
> +          input-enable: true
> +
> +          input-disable: true
> +
> +          input-schmitt-enable: true
> +
> +          input-schmitt-disable: true
> +
> +          slew-rate:
> +            maximum: 1
> +
> +        oneOf:
> +          - required: [pins]
> +          - required: [groups]
> +
> +        additionalProperties: false
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          const: zhihe,a210-peri3-pinctrl
> +    then:
> +      patternProperties:
> +        '-[0-9]+$':
> +          patternProperties:
> +            '-pins$':
> +              properties:
> +                pins:
> +                  items:
> +                    enum: [SDIO_CLK, SDIO_CMD, SDIO_DAT0, SDIO_DAT1,
> +                           SDIO_DAT2, SDIO_DAT3]

Commentary here also applies.

> +                function:
> +                  enum: [sdio, gpio4]
> +                drive-strength: false
> +                input-enable: false
> +                input-disable: false
> +                input-schmitt-enable: false
> +                input-schmitt-disable: false
> +                slew-rate: false
> +              if:
> +                required: [function]
> +              then:
> +                required: [groups]
> +    else:
> +      patternProperties:
> +        '-[0-9]+$':
> +          patternProperties:
> +            '-pins$':
> +              properties:
> +                groups: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - clock-names
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    pinctrl@2026000 {
> +        compatible = "zhihe,a210-peri1-pinctrl";
> +        reg = <0x2026000 0x1000>;
> +        clocks = <&clk 0>;
> +        clock-names = "pclk";
> +
> +        gmac0-0 {
> +            gmac0-pins {
> +                pins = "GPIO0_0", "GPIO0_12";
> +                function = "gmac0";
> +                bias-disable;
> +                drive-strength = <13>;
> +                input-disable;
> +                input-schmitt-disable;
> +                slew-rate = <0>;
> +            };
> +        };
> +    };
> +
> +  - |
> +    pinctrl@542000 {
> +        compatible = "zhihe,a210-peri3-pinctrl";
> +        reg = <0x542000 0x1000>;
> +        clocks = <&clk 0>;
> +        clock-names = "pclk";
> +
> +        sdio-0 {
> +            cmd-data-pins {
> +                pins = "SDIO_CMD", "SDIO_DAT0", "SDIO_DAT1",
> +                       "SDIO_DAT2", "SDIO_DAT3";
> +                bias-pull-up;
> +            };
> +
> +            sdio-pins {
> +                groups = "sdio";
> +                function = "sdio";
> +            };
> +        };
> +    };
> 
> -- 
> 2.55.0
> 
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-10-29 19:41 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 15:36 [PATCH RFC 00/18] riscv: add initial Zhihe A210 support using SCMI clocks and resets Han Gao via B4 Relay
2026-10-27 15:36 ` [PATCH RFC 01/18] firmware: arm_scmi: Allow SCMI transports on RISC-V Han Gao via B4 Relay
2026-10-27 15:51   ` Michal Simek
2026-10-27 16:18     ` Sudeep Holla
2026-10-27 15:36 ` [PATCH RFC 02/18] dt-bindings: vendor-prefixes: add Zhihe Han Gao via B4 Relay
2026-10-29 19:51   ` Conor Dooley
2026-10-27 15:36 ` [PATCH RFC 03/18] riscv: add Zhihe A210 support Han Gao via B4 Relay
2026-10-27 15:36 ` [PATCH RFC 04/18] dt-bindings: mailbox: add the A210 AP to E902 doorbell Han Gao via B4 Relay
2026-10-29 19:50   ` Conor Dooley
2026-10-27 15:36 ` [PATCH RFC 05/18] mailbox: add A210 AP to E902 doorbell support Han Gao via B4 Relay
2026-10-27 15:36 ` [PATCH RFC 06/18] dt-bindings: pinctrl: add Zhihe A210 pin controller Han Gao via B4 Relay
2026-10-29 19:41   ` Conor Dooley [this message]
2026-10-27 15:36 ` [PATCH RFC 07/18] pinctrl: zhihe: add A210 support Han Gao via B4 Relay
2026-10-28  7:17   ` Uwe Kleine-König
2026-10-29  9:53   ` Linus Walleij
2026-10-27 15:36 ` [PATCH RFC 08/18] dt-bindings: interrupt-controller: add Zhihe A210 PLIC Han Gao via B4 Relay
2026-10-29 19:21   ` Conor Dooley
2026-10-27 15:37 ` [PATCH RFC 09/18] dt-bindings: riscv: add Melon Pi V1 and V2 Han Gao via B4 Relay
2026-10-29 19:41   ` Conor Dooley
2026-10-27 15:37 ` [PATCH RFC 10/18] dt-bindings: timer: add Zhihe A210 CLINT Han Gao via B4 Relay
2026-10-29 19:48   ` Conor Dooley
2026-10-27 15:37 ` [PATCH RFC 11/18] dt-bindings: firmware: add A210 SCMI clock and reset IDs Han Gao via B4 Relay
2026-10-29 19:45   ` Conor Dooley
2026-10-27 15:37 ` [PATCH RFC 12/18] dt-bindings: serial: snps-dw-apb-uart: add Zhihe A210 UART Han Gao via B4 Relay
2026-10-29 19:53   ` Conor Dooley
2026-10-27 15:37 ` [PATCH RFC 13/18] riscv: dts: zhihe: add A210 core support Han Gao via B4 Relay
2026-10-27 15:37 ` [PATCH RFC 14/18] riscv: dts: zhihe: add A210 UARTs Han Gao via B4 Relay
2026-10-27 15:37 ` [PATCH RFC 15/18] riscv: dts: zhihe: add A210 module memory Han Gao via B4 Relay
2026-10-27 15:37 ` [PATCH RFC 16/18] riscv: dts: zhihe: add Melon Pi V1 and V2 Han Gao via B4 Relay
2026-10-27 15:37 ` [PATCH RFC 17/18] riscv: defconfig: enable A210 support Han Gao via B4 Relay
2026-10-27 15:37 ` [PATCH RFC 18/18] MAINTAINERS: add Zhihe A210 Han Gao via B4 Relay
2026-10-28  8:56 ` [PATCH RFC 00/18] riscv: add initial Zhihe A210 support using SCMI clocks and resets Bartosz Golaszewski
2026-10-28 17:48 ` Conor Dooley

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=20261029-cleft-other-eb7371c8fa3b@spud \
    --to=conor@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=arm-scmi@vger.kernel.org \
    --cc=bmasney+clk@redhat.com \
    --cc=brgl@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=cristian.marussi@arm.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fustini@kernel.org \
    --cc=gaohan@iscas.ac.cn \
    --cc=gregkh@linuxfoundation.org \
    --cc=inochiama@gmail.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=jbrunet+clk@baylibre.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=jirislaby@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=me@ziyao.cc \
    --cc=p.zabel@pengutronix.de \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pjw@kernel.org \
    --cc=radu@rendec.net \
    --cc=robh@kernel.org \
    --cc=samuel.holland@sifive.com \
    --cc=sboyd@kernel.org \
    --cc=sudeep.holla@kernel.org \
    --cc=tglx@kernel.org \
    --cc=uwu@icenowy.me \
    --cc=wangruikang@iscas.ac.cn \
    --cc=zhiguo.zhu@linux.alibaba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox