aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@linaro.org>2018-02-10 14:52:54 +0800
committerHaojian Zhuang <haojian.zhuang@linaro.org>2018-02-10 15:01:19 +0800
commit389915f98330682871811e5df84195effb55a8d3 (patch)
tree6c05435e0d82ae0e09423d043b2f33c52c12e121
parent69a8c5fc495a5fd524c7187382c2b82bc253b2ad (diff)
downloadOpenPlatformPkg-389915f98330682871811e5df84195effb55a8d3.tar.gz
Drivers/SdMmc/DwMmcHcDxe: update interface of card detect
Update the interface of card detection with controller handle. Since eMMC and SD controllers are handled as two different controllers on HiKey, slot can't be used to distinguish which controller is working now. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
-rw-r--r--Drivers/SdMmc/DwMmcHcDxe/DwMmcHcDxe.c4
-rw-r--r--Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.c3
-rw-r--r--Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.h7
-rw-r--r--Include/Protocol/PlatformDwMmc.h1
4 files changed, 9 insertions, 6 deletions
diff --git a/Drivers/SdMmc/DwMmcHcDxe/DwMmcHcDxe.c b/Drivers/SdMmc/DwMmcHcDxe/DwMmcHcDxe.c
index 55e2fa4..f3c9156 100644
--- a/Drivers/SdMmc/DwMmcHcDxe/DwMmcHcDxe.c
+++ b/Drivers/SdMmc/DwMmcHcDxe/DwMmcHcDxe.c
@@ -248,7 +248,7 @@ return;
for (Slot = 0; Slot < DW_MMC_HC_MAX_SLOT; Slot++) {
if ((Private->Slot[Slot].Enable) && (Private->Slot[Slot].SlotType == RemovableSlot)) {
- Status = DwMmcHcCardDetect (Private->PciIo, Slot, &MediaPresent);
+ Status = DwMmcHcCardDetect (Private->PciIo, Private->ControllerHandle, Slot, &MediaPresent);
if ((Status == EFI_MEDIA_CHANGED) && !MediaPresent) {
DEBUG ((DEBUG_INFO, "DwMmcHcEnumerateDevice: device disconnected at slot %d of pci %p\n", Slot, Private->PciIo));
Private->Slot[Slot].MediaPresent = FALSE;
@@ -679,7 +679,7 @@ DwMmcHcDriverBindingStart (
DumpCapabilityReg (Slot, &Private->Capability[Slot]);
MediaPresent = FALSE;
- Status = DwMmcHcCardDetect (Private->PciIo, Slot, &MediaPresent);
+ Status = DwMmcHcCardDetect (Private->PciIo, Controller, Slot, &MediaPresent);
if (MediaPresent == FALSE) {
continue;
}
diff --git a/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.c b/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.c
index 533f911..3d03780 100644
--- a/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.c
+++ b/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.c
@@ -524,6 +524,7 @@ DwMmcHcGetMaxCurrent (
EFI_STATUS
DwMmcHcCardDetect (
IN EFI_PCI_IO_PROTOCOL *PciIo,
+ IN EFI_HANDLE Controller,
IN UINT8 Slot,
OUT BOOLEAN *MediaPresent
)
@@ -542,7 +543,7 @@ DwMmcHcCardDetect (
if (EFI_ERROR (Status)) {
return Status;
}
- *MediaPresent = PlatformDwMmc->CardDetect (Slot);
+ *MediaPresent = PlatformDwMmc->CardDetect (Controller, Slot);
return EFI_SUCCESS;
}
diff --git a/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.h b/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.h
index 228b20f..d9c6211 100644
--- a/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.h
+++ b/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.h
@@ -522,9 +522,10 @@ DwMmcHcGetMaxCurrent (
**/
EFI_STATUS
DwMmcHcCardDetect (
- IN EFI_PCI_IO_PROTOCOL *PciIo,
- IN UINT8 Slot,
- OUT BOOLEAN *MediaPresent
+ IN EFI_PCI_IO_PROTOCOL *PciIo,
+ IN EFI_HANDLE Controller,
+ IN UINT8 Slot,
+ OUT BOOLEAN *MediaPresent
);
/**
diff --git a/Include/Protocol/PlatformDwMmc.h b/Include/Protocol/PlatformDwMmc.h
index fe2259b..bf315c4 100644
--- a/Include/Protocol/PlatformDwMmc.h
+++ b/Include/Protocol/PlatformDwMmc.h
@@ -65,6 +65,7 @@ EFI_STATUS
typedef
BOOLEAN
(EFIAPI *PLATFORM_DW_MMC_CARD_DETECT) (
+ IN EFI_HANDLE Controller,
IN UINT8 Slot
);