Skip to content

Commit df20597

Browse files
committed
Merge tag 'trbe-cortex-a510-errata' of gitolite.kernel.org:pub/scm/linux/kernel/git/coresight/linux into for-next/fixes
coresight: trbe: Workaround Cortex-A510 erratas This pull request is providing arm64 definitions to support TRBE Cortex-A510 erratas. Signed-off-by: Mathieu Poirier <[email protected]> * tag 'trbe-cortex-a510-errata' of gitolite.kernel.org:pub/scm/linux/kernel/git/coresight/linux: arm64: errata: Add detection for TRBE trace data corruption arm64: errata: Add detection for TRBE invalid prohibited states arm64: errata: Add detection for TRBE ignored system register writes arm64: Add Cortex-A510 CPU part definition
2 parents 9ae279e + 708e8af commit df20597

File tree

5 files changed

+97
-0
lines changed

5 files changed

+97
-0
lines changed

Documentation/arm64/silicon-errata.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ stable kernels.
5252
| Allwinner | A64/R18 | UNKNOWN1 | SUN50I_ERRATUM_UNKNOWN1 |
5353
+----------------+-----------------+-----------------+-----------------------------+
5454
+----------------+-----------------+-----------------+-----------------------------+
55+
| ARM | Cortex-A510 | #2064142 | ARM64_ERRATUM_2064142 |
56+
+----------------+-----------------+-----------------+-----------------------------+
57+
| ARM | Cortex-A510 | #2038923 | ARM64_ERRATUM_2038923 |
58+
+----------------+-----------------+-----------------+-----------------------------+
59+
| ARM | Cortex-A510 | #1902691 | ARM64_ERRATUM_1902691 |
60+
+----------------+-----------------+-----------------+-----------------------------+
5561
| ARM | Cortex-A53 | #826319 | ARM64_ERRATUM_826319 |
5662
+----------------+-----------------+-----------------+-----------------------------+
5763
| ARM | Cortex-A53 | #827319 | ARM64_ERRATUM_827319 |

arch/arm64/Kconfig

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,65 @@ config ARM64_ERRATUM_2224489
778778

779779
If unsure, say Y.
780780

781+
config ARM64_ERRATUM_2064142
782+
bool "Cortex-A510: 2064142: workaround TRBE register writes while disabled"
783+
depends on COMPILE_TEST # Until the CoreSight TRBE driver changes are in
784+
default y
785+
help
786+
This option adds the workaround for ARM Cortex-A510 erratum 2064142.
787+
788+
Affected Cortex-A510 core might fail to write into system registers after the
789+
TRBE has been disabled. Under some conditions after the TRBE has been disabled
790+
writes into TRBE registers TRBLIMITR_EL1, TRBPTR_EL1, TRBBASER_EL1, TRBSR_EL1,
791+
and TRBTRG_EL1 will be ignored and will not be effected.
792+
793+
Work around this in the driver by executing TSB CSYNC and DSB after collection
794+
is stopped and before performing a system register write to one of the affected
795+
registers.
796+
797+
If unsure, say Y.
798+
799+
config ARM64_ERRATUM_2038923
800+
bool "Cortex-A510: 2038923: workaround TRBE corruption with enable"
801+
depends on COMPILE_TEST # Until the CoreSight TRBE driver changes are in
802+
default y
803+
help
804+
This option adds the workaround for ARM Cortex-A510 erratum 2038923.
805+
806+
Affected Cortex-A510 core might cause an inconsistent view on whether trace is
807+
prohibited within the CPU. As a result, the trace buffer or trace buffer state
808+
might be corrupted. This happens after TRBE buffer has been enabled by setting
809+
TRBLIMITR_EL1.E, followed by just a single context synchronization event before
810+
execution changes from a context, in which trace is prohibited to one where it
811+
isn't, or vice versa. In these mentioned conditions, the view of whether trace
812+
is prohibited is inconsistent between parts of the CPU, and the trace buffer or
813+
the trace buffer state might be corrupted.
814+
815+
Work around this in the driver by preventing an inconsistent view of whether the
816+
trace is prohibited or not based on TRBLIMITR_EL1.E by immediately following a
817+
change to TRBLIMITR_EL1.E with at least one ISB instruction before an ERET, or
818+
two ISB instructions if no ERET is to take place.
819+
820+
If unsure, say Y.
821+
822+
config ARM64_ERRATUM_1902691
823+
bool "Cortex-A510: 1902691: workaround TRBE trace corruption"
824+
depends on COMPILE_TEST # Until the CoreSight TRBE driver changes are in
825+
default y
826+
help
827+
This option adds the workaround for ARM Cortex-A510 erratum 1902691.
828+
829+
Affected Cortex-A510 core might cause trace data corruption, when being written
830+
into the memory. Effectively TRBE is broken and hence cannot be used to capture
831+
trace data.
832+
833+
Work around this problem in the driver by just preventing TRBE initialization on
834+
affected cpus. The firmware must have disabled the access to TRBE for the kernel
835+
on such implementations. This will cover the kernel for any firmware that doesn't
836+
do this already.
837+
838+
If unsure, say Y.
839+
781840
config CAVIUM_ERRATUM_22375
782841
bool "Cavium erratum 22375, 24313"
783842
default y

