xref: /linux/arch/s390/include/asm/setup.h (revision bc46b7cbc58c4cb562b6a45a1fbc7b8e7b23df58)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  *  S390 version
4  *    Copyright IBM Corp. 1999, 2017
5  */
6 #ifndef _ASM_S390_SETUP_H
7 #define _ASM_S390_SETUP_H
8 
9 #include <linux/bits.h>
10 #include <uapi/asm/setup.h>
11 #include <linux/build_bug.h>
12 
13 #define PARMAREA		0x10400
14 
15 #define COMMAND_LINE_SIZE CONFIG_COMMAND_LINE_SIZE
16 
17 #define LPP_MAGIC		BIT(31)
18 #define LPP_PID_MASK		_AC(0xffffffff, UL)
19 
20 /* Offsets to entry points in kernel/head.S  */
21 
22 #define STARTUP_NORMAL_OFFSET	0x10000
23 #define STARTUP_KDUMP_OFFSET	0x10010
24 
25 #define LEGACY_COMMAND_LINE_SIZE	896
26 
27 #ifndef __ASSEMBLER__
28 
29 #include <asm/lowcore.h>
30 #include <asm/types.h>
31 
32 struct parmarea {
33 	unsigned long ipl_device;			/* 0x10400 */
34 	unsigned long initrd_start;			/* 0x10408 */
35 	unsigned long initrd_size;			/* 0x10410 */
36 	unsigned long oldmem_base;			/* 0x10418 */
37 	unsigned long oldmem_size;			/* 0x10420 */
38 	unsigned long kernel_version;			/* 0x10428 */
39 	unsigned long max_command_line_size;		/* 0x10430 */
40 	char pad1[0x10480-0x10438];			/* 0x10438 - 0x10480 */
41 	char command_line[COMMAND_LINE_SIZE];		/* 0x10480 */
42 };
43 
44 extern char arch_hw_string[128];
45 
46 extern struct parmarea parmarea;
47 
48 extern unsigned int zlib_dfltcc_support;
49 #define ZLIB_DFLTCC_DISABLED		0
50 #define ZLIB_DFLTCC_FULL		1
51 #define ZLIB_DFLTCC_DEFLATE_ONLY	2
52 #define ZLIB_DFLTCC_INFLATE_ONLY	3
53 #define ZLIB_DFLTCC_FULL_DEBUG		4
54 
55 extern unsigned long ident_map_size;
56 extern unsigned long max_mappable;
57 
58 /* The Write Back bit position in the physaddr is given by the SLPC PCI */
59 extern unsigned long mio_wb_bit_mask;
60 
61 /*
62  * Console mode. Override with conmode=
63  */
64 extern unsigned int console_mode;
65 extern unsigned int console_devno;
66 extern unsigned int console_irq;
67 
68 #define CONSOLE_IS_UNDEFINED	(console_mode == 0)
69 #define CONSOLE_IS_SCLP		(console_mode == 1)
70 #define CONSOLE_IS_3215		(console_mode == 2)
71 #define CONSOLE_IS_3270		(console_mode == 3)
72 #define CONSOLE_IS_VT220	(console_mode == 4)
73 #define CONSOLE_IS_HVC		(console_mode == 5)
74 #define SET_CONSOLE_SCLP	do { console_mode = 1; } while (0)
75 #define SET_CONSOLE_3215	do { console_mode = 2; } while (0)
76 #define SET_CONSOLE_3270	do { console_mode = 3; } while (0)
77 #define SET_CONSOLE_VT220	do { console_mode = 4; } while (0)
78 #define SET_CONSOLE_HVC		do { console_mode = 5; } while (0)
79 
80 void register_early_console(void);
81 
82 #ifdef CONFIG_VMCP
83 void vmcp_cma_reserve(void);
84 #else
vmcp_cma_reserve(void)85 static inline void vmcp_cma_reserve(void) { }
86 #endif
87 
88 void report_user_fault(struct pt_regs *regs, long signr, int is_mm_fault);
89 
90 extern void (*_machine_restart)(char *command);
91 extern void (*_machine_halt)(void);
92 extern void (*_machine_power_off)(void);
93 
94 struct oldmem_data {
95 	unsigned long start;
96 	unsigned long size;
97 };
98 extern struct oldmem_data oldmem_data;
99 
gen_lpswe(unsigned long addr)100 static __always_inline u32 gen_lpswe(unsigned long addr)
101 {
102 	BUILD_BUG_ON(addr > 0xfff);
103 	return 0xb2b20000 | addr;
104 }
105 #endif /* __ASSEMBLER__ */
106 #endif /* _ASM_S390_SETUP_H */
107