[S390] reboot from and dump to SCSI under z/VM fails.
[pandora-kernel.git] / include / 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/types.h>
11
12 #define IPL_PARMBLOCK_ORIGIN    0x2000
13
14 #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \
15                               sizeof(struct ipl_block_fcp))
16
17 #define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8)
18
19 #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \
20                               sizeof(struct ipl_block_ccw))
21
22 #define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8)
23
24 #define IPL_MAX_SUPPORTED_VERSION (0)
25
26 #define IPL_PARMBLOCK_START     ((struct ipl_parameter_block *) \
27                                  IPL_PARMBLOCK_ORIGIN)
28 #define IPL_PARMBLOCK_SIZE      (IPL_PARMBLOCK_START->hdr.len)
29
30 struct ipl_list_hdr {
31         u32 len;
32         u8  reserved1[3];
33         u8  version;
34         u32 blk0_len;
35         u8  pbt;
36         u8  flags;
37         u16 reserved2;
38 } __attribute__((packed));
39
40 struct ipl_block_fcp {
41         u8  reserved1[313-1];
42         u8  opt;
43         u8  reserved2[3];
44         u16 reserved3;
45         u16 devno;
46         u8  reserved4[4];
47         u64 wwpn;
48         u64 lun;
49         u32 bootprog;
50         u8  reserved5[12];
51         u64 br_lba;
52         u32 scp_data_len;
53         u8  reserved6[260];
54         u8  scp_data[];
55 } __attribute__((packed));
56
57 struct ipl_block_ccw {
58         u8  load_param[8];
59         u8  reserved1[84];
60         u8  reserved2[2];
61         u16 devno;
62         u8  vm_flags;
63         u8  reserved3[3];
64         u32 vm_parm_len;
65         u8  reserved4[80];
66 } __attribute__((packed));
67
68 struct ipl_parameter_block {
69         struct ipl_list_hdr hdr;
70         union {
71                 struct ipl_block_fcp fcp;
72                 struct ipl_block_ccw ccw;
73         } ipl_info;
74 } __attribute__((packed));
75
76 /*
77  * IPL validity flags and parameters as detected in head.S
78  */
79 extern u32 ipl_flags;
80 extern u16 ipl_devno;
81
82 extern u32 dump_prefix_page;
83 extern void do_reipl(void);
84 extern void ipl_save_parameters(void);
85
86 enum {
87         IPL_DEVNO_VALID         = 1,
88         IPL_PARMBLOCK_VALID     = 2,
89         IPL_NSS_VALID           = 4,
90 };
91
92 /*
93  * DIAG 308 support
94  */
95 enum diag308_subcode  {
96         DIAG308_REL_HSA = 2,
97         DIAG308_IPL     = 3,
98         DIAG308_DUMP    = 4,
99         DIAG308_SET     = 5,
100         DIAG308_STORE   = 6,
101 };
102
103 enum diag308_ipl_type {
104         DIAG308_IPL_TYPE_FCP    = 0,
105         DIAG308_IPL_TYPE_CCW    = 2,
106 };
107
108 enum diag308_opt {
109         DIAG308_IPL_OPT_IPL     = 0x10,
110         DIAG308_IPL_OPT_DUMP    = 0x20,
111 };
112
113 enum diag308_rc {
114         DIAG308_RC_OK   = 1,
115 };
116
117 extern int diag308(unsigned long subcode, void *addr);
118
119 #endif /* _ASM_S390_IPL_H */