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