TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | EFI_ATA_DMA_PRD |
struct | EFI_ATA_TRANSFER_MODE |
struct | EFI_ATA_DRIVE_PARMS |
struct | EFI_IDE_REGISTERS |
Macros | |
#define | BMIC_NREAD BIT3 |
#define | BMIC_START BIT0 |
#define | BMIS_INTERRUPT BIT2 |
#define | BMIS_ERROR BIT1 |
#define | BMIC_OFFSET 0x00 |
#define | BMIS_OFFSET 0x02 |
#define | BMID_OFFSET 0x04 |
#define | EFI_ATA_MODE_DEFAULT_PIO 0x00 |
#define | EFI_ATA_MODE_FLOW_PIO 0x01 |
#define | EFI_ATA_MODE_MDMA 0x04 |
#define | EFI_ATA_MODE_UDMA 0x08 |
#define | IDE_PRIMARY_OPERATING_MODE BIT0 |
#define | IDE_PRIMARY_PROGRAMMABLE_INDICATOR BIT1 |
#define | IDE_SECONDARY_OPERATING_MODE BIT2 |
#define | IDE_SECONDARY_PROGRAMMABLE_INDICATOR BIT3 |
Enumerations | |
enum | EFI_IDE_CHANNEL { EfiIdePrimary = 0 , EfiIdeSecondary = 1 , EfiIdeMaxChannel = 2 , IdePrimary = 0 , IdeSecondary = 1 , IdeMaxChannel = 2 } |
enum | EFI_IDE_DEVICE { EfiIdeMaster = 0 , EfiIdeSlave = 1 , EfiIdeMaxDevice = 2 , IdeMaster = 0 , IdeSlave = 1 , IdeMaxDevice = 2 } |
enum | EFI_ATA_PIO_MODE { EfiAtaPioModeBelow2 , EfiAtaPioMode2 , EfiAtaPioMode3 , EfiAtaPioMode4 } |
enum | EFI_ATA_MDMA_MODE { EfiAtaMdmaMode0 , EfiAtaMdmaMode1 , EfiAtaMdmaMode2 } |
enum | EFI_ATA_UDMA_MODE { EfiAtaUdmaMode0 , EfiAtaUdmaMode1 , EfiAtaUdmaMode2 , EfiAtaUdmaMode3 , EfiAtaUdmaMode4 , EfiAtaUdmaMode5 } |
Functions | |
EFI_STATUS EFIAPI | GetIdeRegisterIoAddr (IN EFI_PCI_IO_PROTOCOL *PciIo, IN OUT EFI_IDE_REGISTERS *IdeRegisters) |
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) |
Header file for IDE mode of ATA host controller.
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file IdeMode.h.
enum EFI_ATA_PIO_MODE |
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 | ||
) |
This function is used to send out ATAPI commands conforms to the Packet Command with PIO Data In Protocol.
[in] | PciIo | Pointer to the EFI_PCI_IO_PROTOCOL instance |
[in] | IdeRegisters | Pointer to EFI_IDE_REGISTERS which is used to store the IDE i/o port registers' base addresses |
[in] | Channel | The channel number of device. |
[in] | Device | The device number of device. |
[in] | Packet | A pointer to EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET data structure. |
EFI_SUCCESS | send out the ATAPI packet command successfully and device sends data successfully. |
EFI_DEVICE_ERROR | the device failed to send data. |
EFI_STATUS EFIAPI GetIdeRegisterIoAddr | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN OUT EFI_IDE_REGISTERS * | IdeRegisters | ||
) |
Get IDE i/o port registers' base addresses by mode.
In 'Compatibility' mode, use fixed addresses. In Native-PCI mode, get base addresses from BARs in the PCI IDE controller's Configuration Space.
The steps to get IDE i/o port registers' base addresses for each channel as follows:
Table 1. Compatibility resource mappings
b) In Native-PCI mode, IDE registers are mapped into IO space using the BARs in IDE controller's PCI Configuration Space, shown in the Table 2 below.
| | Command Block | Control Block | | Channel | Registers | Registers | |___________|___________________|___________________| | Primary | BAR at offset 0x10| BAR at offset 0x14| |___________|___________________|___________________| | Secondary | BAR at offset 0x18| BAR at offset 0x1C| |___________|___________________|___________________|
Table 2. BARs for Register Mapping
[in] | PciIo | Pointer to the EFI_PCI_IO_PROTOCOL instance |
[in,out] | IdeRegisters | Pointer to EFI_IDE_REGISTERS which is used to store the IDE i/o port registers' base addresses |
EFI_UNSUPPORTED | Return this value when the BARs is not IO type |
EFI_SUCCESS | Get the Base address successfully |
Other | Read the pci configuration data error |