All of lore.kernel.org
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Pavel Machek <pavel@denx.de>
Cc: Chris Paterson <chris.paterson2@renesas.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Subject: [PATCH 5.10.y-cip 30/33] dt-bindings: pinctrl: Add DT bindings for Renesas RZ/V2M pinctrl
Date: Fri, 21 Apr 2023 08:17:26 +0100	[thread overview]
Message-ID: <20230421071729.130347-31-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20230421071729.130347-1-biju.das.jz@bp.renesas.com>

From: Phil Edworthy <phil.edworthy@renesas.com>

commit 34e3b69b1edc966f0f4dcdd880afba3a2dad8c09 upstream.

Add device tree binding documentation and header file for Renesas
RZ/V2M pinctrl.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220624084833.22605-2-phil.edworthy@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 .../pinctrl/renesas,rzv2m-pinctrl.yaml        | 170 ++++++++++++++++++
 include/dt-bindings/pinctrl/rzv2m-pinctrl.h   |  23 +++
 2 files changed, 193 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/renesas,rzv2m-pinctrl.yaml
 create mode 100644 include/dt-bindings/pinctrl/rzv2m-pinctrl.h

diff --git a/Documentation/devicetree/bindings/pinctrl/renesas,rzv2m-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/renesas,rzv2m-pinctrl.yaml
new file mode 100644
index 000000000000..eac6245db7dc
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/renesas,rzv2m-pinctrl.yaml
@@ -0,0 +1,170 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/renesas,rzv2m-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/V2M combined Pin and GPIO controller
+
+maintainers:
+  - Geert Uytterhoeven <geert+renesas@glider.be>
+  - Phil Edworthy <phil.edworthy@renesas.com>
+
+description:
+  The Renesas RZ/V2M SoC features a combined Pin and GPIO controller.
+  Pin multiplexing and GPIO configuration is performed on a per-pin basis.
+  Each port features up to 16 pins, each of them configurable for GPIO function
+  (port mode) or in alternate function mode.
+  Up to 8 different alternate function modes exist for each single pin.
+
+properties:
+  compatible:
+    const: renesas,r9a09g011-pinctrl # RZ/V2M
+
+  reg:
+    maxItems: 1
+
+  gpio-controller: true
+
+  '#gpio-cells':
+    const: 2
+    description:
+      The first cell contains the global GPIO port index, constructed using the
+      RZV2M_GPIO() helper macro in <dt-bindings/pinctrl/rzv2m-pinctrl.h> and the
+      second cell represents consumer flag as mentioned in ../gpio/gpio.txt
+      E.g. "RZV2M_GPIO(8, 1)" for P8_1.
+
+  gpio-ranges:
+    maxItems: 1
+
+  interrupts:
+    description: INEXINT[0..38] corresponding to individual pin inputs.
+    maxItems: 39
+
+  clocks:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+additionalProperties:
+  anyOf:
+    - type: object
+      allOf:
+        - $ref: pincfg-node.yaml#
+        - $ref: pinmux-node.yaml#
+
+      description:
+        Pin controller client devices use pin configuration subnodes (children
+        and grandchildren) for desired pin configuration.
+        Client device subnodes use below standard properties.
+
+      properties:
+        phandle: true
+        pinmux:
+          description:
+            Values are constructed from GPIO port number, pin number, and
+            alternate function configuration number using the RZV2M_PORT_PINMUX()
+            helper macro in <dt-bindings/pinctrl/rzv2m-pinctrl.h>.
+        pins: true
+        bias-disable: true
+        bias-pull-down: true
+        bias-pull-up: true
+        drive-strength-microamp:
+          # Superset of supported values
+          enum: [ 1600, 1800, 2000, 3200, 3800, 4000, 6400, 7800, 8000,
+                  9000, 9600, 11000, 12000, 13000, 18000 ]
+        slew-rate:
+          description: 0 is slow slew rate, 1 is fast slew rate
+          enum: [ 0, 1 ]
+        gpio-hog: true
+        gpios: true
+        output-high: true
+        output-low: true
+        line-name: true
+
+    - type: object
+      properties:
+        phandle: true
+
+      additionalProperties:
+        $ref: "#/additionalProperties/anyOf/0"
+
+allOf:
+  - $ref: "pinctrl.yaml#"
+
+required:
+  - compatible
+  - reg
+  - gpio-controller
+  - '#gpio-cells'
+  - gpio-ranges
+  - interrupts
+  - clocks
+  - power-domains
+  - resets
+
+examples:
+  - |
+    #include <dt-bindings/pinctrl/rzv2m-pinctrl.h>
+    #include <dt-bindings/clock/r9a09g011-cpg.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    pinctrl: pinctrl@b6250000 {
+            compatible = "renesas,r9a09g011-pinctrl";
+            reg = <0xb6250000 0x800>;
+
+            gpio-controller;
+            #gpio-cells = <2>;
+            gpio-ranges = <&pinctrl 0 0 352>;
+            interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
+            clocks = <&cpg CPG_MOD R9A09G011_PFC_PCLK>;
+            resets = <&cpg R9A09G011_PFC_PRESETN>;
+            power-domains = <&cpg>;
+
+            i2c2_pins: i2c2 {
+                    pinmux = <RZV2M_PORT_PINMUX(3, 8, 2)>, /* SDA */
+                             <RZV2M_PORT_PINMUX(3, 9, 2)>; /* SCL */
+            };
+    };
diff --git a/include/dt-bindings/pinctrl/rzv2m-pinctrl.h b/include/dt-bindings/pinctrl/rzv2m-pinctrl.h
new file mode 100644
index 000000000000..525532cd15da
--- /dev/null
+++ b/include/dt-bindings/pinctrl/rzv2m-pinctrl.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * This header provides constants for Renesas RZ/V2M pinctrl bindings.
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ *
+ */
+
+#ifndef __DT_BINDINGS_RZV2M_PINCTRL_H
+#define __DT_BINDINGS_RZV2M_PINCTRL_H
+
+#define RZV2M_PINS_PER_PORT	16
+
+/*
+ * Create the pin index from its bank and position numbers and store in
+ * the upper 16 bits the alternate function identifier
+ */
+#define RZV2M_PORT_PINMUX(b, p, f)	((b) * RZV2M_PINS_PER_PORT + (p) | ((f) << 16))
+
+/* Convert a port and pin label to its global pin index */
+#define RZV2M_GPIO(port, pin)	((port) * RZV2M_PINS_PER_PORT + (pin))
+
+#endif /* __DT_BINDINGS_RZV2M_PINCTRL_H */
-- 
2.25.1



  parent reply	other threads:[~2023-04-21  7:18 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21  7:16 [PATCH 5.10.y-cip 00/33] Add RZ/V2M support Biju Das
2023-04-21  7:16 ` [PATCH 5.10.y-cip 01/33] dt-bindings: serial: renesas,em-uart: Document r9a09g011 bindings Biju Das
2023-04-21  7:16 ` [PATCH 5.10.y-cip 02/33] dt-bindings: serial: renesas,em-uart: Add RZ/V2M clock to access the registers Biju Das
2023-04-21  7:16 ` [PATCH 5.10.y-cip 03/33] serial: 8250: extend compile-test coverage Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 04/33] serial: 8250: SERIAL_8250_EM should depend on ARCH_RENESAS Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 05/33] serial: 8250: Make SERIAL_8250_EM available for arm64 systems Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 06/33] dt-bindings: arm: renesas: Document Renesas RZ/V2M SoC and EVK board Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 07/33] dt-bindings: arm: renesas: Document Renesas RZ/V2M System Configuration Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 08/33] soc: renesas: Identify RZ/V2M SoC Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 09/33] soc: renesas: Add RZ/V2M (R9A09G011) config option Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 10/33] arm64: defconfig: Enable Renesas RZ/V2M SoC Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 11/33] dt-bindings: clock: Add r9a09g011 CPG Clock Definitions Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 12/33] dt-bindings: clock: renesas,rzg2l: Document RZ/V2M SoC Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 13/33] clk: renesas: rzg2l: Move the DEF_MUX array size calc into the macro Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 14/33] clk: renesas: rzg2l: Add read only versions of the clk macros Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 15/33] clk: renesas: rzg2l: Set HIWORD mask for all mux and dividers Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 16/33] clk: renesas: rzg2l: Make use of CLK_MON registers optional Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 17/33] clk: renesas: rzg2l: Add support for RZ/V2M reset monitor reg Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 18/33] clk: renesas: Add RZ/V2M support using the rzg2l driver Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 19/33] clk: renesas: r9a09g011: Add eth clock and reset entries Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 20/33] arm64: dts: renesas: Add initial DTSI for RZ/V2M SoC Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 21/33] arm64: dts: renesas: Add initial device tree for RZ/V2M EVK Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 22/33] dt-bindings: net: renesas,etheravb: Document RZ/V2M SoC Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 23/33] ravb: Separate handling of irq enable/disable regs into feature Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 24/33] ravb: Support separate Line0 (Desc), Line1 (Err) and Line2 (Mgmt) irqs Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 25/33] ravb: Use separate clock for gPTP Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 26/33] ravb: Add support for RZ/V2M Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 27/33] arm64: dts: renesas: r9a09g011: Add ethernet nodes Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 28/33] arm64: dts: renesas: rzv2mevk2: Enable ethernet Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 29/33] clk: renesas: r9a09g011: Add PFC clock and reset entries Biju Das
2023-04-21  7:17 ` Biju Das [this message]
2023-04-21  7:17 ` [PATCH 5.10.y-cip 31/33] pinctrl: renesas: Select PINCTRL_RZG2L if ARCH_RZG2L is enabled Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 32/33] pinctrl: renesas: Add RZ/V2M pin and gpio controller driver Biju Das
2023-04-21  7:17 ` [PATCH 5.10.y-cip 33/33] arm64: dts: renesas: r9a09g011: Add pinctrl node Biju Das
2023-04-21 10:54 ` [PATCH 5.10.y-cip 00/33] Add RZ/V2M support Pavel Machek
2023-04-21 11:18   ` Biju Das
2023-04-25  9:13     ` Pavel Machek

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=20230421071729.130347-31-biju.das.jz@bp.renesas.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=chris.paterson2@renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    /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.