xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/gpio-altera.txt (revision d5b0e70f7e04d971691517ce1304d86a1e367e2e)
1c66ec88fSEmmanuel VadotAltera GPIO controller bindings
2c66ec88fSEmmanuel Vadot
3c66ec88fSEmmanuel VadotRequired properties:
4c66ec88fSEmmanuel Vadot- compatible:
5c66ec88fSEmmanuel Vadot  - "altr,pio-1.0"
6c66ec88fSEmmanuel Vadot- reg: Physical base address and length of the controller's registers.
7c66ec88fSEmmanuel Vadot- #gpio-cells : Should be 2
8c66ec88fSEmmanuel Vadot  - The first cell is the gpio offset number.
9c66ec88fSEmmanuel Vadot  - The second cell is reserved and is currently unused.
10c66ec88fSEmmanuel Vadot- gpio-controller : Marks the device node as a GPIO controller.
11c66ec88fSEmmanuel Vadot- interrupt-controller: Mark the device node as an interrupt controller
12*d5b0e70fSEmmanuel Vadot- #interrupt-cells : Should be 2. The interrupt type is fixed in the hardware.
13c66ec88fSEmmanuel Vadot  - The first cell is the GPIO offset number within the GPIO controller.
14*d5b0e70fSEmmanuel Vadot  - The second cell is the interrupt trigger type and level flags.
15c66ec88fSEmmanuel Vadot- interrupts: Specify the interrupt.
16c66ec88fSEmmanuel Vadot- altr,interrupt-type: Specifies the interrupt trigger type the GPIO
17c66ec88fSEmmanuel Vadot  hardware is synthesized. This field is required if the Altera GPIO controller
18c66ec88fSEmmanuel Vadot  used has IRQ enabled as the interrupt type is not software controlled,
19c66ec88fSEmmanuel Vadot  but hardware synthesized. Required if GPIO is used as an interrupt
20c66ec88fSEmmanuel Vadot  controller. The value is defined in <dt-bindings/interrupt-controller/irq.h>
21c66ec88fSEmmanuel Vadot  Only the following flags are supported:
22c66ec88fSEmmanuel Vadot    IRQ_TYPE_EDGE_RISING
23c66ec88fSEmmanuel Vadot    IRQ_TYPE_EDGE_FALLING
24c66ec88fSEmmanuel Vadot    IRQ_TYPE_EDGE_BOTH
25c66ec88fSEmmanuel Vadot    IRQ_TYPE_LEVEL_HIGH
26c66ec88fSEmmanuel Vadot
27c66ec88fSEmmanuel VadotOptional properties:
28c66ec88fSEmmanuel Vadot- altr,ngpio: Width of the GPIO bank. This defines how many pins the
29c66ec88fSEmmanuel Vadot  GPIO device has. Ranges between 1-32. Optional and defaults to 32 if not
30c66ec88fSEmmanuel Vadot  specified.
31c66ec88fSEmmanuel Vadot
32c66ec88fSEmmanuel VadotExample:
33c66ec88fSEmmanuel Vadot
34c66ec88fSEmmanuel Vadotgpio_altr: gpio@ff200000 {
35c66ec88fSEmmanuel Vadot	compatible = "altr,pio-1.0";
36c66ec88fSEmmanuel Vadot	reg = <0xff200000 0x10>;
37c66ec88fSEmmanuel Vadot	interrupts = <0 45 4>;
38c66ec88fSEmmanuel Vadot	altr,ngpio = <32>;
39c66ec88fSEmmanuel Vadot	altr,interrupt-type = <IRQ_TYPE_EDGE_RISING>;
40c66ec88fSEmmanuel Vadot	#gpio-cells = <2>;
41c66ec88fSEmmanuel Vadot	gpio-controller;
42*d5b0e70fSEmmanuel Vadot	#interrupt-cells = <2>;
43c66ec88fSEmmanuel Vadot	interrupt-controller;
44c66ec88fSEmmanuel Vadot};
45