blob: 2c47bd38184c92e5909fac6eb40fce511675e635 [file] [log] [blame]
Govindraj Raja02b5d1c2023-03-10 10:38:54 +00001/*
2 * Copyright (c) 2023, 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_chaberton.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 Chaberton must be compiled with HW_ASSISTED_COHERENCY enabled"
17#endif
18
19/* 64-bit only core */
20#if CTX_INCLUDE_AARCH32_REGS == 1
21#error "Cortex Chaberton supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
22#endif
23
24func cortex_chaberton_reset_func
25 /* Disable speculative loads */
26 msr SSBS, xzr
27 isb
28 ret
29endfunc cortex_chaberton_reset_func
30
31 /* ----------------------------------------------------
32 * HW will do the cache maintenance while powering down
33 * ----------------------------------------------------
34 */
35func cortex_chaberton_core_pwr_dwn
36 /* ---------------------------------------------------
37 * Enable CPU power down bit in power control register
38 * ---------------------------------------------------
39 */
40 mrs x0, CORTEX_CHABERTON_CPUPWRCTLR_EL1
41 orr x0, x0, #CORTEX_CHABERTON_CPUPWRCTLR_EL1_CORE_PWRDN_BIT
42 msr CORTEX_CHABERTON_CPUPWRCTLR_EL1, x0
43 isb
44 ret
45endfunc cortex_chaberton_core_pwr_dwn
46
47#if REPORT_ERRATA
48/*
49 * Errata printing function for Cortex Chaberton. Must follow AAPCS.
50 */
51func cortex_chaberton_errata_report
52 ret
53endfunc cortex_chaberton_errata_report
54#endif
55
56 /* ---------------------------------------------
57 * This function provides Cortex Chaberton specific
58 * register information for crash reporting.
59 * It needs to return with x6 pointing to
60 * a list of register names in ascii and
61 * x8 - x15 having values of registers to be
62 * reported.
63 * ---------------------------------------------
64 */
65.section .rodata.cortex_chaberton_regs, "aS"
66cortex_chaberton_regs: /* The ascii list of register names to be reported */
67 .asciz "cpuectlr_el1", ""
68
69func cortex_chaberton_cpu_reg_dump
70 adr x6, cortex_chaberton_regs
71 mrs x8, CORTEX_CHABERTON_CPUECTLR_EL1
72 ret
73endfunc cortex_chaberton_cpu_reg_dump
74
75declare_cpu_ops cortex_chaberton, CORTEX_CHABERTON_MIDR, \
76 cortex_chaberton_reset_func, \
77 cortex_chaberton_core_pwr_dwn