aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTony Lin <tony.lin@freescale.com>2011-08-24 17:10:31 +0800
committerTony Lin <tony.lin@freescale.com>2011-08-24 17:13:40 +0800
commitc02f706c153c82a2493663505e1681663d391fcb (patch)
tree7b881a8ba0c5f265e8d6182034fb6bdb10e024b5 /drivers
parente2b04649eb350ea49f71603af73950f5857ec9ea (diff)
ENGR00155288 [mx6q]sd dat1 glitch causes system panic
some sd cards insertion will cause a glitch on sd dat1 which is also a card interrupt signal. Thus the wrongly generated card interrupt will make system panic because there's no registered sdio interrupt handler. the patch fixes this issue. Signed-off-by: Tony Lin <tony.lin@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index e98d341c74c..1ddfa470bdd 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -394,6 +394,7 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
struct clk *clk;
int err;
struct pltfm_imx_data *imx_data;
+ u32 reg;
clk = clk_get(mmc_dev(host->mmc), NULL);
if (IS_ERR(clk)) {
@@ -440,6 +441,20 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
host->tuning_step = SDHCI_TUNE_CTRL_STEP;
}
+ /* disable card interrupt enable bit, and clear status bit
+ * the default value of this enable bit is 1, but it should
+ * be 0 regarding to standard host controller spec 2.1.3.
+ * if this bit is 1, it may cause some problems.
+ * there's dat1 glitch when some cards inserting into the slot,
+ * thus wrongly generate a card interrupt that will cause
+ * system panic because it lacks of sdio handler
+ * following code will solve the problem.
+ */
+ reg = sdhci_readl(host, SDHCI_INT_ENABLE);
+ reg &= ~SDHCI_INT_CARD_INT;
+ sdhci_writel(host, reg, SDHCI_INT_ENABLE);
+ sdhci_writel(host, SDHCI_INT_CARD_INT, SDHCI_INT_STATUS);
+
if (boarddata) {
/* Device is always present, e.x, populated emmc device */
if (boarddata->always_present) {