Joel Hutton | 9463cae | 2018-05-04 15:09:47 +0100 | [diff] [blame] | 1 | /* |
John Tsichritzis | fe6df39 | 2019-03-19 17:20:52 +0000 | [diff] [blame^] | 2 | * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. |
Joel Hutton | 9463cae | 2018-05-04 15:09:47 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
| 8 | #include <asm_macros.S> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 9 | #include <common/bl_common.h> |
Joel Hutton | 9463cae | 2018-05-04 15:09:47 +0100 | [diff] [blame] | 10 | #include <cortex_deimos.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 "Deimos must be compiled with HW_ASSISTED_COHERENCY enabled" |
| 17 | #endif |
| 18 | |
Joel Hutton | 9463cae | 2018-05-04 15:09:47 +0100 | [diff] [blame] | 19 | /* --------------------------------------------- |
| 20 | * HW will do the cache maintenance while powering down |
| 21 | * --------------------------------------------- |
| 22 | */ |
| 23 | func cortex_deimos_core_pwr_dwn |
| 24 | /* --------------------------------------------- |
| 25 | * Enable CPU power down bit in power control register |
| 26 | * --------------------------------------------- |
| 27 | */ |
| 28 | mrs x0, CORTEX_DEIMOS_CPUPWRCTLR_EL1 |
| 29 | orr x0, x0, #CORTEX_DEIMOS_CPUPWRCTLR_EL1_CORE_PWRDN_BIT |
| 30 | msr CORTEX_DEIMOS_CPUPWRCTLR_EL1, x0 |
| 31 | isb |
| 32 | ret |
| 33 | endfunc cortex_deimos_core_pwr_dwn |
| 34 | |
Soby Mathew | 0980dce | 2018-09-17 04:34:35 +0100 | [diff] [blame] | 35 | #if REPORT_ERRATA |
| 36 | /* |
| 37 | * Errata printing function for Cortex Deimos. Must follow AAPCS. |
| 38 | */ |
| 39 | func cortex_deimos_errata_report |
| 40 | ret |
| 41 | endfunc cortex_deimos_errata_report |
| 42 | #endif |
| 43 | |
| 44 | |
Joel Hutton | 9463cae | 2018-05-04 15:09:47 +0100 | [diff] [blame] | 45 | /* --------------------------------------------- |
| 46 | * This function provides Cortex-Deimos specific |
| 47 | * register information for crash reporting. |
| 48 | * It needs to return with x6 pointing to |
| 49 | * a list of register names in ascii and |
| 50 | * x8 - x15 having values of registers to be |
| 51 | * reported. |
| 52 | * --------------------------------------------- |
| 53 | */ |
| 54 | .section .rodata.cortex_deimos_regs, "aS" |
| 55 | cortex_deimos_regs: /* The ascii list of register names to be reported */ |
| 56 | .asciz "cpuectlr_el1", "" |
| 57 | |
| 58 | func cortex_deimos_cpu_reg_dump |
| 59 | adr x6, cortex_deimos_regs |
| 60 | mrs x8, CORTEX_DEIMOS_CPUECTLR_EL1 |
| 61 | ret |
| 62 | endfunc cortex_deimos_cpu_reg_dump |
| 63 | |
| 64 | declare_cpu_ops cortex_deimos, CORTEX_DEIMOS_MIDR, \ |
| 65 | CPU_NO_RESET_FUNC, \ |
| 66 | cortex_deimos_core_pwr_dwn |