diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2014-09-25 07:24:43 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2014-10-13 05:16:22 -0400 |
commit | 56372082533afb859e6d64707859349a2ee171bf (patch) | |
tree | 57a04e8e617e36ce3f62b963c8b5578a7dbad0a5 /arch/arc | |
parent | c4b9856b5e1eb6d4f0d226f3c48be208475fc3d7 (diff) |
ARC: boot: cpu feature print enhancements
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/include/asm/arcregs.h | 77 | ||||
-rw-r--r-- | arch/arc/kernel/perf_event.c | 22 | ||||
-rw-r--r-- | arch/arc/kernel/setup.c | 207 | ||||
-rw-r--r-- | arch/arc/mm/tlb.c | 8 |
4 files changed, 176 insertions, 138 deletions
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h index 3ea5b437bfb9..be33db8a2ee3 100644 --- a/arch/arc/include/asm/arcregs.h +++ b/arch/arc/include/asm/arcregs.h | |||
@@ -12,14 +12,13 @@ | |||
12 | /* Build Configuration Registers */ | 12 | /* Build Configuration Registers */ |
13 | #define ARC_REG_DCCMBASE_BCR 0x61 /* DCCM Base Addr */ | 13 | #define ARC_REG_DCCMBASE_BCR 0x61 /* DCCM Base Addr */ |
14 | #define ARC_REG_CRC_BCR 0x62 | 14 | #define ARC_REG_CRC_BCR 0x62 |
15 | #define ARC_REG_DVFB_BCR 0x64 | ||
16 | #define ARC_REG_EXTARITH_BCR 0x65 | ||
17 | #define ARC_REG_VECBASE_BCR 0x68 | 15 | #define ARC_REG_VECBASE_BCR 0x68 |
18 | #define ARC_REG_PERIBASE_BCR 0x69 | 16 | #define ARC_REG_PERIBASE_BCR 0x69 |
19 | #define ARC_REG_FP_BCR 0x6B /* Single-Precision FPU */ | 17 | #define ARC_REG_FP_BCR 0x6B /* ARCompact: Single-Precision FPU */ |
20 | #define ARC_REG_DPFP_BCR 0x6C /* Dbl Precision FPU */ | 18 | #define ARC_REG_DPFP_BCR 0x6C /* ARCompact: Dbl Precision FPU */ |
21 | #define ARC_REG_DCCM_BCR 0x74 /* DCCM Present + SZ */ | 19 | #define ARC_REG_DCCM_BCR 0x74 /* DCCM Present + SZ */ |
22 | #define ARC_REG_TIMERS_BCR 0x75 | 20 | #define ARC_REG_TIMERS_BCR 0x75 |
21 | #define ARC_REG_AP_BCR 0x76 | ||
23 | #define ARC_REG_ICCM_BCR 0x78 | 22 | #define ARC_REG_ICCM_BCR 0x78 |
24 | #define ARC_REG_XY_MEM_BCR 0x79 | 23 | #define ARC_REG_XY_MEM_BCR 0x79 |
25 | #define ARC_REG_MAC_BCR 0x7a | 24 | #define ARC_REG_MAC_BCR 0x7a |
@@ -29,6 +28,9 @@ | |||
29 | #define ARC_REG_MIXMAX_BCR 0x7e | 28 | #define ARC_REG_MIXMAX_BCR 0x7e |
30 | #define ARC_REG_BARREL_BCR 0x7f | 29 | #define ARC_REG_BARREL_BCR 0x7f |
31 | #define ARC_REG_D_UNCACH_BCR 0x6A | 30 | #define ARC_REG_D_UNCACH_BCR 0x6A |
31 | #define ARC_REG_BPU_BCR 0xc0 | ||
32 | #define ARC_REG_ISA_CFG_BCR 0xc1 | ||
33 | #define ARC_REG_SMART_BCR 0xFF | ||
32 | 34 | ||
33 | /* status32 Bits Positions */ | 35 | /* status32 Bits Positions */ |
34 | #define STATUS_AE_BIT 5 /* Exception active */ | 36 | #define STATUS_AE_BIT 5 /* Exception active */ |
@@ -202,27 +204,19 @@ struct bcr_identity { | |||
202 | #endif | 204 | #endif |
203 | }; | 205 | }; |
204 | 206 | ||
205 | #define EXTN_SWAP_VALID 0x1 | 207 | struct bcr_isa { |
206 | #define EXTN_NORM_VALID 0x2 | ||
207 | #define EXTN_MINMAX_VALID 0x2 | ||
208 | #define EXTN_BARREL_VALID 0x2 | ||
209 | |||
210 | struct bcr_extn { | ||
211 | #ifdef CONFIG_CPU_BIG_ENDIAN | 208 | #ifdef CONFIG_CPU_BIG_ENDIAN |
212 | unsigned int pad:20, crc:1, ext_arith:2, mul:2, barrel:2, minmax:2, | 209 | unsigned int pad1:23, atomic1:1, ver:8; |
213 | norm:2, swap:1; | ||
214 | #else | 210 | #else |
215 | unsigned int swap:1, norm:2, minmax:2, barrel:2, mul:2, ext_arith:2, | 211 | unsigned int ver:8, atomic1:1, pad1:23; |
216 | crc:1, pad:20; | ||
217 | #endif | 212 | #endif |
218 | }; | 213 | }; |
219 | 214 | ||
220 | /* DSP Options Ref Manual */ | 215 | struct bcr_mpy { |
221 | struct bcr_extn_mac_mul { | ||
222 | #ifdef CONFIG_CPU_BIG_ENDIAN | 216 | #ifdef CONFIG_CPU_BIG_ENDIAN |
223 | unsigned int pad:16, type:8, ver:8; | 217 | unsigned int pad:8, x1616:8, dsp:4, cycles:2, type:2, ver:8; |
224 | #else | 218 | #else |
225 | unsigned int ver:8, type:8, pad:16; | 219 | unsigned int ver:8, type:2, cycles:2, dsp:4, x1616:8, pad:8; |
226 | #endif | 220 | #endif |
227 | }; | 221 | }; |
228 | 222 | ||
@@ -241,6 +235,7 @@ struct bcr_perip { | |||
241 | unsigned int pad:8, sz:8, pad2:8, start:8; | 235 | unsigned int pad:8, sz:8, pad2:8, start:8; |
242 | #endif | 236 | #endif |
243 | }; | 237 | }; |
238 | |||
244 | struct bcr_iccm { | 239 | struct bcr_iccm { |
245 | #ifdef CONFIG_CPU_BIG_ENDIAN | 240 | #ifdef CONFIG_CPU_BIG_ENDIAN |
246 | unsigned int base:16, pad:5, sz:3, ver:8; | 241 | unsigned int base:16, pad:5, sz:3, ver:8; |
@@ -267,8 +262,8 @@ struct bcr_dccm { | |||
267 | #endif | 262 | #endif |
268 | }; | 263 | }; |
269 | 264 | ||
270 | /* Both SP and DP FPU BCRs have same format */ | 265 | /* ARCompact: Both SP and DP FPU BCRs have same format */ |
271 | struct bcr_fp { | 266 | struct bcr_fp_arcompact { |
272 | #ifdef CONFIG_CPU_BIG_ENDIAN | 267 | #ifdef CONFIG_CPU_BIG_ENDIAN |
273 | unsigned int fast:1, ver:8; | 268 | unsigned int fast:1, ver:8; |
274 | #else | 269 | #else |
@@ -276,6 +271,30 @@ struct bcr_fp { | |||
276 | #endif | 271 | #endif |
277 | }; | 272 | }; |
278 | 273 | ||
274 | struct bcr_timer { | ||
275 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
276 | unsigned int pad2:15, rtsc:1, pad1:6, t1:1, t0:1, ver:8; | ||
277 | #else | ||
278 | unsigned int ver:8, t0:1, t1:1, pad1:6, rtsc:1, pad2:15; | ||
279 | #endif | ||
280 | }; | ||
281 | |||
282 | struct bcr_bpu_arcompact { | ||
283 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
284 | unsigned int pad2:19, fam:1, pad:2, ent:2, ver:8; | ||
285 | #else | ||
286 | unsigned int ver:8, ent:2, pad:2, fam:1, pad2:19; | ||
287 | #endif | ||
288 | }; | ||
289 | |||
290 | struct bcr_generic { | ||
291 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
292 | unsigned int pad:24, ver:8; | ||
293 | #else | ||
294 | unsigned int ver:8, pad:24; | ||
295 | #endif | ||
296 | }; | ||
297 | |||
279 | /* | 298 | /* |
280 | ******************************************************************* | 299 | ******************************************************************* |
281 | * Generic structures to hold build configuration used at runtime | 300 | * Generic structures to hold build configuration used at runtime |
@@ -289,6 +308,10 @@ struct cpuinfo_arc_cache { | |||
289 | unsigned int sz_k:8, line_len:8, assoc:4, ver:4, alias:1, vipt:1, pad:6; | 308 | unsigned int sz_k:8, line_len:8, assoc:4, ver:4, alias:1, vipt:1, pad:6; |
290 | }; | 309 | }; |
291 | 310 | ||
311 | struct cpuinfo_arc_bpu { | ||
312 | unsigned int ver, full, num_cache, num_pred; | ||
313 | }; | ||
314 | |||
292 | struct cpuinfo_arc_ccm { | 315 | struct cpuinfo_arc_ccm { |
293 | unsigned int base_addr, sz; | 316 | unsigned int base_addr, sz; |
294 | }; | 317 | }; |
@@ -296,15 +319,21 @@ struct cpuinfo_arc_ccm { | |||
296 | struct cpuinfo_arc { | 319 | struct cpuinfo_arc { |
297 | struct cpuinfo_arc_cache icache, dcache; | 320 | struct cpuinfo_arc_cache icache, dcache; |
298 | struct cpuinfo_arc_mmu mmu; | 321 | struct cpuinfo_arc_mmu mmu; |
322 | struct cpuinfo_arc_bpu bpu; | ||
299 | struct bcr_identity core; | 323 | struct bcr_identity core; |
300 | unsigned int timers; | 324 | struct bcr_isa isa; |
325 | struct bcr_timer timers; | ||
301 | unsigned int vec_base; | 326 | unsigned int vec_base; |
302 | unsigned int uncached_base; | 327 | unsigned int uncached_base; |
303 | struct cpuinfo_arc_ccm iccm, dccm; | 328 | struct cpuinfo_arc_ccm iccm, dccm; |
304 | struct bcr_extn extn; | 329 | struct { |
330 | unsigned int swap:1, norm:1, minmax:1, barrel:1, crc:1, pad1:3, | ||
331 | fpu_sp:1, fpu_dp:1, pad2:6, | ||
332 | debug:1, ap:1, smart:1, rtt:1, pad3:4, | ||
333 | pad4:8; | ||
334 | } extn; | ||
335 | struct bcr_mpy extn_mpy; | ||
305 | struct bcr_extn_xymem extn_xymem; | 336 | struct bcr_extn_xymem extn_xymem; |
306 | struct bcr_extn_mac_mul extn_mac_mul; | ||
307 | struct bcr_fp fp, dpfp; | ||
308 | }; | 337 | }; |
309 | 338 | ||
310 | extern struct cpuinfo_arc cpuinfo_arc700[]; | 339 | extern struct cpuinfo_arc cpuinfo_arc700[]; |
diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c index b9a5685a990e..ae1c485cbc68 100644 --- a/arch/arc/kernel/perf_event.c +++ b/arch/arc/kernel/perf_event.c | |||
@@ -244,25 +244,23 @@ static int arc_pmu_device_probe(struct platform_device *pdev) | |||
244 | pr_err("This core does not have performance counters!\n"); | 244 | pr_err("This core does not have performance counters!\n"); |
245 | return -ENODEV; | 245 | return -ENODEV; |
246 | } | 246 | } |
247 | BUG_ON(pct_bcr.c > ARC_PMU_MAX_HWEVENTS); | ||
247 | 248 | ||
248 | arc_pmu = devm_kzalloc(&pdev->dev, sizeof(struct arc_pmu), | 249 | READ_BCR(ARC_REG_CC_BUILD, cc_bcr); |
249 | GFP_KERNEL); | 250 | if (!cc_bcr.v) { |
251 | pr_err("Performance counters exist, but no countable conditions?\n"); | ||
252 | return -ENODEV; | ||
253 | } | ||
254 | |||
255 | arc_pmu = devm_kzalloc(&pdev->dev, sizeof(struct arc_pmu), GFP_KERNEL); | ||
250 | if (!arc_pmu) | 256 | if (!arc_pmu) |
251 | return -ENOMEM; | 257 | return -ENOMEM; |
252 | 258 | ||
253 | arc_pmu->n_counters = pct_bcr.c; | 259 | arc_pmu->n_counters = pct_bcr.c; |
254 | BUG_ON(arc_pmu->n_counters > ARC_PMU_MAX_HWEVENTS); | ||
255 | |||
256 | arc_pmu->counter_size = 32 + (pct_bcr.s << 4); | 260 | arc_pmu->counter_size = 32 + (pct_bcr.s << 4); |
257 | pr_info("ARC PMU found with %d counters of size %d bits\n", | ||
258 | arc_pmu->n_counters, arc_pmu->counter_size); | ||
259 | |||
260 | READ_BCR(ARC_REG_CC_BUILD, cc_bcr); | ||
261 | |||
262 | if (!cc_bcr.v) | ||
263 | pr_err("Strange! Performance counters exist, but no countable conditions?\n"); | ||
264 | 261 | ||
265 | pr_info("ARC PMU has %d countable conditions\n", cc_bcr.c); | 262 | pr_info("ARC perf\t: %d counters (%d bits), %d countable conditions\n", |
263 | arc_pmu->n_counters, arc_pmu->counter_size, cc_bcr.c); | ||
266 | 264 | ||
267 | cc_name.str[8] = 0; | 265 | cc_name.str[8] = 0; |
268 | for (i = 0; i < PERF_COUNT_HW_MAX; i++) | 266 | for (i = 0; i < PERF_COUNT_HW_MAX; i++) |
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 5a10b63e2283..252bf603db9c 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c | |||
@@ -43,26 +43,26 @@ struct cpuinfo_arc cpuinfo_arc700[NR_CPUS]; | |||
43 | static void read_arc_build_cfg_regs(void) | 43 | static void read_arc_build_cfg_regs(void) |
44 | { | 44 | { |
45 | struct bcr_perip uncached_space; | 45 | struct bcr_perip uncached_space; |
46 | struct bcr_generic bcr; | ||
46 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; | 47 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; |
47 | FIX_PTR(cpu); | 48 | FIX_PTR(cpu); |
48 | 49 | ||
49 | READ_BCR(AUX_IDENTITY, cpu->core); | 50 | READ_BCR(AUX_IDENTITY, cpu->core); |
51 | READ_BCR(ARC_REG_ISA_CFG_BCR, cpu->isa); | ||
50 | 52 | ||
51 | cpu->timers = read_aux_reg(ARC_REG_TIMERS_BCR); | 53 | READ_BCR(ARC_REG_TIMERS_BCR, cpu->timers); |
52 | cpu->vec_base = read_aux_reg(AUX_INTR_VEC_BASE); | 54 | cpu->vec_base = read_aux_reg(AUX_INTR_VEC_BASE); |
53 | 55 | ||
54 | READ_BCR(ARC_REG_D_UNCACH_BCR, uncached_space); | 56 | READ_BCR(ARC_REG_D_UNCACH_BCR, uncached_space); |
55 | cpu->uncached_base = uncached_space.start << 24; | 57 | cpu->uncached_base = uncached_space.start << 24; |
56 | 58 | ||
57 | cpu->extn.mul = read_aux_reg(ARC_REG_MUL_BCR); | 59 | READ_BCR(ARC_REG_MUL_BCR, cpu->extn_mpy); |
58 | cpu->extn.swap = read_aux_reg(ARC_REG_SWAP_BCR); | ||
59 | cpu->extn.norm = read_aux_reg(ARC_REG_NORM_BCR); | ||
60 | cpu->extn.minmax = read_aux_reg(ARC_REG_MIXMAX_BCR); | ||
61 | cpu->extn.barrel = read_aux_reg(ARC_REG_BARREL_BCR); | ||
62 | READ_BCR(ARC_REG_MAC_BCR, cpu->extn_mac_mul); | ||
63 | 60 | ||
64 | cpu->extn.ext_arith = read_aux_reg(ARC_REG_EXTARITH_BCR); | 61 | cpu->extn.norm = read_aux_reg(ARC_REG_NORM_BCR) > 1 ? 1 : 0; /* 2,3 */ |
65 | cpu->extn.crc = read_aux_reg(ARC_REG_CRC_BCR); | 62 | cpu->extn.barrel = read_aux_reg(ARC_REG_BARREL_BCR) > 1 ? 1 : 0; /* 2,3 */ |
63 | cpu->extn.swap = read_aux_reg(ARC_REG_SWAP_BCR) ? 1 : 0; /* 1,3 */ | ||
64 | cpu->extn.crc = read_aux_reg(ARC_REG_CRC_BCR) ? 1 : 0; | ||
65 | cpu->extn.minmax = read_aux_reg(ARC_REG_MIXMAX_BCR) > 1 ? 1 : 0; /* 2 */ | ||
66 | 66 | ||
67 | /* Note that we read the CCM BCRs independent of kernel config | 67 | /* Note that we read the CCM BCRs independent of kernel config |
68 | * This is to catch the cases where user doesn't know that | 68 | * This is to catch the cases where user doesn't know that |
@@ -96,43 +96,76 @@ static void read_arc_build_cfg_regs(void) | |||
96 | read_decode_mmu_bcr(); | 96 | read_decode_mmu_bcr(); |
97 | read_decode_cache_bcr(); | 97 | read_decode_cache_bcr(); |
98 | 98 | ||
99 | READ_BCR(ARC_REG_FP_BCR, cpu->fp); | 99 | { |
100 | READ_BCR(ARC_REG_DPFP_BCR, cpu->dpfp); | 100 | struct bcr_fp_arcompact sp, dp; |
101 | struct bcr_bpu_arcompact bpu; | ||
102 | |||
103 | READ_BCR(ARC_REG_FP_BCR, sp); | ||
104 | READ_BCR(ARC_REG_DPFP_BCR, dp); | ||
105 | cpu->extn.fpu_sp = sp.ver ? 1 : 0; | ||
106 | cpu->extn.fpu_dp = dp.ver ? 1 : 0; | ||
107 | |||
108 | READ_BCR(ARC_REG_BPU_BCR, bpu); | ||
109 | cpu->bpu.ver = bpu.ver; | ||
110 | cpu->bpu.full = bpu.fam ? 1 : 0; | ||
111 | if (bpu.ent) { | ||
112 | cpu->bpu.num_cache = 256 << (bpu.ent - 1); | ||
113 | cpu->bpu.num_pred = 256 << (bpu.ent - 1); | ||
114 | } | ||
115 | } | ||
116 | |||
117 | READ_BCR(ARC_REG_AP_BCR, bcr); | ||
118 | cpu->extn.ap = bcr.ver ? 1 : 0; | ||
119 | |||
120 | READ_BCR(ARC_REG_SMART_BCR, bcr); | ||
121 | cpu->extn.smart = bcr.ver ? 1 : 0; | ||
122 | |||
123 | cpu->extn.debug = cpu->extn.ap | cpu->extn.smart; | ||
101 | } | 124 | } |
102 | 125 | ||
103 | static const struct cpuinfo_data arc_cpu_tbl[] = { | 126 | static const struct cpuinfo_data arc_cpu_tbl[] = { |
104 | { {0x10, "ARCTangent A5"}, 0x1F}, | ||
105 | { {0x20, "ARC 600" }, 0x2F}, | 127 | { {0x20, "ARC 600" }, 0x2F}, |
106 | { {0x30, "ARC 700" }, 0x33}, | 128 | { {0x30, "ARC 700" }, 0x33}, |
107 | { {0x34, "ARC 700 R4.10"}, 0x34}, | 129 | { {0x34, "ARC 700 R4.10"}, 0x34}, |
130 | { {0x35, "ARC 700 R4.11"}, 0x35}, | ||
108 | { {0x00, NULL } } | 131 | { {0x00, NULL } } |
109 | }; | 132 | }; |
110 | 133 | ||
134 | #define IS_AVAIL1(v, str) ((v) ? str : "") | ||
135 | #define IS_USED(cfg) (IS_ENABLED(cfg) ? "" : "(not used) ") | ||
136 | #define IS_AVAIL2(v, str, cfg) IS_AVAIL1(v, str), IS_AVAIL1(v, IS_USED(cfg)) | ||
137 | |||
111 | static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) | 138 | static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) |
112 | { | 139 | { |
113 | int n = 0; | ||
114 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id]; | 140 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id]; |
115 | struct bcr_identity *core = &cpu->core; | 141 | struct bcr_identity *core = &cpu->core; |
116 | const struct cpuinfo_data *tbl; | 142 | const struct cpuinfo_data *tbl; |
117 | int be = 0; | 143 | char *isa_nm; |
118 | #ifdef CONFIG_CPU_BIG_ENDIAN | 144 | int i, be, atomic; |
119 | be = 1; | 145 | int n = 0; |
120 | #endif | 146 | |
121 | FIX_PTR(cpu); | 147 | FIX_PTR(cpu); |
122 | 148 | ||
149 | { | ||
150 | isa_nm = "ARCompact"; | ||
151 | be = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN); | ||
152 | |||
153 | atomic = cpu->isa.atomic1; | ||
154 | if (!cpu->isa.ver) /* ISA BCR absent, use Kconfig info */ | ||
155 | atomic = IS_ENABLED(CONFIG_ARC_HAS_LLSC); | ||
156 | } | ||
157 | |||
123 | n += scnprintf(buf + n, len - n, | 158 | n += scnprintf(buf + n, len - n, |
124 | "\nARC IDENTITY\t: Family [%#02x]" | 159 | "\nIDENTITY\t: ARCVER [%#02x] ARCNUM [%#02x] CHIPID [%#4x]\n", |
125 | " Cpu-id [%#02x] Chip-id [%#4x]\n", | 160 | core->family, core->cpu_id, core->chip_id); |
126 | core->family, core->cpu_id, | ||
127 | core->chip_id); | ||
128 | 161 | ||
129 | for (tbl = &arc_cpu_tbl[0]; tbl->info.id != 0; tbl++) { | 162 | for (tbl = &arc_cpu_tbl[0]; tbl->info.id != 0; tbl++) { |
130 | if ((core->family >= tbl->info.id) && | 163 | if ((core->family >= tbl->info.id) && |
131 | (core->family <= tbl->up_range)) { | 164 | (core->family <= tbl->up_range)) { |
132 | n += scnprintf(buf + n, len - n, | 165 | n += scnprintf(buf + n, len - n, |
133 | "processor\t: %s %s\n", | 166 | "processor [%d]\t: %s (%s ISA) %s\n", |
134 | tbl->info.str, | 167 | cpu_id, tbl->info.str, isa_nm, |
135 | be ? "[Big Endian]" : ""); | 168 | IS_AVAIL1(be, "[Big-Endian]")); |
136 | break; | 169 | break; |
137 | } | 170 | } |
138 | } | 171 | } |
@@ -144,34 +177,35 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) | |||
144 | (unsigned int)(arc_get_core_freq() / 1000000), | 177 | (unsigned int)(arc_get_core_freq() / 1000000), |
145 | (unsigned int)(arc_get_core_freq() / 10000) % 100); | 178 | (unsigned int)(arc_get_core_freq() / 10000) % 100); |
146 | 179 | ||
147 | n += scnprintf(buf + n, len - n, "Timers\t\t: %s %s\n", | 180 | n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s\nISA Extn\t: ", |
148 | (cpu->timers & 0x200) ? "TIMER1" : "", | 181 | IS_AVAIL1(cpu->timers.t0, "Timer0 "), |
149 | (cpu->timers & 0x100) ? "TIMER0" : ""); | 182 | IS_AVAIL1(cpu->timers.t1, "Timer1 "), |
183 | IS_AVAIL2(cpu->timers.rtsc, "64-bit RTSC ", CONFIG_ARC_HAS_RTSC)); | ||
150 | 184 | ||
151 | n += scnprintf(buf + n, len - n, "Vect Tbl Base\t: %#x\n", | 185 | n += i = scnprintf(buf + n, len - n, "%s%s", |
152 | cpu->vec_base); | 186 | IS_AVAIL2(atomic, "atomic ", CONFIG_ARC_HAS_LLSC)); |
153 | 187 | ||
154 | n += scnprintf(buf + n, len - n, "UNCACHED Base\t: %#x\n", | 188 | if (i) |
155 | cpu->uncached_base); | 189 | n += scnprintf(buf + n, len - n, "\n\t\t: "); |
156 | 190 | ||
157 | return buf; | 191 | n += scnprintf(buf + n, len - n, "%s%s%s%s%s%s%s%s\n", |
158 | } | 192 | IS_AVAIL1(cpu->extn_mpy.ver, "mpy "), |
193 | IS_AVAIL1(cpu->extn.norm, "norm "), | ||
194 | IS_AVAIL1(cpu->extn.barrel, "barrel-shift "), | ||
195 | IS_AVAIL1(cpu->extn.swap, "swap "), | ||
196 | IS_AVAIL1(cpu->extn.minmax, "minmax "), | ||
197 | IS_AVAIL1(cpu->extn.crc, "crc "), | ||
198 | IS_AVAIL2(1, "swape", CONFIG_ARC_HAS_SWAPE)); | ||
159 | 199 | ||
160 | static const struct id_to_str mul_type_nm[] = { | 200 | if (cpu->bpu.ver) |
161 | { 0x0, "N/A"}, | 201 | n += scnprintf(buf + n, len - n, |
162 | { 0x1, "32x32 (spl Result Reg)" }, | 202 | "BPU\t\t: %s%s match, cache:%d, Predict Table:%d\n", |
163 | { 0x2, "32x32 (ANY Result Reg)" } | 203 | IS_AVAIL1(cpu->bpu.full, "full"), |
164 | }; | 204 | IS_AVAIL1(!cpu->bpu.full, "partial"), |
205 | cpu->bpu.num_cache, cpu->bpu.num_pred); | ||
165 | 206 | ||
166 | static const struct id_to_str mac_mul_nm[] = { | 207 | return buf; |
167 | {0x0, "N/A"}, | 208 | } |
168 | {0x1, "N/A"}, | ||
169 | {0x2, "Dual 16 x 16"}, | ||
170 | {0x3, "N/A"}, | ||
171 | {0x4, "32x16"}, | ||
172 | {0x5, "N/A"}, | ||
173 | {0x6, "Dual 16x16 and 32x16"} | ||
174 | }; | ||
175 | 209 | ||
176 | static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len) | 210 | static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len) |
177 | { | 211 | { |
@@ -179,57 +213,27 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len) | |||
179 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id]; | 213 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id]; |
180 | 214 | ||
181 | FIX_PTR(cpu); | 215 | FIX_PTR(cpu); |
182 | #define IS_AVAIL1(var, str) ((var) ? str : "") | ||
183 | #define IS_AVAIL2(var, str) ((var == 0x2) ? str : "") | ||
184 | #define IS_USED(cfg) (IS_ENABLED(cfg) ? "(in-use)" : "(not used)") | ||
185 | 216 | ||
186 | n += scnprintf(buf + n, len - n, | 217 | n += scnprintf(buf + n, len - n, |
187 | "Extn [700-Base]\t: %s %s %s %s %s %s\n", | 218 | "Vector Table\t: %#x\nUncached Base\t: %#x\n", |
188 | IS_AVAIL2(cpu->extn.norm, "norm,"), | 219 | cpu->vec_base, cpu->uncached_base); |
189 | IS_AVAIL2(cpu->extn.barrel, "barrel-shift,"), | 220 | |
190 | IS_AVAIL1(cpu->extn.swap, "swap,"), | 221 | if (cpu->extn.fpu_sp || cpu->extn.fpu_dp) |
191 | IS_AVAIL2(cpu->extn.minmax, "minmax,"), | 222 | n += scnprintf(buf + n, len - n, "FPU\t\t: %s%s\n", |
192 | IS_AVAIL1(cpu->extn.crc, "crc,"), | 223 | IS_AVAIL1(cpu->extn.fpu_sp, "SP "), |
193 | IS_AVAIL2(cpu->extn.ext_arith, "ext-arith")); | 224 | IS_AVAIL1(cpu->extn.fpu_dp, "DP ")); |
194 | 225 | ||
195 | n += scnprintf(buf + n, len - n, "Extn [700-MPY]\t: %s", | 226 | if (cpu->extn.debug) |
196 | mul_type_nm[cpu->extn.mul].str); | 227 | n += scnprintf(buf + n, len - n, "DEBUG\t\t: %s%s%s\n", |
197 | 228 | IS_AVAIL1(cpu->extn.ap, "ActionPoint "), | |
198 | n += scnprintf(buf + n, len - n, " MAC MPY: %s\n", | 229 | IS_AVAIL1(cpu->extn.smart, "smaRT "), |
199 | mac_mul_nm[cpu->extn_mac_mul.type].str); | 230 | IS_AVAIL1(cpu->extn.rtt, "RTT ")); |
200 | 231 | ||
201 | if (cpu->core.family == 0x34) { | 232 | if (cpu->dccm.sz || cpu->iccm.sz) |
202 | n += scnprintf(buf + n, len - n, | 233 | n += scnprintf(buf + n, len - n, "Extn [CCM]\t: DCCM @ %x, %d KB / ICCM: @ %x, %d KB\n", |
203 | "Extn [700-4.10]\t: LLOCK/SCOND %s, SWAPE %s, RTSC %s\n", | 234 | cpu->dccm.base_addr, TO_KB(cpu->dccm.sz), |
204 | IS_USED(CONFIG_ARC_HAS_LLSC), | ||
205 | IS_USED(CONFIG_ARC_HAS_SWAPE), | ||
206 | IS_USED(CONFIG_ARC_HAS_RTSC)); | ||
207 | } | ||
208 | |||
209 | n += scnprintf(buf + n, len - n, "Extn [CCM]\t: %s", | ||
210 | !(cpu->dccm.sz || cpu->iccm.sz) ? "N/A" : ""); | ||
211 | |||
212 | if (cpu->dccm.sz) | ||
213 | n += scnprintf(buf + n, len - n, "DCCM: @ %x, %d KB ", | ||
214 | cpu->dccm.base_addr, TO_KB(cpu->dccm.sz)); | ||
215 | |||
216 | if (cpu->iccm.sz) | ||
217 | n += scnprintf(buf + n, len - n, "ICCM: @ %x, %d KB", | ||
218 | cpu->iccm.base_addr, TO_KB(cpu->iccm.sz)); | 235 | cpu->iccm.base_addr, TO_KB(cpu->iccm.sz)); |
219 | 236 | ||
220 | n += scnprintf(buf + n, len - n, "\nExtn [FPU]\t: %s", | ||
221 | !(cpu->fp.ver || cpu->dpfp.ver) ? "N/A" : ""); | ||
222 | |||
223 | if (cpu->fp.ver) | ||
224 | n += scnprintf(buf + n, len - n, "SP [v%d] %s", | ||
225 | cpu->fp.ver, cpu->fp.fast ? "(fast)" : ""); | ||
226 | |||
227 | if (cpu->dpfp.ver) | ||
228 | n += scnprintf(buf + n, len - n, "DP [v%d] %s", | ||
229 | cpu->dpfp.ver, cpu->dpfp.fast ? "(fast)" : ""); | ||
230 | |||
231 | n += scnprintf(buf + n, len - n, "\n"); | ||
232 | |||
233 | n += scnprintf(buf + n, len - n, | 237 | n += scnprintf(buf + n, len - n, |
234 | "OS ABI [v3]\t: no-legacy-syscalls\n"); | 238 | "OS ABI [v3]\t: no-legacy-syscalls\n"); |
235 | 239 | ||
@@ -241,6 +245,15 @@ static void arc_chk_core_config(void) | |||
241 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; | 245 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; |
242 | int fpu_enabled; | 246 | int fpu_enabled; |
243 | 247 | ||
248 | if (!cpu->timers.t0) | ||
249 | panic("Timer0 is not present!\n"); | ||
250 | |||
251 | if (!cpu->timers.t1) | ||
252 | panic("Timer1 is not present!\n"); | ||
253 | |||
254 | if (IS_ENABLED(CONFIG_ARC_HAS_RTSC) && !cpu->timers.rtsc) | ||
255 | panic("RTSC is not present\n"); | ||
256 | |||
244 | #ifdef CONFIG_ARC_HAS_DCCM | 257 | #ifdef CONFIG_ARC_HAS_DCCM |
245 | /* | 258 | /* |
246 | * DCCM can be arbit placed in hardware. | 259 | * DCCM can be arbit placed in hardware. |
@@ -267,9 +280,9 @@ static void arc_chk_core_config(void) | |||
267 | */ | 280 | */ |
268 | fpu_enabled = IS_ENABLED(CONFIG_ARC_FPU_SAVE_RESTORE); | 281 | fpu_enabled = IS_ENABLED(CONFIG_ARC_FPU_SAVE_RESTORE); |
269 | 282 | ||
270 | if (cpu->dpfp.ver && !fpu_enabled) | 283 | if (cpu->extn.fpu_dp && !fpu_enabled) |
271 | pr_warn("CONFIG_ARC_FPU_SAVE_RESTORE needed for working apps\n"); | 284 | pr_warn("CONFIG_ARC_FPU_SAVE_RESTORE needed for working apps\n"); |
272 | else if (!cpu->dpfp.ver && fpu_enabled) | 285 | else if (!cpu->extn.fpu_dp && fpu_enabled) |
273 | panic("FPU non-existent, disable CONFIG_ARC_FPU_SAVE_RESTORE\n"); | 286 | panic("FPU non-existent, disable CONFIG_ARC_FPU_SAVE_RESTORE\n"); |
274 | } | 287 | } |
275 | 288 | ||
@@ -405,7 +418,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
405 | 418 | ||
406 | seq_printf(m, arc_cpu_mumbojumbo(cpu_id, str, PAGE_SIZE)); | 419 | seq_printf(m, arc_cpu_mumbojumbo(cpu_id, str, PAGE_SIZE)); |
407 | 420 | ||
408 | seq_printf(m, "Bogo MIPS : \t%lu.%02lu\n", | 421 | seq_printf(m, "Bogo MIPS\t: %lu.%02lu\n", |
409 | loops_per_jiffy / (500000 / HZ), | 422 | loops_per_jiffy / (500000 / HZ), |
410 | (loops_per_jiffy / (5000 / HZ)) % 100); | 423 | (loops_per_jiffy / (5000 / HZ)) % 100); |
411 | 424 | ||
diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index e1acf0ce5647..7f47d2a56f44 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c | |||
@@ -609,14 +609,12 @@ char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len) | |||
609 | int n = 0; | 609 | int n = 0; |
610 | struct cpuinfo_arc_mmu *p_mmu = &cpuinfo_arc700[cpu_id].mmu; | 610 | struct cpuinfo_arc_mmu *p_mmu = &cpuinfo_arc700[cpu_id].mmu; |
611 | 611 | ||
612 | n += scnprintf(buf + n, len - n, "ARC700 MMU [v%x]\t: %dk PAGE, ", | ||
613 | p_mmu->ver, TO_KB(p_mmu->pg_sz)); | ||
614 | |||
615 | n += scnprintf(buf + n, len - n, | 612 | n += scnprintf(buf + n, len - n, |
616 | "J-TLB %d (%dx%d), uDTLB %d, uITLB %d, %s\n", | 613 | "MMU [v%x]\t: %dk PAGE, JTLB %d (%dx%d), uDTLB %d, uITLB %d %s\n", |
614 | p_mmu->ver, TO_KB(p_mmu->pg_sz), | ||
617 | p_mmu->num_tlb, p_mmu->sets, p_mmu->ways, | 615 | p_mmu->num_tlb, p_mmu->sets, p_mmu->ways, |
618 | p_mmu->u_dtlb, p_mmu->u_itlb, | 616 | p_mmu->u_dtlb, p_mmu->u_itlb, |
619 | IS_ENABLED(CONFIG_ARC_MMU_SASID) ? "SASID" : ""); | 617 | IS_ENABLED(CONFIG_ARC_MMU_SASID) ? ",SASID" : ""); |
620 | 618 | ||
621 | return buf; | 619 | return buf; |
622 | } | 620 | } |