]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SdMmcPciHcDxe: Add controller version defines
authorJeff Brasen <jbrasen@nvidia.com>
Tue, 9 Oct 2018 17:50:36 +0000 (01:50 +0800)
committerHao Wu <hao.a.wu@intel.com>
Fri, 12 Oct 2018 07:46:04 +0000 (15:46 +0800)
Add SDHCI controller defines, this is useful as the version in the
register does not explictly map to a specification version. For example
vesion 4.10 of the specification is version 0x04.

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
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h

index 8c93933bc6311008351706aa938a73b05194e704..d3f77edfeaa68f1d84c3ec7149646e62e5cd69fe 100644 (file)
@@ -978,9 +978,9 @@ SdCardIdentification (
     return Status;\r
   }\r
 \r
-  if ((ControllerVer & 0xFF) == 2) {\r
+  if ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_300) {\r
     S18r = TRUE;\r
-  } else if (((ControllerVer & 0xFF) == 0) || ((ControllerVer & 0xFF) == 1)) {\r
+  } else if (((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_100) || ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_200)) {\r
     S18r = FALSE;\r
   } else {\r
     ASSERT (FALSE);\r
index 25771dc9de74a619ddcf9446807626901124e2e8..3b9a184bc4efcdd504a70ed1bd579fc8f14e368d 100644 (file)
@@ -782,7 +782,7 @@ SdMmcHcClockSupply (
   //\r
   // Set SDCLK Frequency Select and Internal Clock Enable fields in Clock Control register.\r
   //\r
-  if ((ControllerVer & 0xFF) == 2) {\r
+  if ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_300) {\r
     ASSERT (Divisor <= 0x3FF);\r
     ClockCtrl = ((Divisor & 0xFF) << 8) | ((Divisor & 0x300) >> 2);\r
   } else if (((ControllerVer & 0xFF) == 0) || ((ControllerVer & 0xFF) == 1)) {\r
index e389d52184f41a7d0b62ea52e983025d50080410..7e3f588e0a229952054aff1595971093ed3c34e1 100644 (file)
@@ -135,6 +135,16 @@ typedef struct {
   UINT32   Hs400:1;           // bit 63\r
 } SD_MMC_HC_SLOT_CAP;\r
 \r
+//\r
+// SD Host controller version\r
+//\r
+#define SD_MMC_HC_CTRL_VER_100      0x00\r
+#define SD_MMC_HC_CTRL_VER_200      0x01\r
+#define SD_MMC_HC_CTRL_VER_300      0x02\r
+#define SD_MMC_HC_CTRL_VER_400      0x03\r
+#define SD_MMC_HC_CTRL_VER_410      0x04\r
+#define SD_MMC_HC_CTRL_VER_420      0x05\r
+\r
 /**\r
   Dump the content of SD/MMC host controller's Capability Register.\r
 \r