Thomas Gleixner | 2874c5f | 2019-05-27 08:55:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 2 | /* |
| 3 | * Prototypes for functions that are shared between setup_(32|64|common).c |
| 4 | * |
| 5 | * Copyright 2016 Michael Ellerman, IBM Corporation. |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __ARCH_POWERPC_KERNEL_SETUP_H |
| 9 | #define __ARCH_POWERPC_KERNEL_SETUP_H |
| 10 | |
| 11 | void initialize_cache_info(void); |
| 12 | void irqstack_early_init(void); |
| 13 | |
| 14 | #ifdef CONFIG_PPC32 |
| 15 | void setup_power_save(void); |
| 16 | #else |
Chengyang Fan | 6c6fdbb | 2021-01-25 17:53:38 +0800 | [diff] [blame] | 17 | static inline void setup_power_save(void) { } |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 18 | #endif |
| 19 | |
| 20 | #if defined(CONFIG_PPC64) && defined(CONFIG_SMP) |
| 21 | void check_smt_enabled(void); |
| 22 | #else |
Chengyang Fan | 6c6fdbb | 2021-01-25 17:53:38 +0800 | [diff] [blame] | 23 | static inline void check_smt_enabled(void) { } |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 24 | #endif |
| 25 | |
| 26 | #if defined(CONFIG_PPC_BOOK3E) && defined(CONFIG_SMP) |
| 27 | void setup_tlb_core_data(void); |
| 28 | #else |
Chengyang Fan | 6c6fdbb | 2021-01-25 17:53:38 +0800 | [diff] [blame] | 29 | static inline void setup_tlb_core_data(void) { } |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 30 | #endif |
| 31 | |
Christophe Leroy | 047a6fd | 2021-10-19 09:29:25 +0200 | [diff] [blame] | 32 | #ifdef CONFIG_BOOKE_OR_40x |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 33 | void exc_lvl_early_init(void); |
| 34 | #else |
Chengyang Fan | 6c6fdbb | 2021-01-25 17:53:38 +0800 | [diff] [blame] | 35 | static inline void exc_lvl_early_init(void) { } |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 36 | #endif |
| 37 | |
Christophe Leroy | 3978eb7 | 2019-12-21 08:32:29 +0000 | [diff] [blame] | 38 | #if defined(CONFIG_PPC64) || defined(CONFIG_VMAP_STACK) |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 39 | void emergency_stack_init(void); |
| 40 | #else |
Chengyang Fan | 6c6fdbb | 2021-01-25 17:53:38 +0800 | [diff] [blame] | 41 | static inline void emergency_stack_init(void) { } |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 42 | #endif |
| 43 | |
Nicholas Piggin | 1696d0f | 2017-10-24 21:44:44 +1000 | [diff] [blame] | 44 | #ifdef CONFIG_PPC64 |
Nicholas Piggin | 1af1933 | 2017-12-22 21:17:13 +1000 | [diff] [blame] | 45 | u64 ppc64_bolted_size(void); |
Nicholas Piggin | c0abd0c | 2018-02-14 01:08:17 +1000 | [diff] [blame] | 46 | |
| 47 | /* Default SPR values from firmware/kexec */ |
| 48 | extern unsigned long spr_default_dscr; |
Nicholas Piggin | 1af1933 | 2017-12-22 21:17:13 +1000 | [diff] [blame] | 49 | #endif |
| 50 | |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 51 | /* |
| 52 | * Having this in kvm_ppc.h makes include dependencies too |
| 53 | * tricky to solve for setup-common.c so have it here. |
| 54 | */ |
| 55 | #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE |
| 56 | void kvm_cma_reserve(void); |
| 57 | #else |
Chengyang Fan | 6c6fdbb | 2021-01-25 17:53:38 +0800 | [diff] [blame] | 58 | static inline void kvm_cma_reserve(void) { } |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 59 | #endif |
| 60 | |
Mathieu Malaterre | bd13ac9 | 2018-04-04 22:10:28 +0200 | [diff] [blame] | 61 | #ifdef CONFIG_TAU |
| 62 | u32 cpu_temp(unsigned long cpu); |
| 63 | u32 cpu_temp_both(unsigned long cpu); |
| 64 | u32 tau_interrupts(unsigned long cpu); |
| 65 | #endif /* CONFIG_TAU */ |
| 66 | |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 67 | #endif /* __ARCH_POWERPC_KERNEL_SETUP_H */ |