Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / include / asm-s390 / setup.h
1 /*
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
11 #ifdef __KERNEL__
12
13 #include <asm/types.h>
14
15 #define PARMAREA                0x10400
16 #define COMMAND_LINE_SIZE       896
17 #define RAMDISK_ORIGIN          0x800000
18 #define RAMDISK_SIZE            0x800000
19 #define MEMORY_CHUNKS           16      /* max 0x7fff */
20 #define IPL_PARMBLOCK_ORIGIN    0x2000
21
22 #ifndef __ASSEMBLY__
23
24 #ifndef __s390x__
25 #define IPL_DEVICE        (*(unsigned long *)  (0x10404))
26 #define INITRD_START      (*(unsigned long *)  (0x1040C))
27 #define INITRD_SIZE       (*(unsigned long *)  (0x10414))
28 #else /* __s390x__ */
29 #define IPL_DEVICE        (*(unsigned long *)  (0x10400))
30 #define INITRD_START      (*(unsigned long *)  (0x10408))
31 #define INITRD_SIZE       (*(unsigned long *)  (0x10410))
32 #endif /* __s390x__ */
33 #define COMMAND_LINE      ((char *)            (0x10480))
34
35 /*
36  * Machine features detected in head.S
37  */
38 extern unsigned long machine_flags;
39
40 #define MACHINE_IS_VM           (machine_flags & 1)
41 #define MACHINE_IS_P390         (machine_flags & 4)
42 #define MACHINE_HAS_MVPG        (machine_flags & 16)
43 #define MACHINE_HAS_IDTE        (machine_flags & 128)
44
45 #ifndef __s390x__
46 #define MACHINE_HAS_IEEE        (machine_flags & 2)
47 #define MACHINE_HAS_CSP         (machine_flags & 8)
48 #define MACHINE_HAS_DIAG44      (1)
49 #else /* __s390x__ */
50 #define MACHINE_HAS_IEEE        (1)
51 #define MACHINE_HAS_CSP         (1)
52 #define MACHINE_HAS_DIAG44      (machine_flags & 32)
53 #endif /* __s390x__ */
54
55
56 #define MACHINE_HAS_SCLP        (!MACHINE_IS_P390)
57
58 /*
59  * Console mode. Override with conmode=
60  */
61 extern unsigned int console_mode;
62 extern unsigned int console_devno;
63 extern 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
73 struct ipl_list_header {
74         u32 length;
75         u8  reserved[3];
76         u8  version;
77 } __attribute__((packed));
78
79 struct ipl_block_fcp {
80         u32 length;
81         u8  pbt;
82         u8  reserved1[322-1];
83         u16 devno;
84         u8  reserved2[4];
85         u64 wwpn;
86         u64 lun;
87         u32 bootprog;
88         u8  reserved3[12];
89         u64 br_lba;
90         u32 scp_data_len;
91         u8  reserved4[260];
92         u8  scp_data[];
93 } __attribute__((packed));
94
95 struct ipl_parameter_block {
96         union {
97                 u32 length;
98                 struct ipl_list_header header;
99         } hdr;
100         struct ipl_block_fcp fcp;
101 } __attribute__((packed));
102
103 #define IPL_MAX_SUPPORTED_VERSION (0)
104
105 #define IPL_TYPE_FCP (0)
106
107 /*
108  * IPL validity flags and parameters as detected in head.S
109  */
110 extern u32 ipl_parameter_flags;
111 extern u16 ipl_devno;
112
113 #define IPL_DEVNO_VALID         (ipl_parameter_flags & 1)
114 #define IPL_PARMBLOCK_VALID     (ipl_parameter_flags & 2)
115
116 #define IPL_PARMBLOCK_START     ((struct ipl_parameter_block *) \
117                                  IPL_PARMBLOCK_ORIGIN)
118 #define IPL_PARMBLOCK_SIZE      (IPL_PARMBLOCK_START->hdr.length)
119
120 #else /* __ASSEMBLY__ */
121
122 #ifndef __s390x__
123 #define IPL_DEVICE        0x10404
124 #define INITRD_START      0x1040C
125 #define INITRD_SIZE       0x10414
126 #else /* __s390x__ */
127 #define IPL_DEVICE        0x10400
128 #define INITRD_START      0x10408
129 #define INITRD_SIZE       0x10410
130 #endif /* __s390x__ */
131 #define COMMAND_LINE      0x10480
132
133 #endif /* __ASSEMBLY__ */
134 #endif /* __KERNEL__ */
135 #endif /* _ASM_S390_SETUP_H */