blob: 93f22da12abe78c4982c637da3f3afb70669248f [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +10002/*
3 * Prototypes for functions that are shared between setup_(32|64|common).c
4 *
5 * Copyright 2016 Michael Ellerman, IBM Corporation.
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +10006 */
7
8#ifndef __ARCH_POWERPC_KERNEL_SETUP_H
9#define __ARCH_POWERPC_KERNEL_SETUP_H
10
11void initialize_cache_info(void);
12void irqstack_early_init(void);
13
14#ifdef CONFIG_PPC32
15void setup_power_save(void);
16#else
Chengyang Fan6c6fdbb2021-01-25 17:53:38 +080017static inline void setup_power_save(void) { }
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +100018#endif
19
20#if defined(CONFIG_PPC64) && defined(CONFIG_SMP)
21void check_smt_enabled(void);
22#else
Chengyang Fan6c6fdbb2021-01-25 17:53:38 +080023static inline void check_smt_enabled(void) { }
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +100024#endif
25
26#if defined(CONFIG_PPC_BOOK3E) && defined(CONFIG_SMP)
27void setup_tlb_core_data(void);
28#else
Chengyang Fan6c6fdbb2021-01-25 17:53:38 +080029static inline void setup_tlb_core_data(void) { }
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +100030#endif
31
Christophe Leroy047a6fd2021-10-19 09:29:25 +020032#ifdef CONFIG_BOOKE_OR_40x
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +100033void exc_lvl_early_init(void);
34#else
Chengyang Fan6c6fdbb2021-01-25 17:53:38 +080035static inline void exc_lvl_early_init(void) { }
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +100036#endif
37
Christophe Leroy3978eb72019-12-21 08:32:29 +000038#if defined(CONFIG_PPC64) || defined(CONFIG_VMAP_STACK)
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +100039void emergency_stack_init(void);
40#else
Chengyang Fan6c6fdbb2021-01-25 17:53:38 +080041static inline void emergency_stack_init(void) { }
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +100042#endif
43
Nicholas Piggin1696d0f2017-10-24 21:44:44 +100044#ifdef CONFIG_PPC64
Nicholas Piggin1af19332017-12-22 21:17:13 +100045u64 ppc64_bolted_size(void);
Nicholas Pigginc0abd0c2018-02-14 01:08:17 +100046
47/* Default SPR values from firmware/kexec */
48extern unsigned long spr_default_dscr;
Nicholas Piggin1af19332017-12-22 21:17:13 +100049#endif
50
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +100051/*
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
56void kvm_cma_reserve(void);
57#else
Chengyang Fan6c6fdbb2021-01-25 17:53:38 +080058static inline void kvm_cma_reserve(void) { }
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +100059#endif
60
Mathieu Malaterrebd13ac92018-04-04 22:10:28 +020061#ifdef CONFIG_TAU
62u32 cpu_temp(unsigned long cpu);
63u32 cpu_temp_both(unsigned long cpu);
64u32 tau_interrupts(unsigned long cpu);
65#endif /* CONFIG_TAU */
66
Benjamin Herrenschmidtb1923ca2016-07-05 15:07:51 +100067#endif /* __ARCH_POWERPC_KERNEL_SETUP_H */