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#define IPL_DEVICE        (*(unsigned long *)  (0x10400))
19#define INITRD_START      (*(unsigned long *)  (0x10408))
20#define INITRD_SIZE       (*(unsigned long *)  (0x10410))
21#define OLDMEM_BASE	  (*(unsigned long *)  (0x10418))
22#define OLDMEM_SIZE	  (*(unsigned long *)  (0x10420))
23#define COMMAND_LINE      ((char *)            (0x10480))
24
25extern int memory_end_set;
26extern unsigned long memory_end;
27extern unsigned long max_physmem_end;
28
29extern void detect_memory_memblock(void);
30
31/*
32 * Machine features detected in head.S
33 */
34
35#define MACHINE_FLAG_VM		(1UL << 0)
36#define MACHINE_FLAG_IEEE	(1UL << 1)
37#define MACHINE_FLAG_CSP	(1UL << 2)
38#define MACHINE_FLAG_MVPG	(1UL << 3)
39#define MACHINE_FLAG_DIAG44	(1UL << 4)
40#define MACHINE_FLAG_IDTE	(1UL << 5)
41#define MACHINE_FLAG_DIAG9C	(1UL << 6)
42#define MACHINE_FLAG_KVM	(1UL << 8)
43#define MACHINE_FLAG_ESOP	(1UL << 9)
44#define MACHINE_FLAG_EDAT1	(1UL << 10)
45#define MACHINE_FLAG_EDAT2	(1UL << 11)
46#define MACHINE_FLAG_LPAR	(1UL << 12)
47#define MACHINE_FLAG_LPP	(1UL << 13)
48#define MACHINE_FLAG_TOPOLOGY	(1UL << 14)
49#define MACHINE_FLAG_TE		(1UL << 15)
50#define MACHINE_FLAG_TLB_LC	(1UL << 17)
51#define MACHINE_FLAG_VX		(1UL << 18)
52#define MACHINE_FLAG_CAD	(1UL << 19)
53
54#define MACHINE_IS_VM		(S390_lowcore.machine_flags & MACHINE_FLAG_VM)
55#define MACHINE_IS_KVM		(S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
56#define MACHINE_IS_LPAR		(S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
57
58#define MACHINE_HAS_DIAG9C	(S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
59#define MACHINE_HAS_ESOP	(S390_lowcore.machine_flags & MACHINE_FLAG_ESOP)
60#define MACHINE_HAS_PFMF	MACHINE_HAS_EDAT1
61#define MACHINE_HAS_HPAGE	MACHINE_HAS_EDAT1
62
63#define MACHINE_HAS_IDTE	(S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
64#define MACHINE_HAS_DIAG44	(S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
65#define MACHINE_HAS_EDAT1	(S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
66#define MACHINE_HAS_EDAT2	(S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
67#define MACHINE_HAS_LPP		(S390_lowcore.machine_flags & MACHINE_FLAG_LPP)
68#define MACHINE_HAS_TOPOLOGY	(S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
69#define MACHINE_HAS_TE		(S390_lowcore.machine_flags & MACHINE_FLAG_TE)
70#define MACHINE_HAS_TLB_LC	(S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
71#define MACHINE_HAS_VX		(S390_lowcore.machine_flags & MACHINE_FLAG_VX)
72#define MACHINE_HAS_CAD		(S390_lowcore.machine_flags & MACHINE_FLAG_CAD)
73
74/*
75 * Console mode. Override with conmode=
76 */
77extern unsigned int console_mode;
78extern unsigned int console_devno;
79extern unsigned int console_irq;
80
81extern char vmhalt_cmd[];
82extern 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 SET_CONSOLE_SCLP	do { console_mode = 1; } while (0)
89#define SET_CONSOLE_3215	do { console_mode = 2; } while (0)
90#define SET_CONSOLE_3270	do { console_mode = 3; } while (0)
91
92#define NSS_NAME_SIZE	8
93extern char kernel_nss_name[];
94
95#ifdef CONFIG_PFAULT
96extern int pfault_init(void);
97extern void pfault_fini(void);
98#else /* CONFIG_PFAULT */
99#define pfault_init()		({-1;})
100#define pfault_fini()		do { } while (0)
101#endif /* CONFIG_PFAULT */
102
103extern void cmma_init(void);
104
105extern void (*_machine_restart)(char *command);
106extern void (*_machine_halt)(void);
107extern void (*_machine_power_off)(void);
108
109#else /* __ASSEMBLY__ */
110
111#define IPL_DEVICE        0x10400
112#define INITRD_START      0x10408
113#define INITRD_SIZE       0x10410
114#define OLDMEM_BASE	  0x10418
115#define OLDMEM_SIZE	  0x10420
116#define COMMAND_LINE      0x10480
117
118#endif /* __ASSEMBLY__ */
119#endif /* _ASM_S390_SETUP_H */
120