All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/2] mmc: sdhci: Update sdhci_send_command() to handle HS200
@ 2018-05-29 14:33 Siva Durga Prasad Paladugu
  2018-05-29 14:33 ` [U-Boot] [PATCH v2 2/2] mmc: zynqmp: Add HS200 modes support for ZynqMP Siva Durga Prasad Paladugu
  2018-06-01  8:43 ` [U-Boot] [PATCH v2 1/2] mmc: sdhci: Update sdhci_send_command() to handle HS200 Michal Simek
  0 siblings, 2 replies; 4+ messages in thread
From: Siva Durga Prasad Paladugu @ 2018-05-29 14:33 UTC (permalink / raw)
  To: u-boot

This patch updates sdhci_send_command() to handle MMC
HS200 tuning command.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
---
Changes from v1:
- Fixed spacings as per comment
---
 drivers/mmc/sdhci.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 400f87e..40e28ab 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -161,7 +161,8 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
        /* We shouldn't wait for data inihibit for stop commands, even
           though they might use busy signaling */
        if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION ||
-           cmd->cmdidx ==  MMC_CMD_SEND_TUNING_BLOCK)
+           cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK ||
+           cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)
                mask &= ~SDHCI_DATA_INHIBIT;

        while (sdhci_readl(host, SDHCI_PRESENT_STATE) & mask) {
@@ -183,7 +184,8 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
        sdhci_writel(host, SDHCI_INT_ALL_MASK, SDHCI_INT_STATUS);

        mask = SDHCI_INT_RESPONSE;
-       if (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK)
+       if (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK ||
+           cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)
                mask = SDHCI_INT_DATA_AVAIL;

        if (!(cmd->resp_type & MMC_RSP_PRESENT))
@@ -201,7 +203,8 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
                flags |= SDHCI_CMD_CRC;
        if (cmd->resp_type & MMC_RSP_OPCODE)
                flags |= SDHCI_CMD_INDEX;
-       if (data || cmd->cmdidx ==  MMC_CMD_SEND_TUNING_BLOCK)
+       if (data || cmd->cmdidx ==  MMC_CMD_SEND_TUNING_BLOCK ||
+           cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)
                flags |= SDHCI_CMD_DATA;

        /* Set Transfer mode regarding to data flag */
--
2.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v2 2/2] mmc: zynqmp: Add HS200 modes support for ZynqMP
  2018-05-29 14:33 [U-Boot] [PATCH v2 1/2] mmc: sdhci: Update sdhci_send_command() to handle HS200 Siva Durga Prasad Paladugu
@ 2018-05-29 14:33 ` Siva Durga Prasad Paladugu
  2018-06-01  8:43   ` Michal Simek
  2018-06-01  8:43 ` [U-Boot] [PATCH v2 1/2] mmc: sdhci: Update sdhci_send_command() to handle HS200 Michal Simek
  1 sibling, 1 reply; 4+ messages in thread
From: Siva Durga Prasad Paladugu @ 2018-05-29 14:33 UTC (permalink / raw)
  To: u-boot

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>
---
Changes from v1:
- Fixed coding style as per comment
---
 configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig |  1 +
 drivers/mmc/zynq_sdhci.c                         | 25 ++++++++++++++++--------
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
index f5a3334..96abf61 100644
--- a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
+++ b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
@@ -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
diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
index f99731f..ea5af47 100644
--- a/drivers/mmc/zynq_sdhci.c
+++ b/drivers/mmc/zynq_sdhci.c
@@ -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;
--
2.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v2 1/2] mmc: sdhci: Update sdhci_send_command() to handle HS200
  2018-05-29 14:33 [U-Boot] [PATCH v2 1/2] mmc: sdhci: Update sdhci_send_command() to handle HS200 Siva Durga Prasad Paladugu
  2018-05-29 14:33 ` [U-Boot] [PATCH v2 2/2] mmc: zynqmp: Add HS200 modes support for ZynqMP Siva Durga Prasad Paladugu
@ 2018-06-01  8:43 ` Michal Simek
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Simek @ 2018-06-01  8:43 UTC (permalink / raw)
  To: u-boot

On 29.5.2018 16:33, Siva Durga Prasad Paladugu wrote:
> This patch updates sdhci_send_command() to handle MMC
> HS200 tuning command.
> 
> Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
> ---
> Changes from v1:
> - Fixed spacings as per comment
> ---
>  drivers/mmc/sdhci.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index 400f87e..40e28ab 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -161,7 +161,8 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
>  	/* We shouldn't wait for data inihibit for stop commands, even
>  	   though they might use busy signaling */
>  	if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION ||
> -	    cmd->cmdidx ==  MMC_CMD_SEND_TUNING_BLOCK)
> +	    cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK ||
> +	    cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)
>  		mask &= ~SDHCI_DATA_INHIBIT;
>  
>  	while (sdhci_readl(host, SDHCI_PRESENT_STATE) & mask) {
> @@ -183,7 +184,8 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
>  	sdhci_writel(host, SDHCI_INT_ALL_MASK, SDHCI_INT_STATUS);
>  
>  	mask = SDHCI_INT_RESPONSE;
> -	if (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK)
> +	if (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK ||
> +	    cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)
>  		mask = SDHCI_INT_DATA_AVAIL;
>  
>  	if (!(cmd->resp_type & MMC_RSP_PRESENT))
> @@ -201,7 +203,8 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
>  		flags |= SDHCI_CMD_CRC;
>  	if (cmd->resp_type & MMC_RSP_OPCODE)
>  		flags |= SDHCI_CMD_INDEX;
> -	if (data || cmd->cmdidx ==  MMC_CMD_SEND_TUNING_BLOCK)
> +	if (data || cmd->cmdidx ==  MMC_CMD_SEND_TUNING_BLOCK ||
> +	    cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)
>  		flags |= SDHCI_CMD_DATA;
>  
>  	/* Set Transfer mode regarding to data flag */
> 

Applied.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v2 2/2] mmc: zynqmp: Add HS200 modes support for ZynqMP
  2018-05-29 14:33 ` [U-Boot] [PATCH v2 2/2] mmc: zynqmp: Add HS200 modes support for ZynqMP Siva Durga Prasad Paladugu
@ 2018-06-01  8:43   ` Michal Simek
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2018-06-01  8:43 UTC (permalink / raw)
  To: u-boot

On 29.5.2018 16:33, Siva Durga Prasad Paladugu wrote:
> 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>
> ---
> Changes from v1:
> - Fixed coding style as per comment
> ---
>  configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig |  1 +
>  drivers/mmc/zynq_sdhci.c                         | 25 ++++++++++++++++--------
>  2 files changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
> index f5a3334..96abf61 100644
> --- a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
> +++ b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
> @@ -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
> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
> index f99731f..ea5af47 100644
> --- a/drivers/mmc/zynq_sdhci.c
> +++ b/drivers/mmc/zynq_sdhci.c
> @@ -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;
> 

Applied.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-06-01  8:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29 14:33 [U-Boot] [PATCH v2 1/2] mmc: sdhci: Update sdhci_send_command() to handle HS200 Siva Durga Prasad Paladugu
2018-05-29 14:33 ` [U-Boot] [PATCH v2 2/2] mmc: zynqmp: Add HS200 modes support for ZynqMP Siva Durga Prasad Paladugu
2018-06-01  8:43   ` Michal Simek
2018-06-01  8:43 ` [U-Boot] [PATCH v2 1/2] mmc: sdhci: Update sdhci_send_command() to handle HS200 Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.