Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 1 | /* |
| 2 | * Prototypes for functions that are shared between setup_(32|64|common).c |
| 3 | * |
| 4 | * Copyright 2016 Michael Ellerman, IBM Corporation. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the License, or (at your option) any later version. |
| 10 | */ |
| 11 | |
| 12 | #ifndef __ARCH_POWERPC_KERNEL_SETUP_H |
| 13 | #define __ARCH_POWERPC_KERNEL_SETUP_H |
| 14 | |
| 15 | void initialize_cache_info(void); |
| 16 | void irqstack_early_init(void); |
| 17 | |
| 18 | #ifdef CONFIG_PPC32 |
| 19 | void setup_power_save(void); |
| 20 | #else |
| 21 | static inline void setup_power_save(void) { }; |
| 22 | #endif |
| 23 | |
| 24 | #if defined(CONFIG_PPC64) && defined(CONFIG_SMP) |
| 25 | void check_smt_enabled(void); |
| 26 | #else |
| 27 | static inline void check_smt_enabled(void) { }; |
| 28 | #endif |
| 29 | |
| 30 | #if defined(CONFIG_PPC_BOOK3E) && defined(CONFIG_SMP) |
| 31 | void setup_tlb_core_data(void); |
| 32 | #else |
| 33 | static inline void setup_tlb_core_data(void) { }; |
| 34 | #endif |
| 35 | |
| 36 | #if defined(CONFIG_PPC_BOOK3E) || defined(CONFIG_BOOKE) || defined(CONFIG_40x) |
| 37 | void exc_lvl_early_init(void); |
| 38 | #else |
| 39 | static inline void exc_lvl_early_init(void) { }; |
| 40 | #endif |
| 41 | |
| 42 | #ifdef CONFIG_PPC64 |
| 43 | void emergency_stack_init(void); |
| 44 | #else |
| 45 | static inline void emergency_stack_init(void) { }; |
| 46 | #endif |
| 47 | |
Nicholas Piggin | 1696d0f | 2017-10-24 21:44:44 +1000 | [diff] [blame] | 48 | #ifdef CONFIG_PPC64 |
Nicholas Piggin | 1af1933 | 2017-12-22 21:17:13 +1000 | [diff] [blame] | 49 | u64 ppc64_bolted_size(void); |
Nicholas Piggin | c0abd0c | 2018-02-14 01:08:17 +1000 | [diff] [blame] | 50 | |
| 51 | /* Default SPR values from firmware/kexec */ |
| 52 | extern unsigned long spr_default_dscr; |
Nicholas Piggin | 1af1933 | 2017-12-22 21:17:13 +1000 | [diff] [blame] | 53 | #endif |
| 54 | |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 55 | /* |
| 56 | * Having this in kvm_ppc.h makes include dependencies too |
| 57 | * tricky to solve for setup-common.c so have it here. |
| 58 | */ |
| 59 | #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE |
| 60 | void kvm_cma_reserve(void); |
| 61 | #else |
| 62 | static inline void kvm_cma_reserve(void) { }; |
| 63 | #endif |
| 64 | |
Mathieu Malaterre | bd13ac9 | 2018-04-04 22:10:28 +0200 | [diff] [blame^] | 65 | #ifdef CONFIG_TAU |
| 66 | u32 cpu_temp(unsigned long cpu); |
| 67 | u32 cpu_temp_both(unsigned long cpu); |
| 68 | u32 tau_interrupts(unsigned long cpu); |
| 69 | #endif /* CONFIG_TAU */ |
| 70 | |
Benjamin Herrenschmidt | b1923ca | 2016-07-05 15:07:51 +1000 | [diff] [blame] | 71 | #endif /* __ARCH_POWERPC_KERNEL_SETUP_H */ |