blob: 4e9bd9f6f7b4f2e6f35747a35e32a0332bde6e0d [file] [log] [blame]
David Wang805c2c72016-11-09 16:29:02 +00001/*
John Tsichritzis4daa1de2018-07-23 09:11:59 +01002 * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
David Wang805c2c72016-11-09 16:29:02 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
David Wang805c2c72016-11-09 16:29:02 +00007#include <arch.h>
8#include <asm_macros.S>
9#include <bl_common.h>
Isla Mitchell99305012017-07-11 14:54:08 +010010#include <cortex_a55.h>
David Wang805c2c72016-11-09 16:29:02 +000011#include <cpu_macros.S>
12#include <plat_macros.S>
13
John Tsichritzis4daa1de2018-07-23 09:11:59 +010014func cortex_a55_reset_func
15 mov x19, x30
16#if ERRATA_DSU_936184
17 bl errata_dsu_936184_wa
18#endif
19 ret x19
20endfunc cortex_a55_reset_func
21
David Wang805c2c72016-11-09 16:29:02 +000022 /* ---------------------------------------------
23 * HW will do the cache maintenance while powering down
24 * ---------------------------------------------
25 */
26func cortex_a55_core_pwr_dwn
27 /* ---------------------------------------------
28 * Enable CPU power down bit in power control register
29 * ---------------------------------------------
30 */
31 mrs x0, CORTEX_A55_CPUPWRCTLR_EL1
32 orr x0, x0, #CORTEX_A55_CORE_PWRDN_EN_MASK
33 msr CORTEX_A55_CPUPWRCTLR_EL1, x0
34 isb
35 ret
36endfunc cortex_a55_core_pwr_dwn
37
John Tsichritzis4daa1de2018-07-23 09:11:59 +010038#if REPORT_ERRATA
39/*
40 * Errata printing function for Cortex A55. Must follow AAPCS & can use stack.
41 */
42func cortex_a55_errata_report
43 stp x8, x30, [sp, #-16]!
44 bl cpu_get_rev_var
45 mov x8, x0
46
47 /*
48 * Report all errata. The revision variant information is at x8, where
49 * "report_errata" is expecting it and it doesn't corrupt it.
50 */
51 report_errata ERRATA_DSU_936184, cortex_a55, dsu_936184
52
53 ldp x8, x30, [sp], #16
54 ret
55endfunc cortex_a55_errata_report
56#endif
57
David Wang805c2c72016-11-09 16:29:02 +000058 /* ---------------------------------------------
59 * This function provides cortex_a55 specific
60 * register information for crash reporting.
61 * It needs to return with x6 pointing to
62 * a list of register names in ascii and
63 * x8 - x15 having values of registers to be
64 * reported.
65 * ---------------------------------------------
66 */
67.section .rodata.cortex_a55_regs, "aS"
68cortex_a55_regs: /* The ascii list of register names to be reported */
69 .asciz "cpuectlr_el1", ""
70
71func cortex_a55_cpu_reg_dump
72 adr x6, cortex_a55_regs
73 mrs x8, CORTEX_A55_CPUECTLR_EL1
74 ret
75endfunc cortex_a55_cpu_reg_dump
76
77declare_cpu_ops cortex_a55, CORTEX_A55_MIDR, \
John Tsichritzis4daa1de2018-07-23 09:11:59 +010078 cortex_a55_reset_func, \
David Wang805c2c72016-11-09 16:29:02 +000079 cortex_a55_core_pwr_dwn