Skip to content

Commit f92a80b

Browse files
committed
Merge tag 'mmc-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC host fixes from Ulf Hansson: - mtk-sd: Fix register settings for hs400(es) mode - sdhci_am654: Revert patch for start-signal-voltage-switch * tag 'mmc-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: mtk-sd: Fix register settings for hs400(es) mode Revert "mmc: sdhci_am654: Add sdhci_am654_start_signal_voltage_switch"
2 parents cabb162 + 3e68abf commit f92a80b

File tree

2 files changed

+20
-41
lines changed

2 files changed

+20
-41
lines changed

drivers/mmc/host/mtk-sd.c

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@
273273
#define MSDC_PAD_TUNE_CMD2_SEL BIT(21) /* RW */
274274

275275
#define PAD_DS_TUNE_DLY_SEL BIT(0) /* RW */
276+
#define PAD_DS_TUNE_DLY2_SEL BIT(1) /* RW */
276277
#define PAD_DS_TUNE_DLY1 GENMASK(6, 2) /* RW */
277278
#define PAD_DS_TUNE_DLY2 GENMASK(11, 7) /* RW */
278279
#define PAD_DS_TUNE_DLY3 GENMASK(16, 12) /* RW */
@@ -318,6 +319,7 @@
318319

319320
/* EMMC50_PAD_DS_TUNE mask */
320321
#define PAD_DS_DLY_SEL BIT(16) /* RW */
322+
#define PAD_DS_DLY2_SEL BIT(15) /* RW */
321323
#define PAD_DS_DLY1 GENMASK(14, 10) /* RW */
322324
#define PAD_DS_DLY3 GENMASK(4, 0) /* RW */
323325

@@ -2504,13 +2506,23 @@ static int msdc_execute_tuning(struct mmc_host *mmc, u32 opcode)
25042506
static int msdc_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_ios *ios)
25052507
{
25062508
struct msdc_host *host = mmc_priv(mmc);
2509+
25072510
host->hs400_mode = true;
25082511

2509-
if (host->top_base)
2510-
writel(host->hs400_ds_delay,
2511-
host->top_base + EMMC50_PAD_DS_TUNE);
2512-
else
2513-
writel(host->hs400_ds_delay, host->base + PAD_DS_TUNE);
2512+
if (host->top_base) {
2513+
if (host->hs400_ds_dly3)
2514+
sdr_set_field(host->top_base + EMMC50_PAD_DS_TUNE,
2515+
PAD_DS_DLY3, host->hs400_ds_dly3);
2516+
if (host->hs400_ds_delay)
2517+
writel(host->hs400_ds_delay,
2518+
host->top_base + EMMC50_PAD_DS_TUNE);
2519+
} else {
2520+
if (host->hs400_ds_dly3)
2521+
sdr_set_field(host->base + PAD_DS_TUNE,
2522+
PAD_DS_TUNE_DLY3, host->hs400_ds_dly3);
2523+
if (host->hs400_ds_delay)
2524+
writel(host->hs400_ds_delay, host->base + PAD_DS_TUNE);
2525+
}
25142526
/* hs400 mode must set it to 0 */
25152527
sdr_clr_bits(host->base + MSDC_PATCH_BIT2, MSDC_PATCH_BIT2_CFGCRCSTS);
25162528
/* to improve read performance, set outstanding to 2 */
@@ -2530,14 +2542,11 @@ static int msdc_execute_hs400_tuning(struct mmc_host *mmc, struct mmc_card *card
25302542
if (host->top_base) {
25312543
sdr_set_bits(host->top_base + EMMC50_PAD_DS_TUNE,
25322544
PAD_DS_DLY_SEL);
2533-
if (host->hs400_ds_dly3)
2534-
sdr_set_field(host->top_base + EMMC50_PAD_DS_TUNE,
2535-
PAD_DS_DLY3, host->hs400_ds_dly3);
2545+
sdr_clr_bits(host->top_base + EMMC50_PAD_DS_TUNE,
2546+
PAD_DS_DLY2_SEL);
25362547
} else {
25372548
sdr_set_bits(host->base + PAD_DS_TUNE, PAD_DS_TUNE_DLY_SEL);
2538-
if (host->hs400_ds_dly3)
2539-
sdr_set_field(host->base + PAD_DS_TUNE,
2540-
PAD_DS_TUNE_DLY3, host->hs400_ds_dly3);
2549+
sdr_clr_bits(host->base + PAD_DS_TUNE, PAD_DS_TUNE_DLY2_SEL);
25412550
}
25422551

25432552
host->hs400_tuning = true;

drivers/mmc/host/sdhci_am654.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ struct sdhci_am654_data {
155155
u32 tuning_loop;
156156

157157
#define SDHCI_AM654_QUIRK_FORCE_CDTEST BIT(0)
158-
#define SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA BIT(1)
159158
};
160159

161160
struct window {
@@ -357,29 +356,6 @@ static void sdhci_j721e_4bit_set_clock(struct sdhci_host *host,
357356
sdhci_set_clock(host, clock);
358357
}
359358

360-
static int sdhci_am654_start_signal_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
361-
{
362-
struct sdhci_host *host = mmc_priv(mmc);
363-
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
364-
struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host);
365-
int ret;
366-
367-
if ((sdhci_am654->quirks & SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA) &&
368-
ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
369-
if (!IS_ERR(mmc->supply.vqmmc)) {
370-
ret = mmc_regulator_set_vqmmc(mmc, ios);
371-
if (ret < 0) {
372-
pr_err("%s: Switching to 1.8V signalling voltage failed,\n",
373-
mmc_hostname(mmc));
374-
return -EIO;
375-
}
376-
}
377-
return 0;
378-
}
379-
380-
return sdhci_start_signal_voltage_switch(mmc, ios);
381-
}
382-
383359
static u8 sdhci_am654_write_power_on(struct sdhci_host *host, u8 val, int reg)
384360
{
385361
writeb(val, host->ioaddr + reg);
@@ -868,11 +844,6 @@ static int sdhci_am654_get_of_property(struct platform_device *pdev,
868844
if (device_property_read_bool(dev, "ti,fails-without-test-cd"))
869845
sdhci_am654->quirks |= SDHCI_AM654_QUIRK_FORCE_CDTEST;
870846

871-
/* Suppress v1p8 ena for eMMC and SD with vqmmc supply */
872-
if (!!of_parse_phandle(dev->of_node, "vmmc-supply", 0) ==
873-
!!of_parse_phandle(dev->of_node, "vqmmc-supply", 0))
874-
sdhci_am654->quirks |= SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA;
875-
876847
sdhci_get_of_property(pdev);
877848

878849
return 0;
@@ -969,7 +940,6 @@ static int sdhci_am654_probe(struct platform_device *pdev)
969940
goto err_pltfm_free;
970941
}
971942

972-
host->mmc_host_ops.start_signal_voltage_switch = sdhci_am654_start_signal_voltage_switch;
973943
host->mmc_host_ops.execute_tuning = sdhci_am654_execute_tuning;
974944

975945
pm_runtime_get_noresume(dev);

0 commit comments

Comments
 (0)