1/*
2 * Copyright (c) 2015-2018, Arm Limited and Contributors. All rights reserved.
3 * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#include <arch.h>
9#include <asm_macros.S>
10#include <cpu_macros.S>
11
12#include <plat_macros.S>
13#include <qti_cpu.h>
14
15	.p2align 3
16
17/* -------------------------------------------------
18 * The CPU Ops reset function for Kryo-3 Gold
19 * -------------------------------------------------
20 */
21func qti_kryo6_gold_reset_func
22#if IMAGE_BL31 && WORKAROUND_CVE_2017_5715
23	adr	x0, wa_cve_2017_5715_bpiall_vbar
24	msr	vbar_el3, x0
25	isb
26#endif
27
28	mov	x19, x30
29
30	bl	qtiseclib_kryo6_gold_reset_asm
31	mov	x30, x19
32	b	cortex_a78_reset_func
33
34endfunc qti_kryo6_gold_reset_func
35
36/* -------------------------------------------------------
37 * The CPU Ops cluster power down function for Kryo-3 Gold
38 * -------------------------------------------------------
39 */
40func qti_kryo6_gold_cluster_pwr_dwn
41	ret
42endfunc qti_kryo6_gold_cluster_pwr_dwn
43
44#if REPORT_ERRATA
45/*
46 * Errata printing function for Kryo4 Gold. Must follow AAPCS.
47 */
48func qti_kryo6_gold_errata_report
49	/* TODO : Need to add support. Required only for debug bl31 image.*/
50	ret
51endfunc qti_kryo6_gold_errata_report
52#endif
53
54/* ---------------------------------------------
55 * This function provides kryo4_gold specific
56 * register information for crash reporting.
57 * It needs to return with x6 pointing to
58 * a list of register names in ASCII and
59 * x8 - x15 having values of registers to be
60 * reported.
61 * ---------------------------------------------
62 */
63.section .rodata.qti_kryo4_gold_regs, "aS"
64qti_kryo6_gold_regs:  /* The ASCII list of register names to be reported */
65	.asciz	""
66
67func qti_kryo6_gold_cpu_reg_dump
68	adr	x6, qti_kryo6_gold_regs
69	ret
70endfunc qti_kryo6_gold_cpu_reg_dump
71
72declare_cpu_ops	qti_kryo6_gold, QTI_KRYO6_GOLD_MIDR,	\
73		qti_kryo6_gold_reset_func,		\
74		cortex_a78_core_pwr_dwn,	\
75		qti_kryo6_gold_cluster_pwr_dwn
76