Skip to content

Commit d072527

Browse files
committed
Merge tag 'mmc-v7.0-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fixes from Ulf Hansson: - sdhci: Fix timing selection for 1-bit bus width - sdhci-pci-gli: Fix DMA write corruption for GL9750 * tag 'mmc-v7.0-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci: fix timing selection for 1-bit bus width mmc: sdhci-pci-gli: fix GL9750 DMA write corruption
2 parents f374ff7 + 5e3486e commit d072527

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

drivers/mmc/host/sdhci-pci-gli.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
#define GLI_9750_MISC_TX1_DLY_VALUE 0x5
6969
#define SDHCI_GLI_9750_MISC_SSC_OFF BIT(26)
7070

71+
#define SDHCI_GLI_9750_GM_BURST_SIZE 0x510
72+
#define SDHCI_GLI_9750_GM_BURST_SIZE_R_OSRC_LMT GENMASK(17, 16)
73+
7174
#define SDHCI_GLI_9750_TUNING_CONTROL 0x540
7275
#define SDHCI_GLI_9750_TUNING_CONTROL_EN BIT(4)
7376
#define GLI_9750_TUNING_CONTROL_EN_ON 0x1
@@ -345,10 +348,16 @@ static void gli_set_9750(struct sdhci_host *host)
345348
u32 misc_value;
346349
u32 parameter_value;
347350
u32 control_value;
351+
u32 burst_value;
348352
u16 ctrl2;
349353

350354
gl9750_wt_on(host);
351355

356+
/* clear R_OSRC_Lmt to avoid DMA write corruption */
357+
burst_value = sdhci_readl(host, SDHCI_GLI_9750_GM_BURST_SIZE);
358+
burst_value &= ~SDHCI_GLI_9750_GM_BURST_SIZE_R_OSRC_LMT;
359+
sdhci_writel(host, burst_value, SDHCI_GLI_9750_GM_BURST_SIZE);
360+
352361
driving_value = sdhci_readl(host, SDHCI_GLI_9750_DRIVING);
353362
pll_value = sdhci_readl(host, SDHCI_GLI_9750_PLL);
354363
sw_ctrl_value = sdhci_readl(host, SDHCI_GLI_9750_SW_CTRL);

drivers/mmc/host/sdhci.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4532,8 +4532,15 @@ int sdhci_setup_host(struct sdhci_host *host)
45324532
* their platform code before calling sdhci_add_host(), and we
45334533
* won't assume 8-bit width for hosts without that CAP.
45344534
*/
4535-
if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
4535+
if (host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA) {
4536+
host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50);
4537+
if (host->quirks2 & SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400)
4538+
host->caps1 &= ~SDHCI_SUPPORT_HS400;
4539+
mmc->caps2 &= ~(MMC_CAP2_HS200 | MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
4540+
mmc->caps &= ~(MMC_CAP_DDR | MMC_CAP_UHS);
4541+
} else {
45364542
mmc->caps |= MMC_CAP_4_BIT_DATA;
4543+
}
45374544

45384545
if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
45394546
mmc->caps &= ~MMC_CAP_CMD23;

0 commit comments

Comments
 (0)