cortex_a510.S 2.06 KB
Newer Older
Jimmy Brisson's avatar
Jimmy Brisson committed
1
/*
2
 * Copyright (c) 2021, ARM Limited. All rights reserved.
Jimmy Brisson's avatar
Jimmy Brisson committed
3
4
5
6
7
8
9
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <arch.h>
#include <asm_macros.S>
#include <common/bl_common.h>
10
#include <cortex_a510.h>
Jimmy Brisson's avatar
Jimmy Brisson committed
11
12
13
14
15
#include <cpu_macros.S>
#include <plat_macros.S>

/* Hardware handled coherency */
#if HW_ASSISTED_COHERENCY == 0
16
#error "Cortex A510 must be compiled with HW_ASSISTED_COHERENCY enabled"
Jimmy Brisson's avatar
Jimmy Brisson committed
17
18
19
20
#endif

/* 64-bit only core */
#if CTX_INCLUDE_AARCH32_REGS == 1
21
#error "Cortex A510 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
Jimmy Brisson's avatar
Jimmy Brisson committed
22
23
24
25
26
27
#endif

	/* ----------------------------------------------------
	 * HW will do the cache maintenance while powering down
	 * ----------------------------------------------------
	 */
28
func cortex_a510_core_pwr_dwn
Jimmy Brisson's avatar
Jimmy Brisson committed
29
30
31
32
	/* ---------------------------------------------------
	 * Enable CPU power down bit in power control register
	 * ---------------------------------------------------
	 */
33
34
35
	mrs	x0, CORTEX_A510_CPUPWRCTLR_EL1
	orr	x0, x0, #CORTEX_A510_CPUPWRCTLR_EL1_CORE_PWRDN_BIT
	msr	CORTEX_A510_CPUPWRCTLR_EL1, x0
Jimmy Brisson's avatar
Jimmy Brisson committed
36
37
	isb
	ret
38
endfunc cortex_a510_core_pwr_dwn
Jimmy Brisson's avatar
Jimmy Brisson committed
39
40

	/*
41
	 * Errata printing function for Cortex A510. Must follow AAPCS.
Jimmy Brisson's avatar
Jimmy Brisson committed
42
43
	 */
#if REPORT_ERRATA
44
func cortex_a510_errata_report
Jimmy Brisson's avatar
Jimmy Brisson committed
45
	ret
46
endfunc cortex_a510_errata_report
Jimmy Brisson's avatar
Jimmy Brisson committed
47
48
#endif

49
func cortex_a510_reset_func
Jimmy Brisson's avatar
Jimmy Brisson committed
50
51
52
53
	/* Disable speculative loads */
	msr	SSBS, xzr
	isb
	ret
54
endfunc cortex_a510_reset_func
Jimmy Brisson's avatar
Jimmy Brisson committed
55
56

	/* ---------------------------------------------
57
	 * This function provides Cortex-A510 specific
Jimmy Brisson's avatar
Jimmy Brisson committed
58
59
60
61
62
63
64
	 * register information for crash reporting.
	 * It needs to return with x6 pointing to
	 * a list of register names in ascii and
	 * x8 - x15 having values of registers to be
	 * reported.
	 * ---------------------------------------------
	 */
65
66
.section .rodata.cortex_a510_regs, "aS"
cortex_a510_regs:  /* The ascii list of register names to be reported */
Jimmy Brisson's avatar
Jimmy Brisson committed
67
68
	.asciz	"cpuectlr_el1", ""

69
70
71
func cortex_a510_cpu_reg_dump
	adr	x6, cortex_a510_regs
	mrs	x8, CORTEX_A510_CPUECTLR_EL1
Jimmy Brisson's avatar
Jimmy Brisson committed
72
	ret
73
endfunc cortex_a510_cpu_reg_dump
Jimmy Brisson's avatar
Jimmy Brisson committed
74

75
76
77
declare_cpu_ops cortex_a510, CORTEX_A510_MIDR, \
	cortex_a510_reset_func, \
	cortex_a510_core_pwr_dwn