xia.jin | 958d293 | 2024-06-07 03:12:53 +0000 | [diff] [blame] | 1 | // 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 |
| 12 | DECLARE_GLOBAL_DATA_PTR; |
| 13 | |
| 14 | #ifdef CONFIG_ARMV8_MULTIENTRY |
| 15 | unsigned long gd_ptr_init; |
| 16 | |
| 17 | /* |
| 18 | * secondary_boot_func |
| 19 | * this function should be write with asm, here, only for compiling pass |
| 20 | */ |
| 21 | void secondary_bootup_f(unsigned int x) |
| 22 | { |
| 23 | __asm__ volatile("mov x18, %0\n" |
| 24 | :: "r" (gd_ptr_init) : "memory"); |
| 25 | } |
| 26 | |
| 27 | void cpu_smp_init_r(void) |
| 28 | { |
| 29 | gd->flags |= GD_FLG_SMP; |
| 30 | gd_ptr_init = (unsigned long)gd; |
| 31 | } |
| 32 | |
| 33 | unsigned int get_smp_sp(unsigned int cpuidx) |
| 34 | { |
| 35 | return gd->start_addr_sp + secondary_sp_size * cpuidx; |
| 36 | } |
| 37 | #endif |
| 38 | |