blob: 79800663a659efb461a010e780ac73de495e9c7e [file] [log] [blame]
Leif Lindholm5d764e02021-03-10 13:23:24 +00001/*
Boyan Karatotev0d020822024-11-19 11:27:01 +00002 * Copyright (c) 2014-2025, Arm Limited and Contributors. All rights reserved.
Leif Lindholm5d764e02021-03-10 13:23:24 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6#include <arch.h>
7#include <asm_macros.S>
8#include <cpu_macros.S>
9#include <qemu_max.h>
10
Boyan Karatotev89dba822025-01-22 13:54:43 +000011cpu_reset_prologue qemu_max
12
Leif Lindholm5d764e02021-03-10 13:23:24 +000013func qemu_max_core_pwr_dwn
14 /* ---------------------------------------------
Leif Lindholm5d764e02021-03-10 13:23:24 +000015 * Flush L1 cache to L2.
16 * ---------------------------------------------
17 */
18 mov x18, lr
19 mov x0, #DCCISW
20 bl dcsw_op_level1
21 mov lr, x18
22 ret
23endfunc qemu_max_core_pwr_dwn
24
25func qemu_max_cluster_pwr_dwn
26 /* ---------------------------------------------
Leif Lindholm5d764e02021-03-10 13:23:24 +000027 * Flush all caches to PoC.
28 * ---------------------------------------------
29 */
30 mov x0, #DCCISW
31 b dcsw_op_all
32endfunc qemu_max_cluster_pwr_dwn
33
Boyan Karatotev0d020822024-11-19 11:27:01 +000034cpu_reset_func_start qemu_max
35cpu_reset_func_end qemu_max
36
Leif Lindholm5d764e02021-03-10 13:23:24 +000037 /* ---------------------------------------------
38 * This function provides cpu specific
39 * register information for crash reporting.
40 * It needs to return with x6 pointing to
41 * a list of register names in ascii and
42 * x8 - x15 having values of registers to be
43 * reported.
44 * ---------------------------------------------
45 */
46.section .rodata.qemu_max_regs, "aS"
47qemu_max_regs: /* The ascii list of register names to be reported */
48 .asciz "" /* no registers to report */
49
50func qemu_max_cpu_reg_dump
51 adr x6, qemu_max_regs
52 ret
53endfunc qemu_max_cpu_reg_dump
54
55
56/* cpu_ops for QEMU MAX */
Boyan Karatotev0d020822024-11-19 11:27:01 +000057declare_cpu_ops qemu_max, QEMU_MAX_MIDR, qemu_max_reset_func, \
Leif Lindholm5d764e02021-03-10 13:23:24 +000058 qemu_max_core_pwr_dwn, \
59 qemu_max_cluster_pwr_dwn