]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SdMmcPciHcDxe: Allow additional SDHCI versions
authorJeff Brasen <jbrasen@nvidia.com>
Tue, 9 Oct 2018 17:50:37 +0000 (01:50 +0800)
committerHao Wu <hao.a.wu@intel.com>
Fri, 12 Oct 2018 07:46:10 +0000 (15:46 +0800)
Clock control is similar in SDHCI versions greater then version 2. Add
support for more recent versions of the controller specification.

SD card support for 1.8V is also present in controller versions 3 and
greater.

https://bugzilla.tianocore.org/show_bug.cgi?id=1233

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c

index d3f77edfeaa68f1d84c3ec7149646e62e5cd69fe..6ee9ed7f14e22ee4d3e8ff62d7a8ac337f959f32 100644 (file)
@@ -978,7 +978,8 @@ SdCardIdentification (
     return Status;\r
   }\r
 \r
-  if ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_300) {\r
+  if (((ControllerVer & 0xFF) >= SD_MMC_HC_CTRL_VER_300) &&\r
+      ((ControllerVer & 0xFF) <= SD_MMC_HC_CTRL_VER_420)) {\r
     S18r = TRUE;\r
   } else if (((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_100) || ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_200)) {\r
     S18r = FALSE;\r
index 3b9a184bc4efcdd504a70ed1bd579fc8f14e368d..bedc96863cc3ca13327cd919aaa0186574478ac1 100644 (file)
@@ -782,7 +782,8 @@ SdMmcHcClockSupply (
   //\r
   // Set SDCLK Frequency Select and Internal Clock Enable fields in Clock Control register.\r
   //\r
-  if ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_300) {\r
+  if (((ControllerVer & 0xFF) >= SD_MMC_HC_CTRL_VER_300) &&\r
+      ((ControllerVer & 0xFF) <= SD_MMC_HC_CTRL_VER_420)) {\r
     ASSERT (Divisor <= 0x3FF);\r
     ClockCtrl = ((Divisor & 0xFF) << 8) | ((Divisor & 0x300) >> 2);\r
   } else if (((ControllerVer & 0xFF) == 0) || ((ControllerVer & 0xFF) == 1)) {\r