Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e113b07e authored by Sahitya Tummala's avatar Sahitya Tummala
Browse files

mmc: sdhci: Add new quirk to use PIO for eMMC tuning commands



Some controllers have an issue using ADMA for tuning commands.
Add a quirk - SDHCI_QUIRK2_USE_PIO_FOR_EMMC_TUNING to use PIO
mode for tuning commands on those host controllers.

Change-Id: Id9625167d7e235fb3a20a6193889c1654b5c0cd8
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent ddedef01
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -897,6 +897,10 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
	if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA))
		host->flags |= SDHCI_REQ_USE_DMA;

	if ((host->quirks2 & SDHCI_QUIRK2_USE_PIO_FOR_EMMC_TUNING) &&
		cmd->opcode == MMC_SEND_TUNING_BLOCK_HS200)
		host->flags &= ~SDHCI_REQ_USE_DMA;

	/*
	 * FIXME: This doesn't account for merging when mapping the
	 * scatterlist.
+5 −0
Original line number Diff line number Diff line
@@ -187,6 +187,11 @@ struct sdhci_host {
 * phase.
 */
#define SDHCI_QUIRK2_NON_STANDARD_TUNING (1 << 22)
/*
 * Some controllers may use PIO mode to workaround HW issues in ADMA for
 * eMMC tuning commands.
 */
#define SDHCI_QUIRK2_USE_PIO_FOR_EMMC_TUNING (1 << 23)

	int irq;		/* Device IRQ */
	void __iomem *ioaddr;	/* Mapped address */