xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/snps,dw-apb-gpio.yaml (revision 8d13bc63c0e1d50bc9e47ac1f26329c999bfecf0)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/gpio/snps,dw-apb-gpio.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: Synopsys DesignWare APB GPIO controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotdescription: |
10c66ec88fSEmmanuel Vadot  Synopsys DesignWare GPIO controllers have a configurable number of ports,
11c66ec88fSEmmanuel Vadot  each of which are intended to be represented as child nodes with the generic
12aa1a8ff2SEmmanuel Vadot  GPIO-controller properties as described in this bindings file.
13c66ec88fSEmmanuel Vadot
14c66ec88fSEmmanuel Vadotmaintainers:
15c66ec88fSEmmanuel Vadot  - Hoan Tran <hoan@os.amperecomputing.com>
16c66ec88fSEmmanuel Vadot  - Serge Semin <fancer.lancer@gmail.com>
17c66ec88fSEmmanuel Vadot
18c66ec88fSEmmanuel Vadotproperties:
19c66ec88fSEmmanuel Vadot  $nodename:
20c66ec88fSEmmanuel Vadot    pattern: "^gpio@[0-9a-f]+$"
21c66ec88fSEmmanuel Vadot
22c66ec88fSEmmanuel Vadot  compatible:
23c66ec88fSEmmanuel Vadot    const: snps,dw-apb-gpio
24c66ec88fSEmmanuel Vadot
25c66ec88fSEmmanuel Vadot  "#address-cells":
26c66ec88fSEmmanuel Vadot    const: 1
27c66ec88fSEmmanuel Vadot
28c66ec88fSEmmanuel Vadot  "#size-cells":
29c66ec88fSEmmanuel Vadot    const: 0
30c66ec88fSEmmanuel Vadot
31c66ec88fSEmmanuel Vadot  reg:
32c66ec88fSEmmanuel Vadot    maxItems: 1
33c66ec88fSEmmanuel Vadot
34c66ec88fSEmmanuel Vadot  clocks:
35c66ec88fSEmmanuel Vadot    minItems: 1
36c66ec88fSEmmanuel Vadot    items:
37c66ec88fSEmmanuel Vadot      - description: APB interface clock source
38c66ec88fSEmmanuel Vadot      - description: DW GPIO debounce reference clock source
39c66ec88fSEmmanuel Vadot
40c66ec88fSEmmanuel Vadot  clock-names:
41c66ec88fSEmmanuel Vadot    minItems: 1
42c66ec88fSEmmanuel Vadot    items:
43c66ec88fSEmmanuel Vadot      - const: bus
44c66ec88fSEmmanuel Vadot      - const: db
45c66ec88fSEmmanuel Vadot
46c66ec88fSEmmanuel Vadot  resets:
47c66ec88fSEmmanuel Vadot    maxItems: 1
48c66ec88fSEmmanuel Vadot
49c66ec88fSEmmanuel VadotpatternProperties:
50c66ec88fSEmmanuel Vadot  "^gpio-(port|controller)@[0-9a-f]+$":
51c66ec88fSEmmanuel Vadot    type: object
52c66ec88fSEmmanuel Vadot    properties:
53c66ec88fSEmmanuel Vadot      compatible:
54c66ec88fSEmmanuel Vadot        const: snps,dw-apb-gpio-port
55c66ec88fSEmmanuel Vadot
56c66ec88fSEmmanuel Vadot      reg:
57c66ec88fSEmmanuel Vadot        maxItems: 1
58c66ec88fSEmmanuel Vadot
59c66ec88fSEmmanuel Vadot      gpio-controller: true
60c66ec88fSEmmanuel Vadot
61c66ec88fSEmmanuel Vadot      '#gpio-cells':
62c66ec88fSEmmanuel Vadot        const: 2
63c66ec88fSEmmanuel Vadot
64aa1a8ff2SEmmanuel Vadot      gpio-line-names:
65aa1a8ff2SEmmanuel Vadot        minItems: 1
66aa1a8ff2SEmmanuel Vadot        maxItems: 32
67aa1a8ff2SEmmanuel Vadot
68*8d13bc63SEmmanuel Vadot      gpio-ranges: true
69*8d13bc63SEmmanuel Vadot
706be33864SEmmanuel Vadot      ngpios:
716be33864SEmmanuel Vadot        default: 32
726be33864SEmmanuel Vadot        minimum: 1
736be33864SEmmanuel Vadot        maximum: 32
746be33864SEmmanuel Vadot
75c66ec88fSEmmanuel Vadot      snps,nr-gpios:
76c66ec88fSEmmanuel Vadot        description: The number of GPIO pins exported by the port.
776be33864SEmmanuel Vadot        deprecated: true
78c66ec88fSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
79c66ec88fSEmmanuel Vadot        default: 32
80c66ec88fSEmmanuel Vadot        minimum: 1
81c66ec88fSEmmanuel Vadot        maximum: 32
82c66ec88fSEmmanuel Vadot
83c66ec88fSEmmanuel Vadot      interrupts:
84c66ec88fSEmmanuel Vadot        description: |
85c66ec88fSEmmanuel Vadot          The interrupts to the parent controller raised when GPIOs generate
86c66ec88fSEmmanuel Vadot          the interrupts. If the controller provides one combined interrupt
87c66ec88fSEmmanuel Vadot          for all GPIOs, specify a single interrupt. If the controller provides
88c66ec88fSEmmanuel Vadot          one interrupt for each GPIO, provide a list of interrupts that
89c66ec88fSEmmanuel Vadot          correspond to each of the GPIO pins.
90c66ec88fSEmmanuel Vadot        minItems: 1
91c66ec88fSEmmanuel Vadot        maxItems: 32
92c66ec88fSEmmanuel Vadot
93c66ec88fSEmmanuel Vadot      interrupt-controller: true
94c66ec88fSEmmanuel Vadot
95c66ec88fSEmmanuel Vadot      '#interrupt-cells':
96c66ec88fSEmmanuel Vadot        const: 2
97c66ec88fSEmmanuel Vadot
98c66ec88fSEmmanuel Vadot    required:
99c66ec88fSEmmanuel Vadot      - compatible
100c66ec88fSEmmanuel Vadot      - reg
101c66ec88fSEmmanuel Vadot      - gpio-controller
102c66ec88fSEmmanuel Vadot      - '#gpio-cells'
103c66ec88fSEmmanuel Vadot
104c66ec88fSEmmanuel Vadot    dependencies:
105c66ec88fSEmmanuel Vadot      interrupt-controller: [ interrupts ]
106c66ec88fSEmmanuel Vadot
107c66ec88fSEmmanuel Vadot    additionalProperties: false
108c66ec88fSEmmanuel Vadot
109c66ec88fSEmmanuel VadotadditionalProperties: false
110c66ec88fSEmmanuel Vadot
111c66ec88fSEmmanuel Vadotrequired:
112c66ec88fSEmmanuel Vadot  - compatible
113c66ec88fSEmmanuel Vadot  - reg
114c66ec88fSEmmanuel Vadot  - "#address-cells"
115c66ec88fSEmmanuel Vadot  - "#size-cells"
116c66ec88fSEmmanuel Vadot
117c66ec88fSEmmanuel Vadotexamples:
118c66ec88fSEmmanuel Vadot  - |
119c66ec88fSEmmanuel Vadot    gpio: gpio@20000 {
120c66ec88fSEmmanuel Vadot      compatible = "snps,dw-apb-gpio";
121c66ec88fSEmmanuel Vadot      reg = <0x20000 0x1000>;
122c66ec88fSEmmanuel Vadot      #address-cells = <1>;
123c66ec88fSEmmanuel Vadot      #size-cells = <0>;
124c66ec88fSEmmanuel Vadot
125c66ec88fSEmmanuel Vadot      porta: gpio-port@0 {
126c66ec88fSEmmanuel Vadot        compatible = "snps,dw-apb-gpio-port";
127c66ec88fSEmmanuel Vadot        reg = <0>;
128c66ec88fSEmmanuel Vadot        gpio-controller;
129c66ec88fSEmmanuel Vadot        #gpio-cells = <2>;
130c66ec88fSEmmanuel Vadot        snps,nr-gpios = <8>;
131c66ec88fSEmmanuel Vadot        interrupt-controller;
132c66ec88fSEmmanuel Vadot        #interrupt-cells = <2>;
133c66ec88fSEmmanuel Vadot        interrupt-parent = <&vic1>;
134c66ec88fSEmmanuel Vadot        interrupts = <0>;
135c66ec88fSEmmanuel Vadot      };
136c66ec88fSEmmanuel Vadot
137c66ec88fSEmmanuel Vadot      portb: gpio-port@1 {
138c66ec88fSEmmanuel Vadot        compatible = "snps,dw-apb-gpio-port";
139c66ec88fSEmmanuel Vadot        reg = <1>;
140c66ec88fSEmmanuel Vadot        gpio-controller;
141c66ec88fSEmmanuel Vadot        #gpio-cells = <2>;
142c66ec88fSEmmanuel Vadot        snps,nr-gpios = <8>;
143c66ec88fSEmmanuel Vadot      };
144c66ec88fSEmmanuel Vadot    };
145c66ec88fSEmmanuel Vadot...
146