xref: /openbmc/linux/Documentation/devicetree/bindings/pinctrl/nuvoton,npcm845-pinctrl.yaml (revision bdc76f53645ae0d544ebadd191981242009f676d)
1ab1c2de3STomer Maimon# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2ab1c2de3STomer Maimon%YAML 1.2
3ab1c2de3STomer Maimon---
4ab1c2de3STomer Maimon$id: http://devicetree.org/schemas/pinctrl/nuvoton,npcm845-pinctrl.yaml#
5ab1c2de3STomer Maimon$schema: http://devicetree.org/meta-schemas/core.yaml#
6ab1c2de3STomer Maimon
7ab1c2de3STomer Maimontitle: Nuvoton NPCM845 Pin Controller and GPIO
8ab1c2de3STomer Maimon
9ab1c2de3STomer Maimonmaintainers:
10ab1c2de3STomer Maimon  - Tomer Maimon <tmaimon77@gmail.com>
11ab1c2de3STomer Maimon
12ab1c2de3STomer Maimondescription:
13ab1c2de3STomer Maimon  The Nuvoton BMC NPCM8XX Pin Controller multi-function routed through
14ab1c2de3STomer Maimon  the multiplexing block, Each pin supports GPIO functionality (GPIOx)
15ab1c2de3STomer Maimon  and multiple functions that directly connect the pin to different
16ab1c2de3STomer Maimon  hardware blocks.
17ab1c2de3STomer Maimon
18ab1c2de3STomer Maimonproperties:
19ab1c2de3STomer Maimon  compatible:
20ab1c2de3STomer Maimon    const: nuvoton,npcm845-pinctrl
21ab1c2de3STomer Maimon
22ab1c2de3STomer Maimon  ranges:
23ab1c2de3STomer Maimon    maxItems: 1
24ab1c2de3STomer Maimon
25ab1c2de3STomer Maimon  '#address-cells':
26ab1c2de3STomer Maimon    const: 1
27ab1c2de3STomer Maimon
28ab1c2de3STomer Maimon  '#size-cells':
29ab1c2de3STomer Maimon    const: 1
30ab1c2de3STomer Maimon
31ab1c2de3STomer Maimon  nuvoton,sysgcr:
32ab1c2de3STomer Maimon    $ref: /schemas/types.yaml#/definitions/phandle
33ab1c2de3STomer Maimon    description: a phandle to access GCR registers.
34ab1c2de3STomer Maimon
35ab1c2de3STomer MaimonpatternProperties:
36ab1c2de3STomer Maimon  '^gpio@':
37ab1c2de3STomer Maimon    type: object
38*bdc76f53STomer Maimon    additionalProperties: false
39ab1c2de3STomer Maimon
40ab1c2de3STomer Maimon    description:
41ab1c2de3STomer Maimon      Eight GPIO banks that each contain 32 GPIOs.
42ab1c2de3STomer Maimon
43ab1c2de3STomer Maimon    properties:
44ab1c2de3STomer Maimon      gpio-controller: true
45ab1c2de3STomer Maimon
46ab1c2de3STomer Maimon      '#gpio-cells':
47ab1c2de3STomer Maimon        const: 2
48ab1c2de3STomer Maimon
49ab1c2de3STomer Maimon      reg:
50ab1c2de3STomer Maimon        maxItems: 1
51ab1c2de3STomer Maimon
52ab1c2de3STomer Maimon      interrupts:
53ab1c2de3STomer Maimon        maxItems: 1
54ab1c2de3STomer Maimon
55ab1c2de3STomer Maimon      gpio-ranges:
56ab1c2de3STomer Maimon        maxItems: 1
57ab1c2de3STomer Maimon
58ab1c2de3STomer Maimon    required:
59ab1c2de3STomer Maimon      - gpio-controller
60ab1c2de3STomer Maimon      - '#gpio-cells'
61ab1c2de3STomer Maimon      - reg
62ab1c2de3STomer Maimon      - interrupts
63ab1c2de3STomer Maimon      - gpio-ranges
64ab1c2de3STomer Maimon
65ab1c2de3STomer Maimon  '-mux$':
66ab1c2de3STomer Maimon    $ref: pinmux-node.yaml#
67ab1c2de3STomer Maimon
68ab1c2de3STomer Maimon    properties:
69ab1c2de3STomer Maimon      groups:
70ab1c2de3STomer Maimon        description:
71ab1c2de3STomer Maimon          One or more groups of pins to mux to a certain function
72ab1c2de3STomer Maimon        items:
73ab1c2de3STomer Maimon          enum: [ iox1, iox2, smb1d, smb2d, lkgpo1, lkgpo2, ioxh, gspi,
74*bdc76f53STomer Maimon                  smb5b, smb5c, lkgpo0, pspi, jm1, jm2, smb4b, smb4c, smb15,
75*bdc76f53STomer Maimon                  smb16, smb17, smb18, smb19, smb20, smb21, smb22, smb23,
76*bdc76f53STomer Maimon                  smb23b, smb4d, smb14, smb5, smb4, smb3, spi0cs1, spi0cs2,
77*bdc76f53STomer Maimon                  spi0cs3, spi1cs0, spi1cs1, spi1cs2, spi1cs3, spi1cs23, smb3c,
78*bdc76f53STomer Maimon                  smb3b, bmcuart0a, uart1, jtag2, bmcuart1, uart2, sg1mdio,
79*bdc76f53STomer Maimon                  bmcuart0b, r1err, r1md, r1oen, r2oen, rmii3, r3oen, smb3d,
80*bdc76f53STomer Maimon                  fanin0, fanin1, fanin2, fanin3, fanin4, fanin5, fanin6,
81*bdc76f53STomer Maimon                  fanin7, fanin8, fanin9, fanin10, fanin11, fanin12, fanin13,
82*bdc76f53STomer Maimon                  fanin14, fanin15, pwm0, pwm1, pwm2, pwm3, r2, r2err, r2md,
83*bdc76f53STomer Maimon                  r3rxer, ga20kbc, smb5d, lpc, espi, rg2, ddr, i3c0, i3c1,
84*bdc76f53STomer Maimon                  i3c2, i3c3, i3c4, i3c5, smb0, smb1, smb2, smb2c, smb2b, smb1c,
85*bdc76f53STomer Maimon                  smb1b, smb8, smb9, smb10, smb11, sd1, sd1pwr, pwm4, pwm5,
86*bdc76f53STomer Maimon                  pwm6, pwm7, pwm8, pwm9, pwm10, pwm11, mmc8, mmc, mmcwp, mmccd,
87*bdc76f53STomer Maimon                  mmcrst, clkout, serirq, scipme, smi, smb6, smb6b, smb6c,
88*bdc76f53STomer Maimon                  smb6d, smb7, smb7b, smb7c, smb7d, spi1, faninx, r1, spi3,
89*bdc76f53STomer Maimon                  spi3cs1, spi3quad, spi3cs2, spi3cs3, nprd_smi, smb0b, smb0c,
90*bdc76f53STomer Maimon                  smb0den, smb0d, ddc, rg2mdio, wdog1, wdog2, smb12, smb13,
91*bdc76f53STomer Maimon                  spix, spixcs1, clkreq, hgpio0, hgpio1, hgpio2, hgpio3, hgpio4,
92*bdc76f53STomer Maimon                  hgpio5, hgpio6, hgpio7, bu4, bu4b, bu5, bu5b, bu6, gpo187 ]
93ab1c2de3STomer Maimon
94ab1c2de3STomer Maimon      function:
95ab1c2de3STomer Maimon        description:
96ab1c2de3STomer Maimon          The function that a group of pins is muxed to
97*bdc76f53STomer Maimon        enum: [ iox1, iox2, smb1d, smb2d, lkgpo1, lkgpo2, ioxh, gspi, smb5b,
98*bdc76f53STomer Maimon                smb5c, lkgpo0, pspi, jm1, jm2, smb4b, smb4c, smb15, smb16,
99*bdc76f53STomer Maimon                smb17, smb18, smb19, smb20, smb21, smb22, smb23, smb23b, smb4d,
100*bdc76f53STomer Maimon                smb14, smb5, smb4, smb3, spi0cs1, spi0cs2, spi0cs3, spi1cs0,
101*bdc76f53STomer Maimon                spi1cs1, spi1cs2, spi1cs3, spi1cs23, smb3c, smb3b, bmcuart0a,
102*bdc76f53STomer Maimon                uart1, jtag2, bmcuart1, uart2, sg1mdio, bmcuart0b, r1err, r1md,
103*bdc76f53STomer Maimon                r1oen, r2oen, rmii3, r3oen, smb3d, fanin0, fanin1, fanin2,
104*bdc76f53STomer Maimon                fanin3, fanin4, fanin5, fanin6, fanin7, fanin8, fanin9, fanin10,
105ab1c2de3STomer Maimon                fanin11, fanin12, fanin13, fanin14, fanin15, pwm0, pwm1, pwm2,
106ab1c2de3STomer Maimon                pwm3, r2, r2err, r2md, r3rxer, ga20kbc, smb5d, lpc, espi, rg2,
107ab1c2de3STomer Maimon                ddr, i3c0, i3c1, i3c2, i3c3, i3c4, i3c5, smb0, smb1, smb2,
108ab1c2de3STomer Maimon                smb2c, smb2b, smb1c, smb1b, smb8, smb9, smb10, smb11, sd1,
109ab1c2de3STomer Maimon                sd1pwr, pwm4, pwm5, pwm6, pwm7, pwm8, pwm9, pwm10, pwm11,
110*bdc76f53STomer Maimon                mmc8, mmc, mmcwp, mmccd, mmcrst, clkout, serirq, scipme, smi,
111*bdc76f53STomer Maimon                smb6, smb6b, smb6c, smb6d, smb7, smb7b, smb7c, smb7d, spi1,
112*bdc76f53STomer Maimon                faninx, r1, spi3, spi3cs1, spi3quad, spi3cs2, spi3cs3, nprd_smi,
113*bdc76f53STomer Maimon                smb0b, smb0c, smb0den, smb0d, ddc, rg2mdio, wdog1, wdog2,
114*bdc76f53STomer Maimon                smb12, smb13, spix, spixcs1, clkreq, hgpio0, hgpio1, hgpio2,
115*bdc76f53STomer Maimon                hgpio3, hgpio4, hgpio5, hgpio6, hgpio7, bu4, bu4b, bu5, bu5b,
116*bdc76f53STomer Maimon                bu6, gpo187 ]
117ab1c2de3STomer Maimon
118ab1c2de3STomer Maimon    dependencies:
119ab1c2de3STomer Maimon      groups: [ function ]
120ab1c2de3STomer Maimon      function: [ groups ]
121ab1c2de3STomer Maimon
122ab1c2de3STomer Maimon    additionalProperties: false
123ab1c2de3STomer Maimon
124ab1c2de3STomer Maimon  '^pin':
125ab1c2de3STomer Maimon    $ref: pincfg-node.yaml#
126ab1c2de3STomer Maimon
127ab1c2de3STomer Maimon    properties:
128ab1c2de3STomer Maimon      pins:
129ab1c2de3STomer Maimon        description:
130ab1c2de3STomer Maimon          A list of pins to configure in certain ways, such as enabling
131ab1c2de3STomer Maimon          debouncing
132ab1c2de3STomer Maimon        items:
133ab1c2de3STomer Maimon          pattern: '^GPIO([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-6])'
134ab1c2de3STomer Maimon
135ab1c2de3STomer Maimon      bias-disable: true
136ab1c2de3STomer Maimon
137ab1c2de3STomer Maimon      bias-pull-up: true
138ab1c2de3STomer Maimon
139ab1c2de3STomer Maimon      bias-pull-down: true
140ab1c2de3STomer Maimon
141ab1c2de3STomer Maimon      input-enable: true
142ab1c2de3STomer Maimon
143ab1c2de3STomer Maimon      output-low: true
144ab1c2de3STomer Maimon
145ab1c2de3STomer Maimon      output-high: true
146ab1c2de3STomer Maimon
147ab1c2de3STomer Maimon      drive-push-pull: true
148ab1c2de3STomer Maimon
149ab1c2de3STomer Maimon      drive-open-drain: true
150ab1c2de3STomer Maimon
151ab1c2de3STomer Maimon      input-debounce:
152ab1c2de3STomer Maimon        description:
153ab1c2de3STomer Maimon          Debouncing periods in microseconds, one period per interrupt
154ab1c2de3STomer Maimon          bank found in the controller
155ab1c2de3STomer Maimon        minItems: 1
156ab1c2de3STomer Maimon        maxItems: 4
157ab1c2de3STomer Maimon
158ab1c2de3STomer Maimon      slew-rate:
159ab1c2de3STomer Maimon        description: |
160ab1c2de3STomer Maimon          0: Low rate
161ab1c2de3STomer Maimon          1: High rate
162ab1c2de3STomer Maimon        enum: [0, 1]
163ab1c2de3STomer Maimon
164ab1c2de3STomer Maimon      drive-strength:
165ab1c2de3STomer Maimon        enum: [ 0, 1, 2, 4, 8, 12 ]
166ab1c2de3STomer Maimon
167ab1c2de3STomer Maimon    additionalProperties: false
168ab1c2de3STomer Maimon
169ab1c2de3STomer MaimonallOf:
170ab1c2de3STomer Maimon  - $ref: pinctrl.yaml#
171ab1c2de3STomer Maimon
172ab1c2de3STomer Maimonrequired:
173ab1c2de3STomer Maimon  - compatible
174ab1c2de3STomer Maimon  - ranges
175ab1c2de3STomer Maimon  - '#address-cells'
176ab1c2de3STomer Maimon  - '#size-cells'
177ab1c2de3STomer Maimon  - nuvoton,sysgcr
178ab1c2de3STomer Maimon
179ab1c2de3STomer MaimonadditionalProperties: false
180ab1c2de3STomer Maimon
181ab1c2de3STomer Maimonexamples:
182ab1c2de3STomer Maimon  - |
183ab1c2de3STomer Maimon    #include <dt-bindings/interrupt-controller/arm-gic.h>
184ab1c2de3STomer Maimon    #include <dt-bindings/gpio/gpio.h>
185ab1c2de3STomer Maimon
186ab1c2de3STomer Maimon    soc {
187ab1c2de3STomer Maimon      #address-cells = <2>;
188ab1c2de3STomer Maimon      #size-cells = <2>;
189ab1c2de3STomer Maimon
190ab1c2de3STomer Maimon      pinctrl: pinctrl@f0010000 {
191ab1c2de3STomer Maimon        compatible = "nuvoton,npcm845-pinctrl";
192ab1c2de3STomer Maimon        ranges = <0x0 0x0 0xf0010000 0x8000>;
193ab1c2de3STomer Maimon        #address-cells = <1>;
194ab1c2de3STomer Maimon        #size-cells = <1>;
195ab1c2de3STomer Maimon        nuvoton,sysgcr = <&gcr>;
196ab1c2de3STomer Maimon
197ab1c2de3STomer Maimon        gpio0: gpio@0 {
198ab1c2de3STomer Maimon          gpio-controller;
199ab1c2de3STomer Maimon          #gpio-cells = <2>;
200ab1c2de3STomer Maimon          reg = <0x0 0xb0>;
201ab1c2de3STomer Maimon          interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
202ab1c2de3STomer Maimon          gpio-ranges = <&pinctrl 0 0 32>;
203ab1c2de3STomer Maimon        };
204ab1c2de3STomer Maimon
205ab1c2de3STomer Maimon        fanin0_pin: fanin0-mux {
206ab1c2de3STomer Maimon          groups = "fanin0";
207ab1c2de3STomer Maimon          function = "fanin0";
208ab1c2de3STomer Maimon        };
209ab1c2de3STomer Maimon
210ab1c2de3STomer Maimon        pin34_slew: pin34-slew {
211ab1c2de3STomer Maimon          pins = "GPIO34/I3C4_SDA";
212ab1c2de3STomer Maimon          bias-disable;
213ab1c2de3STomer Maimon        };
214ab1c2de3STomer Maimon      };
215ab1c2de3STomer Maimon    };
216