xref: /openbmc/linux/arch/s390/include/asm/setup.h (revision 275876e2)
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 <uapi/asm/setup.h>
9 
10 
11 #define PARMAREA		0x10400
12 
13 #ifndef __ASSEMBLY__
14 
15 #include <asm/lowcore.h>
16 #include <asm/types.h>
17 
18 #ifndef CONFIG_64BIT
19 #define IPL_DEVICE        (*(unsigned long *)  (0x10404))
20 #define INITRD_START      (*(unsigned long *)  (0x1040C))
21 #define INITRD_SIZE       (*(unsigned long *)  (0x10414))
22 #define OLDMEM_BASE	  (*(unsigned long *)  (0x1041C))
23 #define OLDMEM_SIZE	  (*(unsigned long *)  (0x10424))
24 #else /* CONFIG_64BIT */
25 #define IPL_DEVICE        (*(unsigned long *)  (0x10400))
26 #define INITRD_START      (*(unsigned long *)  (0x10408))
27 #define INITRD_SIZE       (*(unsigned long *)  (0x10410))
28 #define OLDMEM_BASE	  (*(unsigned long *)  (0x10418))
29 #define OLDMEM_SIZE	  (*(unsigned long *)  (0x10420))
30 #endif /* CONFIG_64BIT */
31 #define COMMAND_LINE      ((char *)            (0x10480))
32 
33 extern int memory_end_set;
34 extern unsigned long memory_end;
35 extern unsigned long max_physmem_end;
36 
37 extern void detect_memory_memblock(void);
38 
39 /*
40  * Machine features detected in head.S
41  */
42 
43 #define MACHINE_FLAG_VM		(1UL << 0)
44 #define MACHINE_FLAG_IEEE	(1UL << 1)
45 #define MACHINE_FLAG_CSP	(1UL << 2)
46 #define MACHINE_FLAG_MVPG	(1UL << 3)
47 #define MACHINE_FLAG_DIAG44	(1UL << 4)
48 #define MACHINE_FLAG_IDTE	(1UL << 5)
49 #define MACHINE_FLAG_DIAG9C	(1UL << 6)
50 #define MACHINE_FLAG_KVM	(1UL << 8)
51 #define MACHINE_FLAG_ESOP	(1UL << 9)
52 #define MACHINE_FLAG_EDAT1	(1UL << 10)
53 #define MACHINE_FLAG_EDAT2	(1UL << 11)
54 #define MACHINE_FLAG_LPAR	(1UL << 12)
55 #define MACHINE_FLAG_LPP	(1UL << 13)
56 #define MACHINE_FLAG_TOPOLOGY	(1UL << 14)
57 #define MACHINE_FLAG_TE		(1UL << 15)
58 #define MACHINE_FLAG_RRBM	(1UL << 16)
59 #define MACHINE_FLAG_TLB_LC	(1UL << 17)
60 
61 #define MACHINE_IS_VM		(S390_lowcore.machine_flags & MACHINE_FLAG_VM)
62 #define MACHINE_IS_KVM		(S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
63 #define MACHINE_IS_LPAR		(S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
64 
65 #define MACHINE_HAS_DIAG9C	(S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
66 #define MACHINE_HAS_ESOP	(S390_lowcore.machine_flags & MACHINE_FLAG_ESOP)
67 #define MACHINE_HAS_PFMF	MACHINE_HAS_EDAT1
68 #define MACHINE_HAS_HPAGE	MACHINE_HAS_EDAT1
69 
70 #ifndef CONFIG_64BIT
71 #define MACHINE_HAS_IEEE	(S390_lowcore.machine_flags & MACHINE_FLAG_IEEE)
72 #define MACHINE_HAS_CSP		(S390_lowcore.machine_flags & MACHINE_FLAG_CSP)
73 #define MACHINE_HAS_IDTE	(0)
74 #define MACHINE_HAS_DIAG44	(1)
75 #define MACHINE_HAS_MVPG	(S390_lowcore.machine_flags & MACHINE_FLAG_MVPG)
76 #define MACHINE_HAS_EDAT1	(0)
77 #define MACHINE_HAS_EDAT2	(0)
78 #define MACHINE_HAS_LPP		(0)
79 #define MACHINE_HAS_TOPOLOGY	(0)
80 #define MACHINE_HAS_TE		(0)
81 #define MACHINE_HAS_RRBM	(0)
82 #define MACHINE_HAS_TLB_LC	(0)
83 #else /* CONFIG_64BIT */
84 #define MACHINE_HAS_IEEE	(1)
85 #define MACHINE_HAS_CSP		(1)
86 #define MACHINE_HAS_IDTE	(S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
87 #define MACHINE_HAS_DIAG44	(S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
88 #define MACHINE_HAS_MVPG	(1)
89 #define MACHINE_HAS_EDAT1	(S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
90 #define MACHINE_HAS_EDAT2	(S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
91 #define MACHINE_HAS_LPP		(S390_lowcore.machine_flags & MACHINE_FLAG_LPP)
92 #define MACHINE_HAS_TOPOLOGY	(S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
93 #define MACHINE_HAS_TE		(S390_lowcore.machine_flags & MACHINE_FLAG_TE)
94 #define MACHINE_HAS_RRBM	(S390_lowcore.machine_flags & MACHINE_FLAG_RRBM)
95 #define MACHINE_HAS_TLB_LC	(S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
96 #endif /* CONFIG_64BIT */
97 
98 /*
99  * Console mode. Override with conmode=
100  */
101 extern unsigned int console_mode;
102 extern unsigned int console_devno;
103 extern unsigned int console_irq;
104 
105 extern char vmhalt_cmd[];
106 extern char vmpoff_cmd[];
107 
108 #define CONSOLE_IS_UNDEFINED	(console_mode == 0)
109 #define CONSOLE_IS_SCLP		(console_mode == 1)
110 #define CONSOLE_IS_3215		(console_mode == 2)
111 #define CONSOLE_IS_3270		(console_mode == 3)
112 #define SET_CONSOLE_SCLP	do { console_mode = 1; } while (0)
113 #define SET_CONSOLE_3215	do { console_mode = 2; } while (0)
114 #define SET_CONSOLE_3270	do { console_mode = 3; } while (0)
115 
116 #define NSS_NAME_SIZE	8
117 extern char kernel_nss_name[];
118 
119 #ifdef CONFIG_PFAULT
120 extern int pfault_init(void);
121 extern void pfault_fini(void);
122 #else /* CONFIG_PFAULT */
123 #define pfault_init()		({-1;})
124 #define pfault_fini()		do { } while (0)
125 #endif /* CONFIG_PFAULT */
126 
127 extern void cmma_init(void);
128 
129 extern void (*_machine_restart)(char *command);
130 extern void (*_machine_halt)(void);
131 extern void (*_machine_power_off)(void);
132 
133 #else /* __ASSEMBLY__ */
134 
135 #ifndef CONFIG_64BIT
136 #define IPL_DEVICE        0x10404
137 #define INITRD_START      0x1040C
138 #define INITRD_SIZE       0x10414
139 #define OLDMEM_BASE	  0x1041C
140 #define OLDMEM_SIZE	  0x10424
141 #else /* CONFIG_64BIT */
142 #define IPL_DEVICE        0x10400
143 #define INITRD_START      0x10408
144 #define INITRD_SIZE       0x10410
145 #define OLDMEM_BASE	  0x10418
146 #define OLDMEM_SIZE	  0x10420
147 #endif /* CONFIG_64BIT */
148 #define COMMAND_LINE      0x10480
149 
150 #endif /* __ASSEMBLY__ */
151 #endif /* _ASM_S390_SETUP_H */
152