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