From cc46166144b9a3746807f1d137ff784da3013e26 Mon Sep 17 00:00:00 2001 From: Arvind Ram Prakash Date: Wed, 27 Nov 2024 15:02:32 -0600 Subject: [PATCH] fix(cpus): workaround for Cortex-X4 erratum 2923985 Cortex-X4 erratum 2923935 is a Cat B erratum that applies to all revisions <= r0p1 and is fixed in r0p2. The workaround is to set CPUACTLR4_EL1[11:10] to 0b11. SDEN documentation: https://developer.arm.com/documentation/SDEN-2432808/latest Signed-off-by: Arvind Ram Prakash Change-Id: I9207802ad479919a7f77c1271019fa2479e076ee --- docs/design/cpu-specific-build-macros.rst | 3 +++ lib/cpus/aarch64/cortex_x4.S | 6 ++++++ lib/cpus/cpu-ops.mk | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/docs/design/cpu-specific-build-macros.rst b/docs/design/cpu-specific-build-macros.rst index fda43dc99..f1cb73bfc 100644 --- a/docs/design/cpu-specific-build-macros.rst +++ b/docs/design/cpu-specific-build-macros.rst @@ -843,6 +843,9 @@ For Cortex-X4, the following errata build flags are defined : - ``ERRATA_X4_2897503``: This applies errata 2897503 workaround to Cortex-X4 CPU. This needs to be enabled for revisions r0p0 and r0p1. It is fixed in r0p2. +- ``ERRATA_X4_2923985``: This applies errata 2923985 workaround to Cortex-X4 + CPU. This needs to be enabled for revisions r0p0 and r0p1. It is fixed in r0p2. + - ``ERRATA_X4_3076789``: This applies errata 3076789 workaround to Cortex-X4 CPU. This needs to be enabled for revisions r0p0 and r0p1. It is fixed in r0p2. diff --git a/lib/cpus/aarch64/cortex_x4.S b/lib/cpus/aarch64/cortex_x4.S index 320fd90b9..4ff0ea52c 100644 --- a/lib/cpus/aarch64/cortex_x4.S +++ b/lib/cpus/aarch64/cortex_x4.S @@ -75,6 +75,12 @@ workaround_reset_end cortex_x4, ERRATUM(2897503) check_erratum_ls cortex_x4, ERRATUM(2897503), CPU_REV(0, 1) +workaround_reset_start cortex_x4, ERRATUM(2923985), ERRATA_X4_2923985 + sysreg_bit_set CORTEX_X4_CPUACTLR4_EL1, (BIT(11) | BIT(10)) +workaround_reset_end cortex_x4, ERRATUM(2923985) + +check_erratum_ls cortex_x4, ERRATUM(2923985), CPU_REV(0, 1) + workaround_reset_start cortex_x4, ERRATUM(3076789), ERRATA_X4_3076789 sysreg_bit_set CORTEX_X4_CPUACTLR3_EL1, BIT(14) sysreg_bit_set CORTEX_X4_CPUACTLR3_EL1, BIT(13) diff --git a/lib/cpus/cpu-ops.mk b/lib/cpus/cpu-ops.mk index 4c207850d..4a04a9dc7 100644 --- a/lib/cpus/cpu-ops.mk +++ b/lib/cpus/cpu-ops.mk @@ -843,6 +843,10 @@ CPU_FLAG_LIST += ERRATA_X4_2816013 # to revisions r0p0 and r0p1 of the Cortex-X4 cpu. It is fixed in r0p2. CPU_FLAG_LIST += ERRATA_X4_2897503 +# Flag to apply erratum 2923985 workaround on reset. This erratum applies +# to revisions r0p0 and r0p1 of the Cortex-X4 cpu. It is fixed in r0p2. +CPU_FLAG_LIST += ERRATA_X4_2923985 + # Flag to apply erratum 3076789 workaround on reset. This erratum applies # to revisions r0p0 and r0p1 of the Cortex-X4 cpu. It is fixed in r0p2. CPU_FLAG_LIST += ERRATA_X4_3076789