blob: f1959732b6fdeb731608eea88da206c97ade05c1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * include/asm-s390/setup.h
3 *
4 * S390 version
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 */
7
8#ifndef _ASM_S390_SETUP_H
9#define _ASM_S390_SETUP_H
10
Heiko Carstens0defa3c2006-02-11 17:56:03 -080011#ifdef __KERNEL__
12
Heiko Carstens1e8e3382005-10-30 15:00:11 -080013#include <asm/types.h>
14
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#define PARMAREA 0x10400
16#define COMMAND_LINE_SIZE 896
Linus Torvalds1da177e2005-04-16 15:20:36 -070017#define MEMORY_CHUNKS 16 /* max 0x7fff */
Heiko Carstens1e8e3382005-10-30 15:00:11 -080018#define IPL_PARMBLOCK_ORIGIN 0x2000
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
20#ifndef __ASSEMBLY__
21
22#ifndef __s390x__
23#define IPL_DEVICE (*(unsigned long *) (0x10404))
24#define INITRD_START (*(unsigned long *) (0x1040C))
25#define INITRD_SIZE (*(unsigned long *) (0x10414))
26#else /* __s390x__ */
27#define IPL_DEVICE (*(unsigned long *) (0x10400))
28#define INITRD_START (*(unsigned long *) (0x10408))
29#define INITRD_SIZE (*(unsigned long *) (0x10410))
30#endif /* __s390x__ */
31#define COMMAND_LINE ((char *) (0x10480))
32
33/*
34 * Machine features detected in head.S
35 */
36extern unsigned long machine_flags;
37
38#define MACHINE_IS_VM (machine_flags & 1)
39#define MACHINE_IS_P390 (machine_flags & 4)
40#define MACHINE_HAS_MVPG (machine_flags & 16)
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#define MACHINE_HAS_IDTE (machine_flags & 128)
42
43#ifndef __s390x__
44#define MACHINE_HAS_IEEE (machine_flags & 2)
45#define MACHINE_HAS_CSP (machine_flags & 8)
Heiko Carstensabdba612006-07-12 16:39:58 +020046#define MACHINE_HAS_DIAG44 (1)
Gerald Schaefer6c2a9e62006-09-20 15:59:44 +020047#define MACHINE_HAS_MVCOS (0)
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#else /* __s390x__ */
49#define MACHINE_HAS_IEEE (1)
50#define MACHINE_HAS_CSP (1)
Heiko Carstensabdba612006-07-12 16:39:58 +020051#define MACHINE_HAS_DIAG44 (machine_flags & 32)
Gerald Schaefer6c2a9e62006-09-20 15:59:44 +020052#define MACHINE_HAS_MVCOS (machine_flags & 512)
Linus Torvalds1da177e2005-04-16 15:20:36 -070053#endif /* __s390x__ */
54
55
56#define MACHINE_HAS_SCLP (!MACHINE_IS_P390)
57
58/*
59 * Console mode. Override with conmode=
60 */
61extern unsigned int console_mode;
62extern unsigned int console_devno;
63extern unsigned int console_irq;
64
65#define CONSOLE_IS_UNDEFINED (console_mode == 0)
66#define CONSOLE_IS_SCLP (console_mode == 1)
67#define CONSOLE_IS_3215 (console_mode == 2)
68#define CONSOLE_IS_3270 (console_mode == 3)
69#define SET_CONSOLE_SCLP do { console_mode = 1; } while (0)
70#define SET_CONSOLE_3215 do { console_mode = 2; } while (0)
71#define SET_CONSOLE_3270 do { console_mode = 3; } while (0)
72
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020073
74struct ipl_list_hdr {
75 u32 len;
76 u8 reserved1[3];
Heiko Carstens1e8e3382005-10-30 15:00:11 -080077 u8 version;
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020078 u32 blk0_len;
79 u8 pbt;
80 u8 flags;
81 u16 reserved2;
Heiko Carstens1e8e3382005-10-30 15:00:11 -080082} __attribute__((packed));
83
84struct ipl_block_fcp {
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020085 u8 reserved1[313-1];
86 u8 opt;
87 u8 reserved2[3];
88 u16 reserved3;
Heiko Carstens1e8e3382005-10-30 15:00:11 -080089 u16 devno;
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020090 u8 reserved4[4];
Heiko Carstens1e8e3382005-10-30 15:00:11 -080091 u64 wwpn;
92 u64 lun;
93 u32 bootprog;
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020094 u8 reserved5[12];
Heiko Carstens1e8e3382005-10-30 15:00:11 -080095 u64 br_lba;
96 u32 scp_data_len;
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020097 u8 reserved6[260];
Heiko Carstens1e8e3382005-10-30 15:00:11 -080098 u8 scp_data[];
99} __attribute__((packed));
100
Michael Holzheuff6b8ea2006-09-20 15:58:49 +0200101struct ipl_block_ccw {
102 u8 load_param[8];
103 u8 reserved1[84];
104 u8 reserved2[2];
105 u16 devno;
106 u8 vm_flags;
107 u8 reserved3[3];
108 u32 vm_parm_len;
Heiko Carstens1e8e3382005-10-30 15:00:11 -0800109} __attribute__((packed));
110
Michael Holzheuff6b8ea2006-09-20 15:58:49 +0200111struct ipl_parameter_block {
112 struct ipl_list_hdr hdr;
113 union {
114 struct ipl_block_fcp fcp;
115 struct ipl_block_ccw ccw;
116 } ipl_info;
117} __attribute__((packed));
Heiko Carstens1e8e3382005-10-30 15:00:11 -0800118
Michael Holzheuff6b8ea2006-09-20 15:58:49 +0200119#define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \
120 sizeof(struct ipl_block_fcp))
121
122#define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \
123 sizeof(struct ipl_block_ccw))
124
125#define IPL_MAX_SUPPORTED_VERSION (0)
Heiko Carstens1e8e3382005-10-30 15:00:11 -0800126
127/*
128 * IPL validity flags and parameters as detected in head.S
129 */
Heiko Carstense87bfe52006-09-20 15:59:15 +0200130extern u32 ipl_flags;
Heiko Carstens1e8e3382005-10-30 15:00:11 -0800131extern u16 ipl_devno;
132
Michael Holzheuff6b8ea2006-09-20 15:58:49 +0200133void do_reipl(void);
134
Heiko Carstense87bfe52006-09-20 15:59:15 +0200135enum {
136 IPL_DEVNO_VALID = 1,
137 IPL_PARMBLOCK_VALID = 2,
138};
Heiko Carstens1e8e3382005-10-30 15:00:11 -0800139
140#define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \
141 IPL_PARMBLOCK_ORIGIN)
Michael Holzheuff6b8ea2006-09-20 15:58:49 +0200142#define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len)
Heiko Carstens1e8e3382005-10-30 15:00:11 -0800143
Heiko Carstens0defa3c2006-02-11 17:56:03 -0800144#else /* __ASSEMBLY__ */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145
146#ifndef __s390x__
147#define IPL_DEVICE 0x10404
148#define INITRD_START 0x1040C
149#define INITRD_SIZE 0x10414
150#else /* __s390x__ */
151#define IPL_DEVICE 0x10400
152#define INITRD_START 0x10408
153#define INITRD_SIZE 0x10410
154#endif /* __s390x__ */
155#define COMMAND_LINE 0x10480
156
Heiko Carstens0defa3c2006-02-11 17:56:03 -0800157#endif /* __ASSEMBLY__ */
158#endif /* __KERNEL__ */
159#endif /* _ASM_S390_SETUP_H */