aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2017-08-12 22:49:25 -0400
committerRalf Baechle <ralf@linux-mips.org>2017-08-29 09:21:57 -0400
commitabe852ea3ad1c9ada6d053ae8f9eedb9722d0e90 (patch)
treebf2ebcb86cdff08f806a558d7c0f5333e0ae4ee4 /arch
parent454854ace22f5a9fdd369a4e428493159a02f029 (diff)
MIPS: CM: Rename mips_cm_base to mips_gcr_base
We currently have a mips_cm_base variable which holds the base address of the Coherence Manager (CM) Global Configuration Registers (GCRs), and accessor functions which use the GCR in their names. This works fine, but gets in the way of sharing the code to generate the accessor functions with other blocks (ie. CPC & GIC) because that code would then need to separately handle the name of the base address variable & the name used in the accessor functions. In order to prepare for sharing the accessor generation code between CM, CPC & GIC code this patch renames mips_cm_base to mips_gcr_base such that the "gcr" portion is common to both the base address variable & the accessor function names. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/16999/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/mips-cm.h6
-rw-r--r--arch/mips/kernel/mips-cm.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h
index cfdbab015769..a13d721669e6 100644
--- a/arch/mips/include/asm/mips-cm.h
+++ b/arch/mips/include/asm/mips-cm.h
@@ -17,7 +17,7 @@
17#include <linux/types.h> 17#include <linux/types.h>
18 18
19/* The base address of the CM GCR block */ 19/* The base address of the CM GCR block */
20extern void __iomem *mips_cm_base; 20extern void __iomem *mips_gcr_base;
21 21
22/* The base address of the CM L2-only sync region */ 22/* The base address of the CM L2-only sync region */
23extern void __iomem *mips_cm_l2sync_base; 23extern void __iomem *mips_cm_l2sync_base;
@@ -80,7 +80,7 @@ static inline int mips_cm_probe(void)
80static inline bool mips_cm_present(void) 80static inline bool mips_cm_present(void)
81{ 81{
82#ifdef CONFIG_MIPS_CM 82#ifdef CONFIG_MIPS_CM
83 return mips_cm_base != NULL; 83 return mips_gcr_base != NULL;
84#else 84#else
85 return false; 85 return false;
86#endif 86#endif
@@ -116,7 +116,7 @@ static inline bool mips_cm_has_l2sync(void)
116#define BUILD_CM_R_(name, off) \ 116#define BUILD_CM_R_(name, off) \
117static inline unsigned long __iomem *addr_gcr_##name(void) \ 117static inline unsigned long __iomem *addr_gcr_##name(void) \
118{ \ 118{ \
119 return (unsigned long __iomem *)(mips_cm_base + (off)); \ 119 return (unsigned long __iomem *)(mips_gcr_base + (off));\
120} \ 120} \
121 \ 121 \
122static inline u32 read32_gcr_##name(void) \ 122static inline u32 read32_gcr_##name(void) \
diff --git a/arch/mips/kernel/mips-cm.c b/arch/mips/kernel/mips-cm.c
index cb0c57f860d4..caac4a523968 100644
--- a/arch/mips/kernel/mips-cm.c
+++ b/arch/mips/kernel/mips-cm.c
@@ -15,7 +15,7 @@
15#include <asm/mips-cm.h> 15#include <asm/mips-cm.h>
16#include <asm/mipsregs.h> 16#include <asm/mipsregs.h>
17 17
18void __iomem *mips_cm_base; 18void __iomem *mips_gcr_base;
19void __iomem *mips_cm_l2sync_base; 19void __iomem *mips_cm_l2sync_base;
20int mips_cm_is64; 20int mips_cm_is64;
21 21
@@ -211,7 +211,7 @@ int mips_cm_probe(void)
211 * No need to probe again if we have already been 211 * No need to probe again if we have already been
212 * here before. 212 * here before.
213 */ 213 */
214 if (mips_cm_base) 214 if (mips_gcr_base)
215 return 0; 215 return 0;
216 216
217 addr = mips_cm_phys_base(); 217 addr = mips_cm_phys_base();
@@ -219,8 +219,8 @@ int mips_cm_probe(void)
219 if (!addr) 219 if (!addr)
220 return -ENODEV; 220 return -ENODEV;
221 221
222 mips_cm_base = ioremap_nocache(addr, MIPS_CM_GCR_SIZE); 222 mips_gcr_base = ioremap_nocache(addr, MIPS_CM_GCR_SIZE);
223 if (!mips_cm_base) 223 if (!mips_gcr_base)
224 return -ENXIO; 224 return -ENXIO;
225 225
226 /* sanity check that we're looking at a CM */ 226 /* sanity check that we're looking at a CM */
@@ -228,7 +228,7 @@ int mips_cm_probe(void)
228 if ((base_reg & CM_GCR_BASE_GCRBASE_MSK) != addr) { 228 if ((base_reg & CM_GCR_BASE_GCRBASE_MSK) != addr) {
229 pr_err("GCRs appear to have been moved (expected them at 0x%08lx)!\n", 229 pr_err("GCRs appear to have been moved (expected them at 0x%08lx)!\n",
230 (unsigned long)addr); 230 (unsigned long)addr);
231 mips_cm_base = NULL; 231 mips_gcr_base = NULL;
232 return -ENODEV; 232 return -ENODEV;
233 } 233 }
234 234