diff options
| -rw-r--r-- | arch/arc/include/asm/arcregs.h | 2 | ||||
| -rw-r--r-- | arch/arc/include/asm/setup.h | 5 | ||||
| -rw-r--r-- | arch/arc/kernel/setup.c | 51 |
3 files changed, 34 insertions, 24 deletions
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h index b8d29b136b96..7f3f9f63708c 100644 --- a/arch/arc/include/asm/arcregs.h +++ b/arch/arc/include/asm/arcregs.h | |||
| @@ -349,7 +349,7 @@ struct cpuinfo_arc { | |||
| 349 | struct cpuinfo_arc_bpu bpu; | 349 | struct cpuinfo_arc_bpu bpu; |
| 350 | struct bcr_identity core; | 350 | struct bcr_identity core; |
| 351 | struct bcr_isa isa; | 351 | struct bcr_isa isa; |
| 352 | const char *details; | 352 | const char *details, *name; |
| 353 | unsigned int vec_base; | 353 | unsigned int vec_base; |
| 354 | struct cpuinfo_arc_ccm iccm, dccm; | 354 | struct cpuinfo_arc_ccm iccm, dccm; |
| 355 | struct { | 355 | struct { |
diff --git a/arch/arc/include/asm/setup.h b/arch/arc/include/asm/setup.h index bdc43df922c9..cb954cdab070 100644 --- a/arch/arc/include/asm/setup.h +++ b/arch/arc/include/asm/setup.h | |||
| @@ -27,11 +27,6 @@ struct id_to_str { | |||
| 27 | const char *str; | 27 | const char *str; |
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | struct cpuinfo_data { | ||
| 31 | struct id_to_str info; | ||
| 32 | int up_range; | ||
| 33 | }; | ||
| 34 | |||
| 35 | extern int root_mountflags, end_mem; | 30 | extern int root_mountflags, end_mem; |
| 36 | 31 | ||
| 37 | void setup_processor(void); | 32 | void setup_processor(void); |
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 156981aecd74..0385df77a697 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c | |||
| @@ -40,18 +40,27 @@ struct task_struct *_current_task[NR_CPUS]; /* For stack switching */ | |||
| 40 | 40 | ||
| 41 | struct cpuinfo_arc cpuinfo_arc700[NR_CPUS]; | 41 | struct cpuinfo_arc cpuinfo_arc700[NR_CPUS]; |
| 42 | 42 | ||
| 43 | static const struct cpuinfo_data arc_cpu_tbl[] = { | 43 | static const struct id_to_str arc_cpu_rel[] = { |
| 44 | #ifdef CONFIG_ISA_ARCOMPACT | 44 | #ifdef CONFIG_ISA_ARCOMPACT |
| 45 | { {0x20, "ARC 600" }, 0x2F}, | 45 | { 0x34, "R4.10"}, |
| 46 | { {0x30, "ARC 700" }, 0x33}, | 46 | { 0x35, "R4.11"}, |
| 47 | { {0x34, "ARC 700 R4.10"}, 0x34}, | ||
| 48 | { {0x35, "ARC 700 R4.11"}, 0x35}, | ||
| 49 | #else | 47 | #else |
| 50 | { {0x50, "ARC HS38 R2.0"}, 0x51}, | 48 | { 0x51, "R2.0" }, |
| 51 | { {0x52, "ARC HS38 R2.1"}, 0x52}, | 49 | { 0x52, "R2.1" }, |
| 52 | { {0x53, "ARC HS38 R3.0"}, 0x53}, | 50 | { 0x53, "R3.0" }, |
| 53 | #endif | 51 | #endif |
| 54 | { {0x00, NULL } } | 52 | { 0x00, NULL } |
| 53 | }; | ||
| 54 | |||
| 55 | static const struct id_to_str arc_cpu_nm[] = { | ||
| 56 | #ifdef CONFIG_ISA_ARCOMPACT | ||
| 57 | { 0x20, "ARC 600" }, | ||
| 58 | { 0x30, "ARC 770" }, /* 750 identified seperately */ | ||
| 59 | #else | ||
| 60 | { 0x40, "ARC EM" }, | ||
| 61 | { 0x50, "ARC HS38" }, | ||
| 62 | #endif | ||
| 63 | { 0x00, "Unknown" } | ||
| 55 | }; | 64 | }; |
| 56 | 65 | ||
| 57 | static void read_decode_ccm_bcr(struct cpuinfo_arc *cpu) | 66 | static void read_decode_ccm_bcr(struct cpuinfo_arc *cpu) |
| @@ -106,23 +115,25 @@ static void read_arc_build_cfg_regs(void) | |||
| 106 | struct bcr_timer timer; | 115 | struct bcr_timer timer; |
| 107 | struct bcr_generic bcr; | 116 | struct bcr_generic bcr; |
| 108 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; | 117 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; |
| 109 | const struct cpuinfo_data *tbl; | 118 | const struct id_to_str *tbl; |
| 110 | 119 | ||
| 111 | FIX_PTR(cpu); | 120 | FIX_PTR(cpu); |
| 112 | 121 | ||
| 113 | READ_BCR(AUX_IDENTITY, cpu->core); | 122 | READ_BCR(AUX_IDENTITY, cpu->core); |
| 114 | READ_BCR(ARC_REG_ISA_CFG_BCR, cpu->isa); | 123 | READ_BCR(ARC_REG_ISA_CFG_BCR, cpu->isa); |
| 115 | 124 | ||
| 116 | for (tbl = &arc_cpu_tbl[0]; tbl->info.id != 0; tbl++) { | 125 | for (tbl = &arc_cpu_rel[0]; tbl->id != 0; tbl++) { |
| 117 | if ((cpu->core.family >= tbl->info.id) && | 126 | if (cpu->core.family == tbl->id) { |
| 118 | (cpu->core.family <= tbl->up_range)) { | 127 | cpu->details = tbl->str; |
| 119 | cpu->details = tbl->info.str; | ||
| 120 | break; | 128 | break; |
| 121 | } | 129 | } |
| 122 | } | 130 | } |
| 123 | 131 | ||
| 124 | if (tbl->info.id == 0) | 132 | for (tbl = &arc_cpu_nm[0]; tbl->id != 0; tbl++) { |
| 125 | cpu->details = "UNKNOWN"; | 133 | if ((cpu->core.family & 0xF0) == tbl->id) |
| 134 | break; | ||
| 135 | } | ||
| 136 | cpu->name = tbl->str; | ||
| 126 | 137 | ||
| 127 | READ_BCR(ARC_REG_TIMERS_BCR, timer); | 138 | READ_BCR(ARC_REG_TIMERS_BCR, timer); |
| 128 | cpu->extn.timer0 = timer.t0; | 139 | cpu->extn.timer0 = timer.t0; |
| @@ -199,6 +210,10 @@ static void read_arc_build_cfg_regs(void) | |||
| 199 | cpu->isa.atomic = cpu->isa.atomic1; | 210 | cpu->isa.atomic = cpu->isa.atomic1; |
| 200 | 211 | ||
| 201 | cpu->isa.be = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN); | 212 | cpu->isa.be = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN); |
| 213 | |||
| 214 | /* there's no direct way to distinguish 750 vs. 770 */ | ||
| 215 | if (unlikely(cpu->core.family < 0x34 || cpu->mmu.ver < 3)) | ||
| 216 | cpu->name = "ARC750"; | ||
| 202 | } | 217 | } |
| 203 | } | 218 | } |
| 204 | 219 | ||
| @@ -214,8 +229,8 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) | |||
| 214 | "\nIDENTITY\t: ARCVER [%#02x] ARCNUM [%#02x] CHIPID [%#4x]\n", | 229 | "\nIDENTITY\t: ARCVER [%#02x] ARCNUM [%#02x] CHIPID [%#4x]\n", |
| 215 | core->family, core->cpu_id, core->chip_id); | 230 | core->family, core->cpu_id, core->chip_id); |
| 216 | 231 | ||
| 217 | n += scnprintf(buf + n, len - n, "processor [%d]\t: %s (%s ISA) %s\n", | 232 | n += scnprintf(buf + n, len - n, "processor [%d]\t: %s %s (%s ISA) %s\n", |
| 218 | cpu_id, cpu->details, | 233 | cpu_id, cpu->name, cpu->details, |
| 219 | is_isa_arcompact() ? "ARCompact" : "ARCv2", | 234 | is_isa_arcompact() ? "ARCompact" : "ARCv2", |
| 220 | IS_AVAIL1(cpu->isa.be, "[Big-Endian]")); | 235 | IS_AVAIL1(cpu->isa.be, "[Big-Endian]")); |
| 221 | 236 | ||
