fix(cpus): workaround for Cortex-A710 erratum 2768515

Cortex-A710 erratum 2768515 is a Cat B erratum that applies to
all revisions <=r2p1 and is still open. The workaround is to
insert a dsb before the isb in the power down sequence.

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

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: If17fe04d3fda0dba6b8aabdd837a1c53e1830ed5
This commit is contained in:
Bipin Ravi 2022-12-07 13:32:35 -06:00
parent 10f4d1a2d0
commit b87b02cf1d
3 changed files with 44 additions and 0 deletions

View file

@ -518,6 +518,10 @@ For Cortex-A710, the following errata build flags are defined :
Cortex-A710 CPU. This needs to be enabled for revisions r0p0, r1p0 and r2p0 Cortex-A710 CPU. This needs to be enabled for revisions r0p0, r1p0 and r2p0
of the CPU and is fixed in r2p1. of the CPU and is fixed in r2p1.
- ``ERRATA_A710_2768515``: This applies errata 2768515 workaround to
Cortex-A710 CPU. This needs to be enabled for revisions r0p0, r1p0, r2p0 and
r2p1 of the CPU and is still open.
For Neoverse N2, the following errata build flags are defined : For Neoverse N2, the following errata build flags are defined :
- ``ERRATA_N2_2002655``: This applies errata 2002655 workaround to Neoverse-N2 - ``ERRATA_N2_2002655``: This applies errata 2002655 workaround to Neoverse-N2

View file

@ -482,6 +482,30 @@ func check_errata_2371105
b cpu_rev_var_ls b cpu_rev_var_ls
endfunc check_errata_2371105 endfunc check_errata_2371105
/* ----------------------------------------------------
* Errata Workaround for Cortex-A710 Errata #2768515
* This applies to revisions <= r2p1 and is still open.
* x0: variant[4:7] and revision[0:3] of current cpu.
* Shall clobber: x0-x17
* ----------------------------------------------------
*/
func errata_a710_2768515_wa
mov x17, x30
bl check_errata_2768515
cbz x0, 1f
/* dsb before isb of power down sequence */
dsb sy
1:
ret x17
endfunc errata_a710_2768515_wa
func check_errata_2768515
/* Applies to all revisions <= r2p1 */
mov x1, #0x21
b cpu_rev_var_ls
endfunc check_errata_2768515
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
@ -518,6 +542,12 @@ func cortex_a710_core_pwr_dwn
mrs x0, CORTEX_A710_CPUPWRCTLR_EL1 mrs x0, CORTEX_A710_CPUPWRCTLR_EL1
orr x0, x0, #CORTEX_A710_CPUPWRCTLR_EL1_CORE_PWRDN_BIT orr x0, x0, #CORTEX_A710_CPUPWRCTLR_EL1_CORE_PWRDN_BIT
msr CORTEX_A710_CPUPWRCTLR_EL1, x0 msr CORTEX_A710_CPUPWRCTLR_EL1, x0
#if ERRATA_A710_2768515
mov x15, x30
bl cpu_get_rev_var
bl errata_a710_2768515_wa
mov x30, x15
#endif /* ERRATA_A710_2768515 */
isb isb
ret ret
endfunc cortex_a710_core_pwr_dwn endfunc cortex_a710_core_pwr_dwn
@ -550,6 +580,7 @@ func cortex_a710_errata_report
report_errata ERRATA_A710_2216384, cortex_a710, 2216384 report_errata ERRATA_A710_2216384, cortex_a710, 2216384
report_errata ERRATA_A710_2291219, cortex_a710, 2291219 report_errata ERRATA_A710_2291219, cortex_a710, 2291219
report_errata ERRATA_A710_2371105, cortex_a710, 2371105 report_errata ERRATA_A710_2371105, cortex_a710, 2371105
report_errata ERRATA_A710_2768515, cortex_a710, 2768515
report_errata WORKAROUND_CVE_2022_23960, cortex_a710, cve_2022_23960 report_errata WORKAROUND_CVE_2022_23960, cortex_a710, cve_2022_23960
report_errata ERRATA_DSU_2313941, cortex_a710, dsu_2313941 report_errata ERRATA_DSU_2313941, cortex_a710, dsu_2313941

View file

@ -572,6 +572,11 @@ ERRATA_A710_2008768 ?=0
# to revision r0p0, r1p0 and r2p0 of the Cortex-A710 cpu and is fixed in r2p1. # to revision r0p0, r1p0 and r2p0 of the Cortex-A710 cpu and is fixed in r2p1.
ERRATA_A710_2371105 ?=0 ERRATA_A710_2371105 ?=0
# Flag to apply erratum 2768515 workaround during power down. This erratum
# applies to revision r0p0, r1p0, r2p0 and r2p1 of the Cortex-A710 cpu and is
# still open.
ERRATA_A710_2768515 ?=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
@ -1208,6 +1213,10 @@ $(eval $(call add_define,ERRATA_A710_2008768))
$(eval $(call assert_boolean,ERRATA_A710_2371105)) $(eval $(call assert_boolean,ERRATA_A710_2371105))
$(eval $(call add_define,ERRATA_A710_2371105)) $(eval $(call add_define,ERRATA_A710_2371105))
# Process ERRATA_A710_2768515 flag
$(eval $(call assert_boolean,ERRATA_A710_2768515))
$(eval $(call add_define,ERRATA_A710_2768515))
# 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))