31#define SLOT_INIT_TEMPLATE {0, UnknownSlot, 0, 0, 0, 0,\
32 {EDKII_SD_MMC_BUS_WIDTH_IGNORE,\
33 EDKII_SD_MMC_CLOCK_FREQ_IGNORE,\
34 {EDKII_SD_MMC_DRIVER_STRENGTH_IGNORE}}}
40 SD_MMC_HC_PRIVATE_SIGNATURE,
132 &gSdMmcPciHcDriverBinding,
134 &gSdMmcPciHcComponentName,
135 &gSdMmcPciHcComponentName2
162 BOOLEAN InfiniteWait;
173 if (!
IsNull (&Private->Queue, Link)) {
174 Trb = SD_MMC_HC_TRB_FROM_THIS (Link);
175 if (!Private->Slot[Trb->Slot].MediaPresent) {
176 Status = EFI_NO_MEDIA;
185 if (!EFI_ERROR (Status)) {
188 if (EFI_ERROR (Status)) {
200 if ((Trb !=
NULL) && (Status == EFI_NOT_READY)) {
201 Packet = Trb->Packet;
202 if (Packet->Timeout == 0) {
205 InfiniteWait =
FALSE;
208 if ((!InfiniteWait) && (Trb->Timeout-- == 0)) {
210 Trb->Packet->TransactionStatus = EFI_TIMEOUT;
211 TrbEvent = Trb->Event;
213 DEBUG ((DEBUG_VERBOSE,
"ProcessAsyncTaskList(): Signal Event %p EFI_TIMEOUT\n", TrbEvent));
214 gBS->SignalEvent (TrbEvent);
217 }
else if ((Trb !=
NULL) && (Status == EFI_CRC_ERROR) && (Trb->Retries > 0)) {
219 Trb->Started =
FALSE;
220 }
else if ((Trb !=
NULL)) {
222 Trb->Packet->TransactionStatus = Status;
223 TrbEvent = Trb->Event;
225 DEBUG ((DEBUG_VERBOSE,
"ProcessAsyncTaskList(): Signal Event %p with %r\n", TrbEvent, Status));
226 gBS->SignalEvent (TrbEvent);
250 BOOLEAN MediaPresent;
261 for (Slot = 0; Slot < SD_MMC_HC_MAX_SLOT; Slot++) {
262 if ((Private->Slot[Slot].Enable) && (Private->Slot[Slot].SlotType == RemovableSlot)) {
264 if ((Status == EFI_MEDIA_CHANGED) && !MediaPresent) {
265 DEBUG ((DEBUG_INFO,
"SdMmcPciHcEnumerateDevice: device disconnected at slot %d of pci %p\n", Slot, Private->PciIo));
266 Private->Slot[Slot].MediaPresent =
FALSE;
267 Private->Slot[Slot].Initialized =
FALSE;
271 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
273 !
IsNull (&Private->Queue, Link);
277 Trb = SD_MMC_HC_TRB_FROM_THIS (Link);
278 if (Trb->Slot == Slot) {
280 Trb->Packet->TransactionStatus = EFI_NO_MEDIA;
281 gBS->SignalEvent (Trb->Event);
286 gBS->RestoreTPL (OldTpl);
290 gBS->ReinstallProtocolInterface (
291 Private->ControllerHandle,
292 &gEfiSdMmcPassThruProtocolGuid,
298 if ((Status == EFI_MEDIA_CHANGED) && MediaPresent) {
299 DEBUG ((DEBUG_INFO,
"SdMmcPciHcEnumerateDevice: device connected at slot %d of pci %p\n", Slot, Private->PciIo));
304 if (EFI_ERROR (Status)) {
312 if (EFI_ERROR (Status)) {
316 Private->Slot[Slot].MediaPresent =
TRUE;
317 Private->Slot[Slot].Initialized =
TRUE;
319 for (Index = 0; Index < RoutineNum; Index++) {
320 Routine = &mCardTypeDetectRoutineTable[Index];
321 if (*Routine !=
NULL) {
322 Status = (*Routine)(Private, Slot);
323 if (!EFI_ERROR (Status)) {
332 if (Index == RoutineNum) {
333 Private->Slot[Slot].Initialized =
FALSE;
339 gBS->ReinstallProtocolInterface (
340 Private->ControllerHandle,
341 &gEfiSdMmcPassThruProtocolGuid,
408 ParentDevicePath =
NULL;
414 Status =
gBS->OpenProtocol (
416 &gEfiDevicePathProtocolGuid,
417 (VOID *)&ParentDevicePath,
418 This->DriverBindingHandle,
420 EFI_OPEN_PROTOCOL_BY_DRIVER
422 if (EFI_ERROR (Status)) {
434 &gEfiDevicePathProtocolGuid,
435 This->DriverBindingHandle,
442 Status =
gBS->OpenProtocol (
444 &gEfiPciIoProtocolGuid,
446 This->DriverBindingHandle,
448 EFI_OPEN_PROTOCOL_BY_DRIVER
450 if (EFI_ERROR (Status)) {
459 Status = PciIo->Pci.
Read (
466 if (EFI_ERROR (Status)) {
469 &gEfiPciIoProtocolGuid,
470 This->DriverBindingHandle,
473 return EFI_UNSUPPORTED;
482 &gEfiPciIoProtocolGuid,
483 This->DriverBindingHandle,
490 if ((PciData.Hdr.ClassCode[2] == PCI_CLASS_SYSTEM_PERIPHERAL) &&
491 (PciData.Hdr.ClassCode[1] == PCI_SUBCLASS_SD_HOST_CONTROLLER) &&
492 ((PciData.Hdr.ClassCode[0] == 0x00) || (PciData.Hdr.ClassCode[0] == 0x01)))
497 return EFI_UNSUPPORTED;
547 UINT64 PciAttributes;
554 BOOLEAN MediaPresent;
555 BOOLEAN Support64BitDma;
557 DEBUG ((DEBUG_INFO,
"SdMmcPciHcDriverBindingStart: Start\n"));
564 Status =
gBS->OpenProtocol (
566 &gEfiPciIoProtocolGuid,
568 This->DriverBindingHandle,
570 EFI_OPEN_PROTOCOL_BY_DRIVER
572 if (EFI_ERROR (Status)) {
580 Status = PciIo->Attributes (
587 if (EFI_ERROR (Status)) {
591 Status = PciIo->Attributes (
598 if (!EFI_ERROR (Status)) {
599 Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;
600 Status = PciIo->Attributes (
611 if (Private ==
NULL) {
612 Status = EFI_OUT_OF_RESOURCES;
616 Private->ControllerHandle = Controller;
617 Private->PciIo = PciIo;
618 Private->PciAttributes = PciAttributes;
625 if (EFI_ERROR (Status)) {
634 if (mOverride ==
NULL) {
635 Status =
gBS->LocateProtocol (
636 &gEdkiiSdMmcOverrideProtocolGuid,
640 if (!EFI_ERROR (Status)) {
643 "%a: found SD/MMC override protocol\n",
649 Support64BitDma =
TRUE;
650 for (Slot = FirstBar; Slot < (FirstBar + SlotNum); Slot++) {
651 Private->Slot[Slot].Enable =
TRUE;
656 if (EFI_ERROR (Status)) {
661 if (EFI_ERROR (Status)) {
665 Private->BaseClkFreq[Slot] = Private->Capability[Slot].BaseClkFreq;
667 if (mOverride !=
NULL) {
668 if (mOverride->Capability !=
NULL) {
669 Status = mOverride->Capability (
672 &Private->Capability[Slot],
673 &Private->BaseClkFreq[Slot]
675 if (EFI_ERROR (Status)) {
678 "%a: Failed to override capability - %r\n",
686 if (mOverride->NotifyPhase !=
NULL) {
687 Status = mOverride->NotifyPhase (
690 EdkiiSdMmcGetOperatingParam,
691 (VOID *)&Private->Slot[Slot].OperatingParameters
693 if (EFI_ERROR (Status)) {
694 DEBUG ((DEBUG_WARN,
"%a: Failed to get operating parameters, using defaults\n", __func__));
702 "Slot[%d] Base Clock Frequency: %dMHz\n",
704 Private->BaseClkFreq[Slot]
711 if (((Private->ControllerVersion[Slot] == SD_MMC_HC_CTRL_VER_300) &&
712 (Private->Capability[Slot].SysBus64V3 == 0)) ||
713 ((Private->ControllerVersion[Slot] == SD_MMC_HC_CTRL_VER_400) &&
714 (Private->Capability[Slot].SysBus64V3 == 0)) ||
715 ((Private->ControllerVersion[Slot] >= SD_MMC_HC_CTRL_VER_410) &&
716 (Private->Capability[Slot].SysBus64V4 == 0)))
718 Support64BitDma =
FALSE;
722 if (EFI_ERROR (Status)) {
726 Private->Slot[Slot].SlotType = Private->Capability[Slot].SlotType;
727 if ((Private->Slot[Slot].SlotType != RemovableSlot) && (Private->Slot[Slot].SlotType != EmbeddedSlot)) {
728 DEBUG ((DEBUG_INFO,
"SdMmcPciHcDxe doesn't support the slot type [%d]!!!\n", Private->Slot[Slot].SlotType));
736 if (EFI_ERROR (Status)) {
743 if (Private->Slot[Slot].SlotType == RemovableSlot) {
745 if (EFI_ERROR (Status) && (Status != EFI_MEDIA_CHANGED)) {
747 }
else if (!MediaPresent) {
750 "SdMmcHcCardDetect: No device attached in Slot[%d]!!!\n",
758 if (EFI_ERROR (Status)) {
762 Private->Slot[Slot].MediaPresent =
TRUE;
763 Private->Slot[Slot].Initialized =
TRUE;
765 for (Index = 0; Index < RoutineNum; Index++) {
766 Routine = &mCardTypeDetectRoutineTable[Index];
767 if (*Routine !=
NULL) {
768 Status = (*Routine)(Private, Slot);
769 if (!EFI_ERROR (Status)) {
778 if (Index == RoutineNum) {
779 Private->Slot[Slot].Initialized =
FALSE;
787 if (Support64BitDma) {
788 Status = PciIo->Attributes (
794 if (EFI_ERROR (Status)) {
795 DEBUG ((DEBUG_WARN,
"SdMmcPciHcDriverBindingStart: failed to enable 64-bit DMA (%r)\n", Status));
802 Status =
gBS->CreateEvent (
803 EVT_TIMER | EVT_NOTIFY_SIGNAL,
809 if (EFI_ERROR (Status)) {
813 Status =
gBS->SetTimer (Private->TimerEvent,
TimerPeriodic, SD_MMC_HC_ASYNC_TIMER);
814 if (EFI_ERROR (Status)) {
821 Status =
gBS->CreateEvent (
822 EVT_TIMER | EVT_NOTIFY_SIGNAL,
826 &Private->ConnectEvent
828 if (EFI_ERROR (Status)) {
832 Status =
gBS->SetTimer (Private->ConnectEvent,
TimerPeriodic, SD_MMC_HC_ENUM_TIMER);
833 if (EFI_ERROR (Status)) {
837 Status =
gBS->InstallMultipleProtocolInterfaces (
839 &gEfiSdMmcPassThruProtocolGuid,
840 &(Private->PassThru),
844 DEBUG ((DEBUG_INFO,
"SdMmcPciHcDriverBindingStart: %r End on %x\n", Status, Controller));
847 if (EFI_ERROR (Status)) {
848 if ((Private !=
NULL) && (Private->PciAttributes != 0)) {
855 Private->PciAttributes,
862 &gEfiPciIoProtocolGuid,
863 This->DriverBindingHandle,
867 if ((Private !=
NULL) && (Private->TimerEvent !=
NULL)) {
868 gBS->CloseEvent (Private->TimerEvent);
871 if ((Private !=
NULL) && (Private->ConnectEvent !=
NULL)) {
872 gBS->CloseEvent (Private->ConnectEvent);
875 if (Private !=
NULL) {
926 DEBUG ((DEBUG_INFO,
"SdMmcPciHcDriverBindingStop: Start\n"));
928 Status =
gBS->OpenProtocol (
930 &gEfiSdMmcPassThruProtocolGuid,
932 This->DriverBindingHandle,
934 EFI_OPEN_PROTOCOL_GET_PROTOCOL
936 if (EFI_ERROR (Status)) {
940 Private = SD_MMC_HC_PRIVATE_FROM_THIS (PassThru);
944 if (Private->TimerEvent !=
NULL) {
945 gBS->CloseEvent (Private->TimerEvent);
946 Private->TimerEvent =
NULL;
949 if (Private->ConnectEvent !=
NULL) {
950 gBS->CloseEvent (Private->ConnectEvent);
951 Private->ConnectEvent =
NULL;
959 !
IsNull (&Private->Queue, Link);
964 Trb = SD_MMC_HC_TRB_FROM_THIS (Link);
965 Trb->Packet->TransactionStatus = EFI_ABORTED;
966 gBS->SignalEvent (Trb->Event);
973 Status =
gBS->UninstallProtocolInterface (
975 &gEfiSdMmcPassThruProtocolGuid,
979 if (EFI_ERROR (Status)) {
985 &gEfiPciIoProtocolGuid,
986 This->DriverBindingHandle,
992 PciIo = Private->PciIo;
993 Status = PciIo->Attributes (
996 Private->PciAttributes,
1003 DEBUG ((DEBUG_INFO,
"SdMmcPciHcDriverBindingStop: End with %r\n", Status));
1030 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
1032 gBS->RestoreTPL (OldTpl);
1036 gBS->RestoreTPL (OldTpl);
1039 while (Trb->Retries) {
1041 if (EFI_ERROR (Status)) {
1046 if (EFI_ERROR (Status)) {
1051 if (Status == EFI_CRC_ERROR) {
1111 if ((This ==
NULL) || (Packet ==
NULL)) {
1112 return EFI_INVALID_PARAMETER;
1115 if ((Packet->SdMmcCmdBlk ==
NULL) || (Packet->SdMmcStatusBlk ==
NULL)) {
1116 return EFI_INVALID_PARAMETER;
1119 if ((Packet->OutDataBuffer ==
NULL) && (Packet->OutTransferLength != 0)) {
1120 return EFI_INVALID_PARAMETER;
1123 if ((Packet->InDataBuffer ==
NULL) && (Packet->InTransferLength != 0)) {
1124 return EFI_INVALID_PARAMETER;
1127 Private = SD_MMC_HC_PRIVATE_FROM_THIS (This);
1129 if (!Private->Slot[Slot].Enable) {
1130 return EFI_INVALID_PARAMETER;
1133 if (!Private->Slot[Slot].MediaPresent) {
1134 return EFI_NO_MEDIA;
1137 if (!Private->Slot[Slot].Initialized) {
1138 return EFI_DEVICE_ERROR;
1143 return EFI_OUT_OF_RESOURCES;
1149 if (Event !=
NULL) {
1199 if ((This ==
NULL) || (Slot ==
NULL)) {
1200 return EFI_INVALID_PARAMETER;
1203 Private = SD_MMC_HC_PRIVATE_FROM_THIS (This);
1205 if (*Slot == 0xFF) {
1206 for (Index = 0; Index < SD_MMC_HC_MAX_SLOT; Index++) {
1207 if (Private->Slot[Index].Enable) {
1209 Private->PreviousSlot = Index;
1214 return EFI_NOT_FOUND;
1215 }
else if (*Slot == Private->PreviousSlot) {
1216 for (Index = *Slot + 1; Index < SD_MMC_HC_MAX_SLOT; Index++) {
1217 if (Private->Slot[Index].Enable) {
1219 Private->PreviousSlot = Index;
1224 return EFI_NOT_FOUND;
1226 return EFI_INVALID_PARAMETER;
1276 if ((This ==
NULL) || (DevicePath ==
NULL) || (Slot >= SD_MMC_HC_MAX_SLOT)) {
1277 return EFI_INVALID_PARAMETER;
1280 Private = SD_MMC_HC_PRIVATE_FROM_THIS (This);
1282 if ((!Private->Slot[Slot].Enable) || (!Private->Slot[Slot].MediaPresent)) {
1283 return EFI_NOT_FOUND;
1286 if (Private->Slot[Slot].CardType == SdCardType) {
1288 if (SdNode ==
NULL) {
1289 return EFI_OUT_OF_RESOURCES;
1292 SdNode->SlotNumber = Slot;
1295 }
else if (Private->Slot[Slot].CardType == EmmcCardType) {
1297 if (EmmcNode ==
NULL) {
1298 return EFI_OUT_OF_RESOURCES;
1301 EmmcNode->SlotNumber = Slot;
1308 return EFI_NOT_FOUND;
1348 if ((This ==
NULL) || (DevicePath ==
NULL) || (Slot ==
NULL)) {
1349 return EFI_INVALID_PARAMETER;
1352 Private = SD_MMC_HC_PRIVATE_FROM_THIS (This);
1363 return EFI_UNSUPPORTED;
1368 SlotNumber = SdNode->SlotNumber;
1371 SlotNumber = EmmcNode->SlotNumber;
1374 if (SlotNumber >= SD_MMC_HC_MAX_SLOT) {
1375 return EFI_NOT_FOUND;
1378 if (Private->Slot[SlotNumber].Enable) {
1382 return EFI_NOT_FOUND;
1423 return EFI_INVALID_PARAMETER;
1426 Private = SD_MMC_HC_PRIVATE_FROM_THIS (This);
1428 if (!Private->Slot[Slot].Enable) {
1429 return EFI_INVALID_PARAMETER;
1432 if (!Private->Slot[Slot].MediaPresent) {
1433 return EFI_NO_MEDIA;
1436 if (!Private->Slot[Slot].Initialized) {
1437 return EFI_DEVICE_ERROR;
1443 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
1446 !
IsNull (&Private->Queue, Link);
1451 Trb = SD_MMC_HC_TRB_FROM_THIS (Link);
1452 Trb->Packet->TransactionStatus = EFI_ABORTED;
1453 gBS->SignalEvent (Trb->Event);
1457 gBS->RestoreTPL (OldTpl);
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)
#define MESSAGING_DEVICE_PATH
UINTN EFIAPI DevicePathNodeLength(IN CONST VOID *Node)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS EmmcIdentification(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE
Clear for PCI controllers that can not genrate a DAC.
@ EfiPciIoAttributeOperationGet
@ EfiPciIoAttributeOperationEnable
@ EfiPciIoAttributeOperationSet
@ EfiPciIoAttributeOperationSupported
EFI_STATUS SdCardIdentification(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
VOID EFIAPI SdMmcPciHcEnumerateDevice(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI InitializeSdMmcPciHcDxe(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI SdMmcPciHcDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
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 EFIAPI SdMmcPassThruResetDevice(IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN UINT8 Slot)
EFI_STATUS SdMmcPassThruExecSyncTrb(IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
EFI_STATUS EFIAPI SdMmcPassThruGetSlotNumber(IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT UINT8 *Slot)
VOID EFIAPI ProcessAsyncTaskList(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI SdMmcPassThruGetNextSlot(IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN OUT UINT8 *Slot)
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 EFIAPI SdMmcPassThruBuildDevicePath(IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN UINT8 Slot, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
EFI_STATUS SdMmcHcReset(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
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 SdMmcWaitTrbResult(IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
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 SdMmcHcCardDetect(IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Slot, OUT BOOLEAN *MediaPresent)
EFI_STATUS SdMmcHcGetMaxCurrent(IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Slot, OUT UINT64 *MaxCurrent)
EFI_STATUS EFIAPI SdMmcHcGetSlotInfo(IN EFI_PCI_IO_PROTOCOL *PciIo, OUT UINT8 *FirstBar, OUT UINT8 *SlotNum)
EFI_STATUS SdMmcHcGetCapability(IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Slot, OUT SD_MMC_HC_SLOT_CAP *Capability)
EFI_STATUS SdMmcHcGetControllerVersion(IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Slot, OUT UINT16 *Version)
VOID DumpCapabilityReg(IN UINT8 Slot, IN SD_MMC_HC_SLOT_CAP *Capability)
EFI_STATUS EFIAPI EfiLibInstallDriverBindingComponentName2(IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)
EFI_PCI_IO_PROTOCOL_CONFIG Read