summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.yaml
blob: 45b767986a8784cc1fd07356011a8cbd6f1c14e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/rockchip,pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Rockchip Pinmux Controller

maintainers:
  - Heiko Stuebner <heiko@sntech.de>

description: |
  The Rockchip Pinmux Controller enables the IC to share one PAD
  to several functional blocks. The sharing is done by multiplexing
  the PAD input/output signals. For each PAD there are several muxing
  options with option 0 being used as a GPIO.

  Please refer to pinctrl-bindings.txt in this directory for details of the
  common pinctrl bindings used by client devices, including the meaning of the
  phrase "pin configuration node".

  The Rockchip pin configuration node is a node of a group of pins which can be
  used for a specific device or function. This node represents both mux and
  config of the pins in that group. The 'pins' selects the function mode
  (also named pin mode) this pin can work on and the 'config' configures
  various pad settings such as pull-up, etc.

  The pins are grouped into up to 9 individual pin banks which need to be
  defined as gpio sub-nodes of the pinmux controller.

properties:
  compatible:
    enum:
      - rockchip,px30-pinctrl
      - rockchip,rk2928-pinctrl
      - rockchip,rk3036-pinctrl
      - rockchip,rk3066a-pinctrl
      - rockchip,rk3066b-pinctrl
      - rockchip,rk3128-pinctrl
      - rockchip,rk3188-pinctrl
      - rockchip,rk3228-pinctrl
      - rockchip,rk3288-pinctrl
      - rockchip,rk3308-pinctrl
      - rockchip,rk3328-pinctrl
      - rockchip,rk3368-pinctrl
      - rockchip,rk3399-pinctrl
      - rockchip,rk3568-pinctrl
      - rockchip,rk3588-pinctrl
      - rockchip,rv1108-pinctrl
      - rockchip,rv1126-pinctrl

  rockchip,grf:
    $ref: "/schemas/types.yaml#/definitions/phandle"
    description:
      The phandle of the syscon node for the GRF registers.

  rockchip,pmu:
    $ref: "/schemas/types.yaml#/definitions/phandle"
    description:
      The phandle of the syscon node for the PMU registers,
      as some SoCs carry parts of the iomux controller registers there.
      Required for at least rk3188 and rk3288. On the rk3368 this should
      point to the PMUGRF syscon.

  "#address-cells":
    enum: [1, 2]

  "#size-cells":
    enum: [1, 2]

  ranges: true

allOf:
  - $ref: "pinctrl.yaml#"

required:
  - compatible
  - rockchip,grf

patternProperties:
  "gpio@[0-9a-f]+$":
    type: object

    $ref: "/schemas/gpio/rockchip,gpio-bank.yaml#"
    deprecated: true

    unevaluatedProperties: false

  "pcfg-[a-z0-9-]+$":
    type: object
    properties:
      bias-disable: true

      bias-pull-down: true

      bias-pull-pin-default: true

      bias-pull-up: true

      drive-strength:
        minimum: 0
        maximum: 20

      input-enable: true

      input-schmitt-enable: true

      output-high: true

      output-low: true

    additionalProperties: false

additionalProperties:
  type: object
  additionalProperties:
    type: object
    properties:
      rockchip,pins:
        $ref: "/schemas/types.yaml#/definitions/uint32-matrix"
        minItems: 1
        items:
          items:
            - minimum: 0
              maximum: 8
              description:
                Pin bank.
            - minimum: 0
              maximum: 31
              description:
                Pin bank index.
            - minimum: 0
              maximum: 13
              description:
                Mux 0 means GPIO and mux 1 to N means
                the specific device function.
            - description:
                The phandle of a node contains the generic pinconfig options
                to use as described in pinctrl-bindings.txt.

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/pinctrl/rockchip.h>

    pinctrl: pinctrl {
      compatible = "rockchip,rk3066a-pinctrl";
      rockchip,grf = <&grf>;

      #address-cells = <1>;
      #size-cells = <1>;
      ranges;

      gpio0: gpio@20034000 {
        compatible = "rockchip,gpio-bank";
        reg = <0x20034000 0x100>;
        interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&clk_gates8 9>;

        gpio-controller;
        #gpio-cells = <2>;

        interrupt-controller;
        #interrupt-cells = <2>;
      };

      pcfg_pull_default: pcfg-pull-default {
        bias-pull-pin-default;
      };

      uart2 {
        uart2_xfer: uart2-xfer {
          rockchip,pins = <1 RK_PB0 1 &pcfg_pull_default>,
                          <1 RK_PB1 1 &pcfg_pull_default>;
        };
      };
    };

    uart2: serial@20064000 {
      compatible = "snps,dw-apb-uart";
      reg = <0x20064000 0x400>;
      interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
      clocks = <&mux_uart2>;
      pinctrl-0 = <&uart2_xfer>;
      pinctrl-names = "default";
      reg-io-width = <1>;
      reg-shift = <2>;
    };