xref: /linux/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/gpio/loongson,ls-gpio.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Loongson GPIO controller.
8
9maintainers:
10  - Yinbo Zhu <zhuyinbo@loongson.cn>
11
12properties:
13  compatible:
14    oneOf:
15      - enum:
16          - loongson,ls2k-gpio
17          - loongson,ls2k0500-gpio0
18          - loongson,ls2k0500-gpio1
19          - loongson,ls2k2000-gpio0
20          - loongson,ls2k2000-gpio1
21          - loongson,ls2k2000-gpio2
22          - loongson,ls3a5000-gpio
23          - loongson,ls7a-gpio
24      - items:
25          - const: loongson,ls2k1000-gpio
26          - const: loongson,ls2k-gpio
27      - items:
28          - const: loongson,ls7a1000-gpio
29          - const: loongson,ls7a-gpio
30
31  reg:
32    maxItems: 1
33
34  ngpios:
35    minimum: 1
36    maximum: 64
37
38  "#gpio-cells":
39    const: 2
40
41  gpio-controller: true
42
43  gpio-ranges: true
44
45  interrupts:
46    minItems: 1
47    maxItems: 64
48
49required:
50  - compatible
51  - reg
52  - ngpios
53  - "#gpio-cells"
54  - gpio-controller
55  - gpio-ranges
56  - interrupts
57
58additionalProperties: false
59
60examples:
61  - |
62    #include <dt-bindings/interrupt-controller/irq.h>
63
64    gpio0: gpio@1fe00500 {
65      compatible = "loongson,ls2k1000-gpio", "loongson,ls2k-gpio";
66      reg = <0x1fe00500 0x38>;
67      ngpios = <64>;
68      #gpio-cells = <2>;
69      gpio-controller;
70      gpio-ranges = <&pctrl 0 0 15>,
71                    <&pctrl 16 16 15>,
72                    <&pctrl 32 32 10>,
73                    <&pctrl 44 44 20>;
74      interrupt-parent = <&liointc1>;
75      interrupts = <28 IRQ_TYPE_LEVEL_LOW>,
76                   <29 IRQ_TYPE_LEVEL_LOW>,
77                   <30 IRQ_TYPE_LEVEL_LOW>,
78                   <30 IRQ_TYPE_LEVEL_LOW>,
79                   <26 IRQ_TYPE_LEVEL_LOW>,
80                   <26 IRQ_TYPE_LEVEL_LOW>,
81                   <26 IRQ_TYPE_LEVEL_LOW>,
82                   <26 IRQ_TYPE_LEVEL_LOW>,
83                   <26 IRQ_TYPE_LEVEL_LOW>,
84                   <26 IRQ_TYPE_LEVEL_LOW>,
85                   <26 IRQ_TYPE_LEVEL_LOW>,
86                   <26 IRQ_TYPE_LEVEL_LOW>,
87                   <26 IRQ_TYPE_LEVEL_LOW>,
88                   <26 IRQ_TYPE_LEVEL_LOW>,
89                   <26 IRQ_TYPE_LEVEL_LOW>,
90                   <>,
91                   <26 IRQ_TYPE_LEVEL_LOW>,
92                   <26 IRQ_TYPE_LEVEL_LOW>,
93                   <26 IRQ_TYPE_LEVEL_LOW>,
94                   <26 IRQ_TYPE_LEVEL_LOW>,
95                   <26 IRQ_TYPE_LEVEL_LOW>,
96                   <26 IRQ_TYPE_LEVEL_LOW>,
97                   <26 IRQ_TYPE_LEVEL_LOW>,
98                   <26 IRQ_TYPE_LEVEL_LOW>,
99                   <26 IRQ_TYPE_LEVEL_LOW>,
100                   <26 IRQ_TYPE_LEVEL_LOW>,
101                   <26 IRQ_TYPE_LEVEL_LOW>,
102                   <26 IRQ_TYPE_LEVEL_LOW>,
103                   <26 IRQ_TYPE_LEVEL_LOW>,
104                   <26 IRQ_TYPE_LEVEL_LOW>,
105                   <26 IRQ_TYPE_LEVEL_LOW>,
106                   <26 IRQ_TYPE_LEVEL_LOW>,
107                   <27 IRQ_TYPE_LEVEL_LOW>,
108                   <27 IRQ_TYPE_LEVEL_LOW>,
109                   <27 IRQ_TYPE_LEVEL_LOW>,
110                   <27 IRQ_TYPE_LEVEL_LOW>,
111                   <27 IRQ_TYPE_LEVEL_LOW>,
112                   <>,
113                   <27 IRQ_TYPE_LEVEL_LOW>,
114                   <27 IRQ_TYPE_LEVEL_LOW>,
115                   <27 IRQ_TYPE_LEVEL_LOW>,
116                   <27 IRQ_TYPE_LEVEL_LOW>,
117                   <>,
118                   <>,
119                   <27 IRQ_TYPE_LEVEL_LOW>,
120                   <27 IRQ_TYPE_LEVEL_LOW>,
121                   <27 IRQ_TYPE_LEVEL_LOW>,
122                   <27 IRQ_TYPE_LEVEL_LOW>,
123                   <27 IRQ_TYPE_LEVEL_LOW>,
124                   <27 IRQ_TYPE_LEVEL_LOW>,
125                   <27 IRQ_TYPE_LEVEL_LOW>,
126                   <27 IRQ_TYPE_LEVEL_LOW>,
127                   <27 IRQ_TYPE_LEVEL_LOW>,
128                   <27 IRQ_TYPE_LEVEL_LOW>,
129                   <27 IRQ_TYPE_LEVEL_LOW>,
130                   <27 IRQ_TYPE_LEVEL_LOW>,
131                   <27 IRQ_TYPE_LEVEL_LOW>,
132                   <27 IRQ_TYPE_LEVEL_LOW>,
133                   <27 IRQ_TYPE_LEVEL_LOW>,
134                   <27 IRQ_TYPE_LEVEL_LOW>,
135                   <27 IRQ_TYPE_LEVEL_LOW>,
136                   <27 IRQ_TYPE_LEVEL_LOW>,
137                   <27 IRQ_TYPE_LEVEL_LOW>,
138                   <27 IRQ_TYPE_LEVEL_LOW>;
139    };
140