From f70babda2a22208e18402d15ee91adcfe9bec39c Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Mon, 20 Sep 2021 18:57:00 +0800 Subject: [PATCH] spi: rockchip-sfc: Wait for SFC DMA finished when thunder boot Change-Id: Ia7b47231a1a3fabb059d734228443e52fa4ffa99 Signed-off-by: Jon Lin --- drivers/spi/spi-rockchip-sfc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c index d8539ddad020..dca91a975c51 100644 --- a/drivers/spi/spi-rockchip-sfc.c +++ b/drivers/spi/spi-rockchip-sfc.c @@ -785,6 +785,15 @@ static int rockchip_sfc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, sfc); + if (IS_ENABLED(CONFIG_ROCKCHIP_THUNDER_BOOT)) { + u32 status; + + if (readl_poll_timeout(sfc->regbase + SFC_SR, status, + !(status & SFC_SR_IS_BUSY), 10, + 500 * USEC_PER_MSEC)) + dev_err(dev, "Wait for SFC idle timeout!\n"); + } + ret = rockchip_sfc_init(sfc); if (ret) goto err_irq;