diff options
Diffstat (limited to 'arch/arc/kernel/setup.c')
-rw-r--r-- | arch/arc/kernel/setup.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 877cec8f5ea2..fb83844daeea 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c | |||
@@ -51,6 +51,7 @@ static const struct id_to_str arc_cpu_rel[] = { | |||
51 | { 0x51, "R2.0" }, | 51 | { 0x51, "R2.0" }, |
52 | { 0x52, "R2.1" }, | 52 | { 0x52, "R2.1" }, |
53 | { 0x53, "R3.0" }, | 53 | { 0x53, "R3.0" }, |
54 | { 0x54, "R4.0" }, | ||
54 | #endif | 55 | #endif |
55 | { 0x00, NULL } | 56 | { 0x00, NULL } |
56 | }; | 57 | }; |
@@ -62,6 +63,7 @@ static const struct id_to_str arc_cpu_nm[] = { | |||
62 | #else | 63 | #else |
63 | { 0x40, "ARC EM" }, | 64 | { 0x40, "ARC EM" }, |
64 | { 0x50, "ARC HS38" }, | 65 | { 0x50, "ARC HS38" }, |
66 | { 0x54, "ARC HS48" }, | ||
65 | #endif | 67 | #endif |
66 | { 0x00, "Unknown" } | 68 | { 0x00, "Unknown" } |
67 | }; | 69 | }; |
@@ -119,11 +121,11 @@ static void read_arc_build_cfg_regs(void) | |||
119 | struct bcr_generic bcr; | 121 | struct bcr_generic bcr; |
120 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; | 122 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; |
121 | const struct id_to_str *tbl; | 123 | const struct id_to_str *tbl; |
124 | struct bcr_isa_arcv2 isa; | ||
122 | 125 | ||
123 | FIX_PTR(cpu); | 126 | FIX_PTR(cpu); |
124 | 127 | ||
125 | READ_BCR(AUX_IDENTITY, cpu->core); | 128 | READ_BCR(AUX_IDENTITY, cpu->core); |
126 | READ_BCR(ARC_REG_ISA_CFG_BCR, cpu->isa); | ||
127 | 129 | ||
128 | for (tbl = &arc_cpu_rel[0]; tbl->id != 0; tbl++) { | 130 | for (tbl = &arc_cpu_rel[0]; tbl->id != 0; tbl++) { |
129 | if (cpu->core.family == tbl->id) { | 131 | if (cpu->core.family == tbl->id) { |
@@ -133,7 +135,7 @@ static void read_arc_build_cfg_regs(void) | |||
133 | } | 135 | } |
134 | 136 | ||
135 | for (tbl = &arc_cpu_nm[0]; tbl->id != 0; tbl++) { | 137 | for (tbl = &arc_cpu_nm[0]; tbl->id != 0; tbl++) { |
136 | if ((cpu->core.family & 0xF0) == tbl->id) | 138 | if ((cpu->core.family & 0xF4) == tbl->id) |
137 | break; | 139 | break; |
138 | } | 140 | } |
139 | cpu->name = tbl->str; | 141 | cpu->name = tbl->str; |
@@ -192,6 +194,14 @@ static void read_arc_build_cfg_regs(void) | |||
192 | cpu->bpu.full = bpu.ft; | 194 | cpu->bpu.full = bpu.ft; |
193 | cpu->bpu.num_cache = 256 << bpu.bce; | 195 | cpu->bpu.num_cache = 256 << bpu.bce; |
194 | cpu->bpu.num_pred = 2048 << bpu.pte; | 196 | cpu->bpu.num_pred = 2048 << bpu.pte; |
197 | |||
198 | if (cpu->core.family >= 0x54) { | ||
199 | unsigned int exec_ctrl; | ||
200 | |||
201 | READ_BCR(AUX_EXEC_CTRL, exec_ctrl); | ||
202 | cpu->extn.dual_iss_exist = 1; | ||
203 | cpu->extn.dual_iss_enb = exec_ctrl & 1; | ||
204 | } | ||
195 | } | 205 | } |
196 | 206 | ||
197 | READ_BCR(ARC_REG_AP_BCR, bcr); | 207 | READ_BCR(ARC_REG_AP_BCR, bcr); |
@@ -205,18 +215,25 @@ static void read_arc_build_cfg_regs(void) | |||
205 | 215 | ||
206 | cpu->extn.debug = cpu->extn.ap | cpu->extn.smart | cpu->extn.rtt; | 216 | cpu->extn.debug = cpu->extn.ap | cpu->extn.smart | cpu->extn.rtt; |
207 | 217 | ||
218 | READ_BCR(ARC_REG_ISA_CFG_BCR, isa); | ||
219 | |||
208 | /* some hacks for lack of feature BCR info in old ARC700 cores */ | 220 | /* some hacks for lack of feature BCR info in old ARC700 cores */ |
209 | if (is_isa_arcompact()) { | 221 | if (is_isa_arcompact()) { |
210 | if (!cpu->isa.ver) /* ISA BCR absent, use Kconfig info */ | 222 | if (!isa.ver) /* ISA BCR absent, use Kconfig info */ |
211 | cpu->isa.atomic = IS_ENABLED(CONFIG_ARC_HAS_LLSC); | 223 | cpu->isa.atomic = IS_ENABLED(CONFIG_ARC_HAS_LLSC); |
212 | else | 224 | else { |
213 | cpu->isa.atomic = cpu->isa.atomic1; | 225 | /* ARC700_BUILD only has 2 bits of isa info */ |
226 | struct bcr_generic bcr = *(struct bcr_generic *)&isa; | ||
227 | cpu->isa.atomic = bcr.info & 1; | ||
228 | } | ||
214 | 229 | ||
215 | cpu->isa.be = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN); | 230 | cpu->isa.be = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN); |
216 | 231 | ||
217 | /* there's no direct way to distinguish 750 vs. 770 */ | 232 | /* there's no direct way to distinguish 750 vs. 770 */ |
218 | if (unlikely(cpu->core.family < 0x34 || cpu->mmu.ver < 3)) | 233 | if (unlikely(cpu->core.family < 0x34 || cpu->mmu.ver < 3)) |
219 | cpu->name = "ARC750"; | 234 | cpu->name = "ARC750"; |
235 | } else { | ||
236 | cpu->isa = isa; | ||
220 | } | 237 | } |
221 | } | 238 | } |
222 | 239 | ||
@@ -232,10 +249,11 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) | |||
232 | "\nIDENTITY\t: ARCVER [%#02x] ARCNUM [%#02x] CHIPID [%#4x]\n", | 249 | "\nIDENTITY\t: ARCVER [%#02x] ARCNUM [%#02x] CHIPID [%#4x]\n", |
233 | core->family, core->cpu_id, core->chip_id); | 250 | core->family, core->cpu_id, core->chip_id); |
234 | 251 | ||
235 | n += scnprintf(buf + n, len - n, "processor [%d]\t: %s %s (%s ISA) %s\n", | 252 | n += scnprintf(buf + n, len - n, "processor [%d]\t: %s %s (%s ISA) %s%s%s\n", |
236 | cpu_id, cpu->name, cpu->details, | 253 | cpu_id, cpu->name, cpu->details, |
237 | is_isa_arcompact() ? "ARCompact" : "ARCv2", | 254 | is_isa_arcompact() ? "ARCompact" : "ARCv2", |
238 | IS_AVAIL1(cpu->isa.be, "[Big-Endian]")); | 255 | IS_AVAIL1(cpu->isa.be, "[Big-Endian]"), |
256 | IS_AVAIL3(cpu->extn.dual_iss_exist, cpu->extn.dual_iss_enb, " Dual-Issue")); | ||
239 | 257 | ||
240 | n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s%s%s\nISA Extn\t: ", | 258 | n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s%s%s\nISA Extn\t: ", |
241 | IS_AVAIL1(cpu->extn.timer0, "Timer0 "), | 259 | IS_AVAIL1(cpu->extn.timer0, "Timer0 "), |