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