18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef _ASM_POWERPC_SETUP_H 38c2ecf20Sopenharmony_ci#define _ASM_POWERPC_SETUP_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#include <uapi/asm/setup.h> 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 88c2ecf20Sopenharmony_ciextern void ppc_printk_progress(char *s, unsigned short hex); 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ciextern unsigned int rtas_data; 118c2ecf20Sopenharmony_ciextern unsigned long long memory_limit; 128c2ecf20Sopenharmony_ciextern bool init_mem_is_free; 138c2ecf20Sopenharmony_ciextern unsigned long klimit; 148c2ecf20Sopenharmony_ciextern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_cistruct device_node; 178c2ecf20Sopenharmony_ciextern void note_scsi_host(struct device_node *, void *); 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci/* Used in very early kernel initialization. */ 208c2ecf20Sopenharmony_ciextern unsigned long reloc_offset(void); 218c2ecf20Sopenharmony_ciextern unsigned long add_reloc_offset(unsigned long); 228c2ecf20Sopenharmony_ciextern void reloc_got2(unsigned long); 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x))) 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_civoid check_for_initrd(void); 278c2ecf20Sopenharmony_civoid mem_topology_setup(void); 288c2ecf20Sopenharmony_civoid initmem_init(void); 298c2ecf20Sopenharmony_civoid setup_panic(void); 308c2ecf20Sopenharmony_ci#define ARCH_PANIC_TIMEOUT 180 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci#ifdef CONFIG_PPC_PSERIES 338c2ecf20Sopenharmony_ciextern bool pseries_enable_reloc_on_exc(void); 348c2ecf20Sopenharmony_ciextern void pseries_disable_reloc_on_exc(void); 358c2ecf20Sopenharmony_ciextern void pseries_big_endian_exceptions(void); 368c2ecf20Sopenharmony_ciextern void pseries_little_endian_exceptions(void); 378c2ecf20Sopenharmony_ci#else 388c2ecf20Sopenharmony_cistatic inline bool pseries_enable_reloc_on_exc(void) { return false; } 398c2ecf20Sopenharmony_cistatic inline void pseries_disable_reloc_on_exc(void) {} 408c2ecf20Sopenharmony_cistatic inline void pseries_big_endian_exceptions(void) {} 418c2ecf20Sopenharmony_cistatic inline void pseries_little_endian_exceptions(void) {} 428c2ecf20Sopenharmony_ci#endif /* CONFIG_PPC_PSERIES */ 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_civoid rfi_flush_enable(bool enable); 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci/* These are bit flags */ 478c2ecf20Sopenharmony_cienum l1d_flush_type { 488c2ecf20Sopenharmony_ci L1D_FLUSH_NONE = 0x1, 498c2ecf20Sopenharmony_ci L1D_FLUSH_FALLBACK = 0x2, 508c2ecf20Sopenharmony_ci L1D_FLUSH_ORI = 0x4, 518c2ecf20Sopenharmony_ci L1D_FLUSH_MTTRIG = 0x8, 528c2ecf20Sopenharmony_ci}; 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_civoid setup_rfi_flush(enum l1d_flush_type, bool enable); 558c2ecf20Sopenharmony_civoid setup_entry_flush(bool enable); 568c2ecf20Sopenharmony_civoid setup_uaccess_flush(bool enable); 578c2ecf20Sopenharmony_civoid do_rfi_flush_fixups(enum l1d_flush_type types); 588c2ecf20Sopenharmony_ci#ifdef CONFIG_PPC_BARRIER_NOSPEC 598c2ecf20Sopenharmony_civoid setup_barrier_nospec(void); 608c2ecf20Sopenharmony_ci#else 618c2ecf20Sopenharmony_cistatic inline void setup_barrier_nospec(void) { }; 628c2ecf20Sopenharmony_ci#endif 638c2ecf20Sopenharmony_civoid do_uaccess_flush_fixups(enum l1d_flush_type types); 648c2ecf20Sopenharmony_civoid do_entry_flush_fixups(enum l1d_flush_type types); 658c2ecf20Sopenharmony_civoid do_barrier_nospec_fixups(bool enable); 668c2ecf20Sopenharmony_ciextern bool barrier_nospec_enabled; 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ci#ifdef CONFIG_PPC_BARRIER_NOSPEC 698c2ecf20Sopenharmony_civoid do_barrier_nospec_fixups_range(bool enable, void *start, void *end); 708c2ecf20Sopenharmony_ci#else 718c2ecf20Sopenharmony_cistatic inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { }; 728c2ecf20Sopenharmony_ci#endif 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci#ifdef CONFIG_PPC_FSL_BOOK3E 758c2ecf20Sopenharmony_civoid setup_spectre_v2(void); 768c2ecf20Sopenharmony_ci#else 778c2ecf20Sopenharmony_cistatic inline void setup_spectre_v2(void) {}; 788c2ecf20Sopenharmony_ci#endif 798c2ecf20Sopenharmony_civoid do_btb_flush_fixups(void); 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci#endif /* !__ASSEMBLY__ */ 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci#endif /* _ASM_POWERPC_SETUP_H */ 848c2ecf20Sopenharmony_ci 85