Skip to content

Commit 18b587b

Browse files
masahir0ystorulf
authored andcommitted
mmc: sdhci-cadence: set SDHCI_QUIRK2_PRESET_VALUE_BROKEN for UniPhier
The SDHCI_PRESET_FOR_* registers are not set for the UniPhier platform integration. (They are all read as zeros). Set the SDHCI_QUIRK2_PRESET_VALUE_BROKEN quirk flag. Otherwise, the High Speed DDR mode on the eMMC controller (MMC_TIMING_MMC_DDR52) would not work. I split the platform data to give no impact to other platforms, although the UniPhier platform is currently only the upstream user of this IP. The SDHCI_QUIRK2_PRESET_VALUE_BROKEN flag is set if the compatible string matches to "socionext,uniphier-sd4hc". Signed-off-by: Masahiro Yamada <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 3397b25 commit 18b587b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/mmc/host/sdhci-cadence.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/mmc/host.h>
1212
#include <linux/mmc/mmc.h>
1313
#include <linux/of.h>
14+
#include <linux/of_device.h>
1415

1516
#include "sdhci-pltfm.h"
1617

@@ -235,6 +236,11 @@ static const struct sdhci_ops sdhci_cdns_ops = {
235236
.set_uhs_signaling = sdhci_cdns_set_uhs_signaling,
236237
};
237238

239+
static const struct sdhci_pltfm_data sdhci_cdns_uniphier_pltfm_data = {
240+
.ops = &sdhci_cdns_ops,
241+
.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
242+
};
243+
238244
static const struct sdhci_pltfm_data sdhci_cdns_pltfm_data = {
239245
.ops = &sdhci_cdns_ops,
240246
};
@@ -334,6 +340,7 @@ static void sdhci_cdns_hs400_enhanced_strobe(struct mmc_host *mmc,
334340
static int sdhci_cdns_probe(struct platform_device *pdev)
335341
{
336342
struct sdhci_host *host;
343+
const struct sdhci_pltfm_data *data;
337344
struct sdhci_pltfm_host *pltfm_host;
338345
struct sdhci_cdns_priv *priv;
339346
struct clk *clk;
@@ -350,8 +357,12 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
350357
if (ret)
351358
return ret;
352359

360+
data = of_device_get_match_data(dev);
361+
if (!data)
362+
data = &sdhci_cdns_pltfm_data;
363+
353364
nr_phy_params = sdhci_cdns_phy_param_count(dev->of_node);
354-
host = sdhci_pltfm_init(pdev, &sdhci_cdns_pltfm_data,
365+
host = sdhci_pltfm_init(pdev, data,
355366
struct_size(priv, phy_params, nr_phy_params));
356367
if (IS_ERR(host)) {
357368
ret = PTR_ERR(host);
@@ -431,7 +442,10 @@ static const struct dev_pm_ops sdhci_cdns_pm_ops = {
431442
};
432443

433444
static const struct of_device_id sdhci_cdns_match[] = {
434-
{ .compatible = "socionext,uniphier-sd4hc" },
445+
{
446+
.compatible = "socionext,uniphier-sd4hc",
447+
.data = &sdhci_cdns_uniphier_pltfm_data,
448+
},
435449
{ .compatible = "cdns,sd4hc" },
436450
{ /* sentinel */ }
437451
};

0 commit comments

Comments
 (0)