4 * Copyright 2015 IBM Corp.
5 * Author(s): Alexander Yarygin <yarygin@linux.vnet.ibm.com>
7 * This work is licensed under the terms of the GNU GPL, version 2 or (at
8 * your option) any later version. See the COPYING file in the top-level
16 uint8_t reserved0
[85];
25 } __attribute__ ((packed
));
26 typedef struct IplBlockCcw IplBlockCcw
;
29 uint8_t reserved1
[305 - 1];
38 uint8_t reserved5
[12];
40 uint32_t scp_data_len
;
41 uint8_t reserved6
[260];
43 } __attribute__ ((packed
));
44 typedef struct IplBlockFcp IplBlockFcp
;
46 struct IplBlockQemuScsi
{
50 uint8_t reserved0
[77];
53 } __attribute__ ((packed
));
54 typedef struct IplBlockQemuScsi IplBlockQemuScsi
;
56 struct IplParameterBlock
{
68 IplBlockQemuScsi scsi
;
70 } __attribute__ ((packed
));
71 typedef struct IplParameterBlock IplParameterBlock
;
73 extern IplParameterBlock iplb
__attribute__((__aligned__(PAGE_SIZE
)));
75 #define QIPL_ADDRESS 0xcc
78 #define QIPL_FLAG_BM_OPTS_CMD 0x80
79 #define QIPL_FLAG_BM_OPTS_ZIPL 0x40
82 * This definition must be kept in sync with the defininition
85 struct QemuIplParameters
{
88 uint64_t netboot_start_addr
;
89 uint32_t boot_menu_timeout
;
90 uint8_t reserved2
[12];
91 } __attribute__ ((packed
));
92 typedef struct QemuIplParameters QemuIplParameters
;
94 extern QemuIplParameters qipl
;
96 #define S390_IPL_TYPE_FCP 0x00
97 #define S390_IPL_TYPE_CCW 0x02
98 #define S390_IPL_TYPE_QEMU_SCSI 0xff
100 static inline bool store_iplb(IplParameterBlock
*iplb
)
102 register unsigned long addr
asm("0") = (unsigned long) iplb
;
103 register unsigned long rc
asm("1") = 0;
105 asm volatile ("diag %0,%2,0x308\n"
106 : "+d" (addr
), "+d" (rc
)