xref: /openbmc/linux/arch/s390/include/asm/setup.h (revision feac8c8b)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  *  S390 version
4  *    Copyright IBM Corp. 1999, 2010
5  */
6 #ifndef _ASM_S390_SETUP_H
7 #define _ASM_S390_SETUP_H
8 
9 #include <linux/const.h>
10 #include <uapi/asm/setup.h>
11 
12 
13 #define PARMAREA		0x10400
14 
15 /*
16  * Machine features detected in early.c
17  */
18 
19 #define MACHINE_FLAG_VM		_BITUL(0)
20 #define MACHINE_FLAG_KVM	_BITUL(1)
21 #define MACHINE_FLAG_LPAR	_BITUL(2)
22 #define MACHINE_FLAG_DIAG9C	_BITUL(3)
23 #define MACHINE_FLAG_ESOP	_BITUL(4)
24 #define MACHINE_FLAG_IDTE	_BITUL(5)
25 #define MACHINE_FLAG_DIAG44	_BITUL(6)
26 #define MACHINE_FLAG_EDAT1	_BITUL(7)
27 #define MACHINE_FLAG_EDAT2	_BITUL(8)
28 #define MACHINE_FLAG_LPP	_BITUL(9)
29 #define MACHINE_FLAG_TOPOLOGY	_BITUL(10)
30 #define MACHINE_FLAG_TE		_BITUL(11)
31 #define MACHINE_FLAG_TLB_LC	_BITUL(12)
32 #define MACHINE_FLAG_VX		_BITUL(13)
33 #define MACHINE_FLAG_TLB_GUEST	_BITUL(14)
34 #define MACHINE_FLAG_NX		_BITUL(15)
35 #define MACHINE_FLAG_GS		_BITUL(16)
36 #define MACHINE_FLAG_SCC	_BITUL(17)
37 
38 #define LPP_MAGIC		_BITUL(31)
39 #define LPP_PID_MASK		_AC(0xffffffff, UL)
40 
41 #ifndef __ASSEMBLY__
42 
43 #include <asm/lowcore.h>
44 #include <asm/types.h>
45 
46 #define IPL_DEVICE        (*(unsigned long *)  (0x10400))
47 #define INITRD_START      (*(unsigned long *)  (0x10408))
48 #define INITRD_SIZE       (*(unsigned long *)  (0x10410))
49 #define OLDMEM_BASE	  (*(unsigned long *)  (0x10418))
50 #define OLDMEM_SIZE	  (*(unsigned long *)  (0x10420))
51 #define COMMAND_LINE      ((char *)            (0x10480))
52 
53 extern int memory_end_set;
54 extern unsigned long memory_end;
55 extern unsigned long max_physmem_end;
56 
57 extern void detect_memory_memblock(void);
58 
59 #define MACHINE_IS_VM		(S390_lowcore.machine_flags & MACHINE_FLAG_VM)
60 #define MACHINE_IS_KVM		(S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
61 #define MACHINE_IS_LPAR		(S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
62 
63 #define MACHINE_HAS_DIAG9C	(S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
64 #define MACHINE_HAS_ESOP	(S390_lowcore.machine_flags & MACHINE_FLAG_ESOP)
65 #define MACHINE_HAS_IDTE	(S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
66 #define MACHINE_HAS_DIAG44	(S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
67 #define MACHINE_HAS_EDAT1	(S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
68 #define MACHINE_HAS_EDAT2	(S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
69 #define MACHINE_HAS_LPP		(S390_lowcore.machine_flags & MACHINE_FLAG_LPP)
70 #define MACHINE_HAS_TOPOLOGY	(S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
71 #define MACHINE_HAS_TE		(S390_lowcore.machine_flags & MACHINE_FLAG_TE)
72 #define MACHINE_HAS_TLB_LC	(S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
73 #define MACHINE_HAS_VX		(S390_lowcore.machine_flags & MACHINE_FLAG_VX)
74 #define MACHINE_HAS_TLB_GUEST	(S390_lowcore.machine_flags & MACHINE_FLAG_TLB_GUEST)
75 #define MACHINE_HAS_NX		(S390_lowcore.machine_flags & MACHINE_FLAG_NX)
76 #define MACHINE_HAS_GS		(S390_lowcore.machine_flags & MACHINE_FLAG_GS)
77 #define MACHINE_HAS_SCC		(S390_lowcore.machine_flags & MACHINE_FLAG_SCC)
78 
79 /*
80  * Console mode. Override with conmode=
81  */
82 extern unsigned int console_mode;
83 extern unsigned int console_devno;
84 extern unsigned int console_irq;
85 
86 extern char vmhalt_cmd[];
87 extern char vmpoff_cmd[];
88 
89 #define CONSOLE_IS_UNDEFINED	(console_mode == 0)
90 #define CONSOLE_IS_SCLP		(console_mode == 1)
91 #define CONSOLE_IS_3215		(console_mode == 2)
92 #define CONSOLE_IS_3270		(console_mode == 3)
93 #define CONSOLE_IS_VT220	(console_mode == 4)
94 #define CONSOLE_IS_HVC		(console_mode == 5)
95 #define SET_CONSOLE_SCLP	do { console_mode = 1; } while (0)
96 #define SET_CONSOLE_3215	do { console_mode = 2; } while (0)
97 #define SET_CONSOLE_3270	do { console_mode = 3; } while (0)
98 #define SET_CONSOLE_VT220	do { console_mode = 4; } while (0)
99 #define SET_CONSOLE_HVC		do { console_mode = 5; } while (0)
100 
101 #ifdef CONFIG_PFAULT
102 extern int pfault_init(void);
103 extern void pfault_fini(void);
104 #else /* CONFIG_PFAULT */
105 #define pfault_init()		({-1;})
106 #define pfault_fini()		do { } while (0)
107 #endif /* CONFIG_PFAULT */
108 
109 #ifdef CONFIG_VMCP
110 void vmcp_cma_reserve(void);
111 #else
112 static inline void vmcp_cma_reserve(void) { }
113 #endif
114 
115 void report_user_fault(struct pt_regs *regs, long signr, int is_mm_fault);
116 
117 void cmma_init(void);
118 void cmma_init_nodat(void);
119 
120 extern void (*_machine_restart)(char *command);
121 extern void (*_machine_halt)(void);
122 extern void (*_machine_power_off)(void);
123 
124 #else /* __ASSEMBLY__ */
125 
126 #define IPL_DEVICE        0x10400
127 #define INITRD_START      0x10408
128 #define INITRD_SIZE       0x10410
129 #define OLDMEM_BASE	  0x10418
130 #define OLDMEM_SIZE	  0x10420
131 #define COMMAND_LINE      0x10480
132 
133 #endif /* __ASSEMBLY__ */
134 #endif /* _ASM_S390_SETUP_H */
135