1
2#ifndef _ASM_POWERPC_SETUP_H
3#define _ASM_POWERPC_SETUP_H
4
5#include <uapi/asm/setup.h>
6
7#ifndef __ASSEMBLY__
8extern void ppc_printk_progress(char *s, unsigned short hex);
9
10extern unsigned int rtas_data;
11extern unsigned long long memory_limit;
12extern bool init_mem_is_free;
13extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
14
15struct device_node;
16extern void note_scsi_host(struct device_node *, void *);
17
18
19extern unsigned long reloc_offset(void);
20extern unsigned long add_reloc_offset(unsigned long);
21extern void reloc_got2(unsigned long);
22
23#define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x)))
24
25void check_for_initrd(void);
26void mem_topology_setup(void);
27void initmem_init(void);
28void setup_panic(void);
29#define ARCH_PANIC_TIMEOUT 180
30
31#ifdef CONFIG_PPC_PSERIES
32extern bool pseries_enable_reloc_on_exc(void);
33extern void pseries_disable_reloc_on_exc(void);
34extern void pseries_big_endian_exceptions(void);
35extern void pseries_little_endian_exceptions(void);
36#else
37static inline bool pseries_enable_reloc_on_exc(void) { return false; }
38static inline void pseries_disable_reloc_on_exc(void) {}
39static inline void pseries_big_endian_exceptions(void) {}
40static inline void pseries_little_endian_exceptions(void) {}
41#endif
42
43void rfi_flush_enable(bool enable);
44
45
46enum 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
53void setup_rfi_flush(enum l1d_flush_type, bool enable);
54void setup_entry_flush(bool enable);
55void setup_uaccess_flush(bool enable);
56void do_rfi_flush_fixups(enum l1d_flush_type types);
57#ifdef CONFIG_PPC_BARRIER_NOSPEC
58void setup_barrier_nospec(void);
59#else
60static inline void setup_barrier_nospec(void) { }
61#endif
62void do_uaccess_flush_fixups(enum l1d_flush_type types);
63void do_entry_flush_fixups(enum l1d_flush_type types);
64void do_barrier_nospec_fixups(bool enable);
65extern bool barrier_nospec_enabled;
66
67#ifdef CONFIG_PPC_BARRIER_NOSPEC
68void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
69#else
70static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { }
71#endif
72
73#ifdef CONFIG_PPC_FSL_BOOK3E
74void setup_spectre_v2(void);
75#else
76static inline void setup_spectre_v2(void) {}
77#endif
78void do_btb_flush_fixups(void);
79
80#endif
81
82#endif
83
84