Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 1 | /* |
Bipin Ravi | 7f56547 | 2021-03-31 10:10:27 -0500 | [diff] [blame] | 2 | * Copyright (c) 2020-2021, Arm Limited. All rights reserved. |
Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
| 8 | #include <asm_macros.S> |
| 9 | #include <cpu_macros.S> |
| 10 | #include <neoverse_n2.h> |
| 11 | |
| 12 | /* Hardware handled coherency */ |
| 13 | #if HW_ASSISTED_COHERENCY == 0 |
| 14 | #error "Neoverse N2 must be compiled with HW_ASSISTED_COHERENCY enabled" |
| 15 | #endif |
| 16 | |
| 17 | /* 64-bit only core */ |
| 18 | #if CTX_INCLUDE_AARCH32_REGS == 1 |
| 19 | #error "Neoverse-N2 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0" |
| 20 | #endif |
| 21 | |
nayanpatel-arm | 277581e | 2021-08-06 17:46:10 -0700 | [diff] [blame] | 22 | /* -------------------------------------------------- |
| 23 | * Errata Workaround for Neoverse N2 Erratum 2002655. |
| 24 | * This applies to revision r0p0 of Neoverse N2. it is still open. |
| 25 | * Inputs: |
| 26 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 27 | * Shall clobber: x0-x17 |
| 28 | * -------------------------------------------------- |
| 29 | */ |
| 30 | func errata_n2_2002655_wa |
| 31 | /* Check revision. */ |
| 32 | mov x17, x30 |
| 33 | bl check_errata_2002655 |
| 34 | cbz x0, 1f |
| 35 | |
| 36 | /* Apply instruction patching sequence */ |
| 37 | ldr x0,=0x6 |
| 38 | msr S3_6_c15_c8_0,x0 |
| 39 | ldr x0,=0xF3A08002 |
| 40 | msr S3_6_c15_c8_2,x0 |
| 41 | ldr x0,=0xFFF0F7FE |
| 42 | msr S3_6_c15_c8_3,x0 |
| 43 | ldr x0,=0x40000001003ff |
| 44 | msr S3_6_c15_c8_1,x0 |
| 45 | ldr x0,=0x7 |
| 46 | msr S3_6_c15_c8_0,x0 |
| 47 | ldr x0,=0xBF200000 |
| 48 | msr S3_6_c15_c8_2,x0 |
| 49 | ldr x0,=0xFFEF0000 |
| 50 | msr S3_6_c15_c8_3,x0 |
| 51 | ldr x0,=0x40000001003f3 |
| 52 | msr S3_6_c15_c8_1,x0 |
| 53 | isb |
| 54 | 1: |
| 55 | ret x17 |
| 56 | endfunc errata_n2_2002655_wa |
| 57 | |
| 58 | func check_errata_2002655 |
| 59 | /* Applies to r0p0 */ |
| 60 | mov x1, #0x00 |
| 61 | b cpu_rev_var_ls |
| 62 | endfunc check_errata_2002655 |
| 63 | |
Bipin Ravi | eb35e85 | 2021-03-30 16:08:32 -0500 | [diff] [blame] | 64 | /* --------------------------------------------------------------- |
| 65 | * Errata Workaround for Neoverse N2 Erratum 2067956. |
| 66 | * This applies to revision r0p0 of Neoverse N2 and is still open. |
| 67 | * Inputs: |
| 68 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 69 | * Shall clobber: x0-x17 |
| 70 | * --------------------------------------------------------------- |
| 71 | */ |
| 72 | func errata_n2_2067956_wa |
| 73 | /* Compare x0 against revision r0p0 */ |
| 74 | mov x17, x30 |
| 75 | bl check_errata_2067956 |
| 76 | cbz x0, 1f |
| 77 | mrs x1, NEOVERSE_N2_CPUACTLR_EL1 |
| 78 | orr x1, x1, NEOVERSE_N2_CPUACTLR_EL1_BIT_46 |
| 79 | msr NEOVERSE_N2_CPUACTLR_EL1, x1 |
| 80 | 1: |
| 81 | ret x17 |
| 82 | endfunc errata_n2_2067956_wa |
| 83 | |
| 84 | func check_errata_2067956 |
| 85 | /* Applies to r0p0 */ |
| 86 | mov x1, #0x00 |
| 87 | b cpu_rev_var_ls |
| 88 | endfunc check_errata_2067956 |
| 89 | |
Bipin Ravi | 7f56547 | 2021-03-31 10:10:27 -0500 | [diff] [blame] | 90 | /* --------------------------------------------------------------- |
| 91 | * Errata Workaround for Neoverse N2 Erratum 2025414. |
| 92 | * This applies to revision r0p0 of Neoverse N2 and is still open. |
| 93 | * Inputs: |
| 94 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 95 | * Shall clobber: x0-x17 |
| 96 | * --------------------------------------------------------------- |
| 97 | */ |
| 98 | func errata_n2_2025414_wa |
| 99 | /* Compare x0 against revision r0p0 */ |
| 100 | mov x17, x30 |
| 101 | bl check_errata_2025414 |
| 102 | cbz x0, 1f |
| 103 | mrs x1, NEOVERSE_N2_CPUECTLR_EL1 |
| 104 | orr x1, x1, NEOVERSE_N2_CPUECTLR_EL1_PFSTIDIS_BIT |
| 105 | msr NEOVERSE_N2_CPUECTLR_EL1, x1 |
| 106 | |
| 107 | 1: |
| 108 | ret x17 |
| 109 | endfunc errata_n2_2025414_wa |
| 110 | |
| 111 | func check_errata_2025414 |
| 112 | /* Applies to r0p0 */ |
| 113 | mov x1, #0x00 |
| 114 | b cpu_rev_var_ls |
| 115 | endfunc check_errata_2025414 |
| 116 | |
Bipin Ravi | 7e03069 | 2021-08-30 13:02:51 -0500 | [diff] [blame] | 117 | /* --------------------------------------------------------------- |
| 118 | * Errata Workaround for Neoverse N2 Erratum 2189731. |
| 119 | * This applies to revision r0p0 of Neoverse N2 and is still open. |
| 120 | * Inputs: |
| 121 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 122 | * Shall clobber: x0-x17 |
| 123 | * --------------------------------------------------------------- |
| 124 | */ |
| 125 | func errata_n2_2189731_wa |
| 126 | /* Compare x0 against revision r0p0 */ |
| 127 | mov x17, x30 |
| 128 | bl check_errata_2189731 |
| 129 | cbz x0, 1f |
| 130 | mrs x1, NEOVERSE_N2_CPUACTLR5_EL1 |
| 131 | orr x1, x1, NEOVERSE_N2_CPUACTLR5_EL1_BIT_44 |
| 132 | msr NEOVERSE_N2_CPUACTLR5_EL1, x1 |
| 133 | |
| 134 | 1: |
| 135 | ret x17 |
| 136 | endfunc errata_n2_2189731_wa |
| 137 | |
| 138 | func check_errata_2189731 |
| 139 | /* Applies to r0p0 */ |
| 140 | mov x1, #0x00 |
| 141 | b cpu_rev_var_ls |
| 142 | endfunc check_errata_2189731 |
| 143 | |
Bipin Ravi | 0ba631c | 2021-09-01 01:36:43 -0500 | [diff] [blame] | 144 | /* -------------------------------------------------- |
| 145 | * Errata Workaround for Neoverse N2 Erratum 2138956. |
| 146 | * This applies to revision r0p0 of Neoverse N2. it is still open. |
| 147 | * Inputs: |
| 148 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 149 | * Shall clobber: x0-x17 |
| 150 | * -------------------------------------------------- |
| 151 | */ |
| 152 | func errata_n2_2138956_wa |
| 153 | /* Check revision. */ |
| 154 | mov x17, x30 |
| 155 | bl check_errata_2138956 |
| 156 | cbz x0, 1f |
| 157 | |
| 158 | /* Apply instruction patching sequence */ |
| 159 | ldr x0,=0x3 |
| 160 | msr S3_6_c15_c8_0,x0 |
| 161 | ldr x0,=0xF3A08002 |
| 162 | msr S3_6_c15_c8_2,x0 |
| 163 | ldr x0,=0xFFF0F7FE |
| 164 | msr S3_6_c15_c8_3,x0 |
| 165 | ldr x0,=0x10002001003FF |
| 166 | msr S3_6_c15_c8_1,x0 |
| 167 | ldr x0,=0x4 |
| 168 | msr S3_6_c15_c8_0,x0 |
| 169 | ldr x0,=0xBF200000 |
| 170 | msr S3_6_c15_c8_2,x0 |
| 171 | ldr x0,=0xFFEF0000 |
| 172 | msr S3_6_c15_c8_3,x0 |
| 173 | ldr x0,=0x10002001003F3 |
| 174 | msr S3_6_c15_c8_1,x0 |
| 175 | isb |
| 176 | 1: |
| 177 | ret x17 |
| 178 | endfunc errata_n2_2138956_wa |
| 179 | |
| 180 | func check_errata_2138956 |
| 181 | /* Applies to r0p0 */ |
| 182 | mov x1, #0x00 |
| 183 | b cpu_rev_var_ls |
| 184 | endfunc check_errata_2138956 |
| 185 | |
nayanpatel-arm | d4c5f9c | 2021-09-28 09:46:45 -0700 | [diff] [blame] | 186 | /* -------------------------------------------------- |
nayanpatel-arm | 2f15399 | 2021-10-06 15:31:24 -0700 | [diff] [blame] | 187 | * Errata Workaround for Neoverse N2 Erratum 2242415. |
| 188 | * This applies to revision r0p0 of Neoverse N2. it is still open. |
| 189 | * Inputs: |
| 190 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 191 | * Shall clobber: x0-x1, x17 |
| 192 | * -------------------------------------------------- |
| 193 | */ |
| 194 | func errata_n2_2242415_wa |
| 195 | /* Check revision. */ |
| 196 | mov x17, x30 |
| 197 | bl check_errata_2242415 |
| 198 | cbz x0, 1f |
| 199 | |
| 200 | /* Apply instruction patching sequence */ |
| 201 | mrs x1, NEOVERSE_N2_CPUACTLR_EL1 |
| 202 | orr x1, x1, NEOVERSE_N2_CPUACTLR_EL1_BIT_22 |
| 203 | msr NEOVERSE_N2_CPUACTLR_EL1, x1 |
| 204 | 1: |
| 205 | ret x17 |
| 206 | endfunc errata_n2_2242415_wa |
| 207 | |
| 208 | func check_errata_2242415 |
| 209 | /* Applies to r0p0 */ |
| 210 | mov x1, #0x00 |
| 211 | b cpu_rev_var_ls |
| 212 | endfunc check_errata_2242415 |
| 213 | |
| 214 | /* -------------------------------------------------- |
nayanpatel-arm | d4c5f9c | 2021-09-28 09:46:45 -0700 | [diff] [blame] | 215 | * Errata Workaround for Neoverse N2 Erratum 2138953. |
| 216 | * This applies to revision r0p0 of Neoverse N2. it is still open. |
| 217 | * Inputs: |
| 218 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 219 | * Shall clobber: x0-x1, x17 |
| 220 | * -------------------------------------------------- |
| 221 | */ |
| 222 | func errata_n2_2138953_wa |
| 223 | /* Check revision. */ |
| 224 | mov x17, x30 |
| 225 | bl check_errata_2138953 |
| 226 | cbz x0, 1f |
| 227 | |
| 228 | /* Apply instruction patching sequence */ |
| 229 | mrs x1, NEOVERSE_N2_CPUECTLR2_EL1 |
| 230 | mov x0, #NEOVERSE_N2_CPUECTLR2_EL1_PF_MODE_CNSRV |
| 231 | bfi x1, x0, #CPUECTLR2_EL1_PF_MODE_LSB, #CPUECTLR2_EL1_PF_MODE_WIDTH |
| 232 | msr NEOVERSE_N2_CPUECTLR2_EL1, x1 |
| 233 | 1: |
| 234 | ret x17 |
| 235 | endfunc errata_n2_2138953_wa |
| 236 | |
| 237 | func check_errata_2138953 |
| 238 | /* Applies to r0p0 */ |
| 239 | mov x1, #0x00 |
| 240 | b cpu_rev_var_ls |
| 241 | endfunc check_errata_2138953 |
| 242 | |
nayanpatel-arm | 8e1aa01 | 2021-10-20 18:28:58 -0700 | [diff] [blame] | 243 | /* -------------------------------------------------- |
| 244 | * Errata Workaround for Neoverse N2 Erratum 2138958. |
| 245 | * This applies to revision r0p0 of Neoverse N2. it is still open. |
| 246 | * Inputs: |
| 247 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 248 | * Shall clobber: x0-x1, x17 |
| 249 | * -------------------------------------------------- |
| 250 | */ |
| 251 | func errata_n2_2138958_wa |
| 252 | /* Check revision. */ |
| 253 | mov x17, x30 |
| 254 | bl check_errata_2138958 |
| 255 | cbz x0, 1f |
| 256 | |
| 257 | /* Apply instruction patching sequence */ |
| 258 | mrs x1, NEOVERSE_N2_CPUACTLR5_EL1 |
| 259 | orr x1, x1, NEOVERSE_N2_CPUACTLR5_EL1_BIT_13 |
| 260 | msr NEOVERSE_N2_CPUACTLR5_EL1, x1 |
| 261 | 1: |
| 262 | ret x17 |
| 263 | endfunc errata_n2_2138958_wa |
| 264 | |
| 265 | func check_errata_2138958 |
| 266 | /* Applies to r0p0 */ |
| 267 | mov x1, #0x00 |
| 268 | b cpu_rev_var_ls |
| 269 | endfunc check_errata_2138958 |
| 270 | |
nayanpatel-arm | fed9813 | 2021-10-07 17:59:33 -0700 | [diff] [blame] | 271 | /* -------------------------------------------------- |
| 272 | * Errata Workaround for Neoverse N2 Erratum 2242400. |
| 273 | * This applies to revision r0p0 of Neoverse N2. it is still open. |
| 274 | * Inputs: |
| 275 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 276 | * Shall clobber: x0-x1, x17 |
| 277 | * -------------------------------------------------- |
| 278 | */ |
| 279 | func errata_n2_2242400_wa |
| 280 | /* Check revision. */ |
| 281 | mov x17, x30 |
| 282 | bl check_errata_2242400 |
| 283 | cbz x0, 1f |
| 284 | |
| 285 | /* Apply instruction patching sequence */ |
| 286 | mrs x1, NEOVERSE_N2_CPUACTLR5_EL1 |
| 287 | orr x1, x1, NEOVERSE_N2_CPUACTLR5_EL1_BIT_17 |
| 288 | msr NEOVERSE_N2_CPUACTLR5_EL1, x1 |
| 289 | ldr x0, =0x2 |
| 290 | msr S3_6_c15_c8_0, x0 |
| 291 | ldr x0, =0x10F600E000 |
| 292 | msr S3_6_c15_c8_2, x0 |
| 293 | ldr x0, =0x10FF80E000 |
| 294 | msr S3_6_c15_c8_3, x0 |
| 295 | ldr x0, =0x80000000003FF |
| 296 | msr S3_6_c15_c8_1, x0 |
| 297 | isb |
| 298 | 1: |
| 299 | ret x17 |
| 300 | endfunc errata_n2_2242400_wa |
| 301 | |
| 302 | func check_errata_2242400 |
| 303 | /* Applies to r0p0 */ |
| 304 | mov x1, #0x00 |
| 305 | b cpu_rev_var_ls |
| 306 | endfunc check_errata_2242400 |
| 307 | |
nayanpatel-arm | 45b9f6f | 2021-10-20 17:30:46 -0700 | [diff] [blame] | 308 | /* -------------------------------------------------- |
| 309 | * Errata Workaround for Neoverse N2 Erratum 2280757. |
| 310 | * This applies to revision r0p0 of Neoverse N2. it is still open. |
| 311 | * Inputs: |
| 312 | * x0: variant[4:7] and revision[0:3] of current cpu. |
| 313 | * Shall clobber: x0-x1, x17 |
| 314 | * -------------------------------------------------- |
| 315 | */ |
| 316 | func errata_n2_2280757_wa |
| 317 | /* Check revision. */ |
| 318 | mov x17, x30 |
| 319 | bl check_errata_2280757 |
| 320 | cbz x0, 1f |
| 321 | |
| 322 | /* Apply instruction patching sequence */ |
| 323 | mrs x1, NEOVERSE_N2_CPUACTLR_EL1 |
| 324 | orr x1, x1, NEOVERSE_N2_CPUACTLR_EL1_BIT_22 |
| 325 | msr NEOVERSE_N2_CPUACTLR_EL1, x1 |
| 326 | 1: |
| 327 | ret x17 |
| 328 | endfunc errata_n2_2280757_wa |
| 329 | |
| 330 | func check_errata_2280757 |
| 331 | /* Applies to r0p0 */ |
| 332 | mov x1, #0x00 |
| 333 | b cpu_rev_var_ls |
| 334 | endfunc check_errata_2280757 |
| 335 | |
Bipin Ravi | 7f56547 | 2021-03-31 10:10:27 -0500 | [diff] [blame] | 336 | /* ------------------------------------------- |
Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 337 | * The CPU Ops reset function for Neoverse N2. |
Bipin Ravi | 7f56547 | 2021-03-31 10:10:27 -0500 | [diff] [blame] | 338 | * ------------------------------------------- |
Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 339 | */ |
| 340 | func neoverse_n2_reset_func |
nayanpatel-arm | 277581e | 2021-08-06 17:46:10 -0700 | [diff] [blame] | 341 | mov x19, x30 |
| 342 | |
Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 343 | /* Check if the PE implements SSBS */ |
| 344 | mrs x0, id_aa64pfr1_el1 |
| 345 | tst x0, #(ID_AA64PFR1_EL1_SSBS_MASK << ID_AA64PFR1_EL1_SSBS_SHIFT) |
| 346 | b.eq 1f |
| 347 | |
| 348 | /* Disable speculative loads */ |
| 349 | msr SSBS, xzr |
| 350 | 1: |
| 351 | /* Force all cacheable atomic instructions to be near */ |
| 352 | mrs x0, NEOVERSE_N2_CPUACTLR2_EL1 |
| 353 | orr x0, x0, #NEOVERSE_N2_CPUACTLR2_EL1_BIT_2 |
| 354 | msr NEOVERSE_N2_CPUACTLR2_EL1, x0 |
| 355 | |
Bipin Ravi | eb35e85 | 2021-03-30 16:08:32 -0500 | [diff] [blame] | 356 | #if ERRATA_N2_2067956 |
| 357 | mov x0, x18 |
| 358 | bl errata_n2_2067956_wa |
| 359 | #endif |
| 360 | |
Bipin Ravi | 7f56547 | 2021-03-31 10:10:27 -0500 | [diff] [blame] | 361 | #if ERRATA_N2_2025414 |
nayanpatel-arm | fed9813 | 2021-10-07 17:59:33 -0700 | [diff] [blame] | 362 | mov x0, x18 |
| 363 | bl errata_n2_2025414_wa |
Bipin Ravi | 7f56547 | 2021-03-31 10:10:27 -0500 | [diff] [blame] | 364 | #endif |
| 365 | |
Bipin Ravi | 7e03069 | 2021-08-30 13:02:51 -0500 | [diff] [blame] | 366 | #if ERRATA_N2_2189731 |
nayanpatel-arm | fed9813 | 2021-10-07 17:59:33 -0700 | [diff] [blame] | 367 | mov x0, x18 |
| 368 | bl errata_n2_2189731_wa |
Bipin Ravi | 7e03069 | 2021-08-30 13:02:51 -0500 | [diff] [blame] | 369 | #endif |
| 370 | |
Bipin Ravi | 0ba631c | 2021-09-01 01:36:43 -0500 | [diff] [blame] | 371 | |
| 372 | #if ERRATA_N2_2138956 |
| 373 | mov x0, x18 |
| 374 | bl errata_n2_2138956_wa |
| 375 | #endif |
| 376 | |
nayanpatel-arm | d4c5f9c | 2021-09-28 09:46:45 -0700 | [diff] [blame] | 377 | #if ERRATA_N2_2138953 |
| 378 | mov x0, x18 |
| 379 | bl errata_n2_2138953_wa |
| 380 | #endif |
| 381 | |
nayanpatel-arm | 2f15399 | 2021-10-06 15:31:24 -0700 | [diff] [blame] | 382 | #if ERRATA_N2_2242415 |
| 383 | mov x0, x18 |
| 384 | bl errata_n2_2242415_wa |
| 385 | #endif |
| 386 | |
nayanpatel-arm | 8e1aa01 | 2021-10-20 18:28:58 -0700 | [diff] [blame] | 387 | #if ERRATA_N2_2138958 |
| 388 | mov x0, x18 |
| 389 | bl errata_n2_2138958_wa |
| 390 | #endif |
| 391 | |
nayanpatel-arm | fed9813 | 2021-10-07 17:59:33 -0700 | [diff] [blame] | 392 | #if ERRATA_N2_2242400 |
| 393 | mov x0, x18 |
| 394 | bl errata_n2_2242400_wa |
| 395 | #endif |
| 396 | |
nayanpatel-arm | 45b9f6f | 2021-10-20 17:30:46 -0700 | [diff] [blame] | 397 | #if ERRATA_N2_2280757 |
| 398 | mov x0, x18 |
| 399 | bl errata_n2_2280757_wa |
| 400 | #endif |
| 401 | |
Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 402 | #if ENABLE_AMU |
| 403 | /* Make sure accesses from EL0/EL1 and EL2 are not trapped to EL3 */ |
| 404 | mrs x0, cptr_el3 |
| 405 | orr x0, x0, #TAM_BIT |
| 406 | msr cptr_el3, x0 |
| 407 | |
| 408 | /* Make sure accesses from EL0/EL1 are not trapped to EL2 */ |
| 409 | mrs x0, cptr_el2 |
| 410 | orr x0, x0, #TAM_BIT |
| 411 | msr cptr_el2, x0 |
| 412 | |
| 413 | /* No need to enable the counters as this would be done at el3 exit */ |
| 414 | #endif |
| 415 | |
| 416 | #if NEOVERSE_Nx_EXTERNAL_LLC |
| 417 | /* Some systems may have External LLC, core needs to be made aware */ |
Bipin Ravi | eb35e85 | 2021-03-30 16:08:32 -0500 | [diff] [blame] | 418 | mrs x0, NEOVERSE_N2_CPUECTLR_EL1 |
| 419 | orr x0, x0, NEOVERSE_N2_CPUECTLR_EL1_EXTLLC_BIT |
| 420 | msr NEOVERSE_N2_CPUECTLR_EL1, x0 |
Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 421 | #endif |
| 422 | |
nayanpatel-arm | 277581e | 2021-08-06 17:46:10 -0700 | [diff] [blame] | 423 | bl cpu_get_rev_var |
| 424 | mov x18, x0 |
| 425 | |
| 426 | #if ERRATA_N2_2002655 |
| 427 | mov x0, x18 |
| 428 | bl errata_n2_2002655_wa |
| 429 | #endif |
| 430 | |
Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 431 | isb |
Bipin Ravi | eb35e85 | 2021-03-30 16:08:32 -0500 | [diff] [blame] | 432 | ret x19 |
Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 433 | endfunc neoverse_n2_reset_func |
| 434 | |
| 435 | func neoverse_n2_core_pwr_dwn |
Bipin Ravi | 7f56547 | 2021-03-31 10:10:27 -0500 | [diff] [blame] | 436 | /* --------------------------------------------------- |
Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 437 | * Enable CPU power down bit in power control register |
| 438 | * No need to do cache maintenance here. |
Bipin Ravi | 7f56547 | 2021-03-31 10:10:27 -0500 | [diff] [blame] | 439 | * --------------------------------------------------- |
Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 440 | */ |
| 441 | mrs x0, NEOVERSE_N2_CPUPWRCTLR_EL1 |
| 442 | orr x0, x0, #NEOVERSE_N2_CORE_PWRDN_EN_BIT |
| 443 | msr NEOVERSE_N2_CPUPWRCTLR_EL1, x0 |
| 444 | isb |
| 445 | ret |
| 446 | endfunc neoverse_n2_core_pwr_dwn |
| 447 | |
| 448 | #if REPORT_ERRATA |
| 449 | /* |
| 450 | * Errata printing function for Neoverse N2 cores. Must follow AAPCS. |
| 451 | */ |
| 452 | func neoverse_n2_errata_report |
nayanpatel-arm | 277581e | 2021-08-06 17:46:10 -0700 | [diff] [blame] | 453 | stp x8, x30, [sp, #-16]! |
| 454 | |
| 455 | bl cpu_get_rev_var |
| 456 | mov x8, x0 |
| 457 | |
| 458 | /* |
| 459 | * Report all errata. The revision-variant information is passed to |
| 460 | * checking functions of each errata. |
| 461 | */ |
| 462 | report_errata ERRATA_N2_2002655, neoverse_n2, 2002655 |
Bipin Ravi | eb35e85 | 2021-03-30 16:08:32 -0500 | [diff] [blame] | 463 | report_errata ERRATA_N2_2067956, neoverse_n2, 2067956 |
Bipin Ravi | 7f56547 | 2021-03-31 10:10:27 -0500 | [diff] [blame] | 464 | report_errata ERRATA_N2_2025414, neoverse_n2, 2025414 |
nayanpatel-arm | d4c5f9c | 2021-09-28 09:46:45 -0700 | [diff] [blame] | 465 | report_errata ERRATA_N2_2189731, neoverse_n2, 2189731 |
Bipin Ravi | 0ba631c | 2021-09-01 01:36:43 -0500 | [diff] [blame] | 466 | report_errata ERRATA_N2_2138956, neoverse_n2, 2138956 |
nayanpatel-arm | d4c5f9c | 2021-09-28 09:46:45 -0700 | [diff] [blame] | 467 | report_errata ERRATA_N2_2138953, neoverse_n2, 2138953 |
nayanpatel-arm | 2f15399 | 2021-10-06 15:31:24 -0700 | [diff] [blame] | 468 | report_errata ERRATA_N2_2242415, neoverse_n2, 2242415 |
nayanpatel-arm | 8e1aa01 | 2021-10-20 18:28:58 -0700 | [diff] [blame] | 469 | report_errata ERRATA_N2_2138958, neoverse_n2, 2138958 |
nayanpatel-arm | fed9813 | 2021-10-07 17:59:33 -0700 | [diff] [blame] | 470 | report_errata ERRATA_N2_2242400, neoverse_n2, 2242400 |
nayanpatel-arm | 45b9f6f | 2021-10-20 17:30:46 -0700 | [diff] [blame] | 471 | report_errata ERRATA_N2_2280757, neoverse_n2, 2280757 |
nayanpatel-arm | 277581e | 2021-08-06 17:46:10 -0700 | [diff] [blame] | 472 | |
| 473 | ldp x8, x30, [sp], #16 |
Javier Almansa Sobrino | 9faad3c | 2020-10-23 13:22:07 +0100 | [diff] [blame] | 474 | ret |
| 475 | endfunc neoverse_n2_errata_report |
| 476 | #endif |
| 477 | |
| 478 | /* --------------------------------------------- |
| 479 | * This function provides Neoverse N2 specific |
| 480 | * register information for crash reporting. |
| 481 | * It needs to return with x6 pointing to |
| 482 | * a list of register names in ASCII and |
| 483 | * x8 - x15 having values of registers to be |
| 484 | * reported. |
| 485 | * --------------------------------------------- |
| 486 | */ |
| 487 | .section .rodata.neoverse_n2_regs, "aS" |
| 488 | neoverse_n2_regs: /* The ASCII list of register names to be reported */ |
| 489 | .asciz "cpupwrctlr_el1", "" |
| 490 | |
| 491 | func neoverse_n2_cpu_reg_dump |
| 492 | adr x6, neoverse_n2_regs |
| 493 | mrs x8, NEOVERSE_N2_CPUPWRCTLR_EL1 |
| 494 | ret |
| 495 | endfunc neoverse_n2_cpu_reg_dump |
| 496 | |
| 497 | declare_cpu_ops neoverse_n2, NEOVERSE_N2_MIDR, \ |
| 498 | neoverse_n2_reset_func, \ |
| 499 | neoverse_n2_core_pwr_dwn |