[S390] cio/ipl: Clean interface between cio and ipl code.
[linux-2.6/verdex.git] / include / asm-s390 / ipl.h
blob15bb0b529551fb605ad41a9d1f8df7e4c9d76eae
1 /*
2 * s390 (re)ipl support
4 * Copyright IBM Corp. 2007
5 */
7 #ifndef _ASM_S390_IPL_H
8 #define _ASM_S390_IPL_H
10 #include <asm/types.h>
12 #define IPL_PARMBLOCK_ORIGIN 0x2000
14 #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \
15 sizeof(struct ipl_block_fcp))
17 #define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8)
19 #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \
20 sizeof(struct ipl_block_ccw))
22 #define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8)
24 #define IPL_MAX_SUPPORTED_VERSION (0)
26 #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \
27 IPL_PARMBLOCK_ORIGIN)
28 #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len)
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));
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));
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));
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));
77 * IPL validity flags
79 extern u32 ipl_flags;
81 extern u32 dump_prefix_page;
82 extern void do_reipl(void);
83 extern void ipl_save_parameters(void);
85 enum {
86 IPL_DEVNO_VALID = 1,
87 IPL_PARMBLOCK_VALID = 2,
88 IPL_NSS_VALID = 4,
92 * DIAG 308 support
94 enum diag308_subcode {
95 DIAG308_REL_HSA = 2,
96 DIAG308_IPL = 3,
97 DIAG308_DUMP = 4,
98 DIAG308_SET = 5,
99 DIAG308_STORE = 6,
102 enum diag308_ipl_type {
103 DIAG308_IPL_TYPE_FCP = 0,
104 DIAG308_IPL_TYPE_CCW = 2,
107 enum diag308_opt {
108 DIAG308_IPL_OPT_IPL = 0x10,
109 DIAG308_IPL_OPT_DUMP = 0x20,
112 enum diag308_rc {
113 DIAG308_RC_OK = 1,
116 extern int diag308(unsigned long subcode, void *addr);
118 #endif /* _ASM_S390_IPL_H */