blob: df4c128532624c0e6653d6d140d0c563f3d5e18f [file] [log] [blame]
Joel Hutton9463cae2018-05-04 15:09:47 +01001/*
John Tsichritzisfe6df392019-03-19 17:20:52 +00002 * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
Joel Hutton9463cae2018-05-04 15:09:47 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch.h>
8#include <asm_macros.S>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00009#include <common/bl_common.h>
Joel Hutton9463cae2018-05-04 15:09:47 +010010#include <cortex_deimos.h>
11#include <cpu_macros.S>
12#include <plat_macros.S>
13
John Tsichritzisfe6df392019-03-19 17:20:52 +000014/* Hardware handled coherency */
15#if HW_ASSISTED_COHERENCY == 0
16#error "Deimos must be compiled with HW_ASSISTED_COHERENCY enabled"
17#endif
18
John Tsichritzis7557c662019-06-03 13:54:30 +010019/* 64-bit only core */
20#if CTX_INCLUDE_AARCH32_REGS == 1
21#error "Cortex-Deimos supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
22#endif
23
Joel Hutton9463cae2018-05-04 15:09:47 +010024 /* ---------------------------------------------
25 * HW will do the cache maintenance while powering down
26 * ---------------------------------------------
27 */
28func cortex_deimos_core_pwr_dwn
29 /* ---------------------------------------------
30 * Enable CPU power down bit in power control register
31 * ---------------------------------------------
32 */
33 mrs x0, CORTEX_DEIMOS_CPUPWRCTLR_EL1
34 orr x0, x0, #CORTEX_DEIMOS_CPUPWRCTLR_EL1_CORE_PWRDN_BIT
35 msr CORTEX_DEIMOS_CPUPWRCTLR_EL1, x0
36 isb
37 ret
38endfunc cortex_deimos_core_pwr_dwn
39
Soby Mathew0980dce2018-09-17 04:34:35 +010040#if REPORT_ERRATA
41/*
42 * Errata printing function for Cortex Deimos. Must follow AAPCS.
43 */
44func cortex_deimos_errata_report
45 ret
46endfunc cortex_deimos_errata_report
47#endif
48
49
Joel Hutton9463cae2018-05-04 15:09:47 +010050 /* ---------------------------------------------
51 * This function provides Cortex-Deimos specific
52 * register information for crash reporting.
53 * It needs to return with x6 pointing to
54 * a list of register names in ascii and
55 * x8 - x15 having values of registers to be
56 * reported.
57 * ---------------------------------------------
58 */
59.section .rodata.cortex_deimos_regs, "aS"
60cortex_deimos_regs: /* The ascii list of register names to be reported */
61 .asciz "cpuectlr_el1", ""
62
63func cortex_deimos_cpu_reg_dump
64 adr x6, cortex_deimos_regs
65 mrs x8, CORTEX_DEIMOS_CPUECTLR_EL1
66 ret
67endfunc cortex_deimos_cpu_reg_dump
68
69declare_cpu_ops cortex_deimos, CORTEX_DEIMOS_MIDR, \
70 CPU_NO_RESET_FUNC, \
71 cortex_deimos_core_pwr_dwn