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