Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * S390 version |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 3 | * Copyright IBM Corp. 1999, 2010 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | #ifndef _ASM_S390_SETUP_H |
| 6 | #define _ASM_S390_SETUP_H |
| 7 | |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 8 | #include <linux/const.h> |
David Howells | 9807f75 | 2012-10-09 09:47:31 +0100 | [diff] [blame] | 9 | #include <uapi/asm/setup.h> |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 10 | |
Heiko Carstens | 0defa3c | 2006-02-11 17:56:03 -0800 | [diff] [blame] | 11 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #define PARMAREA 0x10400 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 14 | /* |
| 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 Borntraeger | e22cf8c | 2015-10-06 18:06:15 +0200 | [diff] [blame^] | 37 | #define LPP_MAGIC _BITUL(31) |
| 38 | #define LPP_PFAULT_PID_MASK _AC(0xffffffff, UL) |
| 39 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #ifndef __ASSEMBLY__ |
| 41 | |
Heiko Carstens | cbb870c | 2010-02-26 22:37:43 +0100 | [diff] [blame] | 42 | #include <asm/lowcore.h> |
| 43 | #include <asm/types.h> |
| 44 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | #define IPL_DEVICE (*(unsigned long *) (0x10400)) |
| 46 | #define INITRD_START (*(unsigned long *) (0x10408)) |
| 47 | #define INITRD_SIZE (*(unsigned long *) (0x10410)) |
Michael Holzheu | 60a0c68 | 2011-10-30 15:16:40 +0100 | [diff] [blame] | 48 | #define OLDMEM_BASE (*(unsigned long *) (0x10418)) |
| 49 | #define OLDMEM_SIZE (*(unsigned long *) (0x10420)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | #define COMMAND_LINE ((char *) (0x10480)) |
| 51 | |
Heiko Carstens | 23d75d9 | 2009-02-19 15:19:01 +0100 | [diff] [blame] | 52 | extern int memory_end_set; |
| 53 | extern unsigned long memory_end; |
Philipp Hachtmann | 50be634 | 2014-01-29 18:16:01 +0100 | [diff] [blame] | 54 | extern unsigned long max_physmem_end; |
Heiko Carstens | 36a2bd4 | 2006-12-04 15:40:38 +0100 | [diff] [blame] | 55 | |
Philipp Hachtmann | 50be634 | 2014-01-29 18:16:01 +0100 | [diff] [blame] | 56 | extern void detect_memory_memblock(void); |
Heiko Carstens | 23d1742 | 2008-07-14 09:59:21 +0200 | [diff] [blame] | 57 | |
Christian Ehrhardt | 25097bf | 2009-04-14 15:36:16 +0200 | [diff] [blame] | 58 | #define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM) |
| 59 | #define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM) |
Martin Schwidefsky | 27d7160 | 2010-02-26 22:37:38 +0100 | [diff] [blame] | 60 | #define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR) |
| 61 | |
Christian Ehrhardt | 25097bf | 2009-04-14 15:36:16 +0200 | [diff] [blame] | 62 | #define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C) |
Martin Schwidefsky | abf09be | 2012-11-07 13:17:37 +0100 | [diff] [blame] | 63 | #define MACHINE_HAS_ESOP (S390_lowcore.machine_flags & MACHINE_FLAG_ESOP) |
Heiko Carstens | 3c7ef08 | 2012-09-28 15:06:41 +0200 | [diff] [blame] | 64 | #define MACHINE_HAS_PFMF MACHINE_HAS_EDAT1 |
| 65 | #define MACHINE_HAS_HPAGE MACHINE_HAS_EDAT1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | |
Christian Ehrhardt | 25097bf | 2009-04-14 15:36:16 +0200 | [diff] [blame] | 67 | #define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE) |
| 68 | #define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44) |
Heiko Carstens | 3c7ef08 | 2012-09-28 15:06:41 +0200 | [diff] [blame] | 69 | #define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1) |
Heiko Carstens | 85e9d0e | 2012-09-27 10:45:06 +0200 | [diff] [blame] | 70 | #define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2) |
Hendrik Brueckner | 23d18e8 | 2013-02-11 18:11:09 +0100 | [diff] [blame] | 71 | #define MACHINE_HAS_LPP (S390_lowcore.machine_flags & MACHINE_FLAG_LPP) |
Heiko Carstens | 9186d7a | 2010-10-25 16:10:52 +0200 | [diff] [blame] | 72 | #define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY) |
Martin Schwidefsky | d35339a | 2012-07-31 11:03:04 +0200 | [diff] [blame] | 73 | #define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE) |
Martin Schwidefsky | 1b948d6 | 2014-04-03 13:55:01 +0200 | [diff] [blame] | 74 | #define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC) |
Martin Schwidefsky | 8070361 | 2014-10-06 17:53:53 +0200 | [diff] [blame] | 75 | #define MACHINE_HAS_VX (S390_lowcore.machine_flags & MACHINE_FLAG_VX) |
Martin Schwidefsky | 2c72a44 | 2015-01-14 17:52:33 +0100 | [diff] [blame] | 76 | #define MACHINE_HAS_CAD (S390_lowcore.machine_flags & MACHINE_FLAG_CAD) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | /* |
| 79 | * Console mode. Override with conmode= |
| 80 | */ |
| 81 | extern unsigned int console_mode; |
| 82 | extern unsigned int console_devno; |
| 83 | extern unsigned int console_irq; |
| 84 | |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 85 | extern char vmhalt_cmd[]; |
| 86 | extern char vmpoff_cmd[]; |
| 87 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | #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 Yang | fe355b7 | 2007-02-05 21:18:24 +0100 | [diff] [blame] | 96 | #define NSS_NAME_SIZE 8 |
Hongjie Yang | fe355b7 | 2007-02-05 21:18:24 +0100 | [diff] [blame] | 97 | extern char kernel_nss_name[]; |
| 98 | |
David Howells | a0616cd | 2012-03-28 18:30:02 +0100 | [diff] [blame] | 99 | #ifdef CONFIG_PFAULT |
| 100 | extern int pfault_init(void); |
| 101 | extern 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 | |
| 107 | extern void cmma_init(void); |
| 108 | |
| 109 | extern void (*_machine_restart)(char *command); |
| 110 | extern void (*_machine_halt)(void); |
| 111 | extern void (*_machine_power_off)(void); |
| 112 | |
Heiko Carstens | 0defa3c | 2006-02-11 17:56:03 -0800 | [diff] [blame] | 113 | #else /* __ASSEMBLY__ */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | #define IPL_DEVICE 0x10400 |
| 116 | #define INITRD_START 0x10408 |
| 117 | #define INITRD_SIZE 0x10410 |
Michael Holzheu | 60a0c68 | 2011-10-30 15:16:40 +0100 | [diff] [blame] | 118 | #define OLDMEM_BASE 0x10418 |
| 119 | #define OLDMEM_SIZE 0x10420 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | #define COMMAND_LINE 0x10480 |
| 121 | |
Heiko Carstens | 0defa3c | 2006-02-11 17:56:03 -0800 | [diff] [blame] | 122 | #endif /* __ASSEMBLY__ */ |
Heiko Carstens | 0defa3c | 2006-02-11 17:56:03 -0800 | [diff] [blame] | 123 | #endif /* _ASM_S390_SETUP_H */ |