summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm64/Kconfig12
-rw-r--r--arch/arm64/include/asm/cpucaps.h3
-rw-r--r--arch/arm64/include/asm/cputype.h2
-rw-r--r--arch/arm64/kernel/cpu_errata.c8
-rw-r--r--drivers/clocksource/arm_arch_timer.c15
5 files changed, 39 insertions, 1 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index da5e6f085561..52985d175e5a 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -481,6 +481,18 @@ config ARM64_ERRATUM_1024718
481 481
482 If unsure, say Y. 482 If unsure, say Y.
483 483
484config ARM64_ERRATUM_1188873
485 bool "Cortex-A76: MRC read following MRRC read of specific Generic Timer in AArch32 might give incorrect result"
486 default y
487 help
488 This option adds work arounds for ARM Cortex-A76 erratum 1188873
489
490 Affected Cortex-A76 cores (r0p0, r1p0, r2p0) could cause
491 register corruption when accessing the timer registers from
492 AArch32 userspace.
493
494 If unsure, say Y.
495
484config CAVIUM_ERRATUM_22375 496config CAVIUM_ERRATUM_22375
485 bool "Cavium erratum 22375, 24313" 497 bool "Cavium erratum 22375, 24313"
486 default y 498 default y
diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
index 6eb1b3fd0493..6e2d254c09eb 100644
--- a/arch/arm64/include/asm/cpucaps.h
+++ b/arch/arm64/include/asm/cpucaps.h
@@ -53,7 +53,8 @@
53#define ARM64_HAS_STAGE2_FWB 32 53#define ARM64_HAS_STAGE2_FWB 32
54#define ARM64_HAS_CRC32 33 54#define ARM64_HAS_CRC32 33
55#define ARM64_SSBS 34 55#define ARM64_SSBS 34
56#define ARM64_WORKAROUND_1188873 35
56 57
57#define ARM64_NCAPS 35 58#define ARM64_NCAPS 36
58 59
59#endif /* __ASM_CPUCAPS_H */ 60#endif /* __ASM_CPUCAPS_H */
diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
index ea690b3562af..12f93e4d2452 100644
--- a/arch/arm64/include/asm/cputype.h
+++ b/arch/arm64/include/asm/cputype.h
@@ -86,6 +86,7 @@
86#define ARM_CPU_PART_CORTEX_A75 0xD0A 86#define ARM_CPU_PART_CORTEX_A75 0xD0A
87#define ARM_CPU_PART_CORTEX_A35 0xD04 87#define ARM_CPU_PART_CORTEX_A35 0xD04
88#define ARM_CPU_PART_CORTEX_A55 0xD05 88#define ARM_CPU_PART_CORTEX_A55 0xD05
89#define ARM_CPU_PART_CORTEX_A76 0xD0B
89 90
90#define APM_CPU_PART_POTENZA 0x000 91#define APM_CPU_PART_POTENZA 0x000
91 92
@@ -110,6 +111,7 @@
110#define MIDR_CORTEX_A75 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A75) 111#define MIDR_CORTEX_A75 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A75)
111#define MIDR_CORTEX_A35 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A35) 112#define MIDR_CORTEX_A35 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A35)
112#define MIDR_CORTEX_A55 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A55) 113#define MIDR_CORTEX_A55 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A55)
114#define MIDR_CORTEX_A76 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A76)
113#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX) 115#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)
114#define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX) 116#define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)
115#define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX) 117#define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX)
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index 20be4c578e0a..cde948991d68 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -697,6 +697,14 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
697 .matches = has_ssbd_mitigation, 697 .matches = has_ssbd_mitigation,
698 }, 698 },
699#endif 699#endif
700#ifdef CONFIG_ARM64_ERRATUM_1188873
701 {
702 /* Cortex-A76 r0p0 to r2p0 */
703 .desc = "ARM erratum 1188873",
704 .capability = ARM64_WORKAROUND_1188873,
705 ERRATA_MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 2, 0),
706 },
707#endif
700 { 708 {
701 } 709 }
702}; 710};
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index d8c7f5750cdb..9a7d4dc00b6e 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -319,6 +319,13 @@ static u64 notrace arm64_858921_read_cntvct_el0(void)
319} 319}
320#endif 320#endif
321 321
322#ifdef CONFIG_ARM64_ERRATUM_1188873
323static u64 notrace arm64_1188873_read_cntvct_el0(void)
324{
325 return read_sysreg(cntvct_el0);
326}
327#endif
328
322#ifdef CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND 329#ifdef CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND
323DEFINE_PER_CPU(const struct arch_timer_erratum_workaround *, timer_unstable_counter_workaround); 330DEFINE_PER_CPU(const struct arch_timer_erratum_workaround *, timer_unstable_counter_workaround);
324EXPORT_SYMBOL_GPL(timer_unstable_counter_workaround); 331EXPORT_SYMBOL_GPL(timer_unstable_counter_workaround);
@@ -408,6 +415,14 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = {
408 .read_cntvct_el0 = arm64_858921_read_cntvct_el0, 415 .read_cntvct_el0 = arm64_858921_read_cntvct_el0,
409 }, 416 },
410#endif 417#endif
418#ifdef CONFIG_ARM64_ERRATUM_1188873
419 {
420 .match_type = ate_match_local_cap_id,
421 .id = (void *)ARM64_WORKAROUND_1188873,
422 .desc = "ARM erratum 1188873",
423 .read_cntvct_el0 = arm64_1188873_read_cntvct_el0,
424 },
425#endif
411}; 426};
412 427
413typedef bool (*ate_match_fn_t)(const struct arch_timer_erratum_workaround *, 428typedef bool (*ate_match_fn_t)(const struct arch_timer_erratum_workaround *,