]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
MIPS: CPS: Have asm/mips-cps.h include CM & CPC headers
authorPaul Burton <paul.burton@imgtec.com>
Sun, 13 Aug 2017 02:49:41 +0000 (19:49 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 29 Aug 2017 22:57:27 +0000 (00:57 +0200)
With Coherence Manager (CM) 3.5 information about the topology of the
system, which has previously only been available through & accessed from
the CM, is now also provided by the Cluster Power Controller (CPC). This
includes a new CPC_CONFIG register mirroring GCR_CONFIG, and similarly a
new CPC_Cx_CONFIG register mirroring GCR_Cx_CONFIG.

In preparation for adjusting functions such as mips_cm_numcores(), which
have previously only needed to access the CM, to also access the CPC
this patch modifies the way we use the various CPS headers. Rather than
having users include asm/mips-cm.h or asm/mips-cpc.h individually we
instead have users include asm/mips-cps.h which in turn includes
asm/mips-cm.h & asm/mips-cpc.h. This means that users will gain access
to both CM & CPC registers by including one header, and most importantly
it makes asm/mips-cps.h an ideal location for helper functions which
need to access the various components of the CPS.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17015/
Patchwork: https://patchwork.linux-mips.org/patch/17217/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
20 files changed:
arch/mips/include/asm/mips-cm.h
arch/mips/include/asm/mips-cpc.h
arch/mips/include/asm/mips-cps.h
arch/mips/include/asm/smp-ops.h
arch/mips/kernel/mips-cm.c
arch/mips/kernel/mips-cpc.c
arch/mips/kernel/pm-cps.c
arch/mips/kernel/smp-cps.c
arch/mips/kernel/traps.c
arch/mips/mm/c-r4k.c
arch/mips/mm/sc-mips.c
arch/mips/mti-malta/malta-dtshim.c
arch/mips/mti-malta/malta-init.c
arch/mips/mti-malta/malta-int.c
arch/mips/mti-malta/malta-setup.c
arch/mips/pci/pci-malta.c
arch/mips/pistachio/init.c
arch/mips/ralink/mt7621.c
arch/mips/vdso/gettimeofday.c
drivers/irqchip/irq-mips-gic.c

index d42cc8e76dc23f2674b13c235a15072dd40f86f6..3b82ebb5b35cc0a048f9d93401bd8bc794454bb4 100644 (file)
@@ -8,14 +8,15 @@
  * option) any later version.
  */
 
+#ifndef __MIPS_ASM_MIPS_CPS_H__
+# error Please include asm/mips-cps.h rather than asm/mips-cm.h
+#endif
+
 #ifndef __MIPS_ASM_MIPS_CM_H__
 #define __MIPS_ASM_MIPS_CM_H__
 
 #include <linux/bitops.h>
 #include <linux/errno.h>
-#include <linux/io.h>
-#include <linux/types.h>
-#include <asm/mips-cps.h>
 
 /* The base address of the CM GCR block */
 extern void __iomem *mips_gcr_base;
index 1d024cc6ccd83a72d3024026c01de0110be50ab6..f885051a837876ab19bdd110099a2c3a83ec4ba2 100644 (file)
@@ -8,12 +8,15 @@
  * option) any later version.
  */
 
+#ifndef __MIPS_ASM_MIPS_CPS_H__
+# error Please include asm/mips-cps.h rather than asm/mips-cpc.h
+#endif
+
 #ifndef __MIPS_ASM_MIPS_CPC_H__
 #define __MIPS_ASM_MIPS_CPC_H__
 
-#include <linux/io.h>
-#include <linux/types.h>
-#include <asm/mips-cps.h>
+#include <linux/bitops.h>
+#include <linux/errno.h>
 
 /* The base address of the CPC registers */
 extern void __iomem *mips_cpc_base;
index 7ae32ad1559988398641a3b6067fd5864ebef1c6..2ac88ed4b381b9a40a44a0f8e2fdbd5aee9519a9 100644 (file)
@@ -105,4 +105,7 @@ static inline void clear_##unit##_##name(uint##sz##_t val)          \
        CPS_ACCESSOR_W(unit, sz, name)                                  \
        CPS_ACCESSOR_M(unit, sz, name)
 
