Commit | Line | Data |
---|---|---|
46b05d26 MH |
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> | |
411ed322 MH |
11 | #include <asm/cio.h> |
12 | #include <asm/setup.h> | |
46b05d26 MH |
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 | ||
fbb04f38 MH |
19 | #define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8) |
20 | ||
46b05d26 MH |
21 | #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \ |
22 | sizeof(struct ipl_block_ccw)) | |
23 | ||
fbb04f38 MH |
24 | #define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8) |
25 | ||
46b05d26 MH |
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 | ||
59 | struct ipl_block_ccw { | |
60 | u8 load_param[8]; | |
61 | u8 reserved1[84]; | |
62 | u8 reserved2[2]; | |
63 | u16 devno; | |
64 | u8 vm_flags; | |
65 | u8 reserved3[3]; | |
66 | u32 vm_parm_len; | |
fbb04f38 | 67 | u8 reserved4[80]; |
46b05d26 MH |
68 | } __attribute__((packed)); |
69 | ||
70 | struct ipl_parameter_block { | |
71 | struct ipl_list_hdr hdr; | |
72 | union { | |
73 | struct ipl_block_fcp fcp; | |
74 | struct ipl_block_ccw ccw; | |
75 | } ipl_info; | |
76 | } __attribute__((packed)); | |
77 | ||
78 | /* | |
6fc321fd | 79 | * IPL validity flags |
46b05d26 MH |
80 | */ |
81 | extern u32 ipl_flags; | |
c5dd8586 | 82 | extern u32 dump_prefix_page; |
763968e2 | 83 | extern unsigned int zfcpdump_prefix_array[]; |
411ed322 | 84 | |
46b05d26 | 85 | extern void do_reipl(void); |
99ca4e58 MH |
86 | extern void do_halt(void); |
87 | extern void do_poff(void); | |
46b05d26 MH |
88 | extern void ipl_save_parameters(void); |
89 | ||
90 | enum { | |
91 | IPL_DEVNO_VALID = 1, | |
92 | IPL_PARMBLOCK_VALID = 2, | |
93 | IPL_NSS_VALID = 4, | |
94 | }; | |
95 | ||
411ed322 MH |
96 | enum ipl_type { |
97 | IPL_TYPE_UNKNOWN = 1, | |
98 | IPL_TYPE_CCW = 2, | |
99 | IPL_TYPE_FCP = 4, | |
100 | IPL_TYPE_FCP_DUMP = 8, | |
101 | IPL_TYPE_NSS = 16, | |
102 | }; | |
103 | ||
104 | struct ipl_info | |
105 | { | |
106 | enum ipl_type type; | |
107 | union { | |
108 | struct { | |
109 | struct ccw_dev_id dev_id; | |
110 | } ccw; | |
111 | struct { | |
112 | struct ccw_dev_id dev_id; | |
113 | u64 wwpn; | |
114 | u64 lun; | |
115 | } fcp; | |
116 | struct { | |
117 | char name[NSS_NAME_SIZE + 1]; | |
118 | } nss; | |
119 | } data; | |
120 | }; | |
121 | ||
122 | extern struct ipl_info ipl_info; | |
99ca4e58 | 123 | extern void setup_ipl(void); |
411ed322 | 124 | |
46b05d26 MH |
125 | /* |
126 | * DIAG 308 support | |
127 | */ | |
128 | enum diag308_subcode { | |
129 | DIAG308_REL_HSA = 2, | |
130 | DIAG308_IPL = 3, | |
131 | DIAG308_DUMP = 4, | |
132 | DIAG308_SET = 5, | |
133 | DIAG308_STORE = 6, | |
134 | }; | |
135 | ||
136 | enum diag308_ipl_type { | |
137 | DIAG308_IPL_TYPE_FCP = 0, | |
138 | DIAG308_IPL_TYPE_CCW = 2, | |
139 | }; | |
140 | ||
141 | enum diag308_opt { | |
142 | DIAG308_IPL_OPT_IPL = 0x10, | |
143 | DIAG308_IPL_OPT_DUMP = 0x20, | |
144 | }; | |
145 | ||
146 | enum diag308_rc { | |
147 | DIAG308_RC_OK = 1, | |
148 | }; | |
149 | ||
150 | extern int diag308(unsigned long subcode, void *addr); | |
151 | ||
152 | #endif /* _ASM_S390_IPL_H */ |