| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 6 | | - * published by the Free Software Foundation. |
|---|
| 7 | 4 | */ |
|---|
| 8 | 5 | |
|---|
| 9 | 6 | #include <linux/seq_file.h> |
|---|
| .. | .. |
|---|
| 11 | 8 | #include <linux/delay.h> |
|---|
| 12 | 9 | #include <linux/root_dev.h> |
|---|
| 13 | 10 | #include <linux/clk.h> |
|---|
| 14 | | -#include <linux/clk-provider.h> |
|---|
| 15 | 11 | #include <linux/clocksource.h> |
|---|
| 16 | 12 | #include <linux/console.h> |
|---|
| 17 | 13 | #include <linux/module.h> |
|---|
| 18 | 14 | #include <linux/sizes.h> |
|---|
| 19 | 15 | #include <linux/cpu.h> |
|---|
| 16 | +#include <linux/of_clk.h> |
|---|
| 20 | 17 | #include <linux/of_fdt.h> |
|---|
| 21 | 18 | #include <linux/of.h> |
|---|
| 22 | 19 | #include <linux/cache.h> |
|---|
| 20 | +#include <uapi/linux/mount.h> |
|---|
| 23 | 21 | #include <asm/sections.h> |
|---|
| 24 | 22 | #include <asm/arcregs.h> |
|---|
| 23 | +#include <asm/asserts.h> |
|---|
| 25 | 24 | #include <asm/tlb.h> |
|---|
| 26 | 25 | #include <asm/setup.h> |
|---|
| 27 | 26 | #include <asm/page.h> |
|---|
| .. | .. |
|---|
| 29 | 28 | #include <asm/unwind.h> |
|---|
| 30 | 29 | #include <asm/mach_desc.h> |
|---|
| 31 | 30 | #include <asm/smp.h> |
|---|
| 31 | +#include <asm/dsp-impl.h> |
|---|
| 32 | 32 | |
|---|
| 33 | 33 | #define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x)) |
|---|
| 34 | 34 | |
|---|
| .. | .. |
|---|
| 45 | 45 | |
|---|
| 46 | 46 | struct cpuinfo_arc cpuinfo_arc700[NR_CPUS]; |
|---|
| 47 | 47 | |
|---|
| 48 | | -static const struct id_to_str arc_cpu_rel[] = { |
|---|
| 48 | +static const struct id_to_str arc_legacy_rel[] = { |
|---|
| 49 | + /* ID.ARCVER, Release */ |
|---|
| 49 | 50 | #ifdef CONFIG_ISA_ARCOMPACT |
|---|
| 50 | | - { 0x34, "R4.10"}, |
|---|
| 51 | | - { 0x35, "R4.11"}, |
|---|
| 51 | + { 0x34, "R4.10"}, |
|---|
| 52 | + { 0x35, "R4.11"}, |
|---|
| 52 | 53 | #else |
|---|
| 53 | | - { 0x51, "R2.0" }, |
|---|
| 54 | | - { 0x52, "R2.1" }, |
|---|
| 55 | | - { 0x53, "R3.0" }, |
|---|
| 56 | | - { 0x54, "R3.10a" }, |
|---|
| 54 | + { 0x51, "R2.0" }, |
|---|
| 55 | + { 0x52, "R2.1" }, |
|---|
| 56 | + { 0x53, "R3.0" }, |
|---|
| 57 | 57 | #endif |
|---|
| 58 | | - { 0x00, NULL } |
|---|
| 58 | + { 0x00, NULL } |
|---|
| 59 | 59 | }; |
|---|
| 60 | 60 | |
|---|
| 61 | | -static const struct id_to_str arc_cpu_nm[] = { |
|---|
| 62 | | -#ifdef CONFIG_ISA_ARCOMPACT |
|---|
| 63 | | - { 0x20, "ARC 600" }, |
|---|
| 64 | | - { 0x30, "ARC 770" }, /* 750 identified seperately */ |
|---|
| 65 | | -#else |
|---|
| 66 | | - { 0x40, "ARC EM" }, |
|---|
| 67 | | - { 0x50, "ARC HS38" }, |
|---|
| 68 | | - { 0x54, "ARC HS48" }, |
|---|
| 69 | | -#endif |
|---|
| 70 | | - { 0x00, "Unknown" } |
|---|
| 61 | +static const struct id_to_str arc_hs_ver54_rel[] = { |
|---|
| 62 | + /* UARCH.MAJOR, Release */ |
|---|
| 63 | + { 0, "R3.10a"}, |
|---|
| 64 | + { 1, "R3.50a"}, |
|---|
| 65 | + { 2, "R3.60a"}, |
|---|
| 66 | + { 3, "R4.00a"}, |
|---|
| 67 | + { 0xFF, NULL } |
|---|
| 71 | 68 | }; |
|---|
| 72 | 69 | |
|---|
| 73 | 70 | static void read_decode_ccm_bcr(struct cpuinfo_arc *cpu) |
|---|
| .. | .. |
|---|
| 117 | 114 | } |
|---|
| 118 | 115 | } |
|---|
| 119 | 116 | |
|---|
| 117 | +static void decode_arc_core(struct cpuinfo_arc *cpu) |
|---|
| 118 | +{ |
|---|
| 119 | + struct bcr_uarch_build_arcv2 uarch; |
|---|
| 120 | + const struct id_to_str *tbl; |
|---|
| 121 | + |
|---|
| 122 | + if (cpu->core.family < 0x54) { /* includes arc700 */ |
|---|
| 123 | + |
|---|
| 124 | + for (tbl = &arc_legacy_rel[0]; tbl->id != 0; tbl++) { |
|---|
| 125 | + if (cpu->core.family == tbl->id) { |
|---|
| 126 | + cpu->release = tbl->str; |
|---|
| 127 | + break; |
|---|
| 128 | + } |
|---|
| 129 | + } |
|---|
| 130 | + |
|---|
| 131 | + if (is_isa_arcompact()) |
|---|
| 132 | + cpu->name = "ARC700"; |
|---|
| 133 | + else if (tbl->str) |
|---|
| 134 | + cpu->name = "HS38"; |
|---|
| 135 | + else |
|---|
| 136 | + cpu->name = cpu->release = "Unknown"; |
|---|
| 137 | + |
|---|
| 138 | + return; |
|---|
| 139 | + } |
|---|
| 140 | + |
|---|
| 141 | + /* |
|---|
| 142 | + * Initial HS cores bumped AUX IDENTITY.ARCVER for each release until |
|---|
| 143 | + * ARCVER 0x54 which introduced AUX MICRO_ARCH_BUILD and subsequent |
|---|
| 144 | + * releases only update it. |
|---|
| 145 | + */ |
|---|
| 146 | + READ_BCR(ARC_REG_MICRO_ARCH_BCR, uarch); |
|---|
| 147 | + |
|---|
| 148 | + if (uarch.prod == 4) { |
|---|
| 149 | + cpu->name = "HS48"; |
|---|
| 150 | + cpu->extn.dual = 1; |
|---|
| 151 | + |
|---|
| 152 | + } else { |
|---|
| 153 | + cpu->name = "HS38"; |
|---|
| 154 | + } |
|---|
| 155 | + |
|---|
| 156 | + for (tbl = &arc_hs_ver54_rel[0]; tbl->id != 0xFF; tbl++) { |
|---|
| 157 | + if (uarch.maj == tbl->id) { |
|---|
| 158 | + cpu->release = tbl->str; |
|---|
| 159 | + break; |
|---|
| 160 | + } |
|---|
| 161 | + } |
|---|
| 162 | +} |
|---|
| 163 | + |
|---|
| 120 | 164 | static void read_arc_build_cfg_regs(void) |
|---|
| 121 | 165 | { |
|---|
| 122 | 166 | struct bcr_timer timer; |
|---|
| 123 | 167 | struct bcr_generic bcr; |
|---|
| 124 | 168 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; |
|---|
| 125 | | - const struct id_to_str *tbl; |
|---|
| 126 | 169 | struct bcr_isa_arcv2 isa; |
|---|
| 170 | + struct bcr_actionpoint ap; |
|---|
| 127 | 171 | |
|---|
| 128 | 172 | FIX_PTR(cpu); |
|---|
| 129 | 173 | |
|---|
| 130 | 174 | READ_BCR(AUX_IDENTITY, cpu->core); |
|---|
| 131 | | - |
|---|
| 132 | | - for (tbl = &arc_cpu_rel[0]; tbl->id != 0; tbl++) { |
|---|
| 133 | | - if (cpu->core.family == tbl->id) { |
|---|
| 134 | | - cpu->details = tbl->str; |
|---|
| 135 | | - break; |
|---|
| 136 | | - } |
|---|
| 137 | | - } |
|---|
| 138 | | - |
|---|
| 139 | | - for (tbl = &arc_cpu_nm[0]; tbl->id != 0; tbl++) { |
|---|
| 140 | | - if ((cpu->core.family & 0xF4) == tbl->id) |
|---|
| 141 | | - break; |
|---|
| 142 | | - } |
|---|
| 143 | | - cpu->name = tbl->str; |
|---|
| 175 | + decode_arc_core(cpu); |
|---|
| 144 | 176 | |
|---|
| 145 | 177 | READ_BCR(ARC_REG_TIMERS_BCR, timer); |
|---|
| 146 | 178 | cpu->extn.timer0 = timer.t0; |
|---|
| .. | .. |
|---|
| 150 | 182 | cpu->vec_base = read_aux_reg(AUX_INTR_VEC_BASE); |
|---|
| 151 | 183 | |
|---|
| 152 | 184 | READ_BCR(ARC_REG_MUL_BCR, cpu->extn_mpy); |
|---|
| 153 | | - |
|---|
| 154 | | - cpu->extn.norm = read_aux_reg(ARC_REG_NORM_BCR) > 1 ? 1 : 0; /* 2,3 */ |
|---|
| 155 | | - cpu->extn.barrel = read_aux_reg(ARC_REG_BARREL_BCR) > 1 ? 1 : 0; /* 2,3 */ |
|---|
| 156 | | - cpu->extn.swap = read_aux_reg(ARC_REG_SWAP_BCR) ? 1 : 0; /* 1,3 */ |
|---|
| 157 | | - cpu->extn.crc = read_aux_reg(ARC_REG_CRC_BCR) ? 1 : 0; |
|---|
| 158 | | - cpu->extn.minmax = read_aux_reg(ARC_REG_MIXMAX_BCR) > 1 ? 1 : 0; /* 2 */ |
|---|
| 159 | | - cpu->extn.swape = (cpu->core.family >= 0x34) ? 1 : |
|---|
| 160 | | - IS_ENABLED(CONFIG_ARC_HAS_SWAPE); |
|---|
| 161 | | - |
|---|
| 162 | | - READ_BCR(ARC_REG_XY_MEM_BCR, cpu->extn_xymem); |
|---|
| 163 | 185 | |
|---|
| 164 | 186 | /* Read CCM BCRs for boot reporting even if not enabled in Kconfig */ |
|---|
| 165 | 187 | read_decode_ccm_bcr(cpu); |
|---|
| .. | .. |
|---|
| 196 | 218 | cpu->bpu.full = bpu.ft; |
|---|
| 197 | 219 | cpu->bpu.num_cache = 256 << bpu.bce; |
|---|
| 198 | 220 | cpu->bpu.num_pred = 2048 << bpu.pte; |
|---|
| 221 | + cpu->bpu.ret_stk = 4 << bpu.rse; |
|---|
| 199 | 222 | |
|---|
| 200 | | - if (cpu->core.family >= 0x54) { |
|---|
| 223 | + /* if dual issue hardware, is it enabled ? */ |
|---|
| 224 | + if (cpu->extn.dual) { |
|---|
| 225 | + unsigned int exec_ctrl; |
|---|
| 201 | 226 | |
|---|
| 202 | | - struct bcr_uarch_build_arcv2 uarch; |
|---|
| 203 | | - |
|---|
| 204 | | - /* |
|---|
| 205 | | - * The first 0x54 core (uarch maj:min 0:1 or 0:2) was |
|---|
| 206 | | - * dual issue only (HS4x). But next uarch rev (1:0) |
|---|
| 207 | | - * allows it be configured for single issue (HS3x) |
|---|
| 208 | | - * Ensure we fiddle with dual issue only on HS4x |
|---|
| 209 | | - */ |
|---|
| 210 | | - READ_BCR(ARC_REG_MICRO_ARCH_BCR, uarch); |
|---|
| 211 | | - |
|---|
| 212 | | - if (uarch.prod == 4) { |
|---|
| 213 | | - unsigned int exec_ctrl; |
|---|
| 214 | | - |
|---|
| 215 | | - /* dual issue hardware always present */ |
|---|
| 216 | | - cpu->extn.dual = 1; |
|---|
| 217 | | - |
|---|
| 218 | | - READ_BCR(AUX_EXEC_CTRL, exec_ctrl); |
|---|
| 219 | | - |
|---|
| 220 | | - /* dual issue hardware enabled ? */ |
|---|
| 221 | | - cpu->extn.dual_enb = !(exec_ctrl & 1); |
|---|
| 222 | | - |
|---|
| 223 | | - } |
|---|
| 227 | + READ_BCR(AUX_EXEC_CTRL, exec_ctrl); |
|---|
| 228 | + cpu->extn.dual_enb = !(exec_ctrl & 1); |
|---|
| 224 | 229 | } |
|---|
| 225 | 230 | } |
|---|
| 226 | 231 | |
|---|
| 227 | | - READ_BCR(ARC_REG_AP_BCR, bcr); |
|---|
| 228 | | - cpu->extn.ap = bcr.ver ? 1 : 0; |
|---|
| 232 | + READ_BCR(ARC_REG_AP_BCR, ap); |
|---|
| 233 | + if (ap.ver) { |
|---|
| 234 | + cpu->extn.ap_num = 2 << ap.num; |
|---|
| 235 | + cpu->extn.ap_full = !ap.min; |
|---|
| 236 | + } |
|---|
| 229 | 237 | |
|---|
| 230 | 238 | READ_BCR(ARC_REG_SMART_BCR, bcr); |
|---|
| 231 | 239 | cpu->extn.smart = bcr.ver ? 1 : 0; |
|---|
| 232 | 240 | |
|---|
| 233 | 241 | READ_BCR(ARC_REG_RTT_BCR, bcr); |
|---|
| 234 | 242 | cpu->extn.rtt = bcr.ver ? 1 : 0; |
|---|
| 235 | | - |
|---|
| 236 | | - cpu->extn.debug = cpu->extn.ap | cpu->extn.smart | cpu->extn.rtt; |
|---|
| 237 | 243 | |
|---|
| 238 | 244 | READ_BCR(ARC_REG_ISA_CFG_BCR, isa); |
|---|
| 239 | 245 | |
|---|
| .. | .. |
|---|
| 261 | 267 | { |
|---|
| 262 | 268 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id]; |
|---|
| 263 | 269 | struct bcr_identity *core = &cpu->core; |
|---|
| 264 | | - int i, n = 0; |
|---|
| 270 | + char mpy_opt[16]; |
|---|
| 271 | + int n = 0; |
|---|
| 265 | 272 | |
|---|
| 266 | 273 | FIX_PTR(cpu); |
|---|
| 267 | 274 | |
|---|
| .. | .. |
|---|
| 270 | 277 | core->family, core->cpu_id, core->chip_id); |
|---|
| 271 | 278 | |
|---|
| 272 | 279 | n += scnprintf(buf + n, len - n, "processor [%d]\t: %s %s (%s ISA) %s%s%s\n", |
|---|
| 273 | | - cpu_id, cpu->name, cpu->details, |
|---|
| 280 | + cpu_id, cpu->name, cpu->release, |
|---|
| 274 | 281 | is_isa_arcompact() ? "ARCompact" : "ARCv2", |
|---|
| 275 | 282 | IS_AVAIL1(cpu->isa.be, "[Big-Endian]"), |
|---|
| 276 | 283 | IS_AVAIL3(cpu->extn.dual, cpu->extn.dual_enb, " Dual-Issue ")); |
|---|
| .. | .. |
|---|
| 281 | 288 | IS_AVAIL2(cpu->extn.rtc, "RTC [UP 64-bit] ", CONFIG_ARC_TIMERS_64BIT), |
|---|
| 282 | 289 | IS_AVAIL2(cpu->extn.gfrc, "GFRC [SMP 64-bit] ", CONFIG_ARC_TIMERS_64BIT)); |
|---|
| 283 | 290 | |
|---|
| 284 | | - n += i = scnprintf(buf + n, len - n, "%s%s%s%s%s", |
|---|
| 285 | | - IS_AVAIL2(cpu->isa.atomic, "atomic ", CONFIG_ARC_HAS_LLSC), |
|---|
| 286 | | - IS_AVAIL2(cpu->isa.ldd, "ll64 ", CONFIG_ARC_HAS_LL64), |
|---|
| 287 | | - IS_AVAIL1(cpu->isa.unalign, "unalign (not used)")); |
|---|
| 288 | | - |
|---|
| 289 | | - if (i) |
|---|
| 290 | | - n += scnprintf(buf + n, len - n, "\n\t\t: "); |
|---|
| 291 | | - |
|---|
| 292 | 291 | if (cpu->extn_mpy.ver) { |
|---|
| 293 | | - if (cpu->extn_mpy.ver <= 0x2) { /* ARCompact */ |
|---|
| 294 | | - n += scnprintf(buf + n, len - n, "mpy "); |
|---|
| 292 | + if (is_isa_arcompact()) { |
|---|
| 293 | + scnprintf(mpy_opt, 16, "mpy"); |
|---|
| 295 | 294 | } else { |
|---|
| 295 | + |
|---|
| 296 | 296 | int opt = 2; /* stock MPY/MPYH */ |
|---|
| 297 | 297 | |
|---|
| 298 | 298 | if (cpu->extn_mpy.dsp) /* OPT 7-9 */ |
|---|
| 299 | 299 | opt = cpu->extn_mpy.dsp + 6; |
|---|
| 300 | 300 | |
|---|
| 301 | | - n += scnprintf(buf + n, len - n, "mpy[opt %d] ", opt); |
|---|
| 301 | + scnprintf(mpy_opt, 16, "mpy[opt %d] ", opt); |
|---|
| 302 | 302 | } |
|---|
| 303 | 303 | } |
|---|
| 304 | 304 | |
|---|
| 305 | 305 | n += scnprintf(buf + n, len - n, "%s%s%s%s%s%s%s%s\n", |
|---|
| 306 | | - IS_AVAIL1(cpu->isa.div_rem, "div_rem "), |
|---|
| 307 | | - IS_AVAIL1(cpu->extn.norm, "norm "), |
|---|
| 308 | | - IS_AVAIL1(cpu->extn.barrel, "barrel-shift "), |
|---|
| 309 | | - IS_AVAIL1(cpu->extn.swap, "swap "), |
|---|
| 310 | | - IS_AVAIL1(cpu->extn.minmax, "minmax "), |
|---|
| 311 | | - IS_AVAIL1(cpu->extn.crc, "crc "), |
|---|
| 312 | | - IS_AVAIL2(cpu->extn.swape, "swape", CONFIG_ARC_HAS_SWAPE)); |
|---|
| 306 | + IS_AVAIL2(cpu->isa.atomic, "atomic ", CONFIG_ARC_HAS_LLSC), |
|---|
| 307 | + IS_AVAIL2(cpu->isa.ldd, "ll64 ", CONFIG_ARC_HAS_LL64), |
|---|
| 308 | + IS_AVAIL2(cpu->isa.unalign, "unalign ", CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS), |
|---|
| 309 | + IS_AVAIL1(cpu->extn_mpy.ver, mpy_opt), |
|---|
| 310 | + IS_AVAIL1(cpu->isa.div_rem, "div_rem ")); |
|---|
| 313 | 311 | |
|---|
| 314 | | - if (cpu->bpu.ver) |
|---|
| 312 | + if (cpu->bpu.ver) { |
|---|
| 315 | 313 | n += scnprintf(buf + n, len - n, |
|---|
| 316 | | - "BPU\t\t: %s%s match, cache:%d, Predict Table:%d", |
|---|
| 314 | + "BPU\t\t: %s%s match, cache:%d, Predict Table:%d Return stk: %d", |
|---|
| 317 | 315 | IS_AVAIL1(cpu->bpu.full, "full"), |
|---|
| 318 | 316 | IS_AVAIL1(!cpu->bpu.full, "partial"), |
|---|
| 319 | | - cpu->bpu.num_cache, cpu->bpu.num_pred); |
|---|
| 317 | + cpu->bpu.num_cache, cpu->bpu.num_pred, cpu->bpu.ret_stk); |
|---|
| 320 | 318 | |
|---|
| 321 | | - if (is_isa_arcv2()) { |
|---|
| 322 | | - struct bcr_lpb lpb; |
|---|
| 319 | + if (is_isa_arcv2()) { |
|---|
| 320 | + struct bcr_lpb lpb; |
|---|
| 323 | 321 | |
|---|
| 324 | | - READ_BCR(ARC_REG_LPB_BUILD, lpb); |
|---|
| 325 | | - if (lpb.ver) { |
|---|
| 326 | | - unsigned int ctl; |
|---|
| 327 | | - ctl = read_aux_reg(ARC_REG_LPB_CTRL); |
|---|
| 322 | + READ_BCR(ARC_REG_LPB_BUILD, lpb); |
|---|
| 323 | + if (lpb.ver) { |
|---|
| 324 | + unsigned int ctl; |
|---|
| 325 | + ctl = read_aux_reg(ARC_REG_LPB_CTRL); |
|---|
| 328 | 326 | |
|---|
| 329 | | - n += scnprintf(buf + n, len - n, " Loop Buffer:%d %s", |
|---|
| 330 | | - lpb.entries, |
|---|
| 331 | | - IS_DISABLED_RUN(!ctl)); |
|---|
| 327 | + n += scnprintf(buf + n, len - n, " Loop Buffer:%d %s", |
|---|
| 328 | + lpb.entries, |
|---|
| 329 | + IS_DISABLED_RUN(!ctl)); |
|---|
| 330 | + } |
|---|
| 332 | 331 | } |
|---|
| 332 | + n += scnprintf(buf + n, len - n, "\n"); |
|---|
| 333 | 333 | } |
|---|
| 334 | 334 | |
|---|
| 335 | | - n += scnprintf(buf + n, len - n, "\n"); |
|---|
| 336 | 335 | return buf; |
|---|
| 337 | 336 | } |
|---|
| 338 | 337 | |
|---|
| .. | .. |
|---|
| 350 | 349 | IS_AVAIL1(cpu->extn.fpu_sp, "SP "), |
|---|
| 351 | 350 | IS_AVAIL1(cpu->extn.fpu_dp, "DP ")); |
|---|
| 352 | 351 | |
|---|
| 353 | | - if (cpu->extn.debug) |
|---|
| 354 | | - n += scnprintf(buf + n, len - n, "DEBUG\t\t: %s%s%s\n", |
|---|
| 355 | | - IS_AVAIL1(cpu->extn.ap, "ActionPoint "), |
|---|
| 352 | + if (cpu->extn.ap_num | cpu->extn.smart | cpu->extn.rtt) { |
|---|
| 353 | + n += scnprintf(buf + n, len - n, "DEBUG\t\t: %s%s", |
|---|
| 356 | 354 | IS_AVAIL1(cpu->extn.smart, "smaRT "), |
|---|
| 357 | 355 | IS_AVAIL1(cpu->extn.rtt, "RTT ")); |
|---|
| 356 | + if (cpu->extn.ap_num) { |
|---|
| 357 | + n += scnprintf(buf + n, len - n, "ActionPoint %d/%s", |
|---|
| 358 | + cpu->extn.ap_num, |
|---|
| 359 | + cpu->extn.ap_full ? "full":"min"); |
|---|
| 360 | + } |
|---|
| 361 | + n += scnprintf(buf + n, len - n, "\n"); |
|---|
| 362 | + } |
|---|
| 358 | 363 | |
|---|
| 359 | 364 | if (cpu->dccm.sz || cpu->iccm.sz) |
|---|
| 360 | 365 | n += scnprintf(buf + n, len - n, "Extn [CCM]\t: DCCM @ %x, %d KB / ICCM: @ %x, %d KB\n", |
|---|
| .. | .. |
|---|
| 379 | 384 | } |
|---|
| 380 | 385 | } |
|---|
| 381 | 386 | |
|---|
| 382 | | - n += scnprintf(buf + n, len - n, "OS ABI [v%d]\t: %s\n", |
|---|
| 383 | | - EF_ARC_OSABI_CURRENT >> 8, |
|---|
| 384 | | - EF_ARC_OSABI_CURRENT == EF_ARC_OSABI_V3 ? |
|---|
| 385 | | - "no-legacy-syscalls" : "64-bit data any register aligned"); |
|---|
| 386 | | - |
|---|
| 387 | 387 | return buf; |
|---|
| 388 | +} |
|---|
| 389 | + |
|---|
| 390 | +void chk_opt_strict(char *opt_name, bool hw_exists, bool opt_ena) |
|---|
| 391 | +{ |
|---|
| 392 | + if (hw_exists && !opt_ena) |
|---|
| 393 | + pr_warn(" ! Enable %s for working apps\n", opt_name); |
|---|
| 394 | + else if (!hw_exists && opt_ena) |
|---|
| 395 | + panic("Disable %s, hardware NOT present\n", opt_name); |
|---|
| 396 | +} |
|---|
| 397 | + |
|---|
| 398 | +void chk_opt_weak(char *opt_name, bool hw_exists, bool opt_ena) |
|---|
| 399 | +{ |
|---|
| 400 | + if (!hw_exists && opt_ena) |
|---|
| 401 | + panic("Disable %s, hardware NOT present\n", opt_name); |
|---|
| 388 | 402 | } |
|---|
| 389 | 403 | |
|---|
| 390 | 404 | static void arc_chk_core_config(void) |
|---|
| 391 | 405 | { |
|---|
| 392 | 406 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; |
|---|
| 393 | | - int saved = 0, present = 0; |
|---|
| 394 | | - char *opt_nm = NULL; |
|---|
| 407 | + int present = 0; |
|---|
| 395 | 408 | |
|---|
| 396 | 409 | if (!cpu->extn.timer0) |
|---|
| 397 | 410 | panic("Timer0 is not present!\n"); |
|---|
| .. | .. |
|---|
| 423 | 436 | */ |
|---|
| 424 | 437 | |
|---|
| 425 | 438 | if (is_isa_arcompact()) { |
|---|
| 426 | | - opt_nm = "CONFIG_ARC_FPU_SAVE_RESTORE"; |
|---|
| 427 | | - saved = IS_ENABLED(CONFIG_ARC_FPU_SAVE_RESTORE); |
|---|
| 428 | | - |
|---|
| 429 | 439 | /* only DPDP checked since SP has no arch visible regs */ |
|---|
| 430 | 440 | present = cpu->extn.fpu_dp; |
|---|
| 441 | + CHK_OPT_STRICT(CONFIG_ARC_FPU_SAVE_RESTORE, present); |
|---|
| 431 | 442 | } else { |
|---|
| 432 | | - opt_nm = "CONFIG_ARC_HAS_ACCL_REGS"; |
|---|
| 433 | | - saved = IS_ENABLED(CONFIG_ARC_HAS_ACCL_REGS); |
|---|
| 434 | | - |
|---|
| 435 | 443 | /* Accumulator Low:High pair (r58:59) present if DSP MPY or FPU */ |
|---|
| 436 | 444 | present = cpu->extn_mpy.dsp | cpu->extn.fpu_sp | cpu->extn.fpu_dp; |
|---|
| 437 | | - } |
|---|
| 445 | + CHK_OPT_STRICT(CONFIG_ARC_HAS_ACCL_REGS, present); |
|---|
| 438 | 446 | |
|---|
| 439 | | - if (present && !saved) |
|---|
| 440 | | - pr_warn("Enable %s for working apps\n", opt_nm); |
|---|
| 441 | | - else if (!present && saved) |
|---|
| 442 | | - panic("Disable %s, hardware NOT present\n", opt_nm); |
|---|
| 447 | + dsp_config_check(); |
|---|
| 448 | + } |
|---|
| 443 | 449 | } |
|---|
| 444 | 450 | |
|---|
| 445 | 451 | /* |
|---|
| .. | .. |
|---|
| 569 | 575 | * But that is unlikely so keeping it as it is |
|---|
| 570 | 576 | */ |
|---|
| 571 | 577 | root_mountflags &= ~MS_RDONLY; |
|---|
| 572 | | - |
|---|
| 573 | | -#if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE) |
|---|
| 574 | | - conswitchp = &dummy_con; |
|---|
| 575 | | -#endif |
|---|
| 576 | 578 | |
|---|
| 577 | 579 | arc_unwind_init(); |
|---|
| 578 | 580 | } |
|---|