1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * S390 version 4 * Copyright IBM Corp. 1999, 2017 5 */ 6 #ifndef _ASM_S390_SETUP_H 7 #define _ASM_S390_SETUP_H 8 9 #include <linux/const.h> 10 #include <uapi/asm/setup.h> 11 12 #define EP_OFFSET 0x10008 13 #define EP_STRING "S390EP" 14 #define PARMAREA 0x10400 15 #define PARMAREA_END 0x11000 16 17 /* 18 * Machine features detected in early.c 19 */ 20 21 #define MACHINE_FLAG_VM _BITUL(0) 22 #define MACHINE_FLAG_KVM _BITUL(1) 23 #define MACHINE_FLAG_LPAR _BITUL(2) 24 #define MACHINE_FLAG_DIAG9C _BITUL(3) 25 #define MACHINE_FLAG_ESOP _BITUL(4) 26 #define MACHINE_FLAG_IDTE _BITUL(5) 27 #define MACHINE_FLAG_DIAG44 _BITUL(6) 28 #define MACHINE_FLAG_EDAT1 _BITUL(7) 29 #define MACHINE_FLAG_EDAT2 _BITUL(8) 30 #define MACHINE_FLAG_TOPOLOGY _BITUL(10) 31 #define MACHINE_FLAG_TE _BITUL(11) 32 #define MACHINE_FLAG_TLB_LC _BITUL(12) 33 #define MACHINE_FLAG_VX _BITUL(13) 34 #define MACHINE_FLAG_TLB_GUEST _BITUL(14) 35 #define MACHINE_FLAG_NX _BITUL(15) 36 #define MACHINE_FLAG_GS _BITUL(16) 37 #define MACHINE_FLAG_SCC _BITUL(17) 38 39 #define LPP_MAGIC _BITUL(31) 40 #define LPP_PID_MASK _AC(0xffffffff, UL) 41 42 /* Offsets to entry points in kernel/head.S */ 43 44 #define STARTUP_NORMAL_OFFSET 0x10000 45 #define STARTUP_KDUMP_OFFSET 0x10010 46 47 /* Offsets to parameters in kernel/head.S */ 48 49 #define IPL_DEVICE_OFFSET 0x10400 50 #define INITRD_START_OFFSET 0x10408 51 #define INITRD_SIZE_OFFSET 0x10410 52 #define OLDMEM_BASE_OFFSET 0x10418 53 #define OLDMEM_SIZE_OFFSET 0x10420 54 #define COMMAND_LINE_OFFSET 0x10480 55 56 #ifndef __ASSEMBLY__ 57 58 #include <asm/lowcore.h> 59 #include <asm/types.h> 60 61 #define IPL_DEVICE (*(unsigned long *) (IPL_DEVICE_OFFSET)) 62 #define INITRD_START (*(unsigned long *) (INITRD_START_OFFSET)) 63 #define INITRD_SIZE (*(unsigned long *) (INITRD_SIZE_OFFSET)) 64 #define OLDMEM_BASE (*(unsigned long *) (OLDMEM_BASE_OFFSET)) 65 #define OLDMEM_SIZE (*(unsigned long *) (OLDMEM_SIZE_OFFSET)) 66 #define COMMAND_LINE ((char *) (COMMAND_LINE_OFFSET)) 67 68 extern int memory_end_set; 69 extern unsigned long memory_end; 70 extern unsigned long max_physmem_end; 71 72 extern void detect_memory_memblock(void); 73 74 #define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM) 75 #define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM) 76 #define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR) 77 78 #define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C) 79 #define MACHINE_HAS_ESOP (S390_lowcore.machine_flags & MACHINE_FLAG_ESOP) 80 #define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE) 81 #define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44) 82 #define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1) 83 #define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2) 84 #define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY) 85 #define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE) 86 #define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC) 87 #define MACHINE_HAS_VX (S390_lowcore.machine_flags & MACHINE_FLAG_VX) 88 #define MACHINE_HAS_TLB_GUEST (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_GUEST) 89 #define MACHINE_HAS_NX (S390_lowcore.machine_flags & MACHINE_FLAG_NX) 90 #define MACHINE_HAS_GS (S390_lowcore.machine_flags & MACHINE_FLAG_GS) 91 #define MACHINE_HAS_SCC (S390_lowcore.machine_flags & MACHINE_FLAG_SCC) 92 93 /* 94 * Console mode. Override with conmode= 95 */ 96 extern unsigned int console_mode; 97 extern unsigned int console_devno; 98 extern unsigned int console_irq; 99 100 extern char vmhalt_cmd[]; 101 extern char vmpoff_cmd[]; 102 103 #define CONSOLE_IS_UNDEFINED (console_mode == 0) 104 #define CONSOLE_IS_SCLP (console_mode == 1) 105 #define CONSOLE_IS_3215 (console_mode == 2) 106 #define CONSOLE_IS_3270 (console_mode == 3) 107 #define CONSOLE_IS_VT220 (console_mode == 4) 108 #define CONSOLE_IS_HVC (console_mode == 5) 109 #define SET_CONSOLE_SCLP do { console_mode = 1; } while (0) 110 #define SET_CONSOLE_3215 do { console_mode = 2; } while (0) 111 #define SET_CONSOLE_3270 do { console_mode = 3; } while (0) 112 #define SET_CONSOLE_VT220 do { console_mode = 4; } while (0) 113 #define SET_CONSOLE_HVC do { console_mode = 5; } while (0) 114 115 #ifdef CONFIG_PFAULT 116 extern int pfault_init(void); 117 extern void pfault_fini(void); 118 #else /* CONFIG_PFAULT */ 119 #define pfault_init() ({-1;}) 120 #define pfault_fini() do { } while (0) 121 #endif /* CONFIG_PFAULT */ 122 123 #ifdef CONFIG_VMCP 124 void vmcp_cma_reserve(void); 125 #else 126 static inline void vmcp_cma_reserve(void) { } 127 #endif 128 129 void report_user_fault(struct pt_regs *regs, long signr, int is_mm_fault); 130 131 void cmma_init(void); 132 void cmma_init_nodat(void); 133 134 extern void (*_machine_restart)(char *command); 135 extern void (*_machine_halt)(void); 136 extern void (*_machine_power_off)(void); 137 138 #else /* __ASSEMBLY__ */ 139 140 #define IPL_DEVICE (IPL_DEVICE_OFFSET) 141 #define INITRD_START (INITRD_START_OFFSET) 142 #define INITRD_SIZE (INITRD_SIZE_OFFSET) 143 #define OLDMEM_BASE (OLDMEM_BASE_OFFSET) 144 #define OLDMEM_SIZE (OLDMEM_SIZE_OFFSET) 145 #define COMMAND_LINE (COMMAND_LINE_OFFSET) 146 147 #endif /* __ASSEMBLY__ */ 148 #endif /* _ASM_S390_SETUP_H */ 149