Jimmy Brisson | 958a0b1 | 2020-09-30 15:28:03 -0500 | [diff] [blame] | 1 | /* |
Bipin Ravi | 8649974 | 2022-01-18 01:59:06 -0600 | [diff] [blame] | 2 | * Copyright (c) 2019-2022, Arm Limited. All rights reserved. |
Jimmy Brisson | 958a0b1 | 2020-09-30 15:28:03 -0500 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
| 8 | #include <asm_macros.S> |
| 9 | #include <common/bl_common.h> |
| 10 | #include <neoverse_v1.h> |
| 11 | #include <cpu_macros.S> |
| 12 | #include <plat_macros.S> |
Bipin Ravi | 8649974 | 2022-01-18 01:59:06 -0600 | [diff] [blame] | 13 | #include "wa_cve_2022_23960_bhb_vector.S" |
Jimmy Brisson | 958a0b1 | 2020-09-30 15:28:03 -0500 | [diff] [blame] | 14 | |
| 15 | /* Hardware handled coherency */ |
| 16 | #if HW_ASSISTED_COHERENCY == 0 |
| 17 | #error "Neoverse V1 must be compiled with HW_ASSISTED_COHERENCY enabled" |
| 18 | #endif |
| 19 | |
| 20 | /* 64-bit only core */ |
| 21 | #if CTX_INCLUDE_AARCH32_REGS == 1 |
| 22 | #error "Neoverse-V1 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0" |
| 23 | #endif |
| 24 | |
Bipin Ravi | 8649974 | 2022-01-18 01:59:06 -0600 | [diff] [blame] | 25 | #if WORKAROUND_CVE_2022_23960 |
| 26 | wa_cve_2022_23960_bhb_vector_table NEOVERSE_V1_BHB_LOOP_COUNT, neoverse_v1 |
| 27 | #endif /* WORKAROUND_CVE_2022_23960 */ |
| 28 | |
johpow01 | c73b03c | 2021-05-03 15:33:39 -0500 | [diff] [blame] | 29 | /* -------------------------------------------------- |
laurenw-arm | 3c86d83 | 2021-08-02 13:22:32 -0500 | [diff] [blame] | 30 | * Errata Workaround for Neoverse V1 Errata #1774420. |
| 31 | * This applies to revisions r0p0 and r1p0, fixed in r1p1. |
| 32 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 33 | * Shall clobber: x0-x17 |
| 34 | * -------------------------------------------------- |
| 35 | */ |
| 36 | func errata_neoverse_v1_1774420_wa |
| 37 | /* Check workaround compatibility. */ |
| 38 | mov x17, x30 |
| 39 | bl check_errata_1774420 |
| 40 | cbz x0, 1f |
| 41 | |
| 42 | /* Set bit 53 in CPUECTLR_EL1 */ |
| 43 | mrs x1, NEOVERSE_V1_CPUECTLR_EL1 |
| 44 | orr x1, x1, #NEOVERSE_V1_CPUECTLR_EL1_BIT_53 |
| 45 | msr NEOVERSE_V1_CPUECTLR_EL1, x1 |
| 46 | isb |
| 47 | 1: |
| 48 | ret x17 |
| 49 | endfunc errata_neoverse_v1_1774420_wa |
| 50 | |
| 51 | func check_errata_1774420 |
| 52 | /* Applies to r0p0 and r1p0. */ |
| 53 | mov x1, #0x10 |
| 54 | b cpu_rev_var_ls |
| 55 | endfunc check_errata_1774420 |
| 56 | |
| 57 | /* -------------------------------------------------- |
johpow01 | c73b03c | 2021-05-03 15:33:39 -0500 | [diff] [blame] | 58 | * Errata Workaround for Neoverse V1 Errata #1791573. |
| 59 | * This applies to revisions r0p0 and r1p0, fixed in r1p1. |
| 60 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 61 | * Shall clobber: x0-x17 |
| 62 | * -------------------------------------------------- |
| 63 | */ |
| 64 | func errata_neoverse_v1_1791573_wa |
| 65 | /* Check workaround compatibility. */ |
| 66 | mov x17, x30 |
| 67 | bl check_errata_1791573 |
| 68 | cbz x0, 1f |
| 69 | |
| 70 | /* Set bit 2 in ACTLR2_EL1 */ |
laurenw-arm | 3c86d83 | 2021-08-02 13:22:32 -0500 | [diff] [blame] | 71 | mrs x1, NEOVERSE_V1_ACTLR2_EL1 |
johpow01 | c73b03c | 2021-05-03 15:33:39 -0500 | [diff] [blame] | 72 | orr x1, x1, #NEOVERSE_V1_ACTLR2_EL1_BIT_2 |
laurenw-arm | 3c86d83 | 2021-08-02 13:22:32 -0500 | [diff] [blame] | 73 | msr NEOVERSE_V1_ACTLR2_EL1, x1 |
johpow01 | c73b03c | 2021-05-03 15:33:39 -0500 | [diff] [blame] | 74 | isb |
| 75 | 1: |
| 76 | ret x17 |
| 77 | endfunc errata_neoverse_v1_1791573_wa |
| 78 | |
| 79 | func check_errata_1791573 |
| 80 | /* Applies to r0p0 and r1p0. */ |
| 81 | mov x1, #0x10 |
| 82 | b cpu_rev_var_ls |
| 83 | endfunc check_errata_1791573 |
| 84 | |
johpow01 | 07acb4f | 2020-10-07 16:38:37 -0500 | [diff] [blame] | 85 | /* -------------------------------------------------- |
laurenw-arm | b1923e9 | 2021-08-02 14:40:08 -0500 | [diff] [blame] | 86 | * Errata Workaround for Neoverse V1 Errata #1852267. |
| 87 | * This applies to revisions r0p0 and r1p0, fixed in r1p1. |
| 88 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 89 | * Shall clobber: x0-x17 |
| 90 | * -------------------------------------------------- |
| 91 | */ |
| 92 | func errata_neoverse_v1_1852267_wa |
| 93 | /* Check workaround compatibility. */ |
| 94 | mov x17, x30 |
| 95 | bl check_errata_1852267 |
| 96 | cbz x0, 1f |
| 97 | |
| 98 | /* Set bit 28 in ACTLR2_EL1 */ |
| 99 | mrs x1, NEOVERSE_V1_ACTLR2_EL1 |
| 100 | orr x1, x1, #NEOVERSE_V1_ACTLR2_EL1_BIT_28 |
| 101 | msr NEOVERSE_V1_ACTLR2_EL1, x1 |
| 102 | isb |
| 103 | 1: |
| 104 | ret x17 |
| 105 | endfunc errata_neoverse_v1_1852267_wa |
| 106 | |
| 107 | func check_errata_1852267 |
| 108 | /* Applies to r0p0 and r1p0. */ |
| 109 | mov x1, #0x10 |
| 110 | b cpu_rev_var_ls |
| 111 | endfunc check_errata_1852267 |
| 112 | |
| 113 | /* -------------------------------------------------- |
laurenw-arm | 6b56f96 | 2021-08-02 15:00:15 -0500 | [diff] [blame] | 114 | * Errata Workaround for Neoverse V1 Errata #1925756. |
| 115 | * This applies to revisions <= r1p1. |
| 116 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 117 | * Shall clobber: x0-x17 |
| 118 | * -------------------------------------------------- |
| 119 | */ |
| 120 | func errata_neoverse_v1_1925756_wa |
| 121 | /* Check workaround compatibility. */ |
| 122 | mov x17, x30 |
| 123 | bl check_errata_1925756 |
| 124 | cbz x0, 1f |
| 125 | |
| 126 | /* Set bit 8 in CPUECTLR_EL1 */ |
| 127 | mrs x1, NEOVERSE_V1_CPUECTLR_EL1 |
| 128 | orr x1, x1, #NEOVERSE_V1_CPUECTLR_EL1_BIT_8 |
| 129 | msr NEOVERSE_V1_CPUECTLR_EL1, x1 |
| 130 | isb |
| 131 | 1: |
| 132 | ret x17 |
| 133 | endfunc errata_neoverse_v1_1925756_wa |
| 134 | |
| 135 | func check_errata_1925756 |
| 136 | /* Applies to <= r1p1. */ |
| 137 | mov x1, #0x11 |
| 138 | b cpu_rev_var_ls |
| 139 | endfunc check_errata_1925756 |
| 140 | |
| 141 | /* -------------------------------------------------- |
johpow01 | 07acb4f | 2020-10-07 16:38:37 -0500 | [diff] [blame] | 142 | * Errata Workaround for Neoverse V1 Erratum #1940577 |
| 143 | * This applies to revisions r1p0 - r1p1 and is open. |
| 144 | * It also exists in r0p0 but there is no fix in that |
| 145 | * revision. |
| 146 | * Inputs: |
| 147 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 148 | * Shall clobber: x0-x17 |
| 149 | * -------------------------------------------------- |
| 150 | */ |
| 151 | func errata_neoverse_v1_1940577_wa |
| 152 | /* Compare x0 against revisions r1p0 - r1p1 */ |
| 153 | mov x17, x30 |
| 154 | bl check_errata_1940577 |
| 155 | cbz x0, 1f |
| 156 | |
| 157 | mov x0, #0 |
| 158 | msr S3_6_C15_C8_0, x0 |
| 159 | ldr x0, =0x10E3900002 |
| 160 | msr S3_6_C15_C8_2, x0 |
| 161 | ldr x0, =0x10FFF00083 |
| 162 | msr S3_6_C15_C8_3, x0 |
| 163 | ldr x0, =0x2001003FF |
| 164 | msr S3_6_C15_C8_1, x0 |
| 165 | |
| 166 | mov x0, #1 |
| 167 | msr S3_6_C15_C8_0, x0 |
| 168 | ldr x0, =0x10E3800082 |
| 169 | msr S3_6_C15_C8_2, x0 |
| 170 | ldr x0, =0x10FFF00083 |
| 171 | msr S3_6_C15_C8_3, x0 |
| 172 | ldr x0, =0x2001003FF |
| 173 | msr S3_6_C15_C8_1, x0 |
| 174 | |
| 175 | mov x0, #2 |
| 176 | msr S3_6_C15_C8_0, x0 |
| 177 | ldr x0, =0x10E3800200 |
| 178 | msr S3_6_C15_C8_2, x0 |
| 179 | ldr x0, =0x10FFF003E0 |
| 180 | msr S3_6_C15_C8_3, x0 |
| 181 | ldr x0, =0x2001003FF |
| 182 | msr S3_6_C15_C8_1, x0 |
| 183 | |
| 184 | isb |
| 185 | 1: |
| 186 | ret x17 |
| 187 | endfunc errata_neoverse_v1_1940577_wa |
| 188 | |
| 189 | func check_errata_1940577 |
| 190 | /* Applies to revisions r1p0 - r1p1. */ |
| 191 | mov x1, #0x10 |
| 192 | mov x2, #0x11 |
| 193 | b cpu_rev_var_range |
| 194 | endfunc check_errata_1940577 |
| 195 | |
johpow01 | 97db675 | 2021-08-02 18:59:08 -0500 | [diff] [blame] | 196 | /* -------------------------------------------------- |
| 197 | * Errata Workaround for Neoverse V1 Errata #1966096 |
| 198 | * This applies to revisions r1p0 - r1p1 and is open. |
| 199 | * It also exists in r0p0 but there is no workaround |
| 200 | * for that revision. |
| 201 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 202 | * Shall clobber: x0-x17 |
| 203 | * -------------------------------------------------- |
| 204 | */ |
| 205 | func errata_neoverse_v1_1966096_wa |
| 206 | /* Check workaround compatibility. */ |
| 207 | mov x17, x30 |
| 208 | bl check_errata_1966096 |
| 209 | cbz x0, 1f |
| 210 | |
| 211 | /* Apply the workaround. */ |
| 212 | mov x0, #0x3 |
| 213 | msr S3_6_C15_C8_0, x0 |
| 214 | ldr x0, =0xEE010F12 |
| 215 | msr S3_6_C15_C8_2, x0 |
| 216 | ldr x0, =0xFFFF0FFF |
| 217 | msr S3_6_C15_C8_3, x0 |
| 218 | ldr x0, =0x80000000003FF |
| 219 | msr S3_6_C15_C8_1, x0 |
| 220 | isb |
| 221 | |
| 222 | 1: |
| 223 | ret x17 |
| 224 | endfunc errata_neoverse_v1_1966096_wa |
| 225 | |
| 226 | func check_errata_1966096 |
| 227 | mov x1, #0x10 |
| 228 | mov x2, #0x11 |
| 229 | b cpu_rev_var_range |
| 230 | endfunc check_errata_1966096 |
| 231 | |
johpow01 | ad1ca34 | 2021-08-03 14:35:20 -0500 | [diff] [blame] | 232 | /* -------------------------------------------------- |
| 233 | * Errata Workaround for Neoverse V1 Errata #2139242. |
| 234 | * This applies to revisions r0p0, r1p0, and r1p1, it |
| 235 | * is still open. |
| 236 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 237 | * Shall clobber: x0-x17 |
| 238 | * -------------------------------------------------- |
| 239 | */ |
| 240 | func errata_neoverse_v1_2139242_wa |
| 241 | /* Check workaround compatibility. */ |
| 242 | mov x17, x30 |
| 243 | bl check_errata_2139242 |
| 244 | cbz x0, 1f |
| 245 | |
| 246 | /* Apply the workaround. */ |
| 247 | mov x0, #0x3 |
| 248 | msr S3_6_C15_C8_0, x0 |
| 249 | ldr x0, =0xEE720F14 |
| 250 | msr S3_6_C15_C8_2, x0 |
| 251 | ldr x0, =0xFFFF0FDF |
| 252 | msr S3_6_C15_C8_3, x0 |
| 253 | ldr x0, =0x40000005003FF |
| 254 | msr S3_6_C15_C8_1, x0 |
| 255 | isb |
| 256 | |
| 257 | 1: |
| 258 | ret x17 |
| 259 | endfunc errata_neoverse_v1_2139242_wa |
| 260 | |
| 261 | func check_errata_2139242 |
| 262 | /* Applies to r0p0, r1p0, r1p1 */ |
| 263 | mov x1, #0x11 |
| 264 | b cpu_rev_var_ls |
| 265 | endfunc check_errata_2139242 |
| 266 | |
nayanpatel-arm | fc26ffe | 2021-09-28 13:41:03 -0700 | [diff] [blame] | 267 | /* -------------------------------------------------- |
| 268 | * Errata Workaround for Neoverse V1 Errata #2108267. |
| 269 | * This applies to revisions r0p0, r1p0, and r1p1, it |
| 270 | * is still open. |
| 271 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 272 | * Shall clobber: x0-x1, x17 |
| 273 | * -------------------------------------------------- |
| 274 | */ |
| 275 | func errata_neoverse_v1_2108267_wa |
| 276 | /* Check workaround compatibility. */ |
| 277 | mov x17, x30 |
| 278 | bl check_errata_2108267 |
| 279 | cbz x0, 1f |
| 280 | |
| 281 | /* Apply the workaround. */ |
| 282 | mrs x1, NEOVERSE_V1_CPUECTLR_EL1 |
| 283 | mov x0, #NEOVERSE_V1_CPUECTLR_EL1_PF_MODE_CNSRV |
| 284 | bfi x1, x0, #CPUECTLR_EL1_PF_MODE_LSB, #CPUECTLR_EL1_PF_MODE_WIDTH |
| 285 | msr NEOVERSE_V1_CPUECTLR_EL1, x1 |
| 286 | 1: |
| 287 | ret x17 |
| 288 | endfunc errata_neoverse_v1_2108267_wa |
| 289 | |
| 290 | func check_errata_2108267 |
| 291 | /* Applies to r0p0, r1p0, r1p1 */ |
| 292 | mov x1, #0x11 |
| 293 | b cpu_rev_var_ls |
| 294 | endfunc check_errata_2108267 |
| 295 | |
johpow01 | 4de29cb | 2021-09-02 18:29:17 -0500 | [diff] [blame] | 296 | /* -------------------------------------------------- |
| 297 | * Errata Workaround for Neoverse V1 Errata #2216392. |
| 298 | * This applies to revisions r1p0 and r1p1 and is |
| 299 | * still open. |
| 300 | * This issue is also present in r0p0 but there is no |
| 301 | * workaround in that revision. |
| 302 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 303 | * Shall clobber: x0-x17 |
| 304 | * -------------------------------------------------- |
| 305 | */ |
| 306 | func errata_neoverse_v1_2216392_wa |
| 307 | /* Check workaround compatibility. */ |
| 308 | mov x17, x30 |
| 309 | bl check_errata_2216392 |
| 310 | cbz x0, 1f |
| 311 | |
| 312 | ldr x0, =0x5 |
| 313 | msr S3_6_c15_c8_0, x0 /* CPUPSELR_EL3 */ |
| 314 | ldr x0, =0x10F600E000 |
| 315 | msr S3_6_c15_c8_2, x0 /* CPUPOR_EL3 */ |
| 316 | ldr x0, =0x10FF80E000 |
| 317 | msr S3_6_c15_c8_3, x0 /* CPUPMR_EL3 */ |
| 318 | ldr x0, =0x80000000003FF |
| 319 | msr S3_6_c15_c8_1, x0 /* CPUPCR_EL3 */ |
| 320 | |
| 321 | isb |
| 322 | 1: |
| 323 | ret x17 |
| 324 | endfunc errata_neoverse_v1_2216392_wa |
| 325 | |
| 326 | func check_errata_2216392 |
| 327 | /* Applies to revisions r1p0 and r1p1. */ |
| 328 | mov x1, #CPU_REV(1, 0) |
| 329 | mov x2, #CPU_REV(1, 1) |
| 330 | b cpu_rev_var_range |
| 331 | endfunc check_errata_2216392 |
| 332 | |
Bipin Ravi | 971938f | 2022-06-08 16:28:46 -0500 | [diff] [blame] | 333 | /* ----------------------------------------------------------------- |
| 334 | * Errata Workaround for Neoverse V1 Errata #2294912. |
| 335 | * This applies to revisions r0p0, r1p0, and r1p1 and is still open. |
| 336 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 337 | * Shall clobber: x0-x17 |
| 338 | * ----------------------------------------------------------------- |
| 339 | */ |
| 340 | func errata_neoverse_v1_2294912_wa |
| 341 | /* Check workaround compatibility. */ |
| 342 | mov x17, x30 |
| 343 | bl check_errata_2294912 |
| 344 | cbz x0, 1f |
| 345 | |
| 346 | /* Set bit 0 in ACTLR2_EL1 */ |
| 347 | mrs x1, NEOVERSE_V1_ACTLR2_EL1 |
| 348 | orr x1, x1, #NEOVERSE_V1_ACTLR2_EL1_BIT_0 |
| 349 | msr NEOVERSE_V1_ACTLR2_EL1, x1 |
| 350 | isb |
| 351 | 1: |
| 352 | ret x17 |
| 353 | endfunc errata_neoverse_v1_2294912_wa |
| 354 | |
| 355 | func check_errata_2294912 |
| 356 | /* Applies to r0p0, r1p0, and r1p1 right now */ |
| 357 | mov x1, #0x11 |
| 358 | b cpu_rev_var_ls |
| 359 | endfunc check_errata_2294912 |
| 360 | |
Bipin Ravi | b4cb31f | 2022-06-14 17:09:23 -0500 | [diff] [blame] | 361 | /* --------------------------------------------------- |
| 362 | * Errata Workaround for Neoverse V1 Errata #2372203. |
| 363 | * This applies to revisions <= r1p1 and is still open. |
| 364 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 365 | * Shall clobber: x0-x17 |
| 366 | * ---------------------------------------------------- |
| 367 | */ |
| 368 | func errata_neoverse_v1_2372203_wa |
| 369 | /* Check workaround compatibility. */ |
| 370 | mov x17, x30 |
| 371 | bl check_errata_2372203 |
| 372 | cbz x0, 1f |
| 373 | |
| 374 | /* Set bit 40 in ACTLR2_EL1 */ |
| 375 | mrs x1, NEOVERSE_V1_ACTLR2_EL1 |
| 376 | orr x1, x1, #NEOVERSE_V1_ACTLR2_EL1_BIT_40 |
| 377 | msr NEOVERSE_V1_ACTLR2_EL1, x1 |
| 378 | isb |
| 379 | 1: |
| 380 | ret x17 |
| 381 | endfunc errata_neoverse_v1_2372203_wa |
| 382 | |
| 383 | func check_errata_2372203 |
| 384 | /* Applies to <= r1p1. */ |
| 385 | mov x1, #0x11 |
| 386 | b cpu_rev_var_ls |
| 387 | endfunc check_errata_2372203 |
| 388 | |
Bipin Ravi | 8649974 | 2022-01-18 01:59:06 -0600 | [diff] [blame] | 389 | func check_errata_cve_2022_23960 |
| 390 | #if WORKAROUND_CVE_2022_23960 |
| 391 | mov x0, #ERRATA_APPLIES |
| 392 | #else |
| 393 | mov x0, #ERRATA_MISSING |
| 394 | #endif |
| 395 | ret |
| 396 | endfunc check_errata_cve_2022_23960 |
| 397 | |
Jimmy Brisson | 958a0b1 | 2020-09-30 15:28:03 -0500 | [diff] [blame] | 398 | /* --------------------------------------------- |
| 399 | * HW will do the cache maintenance while powering down |
| 400 | * --------------------------------------------- |
| 401 | */ |
| 402 | func neoverse_v1_core_pwr_dwn |
| 403 | /* --------------------------------------------- |
| 404 | * Enable CPU power down bit in power control register |
| 405 | * --------------------------------------------- |
| 406 | */ |
| 407 | mrs x0, NEOVERSE_V1_CPUPWRCTLR_EL1 |
| 408 | orr x0, x0, #NEOVERSE_V1_CPUPWRCTLR_EL1_CORE_PWRDN_BIT |
| 409 | msr NEOVERSE_V1_CPUPWRCTLR_EL1, x0 |
| 410 | isb |
| 411 | ret |
| 412 | endfunc neoverse_v1_core_pwr_dwn |
| 413 | |
| 414 | /* |
| 415 | * Errata printing function for Neoverse V1. Must follow AAPCS. |
| 416 | */ |
| 417 | #if REPORT_ERRATA |
| 418 | func neoverse_v1_errata_report |
johpow01 | c73b03c | 2021-05-03 15:33:39 -0500 | [diff] [blame] | 419 | stp x8, x30, [sp, #-16]! |
| 420 | |
| 421 | bl cpu_get_rev_var |
| 422 | mov x8, x0 |
| 423 | |
| 424 | /* |
| 425 | * Report all errata. The revision-variant information is passed to |
| 426 | * checking functions of each errata. |
| 427 | */ |
laurenw-arm | 3c86d83 | 2021-08-02 13:22:32 -0500 | [diff] [blame] | 428 | report_errata ERRATA_V1_1774420, neoverse_v1, 1774420 |
johpow01 | c73b03c | 2021-05-03 15:33:39 -0500 | [diff] [blame] | 429 | report_errata ERRATA_V1_1791573, neoverse_v1, 1791573 |
laurenw-arm | b1923e9 | 2021-08-02 14:40:08 -0500 | [diff] [blame] | 430 | report_errata ERRATA_V1_1852267, neoverse_v1, 1852267 |
laurenw-arm | 6b56f96 | 2021-08-02 15:00:15 -0500 | [diff] [blame] | 431 | report_errata ERRATA_V1_1925756, neoverse_v1, 1925756 |
johpow01 | 07acb4f | 2020-10-07 16:38:37 -0500 | [diff] [blame] | 432 | report_errata ERRATA_V1_1940577, neoverse_v1, 1940577 |
johpow01 | 97db675 | 2021-08-02 18:59:08 -0500 | [diff] [blame] | 433 | report_errata ERRATA_V1_1966096, neoverse_v1, 1966096 |
johpow01 | ad1ca34 | 2021-08-03 14:35:20 -0500 | [diff] [blame] | 434 | report_errata ERRATA_V1_2139242, neoverse_v1, 2139242 |
nayanpatel-arm | fc26ffe | 2021-09-28 13:41:03 -0700 | [diff] [blame] | 435 | report_errata ERRATA_V1_2108267, neoverse_v1, 2108267 |
johpow01 | 4de29cb | 2021-09-02 18:29:17 -0500 | [diff] [blame] | 436 | report_errata ERRATA_V1_2216392, neoverse_v1, 2216392 |
Bipin Ravi | 971938f | 2022-06-08 16:28:46 -0500 | [diff] [blame] | 437 | report_errata ERRATA_V1_2294912, neoverse_v1, 2294912 |
Bipin Ravi | b4cb31f | 2022-06-14 17:09:23 -0500 | [diff] [blame] | 438 | report_errata ERRATA_V1_2372203, neoverse_v1, 2372203 |
Bipin Ravi | 8649974 | 2022-01-18 01:59:06 -0600 | [diff] [blame] | 439 | report_errata WORKAROUND_CVE_2022_23960, neoverse_v1, cve_2022_23960 |
johpow01 | c73b03c | 2021-05-03 15:33:39 -0500 | [diff] [blame] | 440 | |
| 441 | ldp x8, x30, [sp], #16 |
Jimmy Brisson | 958a0b1 | 2020-09-30 15:28:03 -0500 | [diff] [blame] | 442 | ret |
| 443 | endfunc neoverse_v1_errata_report |
| 444 | #endif |
| 445 | |
| 446 | func neoverse_v1_reset_func |
| 447 | mov x19, x30 |
| 448 | |
| 449 | /* Disable speculative loads */ |
| 450 | msr SSBS, xzr |
Jimmy Brisson | 958a0b1 | 2020-09-30 15:28:03 -0500 | [diff] [blame] | 451 | isb |
johpow01 | c73b03c | 2021-05-03 15:33:39 -0500 | [diff] [blame] | 452 | |
laurenw-arm | 3c86d83 | 2021-08-02 13:22:32 -0500 | [diff] [blame] | 453 | #if ERRATA_V1_1774420 |
| 454 | mov x0, x18 |
| 455 | bl errata_neoverse_v1_1774420_wa |
| 456 | #endif |
| 457 | |
johpow01 | c73b03c | 2021-05-03 15:33:39 -0500 | [diff] [blame] | 458 | #if ERRATA_V1_1791573 |
| 459 | mov x0, x18 |
| 460 | bl errata_neoverse_v1_1791573_wa |
| 461 | #endif |
| 462 | |
laurenw-arm | b1923e9 | 2021-08-02 14:40:08 -0500 | [diff] [blame] | 463 | #if ERRATA_V1_1852267 |
| 464 | mov x0, x18 |
| 465 | bl errata_neoverse_v1_1852267_wa |
| 466 | #endif |
| 467 | |
laurenw-arm | 6b56f96 | 2021-08-02 15:00:15 -0500 | [diff] [blame] | 468 | #if ERRATA_V1_1925756 |
| 469 | mov x0, x18 |
| 470 | bl errata_neoverse_v1_1925756_wa |
| 471 | #endif |
| 472 | |
johpow01 | 07acb4f | 2020-10-07 16:38:37 -0500 | [diff] [blame] | 473 | #if ERRATA_V1_1940577 |
| 474 | mov x0, x18 |
| 475 | bl errata_neoverse_v1_1940577_wa |
| 476 | #endif |
| 477 | |
johpow01 | 97db675 | 2021-08-02 18:59:08 -0500 | [diff] [blame] | 478 | #if ERRATA_V1_1966096 |
| 479 | mov x0, x18 |
| 480 | bl errata_neoverse_v1_1966096_wa |
| 481 | #endif |
| 482 | |
johpow01 | ad1ca34 | 2021-08-03 14:35:20 -0500 | [diff] [blame] | 483 | #if ERRATA_V1_2139242 |
| 484 | mov x0, x18 |
| 485 | bl errata_neoverse_v1_2139242_wa |
| 486 | #endif |
| 487 | |
nayanpatel-arm | fc26ffe | 2021-09-28 13:41:03 -0700 | [diff] [blame] | 488 | #if ERRATA_V1_2108267 |
| 489 | mov x0, x18 |
| 490 | bl errata_neoverse_v1_2108267_wa |
| 491 | #endif |
| 492 | |
johpow01 | 4de29cb | 2021-09-02 18:29:17 -0500 | [diff] [blame] | 493 | #if ERRATA_V1_2216392 |
| 494 | mov x0, x18 |
| 495 | bl errata_neoverse_v1_2216392_wa |
| 496 | #endif |
| 497 | |
Bipin Ravi | 971938f | 2022-06-08 16:28:46 -0500 | [diff] [blame] | 498 | #if ERRATA_V1_2294912 |
| 499 | mov x0, x18 |
| 500 | bl errata_neoverse_v1_2294912_wa |
| 501 | #endif |
| 502 | |
Bipin Ravi | b4cb31f | 2022-06-14 17:09:23 -0500 | [diff] [blame] | 503 | #if ERRATA_V1_2372203 |
| 504 | mov x0, x18 |
| 505 | bl errata_neoverse_v1_2372203_wa |
| 506 | #endif |
| 507 | |
Bipin Ravi | 8649974 | 2022-01-18 01:59:06 -0600 | [diff] [blame] | 508 | #if IMAGE_BL31 && WORKAROUND_CVE_2022_23960 |
| 509 | /* |
| 510 | * The Neoverse-V1 generic vectors are overridden to apply errata |
| 511 | * mitigation on exception entry from lower ELs. |
| 512 | */ |
| 513 | adr x0, wa_cve_vbar_neoverse_v1 |
| 514 | msr vbar_el3, x0 |
| 515 | #endif /* IMAGE_BL31 && WORKAROUND_CVE_2022_23960 */ |
| 516 | |
| 517 | isb |
Jimmy Brisson | 958a0b1 | 2020-09-30 15:28:03 -0500 | [diff] [blame] | 518 | ret x19 |
| 519 | endfunc neoverse_v1_reset_func |
| 520 | |
| 521 | /* --------------------------------------------- |
| 522 | * This function provides Neoverse-V1 specific |
| 523 | * register information for crash reporting. |
| 524 | * It needs to return with x6 pointing to |
| 525 | * a list of register names in ascii and |
| 526 | * x8 - x15 having values of registers to be |
| 527 | * reported. |
| 528 | * --------------------------------------------- |
| 529 | */ |
| 530 | .section .rodata.neoverse_v1_regs, "aS" |
| 531 | neoverse_v1_regs: /* The ascii list of register names to be reported */ |
| 532 | .asciz "cpuectlr_el1", "" |
| 533 | |
| 534 | func neoverse_v1_cpu_reg_dump |
| 535 | adr x6, neoverse_v1_regs |
| 536 | mrs x8, NEOVERSE_V1_CPUECTLR_EL1 |
| 537 | ret |
| 538 | endfunc neoverse_v1_cpu_reg_dump |
| 539 | |
| 540 | declare_cpu_ops neoverse_v1, NEOVERSE_V1_MIDR, \ |
| 541 | neoverse_v1_reset_func, \ |
| 542 | neoverse_v1_core_pwr_dwn |