TianoCore EDK2 master
|
#include "SdMmcPciHcDxe.h"
Go to the source code of this file.
This driver is used to manage SD/MMC PCI host controllers which are compliance with SD Host Controller Simplified Specification version 3.00 plus the 64-bit System Addressing support in SD Host Controller Simplified Specification version 4.20.
It would expose EFI_SD_MMC_PASS_THRU_PROTOCOL for upper layer use.
Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SdMmcPciHci.c.
EFI_STATUS BuildAdmaDescTable | ( | IN SD_MMC_HC_TRB * | Trb, |
IN UINT16 | ControllerVer | ||
) |
Build ADMA descriptor table for transfer.
Refer to SD Host Controller Simplified spec 4.2 Section 1.13 for details.
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
[in] | ControllerVer | The version of host controller. |
EFI_SUCCESS | The ADMA descriptor table is created successfully. |
Others | The ADMA descriptor table isn't created successfully. |
Definition at line 1467 of file SdMmcPciHci.c.
VOID DumpCapabilityReg | ( | IN UINT8 | Slot, |
IN SD_MMC_HC_SLOT_CAP * | Capability | ||
) |
Dump the content of SD/MMC host controller's Capability Register.
[in] | Slot | The slot number of the SD card to send the command to. |
[in] | Capability | The buffer to store the capability data. |
Definition at line 25 of file SdMmcPciHci.c.
EFI_STATUS SdMmcCheckAndRecoverErrors | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN UINT8 | Slot, | ||
IN UINT16 | IntStatus | ||
) |
Checks the error status in error status register and issues appropriate software reset as described in SD specification section 3.10.
[in] | Private | Pointer to driver private data. |
[in] | Slot | Index of the slot for device. |
[in] | IntStatus | Normal interrupt status mask. |
EFI_CRC_ERROR | CRC error happened during CMD execution. |
EFI_SUCCESS | No error reported. |
Others | Some other error happened. |
Definition at line 2410 of file SdMmcPciHci.c.
EFI_STATUS SdMmcCheckCommandComplete | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN SD_MMC_HC_TRB * | Trb, | ||
IN UINT16 | IntStatus | ||
) |
Checks if the command completed. If the command completed it gets the response and records the command completion in the TRB.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
[in] | IntStatus | Snapshot of the normal interrupt status register. |
EFI_SUCCESS | Command completed successfully. |
EFI_NOT_READY | Command completion still pending. |
Others | Command failed to complete. |
Definition at line 2535 of file SdMmcPciHci.c.
EFI_STATUS SdMmcCheckDataTransfer | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN SD_MMC_HC_TRB * | Trb, | ||
IN UINT16 | IntStatus | ||
) |
Checks if the data transfer completed and performs any actions neccessary to continue the data transfer such as SDMA system address fixup or PIO data transfer.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
[in] | IntStatus | Snapshot of the normal interrupt status register. |
EFI_SUCCESS | Data transfer completed successfully. |
EFI_NOT_READY | Data transfer completion still pending. |
Others | Data transfer failed to complete. |
Definition at line 2734 of file SdMmcPciHci.c.
EFI_STATUS SdMmcCheckTrbEnv | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN SD_MMC_HC_TRB * | Trb | ||
) |
Check if the env is ready for execute specified TRB.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
EFI_SUCCESS | The env is ready for TRB execution. |
EFI_NOT_READY | The env is not ready for TRB execution. |
Others | Some erros happen. |
Definition at line 2021 of file SdMmcPciHci.c.
EFI_STATUS SdMmcCheckTrbResult | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN SD_MMC_HC_TRB * | Trb | ||
) |
Check the TRB execution result.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
EFI_SUCCESS | The TRB is executed successfully. |
EFI_NOT_READY | The TRB is not completed for execution. |
Others | Some erros happen when executing this request. |
Definition at line 2798 of file SdMmcPciHci.c.
SD_MMC_HC_TRB * SdMmcCreateTrb | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN UINT8 | Slot, | ||
IN EFI_SD_MMC_PASS_THRU_COMMAND_PACKET * | Packet, | ||
IN EFI_EVENT | Event | ||
) |
Create a new TRB for the SD/MMC cmd request.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[in] | Packet | A pointer to the SD command data structure. |
[in] | Event | If Event is NULL, blocking I/O is performed. If Event is not NULL, then nonblocking I/O is performed, and Event will be signaled when the Packet completes. |
Definition at line 1848 of file SdMmcPciHci.c.
EFI_STATUS SdMmcExecTrb | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN SD_MMC_HC_TRB * | Trb | ||
) |
Execute the specified TRB.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
EFI_SUCCESS | The TRB is sent to host controller successfully. |
Others | Some erros happen when sending this request to the host controller. |
Definition at line 2127 of file SdMmcPciHci.c.
VOID SdMmcFreeTrb | ( | IN SD_MMC_HC_TRB * | Trb | ) |
Free the resource used by the TRB.
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
Definition at line 1959 of file SdMmcPciHci.c.
EFI_STATUS SdMmcGetResponse | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN SD_MMC_HC_TRB * | Trb | ||
) |
Reads the response data into the TRB buffer. This function assumes that caller made sure that command has completed.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
EFI_SUCCESS | Response read successfully. |
Others | Failed to get response. |
Definition at line 2486 of file SdMmcPciHci.c.
EFI_STATUS EFIAPI SdMmcHcAndMmio | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | BarIndex, | ||
IN UINT32 | Offset, | ||
IN UINT8 | Count, | ||
IN VOID * | AndData | ||
) |
Do AND operation with the value of the specified SD/MMC host controller mmio register.
[in] | PciIo | The PCI IO protocol instance. |
[in] | BarIndex | The BAR index of the standard PCI Configuration header to use as the base address for the memory operation to perform. |
[in] | Offset | The offset within the selected BAR to start the memory operation. |
[in] | Count | The width of the mmio register in bytes. Must be 1, 2 , 4 or 8 bytes. |
[in] | AndData | The pointer to the data used to do AND operation. The caller is responsible for having ownership of the data buffer and ensuring its size not less than Count bytes. |
EFI_INVALID_PARAMETER | The PciIo or AndData is NULL or the Count is not valid. |
EFI_SUCCESS | The AND operation succeeds. |
Others | The AND operation fails. |
Definition at line 283 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcCardDetect | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot, | ||
OUT BOOLEAN * | MediaPresent | ||
) |
Detect whether there is a SD/MMC card attached at the specified SD/MMC host controller slot.
Refer to SD Host Controller Simplified spec 3.0 Section 3.1 for details.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[out] | MediaPresent | The pointer to the media present boolean value. |
EFI_SUCCESS | There is no media change happened. |
EFI_MEDIA_CHANGED | There is media change happened. |
Others | The detection fails. |
Definition at line 678 of file SdMmcPciHci.c.
EFI_STATUS EFIAPI SdMmcHcCheckMmioSet | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | BarIndex, | ||
IN UINT32 | Offset, | ||
IN UINT8 | Count, | ||
IN UINT64 | MaskValue, | ||
IN UINT64 | TestValue | ||
) |
Wait for the value of the specified MMIO register set to the test value.
[in] | PciIo | The PCI IO protocol instance. |
[in] | BarIndex | The BAR index of the standard PCI Configuration header to use as the base address for the memory operation to perform. |
[in] | Offset | The offset within the selected BAR to start the memory operation. |
[in] | Count | The width of the mmio register in bytes. Must be 1, 2, 4 or 8 bytes. |
[in] | MaskValue | The mask value of memory. |
[in] | TestValue | The test value of memory. |
EFI_NOT_READY | The MMIO register hasn't set to the expected value. |
EFI_SUCCESS | The MMIO register has expected value. |
Others | The MMIO operation fails. |
Definition at line 339 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcClockSupply | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN UINT8 | Slot, | ||
IN SD_MMC_BUS_MODE | BusTiming, | ||
IN BOOLEAN | FirstTimeSetup, | ||
IN UINT64 | ClockFreq | ||
) |
SD/MMC card clock supply.
Refer to SD Host Controller Simplified spec 3.0 Section 3.2.1 for details.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[in] | BusTiming | BusTiming at which the frequency change is done. |
[in] | FirstTimeSetup | Flag to indicate whether the clock is being setup for the first time. |
[in] | ClockFreq | The max clock frequency to be set. The unit is KHz. |
EFI_SUCCESS | The clock is supplied successfully. |
Others | The clock isn't supplied successfully. |
Definition at line 815 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcEnableInterrupt | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot | ||
) |
Set all interrupt status bits in Normal and Error Interrupt Status Enable register.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
EFI_SUCCESS | The operation executes successfully. |
Others | The operation fails. |
Definition at line 580 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcGetCapability | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot, | ||
OUT SD_MMC_HC_SLOT_CAP * | Capability | ||
) |
Get the capability data from the specified slot.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[out] | Capability | The buffer to store the capability data. |
EFI_SUCCESS | The operation executes successfully. |
Others | The operation fails. |
Definition at line 618 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcGetControllerVersion | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot, | ||
OUT UINT16 * | Version | ||
) |
Get the controller version information from the specified slot.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[out] | Version | The buffer to store the version information. |
EFI_SUCCESS | The operation executes successfully. |
Others | The operation fails. |
Definition at line 448 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcGetMaxCurrent | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot, | ||
OUT UINT64 * | MaxCurrent | ||
) |
Get the maximum current capability data from the specified slot.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[out] | MaxCurrent | The buffer to store the maximum current capability data. |
EFI_SUCCESS | The operation executes successfully. |
Others | The operation fails. |
Definition at line 649 of file SdMmcPciHci.c.
EFI_STATUS EFIAPI SdMmcHcGetSlotInfo | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
OUT UINT8 * | FirstBar, | ||
OUT UINT8 * | SlotNum | ||
) |
Read SlotInfo register from SD/MMC host controller pci config space.
[in] | PciIo | The PCI IO protocol instance. |
[out] | FirstBar | The buffer to store the first BAR value. |
[out] | SlotNum | The buffer to store the supported slot number. |
EFI_SUCCESS | The operation succeeds. |
Others | The operation fails. |
Definition at line 92 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcInitHost | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN UINT8 | Slot | ||
) |
Initial SD/MMC host controller with lowest clock frequency, max power and max timeout value at initialization.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
EFI_SUCCESS | The host controller is initialized successfully. |
Others | The host controller isn't initialized successfully. |
Definition at line 1213 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcInitPowerVoltage | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot, | ||
IN SD_MMC_HC_SLOT_CAP | Capability | ||
) |
Supply SD/MMC card with maximum voltage at initialization.
Refer to SD Host Controller Simplified spec 3.0 Section 3.3 for details.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[in] | Capability | The capability of the slot. |
EFI_SUCCESS | The voltage is supplied successfully. |
Others | The voltage isn't supplied successfully. |
Definition at line 1127 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcInitTimeoutCtrl | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot | ||
) |
Initialize the Timeout Control register with most conservative value at initialization.
Refer to SD Host Controller Simplified spec 3.0 Section 2.2.15 for details.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
EFI_SUCCESS | The timeout control register is configured successfully. |
Others | The timeout control register isn't configured successfully. |
Definition at line 1187 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcInitV4Enhancements | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot, | ||
IN SD_MMC_HC_SLOT_CAP | Capability, | ||
IN UINT16 | ControllerVer | ||
) |
Configure V4 controller enhancements at initialization.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[in] | Capability | The capability of the slot. |
[in] | ControllerVer | The version of host controller. |
EFI_SUCCESS | The clock is supplied successfully. |
Definition at line 1061 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcLedOnOff | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot, | ||
IN BOOLEAN | On | ||
) |
Turn on/off LED.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[in] | On | The boolean to turn on/off LED. |
EFI_SUCCESS | The LED is turned on/off successfully. |
Others | The LED isn't turned on/off successfully. |
Definition at line 1434 of file SdMmcPciHci.c.
EFI_STATUS EFIAPI SdMmcHcOrMmio | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | BarIndex, | ||
IN UINT32 | Offset, | ||
IN UINT8 | Count, | ||
IN VOID * | OrData | ||
) |
Do OR operation with the value of the specified SD/MMC host controller mmio register.
[in] | PciIo | The PCI IO protocol instance. |
[in] | BarIndex | The BAR index of the standard PCI Configuration header to use as the base address for the memory operation to perform. |
[in] | Offset | The offset within the selected BAR to start the memory operation. |
[in] | Count | The width of the mmio register in bytes. Must be 1, 2 , 4 or 8 bytes. |
[in] | OrData | The pointer to the data used to do OR operation. The caller is responsible for having ownership of the data buffer and ensuring its size not less than Count bytes. |
EFI_INVALID_PARAMETER | The PciIo or OrData is NULL or the Count is not valid. |
EFI_SUCCESS | The OR operation succeeds. |
Others | The OR operation fails. |
Definition at line 225 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcPowerControl | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot, | ||
IN UINT8 | PowerCtrl | ||
) |
SD/MMC bus power control.
Refer to SD Host Controller Simplified spec 3.0 Section 3.3 for details.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[in] | PowerCtrl | The value setting to the power control register. |
TRUE | There is a SD/MMC card attached. |
FALSE | There is no a SD/MMC card attached. |
Definition at line 971 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcReset | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN UINT8 | Slot | ||
) |
Software reset the specified SD/MMC host controller and enable all interrupts.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
EFI_SUCCESS | The software reset executes successfully. |
Others | The software reset fails. |
Definition at line 477 of file SdMmcPciHci.c.
EFI_STATUS EFIAPI SdMmcHcRwMmio | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | BarIndex, | ||
IN UINT32 | Offset, | ||
IN BOOLEAN | Read, | ||
IN UINT8 | Count, | ||
IN OUT VOID * | Data | ||
) |
Read/Write specified SD/MMC host controller mmio register.
[in] | PciIo | The PCI IO protocol instance. |
[in] | BarIndex | The BAR index of the standard PCI Configuration header to use as the base address for the memory operation to perform. |
[in] | Offset | The offset within the selected BAR to start the memory operation. |
[in] | Read | A boolean to indicate it's read or write operation. |
[in] | Count | The width of the mmio register in bytes. Must be 1, 2 , 4 or 8 bytes. |
[in,out] | Data | For read operations, the destination buffer to store the results. For write operations, the source buffer to write data from. The caller is responsible for having ownership of the data buffer and ensuring its size not less than Count bytes. |
EFI_INVALID_PARAMETER | The PciIo or Data is NULL or the Count is not valid. |
EFI_SUCCESS | The read/write operation succeeds. |
Others | The read/write operation fails. |
Definition at line 143 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcSetBusWidth | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot, | ||
IN UINT16 | BusWidth | ||
) |
Set the SD/MMC bus width.
Refer to SD Host Controller Simplified spec 3.0 Section 3.4 for details.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[in] | BusWidth | The bus width used by the SD/MMC device, it must be 1, 4 or 8. |
EFI_SUCCESS | The bus width is set successfully. |
Others | The bus width isn't set successfully. |
Definition at line 1011 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcStartSdClock | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot | ||
) |
Start the SD clock.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number. |
EFI_SUCCESS | Succeeded to start the SD clock. |
Others | Failed to start the SD clock. |
Definition at line 785 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcStopClock | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | Slot | ||
) |
Stop SD/MMC card clock.
Refer to SD Host Controller Simplified spec 3.0 Section 3.2.2 for details.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
EFI_SUCCESS | Succeed to stop SD/MMC clock. |
Others | Fail to stop SD/MMC clock. |
Definition at line 739 of file SdMmcPciHci.c.
EFI_STATUS SdMmcHcUhsSignaling | ( | IN EFI_HANDLE | ControllerHandle, |
IN EFI_PCI_IO_PROTOCOL * | PciIo, | ||
IN UINT8 | Slot, | ||
IN SD_MMC_BUS_MODE | Timing | ||
) |
Set SD Host Controler control 2 registry according to selected speed.
[in] | ControllerHandle | The handle of the controller. |
[in] | PciIo | The PCI IO protocol instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[in] | Timing | The timing to select. |
EFI_SUCCESS | The timing is set successfully. |
Others | The timing isn't set successfully. |
Definition at line 1310 of file SdMmcPciHci.c.
EFI_STATUS EFIAPI SdMmcHcWaitMmioSet | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | BarIndex, | ||
IN UINT32 | Offset, | ||
IN UINT8 | Count, | ||
IN UINT64 | MaskValue, | ||
IN UINT64 | TestValue, | ||
IN UINT64 | Timeout | ||
) |
Wait for the value of the specified MMIO register set to the test value.
[in] | PciIo | The PCI IO protocol instance. |
[in] | BarIndex | The BAR index of the standard PCI Configuration header to use as the base address for the memory operation to perform. |
[in] | Offset | The offset within the selected BAR to start the memory operation. |
[in] | Count | The width of the mmio register in bytes. Must be 1, 2, 4 or 8 bytes. |
[in] | MaskValue | The mask value of memory. |
[in] | TestValue | The test value of memory. |
[in] | Timeout | The time out value for wait memory set, uses 1 microsecond as a unit. |
EFI_TIMEOUT | The MMIO register hasn't expected value in timeout range. |
EFI_SUCCESS | The MMIO register has expected value. |
Others | The MMIO operation fails. |
Definition at line 393 of file SdMmcPciHci.c.
VOID SdMmcPrintPacket | ( | IN UINT32 | DebugLevel, |
IN EFI_SD_MMC_PASS_THRU_COMMAND_PACKET * | Packet | ||
) |
Prints the contents of the command packet to the debug port.
[in] | DebugLevel | Debug level at which the packet should be printed. |
[in] | Packet | Pointer to packet to print. |
Definition at line 1701 of file SdMmcPciHci.c.
VOID SdMmcPrintTrb | ( | IN UINT32 | DebugLevel, |
IN SD_MMC_HC_TRB * | Trb | ||
) |
Prints the contents of the TRB to the debug port.
[in] | DebugLevel | Debug level at which the TRB should be printed. |
[in] | Trb | Pointer to the TRB structure. |
Definition at line 1742 of file SdMmcPciHci.c.
EFI_STATUS SdMmcSetDriverStrength | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT8 | SlotIndex, | ||
IN SD_DRIVER_STRENGTH_TYPE | DriverStrength | ||
) |
Set driver strength in host controller.
[in] | PciIo | The PCI IO protocol instance. |
[in] | SlotIndex | The slot index of the card. |
[in] | DriverStrength | DriverStrength to set in the controller. |
EFI_SUCCESS | Driver strength programmed successfully. |
Others | Failed to set driver strength. |
Definition at line 1399 of file SdMmcPciHci.c.
EFI_STATUS SdMmcSetupMemoryForDmaTransfer | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN UINT8 | Slot, | ||
IN SD_MMC_HC_TRB * | Trb | ||
) |
Sets up host memory to allow DMA transfer.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Slot | The slot number of the SD card to send the command to. |
[in] | Packet | A pointer to the SD command data structure. |
EFI_SUCCESS | Memory has been mapped for DMA transfer. |
Others | Memory has not been mapped. |
Definition at line 1788 of file SdMmcPciHci.c.
EFI_STATUS SdMmcSoftwareReset | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN UINT8 | Slot, | ||
IN UINT16 | ErrIntStatus | ||
) |
Performs SW reset based on passed error status mask.
[in] | Private | Pointer to driver private data. |
[in] | Slot | Index of the slot to reset. |
[in] | ErrIntStatus | Error interrupt status mask. |
EFI_SUCCESS | Software reset performed successfully. |
Other | Software reset failed. |
Definition at line 2349 of file SdMmcPciHci.c.
EFI_STATUS SdMmcTransferDataWithPio | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN SD_MMC_HC_TRB * | Trb, | ||
IN UINT16 | IntStatus | ||
) |
Transfers data from card using PIO method.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
[in] | IntStatus | Snapshot of the normal interrupt status register. |
EFI_SUCCESS | PIO transfer completed successfully. |
EFI_NOT_READY | PIO transfer completion still pending. |
Others | PIO transfer failed to complete. |
Definition at line 2582 of file SdMmcPciHci.c.
EFI_STATUS SdMmcUpdateSdmaAddress | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN SD_MMC_HC_TRB * | Trb | ||
) |
Update the SDMA address on the SDMA buffer boundary interrupt.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
EFI_SUCCESS | Updated SDMA buffer address. |
Others | Failed to update SDMA buffer address. |
Definition at line 2682 of file SdMmcPciHci.c.
EFI_STATUS SdMmcWaitTrbEnv | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN SD_MMC_HC_TRB * | Trb | ||
) |
Wait for the env to be ready for execute specified TRB.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
EFI_SUCCESS | The env is ready for TRB execution. |
EFI_TIMEOUT | The env is not ready for TRB execution in time. |
Others | Some erros happen. |
Definition at line 2075 of file SdMmcPciHci.c.
EFI_STATUS SdMmcWaitTrbResult | ( | IN SD_MMC_HC_PRIVATE_DATA * | Private, |
IN SD_MMC_HC_TRB * | Trb | ||
) |
Wait for the TRB execution result.
[in] | Private | A pointer to the SD_MMC_HC_PRIVATE_DATA instance. |
[in] | Trb | The pointer to the SD_MMC_HC_TRB instance. |
EFI_SUCCESS | The TRB is executed successfully. |
Others | Some erros happen when executing this request. |
Definition at line 2888 of file SdMmcPciHci.c.