blob: 23537661da0ed8d00cc8a2c9df4daed83b43eb52 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * S390 version
Heiko Carstensa53c8fa2012-07-20 11:15:04 +02003 * Copyright IBM Corp. 1999, 2010
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#ifndef _ASM_S390_SETUP_H
6#define _ASM_S390_SETUP_H
7
Hendrik Brueckner83abeff2015-10-01 17:02:48 +02008#include <linux/const.h>
David Howells9807f752012-10-09 09:47:31 +01009#include <uapi/asm/setup.h>
Hendrik Bruecknera0443fb2008-07-14 09:59:09 +020010
Heiko Carstens0defa3c2006-02-11 17:56:03 -080011
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#define PARMAREA 0x10400
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Hendrik Brueckner83abeff2015-10-01 17:02:48 +020014/*
15 * Machine features detected in head.S
16 */
17
18#define MACHINE_FLAG_VM _BITUL(0)
19#define MACHINE_FLAG_IEEE _BITUL(1)
20#define MACHINE_FLAG_CSP _BITUL(2)
21#define MACHINE_FLAG_MVPG _BITUL(3)
22#define MACHINE_FLAG_DIAG44 _BITUL(4)
23#define MACHINE_FLAG_IDTE _BITUL(5)
24#define MACHINE_FLAG_DIAG9C _BITUL(6)
25#define MACHINE_FLAG_KVM _BITUL(8)
26#define MACHINE_FLAG_ESOP _BITUL(9)
27#define MACHINE_FLAG_EDAT1 _BITUL(10)
28#define MACHINE_FLAG_EDAT2 _BITUL(11)
29#define MACHINE_FLAG_LPAR _BITUL(12)
30#define MACHINE_FLAG_LPP _BITUL(13)
31#define MACHINE_FLAG_TOPOLOGY _BITUL(14)
32#define MACHINE_FLAG_TE _BITUL(15)
33#define MACHINE_FLAG_TLB_LC _BITUL(17)
34#define MACHINE_FLAG_VX _BITUL(18)
35#define MACHINE_FLAG_CAD _BITUL(19)
36
Christian Borntraegere22cf8c2015-10-06 18:06:15 +020037#define LPP_MAGIC _BITUL(31)
38#define LPP_PFAULT_PID_MASK _AC(0xffffffff, UL)
39
Linus Torvalds1da177e2005-04-16 15:20:36 -070040#ifndef __ASSEMBLY__
41
Heiko Carstenscbb870c2010-02-26 22:37:43 +010042#include <asm/lowcore.h>
43#include <asm/types.h>
44
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#define IPL_DEVICE (*(unsigned long *) (0x10400))
46#define INITRD_START (*(unsigned long *) (0x10408))
47#define INITRD_SIZE (*(unsigned long *) (0x10410))
Michael Holzheu60a0c682011-10-30 15:16:40 +010048#define OLDMEM_BASE (*(unsigned long *) (0x10418))
49#define OLDMEM_SIZE (*(unsigned long *) (0x10420))
Linus Torvalds1da177e2005-04-16 15:20:36 -070050#define COMMAND_LINE ((char *) (0x10480))
51
Heiko Carstens23d75d92009-02-19 15:19:01 +010052extern int memory_end_set;
53extern unsigned long memory_end;
Philipp Hachtmann50be6342014-01-29 18:16:01 +010054extern unsigned long max_physmem_end;
Heiko Carstens36a2bd42006-12-04 15:40:38 +010055
Philipp Hachtmann50be6342014-01-29 18:16:01 +010056extern void detect_memory_memblock(void);
Heiko Carstens23d17422008-07-14 09:59:21 +020057
Christian Ehrhardt25097bf2009-04-14 15:36:16 +020058#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
59#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
Martin Schwidefsky27d71602010-02-26 22:37:38 +010060#define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
61
Christian Ehrhardt25097bf2009-04-14 15:36:16 +020062#define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
Martin Schwidefskyabf09be2012-11-07 13:17:37 +010063#define MACHINE_HAS_ESOP (S390_lowcore.machine_flags & MACHINE_FLAG_ESOP)
Heiko Carstens3c7ef082012-09-28 15:06:41 +020064#define MACHINE_HAS_PFMF MACHINE_HAS_EDAT1
65#define MACHINE_HAS_HPAGE MACHINE_HAS_EDAT1
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
Christian Ehrhardt25097bf2009-04-14 15:36:16 +020067#define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
68#define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
Heiko Carstens3c7ef082012-09-28 15:06:41 +020069#define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
Heiko Carstens85e9d0e2012-09-27 10:45:06 +020070#define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
Hendrik Brueckner23d18e82013-02-11 18:11:09 +010071#define MACHINE_HAS_LPP (S390_lowcore.machine_flags & MACHINE_FLAG_LPP)
Heiko Carstens9186d7a2010-10-25 16:10:52 +020072#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
Martin Schwidefskyd35339a2012-07-31 11:03:04 +020073#define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
Martin Schwidefsky1b948d62014-04-03 13:55:01 +020074#define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
Martin Schwidefsky80703612014-10-06 17:53:53 +020075#define MACHINE_HAS_VX (S390_lowcore.machine_flags & MACHINE_FLAG_VX)
Martin Schwidefsky2c72a442015-01-14 17:52:33 +010076#define MACHINE_HAS_CAD (S390_lowcore.machine_flags & MACHINE_FLAG_CAD)
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
Linus Torvalds1da177e2005-04-16 15:20:36 -070078/*
79 * Console mode. Override with conmode=
80 */
81extern unsigned int console_mode;
82extern unsigned int console_devno;
83extern unsigned int console_irq;
84
Heiko Carstens2b67fc42007-02-05 21:16:47 +010085extern char vmhalt_cmd[];
86extern char vmpoff_cmd[];
87
Linus Torvalds1da177e2005-04-16 15:20:36 -070088#define CONSOLE_IS_UNDEFINED (console_mode == 0)
89#define CONSOLE_IS_SCLP (console_mode == 1)
90#define CONSOLE_IS_3215 (console_mode == 2)
91#define CONSOLE_IS_3270 (console_mode == 3)
92#define SET_CONSOLE_SCLP do { console_mode = 1; } while (0)
93#define SET_CONSOLE_3215 do { console_mode = 2; } while (0)
94#define SET_CONSOLE_3270 do { console_mode = 3; } while (0)
95
Hongjie Yangfe355b72007-02-05 21:18:24 +010096#define NSS_NAME_SIZE 8
Hongjie Yangfe355b72007-02-05 21:18:24 +010097extern char kernel_nss_name[];
98
David Howellsa0616cd2012-03-28 18:30:02 +010099#ifdef CONFIG_PFAULT
100extern int pfault_init(void);
101extern 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
107extern void cmma_init(void);
108
109extern void (*_machine_restart)(char *command);
110extern void (*_machine_halt)(void);
111extern void (*_machine_power_off)(void);
112
Heiko Carstens0defa3c2006-02-11 17:56:03 -0800113#else /* __ASSEMBLY__ */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115#define IPL_DEVICE 0x10400
116#define INITRD_START 0x10408
117#define INITRD_SIZE 0x10410
Michael Holzheu60a0c682011-10-30 15:16:40 +0100118#define OLDMEM_BASE 0x10418
119#define OLDMEM_SIZE 0x10420
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120#define COMMAND_LINE 0x10480
121
Heiko Carstens0defa3c2006-02-11 17:56:03 -0800122#endif /* __ASSEMBLY__ */
Heiko Carstens0defa3c2006-02-11 17:56:03 -0800123#endif /* _ASM_S390_SETUP_H */