aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2016-08-26 18:41:29 -0400
committerVineet Gupta <vgupta@synopsys.com>2016-09-30 17:48:17 -0400
commit26c01c49d559268527d78f45a6818fae0c204a45 (patch)
treec85355da436bd0f892f581a4f4162d4a5c1862db
parentf507684637ceba4263de145ef7acb90cd107aa12 (diff)
ARCv2: Support dynamic peripheral address space in HS38 rel 3.0 cores
HS release 3.0 provides for even more flexibility in specifying the volatile address space for mapping peripherals. With HS 2.1 @start was made flexible / programmable - with HS 3.0 even @end can be setup (vs. fixed to 0xFFFF_FFFF before). So add code to reflect that and while at it remove an unused struct defintion Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r--arch/arc/include/asm/arcregs.h10
-rw-r--r--arch/arc/include/asm/cache.h2
-rw-r--r--arch/arc/kernel/setup.c4
-rw-r--r--arch/arc/mm/cache.c23
-rw-r--r--arch/arc/mm/ioremap.c2
5 files changed, 23 insertions, 18 deletions
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index 7fbaea00a336..db25c65155cb 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -95,7 +95,7 @@
95/* Auxiliary registers */ 95/* Auxiliary registers */
96#define AUX_IDENTITY 4 96#define AUX_IDENTITY 4
97#define AUX_INTR_VEC_BASE 0x25 97#define AUX_INTR_VEC_BASE 0x25
98#define AUX_NON_VOL 0x5e 98#define AUX_VOL 0x5e
99 99
100/* 100/*
101 * Floating Pt Registers 101 * Floating Pt Registers
@@ -240,14 +240,6 @@ struct bcr_extn_xymem {
240#endif 240#endif
241}; 241};
242 242
243struct bcr_perip {
244#ifdef CONFIG_CPU_BIG_ENDIAN
245 unsigned int start:8, pad2:8, sz:8, ver:8;
246#else
247 unsigned int ver:8, sz:8, pad2:8, start:8;
248#endif
249};
250
251struct bcr_iccm_arcompact { 243struct bcr_iccm_arcompact {
252#ifdef CONFIG_CPU_BIG_ENDIAN 244#ifdef CONFIG_CPU_BIG_ENDIAN
253 unsigned int base:16, pad:5, sz:3, ver:8; 245 unsigned int base:16, pad:5, sz:3, ver:8;
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
index 23706c635c30..fb781e34f322 100644
--- a/arch/arc/include/asm/cache.h
+++ b/arch/arc/include/asm/cache.h
@@ -54,7 +54,7 @@ extern char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len);
54extern void read_decode_cache_bcr(void); 54extern void read_decode_cache_bcr(void);
55 55
56extern int ioc_exists; 56extern int ioc_exists;
57extern unsigned long perip_base; 57extern unsigned long perip_base, perip_end;
58 58
59#endif /* !__ASSEMBLY__ */ 59#endif /* !__ASSEMBLY__ */
60 60
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index 11a75e4ad4fb..3df7f9c72f42 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -273,8 +273,8 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len)
273 FIX_PTR(cpu); 273 FIX_PTR(cpu);
274 274
275 n += scnprintf(buf + n, len - n, 275 n += scnprintf(buf + n, len - n,
276 "Vector Table\t: %#x\nUncached Base\t: %#lx\n", 276 "Vector Table\t: %#x\nPeripherals\t: %#lx:%#lx\n",
277 cpu->vec_base, perip_base); 277 cpu->vec_base, perip_base, perip_end);
278 278
279 if (cpu->extn.fpu_sp || cpu->extn.fpu_dp) 279 if (cpu->extn.fpu_sp || cpu->extn.fpu_dp)
280 n += scnprintf(buf + n, len - n, "FPU\t\t: %s%s\n", 280 n += scnprintf(buf + n, len - n, "FPU\t\t: %s%s\n",
diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c
index 0b10efe3a6a7..97dddbefb86a 100644
--- a/arch/arc/mm/cache.c
+++ b/arch/arc/mm/cache.c
@@ -25,6 +25,7 @@ static int l2_line_sz;
25int ioc_exists; 25int ioc_exists;
26volatile int slc_enable = 1, ioc_enable = 1; 26volatile int slc_enable = 1, ioc_enable = 1;
27unsigned long perip_base = ARC_UNCACHED_ADDR_SPACE; /* legacy value for boot */ 27unsigned long perip_base = ARC_UNCACHED_ADDR_SPACE; /* legacy value for boot */
28unsigned long perip_end = 0xFFFFFFFF; /* legacy value */
28 29
29void (*_cache_line_loop_ic_fn)(phys_addr_t paddr, unsigned long vaddr, 30void (*_cache_line_loop_ic_fn)(phys_addr_t paddr, unsigned long vaddr,
30 unsigned long sz, const int cacheop); 31 unsigned long sz, const int cacheop);
@@ -76,7 +77,6 @@ char *arc_cache_mumbojumbo(int c, char *buf, int len)
76static void read_decode_cache_bcr_arcv2(int cpu) 77static void read_decode_cache_bcr_arcv2(int cpu)
77{ 78{
78 struct cpuinfo_arc_cache *p_slc = &cpuinfo_arc700[cpu].slc; 79 struct cpuinfo_arc_cache *p_slc = &cpuinfo_arc700[cpu].slc;
79 struct bcr_generic uncached_space;
80 struct bcr_generic sbcr; 80 struct bcr_generic sbcr;
81 81
82 struct bcr_slc_cfg { 82 struct bcr_slc_cfg {
@@ -95,6 +95,15 @@ static void read_decode_cache_bcr_arcv2(int cpu)
95#endif 95#endif
96 } cbcr; 96 } cbcr;
97 97
98 struct bcr_volatile {
99#ifdef CONFIG_CPU_BIG_ENDIAN
100 unsigned int start:4, limit:4, pad:22, order:1, disable:1;
101#else
102 unsigned int disable:1, order:1, pad:22, limit:4, start:4;
103#endif
104 } vol;
105
106
98 READ_BCR(ARC_REG_SLC_BCR, sbcr); 107 READ_BCR(ARC_REG_SLC_BCR, sbcr);
99 if (sbcr.ver) { 108 if (sbcr.ver) {
100 READ_BCR(ARC_REG_SLC_CFG, slc_cfg); 109 READ_BCR(ARC_REG_SLC_CFG, slc_cfg);
@@ -107,10 +116,14 @@ static void read_decode_cache_bcr_arcv2(int cpu)
107 if (cbcr.c && ioc_enable) 116 if (cbcr.c && ioc_enable)
108 ioc_exists = 1; 117 ioc_exists = 1;
109 118
110 /* Legacy Data Uncached BCR is deprecated from v3 onwards */ 119 /* HS 2.0 didn't have AUX_VOL */
111 READ_BCR(ARC_REG_D_UNCACH_BCR, uncached_space); 120 if (cpuinfo_arc700[cpu].core.family > 0x51) {
112 if (uncached_space.ver > 2) 121 READ_BCR(AUX_VOL, vol);
113 perip_base = read_aux_reg(AUX_NON_VOL) & 0xF0000000; 122 perip_base = vol.start << 28;
123 /* HS 3.0 has limit and strict-ordering fields */
124 if (cpuinfo_arc700[cpu].core.family > 0x52)
125 perip_end = (vol.limit << 28) - 1;
126 }
114} 127}
115 128
116void read_decode_cache_bcr(void) 129void read_decode_cache_bcr(void)
diff --git a/arch/arc/mm/ioremap.c b/arch/arc/mm/ioremap.c
index f52b7db67fd3..9881bd740ccc 100644
--- a/arch/arc/mm/ioremap.c
+++ b/arch/arc/mm/ioremap.c
@@ -19,7 +19,7 @@ static inline bool arc_uncached_addr_space(phys_addr_t paddr)
19 if (is_isa_arcompact()) { 19 if (is_isa_arcompact()) {
20 if (paddr >= ARC_UNCACHED_ADDR_SPACE) 20 if (paddr >= ARC_UNCACHED_ADDR_SPACE)
21 return true; 21 return true;
22 } else if (paddr >= perip_base && paddr <= 0xFFFFFFFF) { 22 } else if (paddr >= perip_base && paddr <= perip_end) {
23 return true; 23 return true;
24 } 24 }
25 25