+#include <asm/mips-cm.h>
+#include <asm/mips-cpc.h>
+
 #endif /* __MIPS_ASM_MIPS_CPS_H__ */
index e5f49dd453c7d3629c22f82a3ec6edd88e2442d2..53b2cb8e59666c268c634866819ebe43aa401810 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <linux/errno.h>
 
-#include <asm/mips-cm.h>
+#include <asm/mips-cps.h>
 
 #ifdef CONFIG_SMP
 
index 47d64fd224ea26daea91385f10314365774d4ab0..e91c8c4e2eb59e69c76c516bd3fbc99f23f21c8b 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/percpu.h>
 #include <linux/spinlock.h>
 
-#include <asm/mips-cm.h>
+#include <asm/mips-cps.h>
 #include <asm/mipsregs.h>
 
 void __iomem *mips_gcr_base;
index 06952bb34395337b2720b7c9c1905eb970ed1b83..f66b05ebf637d4c6542df58c4d510e16b88a2b8c 100644 (file)
@@ -12,8 +12,7 @@
 #include <linux/percpu.h>
 #include <linux/spinlock.h>
 
-#include <asm/mips-cm.h>
-#include <asm/mips-cpc.h>
+#include <asm/mips-cps.h>
 
 void __iomem *mips_cpc_base;
 
index 8df320a6b4b9005016a0eea486919b419c1be4fd..4655017f2377d0246cc5c9604eba39bbc98366c2 100644 (file)
@@ -17,8 +17,7 @@
 #include <asm/cacheflush.h>
 #include <asm/cacheops.h>
 #include <asm/idle.h>
-#include <asm/mips-cm.h>
-#include <asm/mips-cpc.h>
+#include <asm/mips-cps.h>
 #include <asm/mipsmtregs.h>
 #include <asm/pm.h>
 #include <asm/pm-cps.h>
index 4a4a25c722f17befe8e44c99393b4d4435422929..57b331b85e54c3190071625962d782da34807e63 100644 (file)
@@ -19,8 +19,7 @@
 #include <linux/types.h>
 
 #include <asm/bcache.h>
-#include <asm/mips-cm.h>
-#include <asm/mips-cpc.h>
+#include <asm/mips-cps.h>
 #include <asm/mips_mt.h>
 #include <asm/mipsregs.h>
 #include <asm/pm-cps.h>
index 4cba2e7782844953df78832b96158c7bb6951826..5669d3b8bd382760aa4f7cefa243a13195035928 100644 (file)
@@ -50,9 +50,8 @@
 #include <asm/fpu.h>
 #include <asm/fpu_emulator.h>
 #include <asm/idle.h>
-#include <asm/mips-cm.h>
+#include <asm/mips-cps.h>
 #include <asm/mips-r2-to-r6-emul.h>
-#include <asm/mips-cm.h>
 #include <asm/mipsregs.h>
 #include <asm/mipsmtregs.h>
 #include <asm/module.h>
index 81d6a15c93d08ba2603d0e9f2dd8302546a97489..6f534b2099717da8c2d7be70bfa035a05ed5aede 100644 (file)
@@ -37,7 +37,7 @@
 #include <asm/cacheflush.h> /* for run_uncached() */
 #include <asm/traps.h>
 #include <asm/dma-coherence.h>
-#include <asm/mips-cm.h>
+#include <asm/mips-cps.h>
 
 /*
  * Bits describing what cache ops an SMP callback function may perform.
index cda878c0010baea31e324ee39095a887518386cc..acfb89273dad7d9eaa1529f07e94b3b439733309 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/r4kcache.h>
-#include <asm/mips-cm.h>
+#include <asm/mips-cps.h>
 
 /*
  * MIPS32/MIPS64 L2 cache handling
index 4352e43aee65970b33791d5a7058d5abae150392..a6699c15277d9b802536abba8a2d27288f6e0861 100644 (file)
@@ -18,7 +18,7 @@
 #include <asm/fw/fw.h>
 #include <asm/mips-boards/generic.h>
 #include <asm/mips-boards/malta.h>
-#include <asm/mips-cm.h>
+#include <asm/mips-cps.h>
 #include <asm/page.h>
 
 #define ROCIT_REG_BASE                 0x1f403000
index 0f3b881a3190fdcb993ea01234a2c304b1511f18..009f2918b3201f1390cc163f2d8b61b44d1160cb 100644 (file)
@@ -21,8 +21,7 @@
 #include <asm/smp-ops.h>
 #include <asm/traps.h>
 #include <asm/fw/fw.h>
-#include <asm/mips-cm.h>
-#include <asm/mips-cpc.h>
+#include <asm/mips-cps.h>
 #include <asm/mips-boards/generic.h>
 #include <asm/mips-boards/malta.h>
 
index b0f9b188e83359d18073e08e5ec3dd3105155d51..2e831f4abfb35e987d4d8aabf3b063038900e8a7 100644 (file)
@@ -29,7 +29,6 @@
 #include <asm/i8259.h>
 #include <asm/irq_cpu.h>
 #include <asm/irq_regs.h>
-#include <asm/mips-cm.h>
 #include <asm/mips-boards/malta.h>
 #include <asm/mips-boards/maltaint.h>
 #include <asm/gt64120.h>
index a01d5debfcaf5578a30b6114721db82a1c392e19..7f1868888d18d399a4208c950fbf1d7d80403b09 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <asm/fw/fw.h>
 #include <asm/mach-malta/malta-dtshim.h>
-#include <asm/mips-cm.h>
+#include <asm/mips-cps.h>
 #include <asm/mips-boards/generic.h>
 #include <asm/mips-boards/malta.h>
 #include <asm/mips-boards/maltaint.h>
index cfbbc3e3e914526e8086e156d426a82c043032a2..de97b8f1c5a87cc1f03e1f0856c86dc17b507e84 100644 (file)
@@ -27,7 +27,7 @@
 #include <linux/init.h>
 
 #include <asm/gt64120.h>
-#include <asm/mips-cm.h>
+#include <asm/mips-cps.h>
 #include <asm/mips-boards/generic.h>
 #include <asm/mips-boards/bonito64.h>
 #include <asm/mips-boards/msc01_pci.h>
index 1c91cad7988fb4b2e63e43eeeeefbc46ac72e7df..0b06c953d29359bffcebad378c565202b3a6c646 100644 (file)
@@ -19,8 +19,7 @@
 #include <asm/dma-coherence.h>
 #include <asm/fw/fw.h>
 #include <asm/mips-boards/generic.h>
-#include <asm/mips-cm.h>
-#include <asm/mips-cpc.h>
+#include <asm/mips-cps.h>
 #include <asm/prom.h>
 #include <asm/smp-ops.h>
 #include <asm/traps.h>
index 0695c2d64e49107141091f8614c2689c18e68663..9661c50305b535b791e265b50b59cc6948b11dc6 100644 (file)
@@ -12,8 +12,7 @@
 
 #include <asm/mipsregs.h>
 #include <asm/smp-ops.h>
-#include <asm/mips-cm.h>
-#include <asm/mips-cpc.h>
+#include <asm/mips-cps.h>
 #include <asm/mach-ralink/ralink_regs.h>
 #include <asm/mach-ralink/mt7621.h>
 
index e2690d7ca4ddd992e69fffe802cac6355ad14de8..fec7835b9de7f61179a4888a83d3040c759b7467 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <asm/clocksource.h>
 #include <asm/io.h>
-#include <asm/mips-cm.h>
 #include <asm/unistd.h>
 #include <asm/vdso.h>
 
index ae9f8e581d06f84a3c6f36768d7a4d1471d6ad85..9e984cefdca0edd98586e348575629117b14f765 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/sched.h>
 #include <linux/smp.h>
 
-#include <asm/mips-cm.h>
+#include <asm/mips-cps.h>
 #include <asm/setup.h>
 #include <asm/traps.h>