mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
mmc: dw_mmc: imporove thunder boot
Make the hclk_mmc is available before accessing the registers. Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com> Change-Id: I2ab1556eb2376c77d8e05a66eb64cb367c7919d3
This commit is contained in:
@@ -3287,28 +3287,6 @@ int dw_mci_probe(struct dw_mci *host)
|
||||
int width, i, ret = 0;
|
||||
u32 fifo_size;
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT
|
||||
struct device *dev = host->dev;
|
||||
u32 intr;
|
||||
|
||||
if (device_property_read_bool(host->dev, "supports-emmc")) {
|
||||
if (readl_poll_timeout(host->regs + SDMMC_STATUS,
|
||||
fifo_size,
|
||||
!(fifo_size & (BIT(10) | GENMASK(7, 4))),
|
||||
0, 500 * USEC_PER_MSEC))
|
||||
dev_err(dev, "Controller is occupied!\n");
|
||||
|
||||
if (readl_poll_timeout(host->regs + SDMMC_IDSTS,
|
||||
fifo_size, !(fifo_size & GENMASK(16, 13)),
|
||||
0, 500 * USEC_PER_MSEC))
|
||||
dev_err(dev, "DMA is still running!\n");
|
||||
|
||||
intr = mci_readl(host, RINTSTS);
|
||||
if (intr & DW_MCI_CMD_ERROR_FLAGS || intr & DW_MCI_DATA_ERROR_FLAGS)
|
||||
BUG_ON(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!host->pdata) {
|
||||
host->pdata = dw_mci_parse_dt(host);
|
||||
if (PTR_ERR(host->pdata) == -EPROBE_DEFER) {
|
||||
@@ -3329,6 +3307,22 @@ int dw_mci_probe(struct dw_mci *host)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT
|
||||
if (device_property_read_bool(host->dev, "supports-emmc")) {
|
||||
if (readl_poll_timeout(host->regs + SDMMC_STATUS,
|
||||
fifo_size,
|
||||
!(fifo_size & (BIT(10) | GENMASK(7, 4))),
|
||||
0, 500 * USEC_PER_MSEC))
|
||||
dev_err(host->dev, "Controller is occupied!\n");
|
||||
|
||||
if (readl_poll_timeout(host->regs + SDMMC_IDSTS,
|
||||
fifo_size, !(fifo_size & GENMASK(16, 13)),
|
||||
0, 500 * USEC_PER_MSEC))
|
||||
dev_err(host->dev, "DMA is still running!\n");
|
||||
|
||||
BUG_ON(mci_readl(host, RINTSTS) & DW_MCI_ERROR_FLAGS);
|
||||
}
|
||||
#endif
|
||||
|
||||
host->ciu_clk = devm_clk_get(host->dev, "ciu");
|
||||
if (IS_ERR(host->ciu_clk)) {
|
||||
|
||||
Reference in New Issue
Block a user