setup.h 4.94 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1 2
/*
 *  S390 version
3
 *    Copyright IBM Corp. 1999, 2010
Linus Torvalds's avatar
Linus Torvalds committed
4 5 6 7
 */
#ifndef _ASM_S390_SETUP_H
#define _ASM_S390_SETUP_H

8
#include <uapi/asm/setup.h>
9

10

Linus Torvalds's avatar
Linus Torvalds committed
11 12 13 14
#define PARMAREA		0x10400

#ifndef __ASSEMBLY__

15 16 17
#include <asm/lowcore.h>
#include <asm/types.h>

18
#ifndef CONFIG_64BIT
Linus Torvalds's avatar
Linus Torvalds committed
19 20 21
#define IPL_DEVICE        (*(unsigned long *)  (0x10404))
#define INITRD_START      (*(unsigned long *)  (0x1040C))
#define INITRD_SIZE       (*(unsigned long *)  (0x10414))
Michael Holzheu's avatar
Michael Holzheu committed
22 23
#define OLDMEM_BASE	  (*(unsigned long *)  (0x1041C))
#define OLDMEM_SIZE	  (*(unsigned long *)  (0x10424))
24
#else /* CONFIG_64BIT */
Linus Torvalds's avatar
Linus Torvalds committed
25 26 27
#define IPL_DEVICE        (*(unsigned long *)  (0x10400))
#define INITRD_START      (*(unsigned long *)  (0x10408))
#define INITRD_SIZE       (*(unsigned long *)  (0x10410))
Michael Holzheu's avatar
Michael Holzheu committed
28 29
#define OLDMEM_BASE	  (*(unsigned long *)  (0x10418))
#define OLDMEM_SIZE	  (*(unsigned long *)  (0x10420))
30
#endif /* CONFIG_64BIT */
Linus Torvalds's avatar
Linus Torvalds committed
31 32
#define COMMAND_LINE      ((char *)            (0x10480))

33 34
extern int memory_end_set;
extern unsigned long memory_end;
35
extern unsigned long max_physmem_end;
36

37
extern void detect_memory_memblock(void);
38

Linus Torvalds's avatar
Linus Torvalds committed
39 40 41 42
/*
 * Machine features detected in head.S
 */

43 44
#define MACHINE_FLAG_VM		(1UL << 0)
#define MACHINE_FLAG_IEEE	(1UL << 1)
45 46 47 48 49 50 51
#define MACHINE_FLAG_CSP	(1UL << 2)
#define MACHINE_FLAG_MVPG	(1UL << 3)
#define MACHINE_FLAG_DIAG44	(1UL << 4)
#define MACHINE_FLAG_IDTE	(1UL << 5)
#define MACHINE_FLAG_DIAG9C	(1UL << 6)
#define MACHINE_FLAG_KVM	(1UL << 8)
#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_TLB_LC	(1UL << 17)
59
#define MACHINE_FLAG_VX		(1UL << 18)
60

61 62
#define MACHINE_IS_VM		(S390_lowcore.machine_flags & MACHINE_FLAG_VM)
#define MACHINE_IS_KVM		(S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
63 64
#define MACHINE_IS_LPAR		(S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)

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 68
#define MACHINE_HAS_PFMF	MACHINE_HAS_EDAT1
#define MACHINE_HAS_HPAGE	MACHINE_HAS_EDAT1
Linus Torvalds's avatar
Linus Torvalds committed
69

70
#ifndef CONFIG_64BIT
71 72
#define MACHINE_HAS_IEEE	(S390_lowcore.machine_flags & MACHINE_FLAG_IEEE)
#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_TLB_LC	(0)
82
#define MACHINE_HAS_VX		(0)
83
#else /* CONFIG_64BIT */
Linus Torvalds's avatar
Linus Torvalds committed
84 85
#define MACHINE_HAS_IEEE	(1)
#define MACHINE_HAS_CSP		(1)
86 87
#define MACHINE_HAS_IDTE	(S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
#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_TLB_LC	(S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
95
#define MACHINE_HAS_VX		(S390_lowcore.machine_flags & MACHINE_FLAG_VX)
96
#endif /* CONFIG_64BIT */
Linus Torvalds's avatar
Linus Torvalds committed
97 98 99 100 101 102 103 104

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

105 106 107
extern char vmhalt_cmd[];
extern char vmpoff_cmd[];

Linus Torvalds's avatar
Linus Torvalds committed
108 109 110 111 112 113 114 115
#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)

Hongjie Yang's avatar
Hongjie Yang committed
116 117 118
#define NSS_NAME_SIZE	8
extern char kernel_nss_name[];

119 120 121 122 123 124 125 126 127 128 129 130 131 132
#ifdef CONFIG_PFAULT
extern int pfault_init(void);
extern void pfault_fini(void);
#else /* CONFIG_PFAULT */
#define pfault_init()		({-1;})
#define pfault_fini()		do { } while (0)
#endif /* CONFIG_PFAULT */

extern void cmma_init(void);

extern void (*_machine_restart)(char *command);
extern void (*_machine_halt)(void);
extern void (*_machine_power_off)(void);

133
#else /* __ASSEMBLY__ */
Linus Torvalds's avatar
Linus Torvalds committed
134

135
#ifndef CONFIG_64BIT
Linus Torvalds's avatar
Linus Torvalds committed
136 137 138
#define IPL_DEVICE        0x10404
#define INITRD_START      0x1040C
#define INITRD_SIZE       0x10414
Michael Holzheu's avatar
Michael Holzheu committed
139 140
#define OLDMEM_BASE	  0x1041C
#define OLDMEM_SIZE	  0x10424
141
#else /* CONFIG_64BIT */
Linus Torvalds's avatar
Linus Torvalds committed
142 143 144
#define IPL_DEVICE        0x10400
#define INITRD_START      0x10408
#define INITRD_SIZE       0x10410
Michael Holzheu's avatar
Michael Holzheu committed
145 146
#define OLDMEM_BASE	  0x10418
#define OLDMEM_SIZE	  0x10420
147
#endif /* CONFIG_64BIT */
Linus Torvalds's avatar
Linus Torvalds committed
148 149
#define COMMAND_LINE      0x10480

150 151
#endif /* __ASSEMBLY__ */
#endif /* _ASM_S390_SETUP_H */