diff options
author | nayanpatel-arm <nayankumar.patel@arm.com> | 2021-10-20 17:30:46 -0700 |
---|---|---|
committer | nayanpatel-arm <nayankumar.patel@arm.com> | 2021-11-04 13:01:13 -0700 |
commit | 0d2d99924e1be548e75c46cfd536f7503cf863e0 (patch) | |
tree | 0acbfaf974cd8dd869ee687a35896306409c4b81 /lib | |
parent | 603806d1376c4b18211fb1d4cc338153de026c32 (diff) | |
download | arm-trusted-firmware-0d2d99924e1be548e75c46cfd536f7503cf863e0.tar.gz |
fix(errata): workaround for Neoverse-N2 erratum 2280757
Neoverse-N2 erratum 2280757 is a Cat B erratum that applies to
revision r0p0 of CPU. It is still open. The workaround
is to set CPUACTLR_EL1[22] to 1'b1. Setting CPUACTLR_EL1[22]
will cause CFP instruction to invalidate all branch predictor
resources regardless of context.
SDEN can be found here:
https://developer.arm.com/documentation/SDEN1982442/latest
Signed-off-by: nayanpatel-arm <nayankumar.patel@arm.com>
Change-Id: I615bcc1f993c45659b8b6f1a34fca0eb490f8add
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cpus/aarch64/neoverse_n2.S | 34 | ||||
-rw-r--r-- | lib/cpus/cpu-ops.mk | 8 |
2 files changed, 42 insertions, 0 deletions
diff --git a/lib/cpus/aarch64/neoverse_n2.S b/lib/cpus/aarch64/neoverse_n2.S index 869aa41e1..621aded7c 100644 --- a/lib/cpus/aarch64/neoverse_n2.S +++ b/lib/cpus/aarch64/neoverse_n2.S @@ -305,6 +305,34 @@ func check_errata_2242400 b cpu_rev_var_ls endfunc check_errata_2242400 +/* -------------------------------------------------- + * Errata Workaround for Neoverse N2 Erratum 2280757. + * This applies to revision r0p0 of Neoverse N2. it is still open. + * Inputs: + * x0: variant[4:7] and revision[0:3] of current cpu. + * Shall clobber: x0-x1, x17 + * -------------------------------------------------- + */ +func errata_n2_2280757_wa + /* Check revision. */ + mov x17, x30 + bl check_errata_2280757 + cbz x0, 1f + + /* Apply instruction patching sequence */ + mrs x1, NEOVERSE_N2_CPUACTLR_EL1 + orr x1, x1, NEOVERSE_N2_CPUACTLR_EL1_BIT_22 + msr NEOVERSE_N2_CPUACTLR_EL1, x1 +1: + ret x17 +endfunc errata_n2_2280757_wa + +func check_errata_2280757 + /* Applies to r0p0 */ + mov x1, #0x00 + b cpu_rev_var_ls +endfunc check_errata_2280757 + /* ------------------------------------------- * The CPU Ops reset function for Neoverse N2. * ------------------------------------------- @@ -366,6 +394,11 @@ func neoverse_n2_reset_func bl errata_n2_2242400_wa #endif +#if ERRATA_N2_2280757 + mov x0, x18 + bl errata_n2_2280757_wa +#endif + #if ENABLE_AMU /* Make sure accesses from EL0/EL1 and EL2 are not trapped to EL3 */ mrs x0, cptr_el3 @@ -435,6 +468,7 @@ func neoverse_n2_errata_report report_errata ERRATA_N2_2242415, neoverse_n2, 2242415 report_errata ERRATA_N2_2138958, neoverse_n2, 2138958 report_errata ERRATA_N2_2242400, neoverse_n2, 2242400 + report_errata ERRATA_N2_2280757, neoverse_n2, 2280757 ldp x8, x30, [sp], #16 ret diff --git a/lib/cpus/cpu-ops.mk b/lib/cpus/cpu-ops.mk index f0da13919..cdb978b09 100644 --- a/lib/cpus/cpu-ops.mk +++ b/lib/cpus/cpu-ops.mk @@ -473,6 +473,10 @@ ERRATA_N2_2138958 ?=0 # to revision r0p0 of the Neoverse N2 cpu and is still open. ERRATA_N2_2242400 ?=0 +# Flag to apply erratum 2280757 workaround during reset. This erratum applies +# to revision r0p0 of the Neoverse N2 cpu and is still open. +ERRATA_N2_2280757 ?=0 + # Flag to apply erratum 2055002 workaround during reset. This erratum applies # to revision r1p0, r2p0 of the Cortex-A710 cpu and is still open. ERRATA_A710_2055002 ?=0 @@ -886,6 +890,10 @@ $(eval $(call add_define,ERRATA_N2_2138958)) $(eval $(call assert_boolean,ERRATA_N2_2242400)) $(eval $(call add_define,ERRATA_N2_2242400)) +# Process ERRATA_N2_2280757 flag +$(eval $(call assert_boolean,ERRATA_N2_2280757)) +$(eval $(call add_define,ERRATA_N2_2280757)) + # Process ERRATA_A710_2055002 flag $(eval $(call assert_boolean,ERRATA_A710_2055002)) $(eval $(call add_define,ERRATA_A710_2055002)) |