mmc: dw_mmc: fix the IDMAC sw reset
IDMAC may not be cleaned in driver probe if it has been already used in boot time. So IDMAC needs sw reset newly. And DMA interface reset precedes the internal DMAC reset. Additionally SDMMC_IDMAC_SWRESET is replaced with magic code. Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com> Acked-by: Will Newton <will.newton@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
Родитель
eed6c63cef
Коммит
141a712a4e
|
@ -418,6 +418,8 @@ static int dw_mci_idmac_init(struct dw_mci *host)
|
||||||
p->des3 = host->sg_dma;
|
p->des3 = host->sg_dma;
|
||||||
p->des0 = IDMAC_DES0_ER;
|
p->des0 = IDMAC_DES0_ER;
|
||||||
|
|
||||||
|
mci_writel(host, BMOD, SDMMC_IDMAC_SWRESET);
|
||||||
|
|
||||||
/* Mask out interrupts - get Tx & Rx complete only */
|
/* Mask out interrupts - get Tx & Rx complete only */
|
||||||
mci_writel(host, IDINTEN, SDMMC_IDMAC_INT_NI | SDMMC_IDMAC_INT_RI |
|
mci_writel(host, IDINTEN, SDMMC_IDMAC_INT_NI | SDMMC_IDMAC_INT_RI |
|
||||||
SDMMC_IDMAC_INT_TI);
|
SDMMC_IDMAC_INT_TI);
|
||||||
|
@ -1724,7 +1726,8 @@ static void dw_mci_work_routine_card(struct work_struct *work)
|
||||||
|
|
||||||
#ifdef CONFIG_MMC_DW_IDMAC
|
#ifdef CONFIG_MMC_DW_IDMAC
|
||||||
ctrl = mci_readl(host, BMOD);
|
ctrl = mci_readl(host, BMOD);
|
||||||
ctrl |= 0x01; /* Software reset of DMA */
|
/* Software reset of DMA */
|
||||||
|
ctrl |= SDMMC_IDMAC_SWRESET;
|
||||||
mci_writel(host, BMOD, ctrl);
|
mci_writel(host, BMOD, ctrl);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1949,10 +1952,6 @@ int dw_mci_probe(struct dw_mci *host)
|
||||||
spin_lock_init(&host->lock);
|
spin_lock_init(&host->lock);
|
||||||
INIT_LIST_HEAD(&host->queue);
|
INIT_LIST_HEAD(&host->queue);
|
||||||
|
|
||||||
|
|
||||||
host->dma_ops = host->pdata->dma_ops;
|
|
||||||
dw_mci_init_dma(host);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the host data width - this assumes that HCON has been set with
|
* Get the host data width - this assumes that HCON has been set with
|
||||||
* the correct values.
|
* the correct values.
|
||||||
|
@ -1980,10 +1979,11 @@ int dw_mci_probe(struct dw_mci *host)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset all blocks */
|
/* Reset all blocks */
|
||||||
if (!mci_wait_reset(&host->dev, host)) {
|
if (!mci_wait_reset(&host->dev, host))
|
||||||
ret = -ENODEV;
|
return -ENODEV;
|
||||||
goto err_dmaunmap;
|
|
||||||
}
|
host->dma_ops = host->pdata->dma_ops;
|
||||||
|
dw_mci_init_dma(host);
|
||||||
|
|
||||||
/* Clear the interrupts for the host controller */
|
/* Clear the interrupts for the host controller */
|
||||||
mci_writel(host, RINTSTS, 0xFFFFFFFF);
|
mci_writel(host, RINTSTS, 0xFFFFFFFF);
|
||||||
|
@ -2169,14 +2169,14 @@ int dw_mci_resume(struct dw_mci *host)
|
||||||
if (host->vmmc)
|
if (host->vmmc)
|
||||||
regulator_enable(host->vmmc);
|
regulator_enable(host->vmmc);
|
||||||
|
|
||||||
if (host->dma_ops->init)
|
|
||||||
host->dma_ops->init(host);
|
|
||||||
|
|
||||||
if (!mci_wait_reset(&host->dev, host)) {
|
if (!mci_wait_reset(&host->dev, host)) {
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (host->dma_ops->init)
|
||||||
|
host->dma_ops->init(host);
|
||||||
|
|
||||||
/* Restore the old value at FIFOTH register */
|
/* Restore the old value at FIFOTH register */
|
||||||
mci_writel(host, FIFOTH, host->fifoth_val);
|
mci_writel(host, FIFOTH, host->fifoth_val);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче