Commit e83f7e02 authored by Paul Burton's avatar Paul Burton Committed by Ralf Baechle

MIPS: CPS: Have asm/mips-cps.h include CM & CPC headers

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: default avatarPaul 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: default avatarRalf Baechle <ralf@linux-mips.org>
parent d595d423
...@@ -8,14 +8,15 @@ ...@@ -8,14 +8,15 @@
* option) any later version. * 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__ #ifndef __MIPS_ASM_MIPS_CM_H__
#define __MIPS_ASM_MIPS_CM_H__ #define __MIPS_ASM_MIPS_CM_H__
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/errno.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 */ /* The base address of the CM GCR block */
extern void __iomem *mips_gcr_base; extern void __iomem *mips_gcr_base;
......
...@@ -8,12 +8,15 @@ ...@@ -8,12 +8,15 @@
* option) any later version. * 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__ #ifndef __MIPS_ASM_MIPS_CPC_H__
#define __MIPS_ASM_MIPS_CPC_H__ #define __MIPS_ASM_MIPS_CPC_H__
#include <linux/io.h> #include <linux/bitops.h>
#include <linux/types.h> #include <linux/errno.h>
#include <asm/mips-cps.h>
/* The base address of the CPC registers */ /* The base address of the CPC registers */
extern void __iomem *mips_cpc_base; extern void __iomem *mips_cpc_base;
......
...@@ -105,4 +105,7 @@ static inline void clear_##unit##_##name(uint##sz##_t val) \ ...@@ -105,4 +105,7 @@ static inline void clear_##unit##_##name(uint##sz##_t val) \
CPS_ACCESSOR_W(unit, sz, name) \ CPS_ACCESSOR_W(unit, sz, name) \
CPS_ACCESSOR_M(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__ */ #endif /* __MIPS_ASM_MIPS_CPS_H__ */
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <asm/mips-cm.h> #include <asm/mips-cps.h>
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/mips-cm.h> #include <asm/mips-cps.h>
#include <asm/mipsregs.h> #include <asm/mipsregs.h>
void __iomem *mips_gcr_base; void __iomem *mips_gcr_base;
......
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/mips-cm.h> #include <asm/mips-cps.h>
#include <asm/mips-cpc.h>
void __iomem *mips_cpc_base; void __iomem *mips_cpc_base;
......
...@@ -17,8 +17,7 @@ ...@@ -17,8 +17,7 @@
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/cacheops.h> #include <asm/cacheops.h>
#include <asm/idle.h> #include <asm/idle.h>
#include <asm/mips-cm.h> #include <asm/mips-cps.h>
#include <asm/mips-cpc.h>
#include <asm/mipsmtregs.h> #include <asm/mipsmtregs.h>
#include <asm/pm.h> #include <asm/pm.h>
#include <asm/pm-cps.h> #include <asm/pm-cps.h>
......
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <asm/bcache.h> #include <asm/bcache.h>
#include <asm/mips-cm.h> #include <asm/mips-cps.h>
#include <asm/mips-cpc.h>
#include <asm/mips_mt.h> #include <asm/mips_mt.h>
#include <asm/mipsregs.h> #include <asm/mipsregs.h>
#include <asm/pm-cps.h> #include <asm/pm-cps.h>
......
...@@ -50,9 +50,8 @@ ...@@ -50,9 +50,8 @@
#include <asm/fpu.h> #include <asm/fpu.h>
#include <asm/fpu_emulator.h> #include <asm/fpu_emulator.h>
#include <asm/idle.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-r2-to-r6-emul.h>
#include <asm/mips-cm.h>
#include <asm/mipsregs.h> #include <asm/mipsregs.h>
#include <asm/mipsmtregs.h> #include <asm/mipsmtregs.h>
#include <asm/module.h> #include <asm/module.h>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <asm/cacheflush.h> /* for run_uncached() */ #include <asm/cacheflush.h> /* for run_uncached() */
#include <asm/traps.h> #include <asm/traps.h>
#include <asm/dma-coherence.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. * Bits describing what cache ops an SMP callback function may perform.
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/r4kcache.h> #include <asm/r4kcache.h>
#include <asm/mips-cm.h> #include <asm/mips-cps.h>
/* /*
* MIPS32/MIPS64 L2 cache handling * MIPS32/MIPS64 L2 cache handling
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <asm/fw/fw.h> #include <asm/fw/fw.h>
#include <asm/mips-boards/generic.h> #include <asm/mips-boards/generic.h>
#include <asm/mips-boards/malta.h> #include <asm/mips-boards/malta.h>
#include <asm/mips-cm.h> #include <asm/mips-cps.h>
#include <asm/page.h> #include <asm/page.h>
#define ROCIT_REG_BASE 0x1f403000 #define ROCIT_REG_BASE 0x1f403000
......
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
#include <asm/smp-ops.h> #include <asm/smp-ops.h>
#include <asm/traps.h> #include <asm/traps.h>
#include <asm/fw/fw.h> #include <asm/fw/fw.h>
#include <asm/mips-cm.h> #include <asm/mips-cps.h>
#include <asm/mips-cpc.h>
#include <asm/mips-boards/generic.h> #include <asm/mips-boards/generic.h>
#include <asm/mips-boards/malta.h> #include <asm/mips-boards/malta.h>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <asm/i8259.h> #include <asm/i8259.h>
#include <asm/irq_cpu.h> #include <asm/irq_cpu.h>
#include <asm/irq_regs.h> #include <asm/irq_regs.h>
#include <asm/mips-cm.h>
#include <asm/mips-boards/malta.h> #include <asm/mips-boards/malta.h>
#include <asm/mips-boards/maltaint.h> #include <asm/mips-boards/maltaint.h>
#include <asm/gt64120.h> #include <asm/gt64120.h>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <asm/fw/fw.h> #include <asm/fw/fw.h>
#include <asm/mach-malta/malta-dtshim.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/generic.h>
#include <asm/mips-boards/malta.h> #include <asm/mips-boards/malta.h>
#include <asm/mips-boards/maltaint.h> #include <asm/mips-boards/maltaint.h>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/gt64120.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/generic.h>
#include <asm/mips-boards/bonito64.h> #include <asm/mips-boards/bonito64.h>
#include <asm/mips-boards/msc01_pci.h> #include <asm/mips-boards/msc01_pci.h>
......
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
#include <asm/dma-coherence.h> #include <asm/dma-coherence.h>
#include <asm/fw/fw.h> #include <asm/fw/fw.h>
#include <asm/mips-boards/generic.h> #include <asm/mips-boards/generic.h>
#include <asm/mips-cm.h> #include <asm/mips-cps.h>
#include <asm/mips-cpc.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/smp-ops.h> #include <asm/smp-ops.h>
#include <asm/traps.h> #include <asm/traps.h>
......
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
#include <asm/mipsregs.h> #include <asm/mipsregs.h>
#include <asm/smp-ops.h> #include <asm/smp-ops.h>
#include <asm/mips-cm.h> #include <asm/mips-cps.h>
#include <asm/mips-cpc.h>
#include <asm/mach-ralink/ralink_regs.h> #include <asm/mach-ralink/ralink_regs.h>
#include <asm/mach-ralink/mt7621.h> #include <asm/mach-ralink/mt7621.h>
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <asm/clocksource.h> #include <asm/clocksource.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/mips-cm.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <asm/vdso.h> #include <asm/vdso.h>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <asm/mips-cm.h> #include <asm/mips-cps.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/traps.h> #include <asm/traps.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment