Skip to contentSkip to conversation

mmc: tegra: Disable UHS-I modes for tegra114

PATCH In review Jon Hunter 7 participants 14 messages Feb 18, 2016 – Mar 16, 2016 6 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Jon Hunter

author
#0 lore raw

PATCH 1/1 mmc: tegra: Disable UHS-I modes for tegra114

SD card support for Tegra114 started failing after commit a8e326a911d3 ("mmc: tegra: implement module external clock change") was merged. This commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, only disable UHS-I modes for Tegra114 and in order to do this it is necessary to revert changes from commits a8e326a911d3 ("mmc: tegra: implement module external clock change"), c3c2384c3ac0 ("mmc: tegra: implement UHS tuning"), 7ad2ed1dfcbe ("mmc: tegra: enable UHS-I modes") that impact Tegra114. To do this so that UHS-I mode can be disabled for Tegra114 but not for Tegra124 separate the platform data, soc data and sdhci-ops so they are no longer common to both Tegra114 and Tegra124.

Fixes a8e326a911d3 ("mmc: tegra: implement module external clock change")
---
 drivers/mmc/host/sdhci-tegra.c | 42 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 5 deletions(-)
drivers/mmc/host/sdhci-tegra.c +37 -5
index 83c4bf7bc16c..bc7a0847e316 100644
@@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
 	/* Advertise UHS modes as supported by host */
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
 	sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
 
 	clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
@@ -315,6 +321,32 @@ static const struct sdhci_ops tegra114_sdhci_ops = {
 	.write_w    = tegra_sdhci_writew,
 	.write_l    = tegra_sdhci_writel,
 	.set_clock  = tegra_sdhci_set_clock,
+	.set_bus_width = sdhci_set_bus_width,
+	.reset      = tegra_sdhci_reset,
+	.set_uhs_signaling = sdhci_set_uhs_signaling,
+	.get_max_clock = sdhci_pltfm_clk_get_max_clock,
+};
+
+static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
+	.quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
+		  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
+		  SDHCI_QUIRK_SINGLE_POWER_WRITE |
+		  SDHCI_QUIRK_NO_HISPD_BIT |
+		  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
+		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
+	.ops  = &tegra114_sdhci_ops,
+};
+
+static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
+	.pdata = &sdhci_tegra114_pdata,
+};
+
+static const struct sdhci_ops tegra124_sdhci_ops = {
+	.get_ro     = tegra_sdhci_get_ro,
+	.read_w     = tegra_sdhci_readw,
+	.write_w    = tegra_sdhci_writew,
+	.write_l    = tegra_sdhci_writel,
+	.set_clock  = tegra_sdhci_set_clock,
 	.set_bus_width = tegra_sdhci_set_bus_width,
 	.reset      = tegra_sdhci_reset,
 	.platform_execute_tuning = tegra_sdhci_execute_tuning,
@@ -322,7 +354,7 @@ static const struct sdhci_ops tegra114_sdhci_ops = {
 	.get_max_clock = tegra_sdhci_get_max_clock,
 };
 
-static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
+static const struct sdhci_pltfm_data sdhci_tegra124_pdata = {
 	.quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
 		  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
 		  SDHCI_QUIRK_SINGLE_POWER_WRITE |
@@ -330,11 +362,11 @@ static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
 		  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
 		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
 	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
-	.ops  = &tegra114_sdhci_ops,
+	.ops  = &tegra124_sdhci_ops,
 };
 
-static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
-	.pdata = &sdhci_tegra114_pdata,
+static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
+	.pdata = &sdhci_tegra124_pdata,
 	.nvquirks = NVQUIRK_ENABLE_SDR50 |
 		    NVQUIRK_ENABLE_DDR50 |
 		    NVQUIRK_ENABLE_SDR104,
@@ -357,7 +389,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra210 = {
 
 static const struct of_device_id sdhci_tegra_dt_match[] = {
 	{ .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
-	{ .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 },
+	{ .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 },
 	{ .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
 	{ .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
 	{ .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },
Signature · 1 line
2.1.4

A message that is not in the archive (sent off-list or not yet received): 1455806924-14967-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

#2 lore raw

+Adrian

Quoted 12 lines · Jon Hunter

SD card support for Tegra114 started failing after commit a8e326a911d3 ("mmc: tegra: implement module external clock change") was merged. This commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, only disable UHS-I modes for Tegra114 and in order to do this it is necessary to revert changes from commits a8e326a911d3 ("mmc: tegra: implement module external clock change"), c3c2384c3ac0 ("mmc: tegra: implement UHS tuning"), 7ad2ed1dfcbe ("mmc: tegra: enable UHS-I modes") that impact Tegra114. To do this so that UHS-I mode can be disabled for Tegra114 but not for Tegra124 separate the platform data, soc data and sdhci-ops so they are no longer common to both Tegra114 and Tegra124.

Quoted 3 lines
Fixes a8e326a911d3 ("mmc: tegra: implement module external clock change")

This looks okay to me, although I need and ack from Adrian to pick up this for fixes. Adrian did recently step in as the maintainer for sdhci.

Kind regards
Uffe

Quoted 94 lines
---
 drivers/mmc/host/sdhci-tegra.c | 42 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 5 deletions(-)
drivers/mmc/host/sdhci-tegra.c +37 -6
index 83c4bf7bc16c..bc7a0847e316 100644
@@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
        /* Advertise UHS modes as supported by host */
        if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
                misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
        if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
                misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
        if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
                misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
        sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
 
        clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
@@ -315,6 +321,32 @@ static const struct sdhci_ops tegra114_sdhci_ops = {
        .write_w    = tegra_sdhci_writew,
        .write_l    = tegra_sdhci_writel,
        .set_clock  = tegra_sdhci_set_clock,
+       .set_bus_width = sdhci_set_bus_width,
+       .reset      = tegra_sdhci_reset,
+       .set_uhs_signaling = sdhci_set_uhs_signaling,
+       .get_max_clock = sdhci_pltfm_clk_get_max_clock,
+};
+
+static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
+       .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
+                 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
+                 SDHCI_QUIRK_SINGLE_POWER_WRITE |
+                 SDHCI_QUIRK_NO_HISPD_BIT |
+                 SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
+                 SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
+       .ops  = &tegra114_sdhci_ops,
+};
+
+static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
+       .pdata = &sdhci_tegra114_pdata,
+};
+
+static const struct sdhci_ops tegra124_sdhci_ops = {
+       .get_ro     = tegra_sdhci_get_ro,
+       .read_w     = tegra_sdhci_readw,
+       .write_w    = tegra_sdhci_writew,
+       .write_l    = tegra_sdhci_writel,
+       .set_clock  = tegra_sdhci_set_clock,
        .set_bus_width = tegra_sdhci_set_bus_width,
        .reset      = tegra_sdhci_reset,
        .platform_execute_tuning = tegra_sdhci_execute_tuning,
@@ -322,7 +354,7 @@ static const struct sdhci_ops tegra114_sdhci_ops = {
        .get_max_clock = tegra_sdhci_get_max_clock,
 };
 
-static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
+static const struct sdhci_pltfm_data sdhci_tegra124_pdata = {
        .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
                  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
                  SDHCI_QUIRK_SINGLE_POWER_WRITE |
@@ -330,11 +362,11 @@ static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
                  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
                  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
        .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
-       .ops  = &tegra114_sdhci_ops,
+       .ops  = &tegra124_sdhci_ops,
 };
 
-static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
-       .pdata = &sdhci_tegra114_pdata,
+static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
+       .pdata = &sdhci_tegra124_pdata,
        .nvquirks = NVQUIRK_ENABLE_SDR50 |
                    NVQUIRK_ENABLE_DDR50 |
                    NVQUIRK_ENABLE_SDR104,
@@ -357,7 +389,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra210 = {
 
 static const struct of_device_id sdhci_tegra_dt_match[] = {
        { .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
-       { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 },
+       { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 },
        { .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
        { .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
        { .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },
--

2.1.4

A message that is not in the archive (sent off-list or not yet received): CAPDyKFowEH=4PU1ErNxMA0=SiDT1Q86H0SfMuiH5jA+H7mvquA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#4 lore raw

Hi Adrian, Lucas,

Quoted 15 lines · Ulf Hansson

+Adrian

Quoted 12 lines · Jon Hunter

SD card support for Tegra114 started failing after commit a8e326a911d3 ("mmc: tegra: implement module external clock change") was merged. This commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, only disable UHS-I modes for Tegra114 and in order to do this it is necessary to revert changes from commits a8e326a911d3 ("mmc: tegra: implement module external clock change"), c3c2384c3ac0 ("mmc: tegra: implement UHS tuning"), 7ad2ed1dfcbe ("mmc: tegra: enable UHS-I modes") that impact Tegra114. To do this so that UHS-I mode can be disabled for Tegra114 but not for Tegra124 separate the platform data, soc data and sdhci-ops so they are no longer common to both Tegra114 and Tegra124.

Quoted 7 lines
Quoted 3 lines
Fixes a8e326a911d3 ("mmc: tegra: implement module external clock change")

This looks okay to me, although I need and ack from Adrian to pick up this for fixes. Adrian did recently step in as the maintainer for sdhci.

Are you guys ok with this? It would be good to get your ACK's so that Ulf can pick it up.

Jon

Quoted 94 lines
Quoted 94 lines
---
 drivers/mmc/host/sdhci-tegra.c | 42 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 5 deletions(-)
drivers/mmc/host/sdhci-tegra.c +37 -6
index 83c4bf7bc16c..bc7a0847e316 100644
@@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
        /* Advertise UHS modes as supported by host */
        if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
                misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
        if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
                misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
        if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
                misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
        sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
 
        clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
@@ -315,6 +321,32 @@ static const struct sdhci_ops tegra114_sdhci_ops = {
        .write_w    = tegra_sdhci_writew,
        .write_l    = tegra_sdhci_writel,
        .set_clock  = tegra_sdhci_set_clock,
+       .set_bus_width = sdhci_set_bus_width,
+       .reset      = tegra_sdhci_reset,
+       .set_uhs_signaling = sdhci_set_uhs_signaling,
+       .get_max_clock = sdhci_pltfm_clk_get_max_clock,
+};
+
+static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
+       .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
+                 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
+                 SDHCI_QUIRK_SINGLE_POWER_WRITE |
+                 SDHCI_QUIRK_NO_HISPD_BIT |
+                 SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
+                 SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
+       .ops  = &tegra114_sdhci_ops,
+};
+
+static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
+       .pdata = &sdhci_tegra114_pdata,
+};
+
+static const struct sdhci_ops tegra124_sdhci_ops = {
+       .get_ro     = tegra_sdhci_get_ro,
+       .read_w     = tegra_sdhci_readw,
+       .write_w    = tegra_sdhci_writew,
+       .write_l    = tegra_sdhci_writel,
+       .set_clock  = tegra_sdhci_set_clock,
        .set_bus_width = tegra_sdhci_set_bus_width,
        .reset      = tegra_sdhci_reset,
        .platform_execute_tuning = tegra_sdhci_execute_tuning,
@@ -322,7 +354,7 @@ static const struct sdhci_ops tegra114_sdhci_ops = {
        .get_max_clock = tegra_sdhci_get_max_clock,
 };
 
-static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
+static const struct sdhci_pltfm_data sdhci_tegra124_pdata = {
        .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
                  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
                  SDHCI_QUIRK_SINGLE_POWER_WRITE |
@@ -330,11 +362,11 @@ static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
                  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
                  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
        .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
-       .ops  = &tegra114_sdhci_ops,
+       .ops  = &tegra124_sdhci_ops,
 };
 
-static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
-       .pdata = &sdhci_tegra114_pdata,
+static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
+       .pdata = &sdhci_tegra124_pdata,
        .nvquirks = NVQUIRK_ENABLE_SDR50 |
                    NVQUIRK_ENABLE_DDR50 |
                    NVQUIRK_ENABLE_SDR104,
@@ -357,7 +389,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra210 = {
 
 static const struct of_device_id sdhci_tegra_dt_match[] = {
        { .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
-       { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 },
+       { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 },
        { .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
        { .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
        { .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },
--

2.1.4

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Am Donnerstag, den 25.02.2016, 09:42 +0000 schrieb Jon Hunter:

Quoted 31 lines

Hi Adrian, Lucas,

Quoted 28 lines · Ulf Hansson

+Adrian

Quoted 23 lines · Jon Hunter

SD card support for Tegra114 started failing after commit a8e326a911d3
("mmc: tegra: implement module external clock change") was merged. This
commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, only disable UHS-I modes for Tegra114
and in order to do this it is necessary to revert changes from commits
a8e326a911d3 ("mmc: tegra: implement module external clock change"),
c3c2384c3ac0 ("mmc: tegra: implement UHS tuning"), 7ad2ed1dfcbe ("mmc: tegra: enable UHS-I modes") that impact Tegra114. To do this so
that UHS-I mode can be disabled for Tegra114 but not for Tegra124 separate the platform data, soc data and sdhci-ops so they are no longer
common to both Tegra114 and Tegra124.

Fixes a8e326a911d3 ("mmc: tegra: implement module external clock

change")

Quoted 8 lines
Quoted 4 lines

This looks okay to me, although I need and ack from Adrian to pick up
this for fixes. Adrian did recently step in as the maintainer for sdhci.

Are you guys ok with this? It would be good to get your ACK's so that Ulf can pick it up.

I don't see why you need to duplicate the tegra114_sdhci_ops. Together with the first hunk of this patch, having soc_data_tegra114 not set any UHS-I capabilities (quirks) should be enough to disable UHS-I modes on Tegra114. The core should never call any of the UHS-I related functions from tegra114_sdhci_ops in that case.

Regards,
Lucas

Quoted 111 lines

Jon

Quoted 109 lines
Quoted 109 lines

---
 drivers/mmc/host/sdhci-tegra.c | 42
+++++++++++++++++++++++++++++++++++++-----

 1 file changed, 37 insertions(+), 5 deletions(-)
drivers/mmc/host/sdhci-tegra.c +6 -0
index 83c4bf7bc16c..bc7a0847e316 100644
@@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct
 sdhci_host *host, u8 mask)
         /* Advertise UHS modes as supported by host */
         if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
                 misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
         if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
                 misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
         if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
                 misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
         sdhci_writel(host, misc_ctrl,
 SDHCI_TEGRA_VENDOR_MISC_CTRL);

        clk_ctrl = sdhci_readl(host,
SDHCI_TEGRA_VENDOR_CLOCK_CTRL);

drivers/mmc/host/sdhci-tegra.c +26 -0
@@ -315,6 +321,32 @@ static const struct sdhci_ops
 tegra114_sdhci_ops = {
         .write_w    = tegra_sdhci_writew,
         .write_l    = tegra_sdhci_writel,
         .set_clock  = tegra_sdhci_set_clock,
+       .set_bus_width = sdhci_set_bus_width,
+       .reset      = tegra_sdhci_reset,
+       .set_uhs_signaling = sdhci_set_uhs_signaling,
+       .get_max_clock = sdhci_pltfm_clk_get_max_clock,
+};
+
+static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
+       .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
+                 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
+                 SDHCI_QUIRK_SINGLE_POWER_WRITE |
+                 SDHCI_QUIRK_NO_HISPD_BIT |
+                 SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
+                 SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
+       .ops  = &tegra114_sdhci_ops,
+};
+
+static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
+       .pdata = &sdhci_tegra114_pdata,
+};
+
+static const struct sdhci_ops tegra124_sdhci_ops = {
+       .get_ro     = tegra_sdhci_get_ro,
+       .read_w     = tegra_sdhci_readw,
+       .write_w    = tegra_sdhci_writew,
+       .write_l    = tegra_sdhci_writel,
+       .set_clock  = tegra_sdhci_set_clock,
         .set_bus_width = tegra_sdhci_set_bus_width,
         .reset      = tegra_sdhci_reset,

        .platform_execute_tuning = tegra_sdhci_execute_tuning,

drivers/mmc/host/sdhci-tegra.c +1 -1
@@ -322,7 +354,7 @@ static const struct sdhci_ops
 tegra114_sdhci_ops = {
         .get_max_clock = tegra_sdhci_get_max_clock,
  };
 
-static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
+static const struct sdhci_pltfm_data sdhci_tegra124_pdata = {

        .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | SDHCI_QUIRK_SINGLE_POWER_WRITE |

drivers/mmc/host/sdhci-tegra.c +0 -0
@@ -330,11 +362,11 @@ static const struct sdhci_pltfm_data
 sdhci_tegra114_pdata = {

                  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC | SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, -       .ops  = &tegra114_sdhci_ops,
+       .ops  = &tegra124_sdhci_ops,
 };

drivers/mmc/host/sdhci-tegra.c +2 -2
-static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
-       .pdata = &sdhci_tegra114_pdata,
+static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
+       .pdata = &sdhci_tegra124_pdata,

        .nvquirks = NVQUIRK_ENABLE_SDR50 |
                    NVQUIRK_ENABLE_DDR50 |
                    NVQUIRK_ENABLE_SDR104,

drivers/mmc/host/sdhci-tegra.c +0 -0
@@ -357,7 +389,7 @@ static const struct sdhci_tegra_soc_data
 soc_data_tegra210 = {
 
  static const struct of_device_id sdhci_tegra_dt_match[] = {

        { .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
-       { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 },
+       { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 },
        { .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
        { .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
        { .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },
--
2.1.4

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 37 lines · Lucas Stach

Am Donnerstag, den 25.02.2016, 09:42 +0000 schrieb Jon Hunter:

Quoted 36 lines

Hi Adrian, Lucas,

Quoted 32 lines · Ulf Hansson

+Adrian

Quoted 19 lines · Jon Hunter

SD card support for Tegra114 started failing after commit a8e326a911d3
("mmc: tegra: implement module external clock change") was merged. This
commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, only disable UHS-I modes for Tegra114
and in order to do this it is necessary to revert changes from commits
a8e326a911d3 ("mmc: tegra: implement module external clock change"),
c3c2384c3ac0 ("mmc: tegra: implement UHS tuning"), 7ad2ed1dfcbe ("mmc: tegra: enable UHS-I modes") that impact Tegra114. To do this so
that UHS-I mode can be disabled for Tegra114 but not for Tegra124 separate the platform data, soc data and sdhci-ops so they are no longer
common to both Tegra114 and Tegra124.

Quoted 4 lines
Fixes a8e326a911d3 ("mmc: tegra: implement module external clock

change")

This looks okay to me, although I need and ack from Adrian to pick up
this for fixes. Adrian did recently step in as the maintainer for sdhci.

Quoted 8 lines
Quoted 3 lines

Are you guys ok with this? It would be good to get your ACK's so that Ulf can pick it up.

I don't see why you need to duplicate the tegra114_sdhci_ops. Together with the first hunk of this patch, having soc_data_tegra114 not set any UHS-I capabilities (quirks) should be enough to disable UHS-I modes on Tegra114. The core should never call any of the UHS-I related functions from tegra114_sdhci_ops in that case.

I am on vacation until the middle of next week so I haven't had a chance to look at this, but it is not obvious if the changes to the ops are needed. Jon, please comment.

Quoted 115 lines

Regards,
Lucas

Quoted 111 lines

Jon

Quoted 109 lines
Quoted 109 lines
---
  drivers/mmc/host/sdhci-tegra.c | 42
+++++++++++++++++++++++++++++++++++++-----
  1 file changed, 37 insertions(+), 5 deletions(-)
drivers/mmc/host/sdhci-tegra.c +6 -0
index 83c4bf7bc16c..bc7a0847e316 100644
@@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct
 sdhci_host *host, u8 mask)
         /* Advertise UHS modes as supported by host */
         if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
                 misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
         if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
                 misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
         if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
                 misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
         sdhci_writel(host, misc_ctrl,
 SDHCI_TEGRA_VENDOR_MISC_CTRL);

clk_ctrl = sdhci_readl(host,
SDHCI_TEGRA_VENDOR_CLOCK_CTRL);

drivers/mmc/host/sdhci-tegra.c +26 -0
@@ -315,6 +321,32 @@ static const struct sdhci_ops
 tegra114_sdhci_ops = {
         .write_w    = tegra_sdhci_writew,
         .write_l    = tegra_sdhci_writel,
         .set_clock  = tegra_sdhci_set_clock,
+       .set_bus_width = sdhci_set_bus_width,
+       .reset      = tegra_sdhci_reset,
+       .set_uhs_signaling = sdhci_set_uhs_signaling,
+       .get_max_clock = sdhci_pltfm_clk_get_max_clock,
+};
+
+static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
+       .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
+                 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
+                 SDHCI_QUIRK_SINGLE_POWER_WRITE |
+                 SDHCI_QUIRK_NO_HISPD_BIT |
+                 SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
+                 SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
+       .ops  = &tegra114_sdhci_ops,
+};
+
+static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
+       .pdata = &sdhci_tegra114_pdata,
+};
+
+static const struct sdhci_ops tegra124_sdhci_ops = {
+       .get_ro     = tegra_sdhci_get_ro,
+       .read_w     = tegra_sdhci_readw,
+       .write_w    = tegra_sdhci_writew,
+       .write_l    = tegra_sdhci_writel,
+       .set_clock  = tegra_sdhci_set_clock,
         .set_bus_width = tegra_sdhci_set_bus_width,
         .reset      = tegra_sdhci_reset,

.platform_execute_tuning = tegra_sdhci_execute_tuning,

drivers/mmc/host/sdhci-tegra.c +1 -1
@@ -322,7 +354,7 @@ static const struct sdhci_ops
 tegra114_sdhci_ops = {
         .get_max_clock = tegra_sdhci_get_max_clock,
  };
 
-static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
+static const struct sdhci_pltfm_data sdhci_tegra124_pdata = {
         .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
                   SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |

SDHCI_QUIRK_SINGLE_POWER_WRITE |

drivers/mmc/host/sdhci-tegra.c +3 -3
@@ -330,11 +362,11 @@ static const struct sdhci_pltfm_data
 sdhci_tegra114_pdata = {
                   SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
                   SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
         .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
-       .ops  = &tegra114_sdhci_ops,
+       .ops  = &tegra124_sdhci_ops,
  };
 
-static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
-       .pdata = &sdhci_tegra114_pdata,
+static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
+       .pdata = &sdhci_tegra124_pdata,
         .nvquirks = NVQUIRK_ENABLE_SDR50 |
                     NVQUIRK_ENABLE_DDR50 |
                     NVQUIRK_ENABLE_SDR104,
drivers/mmc/host/sdhci-tegra.c +1 -1
@@ -357,7 +389,7 @@ static const struct sdhci_tegra_soc_data
 soc_data_tegra210 = {
 
  static const struct of_device_id sdhci_tegra_dt_match[] = {
         { .compatible = "nvidia,tegra210-sdhci", .data =
 &soc_data_tegra210 },
-       { .compatible = "nvidia,tegra124-sdhci", .data =
 &soc_data_tegra114 },
+       { .compatible = "nvidia,tegra124-sdhci", .data =

&soc_data_tegra124 },

         { .compatible = "nvidia,tegra114-sdhci", .data =
&soc_data_tegra114 },
         { .compatible = "nvidia,tegra30-sdhci", .data =
&soc_data_tegra30 },
         { .compatible = "nvidia,tegra20-sdhci", .data =

&soc_data_tegra20 },
--
2.1.4

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#10 lore raw
Quoted 47 lines · Adrian Hunter
Quoted 37 lines · Lucas Stach

Am Donnerstag, den 25.02.2016, 09:42 +0000 schrieb Jon Hunter:

Quoted 36 lines

Hi Adrian, Lucas,

Quoted 32 lines · Ulf Hansson

+Adrian

Quoted 19 lines · Jon Hunter

SD card support for Tegra114 started failing after commit a8e326a911d3
("mmc: tegra: implement module external clock change") was merged. This
commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, only disable UHS-I modes for Tegra114
and in order to do this it is necessary to revert changes from commits
a8e326a911d3 ("mmc: tegra: implement module external clock change"),
c3c2384c3ac0 ("mmc: tegra: implement UHS tuning"), 7ad2ed1dfcbe ("mmc: tegra: enable UHS-I modes") that impact Tegra114. To do this so
that UHS-I mode can be disabled for Tegra114 but not for Tegra124 separate the platform data, soc data and sdhci-ops so they are no longer
common to both Tegra114 and Tegra124.

Quoted 4 lines
Fixes a8e326a911d3 ("mmc: tegra: implement module external clock

change")

This looks okay to me, although I need and ack from Adrian to pick up
this for fixes. Adrian did recently step in as the maintainer for sdhci.

Quoted 8 lines
Quoted 3 lines

Are you guys ok with this? It would be good to get your ACK's so that Ulf can pick it up.

I don't see why you need to duplicate the tegra114_sdhci_ops. Together with the first hunk of this patch, having soc_data_tegra114 not set any UHS-I capabilities (quirks) should be enough to disable UHS-I modes on Tegra114. The core should never call any of the UHS-I related functions from tegra114_sdhci_ops in that case.

Quoted 3 lines

I am on vacation until the middle of next week so I haven't had a chance to look at this, but it is not obvious if the changes to the ops are needed. Jon, please comment.

No problem. I was not sure so reverted all the changes for Tegra114. I have posted an updated version [0] without the duplicate ops (forgot to mark as V2). I have tested this and confirm that it is working. Please ACK this if you are happy.

Jon

[0] http://marc.info/?l=linux-mmc&m=145647928317400&w=2

maintainer
#11 lore raw
In reply to Lucas Stach
Quoted 37 lines · Lucas Stach

Am Donnerstag, den 25.02.2016, 09:42 +0000 schrieb Jon Hunter:

Quoted 36 lines

Hi Adrian, Lucas,

Quoted 32 lines · Ulf Hansson

+Adrian

Quoted 19 lines · Jon Hunter

SD card support for Tegra114 started failing after commit a8e326a911d3
("mmc: tegra: implement module external clock change") was merged. This
commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, only disable UHS-I modes for Tegra114
and in order to do this it is necessary to revert changes from commits
a8e326a911d3 ("mmc: tegra: implement module external clock change"),
c3c2384c3ac0 ("mmc: tegra: implement UHS tuning"), 7ad2ed1dfcbe ("mmc: tegra: enable UHS-I modes") that impact Tegra114. To do this so
that UHS-I mode can be disabled for Tegra114 but not for Tegra124 separate the platform data, soc data and sdhci-ops so they are no longer
common to both Tegra114 and Tegra124.

Quoted 4 lines
Fixes a8e326a911d3 ("mmc: tegra: implement module external clock

change")

This looks okay to me, although I need and ack from Adrian to pick up
this for fixes. Adrian did recently step in as the maintainer for sdhci.

Quoted 8 lines
Quoted 3 lines

Are you guys ok with this? It would be good to get your ACK's so that Ulf can pick it up.

I don't see why you need to duplicate the tegra114_sdhci_ops. Together with the first hunk of this patch, having soc_data_tegra114 not set any UHS-I capabilities (quirks) should be enough to disable UHS-I modes on Tegra114. The core should never call any of the UHS-I related functions from tegra114_sdhci_ops in that case.

Ok, I will give that a try. I was not sure if I needed to completely remove all the changes or not and so I wanted to make it equivalent to what we had before to ensure there would be no other problems crop up. I will re-work and test and hopefully we can get this sorted.

Jon

author
#12 lore raw

PATCH 1/1 mmc: tegra: Disable UHS-I modes for tegra114

In reply to a message not in the archive

SD card support for Tegra114 started failing after commit a8e326a911d3 ("mmc: tegra: implement module external clock change") was merged. This commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, disable UHS-I modes for Tegra114 by separating the soc data structures for Tegra114 and Tegra124 so that UHS-I is still enabled for Tegra124 but not Tegra114.

Fixes a8e326a911d3 ("mmc: tegra: implement module external clock change")
---
 drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +11 -1
index 83c4bf7bc16c..212d51f08939 100644
@@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
 	/* Advertise UHS modes as supported by host */
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
 	sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
 
 	clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
@@ -335,6 +341,10 @@ static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
 
 static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
 	.pdata = &sdhci_tegra114_pdata,
+};
+
+static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
+	.pdata = &sdhci_tegra114_pdata,
 	.nvquirks = NVQUIRK_ENABLE_SDR50 |
 		    NVQUIRK_ENABLE_DDR50 |
 		    NVQUIRK_ENABLE_SDR104,
@@ -357,7 +367,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra210 = {
 
 static const struct of_device_id sdhci_tegra_dt_match[] = {
 	{ .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
-	{ .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 },
+	{ .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 },
 	{ .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
 	{ .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
 	{ .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },
Signature · 1 line
2.1.4

A message that is not in the archive (sent off-list or not yet received): 1456479257-12147-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

author
#14 lore raw

Sorry forgot to mark this as V2!

Quoted 56 lines · Jon Hunter

SD card support for Tegra114 started failing after commit a8e326a911d3 ("mmc: tegra: implement module external clock change") was merged. This commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, disable UHS-I modes for Tegra114 by separating the soc data structures for Tegra114 and Tegra124 so that UHS-I is still enabled for Tegra124 but not Tegra114.

Fixes a8e326a911d3 ("mmc: tegra: implement module external clock change")
---
 drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +11 -1
index 83c4bf7bc16c..212d51f08939 100644
@@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
 	/* Advertise UHS modes as supported by host */
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
 	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
 	sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
 
 	clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
@@ -335,6 +341,10 @@ static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
 
 static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
 	.pdata = &sdhci_tegra114_pdata,
+};
+
+static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
+	.pdata = &sdhci_tegra114_pdata,
 	.nvquirks = NVQUIRK_ENABLE_SDR50 |
 		    NVQUIRK_ENABLE_DDR50 |
 		    NVQUIRK_ENABLE_SDR104,
@@ -357,7 +367,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra210 = {
 
 static const struct of_device_id sdhci_tegra_dt_match[] = {
 	{ .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
-	{ .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 },
+	{ .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 },
 	{ .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
 	{ .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
 	{ .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },
Reviewed-by
#15 lore raw
In reply to a message not in the archive

Am Freitag, den 26.02.2016, 09:34 +0000 schrieb Jon Hunter:

Quoted 9 lines

SD card support for Tegra114 started failing after commit a8e326a911d3
("mmc: tegra: implement module external clock change") was merged. This
commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, disable UHS-I modes for Tegra114 by separating the soc data structures for Tegra114 and Tegra124 so that UHS-I is still enabled for Tegra124 but not Tegra114.

Quoted 4 lines
Fixes a8e326a911d3 ("mmc: tegra: implement module external clock

change")

This looks good to me now,

Quoted 55 lines

---
 drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-

 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci- renamed from drivers/mmc/host/sdhci-tegra.c +0 -0

tegra.c
index 83c4bf7bc16c..212d51f08939 100644

drivers/mmc/host/sdhci-tegra.c +6 -0
@@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct sdhci_host
 *host, u8 mask)
  	/* Advertise UHS modes as supported by host */
  	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
  		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
  	if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
  		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
  	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
  		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
+	else
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
  	sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);


  clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);

drivers/mmc/host/sdhci-tegra.c +0 -0
@@ -335,6 +341,10 @@ static const struct sdhci_pltfm_data
 sdhci_tegra114_pdata = {


 static const struct sdhci_tegra_soc_data soc_data_tegra114 = { .pdata = &sdhci_tegra114_pdata,

drivers/mmc/host/sdhci-tegra.c +4 -0
+};
+
+static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
+	.pdata = &sdhci_tegra114_pdata,

  .nvquirks = NVQUIRK_ENABLE_SDR50 |
      NVQUIRK_ENABLE_DDR50 |
      NVQUIRK_ENABLE_SDR104,

drivers/mmc/host/sdhci-tegra.c +0 -0
@@ -357,7 +367,7 @@ static const struct sdhci_tegra_soc_data
 soc_data_tegra210 = {


 static const struct of_device_id sdhci_tegra_dt_match[] = { { .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },

drivers/mmc/host/sdhci-tegra.c +0 -1
-	{ .compatible = "nvidia,tegra124-sdhci", .data =

&soc_data_tegra114 },

drivers/mmc/host/sdhci-tegra.c +1 -0
+	{ .compatible = "nvidia,tegra124-sdhci", .data =

&soc_data_tegra124 },
  { .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
  { .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
  { .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },

#16 lore raw
In reply to a message not in the archive
Quoted 7 lines · Jon Hunter

SD card support for Tegra114 started failing after commit a8e326a911d3 ("mmc: tegra: implement module external clock change") was merged. This commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, disable UHS-I modes for Tegra114 by separating the soc data structures for Tegra114 and Tegra124 so that UHS-I is still enabled for Tegra124 but not Tegra114.

Quoted 6 lines
Fixes a8e326a911d3 ("mmc: tegra: implement module external clock change")
---
 drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Acked-by
#17 lore raw
Quoted 8 lines · Thierry Reding
Quoted 7 lines · Jon Hunter

SD card support for Tegra114 started failing after commit a8e326a911d3 ("mmc: tegra: implement module external clock change") was merged. This commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, disable UHS-I modes for Tegra114 by separating the soc data structures for Tegra114 and Tegra124 so that UHS-I is still enabled for Tegra124 but not Tegra114.

Quoted 9 lines
Quoted 6 lines
Fixes a8e326a911d3 ("mmc: tegra: implement module external clock change")
---
 drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Applied
#18 lore raw
In reply to a message not in the archive
Quoted 10 lines · Jon Hunter

SD card support for Tegra114 started failing after commit a8e326a911d3 ("mmc: tegra: implement module external clock change") was merged. This commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, disable UHS-I modes for Tegra114 by separating the soc data structures for Tegra114 and Tegra124 so that UHS-I is still enabled for Tegra124 but not Tegra114.

Fixes a8e326a911d3 ("mmc: tegra: implement module external clock change")

Thanks, applied for fixes!

Kind regards
Uffe

Quoted 48 lines
---
 drivers/mmc/host/sdhci-tegra.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +11 -2
index 83c4bf7bc16c..212d51f08939 100644
@@ -147,10 +147,16 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
        /* Advertise UHS modes as supported by host */
        if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
                misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
        if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
                misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
        if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
                misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
+       else
+               misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
        sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
 
        clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
@@ -335,6 +341,10 @@ static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
 
 static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
        .pdata = &sdhci_tegra114_pdata,
+};
+
+static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
+       .pdata = &sdhci_tegra114_pdata,
        .nvquirks = NVQUIRK_ENABLE_SDR50 |
                    NVQUIRK_ENABLE_DDR50 |
                    NVQUIRK_ENABLE_SDR104,
@@ -357,7 +367,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra210 = {
 
 static const struct of_device_id sdhci_tegra_dt_match[] = {
        { .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
-       { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 },
+       { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 },
        { .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
        { .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
        { .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },
--

2.1.4

#19 lore raw
Quoted 8 lines · Ulf Hansson
Quoted 7 lines · Jon Hunter

SD card support for Tegra114 started failing after commit a8e326a911d3 ("mmc: tegra: implement module external clock change") was merged. This commit was part of a series to enable UHS-I modes for Tegra. To workaround this problem for now, disable UHS-I modes for Tegra114 by separating the soc data structures for Tegra114 and Tegra124 so that UHS-I is still enabled for Tegra124 but not Tegra114.

Quoted 5 lines
Quoted 3 lines
Fixes a8e326a911d3 ("mmc: tegra: implement module external clock change")

Thanks, applied for fixes!

Unfortunate I failed to send this in a PR to Linus within the 4.5 rc cycle, apologize for the inconvenience!
Instead I have this queued for 4.6 and I have added a stable tag to it.

[...]

Kind regards
Uffe