xref: /openbmc/linux/Documentation/devicetree/bindings/gpio/8xxx_gpio.txt (revision 3eb66e91a25497065c5322b1268cbc3953642227)
1d524dac9SGrant LikelyGPIO controllers on MPC8xxx SoCs
2d524dac9SGrant Likely
3d524dac9SGrant LikelyThis is for the non-QE/CPM/GUTs GPIO controllers as found on
4d524dac9SGrant Likely8349, 8572, 8610 and compatible.
5d524dac9SGrant Likely
6d524dac9SGrant LikelyEvery GPIO controller node must have #gpio-cells property defined,
7d524dac9SGrant Likelythis information will be used to translate gpio-specifiers.
8*2c0e641aSGerhard SittigSee bindings/gpio/gpio.txt for details of how to specify GPIO
9*2c0e641aSGerhard Sittiginformation for devices.
10*2c0e641aSGerhard Sittig
11*2c0e641aSGerhard SittigThe GPIO module usually is connected to the SoC's internal interrupt
12*2c0e641aSGerhard Sittigcontroller, see bindings/interrupt-controller/interrupts.txt (the
13*2c0e641aSGerhard Sittiginterrupt client nodes section) for details how to specify this GPIO
14*2c0e641aSGerhard Sittigmodule's interrupt.
15*2c0e641aSGerhard Sittig
16*2c0e641aSGerhard SittigThe GPIO module may serve as another interrupt controller (cascaded to
17*2c0e641aSGerhard Sittigthe SoC's internal interrupt controller).  See the interrupt controller
18*2c0e641aSGerhard Sittignodes section in bindings/interrupt-controller/interrupts.txt for
19*2c0e641aSGerhard Sittigdetails.
20d524dac9SGrant Likely
21d524dac9SGrant LikelyRequired properties:
22*2c0e641aSGerhard Sittig- compatible:		"fsl,<chip>-gpio" followed by "fsl,mpc8349-gpio"
23*2c0e641aSGerhard Sittig			for 83xx, "fsl,mpc8572-gpio" for 85xx, or
24*2c0e641aSGerhard Sittig			"fsl,mpc8610-gpio" for 86xx.
25*2c0e641aSGerhard Sittig- #gpio-cells:		Should be two. The first cell is the pin number
26*2c0e641aSGerhard Sittig			and the second cell is used to specify optional
27*2c0e641aSGerhard Sittig			parameters (currently unused).
28*2c0e641aSGerhard Sittig- interrupts:		Interrupt mapping for GPIO IRQ.
29d524dac9SGrant Likely- gpio-controller:	Marks the port as GPIO controller.
30d524dac9SGrant Likely
31*2c0e641aSGerhard SittigOptional properties:
32*2c0e641aSGerhard Sittig- interrupt-controller:	Empty boolean property which marks the GPIO
33*2c0e641aSGerhard Sittig			module as an IRQ controller.
34*2c0e641aSGerhard Sittig- #interrupt-cells:	Should be two.  Defines the number of integer
35*2c0e641aSGerhard Sittig			cells required to specify an interrupt within
36*2c0e641aSGerhard Sittig			this interrupt controller.  The first cell
37*2c0e641aSGerhard Sittig			defines the pin number, the second cell
38*2c0e641aSGerhard Sittig			defines additional flags (trigger type,
39*2c0e641aSGerhard Sittig			trigger polarity).  Note that the available
40*2c0e641aSGerhard Sittig			set of trigger conditions supported by the
41*2c0e641aSGerhard Sittig			GPIO module depends on the actual SoC.
42*2c0e641aSGerhard Sittig
43d524dac9SGrant LikelyExample of gpio-controller nodes for a MPC8347 SoC:
44d524dac9SGrant Likely
45d524dac9SGrant Likely	gpio1: gpio-controller@c00 {
46d524dac9SGrant Likely		#gpio-cells = <2>;
47d524dac9SGrant Likely		compatible = "fsl,mpc8347-gpio", "fsl,mpc8349-gpio";
48d524dac9SGrant Likely		reg = <0xc00 0x100>;
49d524dac9SGrant Likely		interrupt-parent = <&ipic>;
50*2c0e641aSGerhard Sittig		interrupts = <74 0x8>;
51d524dac9SGrant Likely		gpio-controller;
52*2c0e641aSGerhard Sittig		interrupt-controller;
53*2c0e641aSGerhard Sittig		#interrupt-cells = <2>;
54d524dac9SGrant Likely	};
55d524dac9SGrant Likely
56d524dac9SGrant Likely	gpio2: gpio-controller@d00 {
57d524dac9SGrant Likely		#gpio-cells = <2>;
58d524dac9SGrant Likely		compatible = "fsl,mpc8347-gpio", "fsl,mpc8349-gpio";
59d524dac9SGrant Likely		reg = <0xd00 0x100>;
60d524dac9SGrant Likely		interrupt-parent = <&ipic>;
61*2c0e641aSGerhard Sittig		interrupts = <75 0x8>;
62d524dac9SGrant Likely		gpio-controller;
63d524dac9SGrant Likely	};
64d524dac9SGrant Likely
65*2c0e641aSGerhard SittigExample of a peripheral using the GPIO module as an IRQ controller:
66d524dac9SGrant Likely
67d524dac9SGrant Likely	funkyfpga@0 {
68d524dac9SGrant Likely		compatible = "funky-fpga";
69d524dac9SGrant Likely		...
70d524dac9SGrant Likely		interrupt-parent = <&gpio1>;
71*2c0e641aSGerhard Sittig		interrupts = <4 3>;
72d524dac9SGrant Likely	};
73