xref: /rk3399_ARM-atf/plat/st/stm32mp2/aarch64/stm32mp2_helper.S (revision 35527fb41829102083b488a5150c0c707c5ede15)
1/*
2 * Copyright (c) 2023, STMicroelectronics - All Rights Reserved
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <asm_macros.S>
8
9#include <platform_def.h>
10
11	.globl	platform_mem_init
12	.globl	plat_secondary_cold_boot_setup
13	.globl	plat_is_my_cpu_primary
14	.globl	plat_crash_console_init
15	.globl	plat_crash_console_flush
16	.globl	plat_crash_console_putc
17
18func platform_mem_init
19	/* Nothing to do, don't need to init SYSRAM */
20	ret
21endfunc platform_mem_init
22
23	/* ---------------------------------------------
24	 * void plat_secondary_cold_boot_setup (void);
25	 *
26	 * Set secondary core in WFI waiting for core reset.
27	 * ---------------------------------------------
28	 */
29func plat_secondary_cold_boot_setup
30	dsb	sy
31	wfi
32	/* This shouldn't be reached */
33	b	.
34endfunc plat_secondary_cold_boot_setup
35
36	/* ----------------------------------------------
37	 * unsigned int plat_is_my_cpu_primary(void);
38	 * This function checks if this is the primary CPU
39	 * ----------------------------------------------
40	 */
41func plat_is_my_cpu_primary
42	mrs	x0, mpidr_el1
43	and	x0, x0, #(MPIDR_CPU_MASK)
44	cmp	x0, #STM32MP_PRIMARY_CPU
45	cset	x0, eq
46	ret
47endfunc plat_is_my_cpu_primary
48
49	/* ---------------------------------------------
50	 * int plat_crash_console_init(void)
51	 *
52	 * Initialize the crash console without a C Runtime stack.
53	 * ---------------------------------------------
54	 */
55func plat_crash_console_init
56endfunc plat_crash_console_init
57
58func plat_crash_console_flush
59endfunc plat_crash_console_flush
60
61func plat_crash_console_putc
62endfunc plat_crash_console_putc
63
64