1/*
2 * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
3 * Copyright (c) 2018-2020, 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_kryo4_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_kryo4_gold_reset_asm
31
32	ret	x19
33
34endfunc qti_kryo4_gold_reset_func
35
36/* ----------------------------------------------------
37 * The CPU Ops core power down function for Kryo-3 Gold
38 * ----------------------------------------------------
39 */
40func qti_kryo4_gold_core_pwr_dwn
41	ret
42endfunc qti_kryo4_gold_core_pwr_dwn
43
44/* -------------------------------------------------------
45 * The CPU Ops cluster power down function for Kryo-3 Gold
46 * -------------------------------------------------------
47 */
48func qti_kryo4_gold_cluster_pwr_dwn
49	ret
50endfunc qti_kryo4_gold_cluster_pwr_dwn
51
52#if REPORT_ERRATA
53/*
54 * Errata printing function for Kryo4 Gold. Must follow AAPCS.
55 */
56func qti_kryo4_gold_errata_report
57	/* TODO : Need to add support. Required only for debug bl31 image.*/
58	ret
59endfunc qti_kryo4_gold_errata_report
60#endif
61
62/* ---------------------------------------------
63 * This function provides kryo4_gold specific
64 * register information for crash reporting.
65 * It needs to return with x6 pointing to
66 * a list of register names in ASCII and
67 * x8 - x15 having values of registers to be
68 * reported.
69 * ---------------------------------------------
70 */
71.section .rodata.qti_kryo4_gold_regs, "aS"
72qti_kryo4_gold_regs:  /* The ASCII list of register names to be reported */
73	.asciz	""
74
75func qti_kryo4_gold_cpu_reg_dump
76	adr	x6, qti_kryo4_gold_regs
77	ret
78endfunc qti_kryo4_gold_cpu_reg_dump
79
80declare_cpu_ops	qti_kryo4_gold, QTI_KRYO4_GOLD_MIDR,	\
81		qti_kryo4_gold_reset_func,		\
82		qti_kryo4_gold_core_pwr_dwn,	\
83		qti_kryo4_gold_cluster_pwr_dwn
84