diff options
| -rw-r--r-- | arch/arc/Kconfig | 2 | ||||
| -rw-r--r-- | arch/arc/boot/dts/axs10x_mb.dtsi | 8 | ||||
| -rw-r--r-- | arch/arc/include/asm/arcregs.h | 33 | ||||
| -rw-r--r-- | arch/arc/kernel/perf_event.c | 40 | ||||
| -rw-r--r-- | arch/arc/kernel/setup.c | 43 | ||||
| -rw-r--r-- | arch/arc/mm/tlb.c | 57 | ||||
| -rw-r--r-- | arch/arc/plat-axs10x/Kconfig | 2 | ||||
| -rw-r--r-- | arch/arc/plat-axs10x/axs10x.c | 7 |
8 files changed, 136 insertions, 56 deletions
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 5c7adf100a58..9d5fd00d9e91 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig | |||
| @@ -39,7 +39,7 @@ config ARC | |||
| 39 | select OF | 39 | select OF |
| 40 | select OF_EARLY_FLATTREE | 40 | select OF_EARLY_FLATTREE |
| 41 | select OF_RESERVED_MEM | 41 | select OF_RESERVED_MEM |
| 42 | select PERF_USE_VMALLOC | 42 | select PERF_USE_VMALLOC if ARC_CACHE_VIPT_ALIASING |
| 43 | select HAVE_DEBUG_STACKOVERFLOW | 43 | select HAVE_DEBUG_STACKOVERFLOW |
| 44 | select HAVE_GENERIC_DMA_COHERENT | 44 | select HAVE_GENERIC_DMA_COHERENT |
| 45 | select HAVE_KERNEL_GZIP | 45 | select HAVE_KERNEL_GZIP |
diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi index e114000a84f5..74d070cd3c13 100644 --- a/arch/arc/boot/dts/axs10x_mb.dtsi +++ b/arch/arc/boot/dts/axs10x_mb.dtsi | |||
| @@ -16,6 +16,12 @@ | |||
| 16 | ranges = <0x00000000 0x0 0xe0000000 0x10000000>; | 16 | ranges = <0x00000000 0x0 0xe0000000 0x10000000>; |
| 17 | interrupt-parent = <&mb_intc>; | 17 | interrupt-parent = <&mb_intc>; |
| 18 | 18 | ||
| 19 | creg_rst: reset-controller@11220 { | ||
| 20 | compatible = "snps,axs10x-reset"; | ||
| 21 | #reset-cells = <1>; | ||
| 22 | reg = <0x11220 0x4>; | ||
| 23 | }; | ||
| 24 | |||
| 19 | i2sclk: i2sclk@100a0 { | 25 | i2sclk: i2sclk@100a0 { |
| 20 | compatible = "snps,axs10x-i2s-pll-clock"; | 26 | compatible = "snps,axs10x-i2s-pll-clock"; |
| 21 | reg = <0x100a0 0x10>; | 27 | reg = <0x100a0 0x10>; |
| @@ -73,6 +79,8 @@ | |||
| 73 | clocks = <&apbclk>; | 79 | clocks = <&apbclk>; |
| 74 | clock-names = "stmmaceth"; | 80 | clock-names = "stmmaceth"; |
| 75 | max-speed = <100>; | 81 | max-speed = <100>; |
| 82 | resets = <&creg_rst 5>; | ||
| 83 | reset-names = "stmmaceth"; | ||
| 76 | }; | 84 | }; |
| 77 | 85 | ||
| 78 | ehci@0x40000 { | 86 | ehci@0x40000 { |
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 */ | ||
| 238 | struct 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 */ | ||
| 247 | struct 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 | |||
| 255 | struct 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 | |||
| 232 | struct bcr_generic { | 263 | struct 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/perf_event.c b/arch/arc/kernel/perf_event.c index 2ce24e74f879..8aec462d90fb 100644 --- a/arch/arc/kernel/perf_event.c +++ b/arch/arc/kernel/perf_event.c | |||
| @@ -336,15 +336,12 @@ static int arc_pmu_add(struct perf_event *event, int flags) | |||
| 336 | struct hw_perf_event *hwc = &event->hw; | 336 | struct hw_perf_event *hwc = &event->hw; |
| 337 | int idx = hwc->idx; | 337 | int idx = hwc->idx; |
| 338 | 338 | ||
| 339 | if (__test_and_set_bit(idx, pmu_cpu->used_mask)) { | 339 | idx = ffz(pmu_cpu->used_mask[0]); |
| 340 | idx = find_first_zero_bit(pmu_cpu->used_mask, | 340 | if (idx == arc_pmu->n_counters) |
| 341 | arc_pmu->n_counters); | 341 | return -EAGAIN; |
| 342 | if (idx == arc_pmu->n_counters) | 342 | |
| 343 | return -EAGAIN; | 343 | __set_bit(idx, pmu_cpu->used_mask); |
| 344 | 344 | hwc->idx = idx; | |
| 345 | __set_bit(idx, pmu_cpu->used_mask); | ||
| 346 | hwc->idx = idx; | ||
| 347 | } | ||
| 348 | 345 | ||
| 349 | write_aux_reg(ARC_REG_PCT_INDEX, idx); | 346 | write_aux_reg(ARC_REG_PCT_INDEX, idx); |
| 350 | 347 | ||
| @@ -377,21 +374,22 @@ static irqreturn_t arc_pmu_intr(int irq, void *dev) | |||
| 377 | struct perf_sample_data data; | 374 | struct perf_sample_data data; |
| 378 | struct arc_pmu_cpu *pmu_cpu = this_cpu_ptr(&arc_pmu_cpu); | 375 | struct arc_pmu_cpu *pmu_cpu = this_cpu_ptr(&arc_pmu_cpu); |
| 379 | struct pt_regs *regs; | 376 | struct pt_regs *regs; |
| 380 | int active_ints; | 377 | unsigned int active_ints; |
| 381 | int idx; | 378 | int idx; |
| 382 | 379 | ||
| 383 | arc_pmu_disable(&arc_pmu->pmu); | 380 | arc_pmu_disable(&arc_pmu->pmu); |
| 384 | 381 | ||
| 385 | active_ints = read_aux_reg(ARC_REG_PCT_INT_ACT); | 382 | active_ints = read_aux_reg(ARC_REG_PCT_INT_ACT); |
| 383 | if (!active_ints) | ||
| 384 | goto done; | ||
| 386 | 385 | ||
| 387 | regs = get_irq_regs(); | 386 | regs = get_irq_regs(); |
| 388 | 387 | ||
| 389 | for (idx = 0; idx < arc_pmu->n_counters; idx++) { | 388 | do { |
| 390 | struct perf_event *event = pmu_cpu->act_counter[idx]; | 389 | struct perf_event *event; |
| 391 | struct hw_perf_event *hwc; | 390 | struct hw_perf_event *hwc; |
| 392 | 391 | ||
| 393 | if (!(active_ints & (1 << idx))) | 392 | idx = __ffs(active_ints); |
| 394 | continue; | ||
| 395 | 393 | ||
| 396 | /* Reset interrupt flag by writing of 1 */ | 394 | /* Reset interrupt flag by writing of 1 */ |
| 397 | write_aux_reg(ARC_REG_PCT_INT_ACT, 1 << idx); | 395 | write_aux_reg(ARC_REG_PCT_INT_ACT, 1 << idx); |
| @@ -404,19 +402,22 @@ static irqreturn_t arc_pmu_intr(int irq, void *dev) | |||
| 404 | write_aux_reg(ARC_REG_PCT_INT_CTRL, | 402 | write_aux_reg(ARC_REG_PCT_INT_CTRL, |
| 405 | read_aux_reg(ARC_REG_PCT_INT_CTRL) | (1 << idx)); | 403 | read_aux_reg(ARC_REG_PCT_INT_CTRL) | (1 << idx)); |
| 406 | 404 | ||
| 405 | event = pmu_cpu->act_counter[idx]; | ||
| 407 | hwc = &event->hw; | 406 | hwc = &event->hw; |
| 408 | 407 | ||
| 409 | WARN_ON_ONCE(hwc->idx != idx); | 408 | WARN_ON_ONCE(hwc->idx != idx); |
| 410 | 409 | ||
| 411 | arc_perf_event_update(event, &event->hw, event->hw.idx); | 410 | arc_perf_event_update(event, &event->hw, event->hw.idx); |
| 412 | perf_sample_data_init(&data, 0, hwc->last_period); | 411 | perf_sample_data_init(&data, 0, hwc->last_period); |
| 413 | if (!arc_pmu_event_set_period(event)) | 412 | if (arc_pmu_event_set_period(event)) { |
| 414 | continue; | 413 | if (perf_event_overflow(event, &data, regs)) |
| 414 | arc_pmu_stop(event, 0); | ||
| 415 | } | ||
| 415 | 416 | ||
| 416 | if (perf_event_overflow(event, &data, regs)) | 417 | active_ints &= ~(1U << idx); |
| 417 | arc_pmu_stop(event, 0); | 418 | } while (active_ints); |
| 418 | } | ||
| 419 | 419 | ||
| 420 | done: | ||
| 420 | arc_pmu_enable(&arc_pmu->pmu); | 421 | arc_pmu_enable(&arc_pmu->pmu); |
| 421 | 422 | ||
| 422 | return IRQ_HANDLED; | 423 | return IRQ_HANDLED; |
| @@ -461,6 +462,7 @@ static int arc_pmu_device_probe(struct platform_device *pdev) | |||
| 461 | pr_err("This core does not have performance counters!\n"); | 462 | pr_err("This core does not have performance counters!\n"); |
| 462 | return -ENODEV; | 463 | return -ENODEV; |
| 463 | } | 464 | } |
| 465 | BUILD_BUG_ON(ARC_PERF_MAX_COUNTERS > 32); | ||
| 464 | BUG_ON(pct_bcr.c > ARC_PERF_MAX_COUNTERS); | 466 | BUG_ON(pct_bcr.c > ARC_PERF_MAX_COUNTERS); |
| 465 | 467 | ||
| 466 | READ_BCR(ARC_REG_CC_BUILD, cc_bcr); | 468 | READ_BCR(ARC_REG_CC_BUILD, cc_bcr); |
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 ? |
diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index 8ceefbf72fb0..4097764fea23 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c | |||
| @@ -762,21 +762,23 @@ void read_decode_mmu_bcr(void) | |||
| 762 | tmp = read_aux_reg(ARC_REG_MMU_BCR); | 762 | tmp = read_aux_reg(ARC_REG_MMU_BCR); |
| 763 | mmu->ver = (tmp >> 24); | 763 | mmu->ver = (tmp >> 24); |
| 764 | 764 | ||
| 765 | if (mmu->ver <= 2) { | 765 | if (is_isa_arcompact()) { |
| 766 | mmu2 = (struct bcr_mmu_1_2 *)&tmp; | 766 | if (mmu->ver <= 2) { |
| 767 | mmu->pg_sz_k = TO_KB(0x2000); | 767 | mmu2 = (struct bcr_mmu_1_2 *)&tmp; |
| 768 | mmu->sets = 1 << mmu2->sets; | 768 | mmu->pg_sz_k = TO_KB(0x2000); |
| 769 | mmu->ways = 1 << mmu2->ways; | 769 | mmu->sets = 1 << mmu2->sets; |
| 770 | mmu->u_dtlb = mmu2->u_dtlb; | 770 | mmu->ways = 1 << mmu2->ways; |
| 771 | mmu->u_itlb = mmu2->u_itlb; | 771 | mmu->u_dtlb = mmu2->u_dtlb; |
| 772 | } else if (mmu->ver == 3) { | 772 | mmu->u_itlb = mmu2->u_itlb; |
| 773 | mmu3 = (struct bcr_mmu_3 *)&tmp; | 773 | } else { |
| 774 | mmu->pg_sz_k = 1 << (mmu3->pg_sz - 1); | 774 | mmu3 = (struct bcr_mmu_3 *)&tmp; |
| 775 | mmu->sets = 1 << mmu3->sets; | 775 | mmu->pg_sz_k = 1 << (mmu3->pg_sz - 1); |
| 776 | mmu->ways = 1 << mmu3->ways; | 776 | mmu->sets = 1 << mmu3->sets; |
| 777 | mmu->u_dtlb = mmu3->u_dtlb; | 777 | mmu->ways = 1 << mmu3->ways; |
| 778 | mmu->u_itlb = mmu3->u_itlb; | 778 | mmu->u_dtlb = mmu3->u_dtlb; |
| 779 | mmu->sasid = mmu3->sasid; | 779 | mmu->u_itlb = mmu3->u_itlb; |
| 780 | mmu->sasid = mmu3->sasid; | ||
| 781 | } | ||
| 780 | } else { | 782 | } else { |
| 781 | mmu4 = (struct bcr_mmu_4 *)&tmp; | 783 | mmu4 = (struct bcr_mmu_4 *)&tmp; |
| 782 | mmu->pg_sz_k = 1 << (mmu4->sz0 - 1); | 784 | mmu->pg_sz_k = 1 << (mmu4->sz0 - 1); |
| @@ -818,8 +820,9 @@ int pae40_exist_but_not_enab(void) | |||
| 818 | 820 | ||
| 819 | void arc_mmu_init(void) | 821 | void arc_mmu_init(void) |
| 820 | { | 822 | { |
| 821 | char str[256]; | ||
| 822 | struct cpuinfo_arc_mmu *mmu = &cpuinfo_arc700[smp_processor_id()].mmu; | 823 | struct cpuinfo_arc_mmu *mmu = &cpuinfo_arc700[smp_processor_id()].mmu; |
| 824 | char str[256]; | ||
| 825 | int compat = 0; | ||
| 823 | 826 | ||
| 824 | pr_info("%s", arc_mmu_mumbojumbo(0, str, sizeof(str))); | 827 | pr_info("%s", arc_mmu_mumbojumbo(0, str, sizeof(str))); |
| 825 | 828 | ||
| @@ -834,15 +837,21 @@ void arc_mmu_init(void) | |||
| 834 | */ | 837 | */ |
| 835 | BUILD_BUG_ON(!IS_ALIGNED(STACK_TOP, PMD_SIZE)); | 838 | BUILD_BUG_ON(!IS_ALIGNED(STACK_TOP, PMD_SIZE)); |
| 836 | 839 | ||
| 837 | /* For efficiency sake, kernel is compile time built for a MMU ver | 840 | /* |
| 838 | * This must match the hardware it is running on. | 841 | * Ensure that MMU features assumed by kernel exist in hardware. |
| 839 | * Linux built for MMU V2, if run on MMU V1 will break down because V1 | 842 | * For older ARC700 cpus, it has to be exact match, since the MMU |
| 840 | * hardware doesn't understand cmds such as WriteNI, or IVUTLB | 843 | * revisions were not backwards compatible (MMUv3 TLB layout changed |
| 841 | * On the other hand, Linux built for V1 if run on MMU V2 will do | 844 | * so even if kernel for v2 didn't use any new cmds of v3, it would |
| 842 | * un-needed workarounds to prevent memcpy thrashing. | 845 | * still not work. |
| 843 | * Similarly MMU V3 has new features which won't work on older MMU | 846 | * For HS cpus, MMUv4 was baseline and v5 is backwards compatible |
| 847 | * (will run older software). | ||
| 844 | */ | 848 | */ |
| 845 | if (mmu->ver != CONFIG_ARC_MMU_VER) { | 849 | if (is_isa_arcompact() && mmu->ver == CONFIG_ARC_MMU_VER) |
| 850 | compat = 1; | ||
| 851 | else if (is_isa_arcv2() && mmu->ver >= CONFIG_ARC_MMU_VER) | ||
| 852 | compat = 1; | ||
| 853 | |||
| 854 | if (!compat) { | ||
| 846 | panic("MMU ver %d doesn't match kernel built for %d...\n", | 855 | panic("MMU ver %d doesn't match kernel built for %d...\n", |
| 847 | mmu->ver, CONFIG_ARC_MMU_VER); | 856 | mmu->ver, CONFIG_ARC_MMU_VER); |
| 848 | } | 857 | } |
diff --git a/arch/arc/plat-axs10x/Kconfig b/arch/arc/plat-axs10x/Kconfig index c54d1ae57fe0..4e0df7b7a248 100644 --- a/arch/arc/plat-axs10x/Kconfig +++ b/arch/arc/plat-axs10x/Kconfig | |||
| @@ -14,6 +14,8 @@ menuconfig ARC_PLAT_AXS10X | |||
| 14 | select MIGHT_HAVE_PCI | 14 | select MIGHT_HAVE_PCI |
| 15 | select GENERIC_IRQ_CHIP | 15 | select GENERIC_IRQ_CHIP |
| 16 | select GPIOLIB | 16 | select GPIOLIB |
| 17 | select AXS101 if ISA_ARCOMPACT | ||
| 18 | select AXS103 if ISA_ARCV2 | ||
| 17 | help | 19 | help |
| 18 | Support for the ARC AXS10x Software Development Platforms. | 20 | Support for the ARC AXS10x Software Development Platforms. |
| 19 | 21 | ||
diff --git a/arch/arc/plat-axs10x/axs10x.c b/arch/arc/plat-axs10x/axs10x.c index cf14ebc36916..f1ac6790da5f 100644 --- a/arch/arc/plat-axs10x/axs10x.c +++ b/arch/arc/plat-axs10x/axs10x.c | |||
| @@ -111,13 +111,6 @@ static void __init axs10x_early_init(void) | |||
| 111 | 111 | ||
| 112 | axs10x_enable_gpio_intc_wire(); | 112 | axs10x_enable_gpio_intc_wire(); |
| 113 | 113 | ||
| 114 | /* | ||
| 115 | * Reset ethernet IP core. | ||
| 116 | * TODO: get rid of this quirk after axs10x reset driver (or simple | ||
| 117 | * reset driver) will be available in upstream. | ||
| 118 | */ | ||
| 119 | iowrite32((1 << 5), (void __iomem *) CREG_MB_SW_RESET); | ||
| 120 | |||
| 121 | scnprintf(mb, 32, "MainBoard v%d", mb_rev); | 114 | scnprintf(mb, 32, "MainBoard v%d", mb_rev); |
| 122 | axs10x_print_board_ver(CREG_MB_VER, mb); | 115 | axs10x_print_board_ver(CREG_MB_VER, mb); |
| 123 | } | 116 | } |
