Joel Hutton | a7c4687 | 2018-01-10 16:06:07 +0000 | [diff] [blame] | 1 | /* |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 2 | * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. |
Joel Hutton | a7c4687 | 2018-01-10 16:06:07 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | #include <arch.h> |
| 7 | #include <asm_macros.S> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 8 | #include <common/bl_common.h> |
| 9 | #include <common/debug.h> |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 10 | #include <neoverse_e1.h> |
Joel Hutton | a7c4687 | 2018-01-10 16:06:07 +0000 | [diff] [blame] | 11 | #include <cpu_macros.S> |
Joel Hutton | a7c4687 | 2018-01-10 16:06:07 +0000 | [diff] [blame] | 12 | #include <plat_macros.S> |
| 13 | |
John Tsichritzis | fe6df39 | 2019-03-19 17:20:52 +0000 | [diff] [blame] | 14 | /* Hardware handled coherency */ |
| 15 | #if HW_ASSISTED_COHERENCY == 0 |
| 16 | #error "Neoverse E1 must be compiled with HW_ASSISTED_COHERENCY enabled" |
| 17 | #endif |
| 18 | |
John Tsichritzis | 7557c66 | 2019-06-03 13:54:30 +0100 | [diff] [blame] | 19 | /* 64-bit only core */ |
| 20 | #if CTX_INCLUDE_AARCH32_REGS == 1 |
| 21 | #error "Neoverse-E1 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0" |
| 22 | #endif |
| 23 | |
Louis Mayencourt | 8b8b13b | 2019-06-10 16:43:39 +0100 | [diff] [blame] | 24 | /* ------------------------------------------------- |
| 25 | * The CPU Ops reset function for Neoverse-E1. |
| 26 | * Shall clobber: x0-x19 |
| 27 | * ------------------------------------------------- |
| 28 | */ |
| 29 | func neoverse_e1_reset_func |
| 30 | mov x19, x30 |
| 31 | |
| 32 | #if ERRATA_DSU_936184 |
| 33 | bl errata_dsu_936184_wa |
| 34 | #endif |
| 35 | |
| 36 | ret x19 |
| 37 | endfunc neoverse_e1_reset_func |
| 38 | |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 39 | func neoverse_e1_cpu_pwr_dwn |
| 40 | mrs x0, NEOVERSE_E1_CPUPWRCTLR_EL1 |
| 41 | orr x0, x0, #NEOVERSE_E1_CPUPWRCTLR_EL1_CORE_PWRDN_BIT |
| 42 | msr NEOVERSE_E1_CPUPWRCTLR_EL1, x0 |
Joel Hutton | a7c4687 | 2018-01-10 16:06:07 +0000 | [diff] [blame] | 43 | isb |
| 44 | ret |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 45 | endfunc neoverse_e1_cpu_pwr_dwn |
Joel Hutton | a7c4687 | 2018-01-10 16:06:07 +0000 | [diff] [blame] | 46 | |
Soby Mathew | 0980dce | 2018-09-17 04:34:35 +0100 | [diff] [blame] | 47 | #if REPORT_ERRATA |
| 48 | /* |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 49 | * Errata printing function for Neoverse N1. Must follow AAPCS. |
Soby Mathew | 0980dce | 2018-09-17 04:34:35 +0100 | [diff] [blame] | 50 | */ |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 51 | func neoverse_e1_errata_report |
Louis Mayencourt | 8b8b13b | 2019-06-10 16:43:39 +0100 | [diff] [blame] | 52 | stp x8, x30, [sp, #-16]! |
| 53 | |
| 54 | bl cpu_get_rev_var |
| 55 | mov x8, x0 |
| 56 | |
| 57 | /* |
| 58 | * Report all errata. The revision-variant information is passed to |
| 59 | * checking functions of each errata. |
| 60 | */ |
| 61 | report_errata ERRATA_DSU_936184, neoverse_e1, dsu_936184 |
| 62 | |
| 63 | ldp x8, x30, [sp], #16 |
Soby Mathew | 0980dce | 2018-09-17 04:34:35 +0100 | [diff] [blame] | 64 | ret |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 65 | endfunc neoverse_e1_errata_report |
Soby Mathew | 0980dce | 2018-09-17 04:34:35 +0100 | [diff] [blame] | 66 | #endif |
| 67 | |
| 68 | |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 69 | .section .rodata.neoverse_e1_regs, "aS" |
| 70 | neoverse_e1_regs: /* The ascii list of register names to be reported */ |
Joel Hutton | a7c4687 | 2018-01-10 16:06:07 +0000 | [diff] [blame] | 71 | .asciz "cpuectlr_el1", "" |
| 72 | |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 73 | func neoverse_e1_cpu_reg_dump |
| 74 | adr x6, neoverse_e1_regs |
| 75 | mrs x8, NEOVERSE_E1_ECTLR_EL1 |
Joel Hutton | a7c4687 | 2018-01-10 16:06:07 +0000 | [diff] [blame] | 76 | ret |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 77 | endfunc neoverse_e1_cpu_reg_dump |
Joel Hutton | a7c4687 | 2018-01-10 16:06:07 +0000 | [diff] [blame] | 78 | |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 79 | declare_cpu_ops neoverse_e1, NEOVERSE_E1_MIDR, \ |
Louis Mayencourt | 8b8b13b | 2019-06-10 16:43:39 +0100 | [diff] [blame] | 80 | neoverse_e1_reset_func, \ |
John Tsichritzis | 16e6d9f | 2019-02-19 14:01:55 +0000 | [diff] [blame] | 81 | neoverse_e1_cpu_pwr_dwn |