setup.h 4.9 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4
/*
 *  include/asm-s390/setup.h
 *
 *  S390 version
5
 *    Copyright IBM Corp. 1999,2010
L
Linus Torvalds 已提交
6 7 8 9 10
 */

#ifndef _ASM_S390_SETUP_H
#define _ASM_S390_SETUP_H

11
#define COMMAND_LINE_SIZE	4096
12 13

#define ARCH_COMMAND_LINE_SIZE	896
14

15 16
#ifdef __KERNEL__

L
Linus Torvalds 已提交
17
#define PARMAREA		0x10400
18
#define MEMORY_CHUNKS		256
L
Linus Torvalds 已提交
19 20 21

#ifndef __ASSEMBLY__

22 23 24
#include <asm/lowcore.h>
#include <asm/types.h>

L
Linus Torvalds 已提交
25 26 27 28
#ifndef __s390x__
#define IPL_DEVICE        (*(unsigned long *)  (0x10404))
#define INITRD_START      (*(unsigned long *)  (0x1040C))
#define INITRD_SIZE       (*(unsigned long *)  (0x10414))
M
Michael Holzheu 已提交
29 30
#define OLDMEM_BASE	  (*(unsigned long *)  (0x1041C))
#define OLDMEM_SIZE	  (*(unsigned long *)  (0x10424))
L
Linus Torvalds 已提交
31 32 33 34
#else /* __s390x__ */
#define IPL_DEVICE        (*(unsigned long *)  (0x10400))
#define INITRD_START      (*(unsigned long *)  (0x10408))
#define INITRD_SIZE       (*(unsigned long *)  (0x10410))
M
Michael Holzheu 已提交
35 36
#define OLDMEM_BASE	  (*(unsigned long *)  (0x10418))
#define OLDMEM_SIZE	  (*(unsigned long *)  (0x10420))
L
Linus Torvalds 已提交
37 38 39
#endif /* __s390x__ */
#define COMMAND_LINE      ((char *)            (0x10480))

40 41
#define CHUNK_READ_WRITE 0
#define CHUNK_READ_ONLY  1
M
Michael Holzheu 已提交
42 43
#define CHUNK_OLDMEM	 4
#define CHUNK_CRASHK	 5
44 45 46 47

struct mem_chunk {
	unsigned long addr;
	unsigned long size;
48
	int type;
49 50 51
};

extern struct mem_chunk memory_chunk[];
M
Michael Holzheu 已提交
52
extern unsigned long real_memory_size;
53 54
extern int memory_end_set;
extern unsigned long memory_end;
55

56
void detect_memory_layout(struct mem_chunk chunk[]);
M
Michael Holzheu 已提交
57 58
void create_mem_hole(struct mem_chunk memory_chunk[], unsigned long addr,
		     unsigned long size, int type);
59

60 61 62 63 64 65
#define PRIMARY_SPACE_MODE	0
#define ACCESS_REGISTER_MODE	1
#define SECONDARY_SPACE_MODE	2
#define HOME_SPACE_MODE		3

extern unsigned int user_mode;
G
Gerald Schaefer 已提交
66

L
Linus Torvalds 已提交
67 68 69 70
/*
 * Machine features detected in head.S
 */

71 72 73 74 75 76 77 78 79
#define MACHINE_FLAG_VM		(1UL << 0)
#define MACHINE_FLAG_IEEE	(1UL << 1)
#define MACHINE_FLAG_CSP	(1UL << 3)
#define MACHINE_FLAG_MVPG	(1UL << 4)
#define MACHINE_FLAG_DIAG44	(1UL << 5)
#define MACHINE_FLAG_IDTE	(1UL << 6)
#define MACHINE_FLAG_DIAG9C	(1UL << 7)
#define MACHINE_FLAG_MVCOS	(1UL << 8)
#define MACHINE_FLAG_KVM	(1UL << 9)
80 81
#define MACHINE_FLAG_HPAGE	(1UL << 10)
#define MACHINE_FLAG_PFMF	(1UL << 11)
82
#define MACHINE_FLAG_LPAR	(1UL << 12)
83
#define MACHINE_FLAG_SPP	(1UL << 13)
84
#define MACHINE_FLAG_TOPOLOGY	(1UL << 14)
85
#define MACHINE_FLAG_STCKF	(1UL << 15)
86

87 88
#define MACHINE_IS_VM		(S390_lowcore.machine_flags & MACHINE_FLAG_VM)
#define MACHINE_IS_KVM		(S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
89 90
#define MACHINE_IS_LPAR		(S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)

