mmc: zynqmp: Add HS200 modes support for ZynqMP
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Tue, 29 May 2018 14:33:11 +0000 (20:03 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 31 May 2018 11:50:39 +0000 (13:50 +0200)
This patch adds HS200 suuport for ZynqMP and enables
the same for ZC1751 DC1 board which has eMMC on it.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
drivers/mmc/zynq_sdhci.c

index f5a33342fa64164836c1e42f1479123d367c35a4..96abf61e950418780b0de9a2d8718f97803bc545 100644 (file)
@@ -54,6 +54,7 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_CADENCE=y
 CONFIG_MISC=y
 CONFIG_DM_MMC=y
+CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_SPI_FLASH=y
index 1f6d053f96b33d98cd244b2694cd8bca1c7d6822..5b6d5256084c8dfad68e680bc6b6548c9dbe62f5 100644 (file)
@@ -32,12 +32,21 @@ struct arasan_sdhci_priv {
 };
 
 #if defined(CONFIG_ARCH_ZYNQMP)
+#define MMC_HS200_BUS_SPEED    5
+
 static const u8 mode2timing[] = {
-            [UHS_SDR12] = UHS_SDR12_BUS_SPEED,
-            [UHS_SDR25] = UHS_SDR25_BUS_SPEED,
-            [UHS_SDR50] = UHS_SDR50_BUS_SPEED,
-            [UHS_SDR104] = UHS_SDR104_BUS_SPEED,
-            [UHS_DDR50] = UHS_DDR50_BUS_SPEED,
+       [MMC_LEGACY] = UHS_SDR12_BUS_SPEED,
+       [SD_LEGACY] = UHS_SDR12_BUS_SPEED,
+       [MMC_HS] = HIGH_SPEED_BUS_SPEED,
+       [SD_HS] = HIGH_SPEED_BUS_SPEED,
+       [MMC_HS_52] = HIGH_SPEED_BUS_SPEED,
+       [MMC_DDR_52] = HIGH_SPEED_BUS_SPEED,
+       [UHS_SDR12] = UHS_SDR12_BUS_SPEED,
+       [UHS_SDR25] = UHS_SDR25_BUS_SPEED,
+       [UHS_SDR50] = UHS_SDR50_BUS_SPEED,
+       [UHS_DDR50] = UHS_DDR50_BUS_SPEED,
+       [UHS_SDR104] = UHS_SDR104_BUS_SPEED,
+       [MMC_HS_200] = MMC_HS200_BUS_SPEED,
 };
 
 #define SDHCI_HOST_CTRL2       0x3E
@@ -160,9 +169,6 @@ static void arasan_sdhci_set_tapdelay(struct sdhci_host *host)
        struct mmc *mmc = (struct mmc *)host->mmc;
        u8 uhsmode;
 
-       if (!IS_SD(mmc))
-               return;
-
        uhsmode = mode2timing[mmc->selected_mode];
 
        if (uhsmode >= UHS_SDR25_BUS_SPEED)
@@ -175,6 +181,9 @@ static void arasan_sdhci_set_control_reg(struct sdhci_host *host)
        struct mmc *mmc = (struct mmc *)host->mmc;
        u32 reg;
 
+       if (!IS_SD(mmc))
+               return;
+
        if (mmc->signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
                reg = sdhci_readw(host, SDHCI_HOST_CTRL2);
                reg |= SDHCI_18V_SIGNAL;