linux_dsm_epyc7002/arch/powerpc
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
..
boot powerpc/dts/virtex440: Add ethernet phy to virtex440-ml507 board 2013-01-10 15:09:05 +11:00
configs powerpc/fsl: Remove CONFIG_IRQ_ALL_CPUS from mpc85xx/mpc86xx defconfig 2013-01-29 11:35:05 +11:00
crypto powerpc: Add a powerpc implementation of SHA-1 2013-01-10 14:43:45 +11:00
include powerpc/ptrace: Make #defines for all request numbers hex 2013-01-29 11:34:25 +11:00
kernel Merge branch 'merge' into next 2013-01-29 11:33:37 +11:00
kvm Merge branch 'merge' into next 2013-01-29 11:33:37 +11:00
lib powerpc: Build kernel with -mcmodel=medium 2013-01-10 17:00:31 +11:00
math-emu powerpc/math_emu/efp: Look for errata handler when type mismatches 2011-10-06 23:36:47 -05:00
mm powerpc/mm: Eliminate unneeded for_each_memblock 2013-01-29 11:34:25 +11:00
net PPC: net: bpf_jit_comp: add VLAN instructions for BPF JIT 2012-11-17 22:12:47 -05:00
oprofile Merge branch 'merge' into next 2013-01-29 11:33:37 +11:00
perf powerpc/perf: Fix for PMCs not making progress 2013-01-10 17:02:04 +11:00
platforms powerpc: Add support for CTS-1000 GPIO controlled system poweroff 2013-01-29 11:35:05 +11:00
sysdev powerpc/mpic: Make distribute_irqs obey MPIC_SINGLE_DEST_CPU 2013-01-29 11:35:04 +11:00
xmon powerpc: Rename set_break to avoid naming conflict 2013-01-16 05:25:47 +11:00
Kconfig powerpc: Enable ARCH_USE_BUILTIN_BSWAP 2013-01-10 17:00:54 +11:00
Kconfig.debug powerpc: IOMMU fault injection 2012-07-10 19:18:59 +10:00
Makefile powerpc: Avoid load of static chain register when calling nested functions through a pointer on 64bit 2013-01-10 17:01:27 +11:00
relocs_check.pl powerpc: Process dynamic relocations for kernel 2011-12-20 10:21:08 -05:00