Browse Source

refactor(cpus): reorder Neoverse N2 errata by ascending order

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Icf4c12f8404d2e7791bd9c008fe261314b047e14
pull/2000/head
Arvind Ram Prakash 1 year ago
parent
commit
a438f434de
  1. 203
      lib/cpus/aarch64/neoverse_n2.S

203
lib/cpus/aarch64/neoverse_n2.S

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, Arm Limited. All rights reserved.
* Copyright (c) 2020-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -66,32 +66,6 @@ func check_errata_2002655
b cpu_rev_var_ls
endfunc check_errata_2002655
/* ---------------------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2067956.
* This applies to revision r0p0 of Neoverse N2 and is still open.
* Inputs:
* x0: variant[4:7] and revision[0:3] of current cpu.
* Shall clobber: x0-x17
* ---------------------------------------------------------------
*/
func errata_n2_2067956_wa
/* Compare x0 against revision r0p0 */
mov x17, x30
bl check_errata_2067956
cbz x0, 1f
mrs x1, NEOVERSE_N2_CPUACTLR_EL1
orr x1, x1, NEOVERSE_N2_CPUACTLR_EL1_BIT_46
msr NEOVERSE_N2_CPUACTLR_EL1, x1
1:
ret x17
endfunc errata_n2_2067956_wa
func check_errata_2067956
/* Applies to r0p0 */
mov x1, #0x00
b cpu_rev_var_ls
endfunc check_errata_2067956
/* ---------------------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2025414.
* This applies to revision r0p0 of Neoverse N2 and is still open.
@ -120,31 +94,59 @@ func check_errata_2025414
endfunc check_errata_2025414
/* ---------------------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2189731.
* Errata Workaround for Neoverse N2 Erratum 2067956.
* This applies to revision r0p0 of Neoverse N2 and is still open.
* Inputs:
* x0: variant[4:7] and revision[0:3] of current cpu.
* Shall clobber: x0-x17
* ---------------------------------------------------------------
*/
func errata_n2_2189731_wa
func errata_n2_2067956_wa
/* Compare x0 against revision r0p0 */
mov x17, x30
bl check_errata_2189731
cbz x0, 1f
mrs x1, NEOVERSE_N2_CPUACTLR5_EL1
orr x1, x1, NEOVERSE_N2_CPUACTLR5_EL1_BIT_44
msr NEOVERSE_N2_CPUACTLR5_EL1, x1
mov x17, x30
bl check_errata_2067956
cbz x0, 1f
mrs x1, NEOVERSE_N2_CPUACTLR_EL1
orr x1, x1, NEOVERSE_N2_CPUACTLR_EL1_BIT_46
msr NEOVERSE_N2_CPUACTLR_EL1, x1
1:
ret x17
endfunc errata_n2_2067956_wa
func check_errata_2067956
/* Applies to r0p0 */
mov x1, #0x00
b cpu_rev_var_ls
endfunc check_errata_2067956
/* --------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2138953.
* This applies to revision r0p0 of Neoverse N2. it is still open.
* Inputs:
* x0: variant[4:7] and revision[0:3] of current cpu.
* Shall clobber: x0-x1, x17
* --------------------------------------------------
*/
func errata_n2_2138953_wa
/* Check revision. */
mov x17, x30
bl check_errata_2138953
cbz x0, 1f
/* Apply instruction patching sequence */
mrs x1, NEOVERSE_N2_CPUECTLR2_EL1
mov x0, #NEOVERSE_N2_CPUECTLR2_EL1_PF_MODE_CNSRV
bfi x1, x0, #CPUECTLR2_EL1_PF_MODE_LSB, #CPUECTLR2_EL1_PF_MODE_WIDTH
msr NEOVERSE_N2_CPUECTLR2_EL1, x1
1:
ret x17
endfunc errata_n2_2189731_wa
ret x17
endfunc errata_n2_2138953_wa
func check_errata_2189731
func check_errata_2138953
/* Applies to r0p0 */
mov x1, #0x00
b cpu_rev_var_ls
endfunc check_errata_2189731
mov x1, #0x00
b cpu_rev_var_ls
endfunc check_errata_2138953
/* --------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2138956.
@ -189,126 +191,124 @@ func check_errata_2138956
endfunc check_errata_2138956
/* --------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2242415.
* Errata Workaround for Neoverse N2 Erratum 2138958.
* This applies to revision r0p0 of Neoverse N2. it is still open.
* Inputs:
* x0: variant[4:7] and revision[0:3] of current cpu.
* Shall clobber: x0-x1, x17
* --------------------------------------------------
*/
func errata_n2_2242415_wa
func errata_n2_2138958_wa
/* Check revision. */
mov x17, x30
bl check_errata_2242415
bl check_errata_2138958
cbz x0, 1f
/* Apply instruction patching sequence */
mrs x1, NEOVERSE_N2_CPUACTLR_EL1
orr x1, x1, NEOVERSE_N2_CPUACTLR_EL1_BIT_22
msr NEOVERSE_N2_CPUACTLR_EL1, x1
mrs x1, NEOVERSE_N2_CPUACTLR5_EL1
orr x1, x1, NEOVERSE_N2_CPUACTLR5_EL1_BIT_13
msr NEOVERSE_N2_CPUACTLR5_EL1, x1
1:
ret x17
endfunc errata_n2_2242415_wa
endfunc errata_n2_2138958_wa
func check_errata_2242415
func check_errata_2138958
/* Applies to r0p0 */
mov x1, #0x00
b cpu_rev_var_ls
endfunc check_errata_2242415
endfunc check_errata_2138958
/* --------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2138953.
* This applies to revision r0p0 of Neoverse N2. it is still open.
/* ---------------------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2189731.
* This applies to revision r0p0 of Neoverse N2 and is still open.
* Inputs:
* x0: variant[4:7] and revision[0:3] of current cpu.
* Shall clobber: x0-x1, x17
* --------------------------------------------------
* Shall clobber: x0-x17
* ---------------------------------------------------------------
*/
func errata_n2_2138953_wa
/* Check revision. */
mov x17, x30
bl check_errata_2138953
cbz x0, 1f
func errata_n2_2189731_wa
/* Compare x0 against revision r0p0 */
mov x17, x30
bl check_errata_2189731
cbz x0, 1f
mrs x1, NEOVERSE_N2_CPUACTLR5_EL1
orr x1, x1, NEOVERSE_N2_CPUACTLR5_EL1_BIT_44
msr NEOVERSE_N2_CPUACTLR5_EL1, x1
/* Apply instruction patching sequence */
mrs x1, NEOVERSE_N2_CPUECTLR2_EL1
mov x0, #NEOVERSE_N2_CPUECTLR2_EL1_PF_MODE_CNSRV
bfi x1, x0, #CPUECTLR2_EL1_PF_MODE_LSB, #CPUECTLR2_EL1_PF_MODE_WIDTH
msr NEOVERSE_N2_CPUECTLR2_EL1, x1
1:
ret x17
endfunc errata_n2_2138953_wa
ret x17
endfunc errata_n2_2189731_wa
func check_errata_2138953
func check_errata_2189731
/* Applies to r0p0 */
mov x1, #0x00
b cpu_rev_var_ls
endfunc check_errata_2138953
mov x1, #0x00
b cpu_rev_var_ls
endfunc check_errata_2189731
/* --------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2138958.
* Errata Workaround for Neoverse N2 Erratum 2242400.
* This applies to revision r0p0 of Neoverse N2. it is still open.
* Inputs:
* x0: variant[4:7] and revision[0:3] of current cpu.
* Shall clobber: x0-x1, x17
* --------------------------------------------------
*/
func errata_n2_2138958_wa
func errata_n2_2242400_wa
/* Check revision. */
mov x17, x30
bl check_errata_2138958
bl check_errata_2242400
cbz x0, 1f
/* Apply instruction patching sequence */
mrs x1, NEOVERSE_N2_CPUACTLR5_EL1
orr x1, x1, NEOVERSE_N2_CPUACTLR5_EL1_BIT_13
orr x1, x1, NEOVERSE_N2_CPUACTLR5_EL1_BIT_17
msr NEOVERSE_N2_CPUACTLR5_EL1, x1
ldr x0, =0x2
msr S3_6_c15_c8_0, x0
ldr x0, =0x10F600E000
msr S3_6_c15_c8_2, x0
ldr x0, =0x10FF80E000
msr S3_6_c15_c8_3, x0
ldr x0, =0x80000000003FF
msr S3_6_c15_c8_1, x0
isb
1:
ret x17
endfunc errata_n2_2138958_wa
endfunc errata_n2_2242400_wa
func check_errata_2138958
func check_errata_2242400
/* Applies to r0p0 */
mov x1, #0x00
b cpu_rev_var_ls
endfunc check_errata_2138958
endfunc check_errata_2242400
/* --------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2242400.
* Errata Workaround for Neoverse N2 Erratum 2242415.
* This applies to revision r0p0 of Neoverse N2. it is still open.
* Inputs:
* x0: variant[4:7] and revision[0:3] of current cpu.
* Shall clobber: x0-x1, x17
* --------------------------------------------------
*/
func errata_n2_2242400_wa
func errata_n2_2242415_wa
/* Check revision. */
mov x17, x30
bl check_errata_2242400
bl check_errata_2242415
cbz x0, 1f
/* Apply instruction patching sequence */
mrs x1, NEOVERSE_N2_CPUACTLR5_EL1
orr x1, x1, NEOVERSE_N2_CPUACTLR5_EL1_BIT_17
msr NEOVERSE_N2_CPUACTLR5_EL1, x1
ldr x0, =0x2
msr S3_6_c15_c8_0, x0
ldr x0, =0x10F600E000
msr S3_6_c15_c8_2, x0
ldr x0, =0x10FF80E000
msr S3_6_c15_c8_3, x0
ldr x0, =0x80000000003FF
msr S3_6_c15_c8_1, x0
isb
mrs x1, NEOVERSE_N2_CPUACTLR_EL1
orr x1, x1, NEOVERSE_N2_CPUACTLR_EL1_BIT_22
msr NEOVERSE_N2_CPUACTLR_EL1, x1
1:
ret x17
endfunc errata_n2_2242400_wa
endfunc errata_n2_2242415_wa
func check_errata_2242400
func check_errata_2242415
/* Applies to r0p0 */
mov x1, #0x00
b cpu_rev_var_ls
endfunc check_errata_2242400
endfunc check_errata_2242415
/* --------------------------------------------------
* Errata Workaround for Neoverse N2 Erratum 2280757.
@ -504,7 +504,6 @@ func neoverse_n2_reset_func
bl errata_n2_2189731_wa
#endif
#if ERRATA_N2_2138956
mov x0, x18
bl errata_n2_2138956_wa
@ -625,21 +624,21 @@ func neoverse_n2_errata_report
* checking functions of each errata.
*/
report_errata ERRATA_N2_2002655, neoverse_n2, 2002655
report_errata ERRATA_N2_2002655, neoverse_n2, 2025414
report_errata ERRATA_N2_2067956, neoverse_n2, 2067956
report_errata ERRATA_N2_2025414, neoverse_n2, 2025414
report_errata ERRATA_N2_2189731, neoverse_n2, 2189731
report_errata ERRATA_N2_2138956, neoverse_n2, 2138956
report_errata ERRATA_N2_2138953, neoverse_n2, 2138953
report_errata ERRATA_N2_2242415, neoverse_n2, 2242415
report_errata ERRATA_N2_2138956, neoverse_n2, 2138956
report_errata ERRATA_N2_2138958, neoverse_n2, 2138958
report_errata ERRATA_N2_2189731, neoverse_n2, 2189731
report_errata ERRATA_N2_2242400, neoverse_n2, 2242400
report_errata ERRATA_N2_2242415, neoverse_n2, 2242415
report_errata ERRATA_N2_2280757, neoverse_n2, 2280757
report_errata ERRATA_N2_2326639, neoverse_n2, 2326639
report_errata ERRATA_N2_2376738, neoverse_n2, 2376738
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 ERRATA_DSU_2313941, neoverse_n2, dsu_2313941
report_errata WORKAROUND_CVE_2022_23960, neoverse_n2, cve_2022_23960
ldp x8, x30, [sp], #16
ret

Loading…
Cancel
Save