xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/gpio-mvebu.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot* Marvell EBU GPIO controller
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotRequired properties:
4*c66ec88fSEmmanuel Vadot
5*c66ec88fSEmmanuel Vadot- compatible : Should be "marvell,orion-gpio", "marvell,mv78200-gpio",
6*c66ec88fSEmmanuel Vadot  "marvell,armadaxp-gpio" or "marvell,armada-8k-gpio".
7*c66ec88fSEmmanuel Vadot
8*c66ec88fSEmmanuel Vadot    "marvell,orion-gpio" should be used for Orion, Kirkwood, Dove,
9*c66ec88fSEmmanuel Vadot    Discovery (except MV78200) and Armada 370. "marvell,mv78200-gpio"
10*c66ec88fSEmmanuel Vadot    should be used for the Discovery MV78200.
11*c66ec88fSEmmanuel Vadot
12*c66ec88fSEmmanuel Vadot    "marvel,armadaxp-gpio" should be used for all Armada XP SoCs
13*c66ec88fSEmmanuel Vadot    (MV78230, MV78260, MV78460).
14*c66ec88fSEmmanuel Vadot
15*c66ec88fSEmmanuel Vadot    "marvell,armada-8k-gpio" should be used for the Armada 7K and 8K
16*c66ec88fSEmmanuel Vadot    SoCs (either from AP or CP), see
17*c66ec88fSEmmanuel Vadot    Documentation/devicetree/bindings/arm/marvell/ap80x-system-controller.txt
18*c66ec88fSEmmanuel Vadot    for specific details about the offset property.
19*c66ec88fSEmmanuel Vadot
20*c66ec88fSEmmanuel Vadot- reg: Address and length of the register set for the device. Only one
21*c66ec88fSEmmanuel Vadot  entry is expected, except for the "marvell,armadaxp-gpio" variant
22*c66ec88fSEmmanuel Vadot  for which two entries are expected: one for the general registers,
23*c66ec88fSEmmanuel Vadot  one for the per-cpu registers. Not used for marvell,armada-8k-gpio.
24*c66ec88fSEmmanuel Vadot
25*c66ec88fSEmmanuel Vadot- interrupts: The list of interrupts that are used for all the pins
26*c66ec88fSEmmanuel Vadot  managed by this GPIO bank. There can be more than one interrupt
27*c66ec88fSEmmanuel Vadot  (example: 1 interrupt per 8 pins on Armada XP, which means 4
28*c66ec88fSEmmanuel Vadot  interrupts per bank of 32 GPIOs).
29*c66ec88fSEmmanuel Vadot
30*c66ec88fSEmmanuel Vadot- interrupt-controller: identifies the node as an interrupt controller
31*c66ec88fSEmmanuel Vadot
32*c66ec88fSEmmanuel Vadot- #interrupt-cells: specifies the number of cells needed to encode an
33*c66ec88fSEmmanuel Vadot  interrupt source. Should be two.
34*c66ec88fSEmmanuel Vadot  The first cell is the GPIO number.
35*c66ec88fSEmmanuel Vadot  The second cell is used to specify flags:
36*c66ec88fSEmmanuel Vadot    bits[3:0] trigger type and level flags:
37*c66ec88fSEmmanuel Vadot      1 = low-to-high edge triggered.
38*c66ec88fSEmmanuel Vadot      2 = high-to-low edge triggered.
39*c66ec88fSEmmanuel Vadot      4 = active high level-sensitive.
40*c66ec88fSEmmanuel Vadot      8 = active low level-sensitive.
41*c66ec88fSEmmanuel Vadot
42*c66ec88fSEmmanuel Vadot- gpio-controller: marks the device node as a gpio controller
43*c66ec88fSEmmanuel Vadot
44*c66ec88fSEmmanuel Vadot- ngpios: number of GPIOs this controller has
45*c66ec88fSEmmanuel Vadot
46*c66ec88fSEmmanuel Vadot- #gpio-cells: Should be two. The first cell is the pin number. The
47*c66ec88fSEmmanuel Vadot  second cell is reserved for flags, unused at the moment.
48*c66ec88fSEmmanuel Vadot
49*c66ec88fSEmmanuel VadotOptional properties:
50*c66ec88fSEmmanuel Vadot
51*c66ec88fSEmmanuel VadotIn order to use the GPIO lines in PWM mode, some additional optional
52*c66ec88fSEmmanuel Vadotproperties are required.
53*c66ec88fSEmmanuel Vadot
54*c66ec88fSEmmanuel Vadot- compatible: Must contain "marvell,armada-370-gpio"
55*c66ec88fSEmmanuel Vadot
56*c66ec88fSEmmanuel Vadot- reg: an additional register set is needed, for the GPIO Blink
57*c66ec88fSEmmanuel Vadot  Counter on/off registers.
58*c66ec88fSEmmanuel Vadot
59*c66ec88fSEmmanuel Vadot- reg-names: Must contain an entry "pwm" corresponding to the
60*c66ec88fSEmmanuel Vadot  additional register range needed for PWM operation.
61*c66ec88fSEmmanuel Vadot
62*c66ec88fSEmmanuel Vadot- #pwm-cells: Should be two. The first cell is the GPIO line number. The
63*c66ec88fSEmmanuel Vadot  second cell is the period in nanoseconds.
64*c66ec88fSEmmanuel Vadot
65*c66ec88fSEmmanuel Vadot- clocks: Must be a phandle to the clock for the GPIO controller.
66*c66ec88fSEmmanuel Vadot
67*c66ec88fSEmmanuel VadotExample:
68*c66ec88fSEmmanuel Vadot
69*c66ec88fSEmmanuel Vadot		gpio0: gpio@d0018100 {
70*c66ec88fSEmmanuel Vadot			compatible = "marvell,armadaxp-gpio";
71*c66ec88fSEmmanuel Vadot			reg = <0xd0018100 0x40>,
72*c66ec88fSEmmanuel Vadot			    <0xd0018800 0x30>;
73*c66ec88fSEmmanuel Vadot			ngpios = <32>;
74*c66ec88fSEmmanuel Vadot			gpio-controller;
75*c66ec88fSEmmanuel Vadot			#gpio-cells = <2>;
76*c66ec88fSEmmanuel Vadot			interrupt-controller;
77*c66ec88fSEmmanuel Vadot			#interrupt-cells = <2>;
78*c66ec88fSEmmanuel Vadot			interrupts = <16>, <17>, <18>, <19>;
79*c66ec88fSEmmanuel Vadot		};
80*c66ec88fSEmmanuel Vadot
81*c66ec88fSEmmanuel Vadot		gpio1: gpio@18140 {
82*c66ec88fSEmmanuel Vadot			compatible = "marvell,armada-370-gpio";
83*c66ec88fSEmmanuel Vadot			reg = <0x18140 0x40>, <0x181c8 0x08>;
84*c66ec88fSEmmanuel Vadot			reg-names = "gpio", "pwm";
85*c66ec88fSEmmanuel Vadot			ngpios = <17>;
86*c66ec88fSEmmanuel Vadot			gpio-controller;
87*c66ec88fSEmmanuel Vadot			#gpio-cells = <2>;
88*c66ec88fSEmmanuel Vadot			#pwm-cells = <2>;
89*c66ec88fSEmmanuel Vadot			interrupt-controller;
90*c66ec88fSEmmanuel Vadot			#interrupt-cells = <2>;
91*c66ec88fSEmmanuel Vadot			interrupts = <87>, <88>, <89>;
92*c66ec88fSEmmanuel Vadot			clocks = <&coreclk 0>;
93*c66ec88fSEmmanuel Vadot		};
94