xref: /rk3399_ARM-atf/lib/cpus/aarch64/qemu_max.S (revision 35b2bbf4942689fd52fa741ac7d93bc7f1d4c230)
15d764e05SLeif Lindholm/*
20d020822SBoyan Karatotev * Copyright (c) 2014-2025, Arm Limited and Contributors. All rights reserved.
35d764e05SLeif Lindholm *
45d764e05SLeif Lindholm * SPDX-License-Identifier: BSD-3-Clause
55d764e05SLeif Lindholm */
65d764e05SLeif Lindholm#include <arch.h>
75d764e05SLeif Lindholm#include <asm_macros.S>
85d764e05SLeif Lindholm#include <cpu_macros.S>
95d764e05SLeif Lindholm#include <qemu_max.h>
105d764e05SLeif Lindholm
11*89dba82dSBoyan Karatotevcpu_reset_prologue qemu_max
12*89dba82dSBoyan Karatotev
135d764e05SLeif Lindholmfunc qemu_max_core_pwr_dwn
145d764e05SLeif Lindholm	/* ---------------------------------------------
155d764e05SLeif Lindholm	 * Flush L1 cache to L2.
165d764e05SLeif Lindholm	 * ---------------------------------------------
175d764e05SLeif Lindholm	 */
185d764e05SLeif Lindholm	mov	x18, lr
195d764e05SLeif Lindholm	mov	x0, #DCCISW
205d764e05SLeif Lindholm	bl	dcsw_op_level1
215d764e05SLeif Lindholm	mov	lr, x18
225d764e05SLeif Lindholm	ret
235d764e05SLeif Lindholmendfunc qemu_max_core_pwr_dwn
245d764e05SLeif Lindholm
255d764e05SLeif Lindholmfunc qemu_max_cluster_pwr_dwn
265d764e05SLeif Lindholm	/* ---------------------------------------------
275d764e05SLeif Lindholm	 * Flush all caches to PoC.
285d764e05SLeif Lindholm	 * ---------------------------------------------
295d764e05SLeif Lindholm	 */
305d764e05SLeif Lindholm	mov	x0, #DCCISW
315d764e05SLeif Lindholm	b	dcsw_op_all
325d764e05SLeif Lindholmendfunc qemu_max_cluster_pwr_dwn
335d764e05SLeif Lindholm
340d020822SBoyan Karatotevcpu_reset_func_start qemu_max
350d020822SBoyan Karatotevcpu_reset_func_end qemu_max
360d020822SBoyan Karatotev
375d764e05SLeif Lindholm	/* ---------------------------------------------
385d764e05SLeif Lindholm	 * This function provides cpu specific
395d764e05SLeif Lindholm	 * register information for crash reporting.
405d764e05SLeif Lindholm	 * It needs to return with x6 pointing to
415d764e05SLeif Lindholm	 * a list of register names in ascii and
425d764e05SLeif Lindholm	 * x8 - x15 having values of registers to be
435d764e05SLeif Lindholm	 * reported.
445d764e05SLeif Lindholm	 * ---------------------------------------------
455d764e05SLeif Lindholm	 */
465d764e05SLeif Lindholm.section .rodata.qemu_max_regs, "aS"
475d764e05SLeif Lindholmqemu_max_regs:  /* The ascii list of register names to be reported */
485d764e05SLeif Lindholm	.asciz	"" /* no registers to report */
495d764e05SLeif Lindholm
505d764e05SLeif Lindholmfunc qemu_max_cpu_reg_dump
515d764e05SLeif Lindholm	adr	x6, qemu_max_regs
525d764e05SLeif Lindholm	ret
535d764e05SLeif Lindholmendfunc qemu_max_cpu_reg_dump
545d764e05SLeif Lindholm
555d764e05SLeif Lindholm
565d764e05SLeif Lindholm/* cpu_ops for QEMU MAX */
570d020822SBoyan Karatotevdeclare_cpu_ops qemu_max, QEMU_MAX_MIDR, qemu_max_reset_func, \
585d764e05SLeif Lindholm	qemu_max_core_pwr_dwn, \
595d764e05SLeif Lindholm	qemu_max_cluster_pwr_dwn
60