91
#define MACHINE_HAS_DIAG9C	(S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
L
Linus Torvalds 已提交
92 93

#ifndef __s390x__
94 95
#define MACHINE_HAS_IEEE	(S390_lowcore.machine_flags & MACHINE_FLAG_IEEE)
#define MACHINE_HAS_CSP		(S390_lowcore.machine_flags & MACHINE_FLAG_CSP)
96
#define MACHINE_HAS_IDTE	(0)
97
#define MACHINE_HAS_DIAG44	(1)
98
#define MACHINE_HAS_MVPG	(S390_lowcore.machine_flags & MACHINE_FLAG_MVPG)
99
#define MACHINE_HAS_MVCOS	(0)
100 101
#define MACHINE_HAS_HPAGE	(0)
#define MACHINE_HAS_PFMF	(0)
102
#define MACHINE_HAS_SPP		(0)
103
#define MACHINE_HAS_TOPOLOGY	(0)
104
#define MACHINE_HAS_STCKF	(0)
L
Linus Torvalds 已提交
105 106 107
#else /* __s390x__ */
#define MACHINE_HAS_IEEE	(1)
#define MACHINE_HAS_CSP		(1)
108 109
#define MACHINE_HAS_IDTE	(S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
#define MACHINE_HAS_DIAG44	(S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
110
#define MACHINE_HAS_MVPG	(1)
111 112 113
#define MACHINE_HAS_MVCOS	(S390_lowcore.machine_flags & MACHINE_FLAG_MVCOS)
#define MACHINE_HAS_HPAGE	(S390_lowcore.machine_flags & MACHINE_FLAG_HPAGE)
#define MACHINE_HAS_PFMF	(S390_lowcore.machine_flags & MACHINE_FLAG_PFMF)
114
#define MACHINE_HAS_SPP		(S390_lowcore.machine_flags & MACHINE_FLAG_SPP)
115
#define MACHINE_HAS_TOPOLOGY	(S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
116
#define MACHINE_HAS_STCKF	(S390_lowcore.machine_flags & MACHINE_FLAG_STCKF)
L
Linus Torvalds 已提交
117 118
#endif /* __s390x__ */

M
Michael Holzheu 已提交
119
#define ZFCPDUMP_HSA_SIZE	(32UL<<20)
M
Michael Holzheu 已提交
120
#define ZFCPDUMP_HSA_SIZE_MAX	(64UL<<20)
L
Linus Torvalds 已提交
121 122 123 124 125 126 127 128

/*
 * Console mode. Override with conmode=
 */
extern unsigned int console_mode;
extern unsigned int console_devno;
extern unsigned int console_irq;

129 130 131
extern char vmhalt_cmd[];
extern char vmpoff_cmd[];

L
Linus Torvalds 已提交
132 133 134 135 136 137 138 139
#define CONSOLE_IS_UNDEFINED	(console_mode == 0)
#define CONSOLE_IS_SCLP		(console_mode == 1)
#define CONSOLE_IS_3215		(console_mode == 2)
#define CONSOLE_IS_3270		(console_mode == 3)
#define SET_CONSOLE_SCLP	do { console_mode = 1; } while (0)
#define SET_CONSOLE_3215	do { console_mode = 2; } while (0)
#define SET_CONSOLE_3270	do { console_mode = 3; } while (0)

H
Hongjie Yang 已提交
140 141 142
#define NSS_NAME_SIZE	8
extern char kernel_nss_name[];

143
#else /* __ASSEMBLY__ */
L
Linus Torvalds 已提交
144 145 146 147 148

#ifndef __s390x__
#define IPL_DEVICE        0x10404
#define INITRD_START      0x1040C
#define INITRD_SIZE       0x10414
M
Michael Holzheu 已提交
149 150
#define OLDMEM_BASE	  0x1041C
#define OLDMEM_SIZE	  0x10424
L
Linus Torvalds 已提交
151 152 153 154
#else /* __s390x__ */
#define IPL_DEVICE        0x10400
#define INITRD_START      0x10408
#define INITRD_SIZE       0x10410
M
Michael Holzheu 已提交
155 156
#define OLDMEM_BASE	  0x10418
#define OLDMEM_SIZE	  0x10420
L
Linus Torvalds 已提交
157 158 159
#endif /* __s390x__ */
#define COMMAND_LINE      0x10480

160 161 162
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_S390_SETUP_H */