0001
0002 #ifndef _ASM_POWERPC_SETUP_H
0003 #define _ASM_POWERPC_SETUP_H
0004
0005 #include <uapi/asm/setup.h>
0006
0007 #ifndef __ASSEMBLY__
0008 extern void ppc_printk_progress(char *s, unsigned short hex);
0009
0010 extern unsigned int rtas_data;
0011 extern unsigned long long memory_limit;
0012 extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
0013
0014 struct device_node;
0015
0016
0017 extern unsigned long reloc_offset(void);
0018 extern unsigned long add_reloc_offset(unsigned long);
0019 extern void reloc_got2(unsigned long);
0020
0021 #define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x)))
0022
0023 void check_for_initrd(void);
0024 void mem_topology_setup(void);
0025 void initmem_init(void);
0026 void setup_panic(void);
0027 #define ARCH_PANIC_TIMEOUT 180
0028
0029 #ifdef CONFIG_PPC_PSERIES
0030 extern bool pseries_reloc_on_exception(void);
0031 extern bool pseries_enable_reloc_on_exc(void);
0032 extern void pseries_disable_reloc_on_exc(void);
0033 extern void pseries_big_endian_exceptions(void);
0034 void __init pseries_little_endian_exceptions(void);
0035 #else
0036 static inline bool pseries_reloc_on_exception(void) { return false; }
0037 static inline bool pseries_enable_reloc_on_exc(void) { return false; }
0038 static inline void pseries_disable_reloc_on_exc(void) {}
0039 static inline void pseries_big_endian_exceptions(void) {}
0040 static inline void pseries_little_endian_exceptions(void) {}
0041 #endif
0042
0043 void rfi_flush_enable(bool enable);
0044
0045
0046 enum l1d_flush_type {
0047 L1D_FLUSH_NONE = 0x1,
0048 L1D_FLUSH_FALLBACK = 0x2,
0049 L1D_FLUSH_ORI = 0x4,
0050 L1D_FLUSH_MTTRIG = 0x8,
0051 };
0052
0053 void setup_rfi_flush(enum l1d_flush_type, bool enable);
0054 void setup_entry_flush(bool enable);
0055 void setup_uaccess_flush(bool enable);
0056 void do_rfi_flush_fixups(enum l1d_flush_type types);
0057 #ifdef CONFIG_PPC_BARRIER_NOSPEC
0058 void __init setup_barrier_nospec(void);
0059 #else
0060 static inline void setup_barrier_nospec(void) { }
0061 #endif
0062 void do_uaccess_flush_fixups(enum l1d_flush_type types);
0063 void do_entry_flush_fixups(enum l1d_flush_type types);
0064 void do_barrier_nospec_fixups(bool enable);
0065 extern bool barrier_nospec_enabled;
0066
0067 #ifdef CONFIG_PPC_BARRIER_NOSPEC
0068 void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
0069 #else
0070 static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { }
0071 #endif
0072
0073 #ifdef CONFIG_PPC_FSL_BOOK3E
0074 void __init setup_spectre_v2(void);
0075 #else
0076 static inline void setup_spectre_v2(void) {}
0077 #endif
0078 void __init do_btb_flush_fixups(void);
0079
0080 #ifdef CONFIG_PPC32
0081 unsigned long __init early_init(unsigned long dt_ptr);
0082 void __init machine_init(u64 dt_ptr);
0083 #endif
0084 void __init early_setup(unsigned long dt_ptr);
0085 void early_setup_secondary(void);
0086
0087
0088 unsigned long __init prom_init(unsigned long r3, unsigned long r4,
0089 unsigned long pp, unsigned long r6,
0090 unsigned long r7, unsigned long kbase);
0091
0092 #endif
0093
0094 #endif
0095