]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
powerpc/powernv: Move SCOM access code into powernv platform
authorAndrew Donnellan <ajd@linux.ibm.com>
Thu, 9 May 2019 05:11:15 +0000 (15:11 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 5 Aug 2019 08:53:03 +0000 (18:53 +1000)
The powernv platform is the only one that directly accesses SCOMs.
Move the support code to platforms/powernv, and get rid of the
PPC_SCOM Kconfig option, as SCOM support is always selected when
compiling for powernv.

This also means that the Kconfig item for CONFIG_SCOM_DEBUGFS will
show up in menuconfig in the platform menu, rather than at the root,
which is a much better location.

Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190509051119.7694-1-ajd@linux.ibm.com
arch/powerpc/platforms/powernv/Kconfig
arch/powerpc/platforms/powernv/Makefile
arch/powerpc/platforms/powernv/opal-xscom.c
arch/powerpc/platforms/powernv/scom.c [moved from arch/powerpc/sysdev/scom.c with 99% similarity]
arch/powerpc/platforms/powernv/scom.h [moved from arch/powerpc/include/asm/scom.h with 94% similarity]
arch/powerpc/sysdev/Kconfig
arch/powerpc/sysdev/Makefile

index 850eee860cf21c0eacfb39aeb358bbc4b1438b14..938803eab0ad432a9818fdd06bad73dfd272050f 100644 (file)
@@ -12,7 +12,6 @@ config PPC_POWERNV
        select EPAPR_BOOT
        select PPC_INDIRECT_PIO
        select PPC_UDBG_16550
-       select PPC_SCOM
        select ARCH_RANDOM
        select CPU_FREQ
        select PPC_DOORBELL
@@ -47,3 +46,7 @@ config PPC_VAS
          VAS adapters are found in POWER9 based systems.
 
          If unsure, say N.
+
+config SCOM_DEBUGFS
+       bool "Expose SCOM controllers via debugfs"
+       depends on DEBUG_FS
index da2e99efbd04e623f6761b49c16bcd9da06a88d8..4b1644150135322b51db96ff910df2c95b697845 100644 (file)
@@ -4,12 +4,12 @@ obj-y                 += idle.o opal-rtc.o opal-nvram.o opal-lpc.o opal-flash.o
 obj-y                  += rng.o opal-elog.o opal-dump.o opal-sysparam.o opal-sensor.o
 obj-y                  += opal-msglog.o opal-hmi.o opal-power.o opal-irqchip.o
 obj-y                  += opal-kmsg.o opal-powercap.o opal-psr.o opal-sensor-groups.o
+obj-y                  += opal-xscom.o scom.o
 
 obj-$(CONFIG_SMP)      += smp.o subcore.o subcore-asm.o
 obj-$(CONFIG_PCI)      += pci.o pci-ioda.o npu-dma.o pci-ioda-tce.o
 obj-$(CONFIG_CXL_BASE) += pci-cxl.o
 obj-$(CONFIG_EEH)      += eeh-powernv.o
-obj-$(CONFIG_PPC_SCOM) += opal-xscom.o
 obj-$(CONFIG_MEMORY_FAILURE)   += opal-memory-errors.o
 obj-$(CONFIG_OPAL_PRD) += opal-prd.o
 obj-$(CONFIG_PERF_EVENTS) += opal-imc.o
index 66430eebe869a364a2e5703bb8b2ce5d049d2fe6..3f48ee69928ce0199edc25c194d5cb5665ecb5fc 100644 (file)
@@ -14,7 +14,8 @@
 #include <asm/machdep.h>
 #include <asm/firmware.h>
 #include <asm/opal.h>
-#include <asm/scom.h>
+
+#include "scom.h"
 
 /*
  * We could probably fit that inside the scom_map_t
similarity index 99%
rename from arch/powerpc/sysdev/scom.c
rename to arch/powerpc/platforms/powernv/scom.c
index 94e885bf3aeec93c829254b64bdba3774135f2aa..74664e9496b89934f5112e3811ce7e94023a5697 100644 (file)
 #include <linux/export.h>
 #include <asm/debugfs.h>
 #include <asm/prom.h>
-#include <asm/scom.h>
 #include <linux/uaccess.h>
 
+#include "scom.h"
+
 const struct scom_controller *scom_controller;
 EXPORT_SYMBOL_GPL(scom_controller);
 
similarity index 94%
rename from arch/powerpc/include/asm/scom.h
rename to arch/powerpc/platforms/powernv/scom.h
index 08c44396e54a4cf2164f09707f0f03524082f62d..b5c33e30d39ce1a1a3c11c07495f3ac8f5bc7b8b 100644 (file)
@@ -5,12 +5,8 @@
  *     and        David Gibson, IBM Corporation.
  */
 
-#ifndef _ASM_POWERPC_SCOM_H
-#define _ASM_POWERPC_SCOM_H
-
-#ifdef __KERNEL__
-#ifndef __ASSEMBLY__
-#ifdef CONFIG_PPC_SCOM
+#ifndef _SCOM_H
+#define _SCOM_H
 
 /*
  * The SCOM bus is a sideband bus used for accessing various internal
@@ -148,7 +144,4 @@ static inline int scom_write(scom_map_t map, u64 reg, u64 value)
 }
 
 
-#endif /* CONFIG_PPC_SCOM */
-#endif /* __ASSEMBLY__ */
-#endif /* __KERNEL__ */
-#endif /* _ASM_POWERPC_SCOM_H */
+#endif /* _SCOM_H */
index d23288c4abf668cb926346820b39b9045ede1322..9ebcc13375603c2e76844f8ce63162af0dd7726b 100644 (file)
@@ -28,13 +28,6 @@ config PPC_MSI_BITMAP
 source "arch/powerpc/sysdev/xics/Kconfig"
 source "arch/powerpc/sysdev/xive/Kconfig"
 
-config PPC_SCOM
-       bool
-
-config SCOM_DEBUGFS
-       bool "Expose SCOM controllers via debugfs"
-       depends on PPC_SCOM && DEBUG_FS
-
 config GE_FPGA
        bool
 
index 9d73dfddf0600a9b8b75787414120c9423970a0c..603b3c656d191e4f88b9e69c240feea2fb19fe19 100644 (file)
@@ -49,8 +49,6 @@ ifdef CONFIG_SUSPEND
 obj-$(CONFIG_PPC_BOOK3S_32)    += 6xx-suspend.o
 endif
 
-obj-$(CONFIG_PPC_SCOM)         += scom.o
-
 obj-$(CONFIG_PPC_EARLY_DEBUG_MEMCONS)  += udbg_memcons.o
 
 obj-$(CONFIG_PPC_XICS)         += xics/