162306a36Sopenharmony_ciGPIO controllers on MPC8xxx SoCs
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciThis is for the non-QE/CPM/GUTs GPIO controllers as found on
462306a36Sopenharmony_ci8349, 8572, 8610 and compatible.
562306a36Sopenharmony_ci
662306a36Sopenharmony_ciEvery GPIO controller node must have #gpio-cells property defined,
762306a36Sopenharmony_cithis information will be used to translate gpio-specifiers.
862306a36Sopenharmony_ciSee bindings/gpio/gpio.txt for details of how to specify GPIO
962306a36Sopenharmony_ciinformation for devices.
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ciThe GPIO module usually is connected to the SoC's internal interrupt
1262306a36Sopenharmony_cicontroller, see bindings/interrupt-controller/interrupts.txt (the
1362306a36Sopenharmony_ciinterrupt client nodes section) for details how to specify this GPIO
1462306a36Sopenharmony_cimodule's interrupt.
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciThe GPIO module may serve as another interrupt controller (cascaded to
1762306a36Sopenharmony_cithe SoC's internal interrupt controller).  See the interrupt controller
1862306a36Sopenharmony_cinodes section in bindings/interrupt-controller/interrupts.txt for
1962306a36Sopenharmony_cidetails.
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ciRequired properties:
2262306a36Sopenharmony_ci- compatible:		"fsl,<chip>-gpio" followed by "fsl,mpc8349-gpio"
2362306a36Sopenharmony_ci			for 83xx, "fsl,mpc8572-gpio" for 85xx, or
2462306a36Sopenharmony_ci			"fsl,mpc8610-gpio" for 86xx.
2562306a36Sopenharmony_ci- #gpio-cells:		Should be two. The first cell is the pin number
2662306a36Sopenharmony_ci			and the second cell is used to specify optional
2762306a36Sopenharmony_ci			parameters (currently unused).
2862306a36Sopenharmony_ci- interrupts:		Interrupt mapping for GPIO IRQ.
2962306a36Sopenharmony_ci- gpio-controller:	Marks the port as GPIO controller.
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ciOptional properties:
3262306a36Sopenharmony_ci- interrupt-controller:	Empty boolean property which marks the GPIO
3362306a36Sopenharmony_ci			module as an IRQ controller.
3462306a36Sopenharmony_ci- #interrupt-cells:	Should be two.  Defines the number of integer
3562306a36Sopenharmony_ci			cells required to specify an interrupt within
3662306a36Sopenharmony_ci			this interrupt controller.  The first cell
3762306a36Sopenharmony_ci			defines the pin number, the second cell
3862306a36Sopenharmony_ci			defines additional flags (trigger type,
3962306a36Sopenharmony_ci			trigger polarity).  Note that the available
4062306a36Sopenharmony_ci			set of trigger conditions supported by the
4162306a36Sopenharmony_ci			GPIO module depends on the actual SoC.
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ciExample of gpio-controller nodes for a MPC8347 SoC:
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci	gpio1: gpio-controller@c00 {
4662306a36Sopenharmony_ci		#gpio-cells = <2>;
4762306a36Sopenharmony_ci		compatible = "fsl,mpc8347-gpio", "fsl,mpc8349-gpio";
4862306a36Sopenharmony_ci		reg = <0xc00 0x100>;
4962306a36Sopenharmony_ci		interrupt-parent = <&ipic>;
5062306a36Sopenharmony_ci		interrupts = <74 0x8>;
5162306a36Sopenharmony_ci		gpio-controller;
5262306a36Sopenharmony_ci		interrupt-controller;
5362306a36Sopenharmony_ci		#interrupt-cells = <2>;
5462306a36Sopenharmony_ci	};
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci	gpio2: gpio-controller@d00 {
5762306a36Sopenharmony_ci		#gpio-cells = <2>;
5862306a36Sopenharmony_ci		compatible = "fsl,mpc8347-gpio", "fsl,mpc8349-gpio";
5962306a36Sopenharmony_ci		reg = <0xd00 0x100>;
6062306a36Sopenharmony_ci		interrupt-parent = <&ipic>;
6162306a36Sopenharmony_ci		interrupts = <75 0x8>;
6262306a36Sopenharmony_ci		gpio-controller;
6362306a36Sopenharmony_ci	};
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ciExample of a peripheral using the GPIO module as an IRQ controller:
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci	funkyfpga@0 {
6862306a36Sopenharmony_ci		compatible = "funky-fpga";
6962306a36Sopenharmony_ci		...
7062306a36Sopenharmony_ci		interrupt-parent = <&gpio1>;
7162306a36Sopenharmony_ci		interrupts = <4 3>;
7262306a36Sopenharmony_ci	};
73