fix(cpus): workaround for Neoverse N2 erratum 2743089

Neoverse N2 erratum 2743089 is a Cat B erratum that applies to
all revisions <=r0p2 and is fixed in r0p3. The workaround is to
insert a dsb before the isb in the power down sequence.

SDEN documentation:
https://developer.arm.com/documentation/SDEN1982442/latest

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: Idec862226bd32c91374a8bbd5d73d7ee480a34d9
This commit is contained in:
Bipin Ravi 2022-12-07 17:01:26 -06:00
parent e7abef9036
commit 1ee7c8232c
3 changed files with 51 additions and 8 deletions

View file

@ -574,6 +574,10 @@ For Neoverse N2, the following errata build flags are defined :
CPU. This needs to be enabled for revision r0p0 of the CPU, it is fixed in CPU. This needs to be enabled for revision r0p0 of the CPU, it is fixed in
r0p1. r0p1.
- ``ERRATA_N2_2743089``: This applies errata 2743089 workaround to Neoverse-N2
CPU. This needs to be enabled for revisions r0p0, r0p1 and r0p2. It is fixed
in r0p3.
For Cortex-X2, the following errata build flags are defined : For Cortex-X2, the following errata build flags are defined :
- ``ERRATA_X2_2002765``: This applies errata 2002765 workaround to Cortex-X2 - ``ERRATA_X2_2002765``: This applies errata 2002765 workaround to Cortex-X2

View file

@ -428,6 +428,30 @@ func check_errata_2388450
b cpu_rev_var_ls b cpu_rev_var_ls
endfunc check_errata_2388450 endfunc check_errata_2388450
/* -------------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2743089.
* This applies to revisions <= r0p2 and is fixed in r0p3.
* x0: variant[4:7] and revision[0:3] of current cpu.
* Shall clobber: x0-x17
* -------------------------------------------------------
*/
func errata_n2_2743089_wa
mov x17, x30
bl check_errata_2743089
cbz x0, 1f
/* dsb before isb of power down sequence */
dsb sy
1:
ret x17
endfunc errata_n2_2743089_wa
func check_errata_2743089
/* Applies to all revisions <= r0p2 */
mov x1, #0x02
b cpu_rev_var_ls
endfunc check_errata_2743089
func check_errata_cve_2022_23960 func check_errata_cve_2022_23960
#if WORKAROUND_CVE_2022_23960 #if WORKAROUND_CVE_2022_23960
mov x0, #ERRATA_APPLIES mov x0, #ERRATA_APPLIES
@ -576,6 +600,12 @@ func neoverse_n2_core_pwr_dwn
mrs x0, NEOVERSE_N2_CPUPWRCTLR_EL1 mrs x0, NEOVERSE_N2_CPUPWRCTLR_EL1
orr x0, x0, #NEOVERSE_N2_CORE_PWRDN_EN_BIT orr x0, x0, #NEOVERSE_N2_CORE_PWRDN_EN_BIT
msr NEOVERSE_N2_CPUPWRCTLR_EL1, x0 msr NEOVERSE_N2_CPUPWRCTLR_EL1, x0
#if ERRATA_N2_2743089
mov x15, x30
bl cpu_get_rev_var
bl errata_n2_2743089_wa
mov x30, x15
#endif /* ERRATA_N2_2743089 */
isb isb
ret ret
endfunc neoverse_n2_core_pwr_dwn endfunc neoverse_n2_core_pwr_dwn
@ -607,6 +637,7 @@ func neoverse_n2_errata_report
report_errata ERRATA_N2_2326639, neoverse_n2, 2326639 report_errata ERRATA_N2_2326639, neoverse_n2, 2326639
report_errata ERRATA_N2_2376738, neoverse_n2, 2376738 report_errata ERRATA_N2_2376738, neoverse_n2, 2376738
report_errata ERRATA_N2_2388450, neoverse_n2, 2388450 report_errata ERRATA_N2_2388450, neoverse_n2, 2388450
report_errata ERRATA_N2_2743089, neoverse_n2, 2743089
report_errata WORKAROUND_CVE_2022_23960, neoverse_n2, cve_2022_23960 report_errata WORKAROUND_CVE_2022_23960, neoverse_n2, cve_2022_23960
report_errata ERRATA_DSU_2313941, neoverse_n2, dsu_2313941 report_errata ERRATA_DSU_2313941, neoverse_n2, dsu_2313941

View file

