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> |
| 11 | |
| 12 | #define IPL_PARMBLOCK_ORIGIN 0x2000 |
| 13 | |
| 14 | #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \ |
| 15 | sizeof(struct ipl_block_fcp)) |
| 16 | |
| 17 | #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \ |
| 18 | sizeof(struct ipl_block_ccw)) |
| 19 | |
| 20 | #define IPL_MAX_SUPPORTED_VERSION (0) |
| 21 | |
| 22 | #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ |
| 23 | IPL_PARMBLOCK_ORIGIN) |
| 24 | #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len) |
| 25 | |
| 26 | struct ipl_list_hdr { |
| 27 | u32 len; |
| 28 | u8 reserved1[3]; |
| 29 | u8 version; |
| 30 | u32 blk0_len; |
| 31 | u8 pbt; |
| 32 | u8 flags; |
| 33 | u16 reserved2; |
| 34 | } __attribute__((packed)); |
| 35 | |
| 36 | struct ipl_block_fcp { |
| 37 | u8 reserved1[313-1]; |
| 38 | u8 opt; |
| 39 | u8 reserved2[3]; |
| 40 | u16 reserved3; |
| 41 | u16 devno; |
| 42 | u8 reserved4[4]; |
| 43 | u64 wwpn; |
| 44 | u64 lun; |
| 45 | u32 bootprog; |
| 46 | u8 reserved5[12]; |
| 47 | u64 br_lba; |
| 48 | u32 scp_data_len; |
| 49 | u8 reserved6[260]; |
| 50 | u8 scp_data[]; |
| 51 | } __attribute__((packed)); |
| 52 | |
| 53 | struct ipl_block_ccw { |
| 54 | u8 load_param[8]; |
| 55 | u8 reserved1[84]; |
| 56 | u8 reserved2[2]; |
| 57 | u16 devno; |
| 58 | u8 vm_flags; |
| 59 | u8 reserved3[3]; |
| 60 | u32 vm_parm_len; |
| 61 | } __attribute__((packed)); |
| 62 | |
| 63 | struct ipl_parameter_block { |
| 64 | struct ipl_list_hdr hdr; |
| 65 | union { |
| 66 | struct ipl_block_fcp fcp; |
| 67 | struct ipl_block_ccw ccw; |
| 68 | } ipl_info; |
| 69 | } __attribute__((packed)); |
| 70 | |
| 71 | /* |
| 72 | * IPL validity flags and parameters as detected in head.S |
| 73 | */ |
| 74 | extern u32 ipl_flags; |
| 75 | extern u16 ipl_devno; |
| 76 | |
Heiko Carstens | c5dd858 | 2007-03-05 23:35:43 +0100 | [diff] [blame^] | 77 | extern u32 dump_prefix_page; |
Michael Holzheu | 46b05d2 | 2007-02-21 10:55:21 +0100 | [diff] [blame] | 78 | extern void do_reipl(void); |
| 79 | extern void ipl_save_parameters(void); |
| 80 | |
| 81 | enum { |
| 82 | IPL_DEVNO_VALID = 1, |
| 83 | IPL_PARMBLOCK_VALID = 2, |
| 84 | IPL_NSS_VALID = 4, |
| 85 | }; |
| 86 | |
| 87 | /* |
| 88 | * DIAG 308 support |
| 89 | */ |
| 90 | enum diag308_subcode { |
| 91 | DIAG308_REL_HSA = 2, |
| 92 | DIAG308_IPL = 3, |
| 93 | DIAG308_DUMP = 4, |
| 94 | DIAG308_SET = 5, |
| 95 | DIAG308_STORE = 6, |
| 96 | }; |
| 97 | |
| 98 | enum diag308_ipl_type { |
| 99 | DIAG308_IPL_TYPE_FCP = 0, |
| 100 | DIAG308_IPL_TYPE_CCW = 2, |
| 101 | }; |
| 102 | |
| 103 | enum diag308_opt { |
| 104 | DIAG308_IPL_OPT_IPL = 0x10, |
| 105 | DIAG308_IPL_OPT_DUMP = 0x20, |
| 106 | }; |
| 107 | |
| 108 | enum diag308_rc { |
| 109 | DIAG308_RC_OK = 1, |
| 110 | }; |
| 111 | |
| 112 | extern int diag308(unsigned long subcode, void *addr); |
| 113 | |
| 114 | #endif /* _ASM_S390_IPL_H */ |