blob: 65676e2325b85f919a9e2c49aef84b99bfeeb482 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Anton Blanchard560285c2012-11-01 14:55:04 +00002#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;
Anton Blanchard560285c2012-11-01 14:55:04 +000011extern unsigned long long memory_limit;
Michael Neuling51c3c622018-09-14 11:14:11 +100012extern bool init_mem_is_free;
Anton Blanchard560285c2012-11-01 14:55:04 +000013extern unsigned long klimit;
14extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
15
Anton Blanchard560285c2012-11-01 14:55:04 +000016struct device_node;
17extern void note_scsi_host(struct device_node *, void *);
18
19/* Used in very early kernel initialization. */
20extern unsigned long reloc_offset(void);
21extern unsigned long add_reloc_offset(unsigned long);
22extern void reloc_got2(unsigned long);
23
24#define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x)))
25
Robert Jenningsb88c4762013-10-28 09:20:51 -050026void check_for_initrd(void);
Nicholas Piggin9bd9be02018-02-14 01:08:16 +100027void mem_topology_setup(void);
Anton Blanchard10239732014-09-17 22:15:33 +100028void initmem_init(void);
David Gibsonab9dbf72017-12-04 16:27:25 +110029void setup_panic(void);
Jason Baronb71d47c2013-11-25 23:23:11 +000030#define ARCH_PANIC_TIMEOUT 180
Robert Jenningsb88c4762013-10-28 09:20:51 -050031
Benjamin Herrenschmidtd3cbff12016-07-05 15:03:49 +100032#ifdef CONFIG_PPC_PSERIES
33extern void pseries_enable_reloc_on_exc(void);
34extern void pseries_disable_reloc_on_exc(void);
35extern void pseries_big_endian_exceptions(void);
36extern void pseries_little_endian_exceptions(void);
37#else
38static inline void pseries_enable_reloc_on_exc(void) {}
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
Michael Ellermanaa8a5e02018-01-10 03:07:15 +110044void 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
Michael Ellermanabf110f2018-03-14 19:40:39 -030054void setup_rfi_flush(enum l1d_flush_type, bool enable);
Michael Ellermanaa8a5e02018-01-10 03:07:15 +110055void do_rfi_flush_fixups(enum l1d_flush_type types);
Michael Ellermanaf375ee2018-07-28 09:06:35 +100056#ifdef CONFIG_PPC_BARRIER_NOSPEC
Michal Suchanekcb3d6752018-04-24 14:15:57 +100057void setup_barrier_nospec(void);
Michael Ellermanaf375ee2018-07-28 09:06:35 +100058#else
59static inline void setup_barrier_nospec(void) { };
60#endif
Michal Suchanek2eea7f02018-04-24 14:15:55 +100061void do_barrier_nospec_fixups(bool enable);
Michal Suchanek815069c2018-04-24 14:15:56 +100062extern bool barrier_nospec_enabled;
63
Michael Ellerman179ab1c2018-07-28 09:06:34 +100064#ifdef CONFIG_PPC_BARRIER_NOSPEC
Michal Suchanek815069c2018-04-24 14:15:56 +100065void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
66#else
67static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { };
68#endif
Michael Ellermanaa8a5e02018-01-10 03:07:15 +110069
Diana Craciunf633a8a2018-12-12 16:03:04 +020070#ifdef CONFIG_PPC_FSL_BOOK3E
71void setup_spectre_v2(void);
72#else
73static inline void setup_spectre_v2(void) {};
74#endif
Diana Craciun76a5eaa2018-12-12 16:03:00 +020075void do_btb_flush_fixups(void);
76
Anton Blanchard560285c2012-11-01 14:55:04 +000077#endif /* !__ASSEMBLY__ */
78
79#endif /* _ASM_POWERPC_SETUP_H */
80