summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorWeijie Gao <weijie.gao@mediatek.com>2023-07-19 12:16:02 +0300
committerTom Rini <trini@konsulko.com>2023-08-03 16:40:49 +0300
commitb43512d0468a7e409fc2a8d5130d5a2efdee1b3f (patch)
tree1f4ba80e21946c887fa86cfb35558039890b9a85 /drivers/spi
parent793e6230118032a099ec42a1ea67f434721edcc0 (diff)
downloadu-boot-b43512d0468a7e409fc2a8d5130d5a2efdee1b3f.tar.xz
spi: mtk_spim: clear IRQ enable bits
In u-boot we don't use IRQ. Instead, we poll busy bit in SPI_STATUS. However these IRQ enable bits may be set in previous boot stage (BootROM). If we leave these bits not cleared, although u-boot has disabled IRQ and nothing will happen, the linux kernel may encounter panic during initializing the spim driver due to IRQ event happens before IRQ handler is properly setup. This patch clear IRQ bits to prevent this from happening. Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/mtk_spim.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/spi/mtk_spim.c b/drivers/spi/mtk_spim.c
index 3a742d160c..418e586b91 100644
--- a/drivers/spi/mtk_spim.c
+++ b/drivers/spi/mtk_spim.c
@@ -242,6 +242,9 @@ static int mtk_spim_hw_init(struct spi_slave *slave)
reg_val &= ~SPI_CMD_SAMPLE_SEL;
}
+ /* Disable interrupt enable for pause mode & normal mode */
+ reg_val &= ~(SPI_CMD_PAUSE_IE | SPI_CMD_FINISH_IE);
+
/* disable dma mode */
reg_val &= ~(SPI_CMD_TX_DMA | SPI_CMD_RX_DMA);