setup.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_POWERPC_SETUP_H
  3. #define _ASM_POWERPC_SETUP_H
  4. #include <uapi/asm/setup.h>
  5. #ifndef __ASSEMBLY__
  6. extern void ppc_printk_progress(char *s, unsigned short hex);
  7. extern unsigned long long memory_limit;
  8. extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
  9. struct device_node;
  10. /* Used in very early kernel initialization. */
  11. extern unsigned long reloc_offset(void);
  12. extern unsigned long add_reloc_offset(unsigned long);
  13. extern void reloc_got2(unsigned long);
  14. #define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x)))
  15. void check_for_initrd(void);
  16. void mem_topology_setup(void);
  17. void initmem_init(void);
  18. void setup_panic(void);
  19. #define ARCH_PANIC_TIMEOUT 180
  20. #ifdef CONFIG_PPC_PSERIES
  21. extern bool pseries_reloc_on_exception(void);
  22. extern bool pseries_enable_reloc_on_exc(void);
  23. extern void pseries_disable_reloc_on_exc(void);
  24. extern void pseries_big_endian_exceptions(void);
  25. void __init pseries_little_endian_exceptions(void);
  26. #else
  27. static inline bool pseries_reloc_on_exception(void) { return false; }
  28. static inline bool pseries_enable_reloc_on_exc(void) { return false; }
  29. static inline void pseries_disable_reloc_on_exc(void) {}
  30. static inline void pseries_big_endian_exceptions(void) {}
  31. static inline void pseries_little_endian_exceptions(void) {}
  32. #endif /* CONFIG_PPC_PSERIES */
  33. void rfi_flush_enable(bool enable);
  34. /* These are bit flags */
  35. enum l1d_flush_type {
  36. L1D_FLUSH_NONE = 0x1,
  37. L1D_FLUSH_FALLBACK = 0x2,
  38. L1D_FLUSH_ORI = 0x4,
  39. L1D_FLUSH_MTTRIG = 0x8,
  40. };
  41. void setup_rfi_flush(enum l1d_flush_type, bool enable);
  42. void setup_entry_flush(bool enable);
  43. void setup_uaccess_flush(bool enable);
  44. void do_rfi_flush_fixups(enum l1d_flush_type types);
  45. #ifdef CONFIG_PPC_BARRIER_NOSPEC
  46. void __init setup_barrier_nospec(void);
  47. #else
  48. static inline void setup_barrier_nospec(void) { }
  49. #endif
  50. void do_uaccess_flush_fixups(enum l1d_flush_type types);
  51. void do_entry_flush_fixups(enum l1d_flush_type types);
  52. void do_barrier_nospec_fixups(bool enable);
  53. extern bool barrier_nospec_enabled;
  54. #ifdef CONFIG_PPC_BARRIER_NOSPEC
  55. void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
  56. #else
  57. static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { }
  58. #endif
  59. #ifdef CONFIG_PPC_E500
  60. void __init setup_spectre_v2(void);
  61. #else
  62. static inline void setup_spectre_v2(void) {}
  63. #endif
  64. void __init do_btb_flush_fixups(void);
  65. #ifdef CONFIG_PPC32
  66. unsigned long __init early_init(unsigned long dt_ptr);
  67. void __init machine_init(u64 dt_ptr);
  68. #endif
  69. void __init early_setup(unsigned long dt_ptr);
  70. void early_setup_secondary(void);
  71. /* prom_init (OpenFirmware) */
  72. unsigned long __init prom_init(unsigned long r3, unsigned long r4,
  73. unsigned long pp, unsigned long r6,
  74. unsigned long r7, unsigned long kbase);
  75. extern struct seq_buf ppc_hw_desc;
  76. #endif /* !__ASSEMBLY__ */
  77. #endif /* _ASM_POWERPC_SETUP_H */