Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-s390/setup.h |
| 3 | * |
| 4 | * S390 version |
| 5 | * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation |
| 6 | */ |
| 7 | |
| 8 | #ifndef _ASM_S390_SETUP_H |
| 9 | #define _ASM_S390_SETUP_H |
| 10 | |
Heiko Carstens | 0defa3c | 2006-02-11 17:56:03 -0800 | [diff] [blame] | 11 | #ifdef __KERNEL__ |
| 12 | |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 13 | #include <asm/types.h> |
| 14 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #define PARMAREA 0x10400 |
| 16 | #define COMMAND_LINE_SIZE 896 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #define MEMORY_CHUNKS 16 /* max 0x7fff */ |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 18 | #define IPL_PARMBLOCK_ORIGIN 0x2000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
| 20 | #ifndef __ASSEMBLY__ |
| 21 | |
| 22 | #ifndef __s390x__ |
| 23 | #define IPL_DEVICE (*(unsigned long *) (0x10404)) |
| 24 | #define INITRD_START (*(unsigned long *) (0x1040C)) |
| 25 | #define INITRD_SIZE (*(unsigned long *) (0x10414)) |
| 26 | #else /* __s390x__ */ |
| 27 | #define IPL_DEVICE (*(unsigned long *) (0x10400)) |
| 28 | #define INITRD_START (*(unsigned long *) (0x10408)) |
| 29 | #define INITRD_SIZE (*(unsigned long *) (0x10410)) |
| 30 | #endif /* __s390x__ */ |
| 31 | #define COMMAND_LINE ((char *) (0x10480)) |
| 32 | |
| 33 | /* |
| 34 | * Machine features detected in head.S |
| 35 | */ |
| 36 | extern unsigned long machine_flags; |
| 37 | |
| 38 | #define MACHINE_IS_VM (machine_flags & 1) |
| 39 | #define MACHINE_IS_P390 (machine_flags & 4) |
| 40 | #define MACHINE_HAS_MVPG (machine_flags & 16) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | #define MACHINE_HAS_IDTE (machine_flags & 128) |
Martin Schwidefsky | 3c1fcfe | 2006-09-30 23:27:45 -0700 | [diff] [blame] | 42 | #define MACHINE_HAS_DIAG9C (machine_flags & 256) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
| 44 | #ifndef __s390x__ |
| 45 | #define MACHINE_HAS_IEEE (machine_flags & 2) |
| 46 | #define MACHINE_HAS_CSP (machine_flags & 8) |
Heiko Carstens | abdba61 | 2006-07-12 16:39:58 +0200 | [diff] [blame] | 47 | #define MACHINE_HAS_DIAG44 (1) |
Gerald Schaefer | 6c2a9e6 | 2006-09-20 15:59:44 +0200 | [diff] [blame] | 48 | #define MACHINE_HAS_MVCOS (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | #else /* __s390x__ */ |
| 50 | #define MACHINE_HAS_IEEE (1) |
| 51 | #define MACHINE_HAS_CSP (1) |
Heiko Carstens | abdba61 | 2006-07-12 16:39:58 +0200 | [diff] [blame] | 52 | #define MACHINE_HAS_DIAG44 (machine_flags & 32) |
Gerald Schaefer | 6c2a9e6 | 2006-09-20 15:59:44 +0200 | [diff] [blame] | 53 | #define MACHINE_HAS_MVCOS (machine_flags & 512) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | #endif /* __s390x__ */ |
| 55 | |
| 56 | |
| 57 | #define MACHINE_HAS_SCLP (!MACHINE_IS_P390) |
| 58 | |
| 59 | /* |
| 60 | * Console mode. Override with conmode= |
| 61 | */ |
| 62 | extern unsigned int console_mode; |
| 63 | extern unsigned int console_devno; |
| 64 | extern unsigned int console_irq; |
| 65 | |
| 66 | #define CONSOLE_IS_UNDEFINED (console_mode == 0) |
| 67 | #define CONSOLE_IS_SCLP (console_mode == 1) |
| 68 | #define CONSOLE_IS_3215 (console_mode == 2) |
| 69 | #define CONSOLE_IS_3270 (console_mode == 3) |
| 70 | #define SET_CONSOLE_SCLP do { console_mode = 1; } while (0) |
| 71 | #define SET_CONSOLE_3215 do { console_mode = 2; } while (0) |
| 72 | #define SET_CONSOLE_3270 do { console_mode = 3; } while (0) |
| 73 | |
Michael Holzheu | ff6b8ea | 2006-09-20 15:58:49 +0200 | [diff] [blame] | 74 | |
| 75 | struct ipl_list_hdr { |
| 76 | u32 len; |
| 77 | u8 reserved1[3]; |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 78 | u8 version; |
Michael Holzheu | ff6b8ea | 2006-09-20 15:58:49 +0200 | [diff] [blame] | 79 | u32 blk0_len; |
| 80 | u8 pbt; |
| 81 | u8 flags; |
| 82 | u16 reserved2; |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 83 | } __attribute__((packed)); |
| 84 | |
| 85 | struct ipl_block_fcp { |
Michael Holzheu | ff6b8ea | 2006-09-20 15:58:49 +0200 | [diff] [blame] | 86 | u8 reserved1[313-1]; |
| 87 | u8 opt; |
| 88 | u8 reserved2[3]; |
| 89 | u16 reserved3; |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 90 | u16 devno; |
Michael Holzheu | ff6b8ea | 2006-09-20 15:58:49 +0200 | [diff] [blame] | 91 | u8 reserved4[4]; |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 92 | u64 wwpn; |
| 93 | u64 lun; |
| 94 | u32 bootprog; |
Michael Holzheu | ff6b8ea | 2006-09-20 15:58:49 +0200 | [diff] [blame] | 95 | u8 reserved5[12]; |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 96 | u64 br_lba; |
| 97 | u32 scp_data_len; |
Michael Holzheu | ff6b8ea | 2006-09-20 15:58:49 +0200 | [diff] [blame] | 98 | u8 reserved6[260]; |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 99 | u8 scp_data[]; |
| 100 | } __attribute__((packed)); |
| 101 | |
Michael Holzheu | ff6b8ea | 2006-09-20 15:58:49 +0200 | [diff] [blame] | 102 | struct ipl_block_ccw { |
| 103 | u8 load_param[8]; |
| 104 | u8 reserved1[84]; |
| 105 | u8 reserved2[2]; |
| 106 | u16 devno; |
| 107 | u8 vm_flags; |
| 108 | u8 reserved3[3]; |
| 109 | u32 vm_parm_len; |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 110 | } __attribute__((packed)); |
| 111 | |
Michael Holzheu | ff6b8ea | 2006-09-20 15:58:49 +0200 | [diff] [blame] | 112 | struct ipl_parameter_block { |
| 113 | struct ipl_list_hdr hdr; |
| 114 | union { |
| 115 | struct ipl_block_fcp fcp; |
| 116 | struct ipl_block_ccw ccw; |
| 117 | } ipl_info; |
| 118 | } __attribute__((packed)); |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 119 | |
Michael Holzheu | ff6b8ea | 2006-09-20 15:58:49 +0200 | [diff] [blame] | 120 | #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \ |
| 121 | sizeof(struct ipl_block_fcp)) |
| 122 | |
| 123 | #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \ |
| 124 | sizeof(struct ipl_block_ccw)) |
| 125 | |
| 126 | #define IPL_MAX_SUPPORTED_VERSION (0) |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 127 | |
| 128 | /* |
| 129 | * IPL validity flags and parameters as detected in head.S |
| 130 | */ |
Heiko Carstens | e87bfe5 | 2006-09-20 15:59:15 +0200 | [diff] [blame] | 131 | extern u32 ipl_flags; |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 132 | extern u16 ipl_devno; |
| 133 | |
Michael Holzheu | ff6b8ea | 2006-09-20 15:58:49 +0200 | [diff] [blame] | 134 | void do_reipl(void); |
| 135 | |
Heiko Carstens | e87bfe5 | 2006-09-20 15:59:15 +0200 | [diff] [blame] | 136 | enum { |
| 137 | IPL_DEVNO_VALID = 1, |
| 138 | IPL_PARMBLOCK_VALID = 2, |
| 139 | }; |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 140 | |
| 141 | #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ |
| 142 | IPL_PARMBLOCK_ORIGIN) |
Michael Holzheu | ff6b8ea | 2006-09-20 15:58:49 +0200 | [diff] [blame] | 143 | #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len) |
Heiko Carstens | 1e8e338 | 2005-10-30 15:00:11 -0800 | [diff] [blame] | 144 | |
Heiko Carstens | 0defa3c | 2006-02-11 17:56:03 -0800 | [diff] [blame] | 145 | #else /* __ASSEMBLY__ */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | |
| 147 | #ifndef __s390x__ |
| 148 | #define IPL_DEVICE 0x10404 |
| 149 | #define INITRD_START 0x1040C |
| 150 | #define INITRD_SIZE 0x10414 |
| 151 | #else /* __s390x__ */ |
| 152 | #define IPL_DEVICE 0x10400 |
| 153 | #define INITRD_START 0x10408 |
| 154 | #define INITRD_SIZE 0x10410 |
| 155 | #endif /* __s390x__ */ |
| 156 | #define COMMAND_LINE 0x10480 |
| 157 | |
Heiko Carstens | 0defa3c | 2006-02-11 17:56:03 -0800 | [diff] [blame] | 158 | #endif /* __ASSEMBLY__ */ |
| 159 | #endif /* __KERNEL__ */ |
| 160 | #endif /* _ASM_S390_SETUP_H */ |