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
12typedef enum {
13 EfiIdePrimary = 0,
14 EfiIdeSecondary = 1,
15 EfiIdeMaxChannel = 2
16} EFI_IDE_CHANNEL;
17
18typedef enum {
19 EfiIdeMaster = 0,
20 EfiIdeSlave = 1,
21 EfiIdeMaxDevice = 2
22} EFI_IDE_DEVICE;
23
27typedef enum {
28 EfiAtaPioModeBelow2,
29 EfiAtaPioMode2,
30 EfiAtaPioMode3,
31 EfiAtaPioMode4
33
34//
35// Multi word DMA definition
36//
37typedef enum {
38 EfiAtaMdmaMode0,
39 EfiAtaMdmaMode1,
40 EfiAtaMdmaMode2
41} EFI_ATA_MDMA_MODE;
42
43//
44// UDMA mode definition
45//
46typedef 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
75typedef struct {
76 UINT32 RegionBaseAddr;
77 UINT16 ByteCount;
78 UINT16 EndOfTable;
80
81typedef struct {
82 UINT8 ModeNumber : 3;
83 UINT8 ModeCategory : 5;
85
86typedef struct {
87 UINT8 Sector;
88 UINT8 Heads;
89 UINT8 MultipleSector;
91
92//
93// IDE registers set
94//
95typedef 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;
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
166EFIAPI
168 IN EFI_PCI_IO_PROTOCOL *PciIo,
169 IN OUT EFI_IDE_REGISTERS *IdeRegisters
170 );
171
189EFIAPI
191 IN EFI_PCI_IO_PROTOCOL *PciIo,
192 IN EFI_IDE_REGISTERS *IdeRegisters,
193 IN UINT8 Channel,
194 IN UINT8 Device,
196 );
197
198#endif
EFI_STATUS EFIAPI GetIdeRegisterIoAddr(IN EFI_PCI_IO_PROTOCOL *PciIo, IN OUT EFI_IDE_REGISTERS *IdeRegisters)
Definition: IdeMode.c:728
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
Definition: IdeMode.h:27
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29