xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/cdns,gpio.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel VadotCadence GPIO controller bindings
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotRequired properties:
4*c66ec88fSEmmanuel Vadot- compatible: should be "cdns,gpio-r1p02".
5*c66ec88fSEmmanuel Vadot- reg: the register base address and size.
6*c66ec88fSEmmanuel Vadot- #gpio-cells: should be 2.
7*c66ec88fSEmmanuel Vadot	* first cell is the GPIO number.
8*c66ec88fSEmmanuel Vadot	* second cell specifies the GPIO flags, as defined in
9*c66ec88fSEmmanuel Vadot		<dt-bindings/gpio/gpio.h>. Only the GPIO_ACTIVE_HIGH
10*c66ec88fSEmmanuel Vadot		and GPIO_ACTIVE_LOW flags are supported.
11*c66ec88fSEmmanuel Vadot- gpio-controller: marks the device as a GPIO controller.
12*c66ec88fSEmmanuel Vadot- clocks: should contain one entry referencing the peripheral clock driving
13*c66ec88fSEmmanuel Vadot	the GPIO controller.
14*c66ec88fSEmmanuel Vadot
15*c66ec88fSEmmanuel VadotOptional properties:
16*c66ec88fSEmmanuel Vadot- ngpios: integer number of gpio lines supported by this controller, up to 32.
17*c66ec88fSEmmanuel Vadot- interrupts: interrupt specifier for the controllers interrupt.
18*c66ec88fSEmmanuel Vadot- interrupt-controller: marks the device as an interrupt controller. When
19*c66ec88fSEmmanuel Vadot	defined, interrupts, interrupt-parent and #interrupt-cells
20*c66ec88fSEmmanuel Vadot	are required.
21*c66ec88fSEmmanuel Vadot- interrupt-cells: should be 2.
22*c66ec88fSEmmanuel Vadot	* first cell is the GPIO number you want to use as an IRQ source.
23*c66ec88fSEmmanuel Vadot	* second cell specifies the IRQ type, as defined in
24*c66ec88fSEmmanuel Vadot		<dt-bindings/interrupt-controller/irq.h>.
25*c66ec88fSEmmanuel Vadot		Currently only level sensitive IRQs are supported.
26*c66ec88fSEmmanuel Vadot
27*c66ec88fSEmmanuel Vadot
28*c66ec88fSEmmanuel VadotExample:
29*c66ec88fSEmmanuel Vadot	gpio0: gpio-controller@fd060000 {
30*c66ec88fSEmmanuel Vadot		compatible = "cdns,gpio-r1p02";
31*c66ec88fSEmmanuel Vadot		reg =<0xfd060000 0x1000>;
32*c66ec88fSEmmanuel Vadot
33*c66ec88fSEmmanuel Vadot		clocks = <&gpio_clk>;
34*c66ec88fSEmmanuel Vadot
35*c66ec88fSEmmanuel Vadot		interrupt-parent = <&gic>;
36*c66ec88fSEmmanuel Vadot		interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>;
37*c66ec88fSEmmanuel Vadot
38*c66ec88fSEmmanuel Vadot		gpio-controller;
39*c66ec88fSEmmanuel Vadot		#gpio-cells = <2>;
40*c66ec88fSEmmanuel Vadot
41*c66ec88fSEmmanuel Vadot		interrupt-controller;
42*c66ec88fSEmmanuel Vadot		#interrupt-cells = <2>;
43*c66ec88fSEmmanuel Vadot	};
44