blob: b2aa26e286165af4cbd18d1016cb3cababd65aeb [file] [log] [blame]
Juan Pablo Conde54979582023-07-06 15:38:59 -05001/*
Boyan Karatotev89dba822025-01-22 13:54:43 +00002 * Copyright (c) 2023-2025, Arm Limited. All rights reserved.
Juan Pablo Conde54979582023-07-06 15:38:59 -05003 *
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 <nevis.h>
11#include <cpu_macros.S>
12#include <plat_macros.S>
13
14/* Hardware handled coherency */
15#if HW_ASSISTED_COHERENCY == 0
16#error "Nevis 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 "Nevis supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
22#endif
23
Boyan Karatotev89dba822025-01-22 13:54:43 +000024cpu_reset_prologue nevis
25
Juan Pablo Conde54979582023-07-06 15:38:59 -050026cpu_reset_func_start nevis
27 /* ----------------------------------------------------
28 * Disable speculative loads
29 * ----------------------------------------------------
30 */
31 msr SSBS, xzr
Boyan Karatotev2590e812024-11-25 10:14:26 +000032 enable_mpmm
Juan Pablo Conde54979582023-07-06 15:38:59 -050033cpu_reset_func_end nevis
34
35func nevis_core_pwr_dwn
36 /* ---------------------------------------------------
37 * Enable CPU power down bit in power control register
38 * ---------------------------------------------------
39 */
40 sysreg_bit_set NEVIS_IMP_CPUPWRCTLR_EL1, \
41 NEVIS_IMP_CPUPWRCTLR_EL1_CORE_PWRDN_EN_BIT
42 isb
43 ret
44endfunc nevis_core_pwr_dwn
45
Juan Pablo Conde54979582023-07-06 15:38:59 -050046.section .rodata.nevis_regs, "aS"
47nevis_regs: /* The ASCII list of register names to be reported */
48 .asciz "cpuectlr_el1", ""
49
50func nevis_cpu_reg_dump
51 adr x6, nevis_regs
52 mrs x8, NEVIS_CPUECTLR_EL1
53 ret
54endfunc nevis_cpu_reg_dump
55
56declare_cpu_ops nevis, NEVIS_MIDR, \
57 nevis_reset_func, \
58 nevis_core_pwr_dwn