platform: msm_shared: Add support for cm_dll calibration

Sdcc version 3.3.0 uses cm dll4 circuit for hs400 calibration,
add support to perform the calibration based on the sdcc version.
Also ignore the cmd end bit mask during tuning.

CRs-Fixed: 636132
Change-Id: I3ee0d3dbe5acd3fcd3a948d736a83431a309ee52
diff --git a/platform/msm_shared/sdhci.c b/platform/msm_shared/sdhci.c
index ebaf942..a7f2258 100644
--- a/platform/msm_shared/sdhci.c
+++ b/platform/msm_shared/sdhci.c
@@ -449,7 +449,7 @@
 		if (host->tuning_in_progress)
 		{
 			err_status = REG_READ16(host, SDHCI_ERR_INT_STS_REG);
-			if ((err_status & SDHCI_CMD_CRC_MASK) || (err_status & SDHCI_DAT_END_BIT_MASK)
+			if ((err_status & SDHCI_CMD_CRC_MASK) || (err_status & SDHCI_CMD_END_BIT_MASK)
 				|| err_status & SDHCI_CMD_TIMEOUT_MASK)
 			{
 				sdhci_reset(host, (SOFT_RESET_CMD | SOFT_RESET_DATA));
@@ -899,6 +899,7 @@
 void sdhci_init(struct sdhci_host *host)
 {
 	uint32_t caps[2];
+	uint32_t version;
 
 	/* Read the capabilities register & store the info */
 	caps[0] = REG_READ32(host, SDHCI_CAPS_REG1);
@@ -938,6 +939,16 @@
 	/* SDR104 mode support */
 	host->caps.sdr104_support = (caps[1] & SDHCI_SDR104_MODE_MASK) ? 1 : 0;
 
+	version = readl(host->msm_host->pwrctl_base + MCI_VERSION);
+
+	host->major = (version & CORE_VERSION_MAJOR_MASK) >> CORE_VERSION_MAJOR_SHIFT;
+	host->minor = (version & CORE_VERSION_MINOR_MASK);
+
+	if (host->major == 0x1 && host->minor < 0x34)
+		host->use_cdclp533 = true;
+	else
+		host->use_cdclp533 = false;
+
 	/* Set bus power on */
 	sdhci_set_bus_power_on(host);