mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-27 15:24:54 +00:00
fix(errata): workaround for Cortex-A510 erratum 1922240
Cortex-A510 erratum 1922240 is a Cat B erratum that applies to revision r0p0 and is fixed in r0p1. Since no errata framework code existed for A510 prior to this patch, it has been added as well. Also some general cleanup changes in the CPU lib makefile. SDEN can be found here: https://developer.arm.com/documentation/SDEN2397239 Signed-off-by: John Powell <john.powell@arm.com> Change-Id: I8c427ef255cb4b38ed3e5c2c7444fcef957277e4
This commit is contained in:
parent
8a855bd243
commit
83435637bf
4 changed files with 131 additions and 59 deletions
|
@ -474,6 +474,12 @@ For Cortex-X2, the following errata build flags are defined :
|
||||||
Cortex-X2 CPU. This needs to be enabled only for revisions r0p0, r1p0 and
|
Cortex-X2 CPU. This needs to be enabled only for revisions r0p0, r1p0 and
|
||||||
r2p0 of the CPU, it is fixed in r2p1.
|
r2p0 of the CPU, it is fixed in r2p1.
|
||||||
|
|
||||||
|
For Cortex-A510, the following errata build flags are defined :
|
||||||
|
|
||||||
|
- ``ERRATA_A510_1922240``: This applies errata 1922240 workaround to
|
||||||
|
Cortex-A510 CPU. This needs to be enabled only for revision r0p0, it is
|
||||||
|
fixed in r0p1.
|
||||||
|
|
||||||
DSU Errata Workarounds
|
DSU Errata Workarounds
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2021, ARM Limited. All rights reserved.
|
* Copyright (c) 2022, ARM Limited. All rights reserved.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -20,4 +20,9 @@
|
||||||
#define CORTEX_A510_CPUPWRCTLR_EL1 S3_0_C15_C2_7
|
#define CORTEX_A510_CPUPWRCTLR_EL1 S3_0_C15_C2_7
|
||||||
#define CORTEX_A510_CPUPWRCTLR_EL1_CORE_PWRDN_BIT U(1)
|
#define CORTEX_A510_CPUPWRCTLR_EL1_CORE_PWRDN_BIT U(1)
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Complex auxiliary control register specific definitions
|
||||||
|
******************************************************************************/
|
||||||
|
#define CORTEX_A510_CMPXACTLR_EL1 S3_0_C15_C1_3
|
||||||
|
|
||||||
#endif /* CORTEX_A510_H */
|
#endif /* CORTEX_A510_H */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2021, ARM Limited. All rights reserved.
|
* Copyright (c) 2022, ARM Limited. All rights reserved.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -13,14 +13,43 @@
|
||||||
|
|
||||||
/* Hardware handled coherency */
|
/* Hardware handled coherency */
|
||||||
#if HW_ASSISTED_COHERENCY == 0
|
#if HW_ASSISTED_COHERENCY == 0
|
||||||
#error "Cortex A510 must be compiled with HW_ASSISTED_COHERENCY enabled"
|
#error "Cortex-A510 must be compiled with HW_ASSISTED_COHERENCY enabled"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* 64-bit only core */
|
/* 64-bit only core */
|
||||||
#if CTX_INCLUDE_AARCH32_REGS == 1
|
#if CTX_INCLUDE_AARCH32_REGS == 1
|
||||||
#error "Cortex A510 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
|
#error "Cortex-A510 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* --------------------------------------------------
|
||||||
|
* Errata Workaround for Cortex-A510 Errata #1922240.
|
||||||
|
* This applies only to revision r0p0 (fixed in r0p1)
|
||||||
|
* x0: variant[4:7] and revision[0:3] of current cpu.
|
||||||
|
* Shall clobber: x0, x1, x17
|
||||||
|
* --------------------------------------------------
|
||||||
|
*/
|
||||||
|
func errata_cortex_a510_1922240_wa
|
||||||
|
/* Check workaround compatibility. */
|
||||||
|
mov x17, x30
|
||||||
|
bl check_errata_1922240
|
||||||
|
cbz x0, 1f
|
||||||
|
|
||||||
|
/* Apply the workaround by setting IMP_CMPXACTLR_EL1[11:10] = 0b11. */
|
||||||
|
mrs x0, CORTEX_A510_CMPXACTLR_EL1
|
||||||
|
mov x1, #3
|
||||||
|
bfi x0, x1, #10, #2
|
||||||
|
msr CORTEX_A510_CMPXACTLR_EL1, x0
|
||||||
|
|
||||||
|
1:
|
||||||
|
ret x17
|
||||||
|
endfunc errata_cortex_a510_1922240_wa
|
||||||
|
|
||||||
|
func check_errata_1922240
|
||||||
|
/* Applies to r0p0 only */
|
||||||
|
mov x1, #0x00
|
||||||
|
b cpu_rev_var_ls
|
||||||
|
endfunc check_errata_1922240
|
||||||
|
|
||||||
/* ----------------------------------------------------
|
/* ----------------------------------------------------
|
||||||
* HW will do the cache maintenance while powering down
|
* HW will do the cache maintenance while powering down
|
||||||
* ----------------------------------------------------
|
* ----------------------------------------------------
|
||||||
|
@ -38,19 +67,43 @@ func cortex_a510_core_pwr_dwn
|
||||||
endfunc cortex_a510_core_pwr_dwn
|
endfunc cortex_a510_core_pwr_dwn
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Errata printing function for Cortex A510. Must follow AAPCS.
|
* Errata printing function for Cortex-A510. Must follow AAPCS.
|
||||||
*/
|
*/
|
||||||
#if REPORT_ERRATA
|
#if REPORT_ERRATA
|
||||||
func cortex_a510_errata_report
|
func cortex_a510_errata_report
|
||||||
|
stp x8, x30, [sp, #-16]!
|
||||||
|
|
||||||
|
bl cpu_get_rev_var
|
||||||
|
mov x8, x0
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Report all errata. The revision-variant information is passed to
|
||||||
|
* checking functions of each errata.
|
||||||
|
*/
|
||||||
|
report_errata ERRATA_A510_1922240, cortex_a510, 1922240
|
||||||
|
|
||||||
|
ldp x8, x30, [sp], #16
|
||||||
ret
|
ret
|
||||||
endfunc cortex_a510_errata_report
|
endfunc cortex_a510_errata_report
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
func cortex_a510_reset_func
|
func cortex_a510_reset_func
|
||||||
|
mov x19, x30
|
||||||
|
|
||||||
/* Disable speculative loads */
|
/* Disable speculative loads */
|
||||||
msr SSBS, xzr
|
msr SSBS, xzr
|
||||||
isb
|
isb
|
||||||
ret
|
|
||||||
|
/* Get the CPU revision and stash it in x18. */
|
||||||
|
bl cpu_get_rev_var
|
||||||
|
mov x18, x0
|
||||||
|
|
||||||
|
#if ERRATA_A510_1922240
|
||||||
|
mov x0, x18
|
||||||
|
bl errata_cortex_a510_1922240_wa
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ret x19
|
||||||
endfunc cortex_a510_reset_func
|
endfunc cortex_a510_reset_func
|
||||||
|
|
||||||
/* ---------------------------------------------
|
/* ---------------------------------------------
|
||||||
|
|
|
@ -451,6 +451,22 @@ ERRATA_A710_2083908 ?=0
|
||||||
# to revisions r0p0, r1p0 and r2p0 of the Cortex-A710 cpu and is still open.
|
# to revisions r0p0, r1p0 and r2p0 of the Cortex-A710 cpu and is still open.
|
||||||
ERRATA_A710_2058056 ?=0
|
ERRATA_A710_2058056 ?=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
|
||||||
|
|
||||||
|
# Flag to apply erratum 2017096 workaround during reset. This erratum applies
|
||||||
|
# to revision r0p0, r1p0 and r2p0 of the Cortex-A710 cpu and is still open.
|
||||||
|
ERRATA_A710_2017096 ?=0
|
||||||
|
|
||||||
|
# Flag to apply erratum 2267065 workaround during reset. This erratum applies
|
||||||
|
# to revision r0p0, r1p0 and r2p0 of the Cortex-A710 cpu and is fixed in r2p1.
|
||||||
|
ERRATA_A710_2267065 ?=0
|
||||||
|
|
||||||
|
# Flag to apply erratum 2136059 workaround during reset. This erratum applies
|
||||||
|
# to revision r0p0, r1p0 and r2p0 of the Cortex-A710 cpu and is fixed in r2p1.
|
||||||
|
ERRATA_A710_2136059 ?=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
|
||||||
|
@ -487,22 +503,6 @@ ERRATA_N2_2242400 ?=0
|
||||||
# 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_2280757 ?=0
|
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
|
|
||||||
|
|
||||||
# Flag to apply erratum 2017096 workaround during reset. This erratum applies
|
|
||||||
# to revision r0p0, r1p0 and r2p0 of the Cortex-A710 cpu and is still open.
|
|
||||||
ERRATA_A710_2017096 ?=0
|
|
||||||
|
|
||||||
# Flag to apply erratum 2267065 workaround during reset. This erratum applies
|
|
||||||
# to revision r0p0, r1p0 and r2p0 of the Cortex-A710 cpu and is fixed in r2p1.
|
|
||||||
ERRATA_A710_2267065 ?=0
|
|
||||||
|
|
||||||
# Flag to apply erratum 2136059 workaround during reset. This erratum applies
|
|
||||||
# to revision r0p0, r1p0 and r2p0 of the Cortex-A710 cpu and is fixed in r2p1.
|
|
||||||
ERRATA_A710_2136059 ?=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
|
||||||
|
@ -530,6 +530,10 @@ ERRATA_X2_2081180 ?=0
|
||||||
# r2p1.
|
# r2p1.
|
||||||
ERRATA_X2_2216384 ?=0
|
ERRATA_X2_2216384 ?=0
|
||||||
|
|
||||||
|
# Flag to apply erratum 1922240 workaround during reset. This erratum applies
|
||||||
|
# to revision r0p0 of the Cortex-A510 cpu and is fixed in r0p1.
|
||||||
|
ERRATA_A510_1922240 ?=0
|
||||||
|
|
||||||
# Flag to apply DSU erratum 798953. This erratum applies to DSUs revision r0p0.
|
# Flag to apply DSU erratum 798953. This erratum applies to DSUs revision r0p0.
|
||||||
# Applying the workaround results in higher DSU power consumption on idle.
|
# Applying the workaround results in higher DSU power consumption on idle.
|
||||||
ERRATA_DSU_798953 ?=0
|
ERRATA_DSU_798953 ?=0
|
||||||
|
@ -911,6 +915,22 @@ $(eval $(call add_define,ERRATA_A710_2083908))
|
||||||
$(eval $(call assert_boolean,ERRATA_A710_2058056))
|
$(eval $(call assert_boolean,ERRATA_A710_2058056))
|
||||||
$(eval $(call add_define,ERRATA_A710_2058056))
|
$(eval $(call add_define,ERRATA_A710_2058056))
|
||||||
|
|
||||||
|
# Process ERRATA_A710_2055002 flag
|
||||||
|
$(eval $(call assert_boolean,ERRATA_A710_2055002))
|
||||||
|
$(eval $(call add_define,ERRATA_A710_2055002))
|
||||||
|
|
||||||
|
# Process ERRATA_A710_2017096 flag
|
||||||
|
$(eval $(call assert_boolean,ERRATA_A710_2017096))
|
||||||
|
$(eval $(call add_define,ERRATA_A710_2017096))
|
||||||
|
|
||||||
|
# Process ERRATA_A710_2267065 flag
|
||||||
|
$(eval $(call assert_boolean,ERRATA_A710_2267065))
|
||||||
|
$(eval $(call add_define,ERRATA_A710_2267065))
|
||||||
|
|
||||||
|
# Process ERRATA_A710_2136059 flag
|
||||||
|
$(eval $(call assert_boolean,ERRATA_A710_2136059))
|
||||||
|
$(eval $(call add_define,ERRATA_A710_2136059))
|
||||||
|
|
||||||
# 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))
|
||||||
|
@ -947,22 +967,6 @@ $(eval $(call add_define,ERRATA_N2_2242400))
|
||||||
$(eval $(call assert_boolean,ERRATA_N2_2280757))
|
$(eval $(call assert_boolean,ERRATA_N2_2280757))
|
||||||
$(eval $(call add_define,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))
|
|
||||||
|
|
||||||
# Process ERRATA_A710_2017096 flag
|
|
||||||
$(eval $(call assert_boolean,ERRATA_A710_2017096))
|
|
||||||
$(eval $(call add_define,ERRATA_A710_2017096))
|
|
||||||
|
|
||||||
# Process ERRATA_A710_2267065 flag
|
|
||||||
$(eval $(call assert_boolean,ERRATA_A710_2267065))
|
|
||||||
$(eval $(call add_define,ERRATA_A710_2267065))
|
|
||||||
|
|
||||||
# Process ERRATA_A710_2136059 flag
|
|
||||||
$(eval $(call assert_boolean,ERRATA_A710_2136059))
|
|
||||||
$(eval $(call add_define,ERRATA_A710_2136059))
|
|
||||||
|
|
||||||
# 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))
|
||||||
|
@ -987,6 +991,10 @@ $(eval $(call add_define,ERRATA_X2_2081180))
|
||||||
$(eval $(call assert_boolean,ERRATA_X2_2216384))
|
$(eval $(call assert_boolean,ERRATA_X2_2216384))
|
||||||
$(eval $(call add_define,ERRATA_X2_2216384))
|
$(eval $(call add_define,ERRATA_X2_2216384))
|
||||||
|
|
||||||
|
# Process ERRATA_A510_1922240 flag
|
||||||
|
$(eval $(call assert_boolean,ERRATA_A510_1922240))
|
||||||
|
$(eval $(call add_define,ERRATA_A510_1922240))
|
||||||
|
|
||||||
# Process ERRATA_DSU_798953 flag
|
# Process ERRATA_DSU_798953 flag
|
||||||
$(eval $(call assert_boolean,ERRATA_DSU_798953))
|
$(eval $(call assert_boolean,ERRATA_DSU_798953))
|
||||||
$(eval $(call add_define,ERRATA_DSU_798953))
|
$(eval $(call add_define,ERRATA_DSU_798953))
|
||||||
|
|
Loading…
Add table
Reference in a new issue