blob: 15bb0b529551fb605ad41a9d1f8df7e4c9d76eae [file] [log] [blame]
Michael Holzheu46b05d22007-02-21 10:55:21 +01001/*
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
Michael Holzheufbb04f32007-03-19 13:19:03 +010017#define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8)
18
Michael Holzheu46b05d22007-02-21 10:55:21 +010019#define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \
20 sizeof(struct ipl_block_ccw))
21
Michael Holzheufbb04f32007-03-19 13:19:03 +010022#define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8)
23
Michael Holzheu46b05d22007-02-21 10:55:21 +010024#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
30struct 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
40struct 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
57struct 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;
Michael Holzheufbb04f32007-03-19 13:19:03 +010065 u8 reserved4[80];
Michael Holzheu46b05d22007-02-21 10:55:21 +010066} __attribute__((packed));
67
68struct 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/*
Heiko Carstens6fc321f2007-04-27 16:01:25 +020077 * IPL validity flags
Michael Holzheu46b05d22007-02-21 10:55:21 +010078 */
79extern u32 ipl_flags;
Michael Holzheu46b05d22007-02-21 10:55:21 +010080
Heiko Carstensc5dd8582007-03-05 23:35:43 +010081extern u32 dump_prefix_page;
Michael Holzheu46b05d22007-02-21 10:55:21 +010082extern void do_reipl(void);
83extern void ipl_save_parameters(void);
84
85enum {
86 IPL_DEVNO_VALID = 1,
87 IPL_PARMBLOCK_VALID = 2,
88 IPL_NSS_VALID = 4,
89};
90
91/*
92 * DIAG 308 support
93 */
94enum diag308_subcode {
95 DIAG308_REL_HSA = 2,
96 DIAG308_IPL = 3,
97 DIAG308_DUMP = 4,
98 DIAG308_SET = 5,
99 DIAG308_STORE = 6,
100};
101
102enum diag308_ipl_type {
103 DIAG308_IPL_TYPE_FCP = 0,
104 DIAG308_IPL_TYPE_CCW = 2,
105};
106
107enum diag308_opt {
108 DIAG308_IPL_OPT_IPL = 0x10,
109 DIAG308_IPL_OPT_DUMP = 0x20,
110};
111
112enum diag308_rc {
113 DIAG308_RC_OK = 1,
114};
115
116extern int diag308(unsigned long subcode, void *addr);
117
118#endif /* _ASM_S390_IPL_H */