xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/gpio-mvebu.yaml (revision b97ee269eae3cbaf35c18f51a459aea581c2a7dc)
1*b97ee269SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*b97ee269SEmmanuel Vadot%YAML 1.2
3*b97ee269SEmmanuel Vadot---
4*b97ee269SEmmanuel Vadot$id: http://devicetree.org/schemas/gpio/gpio-mvebu.yaml#
5*b97ee269SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*b97ee269SEmmanuel Vadot
7*b97ee269SEmmanuel Vadottitle: Marvell EBU GPIO controller
8*b97ee269SEmmanuel Vadot
9*b97ee269SEmmanuel Vadotmaintainers:
10*b97ee269SEmmanuel Vadot  - Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
11*b97ee269SEmmanuel Vadot  - Andrew Lunn <andrew@lunn.ch>
12*b97ee269SEmmanuel Vadot
13*b97ee269SEmmanuel Vadotproperties:
14*b97ee269SEmmanuel Vadot  compatible:
15*b97ee269SEmmanuel Vadot    oneOf:
16*b97ee269SEmmanuel Vadot      - enum:
17*b97ee269SEmmanuel Vadot          - marvell,armada-8k-gpio
18*b97ee269SEmmanuel Vadot          - marvell,orion-gpio
19*b97ee269SEmmanuel Vadot
20*b97ee269SEmmanuel Vadot      - items:
21*b97ee269SEmmanuel Vadot          - enum:
22*b97ee269SEmmanuel Vadot              - marvell,mv78200-gpio
23*b97ee269SEmmanuel Vadot              - marvell,armada-370-gpio
24*b97ee269SEmmanuel Vadot          - const: marvell,orion-gpio
25*b97ee269SEmmanuel Vadot
26*b97ee269SEmmanuel Vadot      - description: Deprecated binding
27*b97ee269SEmmanuel Vadot        items:
28*b97ee269SEmmanuel Vadot          - const: marvell,armadaxp-gpio
29*b97ee269SEmmanuel Vadot          - const: marvell,orion-gpio
30*b97ee269SEmmanuel Vadot        deprecated: true
31*b97ee269SEmmanuel Vadot
32*b97ee269SEmmanuel Vadot  reg:
33*b97ee269SEmmanuel Vadot    description: |
34*b97ee269SEmmanuel Vadot      Address and length of the register set for the device. Not used for
35*b97ee269SEmmanuel Vadot      marvell,armada-8k-gpio.
36*b97ee269SEmmanuel Vadot
37*b97ee269SEmmanuel Vadot      A second entry can be provided, for the PWM function using the GPIO Blink
38*b97ee269SEmmanuel Vadot      Counter on/off registers.
39*b97ee269SEmmanuel Vadot    minItems: 1
40*b97ee269SEmmanuel Vadot    maxItems: 2
41*b97ee269SEmmanuel Vadot
42*b97ee269SEmmanuel Vadot  reg-names:
43*b97ee269SEmmanuel Vadot    items:
44*b97ee269SEmmanuel Vadot      - const: gpio
45*b97ee269SEmmanuel Vadot      - const: pwm
46*b97ee269SEmmanuel Vadot    minItems: 1
47*b97ee269SEmmanuel Vadot
48*b97ee269SEmmanuel Vadot  offset:
49*b97ee269SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
50*b97ee269SEmmanuel Vadot    description: Offset in the register map for the gpio registers (in bytes)
51*b97ee269SEmmanuel Vadot
52*b97ee269SEmmanuel Vadot  interrupts:
53*b97ee269SEmmanuel Vadot    description: |
54*b97ee269SEmmanuel Vadot      The list of interrupts that are used for all the pins managed by this
55*b97ee269SEmmanuel Vadot      GPIO bank. There can be more than one interrupt (example: 1 interrupt
56*b97ee269SEmmanuel Vadot      per 8 pins on Armada XP, which means 4 interrupts per bank of 32
57*b97ee269SEmmanuel Vadot      GPIOs).
58*b97ee269SEmmanuel Vadot    minItems: 1
59*b97ee269SEmmanuel Vadot    maxItems: 4
60*b97ee269SEmmanuel Vadot
61*b97ee269SEmmanuel Vadot  interrupt-controller: true
62*b97ee269SEmmanuel Vadot
63*b97ee269SEmmanuel Vadot  "#interrupt-cells":
64*b97ee269SEmmanuel Vadot    const: 2
65*b97ee269SEmmanuel Vadot
66*b97ee269SEmmanuel Vadot  gpio-controller: true
67*b97ee269SEmmanuel Vadot
68*b97ee269SEmmanuel Vadot  ngpios:
69*b97ee269SEmmanuel Vadot    minimum: 1
70*b97ee269SEmmanuel Vadot    maximum: 32
71*b97ee269SEmmanuel Vadot
72*b97ee269SEmmanuel Vadot  "#gpio-cells":
73*b97ee269SEmmanuel Vadot    const: 2
74*b97ee269SEmmanuel Vadot
75*b97ee269SEmmanuel Vadot  marvell,pwm-offset:
76*b97ee269SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
77*b97ee269SEmmanuel Vadot    description: Offset in the register map for the pwm registers (in bytes)
78*b97ee269SEmmanuel Vadot
79*b97ee269SEmmanuel Vadot  "#pwm-cells":
80*b97ee269SEmmanuel Vadot    description:
81*b97ee269SEmmanuel Vadot      The first cell is the GPIO line number. The second cell is the period
82*b97ee269SEmmanuel Vadot      in nanoseconds.
83*b97ee269SEmmanuel Vadot    const: 2
84*b97ee269SEmmanuel Vadot
85*b97ee269SEmmanuel Vadot  clocks:
86*b97ee269SEmmanuel Vadot    description:
87*b97ee269SEmmanuel Vadot      Clock(s) used for PWM function.
88*b97ee269SEmmanuel Vadot    items:
89*b97ee269SEmmanuel Vadot      - description: Core clock
90*b97ee269SEmmanuel Vadot      - description: AXI bus clock
91*b97ee269SEmmanuel Vadot    minItems: 1
92*b97ee269SEmmanuel Vadot
93*b97ee269SEmmanuel Vadot  clock-names:
94*b97ee269SEmmanuel Vadot    items:
95*b97ee269SEmmanuel Vadot      - const: core
96*b97ee269SEmmanuel Vadot      - const: axi
97*b97ee269SEmmanuel Vadot    minItems: 1
98*b97ee269SEmmanuel Vadot
99*b97ee269SEmmanuel Vadotrequired:
100*b97ee269SEmmanuel Vadot  - compatible
101*b97ee269SEmmanuel Vadot  - gpio-controller
102*b97ee269SEmmanuel Vadot  - ngpios
103*b97ee269SEmmanuel Vadot  - "#gpio-cells"
104*b97ee269SEmmanuel Vadot
105*b97ee269SEmmanuel VadotallOf:
106*b97ee269SEmmanuel Vadot  - if:
107*b97ee269SEmmanuel Vadot      properties:
108*b97ee269SEmmanuel Vadot        compatible:
109*b97ee269SEmmanuel Vadot          contains:
110*b97ee269SEmmanuel Vadot            const: marvell,armada-8k-gpio
111*b97ee269SEmmanuel Vadot    then:
112*b97ee269SEmmanuel Vadot      required:
113*b97ee269SEmmanuel Vadot        - offset
114*b97ee269SEmmanuel Vadot    else:
115*b97ee269SEmmanuel Vadot      required:
116*b97ee269SEmmanuel Vadot        - reg
117*b97ee269SEmmanuel Vadot
118*b97ee269SEmmanuel VadotunevaluatedProperties: true
119*b97ee269SEmmanuel Vadot
120*b97ee269SEmmanuel Vadotexamples:
121*b97ee269SEmmanuel Vadot  - |
122*b97ee269SEmmanuel Vadot    gpio@d0018100 {
123*b97ee269SEmmanuel Vadot      compatible = "marvell,armadaxp-gpio", "marvell,orion-gpio";
124*b97ee269SEmmanuel Vadot      reg = <0xd0018100 0x40>, <0xd0018800 0x30>;
125*b97ee269SEmmanuel Vadot      ngpios = <32>;
126*b97ee269SEmmanuel Vadot      gpio-controller;
127*b97ee269SEmmanuel Vadot      #gpio-cells = <2>;
128*b97ee269SEmmanuel Vadot      interrupt-controller;
129*b97ee269SEmmanuel Vadot      #interrupt-cells = <2>;
130*b97ee269SEmmanuel Vadot      interrupts = <16>, <17>, <18>, <19>;
131*b97ee269SEmmanuel Vadot    };
132*b97ee269SEmmanuel Vadot
133*b97ee269SEmmanuel Vadot  - |
134*b97ee269SEmmanuel Vadot    gpio@18140 {
135*b97ee269SEmmanuel Vadot      compatible = "marvell,armada-370-gpio", "marvell,orion-gpio";
136*b97ee269SEmmanuel Vadot      reg = <0x18140 0x40>, <0x181c8 0x08>;
137*b97ee269SEmmanuel Vadot      reg-names = "gpio", "pwm";
138*b97ee269SEmmanuel Vadot      ngpios = <17>;
139*b97ee269SEmmanuel Vadot      gpio-controller;
140*b97ee269SEmmanuel Vadot      #gpio-cells = <2>;
141*b97ee269SEmmanuel Vadot      #pwm-cells = <2>;
142*b97ee269SEmmanuel Vadot      interrupt-controller;
143*b97ee269SEmmanuel Vadot      #interrupt-cells = <2>;
144*b97ee269SEmmanuel Vadot      interrupts = <87>, <88>, <89>;
145*b97ee269SEmmanuel Vadot      clocks = <&coreclk 0>;
146*b97ee269SEmmanuel Vadot    };
147