blob: b8ffc1bd0a9f74b5a08bfc6123519355141041dd [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
David Howells9807f752012-10-09 09:47:31 +01008#include <uapi/asm/setup.h>
Hendrik Bruecknera0443fb2008-07-14 09:59:09 +02009
Heiko Carstens0defa3c2006-02-11 17:56:03 -080010
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#define PARMAREA 0x10400
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
13#ifndef __ASSEMBLY__
14
Heiko Carstenscbb870c2010-02-26 22:37:43 +010015#include <asm/lowcore.h>
16#include <asm/types.h>
17
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#define IPL_DEVICE (*(unsigned long *) (0x10400))
19#define INITRD_START (*(unsigned long *) (0x10408))
20#define INITRD_SIZE (*(unsigned long *) (0x10410))
Michael Holzheu60a0c682011-10-30 15:16:40 +010021#define OLDMEM_BASE (*(unsigned long *) (0x10418))
22#define OLDMEM_SIZE (*(unsigned long *) (0x10420))
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#define COMMAND_LINE ((char *) (0x10480))
24
Heiko Carstens23d75d92009-02-19 15:19:01 +010025extern int memory_end_set;
26extern unsigned long memory_end;
Philipp Hachtmann50be6342014-01-29 18:16:01 +010027extern unsigned long max_physmem_end;
Heiko Carstens36a2bd42006-12-04 15:40:38 +010028
Philipp Hachtmann50be6342014-01-29 18:16:01 +010029extern void detect_memory_memblock(void);
Heiko Carstens23d17422008-07-14 09:59:21 +020030
Linus Torvalds1da177e2005-04-16 15:20:36 -070031/*
32 * Machine features detected in head.S
33 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Heiko Carstens2e5061e2008-04-30 13:38:45 +020035#define MACHINE_FLAG_VM (1UL << 0)
36#define MACHINE_FLAG_IEEE (1UL << 1)
Martin Schwidefskyabf09be2012-11-07 13:17:37 +010037#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)
Martin Schwidefskyabf09be2012-11-07 13:17:37 +010042#define MACHINE_FLAG_KVM (1UL << 8)
43#define MACHINE_FLAG_ESOP (1UL << 9)
Heiko Carstens3c7ef082012-09-28 15:06:41 +020044#define MACHINE_FLAG_EDAT1 (1UL << 10)
Heiko Carstens85e9d0e2012-09-27 10:45:06 +020045#define MACHINE_FLAG_EDAT2 (1UL << 11)
Martin Schwidefsky27d71602010-02-26 22:37:38 +010046#define MACHINE_FLAG_LPAR (1UL << 12)
Hendrik Brueckner23d18e82013-02-11 18:11:09 +010047#define MACHINE_FLAG_LPP (1UL << 13)
Heiko Carstens9186d7a2010-10-25 16:10:52 +020048#define MACHINE_FLAG_TOPOLOGY (1UL << 14)
Martin Schwidefskyd35339a2012-07-31 11:03:04 +020049#define MACHINE_FLAG_TE (1UL << 15)
Martin Schwidefsky1b948d62014-04-03 13:55:01 +020050#define MACHINE_FLAG_TLB_LC (1UL << 17)
Martin Schwidefsky80703612014-10-06 17:53:53 +020051#define MACHINE_FLAG_VX (1UL << 18)
Martin Schwidefsky2c72a442015-01-14 17:52:33 +010052#define MACHINE_FLAG_CAD (1UL << 19)
Heiko Carstens2e5061e2008-04-30 13:38:45 +020053
Christian Ehrhardt25097bf2009-04-14 15:36:16 +020054#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
55#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
Martin Schwidefsky27d71602010-02-26 22:37:38 +010056#define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
57
Christian Ehrhardt25097bf2009-04-14 15:36:16 +020058#define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
Martin Schwidefskyabf09be2012-11-07 13:17:37 +010059#define MACHINE_HAS_ESOP (S390_lowcore.machine_flags & MACHINE_FLAG_ESOP)
Heiko Carstens3c7ef082012-09-28 15:06:41 +020060#define MACHINE_HAS_PFMF MACHINE_HAS_EDAT1
61#define MACHINE_HAS_HPAGE MACHINE_HAS_EDAT1
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
Christian Ehrhardt25097bf2009-04-14 15:36:16 +020063#define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
64#define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
Heiko Carstens3c7ef082012-09-28 15:06:41 +020065#define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
Heiko Carstens85e9d0e2012-09-27 10:45:06 +020066#define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
Hendrik Brueckner23d18e82013-02-11 18:11:09 +010067#define MACHINE_HAS_LPP (S390_lowcore.machine_flags & MACHINE_FLAG_LPP)
Heiko Carstens9186d7a2010-10-25 16:10:52 +020068#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
Martin Schwidefskyd35339a2012-07-31 11:03:04 +020069#define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
Martin Schwidefsky1b948d62014-04-03 13:55:01 +020070#define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
Martin Schwidefsky80703612014-10-06 17:53:53 +020071#define MACHINE_HAS_VX (S390_lowcore.machine_flags & MACHINE_FLAG_VX)
Martin Schwidefsky2c72a442015-01-14 17:52:33 +010072#define MACHINE_HAS_CAD (S390_lowcore.machine_flags & MACHINE_FLAG_CAD)
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
Linus Torvalds1da177e2005-04-16 15:20:36 -070074/*
75 * Console mode. Override with conmode=
76 */
77extern unsigned int console_mode;
78extern unsigned int console_devno;
79extern unsigned int console_irq;
80
Heiko Carstens2b67fc42007-02-05 21:16:47 +010081extern char vmhalt_cmd[];
82extern char vmpoff_cmd[];
83
Linus Torvalds1da177e2005-04-16 15:20:36 -070084#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
Hongjie Yangfe355b72007-02-05 21:18:24 +010092#define NSS_NAME_SIZE 8
Hongjie Yangfe355b72007-02-05 21:18:24 +010093extern char kernel_nss_name[];
94
David Howellsa0616cd2012-03-28 18:30:02 +010095#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
Heiko Carstens0defa3c2006-02-11 17:56:03 -0800109#else /* __ASSEMBLY__ */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111#define IPL_DEVICE 0x10400
112#define INITRD_START 0x10408
113#define INITRD_SIZE 0x10410
Michael Holzheu60a0c682011-10-30 15:16:40 +0100114#define OLDMEM_BASE 0x10418
115#define OLDMEM_SIZE 0x10420
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116#define COMMAND_LINE 0x10480
117
Heiko Carstens0defa3c2006-02-11 17:56:03 -0800118#endif /* __ASSEMBLY__ */
Heiko Carstens0defa3c2006-02-11 17:56:03 -0800119#endif /* _ASM_S390_SETUP_H */