aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2017-09-21 20:46:38 -0400
committerVineet Gupta <vgupta@synopsys.com>2017-10-03 23:36:49 -0400
commit010a8c98884f4ca42a167c9b51470c624daa2932 (patch)
tree7ad8780e807cf953be4d31055394655b3b06868a
parentd9bc84a808572451f95fb1dde80cb8d12be05665 (diff)
ARC: boot log: decontaminate ARCv2 ISA_CONFIG register
ARCv2 ISA_CONFIG and ARC700_BUILD build config registers are not compatible. cpuinfo_arc had isa info placeholder which was mashup of bits form both. Untangle this by defining it off of ARCv2 ISA info and it is fine even for ARC700 since former is a super set of latter (ARC700 buildonly has 2 bits for atomics and stack check). At runtime, we treat ARCv2 ISA info as a generic placeholder but populate it correctly depending on ARC700 or HS. This paves way for adding more HS specific bits in isa info which was colliding with the extra bits for arc700. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r--arch/arc/include/asm/arcregs.h8
-rw-r--r--arch/arc/kernel/setup.c15
2 files changed, 15 insertions, 8 deletions
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index ba8e802dba80..b71d84873f7d 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -135,12 +135,12 @@ struct bcr_identity {
135#endif 135#endif
136}; 136};
137 137
138struct bcr_isa { 138struct bcr_isa_arcv2 {
139#ifdef CONFIG_CPU_BIG_ENDIAN 139#ifdef CONFIG_CPU_BIG_ENDIAN
140 unsigned int div_rem:4, pad2:4, ldd:1, unalign:1, atomic:1, be:1, 140 unsigned int div_rem:4, pad2:4, ldd:1, unalign:1, atomic:1, be:1,
141 pad1:11, atomic1:1, ver:8; 141 pad1:12, ver:8;
142#else 142#else
143 unsigned int ver:8, atomic1:1, pad1:11, be:1, atomic:1, unalign:1, 143 unsigned int ver:8, pad1:12, be:1, atomic:1, unalign:1,
144 ldd:1, pad2:4, div_rem:4; 144 ldd:1, pad2:4, div_rem:4;
145#endif 145#endif
146}; 146};
@@ -263,7 +263,7 @@ struct cpuinfo_arc {
263 struct cpuinfo_arc_mmu mmu; 263 struct cpuinfo_arc_mmu mmu;
264 struct cpuinfo_arc_bpu bpu; 264 struct cpuinfo_arc_bpu bpu;
265 struct bcr_identity core; 265 struct bcr_identity core;
266 struct bcr_isa isa; 266 struct bcr_isa_arcv2 isa;
267 const char *details, *name; 267 const char *details, *name;
268 unsigned int vec_base; 268 unsigned int vec_base;
269 struct cpuinfo_arc_ccm iccm, dccm; 269 struct cpuinfo_arc_ccm iccm, dccm;
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index 877cec8f5ea2..228593a964f8 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -119,11 +119,11 @@ static void read_arc_build_cfg_regs(void)
119 struct bcr_generic bcr; 119 struct bcr_generic bcr;
120 struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; 120 struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()];
121 const struct id_to_str *tbl; 121 const struct id_to_str *tbl;
122 struct bcr_isa_arcv2 isa;
122 123
123 FIX_PTR(cpu); 124 FIX_PTR(cpu);
124 125
125 READ_BCR(AUX_IDENTITY, cpu->core); 126 READ_BCR(AUX_IDENTITY, cpu->core);
126 READ_BCR(ARC_REG_ISA_CFG_BCR, cpu->isa);
127 127
128 for (tbl = &arc_cpu_rel[0]; tbl->id != 0; tbl++) { 128 for (tbl = &arc_cpu_rel[0]; tbl->id != 0; tbl++) {
129 if (cpu->core.family == tbl->id) { 129 if (cpu->core.family == tbl->id) {
@@ -205,18 +205,25 @@ static void read_arc_build_cfg_regs(void)
205 205
206 cpu->extn.debug = cpu->extn.ap | cpu->extn.smart | cpu->extn.rtt; 206 cpu->extn.debug = cpu->extn.ap | cpu->extn.smart | cpu->extn.rtt;
207 207
208 READ_BCR(ARC_REG_ISA_CFG_BCR, isa);
209
208 /* some hacks for lack of feature BCR info in old ARC700 cores */ 210 /* some hacks for lack of feature BCR info in old ARC700 cores */
209 if (is_isa_arcompact()) { 211 if (is_isa_arcompact()) {
210 if (!cpu->isa.ver) /* ISA BCR absent, use Kconfig info */ 212 if (!isa.ver) /* ISA BCR absent, use Kconfig info */
211 cpu->isa.atomic = IS_ENABLED(CONFIG_ARC_HAS_LLSC); 213 cpu->isa.atomic = IS_ENABLED(CONFIG_ARC_HAS_LLSC);
212 else 214 else {
213 cpu->isa.atomic = cpu->isa.atomic1; 215 /* ARC700_BUILD only has 2 bits of isa info */
216 struct bcr_generic bcr = *(struct bcr_generic *)&isa;
217 cpu->isa.atomic = bcr.info & 1;
218 }
214 219
215 cpu->isa.be = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN); 220 cpu->isa.be = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN);
216 221
217 /* there's no direct way to distinguish 750 vs. 770 */ 222 /* there's no direct way to distinguish 750 vs. 770 */
218 if (unlikely(cpu->core.family < 0x34 || cpu->mmu.ver < 3)) 223 if (unlikely(cpu->core.family < 0x34 || cpu->mmu.ver < 3))
219 cpu->name = "ARC750"; 224 cpu->name = "ARC750";
225 } else {
226 cpu->isa = isa;
220 } 227 }
221} 228}
222 229