Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 1 | /* |
| 2 | * s390 (re)ipl support |
| 3 | * |
| 4 | * Copyright IBM Corp. 2007 |
| 5 | */ |
| 6 | |
| 7 | #ifndef _ASM_S390_IPL_H |
| 8 | #define _ASM_S390_IPL_H |
| 9 | |
| 10 | #include <asm/types.h> |
Michael Holzheu | 411ed32 | 2007-04-27 16:01:49 +0200 | [diff] [blame] | 11 | #include <asm/cio.h> |
| 12 | #include <asm/setup.h> |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 13 | |
| 14 | #define IPL_PARMBLOCK_ORIGIN 0x2000 |
| 15 | |
| 16 | #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \ |
| 17 | sizeof(struct ipl_block_fcp)) |
| 18 | |
Michael Holzheu | fbb04f3 | 2007-03-19 13:19:03 +0100 | [diff] [blame] | 19 | #define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8) |
| 20 | |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 21 | #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \ |
| 22 | sizeof(struct ipl_block_ccw)) |
| 23 | |
Michael Holzheu | fbb04f3 | 2007-03-19 13:19:03 +0100 | [diff] [blame] | 24 | #define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8) |
| 25 | |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 26 | #define IPL_MAX_SUPPORTED_VERSION (0) |
| 27 | |
| 28 | #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ |
| 29 | IPL_PARMBLOCK_ORIGIN) |
| 30 | #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len) |
| 31 | |
| 32 | struct ipl_list_hdr { |
| 33 | u32 len; |
| 34 | u8 reserved1[3]; |
| 35 | u8 version; |
| 36 | u32 blk0_len; |
| 37 | u8 pbt; |
| 38 | u8 flags; |
| 39 | u16 reserved2; |
| 40 | } __attribute__((packed)); |
| 41 | |
| 42 | struct ipl_block_fcp { |
| 43 | u8 reserved1[313-1]; |
| 44 | u8 opt; |
| 45 | u8 reserved2[3]; |
| 46 | u16 reserved3; |
| 47 | u16 devno; |
| 48 | u8 reserved4[4]; |
| 49 | u64 wwpn; |
| 50 | u64 lun; |
| 51 | u32 bootprog; |
| 52 | u8 reserved5[12]; |
| 53 | u64 br_lba; |
| 54 | u32 scp_data_len; |
| 55 | u8 reserved6[260]; |
| 56 | u8 scp_data[]; |
| 57 | } __attribute__((packed)); |
| 58 | |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 59 | #define DIAG308_VMPARM_SIZE 64 |
| 60 | |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 61 | struct ipl_block_ccw { |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 62 | u8 load_parm[8]; |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 63 | u8 reserved1[84]; |
| 64 | u8 reserved2[2]; |
| 65 | u16 devno; |
| 66 | u8 vm_flags; |
| 67 | u8 reserved3[3]; |
| 68 | u32 vm_parm_len; |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 69 | u8 nss_name[8]; |
| 70 | u8 vm_parm[DIAG308_VMPARM_SIZE]; |
| 71 | u8 reserved4[8]; |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 72 | } __attribute__((packed)); |
| 73 | |
| 74 | struct ipl_parameter_block { |
| 75 | struct ipl_list_hdr hdr; |
| 76 | union { |
| 77 | struct ipl_block_fcp fcp; |
| 78 | struct ipl_block_ccw ccw; |
| 79 | } ipl_info; |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 80 | } __attribute__((packed,aligned(4096))); |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 81 | |
| 82 | /* |
Heiko Carstens | 6fc321f | 2007-04-27 16:01:25 +0200 | [diff] [blame] | 83 | * IPL validity flags |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 84 | */ |
| 85 | extern u32 ipl_flags; |
Heiko Carstens | c5dd858 | 2007-03-05 23:35:43 +0100 | [diff] [blame] | 86 | extern u32 dump_prefix_page; |
Heiko Carstens | 763968e | 2007-05-10 15:45:46 +0200 | [diff] [blame] | 87 | extern unsigned int zfcpdump_prefix_array[]; |
Michael Holzheu | 411ed32 | 2007-04-27 16:01:49 +0200 | [diff] [blame] | 88 | |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 89 | extern void do_reipl(void); |
Michael Holzheu | 99ca4e5 | 2008-01-26 14:11:11 +0100 | [diff] [blame] | 90 | extern void do_halt(void); |
| 91 | extern void do_poff(void); |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 92 | extern void ipl_save_parameters(void); |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 93 | extern void ipl_update_parameters(void); |
| 94 | extern void get_ipl_vmparm(char *); |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 95 | |
| 96 | enum { |
| 97 | IPL_DEVNO_VALID = 1, |
| 98 | IPL_PARMBLOCK_VALID = 2, |
| 99 | IPL_NSS_VALID = 4, |
| 100 | }; |
| 101 | |
Michael Holzheu | 411ed32 | 2007-04-27 16:01:49 +0200 | [diff] [blame] | 102 | enum ipl_type { |
| 103 | IPL_TYPE_UNKNOWN = 1, |
| 104 | IPL_TYPE_CCW = 2, |
| 105 | IPL_TYPE_FCP = 4, |
| 106 | IPL_TYPE_FCP_DUMP = 8, |
| 107 | IPL_TYPE_NSS = 16, |
| 108 | }; |
| 109 | |
| 110 | struct ipl_info |
| 111 | { |
| 112 | enum ipl_type type; |
| 113 | union { |
| 114 | struct { |
| 115 | struct ccw_dev_id dev_id; |
| 116 | } ccw; |
| 117 | struct { |
| 118 | struct ccw_dev_id dev_id; |
| 119 | u64 wwpn; |
| 120 | u64 lun; |
| 121 | } fcp; |
| 122 | struct { |
| 123 | char name[NSS_NAME_SIZE + 1]; |
| 124 | } nss; |
| 125 | } data; |
| 126 | }; |
| 127 | |
| 128 | extern struct ipl_info ipl_info; |
Michael Holzheu | 99ca4e5 | 2008-01-26 14:11:11 +0100 | [diff] [blame] | 129 | extern void setup_ipl(void); |
Michael Holzheu | 411ed32 | 2007-04-27 16:01:49 +0200 | [diff] [blame] | 130 | |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 131 | /* |
| 132 | * DIAG 308 support |
| 133 | */ |
| 134 | enum diag308_subcode { |
| 135 | DIAG308_REL_HSA = 2, |
| 136 | DIAG308_IPL = 3, |
| 137 | DIAG308_DUMP = 4, |
| 138 | DIAG308_SET = 5, |
| 139 | DIAG308_STORE = 6, |
| 140 | }; |
| 141 | |
| 142 | enum diag308_ipl_type { |
| 143 | DIAG308_IPL_TYPE_FCP = 0, |
| 144 | DIAG308_IPL_TYPE_CCW = 2, |
| 145 | }; |
| 146 | |
| 147 | enum diag308_opt { |
| 148 | DIAG308_IPL_OPT_IPL = 0x10, |
| 149 | DIAG308_IPL_OPT_DUMP = 0x20, |
| 150 | }; |
| 151 | |
Michael Holzheu | 48657d2 | 2008-01-26 14:11:17 +0100 | [diff] [blame] | 152 | enum diag308_flags { |
| 153 | DIAG308_FLAGS_LP_VALID = 0x80, |
| 154 | }; |
| 155 | |
Hendrik Brueckner | a0443fb | 2008-07-14 09:59:09 +0200 | [diff] [blame] | 156 | enum diag308_vm_flags { |
| 157 | DIAG308_VM_FLAGS_NSS_VALID = 0x80, |
| 158 | DIAG308_VM_FLAGS_VP_VALID = 0x40, |
| 159 | }; |
| 160 | |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 161 | enum diag308_rc { |
Michael Holzheu | 3a95e8e | 2008-08-01 16:39:10 +0200 | [diff] [blame^] | 162 | DIAG308_RC_OK = 0x0001, |
| 163 | DIAG308_RC_NOCONFIG = 0x0102, |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 164 | }; |
| 165 | |
| 166 | extern int diag308(unsigned long subcode, void *addr); |
| 167 | |
| 168 | #endif /* _ASM_S390_IPL_H */ |