11#ifndef _SD_MMC_PCI_HC_DXE_H_
12#define _SD_MMC_PCI_HC_DXE_H_
45#define SD_MMC_HC_PRIVATE_SIGNATURE SIGNATURE_32 ('s', 'd', 't', 'f')
47#define SD_MMC_HC_PRIVATE_FROM_THIS(a) \
48 CR(a, SD_MMC_HC_PRIVATE_DATA, PassThru, SD_MMC_HC_PRIVATE_SIGNATURE)
53#define SD_MMC_HC_GENERIC_TIMEOUT (PcdGet32 (PcdSdMmcGenericTimeoutValue))
59#define SD_MMC_HC_ASYNC_TIMER EFI_TIMER_PERIOD_MILLISECONDS(1)
64#define SD_MMC_HC_ENUM_TIMER EFI_TIMER_PERIOD_MILLISECONDS(100)
79} EFI_SD_MMC_SLOT_TYPE;
83 EFI_SD_MMC_SLOT_TYPE SlotType;
86 SD_MMC_CARD_TYPE CardType;
116 UINT64 MaxCurrent[SD_MMC_HC_MAX_SLOT];
117 UINT16 ControllerVersion[SD_MMC_HC_MAX_SLOT];
123 UINT32 BaseClkFreq[SD_MMC_HC_MAX_SLOT];
127 SD_MMC_BUS_MODE BusTiming;
133#define SD_MMC_HC_TRB_SIG SIGNATURE_32 ('T', 'R', 'B', 'T')
135#define SD_MMC_TRB_RETRIES 5
153 SD_MMC_HC_TRANSFER_MODE Mode;
154 SD_MMC_HC_ADMA_LENGTH_MODE AdmaLengthMode;
158 BOOLEAN CommandComplete;
162 BOOLEAN PioModeTransferCompleted;
163 UINT32 PioBlockIndex;
175#define SD_MMC_HC_TRB_FROM_THIS(a) \
176 CR(a, SD_MMC_HC_TRB, TrbList, SD_MMC_HC_TRB_SIG)
190 BOOLEAN InfiniteWait;
579 OUT CHAR16 **DriverName
657 OUT CHAR16 **ControllerName
830 IN SD_MMC_BUS_MODE BusTiming,
831 IN BOOLEAN FirstTimeSetup,
EFI_STATUS EFIAPI SdMmcPciHcComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
EFI_STATUS SdMmcHcReset(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
EFI_STATUS EFIAPI SdMmcPciHcDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS SdMmcWaitTrbEnv(IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
EFI_STATUS SdMmcCheckTrbResult(IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
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)
EFI_STATUS(* CARD_TYPE_DETECT_ROUTINE)(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
EFI_STATUS SdMmcHcInitHost(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
EFI_STATUS SdMmcCheckTrbEnv(IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
EFI_STATUS EFIAPI SdMmcPassThruPassThru(IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN UINT8 Slot, IN OUT EFI_SD_MMC_PASS_THRU_COMMAND_PACKET *Packet, IN EFI_EVENT Event OPTIONAL)
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)
EFI_STATUS EFIAPI SdMmcPassThruResetDevice(IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN UINT8 Slot)
EFI_STATUS EmmcIdentification(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
EFI_STATUS EFIAPI SdMmcPassThruGetSlotNumber(IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT UINT8 *Slot)
EFI_STATUS EFIAPI SdMmcPciHcComponentNameGetControllerName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
EFI_STATUS EFIAPI SdMmcPassThruGetNextSlot(IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN OUT UINT8 *Slot)
EFI_STATUS SdMmcWaitTrbResult(IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
EFI_STATUS EFIAPI SdMmcPciHcDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI SdMmcPciHcDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS SdCardIdentification(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
VOID SdMmcFreeTrb(IN SD_MMC_HC_TRB *Trb)
EFI_STATUS SdMmcExecTrb(IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
EFI_STATUS EFIAPI SdMmcPassThruBuildDevicePath(IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN UINT8 Slot, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
UINT64 EFI_PHYSICAL_ADDRESS