Debian Codegraph @

Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml

raw
1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/pinctrl/microchip,sparx5-sgpio.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Microsemi/Microchip Serial GPIO controller
8
9 maintainers:
10 - Lars Povlsen <[email protected]>
11
12 description: |
13 By using a serial interface, the SIO controller significantly extend
14 the number of available GPIOs with a minimum number of additional
15 pins on the device. The primary purpose of the SIO controllers is to
16 connect control signals from SFP modules and to act as an LED
17 controller.
18
19 properties:
20 $nodename:
21 pattern: '^gpio@[0-9a-f]+$'
22
23 compatible:
24 oneOf:
25 - enum:
26 - microchip,sparx5-sgpio
27 - mscc,ocelot-sgpio
28 - mscc,luton-sgpio
29 - items:
30 - enum:
31 - microchip,lan9691-sgpio
32 - const: microchip,sparx5-sgpio
33
34 '#address-cells':
35 const: 1
36
37 '#size-cells':
38 const: 0
39
40 reg:
41 maxItems: 1
42
43 clocks:
44 maxItems: 1
45
46 microchip,sgpio-port-ranges:
47 description: This is a sequence of tuples, defining intervals of
48 enabled ports in the serial input stream. The enabled ports must
49 match the hardware configuration in order for signals to be
50 properly written/read to/from the controller holding
51 registers. Being tuples, then number of arguments must be
52 even. The tuples mast be ordered (low, high) and are
53 inclusive.
54 $ref: /schemas/types.yaml#/definitions/uint32-matrix
55 items:
56 items:
57 - description: |
58 "low" indicates start bit number of range
59 minimum: 0
60 maximum: 31
61 - description: |
62 "high" indicates end bit number of range
63 minimum: 0
64 maximum: 31
65 minItems: 1
66 maxItems: 32
67
68 bus-frequency:
69 description: The sgpio controller frequency (Hz). This dictates
70 the serial bitstream speed, which again affects the latency in
71 getting control signals back and forth between external shift
72 registers. The speed must be no larger than half the system
73 clock, and larger than zero.
74 default: 12500000
75
76 resets:
77 maxItems: 1
78
79 reset-names:
80 items:
81 - const: switch
82
83 patternProperties:
84 '^gpio@[0-1]$':
85 type: object
86 properties:
87 compatible:
88 oneOf:
89 - items:
90 - enum:
91 - microchip,lan9691-sgpio-bank
92 - const: microchip,sparx5-sgpio-bank
93 - const: microchip,sparx5-sgpio-bank
94
95 reg:
96 description: |
97 The GPIO bank number. "0" is designates the input pin bank,
98 "1" the output bank.
99 maxItems: 1
100
101 gpio-controller: true
102
103 '#gpio-cells':
104 description: |
105 Specifies the pin (port and bit) and flags. Note that the
106 SGIO pin is defined by *2* numbers, a port number between 0
107 and 31, and a bit index, 0 to 3. The maximum bit number is
108 controlled indirectly by the "ngpios" property: (ngpios/32).
109 const: 3
110
111 interrupts:
112 description: Specifies the sgpio IRQ (in parent controller)
113 maxItems: 1
114
115 interrupt-controller: true
116
117 '#interrupt-cells':
118 description:
119 Specifies the pin (port and bit) and flags, as defined in
120 defined in include/dt-bindings/interrupt-controller/irq.h
121 const: 3
122
123 ngpios:
124 description: The numbers of GPIO's exposed. This must be a
125 multiple of 32.
126 minimum: 32
127 maximum: 128
128
129 required:
130 - compatible
131 - reg
132 - gpio-controller
133 - '#gpio-cells'
134 - ngpios
135
136 additionalProperties: false
137
138 additionalProperties: false
139
140 required:
141 - compatible
142 - reg
143 - clocks
144 - microchip,sgpio-port-ranges
145 - '#address-cells'
146 - '#size-cells'
147
148 examples:
149 - |
150 #include <dt-bindings/interrupt-controller/arm-gic.h>
151 sgpio2: gpio@1101059c {
152 #address-cells = <1>;
153 #size-cells = <0>;
154 compatible = "microchip,sparx5-sgpio";
155 clocks = <&sys_clk>;
156 pinctrl-0 = <&sgpio2_pins>;
157 pinctrl-names = "default";
158 reg = <0x1101059c 0x118>;
159 microchip,sgpio-port-ranges = <0 0>, <16 18>, <28 31>;
160 bus-frequency = <25000000>;
161 sgpio_in2: gpio@0 {
162 reg = <0>;
163 compatible = "microchip,sparx5-sgpio-bank";
164 gpio-controller;
165 #gpio-cells = <3>;
166 ngpios = <96>;
167 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
168 interrupt-controller;
169 #interrupt-cells = <3>;
170 };
171 sgpio_out2: gpio@1 {
172 compatible = "microchip,sparx5-sgpio-bank";
173 reg = <1>;
174 gpio-controller;
175 #gpio-cells = <3>;
176 ngpios = <96>;
177 };
178 };