ea7d9d6ab06e2b33ff3ae946b8d19928d04e963d
[deliverable/linux.git] / arch / s390 / include / asm / ipl.h
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/lowcore.h>
11 #include <asm/types.h>
12 #include <asm/cio.h>
13 #include <asm/setup.h>
14
15 #define IPL_PARMBLOCK_ORIGIN 0x2000
16
17 #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \
18 sizeof(struct ipl_block_fcp))
19
20 #define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8)
21
22 #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \
23 sizeof(struct ipl_block_ccw))
24
25 #define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8)
26
27 #define IPL_MAX_SUPPORTED_VERSION (0)
28
29 #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \
30 IPL_PARMBLOCK_ORIGIN)
31 #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len)
32
33 struct ipl_list_hdr {
34 u32 len;
35 u8 reserved1[3];
36 u8 version;
37 u32 blk0_len;
38 u8 pbt;
39 u8 flags;
40 u16 reserved2;
41 } __attribute__((packed));
42
43 struct ipl_block_fcp {
44 u8 reserved1[313-1];
45 u8 opt;
46 u8 reserved2[3];
47 u16 reserved3;
48 u16 devno;
49 u8 reserved4[4];
50 u64 wwpn;
51 u64 lun;
52 u32 bootprog;
53 u8 reserved5[12];
54 u64 br_lba;
55 u32 scp_data_len;
56 u8 reserved6[260];
57 u8 scp_data[];
58 } __attribute__((packed));
59
60 #define DIAG308_VMPARM_SIZE 64
61 #define DIAG308_SCPDATA_SIZE (PAGE_SIZE - (sizeof(struct ipl_list_hdr) + \
62 offsetof(struct ipl_block_fcp, scp_data)))
63
64 struct ipl_block_ccw {
65 u8 load_parm[8];
66 u8 reserved1[84];
67 u8 reserved2[2];
68 u16 devno;
69 u8 vm_flags;
70 u8 reserved3[3];
71 u32 vm_parm_len;
72 u8 nss_name[8];
73 u8 vm_parm[DIAG308_VMPARM_SIZE];
74 u8 reserved4[8];
75 } __attribute__((packed));
76
77 struct ipl_parameter_block {
78 struct ipl_list_hdr hdr;
79 union {
80 struct ipl_block_fcp fcp;
81 struct ipl_block_ccw ccw;
82 } ipl_info;
83 } __attribute__((packed,aligned(4096)));
84
85 /*
86 * IPL validity flags
87 */
88 extern u32 ipl_flags;
89 extern u32 dump_prefix_page;
90 extern unsigned int zfcpdump_prefix_array[];
91
92 struct dump_save_areas {
93 struct save_area **areas;
94 int count;
95 };
96
97 extern struct dump_save_areas dump_save_areas;
98 struct save_area *dump_save_area_create(int cpu);
99
100 extern void do_reipl(void);
101 extern void do_halt(void);
102 extern void do_poff(void);
103 extern void ipl_save_parameters(void);
104 extern void ipl_update_parameters(void);
105 extern size_t append_ipl_vmparm(char *, size_t);
106 extern size_t append_ipl_scpdata(char *, size_t);
107
108 enum {
109 IPL_DEVNO_VALID = 1,
110 IPL_PARMBLOCK_VALID = 2,
111 IPL_NSS_VALID = 4,
112 };
113
114 enum ipl_type {
115 IPL_TYPE_UNKNOWN = 1,
116 IPL_TYPE_CCW = 2,
117 IPL_TYPE_FCP = 4,
118 IPL_TYPE_FCP_DUMP = 8,
119 IPL_TYPE_NSS = 16,
120 };
121
122 struct ipl_info
123 {
124 enum ipl_type type;
125 union {
126 struct {
127 struct ccw_dev_id dev_id;
128 } ccw;
129 struct {
130 struct ccw_dev_id dev_id;
131 u64 wwpn;
132 u64 lun;
133 } fcp;
134 struct {
135 char name[NSS_NAME_SIZE + 1];
136 } nss;
137 } data;
138 };
139
140 extern struct ipl_info ipl_info;
141 extern void setup_ipl(void);
142
143 /*
144 * DIAG 308 support
145 */
146 enum diag308_subcode {
147 DIAG308_REL_HSA = 2,
148 DIAG308_IPL = 3,
149 DIAG308_DUMP = 4,
150 DIAG308_SET = 5,
151 DIAG308_STORE = 6,
152 };
153
154 enum diag308_ipl_type {
155 DIAG308_IPL_TYPE_FCP = 0,
156 DIAG308_IPL_TYPE_CCW = 2,
157 };
158
159 enum diag308_opt {
160 DIAG308_IPL_OPT_IPL = 0x10,
161 DIAG308_IPL_OPT_DUMP = 0x20,
162 };
163
164 enum diag308_flags {
165 DIAG308_FLAGS_LP_VALID = 0x80,
166 };
167
168 enum diag308_vm_flags {
169 DIAG308_VM_FLAGS_NSS_VALID = 0x80,
170 DIAG308_VM_FLAGS_VP_VALID = 0x40,
171 };
172
173 enum diag308_rc {
174 DIAG308_RC_OK = 0x0001,
175 DIAG308_RC_NOCONFIG = 0x0102,
176 };
177
178 extern int diag308(unsigned long subcode, void *addr);
179 extern void diag308_reset(void);
180 extern void store_status(void);
181 extern void lgr_info_log(void);
182
183 #endif /* _ASM_S390_IPL_H */
This page took 0.033736 seconds and 4 git commands to generate.