arch/arm64/include/asm/cputype.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
#define ARM_CPU_PART_CORTEX_A76 0xD0B
7474
#define ARM_CPU_PART_NEOVERSE_N1 0xD0C
7575
#define ARM_CPU_PART_CORTEX_A77 0xD0D
76+
#define ARM_CPU_PART_CORTEX_A510 0xD46
7677
#define ARM_CPU_PART_CORTEX_A710 0xD47
7778
#define ARM_CPU_PART_CORTEX_X2 0xD48
7879
#define ARM_CPU_PART_NEOVERSE_N2 0xD49
@@ -116,6 +117,7 @@
116117
#define MIDR_CORTEX_A76 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A76)
117118
#define MIDR_NEOVERSE_N1 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N1)
118119
#define MIDR_CORTEX_A77 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A77)
120+
#define MIDR_CORTEX_A510 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A510)
119121
#define MIDR_CORTEX_A710 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A710)
120122
#define MIDR_CORTEX_X2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X2)
121123
#define MIDR_NEOVERSE_N2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N2)

arch/arm64/kernel/cpu_errata.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,33 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
599599
.type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
600600
CAP_MIDR_RANGE_LIST(trbe_write_out_of_range_cpus),
601601
},
602+
#endif
603+
#ifdef CONFIG_ARM64_ERRATUM_2064142
604+
{
605+
.desc = "ARM erratum 2064142",
606+
.capability = ARM64_WORKAROUND_2064142,
607+
608+
/* Cortex-A510 r0p0 - r0p2 */
609+
ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2)
610+
},
611+
#endif
612+
#ifdef CONFIG_ARM64_ERRATUM_2038923
613+
{
614+
.desc = "ARM erratum 2038923",
615+
.capability = ARM64_WORKAROUND_2038923,
616+
617+
/* Cortex-A510 r0p0 - r0p2 */
618+
ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2)
619+
},
620+
#endif
621+
#ifdef CONFIG_ARM64_ERRATUM_1902691
622+
{
623+
.desc = "ARM erratum 1902691",
624+
.capability = ARM64_WORKAROUND_1902691,
625+
626+
/* Cortex-A510 r0p0 - r0p1 */
627+
ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 1)
628+
},
602629
#endif
603630
{
604631
}

arch/arm64/tools/cpucaps

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ WORKAROUND_1418040
5555
WORKAROUND_1463225
5656
WORKAROUND_1508412
5757
WORKAROUND_1542419
58+
WORKAROUND_2064142
59+
WORKAROUND_2038923
60+
WORKAROUND_1902691
5861
WORKAROUND_TRBE_OVERWRITE_FILL_MODE
5962
WORKAROUND_TSB_FLUSH_FAILURE
6063
WORKAROUND_TRBE_WRITE_OUT_OF_RANGE

0 commit comments

Comments
 (0)