Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
422 giacomo 1
/*
2
 * linux/include/asm-i386/edd.h
3
 *  Copyright (C) 2002 Dell Inc.
4
 *  by Matt Domsch <Matt_Domsch@dell.com>
5
 *
6
 * structures and definitions for the int 13h, ax={41,48}h
7
 * BIOS Enhanced Disk Drive Services
8
 * This is based on the T13 group document D1572 Revision 0 (August 14 2002)
9
 * available at http://www.t13.org/docs2002/d1572r0.pdf.  It is
10
 * very similar to D1484 Revision 3 http://www.t13.org/docs2002/d1484r3.pdf
11
 *
12
 * In a nutshell, arch/i386/boot/setup.S populates a scratch table
13
 * in the empty_zero_block that contains a list of BIOS-enumerated
14
 * boot devices.
15
 * In arch/i386/kernel/setup.c, this information is
16
 * transferred into the edd structure, and in arch/i386/kernel/edd.c, that
17
 * information is used to identify BIOS boot disk.  The code in setup.S
18
 * is very sensitive to the size of these structures.
19
 *
20
 * This program is free software; you can redistribute it and/or modify
21
 * it under the terms of the GNU General Public License v2.0 as published by
22
 * the Free Software Foundation
23
 *
24
 * This program is distributed in the hope that it will be useful,
25
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
 * GNU General Public License for more details.
28
 *
29
 */
30
#ifndef _ASM_I386_EDD_H
31
#define _ASM_I386_EDD_H
32
 
33
#define EDDNR 0x1e9             /* addr of number of edd_info structs at EDDBUF
34
                                   in empty_zero_block - treat this as 1 byte  */
35
#define EDDBUF  0x600           /* addr of edd_info structs in empty_zero_block */
36
#define EDDMAXNR 6              /* number of edd_info structs starting at EDDBUF  */
37
#define EDDEXTSIZE 4            /* change these if you muck with the structures */
38
#define EDDPARMSIZE 74
39
#define CHECKEXTENSIONSPRESENT 0x41
40
#define GETDEVICEPARAMETERS 0x48
41
#define EDDMAGIC1 0x55AA
42
#define EDDMAGIC2 0xAA55
43
 
44
#ifndef __ASSEMBLY__
45
 
46
#define EDD_EXT_FIXED_DISK_ACCESS           (1 << 0)
47
#define EDD_EXT_DEVICE_LOCKING_AND_EJECTING (1 << 1)
48
#define EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT (1 << 2)
49
#define EDD_EXT_64BIT_EXTENSIONS            (1 << 3)
50
 
51
#define EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT (1 << 0)
52
#define EDD_INFO_GEOMETRY_VALID                (1 << 1)
53
#define EDD_INFO_REMOVABLE                     (1 << 2)
54
#define EDD_INFO_WRITE_VERIFY                  (1 << 3)
55
#define EDD_INFO_MEDIA_CHANGE_NOTIFICATION     (1 << 4)
56
#define EDD_INFO_LOCKABLE                      (1 << 5)
57
#define EDD_INFO_NO_MEDIA_PRESENT              (1 << 6)
58
#define EDD_INFO_USE_INT13_FN50                (1 << 7)
59
 
60
struct edd_device_params {
61
        u16 length;
62
        u16 info_flags;
63
        u32 num_default_cylinders;
64
        u32 num_default_heads;
65
        u32 sectors_per_track;
66
        u64 number_of_sectors;
67
        u16 bytes_per_sector;
68
        u32 dpte_ptr;           /* 0xFFFFFFFF for our purposes */
69
        u16 key;                /* = 0xBEDD */
70
        u8 device_path_info_length;     /* = 44 */
71
        u8 reserved2;
72
        u16 reserved3;
73
        u8 host_bus_type[4];
74
        u8 interface_type[8];
75
        union {
76
                struct {
77
                        u16 base_address;
78
                        u16 reserved1;
79
                        u32 reserved2;
80
                } __attribute__ ((packed)) isa;
81
                struct {
82
                        u8 bus;
83
                        u8 slot;
84
                        u8 function;
85
                        u8 channel;
86
                        u32 reserved;
87
                } __attribute__ ((packed)) pci;
88
                /* pcix is same as pci */
89
                struct {
90
                        u64 reserved;
91
                } __attribute__ ((packed)) ibnd;
92
                struct {
93
                        u64 reserved;
94
                } __attribute__ ((packed)) xprs;
95
                struct {
96
                        u64 reserved;
97
                } __attribute__ ((packed)) htpt;
98
                struct {
99
                        u64 reserved;
100
                } __attribute__ ((packed)) unknown;
101
        } interface_path;
102
        union {
103
                struct {
104
                        u8 device;
105
                        u8 reserved1;
106
                        u16 reserved2;
107
                        u32 reserved3;
108
                        u64 reserved4;
109
                } __attribute__ ((packed)) ata;
110
                struct {
111
                        u8 device;
112
                        u8 lun;
113
                        u8 reserved1;
114
                        u8 reserved2;
115
                        u32 reserved3;
116
                        u64 reserved4;
117
                } __attribute__ ((packed)) atapi;
118
                struct {
119
                        u16 id;
120
                        u64 lun;
121
                        u16 reserved1;
122
                        u32 reserved2;
123
                } __attribute__ ((packed)) scsi;
124
                struct {
125
                        u64 serial_number;
126
                        u64 reserved;
127
                } __attribute__ ((packed)) usb;
128
                struct {
129
                        u64 eui;
130
                        u64 reserved;
131
                } __attribute__ ((packed)) i1394;
132
                struct {
133
                        u64 wwid;
134
                        u64 lun;
135
                } __attribute__ ((packed)) fibre;
136
                struct {
137
                        u64 identity_tag;
138
                        u64 reserved;
139
                } __attribute__ ((packed)) i2o;
140
                struct {
141
                        u32 array_number;
142
                        u32 reserved1;
143
                        u64 reserved2;
144
                } __attribute__ ((packed)) raid;
145
                struct {
146
                        u8 device;
147
                        u8 reserved1;
148
                        u16 reserved2;
149
                        u32 reserved3;
150
                        u64 reserved4;
151
                } __attribute__ ((packed)) sata;
152
                struct {
153
                        u64 reserved1;
154
                        u64 reserved2;
155
                } __attribute__ ((packed)) unknown;
156
        } device_path;
157
        u8 reserved4;
158
        u8 checksum;
159
} __attribute__ ((packed));
160
 
161
struct edd_info {
162
        u8 device;
163
        u8 version;
164
        u16 interface_support;
165
        struct edd_device_params params;
166
} __attribute__ ((packed));
167
 
168
extern struct edd_info edd[EDDMAXNR];
169
extern unsigned char eddnr;
170
#endif                          /*!__ASSEMBLY__ */
171
 
172
#endif                          /* _ASM_I386_EDD_H */