Loading...
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#include <asm/cio.h>
12#include <asm/setup.h>
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
19#define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8)
20
21#define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \
22 sizeof(struct ipl_block_ccw))
23
24#define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8)
25
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
32struct 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
42struct 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#define DIAG308_VMPARM_SIZE 64
60#define DIAG308_SCPDATA_SIZE (PAGE_SIZE - (sizeof(struct ipl_list_hdr) + \
61 offsetof(struct ipl_block_fcp, scp_data)))
62
63struct ipl_block_ccw {
64 u8 load_parm[8];
65 u8 reserved1[84];
66 u8 reserved2[2];
67 u16 devno;
68 u8 vm_flags;
69 u8 reserved3[3];
70 u32 vm_parm_len;
71 u8 nss_name[8];
72 u8 vm_parm[DIAG308_VMPARM_SIZE];
73 u8 reserved4[8];
74} __attribute__((packed));
75
76struct ipl_parameter_block {
77 struct ipl_list_hdr hdr;
78 union {
79 struct ipl_block_fcp fcp;
80 struct ipl_block_ccw ccw;
81 } ipl_info;
82} __attribute__((packed,aligned(4096)));
83
84/*
85 * IPL validity flags
86 */
87extern u32 ipl_flags;
88extern u32 dump_prefix_page;
89extern unsigned int zfcpdump_prefix_array[];
90
91extern void do_reipl(void);
92extern void do_halt(void);
93extern void do_poff(void);
94extern void ipl_save_parameters(void);
95extern void ipl_update_parameters(void);
96extern size_t append_ipl_vmparm(char *, size_t);
97extern size_t append_ipl_scpdata(char *, size_t);
98
99enum {
100 IPL_DEVNO_VALID = 1,
101 IPL_PARMBLOCK_VALID = 2,
102 IPL_NSS_VALID = 4,
103};
104
105enum ipl_type {
106 IPL_TYPE_UNKNOWN = 1,
107 IPL_TYPE_CCW = 2,
108 IPL_TYPE_FCP = 4,
109 IPL_TYPE_FCP_DUMP = 8,
110 IPL_TYPE_NSS = 16,
111};
112
113struct ipl_info
114{
115 enum ipl_type type;
116 union {
117 struct {
118 struct ccw_dev_id dev_id;
119 } ccw;
120 struct {
121 struct ccw_dev_id dev_id;
122 u64 wwpn;
123 u64 lun;
124 } fcp;
125 struct {
126 char name[NSS_NAME_SIZE + 1];
127 } nss;
128 } data;
129};
130
131extern struct ipl_info ipl_info;
132extern void setup_ipl(void);
133
134/*
135 * DIAG 308 support
136 */
137enum diag308_subcode {
138 DIAG308_REL_HSA = 2,
139 DIAG308_IPL = 3,
140 DIAG308_DUMP = 4,
141 DIAG308_SET = 5,
142 DIAG308_STORE = 6,
143};
144
145enum diag308_ipl_type {
146 DIAG308_IPL_TYPE_FCP = 0,
147 DIAG308_IPL_TYPE_CCW = 2,
148};
149
150enum diag308_opt {
151 DIAG308_IPL_OPT_IPL = 0x10,
152 DIAG308_IPL_OPT_DUMP = 0x20,
153};
154
155enum diag308_flags {
156 DIAG308_FLAGS_LP_VALID = 0x80,
157};
158
159enum diag308_vm_flags {
160 DIAG308_VM_FLAGS_NSS_VALID = 0x80,
161 DIAG308_VM_FLAGS_VP_VALID = 0x40,
162};
163
164enum diag308_rc {
165 DIAG308_RC_OK = 0x0001,
166 DIAG308_RC_NOCONFIG = 0x0102,
167};
168
169extern int diag308(unsigned long subcode, void *addr);
170extern void diag308_reset(void);
171extern void store_status(void);
172extern void lgr_info_log(void);
173
174#endif /* _ASM_S390_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
33struct 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
43struct 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
64struct 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
77struct 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 */
88extern u32 ipl_flags;
89extern u32 dump_prefix_page;
90
91struct dump_save_areas {
92 struct save_area **areas;
93 int count;
94};
95
96extern struct dump_save_areas dump_save_areas;
97struct save_area *dump_save_area_create(int cpu);
98
99extern void do_reipl(void);
100extern void do_halt(void);
101extern void do_poff(void);
102extern void ipl_save_parameters(void);
103extern void ipl_update_parameters(void);
104extern size_t append_ipl_vmparm(char *, size_t);
105extern size_t append_ipl_scpdata(char *, size_t);
106
107enum {
108 IPL_DEVNO_VALID = 1,
109 IPL_PARMBLOCK_VALID = 2,
110 IPL_NSS_VALID = 4,
111};
112
113enum ipl_type {
114 IPL_TYPE_UNKNOWN = 1,
115 IPL_TYPE_CCW = 2,
116 IPL_TYPE_FCP = 4,
117 IPL_TYPE_FCP_DUMP = 8,
118 IPL_TYPE_NSS = 16,
119};
120
121struct ipl_info
122{
123 enum ipl_type type;
124 union {
125 struct {
126 struct ccw_dev_id dev_id;
127 } ccw;
128 struct {
129 struct ccw_dev_id dev_id;
130 u64 wwpn;
131 u64 lun;
132 } fcp;
133 struct {
134 char name[NSS_NAME_SIZE + 1];
135 } nss;
136 } data;
137};
138
139extern struct ipl_info ipl_info;
140extern void setup_ipl(void);
141
142/*
143 * DIAG 308 support
144 */
145enum diag308_subcode {
146 DIAG308_REL_HSA = 2,
147 DIAG308_IPL = 3,
148 DIAG308_DUMP = 4,
149 DIAG308_SET = 5,
150 DIAG308_STORE = 6,
151};
152
153enum diag308_ipl_type {
154 DIAG308_IPL_TYPE_FCP = 0,
155 DIAG308_IPL_TYPE_CCW = 2,
156};
157
158enum diag308_opt {
159 DIAG308_IPL_OPT_IPL = 0x10,
160 DIAG308_IPL_OPT_DUMP = 0x20,
161};
162
163enum diag308_flags {
164 DIAG308_FLAGS_LP_VALID = 0x80,
165};
166
167enum diag308_vm_flags {
168 DIAG308_VM_FLAGS_NSS_VALID = 0x80,
169 DIAG308_VM_FLAGS_VP_VALID = 0x40,
170};
171
172enum diag308_rc {
173 DIAG308_RC_OK = 0x0001,
174 DIAG308_RC_NOCONFIG = 0x0102,
175};
176
177extern int diag308(unsigned long subcode, void *addr);
178extern void diag308_reset(void);
179extern void store_status(void);
180extern void lgr_info_log(void);
181
182#endif /* _ASM_S390_IPL_H */