xref: /rk3399_ARM-atf/lib/cpus/aarch64/neoverse_e1.S (revision 6f7f8b18e9641d34c5b02b5f5e050d6e0fae12fc)
1/*
2 * Copyright (c) 2018-2025, Arm Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6#include <arch.h>
7#include <asm_macros.S>
8#include <common/bl_common.h>
9#include <common/debug.h>
10#include <dsu_macros.S>
11#include <neoverse_e1.h>
12#include <cpu_macros.S>
13#include <plat_macros.S>
14
15/* Hardware handled coherency */
16#if HW_ASSISTED_COHERENCY == 0
17#error "Neoverse E1 must be compiled with HW_ASSISTED_COHERENCY enabled"
18#endif
19
20/* 64-bit only core */
21#if CTX_INCLUDE_AARCH32_REGS == 1
22#error "Neoverse-E1 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
23#endif
24
25cpu_reset_prologue neoverse_e1
26
27workaround_reset_start neoverse_e1, ERRATUM(936184), ERRATA_DSU_936184
28	errata_dsu_936184_wa_impl
29workaround_reset_end neoverse_e1, ERRATUM(936184)
30
31check_erratum_custom_start neoverse_e1, ERRATUM(936184)
32	branch_if_scu_not_present 2f /* label 1 is used in the macro */
33	check_errata_dsu_936184_impl
34	2:
35	ret
36check_erratum_custom_end neoverse_e1, ERRATUM(936184)
37
38cpu_reset_func_start neoverse_e1
39cpu_reset_func_end neoverse_e1
40
41func neoverse_e1_cpu_pwr_dwn
42	mrs	x0, NEOVERSE_E1_CPUPWRCTLR_EL1
43	orr	x0, x0, #NEOVERSE_E1_CPUPWRCTLR_EL1_CORE_PWRDN_BIT
44	msr	NEOVERSE_E1_CPUPWRCTLR_EL1, x0
45	isb
46	ret
47endfunc neoverse_e1_cpu_pwr_dwn
48
49.section .rodata.neoverse_e1_regs, "aS"
50neoverse_e1_regs:  /* The ascii list of register names to be reported */
51	.asciz	"cpuectlr_el1", ""
52
53func neoverse_e1_cpu_reg_dump
54	adr	x6, neoverse_e1_regs
55	mrs	x8, NEOVERSE_E1_ECTLR_EL1
56	ret
57endfunc neoverse_e1_cpu_reg_dump
58
59declare_cpu_ops neoverse_e1, NEOVERSE_E1_MIDR, \
60	neoverse_e1_reset_func, \
61	neoverse_e1_cpu_pwr_dwn
62