]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SdMmcPciHcDxe: Remove clock stop from HS200 switch
authorAlbecki, Mateusz <mateusz.albecki@intel.com>
Thu, 26 Sep 2019 14:27:42 +0000 (22:27 +0800)
committerHao A Wu <hao.a.wu@intel.com>
Sun, 29 Sep 2019 01:11:16 +0000 (09:11 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2218

Stopping the SD clock before switching host controller
bus timing is only necessary if preset value enable is
set in host controller. Code that performs switch to
HS200 doesn't check this condition right now and we also
don't do the SD clock stop before any other bus timing switch
in host controller. Since the driver is generally not ready to support
host controller with preset value enable set we removed this
code.

Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Tested-by: Hao A Wu <hao.a.wu@intel.com>
Tested-by: Marcin Wojtas <mw@semihalf.com>
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c

index 3f4a8e5413d111eefba6547a47ee60666df6e7a5..bd704902863db50400fc9755dc3d7692cefdc172 100644 (file)
@@ -837,7 +837,6 @@ EmmcSwitchToHS200 (
   )\r
 {\r
   EFI_STATUS               Status;\r
-  UINT16                   ClockCtrl;\r
   SD_MMC_HC_PRIVATE_DATA  *Private;\r
 \r
   Private = SD_MMC_HC_PRIVATE_FROM_THIS (PassThru);\r
@@ -851,40 +850,12 @@ EmmcSwitchToHS200 (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  //\r
-  // Stop bus clock at first\r
-  //\r
-  Status = SdMmcHcStopClock (PciIo, Slot);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
 \r
   Status = SdMmcHcUhsSignaling (Private->ControllerHandle, PciIo, Slot, BusMode->BusTiming);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
-  //\r
-  // Wait Internal Clock Stable in the Clock Control register to be 1 before set SD Clock Enable bit\r
-  //\r
-  Status = SdMmcHcWaitMmioSet (\r
-             PciIo,\r
-             Slot,\r
-             SD_MMC_HC_CLOCK_CTRL,\r
-             sizeof (ClockCtrl),\r
-             BIT1,\r
-             BIT1,\r
-             SD_MMC_HC_GENERIC_TIMEOUT\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  //\r
-  // Set SD Clock Enable in the Clock Control register to 1\r
-  //\r
-  ClockCtrl = BIT2;\r
-  Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_CLOCK_CTRL, sizeof (ClockCtrl), &ClockCtrl);\r
-\r
   Status = EmmcSwitchBusTiming (PciIo, PassThru, Slot, Rca, BusMode->DriverStrength, BusMode->BusTiming, BusMode->ClockFreq);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r