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