xref: /rk3399_ARM-atf/lib/cpus/aarch64/cortex_x2.S (revision 347950281b107d3447240f047482758a745b22fc)
1c6ac4df6Sjohpow01/*
2ae6c7c97SGovindraj Raja * Copyright (c) 2021-2025, Arm Limited. All rights reserved.
3c6ac4df6Sjohpow01 *
4c6ac4df6Sjohpow01 * SPDX-License-Identifier: BSD-3-Clause
5c6ac4df6Sjohpow01 */
6c6ac4df6Sjohpow01
7c6ac4df6Sjohpow01#include <arch.h>
8c6ac4df6Sjohpow01#include <asm_macros.S>
9c6ac4df6Sjohpow01#include <common/bl_common.h>
10c6ac4df6Sjohpow01#include <cortex_x2.h>
11c6ac4df6Sjohpow01#include <cpu_macros.S>
12b62673c6SBoyan Karatotev#include <dsu_macros.S>
13c6ac4df6Sjohpow01#include <plat_macros.S>
141fe4a9d1SBipin Ravi#include "wa_cve_2022_23960_bhb_vector.S"
15c6ac4df6Sjohpow01
16c6ac4df6Sjohpow01/* Hardware handled coherency */
17c6ac4df6Sjohpow01#if HW_ASSISTED_COHERENCY == 0
18c6ac4df6Sjohpow01#error "Cortex X2 must be compiled with HW_ASSISTED_COHERENCY enabled"
19c6ac4df6Sjohpow01#endif
20c6ac4df6Sjohpow01
21c6ac4df6Sjohpow01/* 64-bit only core */
22c6ac4df6Sjohpow01#if CTX_INCLUDE_AARCH32_REGS == 1
23c6ac4df6Sjohpow01#error "Cortex X2 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
24c6ac4df6Sjohpow01#endif
25c6ac4df6Sjohpow01
26ae6c7c97SGovindraj Raja.global check_erratum_cortex_x2_3701772
27ae6c7c97SGovindraj Raja
281fe4a9d1SBipin Ravi#if WORKAROUND_CVE_2022_23960
291fe4a9d1SBipin Ravi	wa_cve_2022_23960_bhb_vector_table CORTEX_X2_BHB_LOOP_COUNT, cortex_x2
301fe4a9d1SBipin Ravi#endif /* WORKAROUND_CVE_2022_23960 */
311fe4a9d1SBipin Ravi
3289dba82dSBoyan Karatotevcpu_reset_prologue cortex_x2
3389dba82dSBoyan Karatotev
34ce64ea6eSJohn Powellworkaround_reset_start cortex_x2, ERRATUM(1901946), ERRATA_X2_1901946
35ce64ea6eSJohn Powell	sysreg_bit_set CORTEX_X2_CPUACTLR4_EL1, BIT(15)
36ce64ea6eSJohn Powellworkaround_reset_end cortex_x2, ERRATUM(1901946)
37ce64ea6eSJohn Powell
38ce64ea6eSJohn Powellcheck_erratum_range cortex_x2, ERRATUM(1901946), CPU_REV(1, 0), CPU_REV(1, 0)
39ce64ea6eSJohn Powell
40ff879c52SJohn Powellworkaround_reset_start cortex_x2, ERRATUM(1916945), ERRATA_X2_1916945
41ff879c52SJohn Powell	sysreg_bit_set CORTEX_X2_CPUECTLR_EL1, BIT(8)
42ff879c52SJohn Powellworkaround_reset_end cortex_x2, ERRATUM(1916945)
43ff879c52SJohn Powell
44ff879c52SJohn Powellcheck_erratum_ls cortex_x2, ERRATUM(1916945), CPU_REV(1, 0)
45ff879c52SJohn Powell
46ccee7fa8SJohn Powellworkaround_reset_start cortex_x2, ERRATUM(1917258), ERRATA_X2_1917258
47ccee7fa8SJohn Powell	sysreg_bit_set CORTEX_X2_CPUACTLR4_EL1, BIT(43)
48ccee7fa8SJohn Powellworkaround_reset_end cortex_x2, ERRATUM(1917258)
49ccee7fa8SJohn Powell
50ccee7fa8SJohn Powellcheck_erratum_ls cortex_x2, ERRATUM(1917258), CPU_REV(1, 0)
51ccee7fa8SJohn Powell
52e2365484SJohn Powellworkaround_reset_start cortex_x2, ERRATUM(1927200), ERRATA_X2_1927200
53e2365484SJohn Powell	mov	x0, #0
54e2365484SJohn Powell	msr	S3_6_C15_C8_0, x0 /* CPUPSELR_EL3 */
55e2365484SJohn Powell	ldr	x0, =0x10E3900002
56e2365484SJohn Powell	msr	S3_6_C15_C8_2, x0 /* CPUPOR_EL3 */
57e2365484SJohn Powell	ldr	x0, =0x10FFF00083
58e2365484SJohn Powell	msr	S3_6_C15_C8_3, x0 /* CPUPMR_EL3 */
59e2365484SJohn Powell	ldr	x0, =0x2001003FF
60e2365484SJohn Powell	msr	S3_6_C15_C8_1, x0 /* CPUPCR_EL3 */
61e2365484SJohn Powell
62e2365484SJohn Powell	mov	x0, #1
63e2365484SJohn Powell	msr	S3_6_C15_C8_0, x0 /* CPUPSELR_EL3 */
64e2365484SJohn Powell	ldr	x0, =0x10E3800082
65e2365484SJohn Powell	msr	S3_6_C15_C8_2, x0 /* CPUPOR_EL3 */
66e2365484SJohn Powell	ldr	x0, =0x10FFF00083
67e2365484SJohn Powell	msr	S3_6_C15_C8_3, x0 /* CPUPMR_EL3 */
68e2365484SJohn Powell	ldr	x0, =0x2001003FF
69e2365484SJohn Powell	msr	S3_6_C15_C8_1, x0 /* CPUPCR_EL3 */
70e2365484SJohn Powell
71e2365484SJohn Powell	mov	x0, #2
72e2365484SJohn Powell	msr	S3_6_C15_C8_0, x0 /* CPUPSELR_EL3 */
73e2365484SJohn Powell	ldr	x0, =0x10E3800200
74e2365484SJohn Powell	msr	S3_6_C15_C8_2, x0 /* CPUPOR_EL3 */
75e2365484SJohn Powell	ldr	x0, =0x10FFF003E0
76e2365484SJohn Powell	msr	S3_6_C15_C8_3, x0 /* CPUPMR_EL3 */
77e2365484SJohn Powell	ldr	x0, =0x2001003FF
78e2365484SJohn Powell	msr	S3_6_C15_C8_1, x0 /* CPUPCR_EL3 */
79e2365484SJohn Powellworkaround_reset_end cortex_x2, ERRATUM(1927200)
80e2365484SJohn Powell
81e2365484SJohn Powellcheck_erratum_ls cortex_x2, ERRATUM(1927200), CPU_REV(1, 0)
82e2365484SJohn Powell
832c0467afSJohn Powellworkaround_reset_start cortex_x2, ERRATUM(1934260), ERRATA_X2_1934260
842c0467afSJohn Powell	sysreg_bit_set CORTEX_X2_CPUECTLR_EL1, CORTEX_X2_CPUECTLR_EL1_WS_THR_DISABLE_ALL_BITS
852c0467afSJohn Powellworkaround_reset_end cortex_x2, ERRATUM(1934260)
862c0467afSJohn Powell
872c0467afSJohn Powellcheck_erratum_range cortex_x2, ERRATUM(1934260), CPU_REV(1, 0), CPU_REV(1, 0)
882c0467afSJohn Powell
89a62b1b31SJayanth Dodderi Chidanandworkaround_reset_start cortex_x2, ERRATUM(2002765), ERRATA_X2_2002765
9034ee76dbSjohpow01	ldr	x0, =0x6
9134ee76dbSjohpow01	msr	S3_6_C15_C8_0, x0 /* CPUPSELR_EL3 */
9234ee76dbSjohpow01	ldr	x0, =0xF3A08002
9334ee76dbSjohpow01	msr	S3_6_C15_C8_2, x0 /* CPUPOR_EL3 */
9434ee76dbSjohpow01	ldr	x0, =0xFFF0F7FE
9534ee76dbSjohpow01	msr	S3_6_C15_C8_3, x0 /* CPUPMR_EL3 */
9634ee76dbSjohpow01	ldr	x0, =0x40000001003ff
9734ee76dbSjohpow01	msr	S3_6_C15_C8_1, x0 /* CPUPCR_EL3 */
98a62b1b31SJayanth Dodderi Chidanandworkaround_reset_end cortex_x2, ERRATUM(2002765)
9934ee76dbSjohpow01
100a62b1b31SJayanth Dodderi Chidanandcheck_erratum_ls cortex_x2, ERRATUM(2002765), CPU_REV(2, 0)
10134ee76dbSjohpow01
102a62b1b31SJayanth Dodderi Chidanandworkaround_reset_start cortex_x2, ERRATUM(2017096), ERRATA_X2_2017096
103fdd32878SJayanth Dodderi Chidanand	sysreg_bit_set CORTEX_X2_CPUECTLR_EL1, CORTEX_X2_CPUECTLR_EL1_PFSTIDIS_BIT
104a62b1b31SJayanth Dodderi Chidanandworkaround_reset_end cortex_x2, ERRATUM(2017096)
10564733b39SJayanth Dodderi Chidanand
106a62b1b31SJayanth Dodderi Chidanandcheck_erratum_ls cortex_x2, ERRATUM(2017096), CPU_REV(2, 0)
10764733b39SJayanth Dodderi Chidanand
108a62b1b31SJayanth Dodderi Chidanandworkaround_reset_start cortex_x2, ERRATUM(2081180), ERRATA_X2_2081180
109c060b533SBipin Ravi	/* Apply instruction patching sequence */
110c060b533SBipin Ravi	ldr	x0, =0x3
111c060b533SBipin Ravi	msr	CORTEX_X2_IMP_CPUPSELR_EL3, x0
112c060b533SBipin Ravi	ldr	x0, =0xF3A08002
113c060b533SBipin Ravi	msr	CORTEX_X2_IMP_CPUPOR_EL3, x0
114c060b533SBipin Ravi	ldr	x0, =0xFFF0F7FE
115c060b533SBipin Ravi	msr	CORTEX_X2_IMP_CPUPMR_EL3, x0
116c060b533SBipin Ravi	ldr	x0, =0x10002001003FF
117c060b533SBipin Ravi	msr	CORTEX_X2_IMP_CPUPCR_EL3, x0
118c060b533SBipin Ravi	ldr	x0, =0x4
119c060b533SBipin Ravi	msr	CORTEX_X2_IMP_CPUPSELR_EL3, x0
120c060b533SBipin Ravi	ldr	x0, =0xBF200000
121c060b533SBipin Ravi	msr	CORTEX_X2_IMP_CPUPOR_EL3, x0
122c060b533SBipin Ravi	ldr	x0, =0xFFEF0000
123c060b533SBipin Ravi	msr	CORTEX_X2_IMP_CPUPMR_EL3, x0
124c060b533SBipin Ravi	ldr	x0, =0x10002001003F3
125c060b533SBipin Ravi	msr	CORTEX_X2_IMP_CPUPCR_EL3, x0
126a62b1b31SJayanth Dodderi Chidanandworkaround_reset_end cortex_x2, ERRATUM(2081180)
127c060b533SBipin Ravi
128a62b1b31SJayanth Dodderi Chidanandcheck_erratum_ls cortex_x2, ERRATUM(2081180), CPU_REV(2, 0)
129c060b533SBipin Ravi
130a62b1b31SJayanth Dodderi Chidanandworkaround_reset_start cortex_x2, ERRATUM(2083908), ERRATA_X2_2083908
13164733b39SJayanth Dodderi Chidanand	/* Apply the workaround by setting bit 13 in CPUACTLR5_EL1. */
132fdd32878SJayanth Dodderi Chidanand	sysreg_bit_set CORTEX_X2_CPUACTLR5_EL1, BIT(13)
133a62b1b31SJayanth Dodderi Chidanandworkaround_reset_end cortex_x2, ERRATUM(2083908)
13464733b39SJayanth Dodderi Chidanand
135a62b1b31SJayanth Dodderi Chidanandcheck_erratum_range cortex_x2, ERRATUM(2083908), CPU_REV(2, 0), CPU_REV(2, 0)
13664733b39SJayanth Dodderi Chidanand
137a8e4d5a5SJohn Powellworkaround_reset_start cortex_x2, ERRATUM(2136059), ERRATA_X2_2136059
138a8e4d5a5SJohn Powell	sysreg_bit_set CORTEX_X2_CPUACTLR5_EL1, BIT(44)
139a8e4d5a5SJohn Powellworkaround_reset_end cortex_x2, ERRATUM(2136059)
140a8e4d5a5SJohn Powell
141a8e4d5a5SJohn Powellcheck_erratum_ls cortex_x2, ERRATUM(2136059), CPU_REV(2, 0)
142a8e4d5a5SJohn Powell
143a62b1b31SJayanth Dodderi Chidanandworkaround_reset_start cortex_x2, ERRATUM(2147715), ERRATA_X2_2147715
14464733b39SJayanth Dodderi Chidanand	/* Apply the workaround by setting bit 22 in CPUACTLR_EL1. */
145fdd32878SJayanth Dodderi Chidanand	sysreg_bit_set CORTEX_X2_CPUACTLR_EL1, CORTEX_X2_CPUACTLR_EL1_BIT_22
146a62b1b31SJayanth Dodderi Chidanandworkaround_reset_end cortex_x2, ERRATUM(2147715)
14764733b39SJayanth Dodderi Chidanand
148a62b1b31SJayanth Dodderi Chidanandcheck_erratum_range cortex_x2, ERRATUM(2147715), CPU_REV(2, 0), CPU_REV(2, 0)
14964733b39SJayanth Dodderi Chidanand
150a62b1b31SJayanth Dodderi Chidanandworkaround_reset_start cortex_x2, ERRATUM(2216384), ERRATA_X2_2216384
151fdd32878SJayanth Dodderi Chidanand	sysreg_bit_set CORTEX_X2_CPUACTLR5_EL1, CORTEX_X2_CPUACTLR5_EL1_BIT_17
1524dff7594SBipin Ravi
1534dff7594SBipin Ravi	/* Apply instruction patching sequence */
1544dff7594SBipin Ravi	ldr	x0, =0x5
1554dff7594SBipin Ravi	msr	CORTEX_X2_IMP_CPUPSELR_EL3, x0
1564dff7594SBipin Ravi	ldr	x0, =0x10F600E000
1574dff7594SBipin Ravi	msr	CORTEX_X2_IMP_CPUPOR_EL3, x0
1584dff7594SBipin Ravi	ldr	x0, =0x10FF80E000
1594dff7594SBipin Ravi	msr	CORTEX_X2_IMP_CPUPMR_EL3, x0
1604dff7594SBipin Ravi	ldr	x0, =0x80000000003FF
1614dff7594SBipin Ravi	msr	CORTEX_X2_IMP_CPUPCR_EL3, x0
162a62b1b31SJayanth Dodderi Chidanandworkaround_reset_end cortex_x2, ERRATUM(2216384)
1634dff7594SBipin Ravi
164a62b1b31SJayanth Dodderi Chidanandcheck_erratum_ls cortex_x2, ERRATUM(2216384), CPU_REV(2, 0)
1654dff7594SBipin Ravi
16641b96976SJohn Powellworkaround_reset_start cortex_x2, ERRATUM(2267065), ERRATA_X2_2267065
16741b96976SJohn Powell	sysreg_bit_set CORTEX_X2_CPUACTLR_EL1, BIT(22)
16841b96976SJohn Powellworkaround_reset_end cortex_x2, ERRATUM(2267065)
16941b96976SJohn Powell
17041b96976SJohn Powellcheck_erratum_ls cortex_x2, ERRATUM(2267065), CPU_REV(2, 0)
17141b96976SJohn Powell
172a62b1b31SJayanth Dodderi Chidanandworkaround_reset_start cortex_x2, ERRATUM(2282622), ERRATA_X2_2282622
173f9c6301dSBipin Ravi	/* Apply the workaround */
174fdd32878SJayanth Dodderi Chidanand	sysreg_bit_set CORTEX_X2_CPUACTLR2_EL1, BIT(0)
175a62b1b31SJayanth Dodderi Chidanandworkaround_reset_end cortex_x2, ERRATUM(2282622)
176f9c6301dSBipin Ravi
177a62b1b31SJayanth Dodderi Chidanandcheck_erratum_ls cortex_x2, ERRATUM(2282622), CPU_REV(2, 1)
178f9c6301dSBipin Ravi
179*989c798dSJohn Powellworkaround_runtime_start cortex_x2, ERRATUM(2291219), ERRATA_X2_2291219
180*989c798dSJohn Powell	/*
181*989c798dSJohn Powell	 * Set/unset bit 36 in ACTLR2_EL1. The first call will set it, applying
182*989c798dSJohn Powell	 * the workaround. Second call clears it to undo it.
183*989c798dSJohn Powell	 */
184*989c798dSJohn Powell	sysreg_bit_toggle CORTEX_X2_CPUACTLR2_EL1, BIT(36)
185*989c798dSJohn Powellworkaround_runtime_end cortex_x2, ERRATUM(2291219), NO_ISB
186*989c798dSJohn Powell
187*989c798dSJohn Powellcheck_erratum_ls cortex_x2, ERRATUM(2291219), CPU_REV(2, 0)
188*989c798dSJohn Powell
189eb9220b2SArvind Ram Prakashworkaround_reset_start cortex_x2, ERRATUM(2313941), ERRATA_DSU_2313941
190eb9220b2SArvind Ram Prakash	errata_dsu_2313941_wa_impl
191eb9220b2SArvind Ram Prakashworkaround_reset_end cortex_x2, ERRATUM(2313941)
192eb9220b2SArvind Ram Prakash
193eb9220b2SArvind Ram Prakashcheck_erratum_custom_start cortex_x2, ERRATUM(2313941)
194eb9220b2SArvind Ram Prakash	check_errata_dsu_2313941_impl
195eb9220b2SArvind Ram Prakash	ret
196eb9220b2SArvind Ram Prakashcheck_erratum_custom_end cortex_x2, ERRATUM(2313941)
197eb9220b2SArvind Ram Prakash
198a62b1b31SJayanth Dodderi Chidanandworkaround_reset_start cortex_x2, ERRATUM(2371105), ERRATA_X2_2371105
199bc0f84deSBipin Ravi	/* Set bit 40 in CPUACTLR2_EL1 */
200fdd32878SJayanth Dodderi Chidanand	sysreg_bit_set CORTEX_X2_CPUACTLR2_EL1, CORTEX_X2_CPUACTLR2_EL1_BIT_40
201a62b1b31SJayanth Dodderi Chidanandworkaround_reset_end cortex_x2, ERRATUM(2371105)
202bc0f84deSBipin Ravi
203a62b1b31SJayanth Dodderi Chidanandcheck_erratum_ls cortex_x2, ERRATUM(2371105), CPU_REV(2, 0)
204bc0f84deSBipin Ravi
205fe06e118SBipin Raviworkaround_reset_start cortex_x2, ERRATUM(2742423), ERRATA_X2_2742423
206fe06e118SBipin Ravi	/* Set CPUACTLR5_EL1[56:55] to 2'b01 */
207fe06e118SBipin Ravi	sysreg_bit_set CORTEX_X2_CPUACTLR5_EL1, BIT(55)
208fe06e118SBipin Ravi	sysreg_bit_clear CORTEX_X2_CPUACTLR5_EL1, BIT(56)
209fe06e118SBipin Raviworkaround_reset_end cortex_x2, ERRATUM(2742423)
210fe06e118SBipin Ravi
211fe06e118SBipin Ravicheck_erratum_ls cortex_x2, ERRATUM(2742423), CPU_REV(2, 1)
212fe06e118SBipin Ravi
213db9ee834SBoyan Karatotevworkaround_runtime_start cortex_x2, ERRATUM(2768515), ERRATA_X2_2768515
2141cfde822SBipin Ravi	/* dsb before isb of power down sequence */
2151cfde822SBipin Ravi	dsb	sy
216db9ee834SBoyan Karatotevworkaround_runtime_end cortex_x2, ERRATUM(2768515)
2171cfde822SBipin Ravi
218a62b1b31SJayanth Dodderi Chidanandcheck_erratum_ls cortex_x2, ERRATUM(2768515), CPU_REV(2, 1)
2191cfde822SBipin Ravi
220b01a93d7SSona Mathewworkaround_reset_start cortex_x2, ERRATUM(2778471), ERRATA_X2_2778471
221b01a93d7SSona Mathew	sysreg_bit_set CORTEX_X2_CPUACTLR3_EL1, BIT(47)
222b01a93d7SSona Mathewworkaround_reset_end cortex_x2, ERRATUM(2778471)
223b01a93d7SSona Mathew
224b01a93d7SSona Mathewcheck_erratum_ls cortex_x2, ERRATUM(2778471), CPU_REV(2, 1)
225b01a93d7SSona Mathew
226eb9220b2SArvind Ram Prakashadd_erratum_entry cortex_x2, ERRATUM(3701772), ERRATA_X2_3701772
227eb9220b2SArvind Ram Prakash
228eb9220b2SArvind Ram Prakashcheck_erratum_ls cortex_x2, ERRATUM(3701772), CPU_REV(2, 1)
229eb9220b2SArvind Ram Prakash
230a62b1b31SJayanth Dodderi Chidanandworkaround_reset_start cortex_x2, CVE(2022, 23960), WORKAROUND_CVE_2022_23960
231a62b1b31SJayanth Dodderi Chidanand#if IMAGE_BL31
232a62b1b31SJayanth Dodderi Chidanand	/*
233a62b1b31SJayanth Dodderi Chidanand	 * The Cortex-X2 generic vectors are overridden to apply errata
234a62b1b31SJayanth Dodderi Chidanand	 * mitigation on exception entry from lower ELs.
235a62b1b31SJayanth Dodderi Chidanand	 */
236fdd32878SJayanth Dodderi Chidanand	override_vector_table wa_cve_vbar_cortex_x2
237a62b1b31SJayanth Dodderi Chidanand#endif /* IMAGE_BL31 */
238a62b1b31SJayanth Dodderi Chidanandworkaround_reset_end cortex_x2, CVE(2022, 23960)
239a62b1b31SJayanth Dodderi Chidanand
240a62b1b31SJayanth Dodderi Chidanandcheck_erratum_chosen cortex_x2, CVE(2022, 23960), WORKAROUND_CVE_2022_23960
241a62b1b31SJayanth Dodderi Chidanand
242eb9220b2SArvind Ram Prakash/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
243eb9220b2SArvind Ram Prakashworkaround_reset_start cortex_x2, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
244eb9220b2SArvind Ram Prakash	sysreg_bit_set CORTEX_X2_CPUECTLR_EL1, BIT(46)
245eb9220b2SArvind Ram Prakashworkaround_reset_end cortex_x2, CVE(2024, 5660)
246b62673c6SBoyan Karatotev
247eb9220b2SArvind Ram Prakashcheck_erratum_ls cortex_x2, CVE(2024, 5660), CPU_REV(2, 1)
24864733b39SJayanth Dodderi Chidanand
2491cfde822SBipin Ravi	/* ----------------------------------------------------
250c6ac4df6Sjohpow01	 * HW will do the cache maintenance while powering down
251c6ac4df6Sjohpow01	 * ----------------------------------------------------
252c6ac4df6Sjohpow01	 */
253c6ac4df6Sjohpow01func cortex_x2_core_pwr_dwn
254*989c798dSJohn Powell	apply_erratum cortex_x2, ERRATUM(2291219), ERRATA_X2_2291219, NO_GET_CPU_REV
255*989c798dSJohn Powell
256c6ac4df6Sjohpow01	/* ---------------------------------------------------
257c6ac4df6Sjohpow01	 * Enable CPU power down bit in power control register
258c6ac4df6Sjohpow01	 * ---------------------------------------------------
259c6ac4df6Sjohpow01	 */
260fdd32878SJayanth Dodderi Chidanand	sysreg_bit_set CORTEX_X2_CPUPWRCTLR_EL1, CORTEX_X2_CPUPWRCTLR_EL1_CORE_PWRDN_BIT
261fdd32878SJayanth Dodderi Chidanand
262645917abSBoyan Karatotev	apply_erratum cortex_x2, ERRATUM(2768515), ERRATA_X2_2768515
263c6ac4df6Sjohpow01	isb
264c6ac4df6Sjohpow01	ret
265c6ac4df6Sjohpow01endfunc cortex_x2_core_pwr_dwn
266c6ac4df6Sjohpow01
267a62b1b31SJayanth Dodderi Chidanandcpu_reset_func_start cortex_x2
268c6ac4df6Sjohpow01	/* Disable speculative loads */
269c6ac4df6Sjohpow01	msr	SSBS, xzr
2702590e819SBoyan Karatotev	enable_mpmm
271a62b1b31SJayanth Dodderi Chidanandcpu_reset_func_end cortex_x2
272c6ac4df6Sjohpow01
273c6ac4df6Sjohpow01	/* ---------------------------------------------
274c6ac4df6Sjohpow01	 * This function provides Cortex X2 specific
275c6ac4df6Sjohpow01	 * register information for crash reporting.
276c6ac4df6Sjohpow01	 * It needs to return with x6 pointing to
277c6ac4df6Sjohpow01	 * a list of register names in ascii and
278c6ac4df6Sjohpow01	 * x8 - x15 having values of registers to be
279c6ac4df6Sjohpow01	 * reported.
280c6ac4df6Sjohpow01	 * ---------------------------------------------
281c6ac4df6Sjohpow01	 */
282c6ac4df6Sjohpow01.section .rodata.cortex_x2_regs, "aS"
283c6ac4df6Sjohpow01cortex_x2_regs:  /* The ascii list of register names to be reported */
284c6ac4df6Sjohpow01	.asciz	"cpuectlr_el1", ""
285c6ac4df6Sjohpow01
286c6ac4df6Sjohpow01func cortex_x2_cpu_reg_dump
287c6ac4df6Sjohpow01	adr	x6, cortex_x2_regs
288c6ac4df6Sjohpow01	mrs	x8, CORTEX_X2_CPUECTLR_EL1
289c6ac4df6Sjohpow01	ret
290c6ac4df6Sjohpow01endfunc cortex_x2_cpu_reg_dump
291c6ac4df6Sjohpow01
292c6ac4df6Sjohpow01declare_cpu_ops cortex_x2, CORTEX_X2_MIDR, \
293c6ac4df6Sjohpow01	cortex_x2_reset_func, \
294c6ac4df6Sjohpow01	cortex_x2_core_pwr_dwn
295