Skip to content

Commit 393c1a3

Browse files
Philip Rakitycjb
authored andcommitted
mmc: sdhci: Add pre and post reset processing for chip specific reset
Marvell pxa controllers have private registers that may need to be modified before and after a reset is done. For example, the SD reset operation, RESET_ALL, will reset the private registers to their default state. This will cause the clock adjustment registers that may have been programmed to have incorrect values. RESET_DATA sometimes needs to be delayed before the reset is done (depending on SoC) to enable any transactions being handled by the SDIO card to be completed. Needed in pre SD 3.0 silicon to handle clock gating. Implement hooks to allow this to happen. Signed-off-by: Philip Rakity <[email protected]> Signed-off-by: Chris Ball <[email protected]>
1 parent 4b01681 commit 393c1a3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/mmc/host/sdhci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask)
156156
if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
157157
ier = sdhci_readl(host, SDHCI_INT_ENABLE);
158158

159+
if (host->ops->platform_reset_enter)
160+
host->ops->platform_reset_enter(host, mask);
161+
159162
sdhci_writeb(host, mask, SDHCI_SOFTWARE_RESET);
160163

161164
if (mask & SDHCI_RESET_ALL)
@@ -176,6 +179,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask)
176179
mdelay(1);
177180
}
178181

182+
if (host->ops->platform_reset_exit)
183+
host->ops->platform_reset_exit(host, mask);
184+
179185
if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
180186
sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, ier);
181187
}

drivers/mmc/host/sdhci.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ struct sdhci_ops {
229229
void (*platform_send_init_74_clocks)(struct sdhci_host *host,
230230
u8 power_mode);
231231
unsigned int (*get_ro)(struct sdhci_host *host);
232+
void (*platform_reset_enter)(struct sdhci_host *host, u8 mask);
233+
void (*platform_reset_exit)(struct sdhci_host *host, u8 mask);
232234
};
233235

234236
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS

0 commit comments

Comments
 (0)