diff --git a/docs/design/cpu-specific-build-macros.rst b/docs/design/cpu-specific-build-macros.rst index 4ee184cfa..5733214a5 100644 --- a/docs/design/cpu-specific-build-macros.rst +++ b/docs/design/cpu-specific-build-macros.rst @@ -918,6 +918,10 @@ For Cortex-A715, the following errata build flags are defined : For Cortex-A720, the following errata build flags are defined : +- ``ERRATA_A720_2926083``: This applies errata 2926083 workaround to + Cortex-A720 CPU. This needs to be enabled for revisions r0p0 and r0p1. + It is fixed in r0p2. + - ``ERRATA_A720_2940794``: This applies errata 2940794 workaround to Cortex-A720 CPU. This needs to be enabled for revisions r0p0 and r0p1. It is fixed in r0p2. diff --git a/include/lib/cpus/aarch64/cortex_a720.h b/include/lib/cpus/aarch64/cortex_a720.h index e542d4e1a..fb27f7912 100644 --- a/include/lib/cpus/aarch64/cortex_a720.h +++ b/include/lib/cpus/aarch64/cortex_a720.h @@ -12,6 +12,11 @@ /* Cortex A720 loop count for CVE-2022-23960 mitigation */ #define CORTEX_A720_BHB_LOOP_COUNT U(132) +/******************************************************************************* + * CPU Auxiliary Control register 1 specific definitions. + ******************************************************************************/ +#define CORTEX_A720_CPUACTLR_EL1 S3_0_C15_C1_0 + /******************************************************************************* * CPU Auxiliary Control register 2 specific definitions. ******************************************************************************/ diff --git a/lib/cpus/aarch64/cortex_a720.S b/lib/cpus/aarch64/cortex_a720.S index 2075acd23..53a1b7897 100644 --- a/lib/cpus/aarch64/cortex_a720.S +++ b/lib/cpus/aarch64/cortex_a720.S @@ -26,6 +26,22 @@ wa_cve_2022_23960_bhb_vector_table CORTEX_A720_BHB_LOOP_COUNT, cortex_a720 #endif /* WORKAROUND_CVE_2022_23960 */ +workaround_reset_start cortex_a720, ERRATUM(2926083), ERRATA_A720_2926083 +/* Erratum 2926083 workaround is required only if SPE is enabled */ +#if ENABLE_SPE_FOR_NS != 0 + /* Check if Static profiling extension is implemented or present. */ + mrs x1, id_aa64dfr0_el1 + ubfx x0, x1, ID_AA64DFR0_PMS_SHIFT, #4 + cbz x0, 1f + /* Apply the workaround by setting CPUACTLR_EL1[58:57] = 0b11. */ + sysreg_bit_set CORTEX_A720_CPUACTLR_EL1, BIT(57) + sysreg_bit_set CORTEX_A720_CPUACTLR_EL1, BIT(58) +1: +#endif +workaround_reset_end cortex_a720, ERRATUM(2926083) + +check_erratum_ls cortex_a720, ERRATUM(2926083), CPU_REV(0, 1) + workaround_reset_start cortex_a720, ERRATUM(2940794), ERRATA_A720_2940794 sysreg_bit_set CORTEX_A720_CPUACTLR2_EL1, BIT(37) workaround_reset_end cortex_a720, ERRATUM(2940794) diff --git a/lib/cpus/cpu-ops.mk b/lib/cpus/cpu-ops.mk index a7a8c8a8d..872f6c768 100644 --- a/lib/cpus/cpu-ops.mk +++ b/lib/cpus/cpu-ops.mk @@ -940,6 +940,10 @@ CPU_FLAG_LIST += ERRATA_A715_2429384 # only to revision r1p0. It is fixed in r1p1. CPU_FLAG_LIST += ERRATA_A715_2561034 +# Flag to apply erratum 2926083 workaround during reset. This erratum applies +# to revisions r0p0 and r0p1. It is fixed in r0p2. +CPU_FLAG_LIST += ERRATA_A720_2926083 + # Flag to apply erratum 2940794 workaround during reset. This erratum applies # to revisions r0p0 and r0p1. It is fixed in r0p2. CPU_FLAG_LIST += ERRATA_A720_2940794 diff --git a/plat/arm/board/fvp/platform.mk b/plat/arm/board/fvp/platform.mk index 569ac3fa0..19c4d275a 100644 --- a/plat/arm/board/fvp/platform.mk +++ b/plat/arm/board/fvp/platform.mk @@ -205,6 +205,7 @@ else lib/cpus/aarch64/cortex_a78c.S \ lib/cpus/aarch64/cortex_a710.S \ lib/cpus/aarch64/cortex_a715.S \ + lib/cpus/aarch64/cortex_a720.S \ lib/cpus/aarch64/neoverse_n_common.S \ lib/cpus/aarch64/neoverse_n1.S \ lib/cpus/aarch64/neoverse_n2.S \