blob: 25287de871837ae9f6190364e46231ecfab41850 [file] [log] [blame]
Louis Mayencourtf57f1082019-05-14 11:00:45 +01001/*
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 <cortex_hercules.h>
11#include <cpu_macros.S>
12#include <plat_macros.S>
13
14/* Hardware handled coherency */
15#if HW_ASSISTED_COHERENCY == 0
16#error "cortex_hercules must be compiled with HW_ASSISTED_COHERENCY enabled"
17#endif
18
19 /* ---------------------------------------------
20 * HW will do the cache maintenance while powering down
21 * ---------------------------------------------
22 */
23func cortex_hercules_core_pwr_dwn
24 /* ---------------------------------------------
25 * Enable CPU power down bit in power control register
26 * ---------------------------------------------
27 */
28 mrs x0, CORTEX_HERCULES_CPUPWRCTLR_EL1
29 orr x0, x0, #CORTEX_HERCULES_CPUPWRCTLR_EL1_CORE_PWRDN_EN_BIT
30 msr CORTEX_HERCULES_CPUPWRCTLR_EL1, x0
31 isb
32 ret
33endfunc cortex_hercules_core_pwr_dwn
34
35 /*
36 * Errata printing function for cortex_hercules. Must follow AAPCS.
37 */
38#if REPORT_ERRATA
39func cortex_hercules_errata_report
40 ret
41endfunc cortex_hercules_errata_report
42#endif
43
44 /* ---------------------------------------------
45 * This function provides cortex_hercules 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.cortex_hercules_regs, "aS"
54cortex_hercules_regs: /* The ascii list of register names to be reported */
55 .asciz "cpuectlr_el1", ""
56
57func cortex_hercules_cpu_reg_dump
58 adr x6, cortex_hercules_regs
59 mrs x8, CORTEX_HERCULES_CPUECTLR_EL1
60 ret
61endfunc cortex_hercules_cpu_reg_dump
62
63declare_cpu_ops cortex_hercules, CORTEX_HERCULES_MIDR, \
64 CPU_NO_RESET_FUNC, \
65 cortex_hercules_core_pwr_dwn