xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/renesas,rza2-pinctrl.yaml (revision e67e85659c0de33e617e5fbf1028c6e8b49eee53)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/renesas,rza2-pinctrl.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: Renesas RZ/A2 combined Pin and GPIO controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Chris Brandt <chris.brandt@renesas.com>
11c66ec88fSEmmanuel Vadot  - Geert Uytterhoeven <geert+renesas@glider.be>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotdescription:
14c66ec88fSEmmanuel Vadot  The Renesas SoCs of the RZ/A2 series feature a combined Pin and GPIO
15c66ec88fSEmmanuel Vadot  controller.
16c66ec88fSEmmanuel Vadot  Pin multiplexing and GPIO configuration is performed on a per-pin basis.
17c66ec88fSEmmanuel Vadot  Each port features up to 8 pins, each of them configurable for GPIO function
18c66ec88fSEmmanuel Vadot  (port mode) or in alternate function mode.
19c66ec88fSEmmanuel Vadot  Up to 8 different alternate function modes exist for each single pin.
20c66ec88fSEmmanuel Vadot
21c66ec88fSEmmanuel Vadotproperties:
22c66ec88fSEmmanuel Vadot  compatible:
23c66ec88fSEmmanuel Vadot    const: "renesas,r7s9210-pinctrl" # RZ/A2M
24c66ec88fSEmmanuel Vadot
25c66ec88fSEmmanuel Vadot  reg:
26c66ec88fSEmmanuel Vadot    maxItems: 1
27c66ec88fSEmmanuel Vadot
28c66ec88fSEmmanuel Vadot  gpio-controller: true
29c66ec88fSEmmanuel Vadot
30c66ec88fSEmmanuel Vadot  '#gpio-cells':
31c66ec88fSEmmanuel Vadot    const: 2
32c66ec88fSEmmanuel Vadot    description:
33c66ec88fSEmmanuel Vadot      The first cell contains the global GPIO port index, constructed using the
34c66ec88fSEmmanuel Vadot      RZA2_PIN() helper macro in r7s9210-pinctrl.h.
35c66ec88fSEmmanuel Vadot      E.g. "RZA2_PIN(PORT6, 0)" for P6_0.
36c66ec88fSEmmanuel Vadot
37c66ec88fSEmmanuel Vadot  gpio-ranges:
38c66ec88fSEmmanuel Vadot    maxItems: 1
39c66ec88fSEmmanuel Vadot
40c66ec88fSEmmanuel VadotpatternProperties:
41c66ec88fSEmmanuel Vadot  "^.*$":
42c66ec88fSEmmanuel Vadot    if:
43c66ec88fSEmmanuel Vadot      type: object
44c66ec88fSEmmanuel Vadot    then:
45c66ec88fSEmmanuel Vadot      allOf:
46c66ec88fSEmmanuel Vadot        - $ref: pincfg-node.yaml#
47c66ec88fSEmmanuel Vadot        - $ref: pinmux-node.yaml#
48c66ec88fSEmmanuel Vadot      description:
49c66ec88fSEmmanuel Vadot        The child nodes of the pin controller designate pins to be used for
50c66ec88fSEmmanuel Vadot        specific peripheral functions or as GPIO.
51c66ec88fSEmmanuel Vadot
52c66ec88fSEmmanuel Vadot        A pin multiplexing sub-node describes how to configure a set of
53c66ec88fSEmmanuel Vadot        (or a single) pin in some desired alternate function mode.
54c66ec88fSEmmanuel Vadot        The values for the pinmux properties are a combination of port name,
55c66ec88fSEmmanuel Vadot        pin number and the desired function index. Use the RZA2_PINMUX macro
56c66ec88fSEmmanuel Vadot        located in include/dt-bindings/pinctrl/r7s9210-pinctrl.h to easily
57c66ec88fSEmmanuel Vadot        define these.
58c66ec88fSEmmanuel Vadot        For assigning GPIO pins, use the macro RZA2_PIN also in
59c66ec88fSEmmanuel Vadot        to express the desired port pin.
60c66ec88fSEmmanuel Vadot
61c66ec88fSEmmanuel Vadot      properties:
62c66ec88fSEmmanuel Vadot        phandle: true
63c66ec88fSEmmanuel Vadot
64c66ec88fSEmmanuel Vadot        pinmux:
65c66ec88fSEmmanuel Vadot          description:
66c66ec88fSEmmanuel Vadot            Values are constructed from GPIO port number, pin number, and
67c66ec88fSEmmanuel Vadot            alternate function configuration number using the RZA2_PINMUX()
68c66ec88fSEmmanuel Vadot            helper macro in r7s9210-pinctrl.h.
69c66ec88fSEmmanuel Vadot
70c66ec88fSEmmanuel Vadot      required:
71c66ec88fSEmmanuel Vadot        - pinmux
72c66ec88fSEmmanuel Vadot
73c66ec88fSEmmanuel Vadot      additionalProperties: false
74c66ec88fSEmmanuel Vadot
75*e67e8565SEmmanuel VadotallOf:
76*e67e8565SEmmanuel Vadot  - $ref: "pinctrl.yaml#"
77*e67e8565SEmmanuel Vadot
78c66ec88fSEmmanuel Vadotrequired:
79c66ec88fSEmmanuel Vadot  - compatible
80c66ec88fSEmmanuel Vadot  - reg
81c66ec88fSEmmanuel Vadot  - gpio-controller
82c66ec88fSEmmanuel Vadot  - '#gpio-cells'
83c66ec88fSEmmanuel Vadot  - gpio-ranges
84c66ec88fSEmmanuel Vadot
85c66ec88fSEmmanuel VadotadditionalProperties: false
86c66ec88fSEmmanuel Vadot
87c66ec88fSEmmanuel Vadotexamples:
88c66ec88fSEmmanuel Vadot  - |
89c66ec88fSEmmanuel Vadot    #include <dt-bindings/pinctrl/r7s9210-pinctrl.h>
906be33864SEmmanuel Vadot    pinctrl: pinctrl@fcffe000 {
91c66ec88fSEmmanuel Vadot            compatible = "renesas,r7s9210-pinctrl";
92c66ec88fSEmmanuel Vadot            reg = <0xfcffe000 0x1000>;
93c66ec88fSEmmanuel Vadot
94c66ec88fSEmmanuel Vadot            gpio-controller;
95c66ec88fSEmmanuel Vadot            #gpio-cells = <2>;
96c66ec88fSEmmanuel Vadot            gpio-ranges = <&pinctrl 0 0 176>;
97c66ec88fSEmmanuel Vadot
98c66ec88fSEmmanuel Vadot            /* Serial Console */
99c66ec88fSEmmanuel Vadot            scif4_pins: serial4 {
100c66ec88fSEmmanuel Vadot                    pinmux = <RZA2_PINMUX(PORT9, 0, 4)>, /* TxD4 */
101c66ec88fSEmmanuel Vadot                             <RZA2_PINMUX(PORT9, 1, 4)>; /* RxD4 */
102c66ec88fSEmmanuel Vadot            };
103c66ec88fSEmmanuel Vadot    };
104