linux_dsm_epyc7002/arch/powerpc/platforms
Benjamin Collins 5611fe48c5 powerpc: Add support for CTS-1000 GPIO controlled system poweroff
CTS-1000 is based on P4080. GPIO 27 is used to signal the FPGA to
switch off power, and also associates IRQ 8 with front-panel button
press (which we use to call orderly_poweroff()).

The relevant device-tree looks like this:

	gpio0: gpio@130000 {
		compatible = "fsl,qoriq-gpio";
		reg = <0x130000 0x1000>;
		interrupts = <55 2 0 0>;
		#gpio-cells = <2>;
		gpio-controller;

		/* Allows powering off the system via GPIO signal. */
		gpio-halt@27 {
			compatible = "sgy,gpio-halt";
			gpios = <&gpio0 27 0>;
			interrupts = <8 1 0 0>;
		};
	};

Because the driver cannot match on sgy,gpio-halt (because the node is never
processed through of_platform), it matches on fsl,qoriq-gpio and then
checks child nodes for the matching sgy,gpio-halt. This also ensures that
the GPIO controller is detected prior to sgy_cts1000's probe callback,
since that node wont match via of_platform until the controller is
registered.

Also, because the GPIO handler for triggering system poweroff might sleep,
the IRQ uses a workqueue to call orderly_poweroff().

As a final note, this driver may be expanded for other features specific to
the CTS-1000.

Signed-off-by: Ben Collins <ben.c@servergy.com>
Cc: Jack Smith <jack.s@servergy.com>
Cc: Vihar Rai <vihar.r@servergy.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-01-29 11:35:05 +11:00
..
8xx
40x powerpc: Add missing NULL terminator to avoid boot panic on PPC40x 2013-01-03 16:45:52 +11:00
44x powerpc/44x: Support OCM(On Chip Memory) for APM821xx SoC and Bluestone board 2013-01-10 15:08:37 +11:00
52xx POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
82xx powerpc/82xx: Use for_each_compatible_node() macro 2013-01-10 17:00:51 +11:00
83xx POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
85xx powerpc: Add support for CTS-1000 GPIO controlled system poweroff 2013-01-29 11:35:05 +11:00
86xx POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
512x powerpc/512x: don't compile any platform DIU code if the DIU is not enabled 2012-12-03 22:13:34 +01:00
amigaone
cell powerpc: Convert print_symbol to %pSR 2013-01-10 17:01:16 +11:00
chrp POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
embedded6xx
maple POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
pasemi powerpc/pasemi: Fix crash on reboot 2013-01-29 10:18:14 +11:00
powermac POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
powernv POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
prep
ps3 POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
pseries powerpc/eeh: Fix crash when adding a device in a slot with DDW 2013-01-10 17:01:58 +11:00
wsp powerpc: Build kernel with -mcmodel=medium 2013-01-10 17:00:31 +11:00
fsl_uli1575.c POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
Kconfig PPC: select EPAPR_PARAVIRT for all users of epapr hcalls 2012-10-05 23:38:37 +02:00
Kconfig.cputype powerpc: Update Kconfig + Makefile to prepare for server doorbells 2013-01-10 15:09:08 +11:00
Makefile