blob: bced2e88b2638e7a0d59a8a6b9d12fa72eb074f0 [file] [log] [blame]
xia.jin958d2932024-06-07 03:12:53 +00001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * (C) Copyright 2013
4 */
5
6#include <common.h>
7#include <asm/global_data.h>
8#include <amlogic/cpu_id.h>
9#ifdef CONFIG_ARMV8_MULTIENTRY
10#include <asm/arch-meson/smp.h>
11#endif
12DECLARE_GLOBAL_DATA_PTR;
13
14#ifdef CONFIG_ARMV8_MULTIENTRY
15unsigned long gd_ptr_init;
16
17/*
18 * secondary_boot_func
19 * this function should be write with asm, here, only for compiling pass
20 */
21void secondary_bootup_f(unsigned int x)
22{
23 __asm__ volatile("mov x18, %0\n"
24 :: "r" (gd_ptr_init) : "memory");
25}
26
27void cpu_smp_init_r(void)
28{
29 gd->flags |= GD_FLG_SMP;
30 gd_ptr_init = (unsigned long)gd;
31}
32
33unsigned int get_smp_sp(unsigned int cpuidx)
34{
35 return gd->start_addr_sp + secondary_sp_size * cpuidx;
36}
37#endif
38