TianoCore EDK2
master
Loading...
Searching...
No Matches
IdeMode.h
Go to the documentation of this file.
1
9
#ifndef __ATA_HC_IDE_MODE_H__
10
#define __ATA_HC_IDE_MODE_H__
11
12
typedef
enum
{
13
EfiIdePrimary = 0,
14
EfiIdeSecondary = 1,
15
EfiIdeMaxChannel = 2
16
} EFI_IDE_CHANNEL;
17
18
typedef
enum
{
19
EfiIdeMaster = 0,
20
EfiIdeSlave = 1,
21
EfiIdeMaxDevice = 2
22
} EFI_IDE_DEVICE;
23
27
typedef
enum
{
28
EfiAtaPioModeBelow2,
29
EfiAtaPioMode2,
30
EfiAtaPioMode3,
31
EfiAtaPioMode4
32
}
EFI_ATA_PIO_MODE
;
33
34
//
35
// Multi word DMA definition
36
//
37
typedef
enum
{
38
EfiAtaMdmaMode0,
39
EfiAtaMdmaMode1,
40
EfiAtaMdmaMode2
41
} EFI_ATA_MDMA_MODE;
42
43
//
44
// UDMA mode definition
45
//
46
typedef
enum
{
47
EfiAtaUdmaMode0,
48
EfiAtaUdmaMode1,
49
EfiAtaUdmaMode2,
50
EfiAtaUdmaMode3,
51
EfiAtaUdmaMode4,
52
EfiAtaUdmaMode5
53
} EFI_ATA_UDMA_MODE;
54
55
//
56
// Bus Master Reg
57
//
58
#define BMIC_NREAD BIT3
59
#define BMIC_START BIT0
60
#define BMIS_INTERRUPT BIT2
61
#define BMIS_ERROR BIT1
62
63
#define BMIC_OFFSET 0x00
64
#define BMIS_OFFSET 0x02
65
#define BMID_OFFSET 0x04
66
67
//
68
// IDE transfer mode
69
//
70
#define EFI_ATA_MODE_DEFAULT_PIO 0x00
71
#define EFI_ATA_MODE_FLOW_PIO 0x01
72
#define EFI_ATA_MODE_MDMA 0x04
73
#define EFI_ATA_MODE_UDMA 0x08
74
75
typedef
struct
{
76
UINT32 RegionBaseAddr;
77
UINT16 ByteCount;
78
UINT16 EndOfTable;
79
}
EFI_ATA_DMA_PRD
;
80
81
typedef
struct
{
82
UINT8 ModeNumber : 3;
83
UINT8 ModeCategory : 5;
84
}
EFI_ATA_TRANSFER_MODE
;
85
86
typedef
struct
{
87
UINT8 Sector;
88
UINT8 Heads;
89
UINT8 MultipleSector;
90
}
EFI_ATA_DRIVE_PARMS
;
91
92
//
93
// IDE registers set
94
//
95
typedef
struct
{
96
UINT16 Data;
97
UINT16 ErrOrFeature;
98
UINT16 SectorCount;
99
UINT16 SectorNumber;
100
UINT16 CylinderLsb;
101
UINT16 CylinderMsb;
102
UINT16 Head;
103
UINT16 CmdOrStatus;
104
UINT16 AltOrDev;
105
106
UINT16 BusMasterBaseAddr;
107
}
EFI_IDE_REGISTERS
;
108
109
//
110
// Bit definitions in Programming Interface byte of the Class Code field
111
// in PCI IDE controller's Configuration Space
112
//
113
#define IDE_PRIMARY_OPERATING_MODE BIT0
114
#define IDE_PRIMARY_PROGRAMMABLE_INDICATOR BIT1
115
#define IDE_SECONDARY_OPERATING_MODE BIT2
116
#define IDE_SECONDARY_PROGRAMMABLE_INDICATOR BIT3
117
165
EFI_STATUS
166
EFIAPI
167
GetIdeRegisterIoAddr
(
168
IN
EFI_PCI_IO_PROTOCOL
*PciIo,
169
IN
OUT
EFI_IDE_REGISTERS
*IdeRegisters
170
);
171
188
EFI_STATUS
189
EFIAPI
190
AtaPacketCommandExecute
(
191
IN
EFI_PCI_IO_PROTOCOL
*PciIo,
192
IN
EFI_IDE_REGISTERS
*IdeRegisters,
193
IN
UINT8 Channel,
194
IN
UINT8 Device,
195
IN
EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
*Packet
196
);
197
198
#endif
GetIdeRegisterIoAddr
EFI_STATUS EFIAPI GetIdeRegisterIoAddr(IN EFI_PCI_IO_PROTOCOL *PciIo, IN OUT EFI_IDE_REGISTERS *IdeRegisters)
Definition:
IdeMode.c:728
AtaPacketCommandExecute
EFI_STATUS EFIAPI AtaPacketCommandExecute(IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_IDE_REGISTERS *IdeRegisters, IN UINT8 Channel, IN UINT8 Device, IN EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
Definition:
IdeMode.c:1806
EFI_ATA_PIO_MODE
EFI_ATA_PIO_MODE
Definition:
IdeMode.h:27
IN
#define IN
Definition:
Base.h:279
OUT
#define OUT
Definition:
Base.h:284
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
_EFI_PCI_IO_PROTOCOL
Definition:
PciIo.h:516
EFI_ATA_DMA_PRD
Definition:
IdeMode.h:75
EFI_ATA_DRIVE_PARMS
Definition:
IdeMode.h:86
EFI_ATA_TRANSFER_MODE
Definition:
IdeMode.h:81
EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
Definition:
ScsiPassThruExt.h:77
EFI_IDE_REGISTERS
Definition:
IdeMode.h:95
MdeModulePkg
Bus
Ata
AtaAtapiPassThru
IdeMode.h
Generated on Fri Nov 15 2024 18:01:08 for TianoCore EDK2 by
1.9.6