@ -467,10 +467,6 @@ ERRATA_N1_1946160 ?=0
# applies to all revisions <= r4p1 of the Neoverse N1 cpu and is still open. # applies to all revisions <= r4p1 of the Neoverse N1 cpu and is still open.
ERRATA_N1_2743102 ?=0 ERRATA_N1_2743102 ?=0
# Flag to apply erratum 2002655 workaround during reset. This erratum applies
# to revisions r0p0 of the Neoverse-N2 cpu, it is still open.
ERRATA_N2_2002655 ?=0
# Flag to apply erratum 1618635 workaround during reset. This erratum applies # Flag to apply erratum 1618635 workaround during reset. This erratum applies
# to revision r0p0 of the Neoverse V1 cpu and was fixed in the revision r1p0. # to revision r0p0 of the Neoverse V1 cpu and was fixed in the revision r1p0.
ERRATA_V1_1618635 ?=0 ERRATA_V1_1618635 ?=0
@ -587,6 +583,10 @@ ERRATA_A710_2371105 ?=0
# still open. # still open.
ERRATA_A710_2768515 ?=0 ERRATA_A710_2768515 ?=0
# Flag to apply erratum 2002655 workaround during reset. This erratum applies
# to revisions r0p0 of the Neoverse-N2 cpu, it is still open.
ERRATA_N2_2002655 ?=0
# Flag to apply erratum 2067956 workaround during reset. This erratum applies # Flag to apply erratum 2067956 workaround during reset. This erratum applies
# to revision r0p0 of the Neoverse N2 cpu and is still open. # to revision r0p0 of the Neoverse N2 cpu and is still open.
ERRATA_N2_2067956 ?=0 ERRATA_N2_2067956 ?=0
@ -635,6 +635,10 @@ ERRATA_N2_2376738 ?=0
# to revision r0p0 of the Neoverse N2 cpu, it is fixed in r0p1. # to revision r0p0 of the Neoverse N2 cpu, it is fixed in r0p1.
ERRATA_N2_2388450 ?=0 ERRATA_N2_2388450 ?=0
# Flag to apply erratum 2743089 workaround during during powerdown. This erratum
# applies to all revisions <= r0p2 of the Neoverse N2 cpu, it is fixed in r0p3.
ERRATA_N2_2743089 ?=0
# Flag to apply erratum 2002765 workaround during reset. This erratum applies # Flag to apply erratum 2002765 workaround during reset. This erratum applies
# to revisions r0p0, r1p0, and r2p0 of the Cortex-X2 cpu and is still open. # to revisions r0p0, r1p0, and r2p0 of the Cortex-X2 cpu and is still open.
ERRATA_X2_2002765 ?=0 ERRATA_X2_2002765 ?=0
@ -1123,10 +1127,6 @@ $(eval $(call add_define,ERRATA_N1_1946160))
# Process ERRATA_N1_2743102 flag # Process ERRATA_N1_2743102 flag
$(eval $(call assert_boolean,ERRATA_N1_2743102)) $(eval $(call assert_boolean,ERRATA_N1_2743102))
$(eval $(call add_define,ERRATA_N1_2743102)) $(eval $(call add_define,ERRATA_N1_2743102))
#
# Process ERRATA_N2_2002655 flag
$(eval $(call assert_boolean,ERRATA_N2_2002655))
$(eval $(call add_define,ERRATA_N2_2002655))
# Process ERRATA_V1_1618635 flag # Process ERRATA_V1_1618635 flag
$(eval $(call assert_boolean,ERRATA_V1_1618635)) $(eval $(call assert_boolean,ERRATA_V1_1618635))
@ -1240,6 +1240,10 @@ $(eval $(call add_define,ERRATA_A710_2371105))
$(eval $(call assert_boolean,ERRATA_A710_2768515)) $(eval $(call assert_boolean,ERRATA_A710_2768515))
$(eval $(call add_define,ERRATA_A710_2768515)) $(eval $(call add_define,ERRATA_A710_2768515))
# Process ERRATA_N2_2002655 flag
$(eval $(call assert_boolean,ERRATA_N2_2002655))
$(eval $(call add_define,ERRATA_N2_2002655))
# Process ERRATA_N2_2067956 flag # Process ERRATA_N2_2067956 flag
$(eval $(call assert_boolean,ERRATA_N2_2067956)) $(eval $(call assert_boolean,ERRATA_N2_2067956))
$(eval $(call add_define,ERRATA_N2_2067956)) $(eval $(call add_define,ERRATA_N2_2067956))
@ -1288,6 +1292,10 @@ $(eval $(call add_define,ERRATA_N2_2376738))
$(eval $(call assert_boolean,ERRATA_N2_2388450)) $(eval $(call assert_boolean,ERRATA_N2_2388450))
$(eval $(call add_define,ERRATA_N2_2388450)) $(eval $(call add_define,ERRATA_N2_2388450))
# Process ERRATA_N2_2743089 flag
$(eval $(call assert_boolean,ERRATA_N2_2743089))
$(eval $(call add_define,ERRATA_N2_2743089))
# Process ERRATA_X2_2002765 flag # Process ERRATA_X2_2002765 flag
$(eval $(call assert_boolean,ERRATA_X2_2002765)) $(eval $(call assert_boolean,ERRATA_X2_2002765))
$(eval $(call add_define,ERRATA_X2_2002765)) $(eval $(call add_define,ERRATA_X2_2002765))