Skip to content

Commit 87fd22e

Browse files
svens-s390Alexander Gordeev
authored andcommitted
s390/ipl: add eckd support
This adds support to IPL from ECKD DASDs to linux. It introduces a few sysfs files in /sys/firmware/reipl/eckd: bootprog: the boot program selector clear: whether to issue a diag308 LOAD_NORMAL or LOAD_CLEAR device: the device to ipl from br_chr: Cylinder/Head/Record number to read the bootrecord from. Might be '0' or 'auto' if it should be read from the volume label. scpdata: data to be passed to the ipl'd program. The new ipl type is called 'eckd'. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent 5de2322 commit 87fd22e

File tree

6 files changed

+329
-1
lines changed

6 files changed

+329
-1
lines changed

arch/s390/boot/ipl_parm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ static size_t ipl_block_get_ascii_scpdata(char *dest, size_t size,
108108
scp_data_len = ipb->nvme.scp_data_len;
109109
scp_data = ipb->nvme.scp_data;
110110
break;
111+
case IPL_PBT_ECKD:
112+
scp_data_len = ipb->eckd.scp_data_len;
113+
scp_data = ipb->eckd.scp_data;
114+
break;
115+
111116
default:
112117
goto out;
113118
}
@@ -153,6 +158,7 @@ static void append_ipl_block_parm(void)
153158
break;
154159
case IPL_PBT_FCP:
155160
case IPL_PBT_NVME:
161+
case IPL_PBT_ECKD:
156162
rc = ipl_block_get_ascii_scpdata(
157163
parm, COMMAND_LINE_SIZE - len - 1, &ipl_block);
158164
break;

arch/s390/include/asm/ipl.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct ipl_parameter_block {
2222
struct ipl_pb0_common common;
2323
struct ipl_pb0_fcp fcp;
2424
struct ipl_pb0_ccw ccw;
25+
struct ipl_pb0_eckd eckd;
2526
struct ipl_pb0_nvme nvme;
2627
char raw[PAGE_SIZE - sizeof(struct ipl_pl_hdr)];
2728
};
@@ -41,6 +42,10 @@ struct ipl_parameter_block {
4142
sizeof(struct ipl_pb0_ccw))
4243
#define IPL_BP0_CCW_LEN (sizeof(struct ipl_pb0_ccw))
4344

45+
#define IPL_BP_ECKD_LEN (sizeof(struct ipl_pl_hdr) + \
46+
sizeof(struct ipl_pb0_eckd))
47+
#define IPL_BP0_ECKD_LEN (sizeof(struct ipl_pb0_eckd))
48+
4449
#define IPL_MAX_SUPPORTED_VERSION (0)
4550

4651
#define IPL_RB_CERT_UNKNOWN ((unsigned short)-1)
@@ -68,6 +73,7 @@ enum ipl_type {
6873
IPL_TYPE_NSS = 16,
6974
IPL_TYPE_NVME = 32,
7075
IPL_TYPE_NVME_DUMP = 64,
76+
IPL_TYPE_ECKD = 128,
7177
};
7278

7379
struct ipl_info
@@ -77,6 +83,9 @@ struct ipl_info
7783
struct {
7884
struct ccw_dev_id dev_id;
7985
} ccw;
86+
struct {
87+
struct ccw_dev_id dev_id;
88+
} eckd;
8089
struct {
8190
struct ccw_dev_id dev_id;
8291
u64 wwpn;

arch/s390/include/asm/sclp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct sclp_info {
8787
unsigned char has_gisaf : 1;
8888
unsigned char has_diag318 : 1;
8989
unsigned char has_sipl : 1;
90+
unsigned char has_sipl_eckd : 1;
9091
unsigned char has_dirq : 1;
9192
unsigned char has_iplcc : 1;
9293
unsigned char has_zpci_lsi : 1;

arch/s390/include/uapi/asm/ipl.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ enum ipl_pbt {
2727
IPL_PBT_FCP = 0,
2828
IPL_PBT_SCP_DATA = 1,
2929
IPL_PBT_CCW = 2,
30+
IPL_PBT_ECKD = 3,
3031
IPL_PBT_NVME = 4,
3132
};
3233

@@ -111,6 +112,33 @@ struct ipl_pb0_ccw {
111112
__u8 reserved5[8];
112113
} __packed;
113114

115+
/* IPL Parameter Block 0 for ECKD */
116+
struct ipl_pb0_eckd {
117+
__u32 len;
118+
__u8 pbt;
119+
__u8 reserved1[3];
120+
__u32 reserved2[78];
121+
__u8 opt;
122+
__u8 reserved4[4];
123+
__u8 reserved5:5;
124+
__u8 ssid:3;
125+
__u16 devno;
126+
__u32 reserved6[5];
127+
__u32 bootprog;
128+
__u8 reserved7[12];
129+
struct {
130+
__u16 cyl;
131+
__u8 head;
132+
__u8 record;
133+
__u32 reserved;
134+
} br_chr __packed;
135+
__u32 scp_data_len;
136+
__u8 reserved8[260];
137+
__u8 scp_data[];
138+
} __packed;
139+
140+
#define IPL_PB0_ECKD_OPT_IPL 0x10
141+
114142
#define IPL_PB0_CCW_VM_FLAG_NSS 0x80
115143
#define IPL_PB0_CCW_VM_FLAG_VP 0x40
116144

0 commit comments

Comments
 (0)