xref: /openbmc/linux/arch/powerpc/include/asm/setup.h (revision 34fc9cc3)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_SETUP_H
3 #define _ASM_POWERPC_SETUP_H
4 
5 #include <uapi/asm/setup.h>
6 
7 #ifndef __ASSEMBLY__
8 extern void ppc_printk_progress(char *s, unsigned short hex);
9 
10 extern unsigned int rtas_data;
11 extern unsigned long long memory_limit;
12 extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
13 
14 struct device_node;
15 
16 /* Used in very early kernel initialization. */
17 extern unsigned long reloc_offset(void);
18 extern unsigned long add_reloc_offset(unsigned long);
19 extern void reloc_got2(unsigned long);
20 
21 #define PTRRELOC(x)	((typeof(x)) add_reloc_offset((unsigned long)(x)))
22 
23 void check_for_initrd(void);
24 void mem_topology_setup(void);
25 void initmem_init(void);
26 void setup_panic(void);
27 #define ARCH_PANIC_TIMEOUT 180
28 
29 #ifdef CONFIG_PPC_PSERIES
30 extern bool pseries_reloc_on_exception(void);
31 extern bool pseries_enable_reloc_on_exc(void);
32 extern void pseries_disable_reloc_on_exc(void);
33 extern void pseries_big_endian_exceptions(void);
34 void __init pseries_little_endian_exceptions(void);
35 #else
36 static inline bool pseries_reloc_on_exception(void) { return false; }
37 static inline bool pseries_enable_reloc_on_exc(void) { return false; }
38 static inline void pseries_disable_reloc_on_exc(void) {}
39 static inline void pseries_big_endian_exceptions(void) {}
40 static inline void pseries_little_endian_exceptions(void) {}
41 #endif /* CONFIG_PPC_PSERIES */
42 
43 void rfi_flush_enable(bool enable);
44 
45 /* These are bit flags */
46 enum l1d_flush_type {
47 	L1D_FLUSH_NONE		= 0x1,
48 	L1D_FLUSH_FALLBACK	= 0x2,
49 	L1D_FLUSH_ORI		= 0x4,
50 	L1D_FLUSH_MTTRIG	= 0x8,
51 };
52 
53 void setup_rfi_flush(enum l1d_flush_type, bool enable);
54 void setup_entry_flush(bool enable);
55 void setup_uaccess_flush(bool enable);
56 void do_rfi_flush_fixups(enum l1d_flush_type types);
57 #ifdef CONFIG_PPC_BARRIER_NOSPEC
58 void __init setup_barrier_nospec(void);
59 #else
60 static inline void setup_barrier_nospec(void) { }
61 #endif
62 void do_uaccess_flush_fixups(enum l1d_flush_type types);
63 void do_entry_flush_fixups(enum l1d_flush_type types);
64 void do_barrier_nospec_fixups(bool enable);
65 extern bool barrier_nospec_enabled;
66 
67 #ifdef CONFIG_PPC_BARRIER_NOSPEC
68 void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
69 #else
70 static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { }
71 #endif
72 
73 #ifdef CONFIG_PPC_FSL_BOOK3E
74 void __init setup_spectre_v2(void);
75 #else
76 static inline void setup_spectre_v2(void) {}
77 #endif
78 void __init do_btb_flush_fixups(void);
79 
80 #ifdef CONFIG_PPC32
81 unsigned long __init early_init(unsigned long dt_ptr);
82 void __init machine_init(u64 dt_ptr);
83 #endif
84 void __init early_setup(unsigned long dt_ptr);
85 void early_setup_secondary(void);
86 
87 /* prom_init (OpenFirmware) */
88 unsigned long __init prom_init(unsigned long r3, unsigned long r4,
89 			       unsigned long pp, unsigned long r6,
90 			       unsigned long r7, unsigned long kbase);
91 
92 #endif /* !__ASSEMBLY__ */
93 
94 #endif	/* _ASM_POWERPC_SETUP_H */
95 
96