aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2017-11-10 15:40:00 -0500
committerVineet Gupta <vgupta@synopsys.com>2017-11-13 17:37:39 -0500
commitf3156851616b4f3cb1d6c567fe46adcfd43ad8f8 (patch)
tree118a965ecaa09460f54c3de64e247db76d201b7f
parent92d44128241f8aa129cf2f3672786a1b52053510 (diff)
ARCv2: boot log: updates for HS48: dual-issue, ECC, Loop Buffer
Print the hardware support for ECC, Loop Buffer as well as the runtime enabled status Note that unlike the existing boot printing, this one is not read from pre-decoded hardware capabilty info cached in cpuinfo[] struct. Instead we read the AUX regs on the spot and print it, without botherign to save anywhere. There is no point in saving static hardware capabilites in memory when its use is very sporadic and non-performance critical, mainly for /proc/cpuinfo. This gets worse in SMP, given it is per-cpu, and pretty much exactly same across all cpus. So only info needed at runtime (e.g. TLB geometry) needs to be cached in cpuinfo[]. So going fwd we will start converting code to this paradigm. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r--arch/arc/include/asm/arcregs.h33
-rw-r--r--arch/arc/kernel/setup.c43
2 files changed, 71 insertions, 5 deletions
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index b1c56d35f2a9..49bfbd879caa 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -11,12 +11,14 @@
11 11
12/* Build Configuration Registers */ 12/* Build Configuration Registers */
13#define ARC_REG_AUX_DCCM 0x18 /* DCCM Base Addr ARCv2 */ 13#define ARC_REG_AUX_DCCM 0x18 /* DCCM Base Addr ARCv2 */
14#define ARC_REG_ERP_CTRL 0x3F /* ARCv2 Error protection control */
14#define ARC_REG_DCCM_BASE_BUILD 0x61 /* DCCM Base Addr ARCompact */ 15#define ARC_REG_DCCM_BASE_BUILD 0x61 /* DCCM Base Addr ARCompact */
15#define ARC_REG_CRC_BCR 0x62 16#define ARC_REG_CRC_BCR 0x62
16#define ARC_REG_VECBASE_BCR 0x68 17#define ARC_REG_VECBASE_BCR 0x68
17#define ARC_REG_PERIBASE_BCR 0x69 18#define ARC_REG_PERIBASE_BCR 0x69
18#define ARC_REG_FP_BCR 0x6B /* ARCompact: Single-Precision FPU */ 19#define ARC_REG_FP_BCR 0x6B /* ARCompact: Single-Precision FPU */
19#define ARC_REG_DPFP_BCR 0x6C /* ARCompact: Dbl Precision FPU */ 20#define ARC_REG_DPFP_BCR 0x6C /* ARCompact: Dbl Precision FPU */
21#define ARC_REG_ERP_BUILD 0xc7 /* ARCv2 Error protection Build: ECC/Parity */
20#define ARC_REG_FP_V2_BCR 0xc8 /* ARCv2 FPU */ 22#define ARC_REG_FP_V2_BCR 0xc8 /* ARCv2 FPU */
21#define ARC_REG_SLC_BCR 0xce 23#define ARC_REG_SLC_BCR 0xce
22#define ARC_REG_DCCM_BUILD 0x74 /* DCCM size (common) */ 24#define ARC_REG_DCCM_BUILD 0x74 /* DCCM size (common) */
@@ -32,11 +34,14 @@
32#define ARC_REG_D_UNCACH_BCR 0x6A 34#define ARC_REG_D_UNCACH_BCR 0x6A
33#define ARC_REG_BPU_BCR 0xc0 35#define ARC_REG_BPU_BCR 0xc0
34#define ARC_REG_ISA_CFG_BCR 0xc1 36#define ARC_REG_ISA_CFG_BCR 0xc1
37#define ARC_REG_LPB_BUILD 0xE9 /* ARCv2 Loop Buffer Build */
35#define ARC_REG_RTT_BCR 0xF2 38#define ARC_REG_RTT_BCR 0xF2
36#define ARC_REG_IRQ_BCR 0xF3 39#define ARC_REG_IRQ_BCR 0xF3
40#define ARC_REG_MICRO_ARCH_BCR 0xF9 /* ARCv2 Product revision */
37#define ARC_REG_SMART_BCR 0xFF 41#define ARC_REG_SMART_BCR 0xFF
38#define ARC_REG_CLUSTER_BCR 0xcf 42#define ARC_REG_CLUSTER_BCR 0xcf
39#define ARC_REG_AUX_ICCM 0x208 /* ICCM Base Addr (ARCv2) */ 43#define ARC_REG_AUX_ICCM 0x208 /* ICCM Base Addr (ARCv2) */
44#define ARC_REG_LPB_CTRL 0x488 /* ARCv2 Loop Buffer control */
40 45
41/* Common for ARCompact and ARCv2 status register */ 46/* Common for ARCompact and ARCv2 status register */
42#define ARC_REG_STATUS32 0x0A 47#define ARC_REG_STATUS32 0x0A
@@ -229,6 +234,32 @@ struct bcr_bpu_arcv2 {
229#endif 234#endif
230}; 235};
231 236
237/* Error Protection Build: ECC/Parity */
238struct bcr_erp {
239#ifdef CONFIG_CPU_BIG_ENDIAN
240 unsigned int pad3:5, mmu:3, pad2:4, ic:3, dc:3, pad1:6, ver:8;
241#else
242 unsigned int ver:8, pad1:6, dc:3, ic:3, pad2:4, mmu:3, pad3:5;
243#endif
244};
245
246/* Error Protection Control */
247struct ctl_erp {
248#ifdef CONFIG_CPU_BIG_ENDIAN
249 unsigned int pad2:27, mpd:1, pad1:2, dpd:1, dpi:1;
250#else
251 unsigned int dpi:1, dpd:1, pad1:2, mpd:1, pad2:27;
252#endif
253};
254
255struct bcr_lpb {
256#ifdef CONFIG_CPU_BIG_ENDIAN
257 unsigned int pad:16, entries:8, ver:8;
258#else
259 unsigned int ver:8, entries:8, pad:16;
260#endif
261};
262
232struct bcr_generic { 263struct bcr_generic {
233#ifdef CONFIG_CPU_BIG_ENDIAN 264#ifdef CONFIG_CPU_BIG_ENDIAN
234 unsigned int info:24, ver:8; 265 unsigned int info:24, ver:8;
@@ -270,7 +301,7 @@ struct cpuinfo_arc {
270 struct cpuinfo_arc_ccm iccm, dccm; 301 struct cpuinfo_arc_ccm iccm, dccm;
271 struct { 302 struct {
272 unsigned int swap:1, norm:1, minmax:1, barrel:1, crc:1, swape:1, pad1:2, 303 unsigned int swap:1, norm:1, minmax:1, barrel:1, crc:1, swape:1, pad1:2,
273 fpu_sp:1, fpu_dp:1, dual_iss_enb:1, dual_iss_exist:1, pad2:4, 304 fpu_sp:1, fpu_dp:1, dual:1, dual_enb:1, pad2:4,
274 debug:1, ap:1, smart:1, rtt:1, pad3:4, 305 debug:1, ap:1, smart:1, rtt:1, pad3:4,
275 timer0:1, timer1:1, rtc:1, gfrc:1, pad4:4; 306 timer0:1, timer1:1, rtc:1, gfrc:1, pad4:4;
276 } extn; 307 } extn;
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index fb83844daeea..7ef7d9a8ff89 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -199,8 +199,10 @@ static void read_arc_build_cfg_regs(void)
199 unsigned int exec_ctrl; 199 unsigned int exec_ctrl;
200 200
201 READ_BCR(AUX_EXEC_CTRL, exec_ctrl); 201 READ_BCR(AUX_EXEC_CTRL, exec_ctrl);
202 cpu->extn.dual_iss_exist = 1; 202 cpu->extn.dual_enb = exec_ctrl & 1;
203 cpu->extn.dual_iss_enb = exec_ctrl & 1; 203
204 /* dual issue always present for this core */
205 cpu->extn.dual = 1;
204 } 206 }
205 } 207 }
206 208
@@ -253,7 +255,7 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
253 cpu_id, cpu->name, cpu->details, 255 cpu_id, cpu->name, cpu->details,
254 is_isa_arcompact() ? "ARCompact" : "ARCv2", 256 is_isa_arcompact() ? "ARCompact" : "ARCv2",
255 IS_AVAIL1(cpu->isa.be, "[Big-Endian]"), 257 IS_AVAIL1(cpu->isa.be, "[Big-Endian]"),
256 IS_AVAIL3(cpu->extn.dual_iss_exist, cpu->extn.dual_iss_enb, " Dual-Issue")); 258 IS_AVAIL3(cpu->extn.dual, cpu->extn.dual_enb, " Dual-Issue "));
257 259
258 n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s%s%s\nISA Extn\t: ", 260 n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s%s%s\nISA Extn\t: ",
259 IS_AVAIL1(cpu->extn.timer0, "Timer0 "), 261 IS_AVAIL1(cpu->extn.timer0, "Timer0 "),
@@ -293,11 +295,26 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
293 295
294 if (cpu->bpu.ver) 296 if (cpu->bpu.ver)
295 n += scnprintf(buf + n, len - n, 297 n += scnprintf(buf + n, len - n,
296 "BPU\t\t: %s%s match, cache:%d, Predict Table:%d\n", 298 "BPU\t\t: %s%s match, cache:%d, Predict Table:%d",
297 IS_AVAIL1(cpu->bpu.full, "full"), 299 IS_AVAIL1(cpu->bpu.full, "full"),
298 IS_AVAIL1(!cpu->bpu.full, "partial"), 300 IS_AVAIL1(!cpu->bpu.full, "partial"),
299 cpu->bpu.num_cache, cpu->bpu.num_pred); 301 cpu->bpu.num_cache, cpu->bpu.num_pred);
300 302
303 if (is_isa_arcv2()) {
304 struct bcr_lpb lpb;
305
306 READ_BCR(ARC_REG_LPB_BUILD, lpb);
307 if (lpb.ver) {
308 unsigned int ctl;
309 ctl = read_aux_reg(ARC_REG_LPB_CTRL);
310
311 n += scnprintf(buf + n, len - n, " Loop Buffer:%d %s",
312 lpb.entries,
313 IS_DISABLED_RUN(!ctl));
314 }
315 }
316
317 n += scnprintf(buf + n, len - n, "\n");
301 return buf; 318 return buf;
302} 319}
303 320
@@ -326,6 +343,24 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len)
326 cpu->dccm.base_addr, TO_KB(cpu->dccm.sz), 343 cpu->dccm.base_addr, TO_KB(cpu->dccm.sz),
327 cpu->iccm.base_addr, TO_KB(cpu->iccm.sz)); 344 cpu->iccm.base_addr, TO_KB(cpu->iccm.sz));
328 345
346 if (is_isa_arcv2()) {
347
348 /* Error Protection: ECC/Parity */
349 struct bcr_erp erp;
350 READ_BCR(ARC_REG_ERP_BUILD, erp);
351
352 if (erp.ver) {
353 struct ctl_erp ctl;
354 READ_BCR(ARC_REG_ERP_CTRL, ctl);
355
356 /* inverted bits: 0 means enabled */
357 n += scnprintf(buf + n, len - n, "Extn [ECC]\t: %s%s%s%s%s%s\n",
358 IS_AVAIL3(erp.ic, !ctl.dpi, "IC "),
359 IS_AVAIL3(erp.dc, !ctl.dpd, "DC "),
360 IS_AVAIL3(erp.mmu, !ctl.mpd, "MMU "));
361 }
362 }
363
329 n += scnprintf(buf + n, len - n, "OS ABI [v%d]\t: %s\n", 364 n += scnprintf(buf + n, len - n, "OS ABI [v%d]\t: %s\n",
330 EF_ARC_OSABI_CURRENT >> 8, 365 EF_ARC_OSABI_CURRENT >> 8,
331 EF_ARC_OSABI_CURRENT == EF_ARC_OSABI_V3 ? 366 EF_ARC_OSABI_CURRENT == EF_ARC_OSABI_V3 ?