blob: f2c2b7cd90992dff3cb08eb6b99dba7fa5d6f2d6 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * S390 version
Heiko Carstensa53c8fa2012-07-20 11:15:04 +02004 * Copyright IBM Corp. 1999, 2010
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#ifndef _ASM_S390_SETUP_H
7#define _ASM_S390_SETUP_H
8
Hendrik Brueckner83abeff2015-10-01 17:02:48 +02009#include <linux/const.h>
David Howells9807f752012-10-09 09:47:31 +010010#include <uapi/asm/setup.h>
Hendrik Bruecknera0443fb2008-07-14 09:59:09 +020011
Heiko Carstens0defa3c2006-02-11 17:56:03 -080012
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#define PARMAREA 0x10400
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Hendrik Brueckner83abeff2015-10-01 17:02:48 +020015/*
Christian Borntraegerd7ae65a2015-12-15 09:26:30 +010016 * Machine features detected in early.c
Hendrik Brueckner83abeff2015-10-01 17:02:48 +020017 */
18
19#define MACHINE_FLAG_VM _BITUL(0)
Christian Borntraegerd7ae65a2015-12-15 09:26:30 +010020#define MACHINE_FLAG_KVM _BITUL(1)
21#define MACHINE_FLAG_LPAR _BITUL(2)
22#define MACHINE_FLAG_DIAG9C _BITUL(3)
23#define MACHINE_FLAG_ESOP _BITUL(4)
Hendrik Brueckner83abeff2015-10-01 17:02:48 +020024#define MACHINE_FLAG_IDTE _BITUL(5)
Christian Borntraegerd7ae65a2015-12-15 09:26:30 +010025#define MACHINE_FLAG_DIAG44 _BITUL(6)
26#define MACHINE_FLAG_EDAT1 _BITUL(7)
27#define MACHINE_FLAG_EDAT2 _BITUL(8)
28#define MACHINE_FLAG_LPP _BITUL(9)
29#define MACHINE_FLAG_TOPOLOGY _BITUL(10)
30#define MACHINE_FLAG_TE _BITUL(11)
31#define MACHINE_FLAG_TLB_LC _BITUL(12)
32#define MACHINE_FLAG_VX _BITUL(13)
Martin Schwidefsky118bd312016-07-26 16:53:09 +020033#define MACHINE_FLAG_TLB_GUEST _BITUL(14)
34#define MACHINE_FLAG_NX _BITUL(15)
35#define MACHINE_FLAG_GS _BITUL(16)
Martin Schwidefsky6e2ef5e2016-10-27 12:41:39 +020036#define MACHINE_FLAG_SCC _BITUL(17)
Hendrik Brueckner83abeff2015-10-01 17:02:48 +020037
Christian Borntraegere22cf8c2015-10-06 18:06:15 +020038#define LPP_MAGIC _BITUL(31)
39#define LPP_PFAULT_PID_MASK _AC(0xffffffff, UL)
40
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#ifndef __ASSEMBLY__
42
Heiko Carstenscbb870c2010-02-26 22:37:43 +010043#include <asm/lowcore.h>
44#include <asm/types.h>
45
Linus Torvalds1da177e2005-04-16 15:20:36 -070046#define IPL_DEVICE (*(unsigned long *) (0x10400))
47#define INITRD_START (*(unsigned long *) (0x10408))
48#define INITRD_SIZE (*(unsigned long *) (0x10410))
Michael Holzheu60a0c682011-10-30 15:16:40 +010049#define OLDMEM_BASE (*(unsigned long *) (0x10418))
50#define OLDMEM_SIZE (*(unsigned long *) (0x10420))
Linus Torvalds1da177e2005-04-16 15:20:36 -070051#define COMMAND_LINE ((char *) (0x10480))
52
Heiko Carstens23d75d92009-02-19 15:19:01 +010053extern int memory_end_set;
54extern unsigned long memory_end;
Philipp Hachtmann50be6342014-01-29 18:16:01 +010055extern unsigned long max_physmem_end;
Heiko Carstens36a2bd42006-12-04 15:40:38 +010056
Philipp Hachtmann50be6342014-01-29 18:16:01 +010057extern void detect_memory_memblock(void);
Heiko Carstens23d17422008-07-14 09:59:21 +020058
Christian Ehrhardt25097bf2009-04-14 15:36:16 +020059#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
60#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
Martin Schwidefsky27d71602010-02-26 22:37:38 +010061#define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
62
Christian Ehrhardt25097bf2009-04-14 15:36:16 +020063#define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
Martin Schwidefskyabf09be2012-11-07 13:17:37 +010064#define MACHINE_HAS_ESOP (S390_lowcore.machine_flags & MACHINE_FLAG_ESOP)
Christian Ehrhardt25097bf2009-04-14 15:36:16 +020065#define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
66#define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
Heiko Carstens3c7ef082012-09-28 15:06:41 +020067#define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
Heiko Carstens85e9d0e2012-09-27 10:45:06 +020068#define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
Hendrik Brueckner23d18e82013-02-11 18:11:09 +010069#define MACHINE_HAS_LPP (S390_lowcore.machine_flags & MACHINE_FLAG_LPP)
Heiko Carstens9186d7a2010-10-25 16:10:52 +020070#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
Martin Schwidefskyd35339a2012-07-31 11:03:04 +020071#define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
Martin Schwidefsky1b948d62014-04-03 13:55:01 +020072#define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
Martin Schwidefsky80703612014-10-06 17:53:53 +020073#define MACHINE_HAS_VX (S390_lowcore.machine_flags & MACHINE_FLAG_VX)
Martin Schwidefsky118bd312016-07-26 16:53:09 +020074#define MACHINE_HAS_TLB_GUEST (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_GUEST)
Martin Schwidefsky57d7f932016-03-22 10:54:24 +010075#define MACHINE_HAS_NX (S390_lowcore.machine_flags & MACHINE_FLAG_NX)
Martin Schwidefsky916cda12016-01-26 14:10:34 +010076#define MACHINE_HAS_GS (S390_lowcore.machine_flags & MACHINE_FLAG_GS)
Martin Schwidefsky6e2ef5e2016-10-27 12:41:39 +020077#define MACHINE_HAS_SCC (S390_lowcore.machine_flags & MACHINE_FLAG_SCC)
Linus Torvalds1da177e2005-04-16 15:20:36 -070078
Linus Torvalds1da177e2005-04-16 15:20:36 -070079/*
80 * Console mode. Override with conmode=
81 */
82extern unsigned int console_mode;
83extern unsigned int console_devno;
84extern unsigned int console_irq;
85
Heiko Carstens2b67fc42007-02-05 21:16:47 +010086extern char vmhalt_cmd[];
87extern char vmpoff_cmd[];
88
Linus Torvalds1da177e2005-04-16 15:20:36 -070089#define CONSOLE_IS_UNDEFINED (console_mode == 0)
90#define CONSOLE_IS_SCLP (console_mode == 1)
91#define CONSOLE_IS_3215 (console_mode == 2)
92#define CONSOLE_IS_3270 (console_mode == 3)
Peter Oberparleiter8f50af42016-07-07 07:52:38 +020093#define CONSOLE_IS_VT220 (console_mode == 4)
94#define CONSOLE_IS_HVC (console_mode == 5)
Linus Torvalds1da177e2005-04-16 15:20:36 -070095#define SET_CONSOLE_SCLP do { console_mode = 1; } while (0)
96#define SET_CONSOLE_3215 do { console_mode = 2; } while (0)
97#define SET_CONSOLE_3270 do { console_mode = 3; } while (0)
Peter Oberparleiter8f50af42016-07-07 07:52:38 +020098#define SET_CONSOLE_VT220 do { console_mode = 4; } while (0)
99#define SET_CONSOLE_HVC do { console_mode = 5; } while (0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100
Hongjie Yangfe355b72007-02-05 21:18:24 +0100101#define NSS_NAME_SIZE 8
Hongjie Yangfe355b72007-02-05 21:18:24 +0100102extern char kernel_nss_name[];
103
David Howellsa0616cd2012-03-28 18:30:02 +0100104#ifdef CONFIG_PFAULT
105extern int pfault_init(void);
106extern void pfault_fini(void);
107#else /* CONFIG_PFAULT */
108#define pfault_init() ({-1;})
109#define pfault_fini() do { } while (0)
110#endif /* CONFIG_PFAULT */
111
Heiko Carstens3f429842017-08-07 15:16:15 +0200112#ifdef CONFIG_VMCP
113void vmcp_cma_reserve(void);
114#else
115static inline void vmcp_cma_reserve(void) { }
116#endif
117
Heiko Carstens5d7ecce2016-02-24 14:27:46 +0100118void report_user_fault(struct pt_regs *regs, long signr, int is_mm_fault);
119
Martin Schwidefskyc9b5ad52016-06-14 12:56:01 +0200120void cmma_init(void);
121void cmma_init_nodat(void);
David Howellsa0616cd2012-03-28 18:30:02 +0100122
123extern void (*_machine_restart)(char *command);
124extern void (*_machine_halt)(void);
125extern void (*_machine_power_off)(void);
126
Heiko Carstens0defa3c2006-02-11 17:56:03 -0800127#else /* __ASSEMBLY__ */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129#define IPL_DEVICE 0x10400
130#define INITRD_START 0x10408
131#define INITRD_SIZE 0x10410
Michael Holzheu60a0c682011-10-30 15:16:40 +0100132#define OLDMEM_BASE 0x10418
133#define OLDMEM_SIZE 0x10420
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134#define COMMAND_LINE 0x10480
135
Heiko Carstens0defa3c2006-02-11 17:56:03 -0800136#endif /* __ASSEMBLY__ */
Heiko Carstens0defa3c2006-02-11 17:56:03 -0800137#endif /* _ASM_S390_SETUP_H */