John Tsichritzis | 6deaf9c | 2018-10-08 17:09:43 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2019, ARM Limited. All rights reserved. |
| 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_zeus.h> |
| 11 | #include <cpu_macros.S> |
| 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 Zeus must be compiled with HW_ASSISTED_COHERENCY enabled" |
| 17 | #endif |
| 18 | |
John Tsichritzis | 6deaf9c | 2018-10-08 17:09:43 +0100 | [diff] [blame] | 19 | /* --------------------------------------------- |
| 20 | * HW will do the cache maintenance while powering down |
| 21 | * --------------------------------------------- |
| 22 | */ |
| 23 | func neoverse_zeus_core_pwr_dwn |
| 24 | /* --------------------------------------------- |
| 25 | * Enable CPU power down bit in power control register |
| 26 | * --------------------------------------------- |
| 27 | */ |
| 28 | mrs x0, NEOVERSE_ZEUS_CPUPWRCTLR_EL1 |
| 29 | orr x0, x0, #NEOVERSE_ZEUS_CPUPWRCTLR_EL1_CORE_PWRDN_BIT |
| 30 | msr NEOVERSE_ZEUS_CPUPWRCTLR_EL1, x0 |
| 31 | isb |
| 32 | ret |
| 33 | endfunc neoverse_zeus_core_pwr_dwn |
| 34 | |
| 35 | /* |
| 36 | * Errata printing function for Neoverse Zeus. Must follow AAPCS. |
| 37 | */ |
| 38 | #if REPORT_ERRATA |
| 39 | func neoverse_zeus_errata_report |
| 40 | ret |
| 41 | endfunc neoverse_zeus_errata_report |
| 42 | #endif |
| 43 | |
| 44 | /* --------------------------------------------- |
| 45 | * This function provides Neoverse-Zeus specific |
| 46 | * register information for crash reporting. |
| 47 | * It needs to return with x6 pointing to |
| 48 | * a list of register names in ascii and |
| 49 | * x8 - x15 having values of registers to be |
| 50 | * reported. |
| 51 | * --------------------------------------------- |
| 52 | */ |
| 53 | .section .rodata.neoverse_zeus_regs, "aS" |
| 54 | neoverse_zeus_regs: /* The ascii list of register names to be reported */ |
| 55 | .asciz "cpuectlr_el1", "" |
| 56 | |
| 57 | func neoverse_zeus_cpu_reg_dump |
| 58 | adr x6, neoverse_zeus_regs |
| 59 | mrs x8, NEOVERSE_ZEUS_CPUECTLR_EL1 |
| 60 | ret |
| 61 | endfunc neoverse_zeus_cpu_reg_dump |
| 62 | |
| 63 | declare_cpu_ops neoverse_zeus, NEOVERSE_ZEUS_MIDR, \ |
| 64 | CPU_NO_RESET_FUNC, \ |
| 65 | neoverse_zeus_core_pwr_dwn |