TianoCore EDK2 master
|
#include "AtaAtapiPassThru.h"
Go to the source code of this file.
Functions | |
UINT32 EFIAPI | AhciReadReg (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset) |
VOID EFIAPI | AhciWriteReg (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset, IN UINT32 Data) |
VOID EFIAPI | AhciAndReg (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset, IN UINT32 AndData) |
VOID EFIAPI | AhciOrReg (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset, IN UINT32 OrData) |
EFI_STATUS EFIAPI | AhciWaitMmioSet (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINTN Offset, IN UINT32 MaskValue, IN UINT32 TestValue, IN UINT64 Timeout) |
EFI_STATUS EFIAPI | AhciWaitMemSet (IN EFI_PHYSICAL_ADDRESS Address, IN UINT32 MaskValue, IN UINT32 TestValue, IN UINT64 Timeout) |
EFI_STATUS EFIAPI | AhciCheckMemSet (IN UINTN Address, IN UINT32 MaskValue, IN UINT32 TestValue) |
VOID EFIAPI | AhciClearPortStatus (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port) |
VOID EFIAPI | AhciDumpPortStatus (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock) |
EFI_STATUS EFIAPI | AhciEnableFisReceive (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN UINT64 Timeout) |
EFI_STATUS EFIAPI | AhciDisableFisReceive (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN UINT64 Timeout) |
VOID EFIAPI | AhciBuildCommand (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_AHCI_COMMAND_FIS *CommandFis, IN EFI_AHCI_COMMAND_LIST *CommandList, IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand OPTIONAL, IN UINT8 AtapiCommandLength, IN UINT8 CommandSlotNumber, IN OUT VOID *DataPhysicalAddr, IN UINT32 DataLength) |
VOID EFIAPI | AhciBuildCommandFis (IN OUT EFI_AHCI_COMMAND_FIS *CmdFis, IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock) |
EFI_STATUS | AhciWaitDeviceReady (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port) |
EFI_STATUS | AhciResetPort (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port) |
EFI_STATUS | AhciRecoverPortError (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port) |
BOOLEAN | AhciShouldCmdBeRetried (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port) |
EFI_STATUS | AhciCheckFisReceived (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN SATA_FIS_TYPE FisType) |
EFI_STATUS | AhciWaitUntilFisReceived (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN UINT64 Timeout, IN SATA_FIS_TYPE FisType) |
VOID | AhciPrintCommandBlock (IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock, IN UINT32 DebugLevel) |
VOID | AhciPrintStatusBlock (IN EFI_ATA_STATUS_BLOCK *AtaStatusBlock, IN UINT32 DebugLevel) |
EFI_STATUS EFIAPI | AhciPioTransfer (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand OPTIONAL, IN UINT8 AtapiCommandLength, IN BOOLEAN Read, IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock, IN OUT VOID *MemoryAddr, IN UINT32 DataCount, IN UINT64 Timeout, IN ATA_NONBLOCK_TASK *Task) |
EFI_STATUS EFIAPI | AhciDmaTransfer (IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand OPTIONAL, IN UINT8 AtapiCommandLength, IN BOOLEAN Read, IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock, IN OUT VOID *MemoryAddr, IN UINT32 DataCount, IN UINT64 Timeout, IN ATA_NONBLOCK_TASK *Task) |
EFI_STATUS EFIAPI | AhciNonDataTransfer (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand OPTIONAL, IN UINT8 AtapiCommandLength, IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock, IN UINT64 Timeout, IN ATA_NONBLOCK_TASK *Task) |
EFI_STATUS EFIAPI | AhciStopCommand (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN UINT64 Timeout) |
EFI_STATUS EFIAPI | AhciStartCommand (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN UINT8 CommandSlot, IN UINT64 Timeout) |
EFI_STATUS EFIAPI | AhciReset (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT64 Timeout) |
EFI_STATUS EFIAPI | AhciAtaSmartReturnStatusCheck (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock) |
VOID EFIAPI | AhciAtaSmartSupport (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_IDENTIFY_DATA *IdentifyData, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock) |
EFI_STATUS EFIAPI | AhciIdentify (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN OUT EFI_IDENTIFY_DATA *Buffer) |
EFI_STATUS EFIAPI | AhciIdentifyPacket (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN OUT EFI_IDENTIFY_DATA *Buffer) |
EFI_STATUS EFIAPI | AhciDeviceSetFeature (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN UINT16 Feature, IN UINT32 FeatureSpecificData, IN UINT64 Timeout) |
EFI_STATUS EFIAPI | AhciPacketCommandExecute (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet) |
EFI_STATUS EFIAPI | AhciCreateTransferDescriptor (IN EFI_PCI_IO_PROTOCOL *PciIo, IN OUT EFI_AHCI_REGISTERS *AhciRegisters) |
EFI_STATUS | AhciReadLogExt (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN OUT UINT8 *Buffer, IN UINT8 LogNumber, IN UINT8 PageNumber) |
EFI_STATUS | AhciEnableDevSlp (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_IDENTIFY_DATA *IdentifyData) |
EFI_STATUS | AhciSpinUpDisk (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN OUT EFI_IDENTIFY_DATA *IdentifyData) |
EFI_STATUS | AhciPuisEnable (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier) |
EFI_STATUS EFIAPI | AhciModeInitialization (IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance) |
The file for AHCI mode of ATA host controller.
Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file AhciMode.c.
VOID EFIAPI AhciAndReg | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT32 | Offset, | ||
IN UINT32 | AndData | ||
) |
Do AND operation with the value of AHCI Operation register.
PciIo | The PCI IO protocol instance. |
Offset | The operation register offset. |
AndData | The data used to do AND operation. |
Definition at line 86 of file AhciMode.c.
EFI_STATUS EFIAPI AhciAtaSmartReturnStatusCheck | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock | ||
) |
Send SMART Return Status command to check if the execution of SMART cmd is successful or not.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
PortMultiplier | The port multiplier port number. |
AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
EFI_SUCCESS | Successfully get the return status of S.M.A.R.T command execution. |
Others | Fail to get return status data. |
Definition at line 1729 of file AhciMode.c.
VOID EFIAPI AhciAtaSmartSupport | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN EFI_IDENTIFY_DATA * | IdentifyData, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock | ||
) |
Enable SMART command of the disk if supported.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
PortMultiplier | The port multiplier port number. |
IdentifyData | A pointer to data buffer which is used to contain IDENTIFY data. |
AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
Definition at line 1825 of file AhciMode.c.
VOID EFIAPI AhciBuildCommand | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN EFI_AHCI_COMMAND_FIS * | CommandFis, | ||
IN EFI_AHCI_COMMAND_LIST * | CommandList, | ||
IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand | OPTIONAL, | ||
IN UINT8 | AtapiCommandLength, | ||
IN UINT8 | CommandSlotNumber, | ||
IN OUT VOID * | DataPhysicalAddr, | ||
IN UINT32 | DataLength | ||
) |
Build the command list, command table and prepare the fis receiver.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
PortMultiplier | The timeout value of stop. |
CommandFis | The control fis will be used for the transfer. |
CommandList | The command list will be used for the transfer. |
AtapiCommand | The atapi command will be used for the transfer. |
AtapiCommandLength | The length of the atapi command. |
CommandSlotNumber | The command slot will be used for the transfer. |
DataPhysicalAddr | The pointer to the data buffer pci bus master address. |
DataLength | The data count to be transferred. |
Definition at line 464 of file AhciMode.c.
VOID EFIAPI AhciBuildCommandFis | ( | IN OUT EFI_AHCI_COMMAND_FIS * | CmdFis, |
IN EFI_ATA_COMMAND_BLOCK * | AtaCommandBlock | ||
) |
Build a command FIS.
CmdFis | A pointer to the EFI_AHCI_COMMAND_FIS data structure. |
AtaCommandBlock | A pointer to the AhciBuildCommandFis data structure. |
Definition at line 572 of file AhciMode.c.
EFI_STATUS AhciCheckFisReceived | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Port, | ||
IN SATA_FIS_TYPE | FisType | ||
) |
Checks if specified FIS has been received.
[in] | PciIo | Pointer to AHCI controller PciIo. |
[in] | Port | SATA port index on which to check. |
[in] | FisType | FIS type for which to check. |
EFI_SUCCESS | FIS received. |
EFI_NOT_READY | FIS not received yet. |
EFI_DEVICE_ERROR | AHCI controller reported an error on port. |
Definition at line 814 of file AhciMode.c.
EFI_STATUS EFIAPI AhciCheckMemSet | ( | IN UINTN | Address, |
IN UINT32 | MaskValue, | ||
IN UINT32 | TestValue | ||
) |
Check the memory status to the test value.
[in] | Address | The memory address to test. |
[in] | MaskValue | The mask value of memory. |
[in] | TestValue | The test value of memory. |
EFI_NOT_READY | The memory is not set. |
EFI_SUCCESS | The memory is correct set. |
Definition at line 258 of file AhciMode.c.
VOID EFIAPI AhciClearPortStatus | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Port | ||
) |
Clear the port interrupt and error status. It will also clear HBA interrupt status.
PciIo | The PCI IO protocol instance. |
Port | The number of port. |
Definition at line 287 of file AhciMode.c.
EFI_STATUS EFIAPI AhciCreateTransferDescriptor | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN OUT EFI_AHCI_REGISTERS * | AhciRegisters | ||
) |
Allocate transfer-related data struct which is used at AHCI mode.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Definition at line 2212 of file AhciMode.c.
EFI_STATUS EFIAPI AhciDeviceSetFeature | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN UINT16 | Feature, | ||
IN UINT32 | FeatureSpecificData, | ||
IN UINT64 | Timeout | ||
) |
Send SET FEATURE cmd on specific device.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
PortMultiplier | The port multiplier port number. |
Feature | The data to send Feature register. |
FeatureSpecificData | The specific data for SET FEATURE cmd. |
Timeout | The timeout value of SET FEATURE cmd, uses 100ns as a unit. |
EFI_DEVICE_ERROR | The cmd abort with error occurs. |
EFI_TIMEOUT | The operation is time out. |
EFI_UNSUPPORTED | The device is not ready for executing. |
EFI_SUCCESS | The cmd executes successfully. |
Definition at line 2068 of file AhciMode.c.
EFI_STATUS EFIAPI AhciDisableFisReceive | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Port, | ||
IN UINT64 | Timeout | ||
) |
Disable the FIS running for giving port.
PciIo | The PCI IO protocol instance. |
Port | The number of port. |
Timeout | The timeout value of disabling FIS, uses 100ns as a unit. |
EFI_DEVICE_ERROR | The FIS disable setting fails. |
EFI_TIMEOUT | The FIS disable setting is time out. |
EFI_UNSUPPORTED | The port is in running state. |
EFI_SUCCESS | The FIS disable successfully. |
Definition at line 409 of file AhciMode.c.
EFI_STATUS EFIAPI AhciDmaTransfer | ( | IN ATA_ATAPI_PASS_THRU_INSTANCE * | Instance, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand | OPTIONAL, | ||
IN UINT8 | AtapiCommandLength, | ||
IN BOOLEAN | Read, | ||
IN EFI_ATA_COMMAND_BLOCK * | AtaCommandBlock, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock, | ||
IN OUT VOID * | MemoryAddr, | ||
IN UINT32 | DataCount, | ||
IN UINT64 | Timeout, | ||
IN ATA_NONBLOCK_TASK * | Task | ||
) |
Start a DMA data transfer on specific port
[in] | Instance | The ATA_ATAPI_PASS_THRU_INSTANCE protocol instance. |
[in] | AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
[in] | Port | The number of port. |
[in] | PortMultiplier | The timeout value of stop. |
[in] | AtapiCommand | The atapi command will be used for the transfer. |
[in] | AtapiCommandLength | The length of the atapi command. |
[in] | Read | The transfer direction. |
[in] | AtaCommandBlock | The EFI_ATA_COMMAND_BLOCK data. |
[in,out] | AtaStatusBlock | The EFI_ATA_STATUS_BLOCK data. |
[in,out] | MemoryAddr | The pointer to the data buffer. |
[in] | DataCount | The data count to be transferred. |
[in] | Timeout | The timeout value of non data transfer, uses 100ns as a unit. |
[in] | Task | Optional. Pointer to the ATA_NONBLOCK_TASK used by non-blocking mode. |
EFI_DEVICE_ERROR | The DMA data transfer abort with error occurs. |
EFI_TIMEOUT | The operation is time out. |
EFI_UNSUPPORTED | The device is not ready for transfer. |
EFI_SUCCESS | The DMA data transfer executes successfully. |
Definition at line 1158 of file AhciMode.c.
VOID EFIAPI AhciDumpPortStatus | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock | ||
) |
This function is used to dump the Status Registers and if there is ERR bit set in the Status Register, the Error Register's value is also be dumped.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
Definition at line 324 of file AhciMode.c.
EFI_STATUS AhciEnableDevSlp | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN EFI_IDENTIFY_DATA * | IdentifyData | ||
) |
Enable DEVSLP of the disk if supported.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
PortMultiplier | The multiplier of port. |
IdentifyData | A pointer to data buffer which is used to contain IDENTIFY data. |
EFI_SUCCESS | The DEVSLP is enabled per policy successfully. |
EFI_UNSUPPORTED | The DEVSLP isn't supported by the controller/device and policy requires to enable it. |
Definition at line 2528 of file AhciMode.c.
EFI_STATUS EFIAPI AhciEnableFisReceive | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Port, | ||
IN UINT64 | Timeout | ||
) |
Enable the FIS running for giving port.
PciIo | The PCI IO protocol instance. |
Port | The number of port. |
Timeout | The timeout value of enabling FIS, uses 100ns as a unit. |
EFI_DEVICE_ERROR | The FIS enable setting fails. |
EFI_TIMEOUT | The FIS enable setting is time out. |
EFI_SUCCESS | The FIS enable successfully. |
Definition at line 380 of file AhciMode.c.
EFI_STATUS EFIAPI AhciIdentify | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN OUT EFI_IDENTIFY_DATA * | Buffer | ||
) |
Send Buffer cmd to specific device.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
PortMultiplier | The port multiplier port number. |
Buffer | The data buffer to store IDENTIFY PACKET data. |
EFI_DEVICE_ERROR | The cmd abort with error occurs. |
EFI_TIMEOUT | The operation is time out. |
EFI_UNSUPPORTED | The device is not ready for executing. |
EFI_SUCCESS | The cmd executes successfully. |
Definition at line 1950 of file AhciMode.c.
EFI_STATUS EFIAPI AhciIdentifyPacket | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN OUT EFI_IDENTIFY_DATA * | Buffer | ||
) |
Send Buffer cmd to specific device.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
PortMultiplier | The port multiplier port number. |
Buffer | The data buffer to store IDENTIFY PACKET data. |
EFI_DEVICE_ERROR | The cmd abort with error occurs. |
EFI_TIMEOUT | The operation is time out. |
EFI_UNSUPPORTED | The device is not ready for executing. |
EFI_SUCCESS | The cmd executes successfully. |
Definition at line 2008 of file AhciMode.c.
EFI_STATUS EFIAPI AhciModeInitialization | ( | IN ATA_ATAPI_PASS_THRU_INSTANCE * | Instance | ) |
Initialize ATA host controller at AHCI mode.
The function is designed to initialize ATA host controller.
[in] | Instance | A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance. |
Definition at line 2863 of file AhciMode.c.
EFI_STATUS EFIAPI AhciNonDataTransfer | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand | OPTIONAL, | ||
IN UINT8 | AtapiCommandLength, | ||
IN EFI_ATA_COMMAND_BLOCK * | AtaCommandBlock, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock, | ||
IN UINT64 | Timeout, | ||
IN ATA_NONBLOCK_TASK * | Task | ||
) |
Start a non data transfer on specific port.
[in] | PciIo | The PCI IO protocol instance. |
[in] | AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
[in] | Port | The number of port. |
[in] | PortMultiplier | The timeout value of stop. |
[in] | AtapiCommand | The atapi command will be used for the transfer. |
[in] | AtapiCommandLength | The length of the atapi command. |
[in] | AtaCommandBlock | The EFI_ATA_COMMAND_BLOCK data. |
[in,out] | AtaStatusBlock | The EFI_ATA_STATUS_BLOCK data. |
[in] | Timeout | The timeout value of non data transfer, uses 100ns as a unit. |
[in] | Task | Optional. Pointer to the ATA_NONBLOCK_TASK used by non-blocking mode. |
EFI_DEVICE_ERROR | The non data transfer abort with error occurs. |
EFI_TIMEOUT | The operation is time out. |
EFI_UNSUPPORTED | The device is not ready for transfer. |
EFI_SUCCESS | The non data transfer executes successfully. |
Definition at line 1424 of file AhciMode.c.
VOID EFIAPI AhciOrReg | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT32 | Offset, | ||
IN UINT32 | OrData | ||
) |
Do OR operation with the value of AHCI Operation register.
PciIo | The PCI IO protocol instance. |
Offset | The operation register offset. |
OrData | The data used to do OR operation. |
Definition at line 113 of file AhciMode.c.
EFI_STATUS EFIAPI AhciPacketCommandExecute | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
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 Protocol.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
PortMultiplier | The number of port multiplier. |
Packet | A pointer to EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET structure. |
EFI_SUCCESS | send out the ATAPI packet command successfully and device sends data successfully. |
EFI_DEVICE_ERROR | the device failed to send data. |
Definition at line 2126 of file AhciMode.c.
EFI_STATUS EFIAPI AhciPioTransfer | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand | OPTIONAL, | ||
IN UINT8 | AtapiCommandLength, | ||
IN BOOLEAN | Read, | ||
IN EFI_ATA_COMMAND_BLOCK * | AtaCommandBlock, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock, | ||
IN OUT VOID * | MemoryAddr, | ||
IN UINT32 | DataCount, | ||
IN UINT64 | Timeout, | ||
IN ATA_NONBLOCK_TASK * | Task | ||
) |
Start a PIO data transfer on specific port.
[in] | PciIo | The PCI IO protocol instance. |
[in] | AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
[in] | Port | The number of port. |
[in] | PortMultiplier | The timeout value of stop. |
[in] | AtapiCommand | The atapi command will be used for the transfer. |
[in] | AtapiCommandLength | The length of the atapi command. |
[in] | Read | The transfer direction. |
[in] | AtaCommandBlock | The EFI_ATA_COMMAND_BLOCK data. |
[in,out] | AtaStatusBlock | The EFI_ATA_STATUS_BLOCK data. |
[in,out] | MemoryAddr | The pointer to the data buffer. |
[in] | DataCount | The data count to be transferred. |
[in] | Timeout | The timeout value of non data transfer, uses 100ns as a unit. |
[in] | Task | Optional. Pointer to the ATA_NONBLOCK_TASK used by non-blocking mode. |
EFI_DEVICE_ERROR | The PIO data transfer abort with error occurs. |
EFI_TIMEOUT | The operation is time out. |
EFI_UNSUPPORTED | The device is not ready for transfer. |
EFI_SUCCESS | The PIO data transfer executes successfully. |
Definition at line 983 of file AhciMode.c.
VOID AhciPrintCommandBlock | ( | IN EFI_ATA_COMMAND_BLOCK * | AtaCommandBlock, |
IN UINT32 | DebugLevel | ||
) |
Prints contents of the ATA command block into the debug port.
[in] | AtaCommandBlock | AtaCommandBlock to print. |
[in] | DebugLevel | Debug level on which to print. |
Definition at line 908 of file AhciMode.c.
VOID AhciPrintStatusBlock | ( | IN EFI_ATA_STATUS_BLOCK * | AtaStatusBlock, |
IN UINT32 | DebugLevel | ||
) |
Prints contents of the ATA status block into the debug port.
[in] | AtaStatusBlock | AtaStatusBlock to print. |
[in] | DebugLevel | Debug level on which to print. |
Definition at line 935 of file AhciMode.c.
EFI_STATUS AhciPuisEnable | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier | ||
) |
Enable/disable/skip PUIS of the disk according to policy.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
PortMultiplier | The multiplier of port. |
Definition at line 2824 of file AhciMode.c.
EFI_STATUS AhciReadLogExt | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN OUT UINT8 * | Buffer, | ||
IN UINT8 | LogNumber, | ||
IN UINT8 | PageNumber | ||
) |
Read logs from SATA device.
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
PortMultiplier | The multiplier of port. |
Buffer | The data buffer to store SATA logs. |
LogNumber | The address of the log. |
PageNumber | The page number of the log. |
EFI_INVALID_PARAMETER | PciIo, AhciRegisters or Buffer is NULL. |
others | Return status of AhciPioTransfer(). |
Read log from device
Definition at line 2469 of file AhciMode.c.
UINT32 EFIAPI AhciReadReg | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT32 | Offset | ||
) |
Read AHCI Operation register.
PciIo | The PCI IO protocol instance. |
Offset | The operation register offset. |
Definition at line 23 of file AhciMode.c.
EFI_STATUS AhciRecoverPortError | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Port | ||
) |
Recovers the SATA port from error condition. This function implements algorithm described in AHCI spec 1.3.1 section 6.2.2
[in] | PciIo | Pointer to AHCI controller PciIo. |
[in] | Port | SATA port index on which to check. |
EFI_SUCCESS | Port recovered. |
Others | Failed to recover port. |
Definition at line 701 of file AhciMode.c.
EFI_STATUS EFIAPI AhciReset | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT64 | Timeout | ||
) |
Do AHCI HBA reset.
PciIo | The PCI IO protocol instance. |
Timeout | The timeout value of reset, uses 100ns as a unit. |
EFI_DEVICE_ERROR | AHCI controller is failed to complete hardware reset. |
EFI_TIMEOUT | The reset operation is time out. |
EFI_SUCCESS | AHCI controller is reset successfully. |
Definition at line 1671 of file AhciMode.c.
EFI_STATUS AhciResetPort | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Port | ||
) |
Reset the SATA port. Algorithm follows AHCI spec 1.3.1 section 10.4.2
[in] | PciIo | Pointer to AHCI controller PciIo. |
[in] | Port | SATA port index on which to reset. |
EFI_SUCCESS | Port reset. |
Others | Failed to reset the port. |
Definition at line 663 of file AhciMode.c.
BOOLEAN AhciShouldCmdBeRetried | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Port | ||
) |
This function will check if the failed command should be retired. Only error conditions which are a result of transient conditions on a link(either to system or to device).
[in] | PciIo | Pointer to AHCI controller PciIo. |
[in] | Port | SATA port index on which to check. |
TRUE | Command failure was caused by transient condition and should be retried |
FALSE | Command should not be retried |
Definition at line 758 of file AhciMode.c.
EFI_STATUS AhciSpinUpDisk | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_AHCI_REGISTERS * | AhciRegisters, | ||
IN UINT8 | Port, | ||
IN UINT8 | PortMultiplier, | ||
IN OUT EFI_IDENTIFY_DATA * | IdentifyData | ||
) |
Spin-up disk if IDD was incomplete or PUIS feature is enabled
PciIo | The PCI IO protocol instance. |
AhciRegisters | The pointer to the EFI_AHCI_REGISTERS. |
Port | The number of port. |
PortMultiplier | The multiplier of port. |
IdentifyData | A pointer to data buffer which is used to contain IDENTIFY data. |
Definition at line 2703 of file AhciMode.c.
EFI_STATUS EFIAPI AhciStartCommand | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Port, | ||
IN UINT8 | CommandSlot, | ||
IN UINT64 | Timeout | ||
) |
Start command for give slot on specific port.
PciIo | The PCI IO protocol instance. |
Port | The number of port. |
CommandSlot | The number of Command Slot. |
Timeout | The timeout value of start, uses 100ns as a unit. |
EFI_DEVICE_ERROR | The command start unsuccessfully. |
EFI_TIMEOUT | The operation is time out. |
EFI_SUCCESS | The command start successfully. |
Definition at line 1580 of file AhciMode.c.
EFI_STATUS EFIAPI AhciStopCommand | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Port, | ||
IN UINT64 | Timeout | ||
) |
Stop command running for giving port
PciIo | The PCI IO protocol instance. |
Port | The number of port. |
Timeout | The timeout value of stop, uses 100ns as a unit. |
EFI_DEVICE_ERROR | The command stop unsuccessfully. |
EFI_TIMEOUT | The operation is time out. |
EFI_SUCCESS | The command stop successfully. |
Definition at line 1536 of file AhciMode.c.
EFI_STATUS AhciWaitDeviceReady | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Port | ||
) |
Wait until SATA device reports it is ready for operation.
[in] | PciIo | Pointer to AHCI controller PciIo. |
[in] | Port | SATA port index on which to reset. |
EFI_SUCCESS | Device ready for operation. |
EFI_TIMEOUT | Device failed to get ready within required period. |
Definition at line 614 of file AhciMode.c.
EFI_STATUS EFIAPI AhciWaitMemSet | ( | IN EFI_PHYSICAL_ADDRESS | Address, |
IN UINT32 | MaskValue, | ||
IN UINT32 | TestValue, | ||
IN UINT64 | Timeout | ||
) |
Wait for the value of the specified system memory set to the test value.
Address | The system memory address to test. |
MaskValue | The mask value of memory. |
TestValue | The test value of memory. |
Timeout | The time out value for wait memory set, uses 100ns as a unit. |
EFI_TIMEOUT | The system memory setting is time out. |
EFI_SUCCESS | The system memory is correct set. |
Definition at line 200 of file AhciMode.c.
EFI_STATUS EFIAPI AhciWaitMmioSet | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINTN | Offset, | ||
IN UINT32 | MaskValue, | ||
IN UINT32 | TestValue, | ||
IN UINT64 | Timeout | ||
) |
Wait for the value of the specified MMIO register set to the test value.
PciIo | The PCI IO protocol instance. |
Offset | The MMIO address to test. |
MaskValue | The mask value of memory. |
TestValue | The test value of memory. |
Timeout | The time out value for wait memory set, uses 100ns as a unit. |
EFI_TIMEOUT | The MMIO setting is time out. |
EFI_SUCCESS | The MMIO is correct set. |
Definition at line 145 of file AhciMode.c.
EFI_STATUS AhciWaitUntilFisReceived | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Port, | ||
IN UINT64 | Timeout, | ||
IN SATA_FIS_TYPE | FisType | ||
) |
Waits until specified FIS has been received.
[in] | PciIo | Pointer to AHCI controller PciIo. |
[in] | Port | SATA port index on which to check. |
[in] | Timeout | Time after which function should stop polling. |
[in] | FisType | FIS type for which to check. |
EFI_SUCCESS | FIS received. |
EFI_TIMEOUT | FIS failed to arrive within a specified time period. |
EFI_DEVICE_ERROR | AHCI controller reported an error on port. |
Definition at line 867 of file AhciMode.c.
VOID EFIAPI AhciWriteReg | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT32 | Offset, | ||
IN UINT32 | Data | ||
) |
Write AHCI Operation register.
PciIo | The PCI IO protocol instance. |
Offset | The operation register offset. |
Data | The data used to write down. |
Definition at line 56 of file AhciMode.c.