]> git.baikalelectronics.ru Git - uboot.git/commit
spi: dw: Actually mask interrupts
authorSean Anderson <seanga2@gmail.com>
Tue, 1 Mar 2022 10:35:43 +0000 (10:35 +0000)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Tue, 15 Mar 2022 09:43:11 +0000 (17:43 +0800)
commit6a5ee2c73ebafd9bc79831a04de5db681ef5931e
tree1c9c9f4b836f83aadde57cc699248eb75143592c
parentf0493dfa9fe9c098b973e0ac722c78d61df9fd1a
spi: dw: Actually mask interrupts

The designware spi driver unconditionally uses polling.

The comment to spi_hw_init() also states that the function should disable
interrupts.

According to the DesignWare DW_apb_ssi Databook, value 0xff in IMR enables
all interrupts. Since we want to mask all interrupts write 0x0 instead.

On the canaan k210 board, pressing the reset button twice to reset the
board will run u-boot. If u-boot boots Linux without having SPI interrupts
masked, Linux will hang as soon as interrupts are enabled, because of an
interrupt storm.

Properly masking the SPI interrupts in u-boot allows us to successfully
boot Linux, even after resetting the board.

Fixes: 5bef6fd79f94 ("spi: Add designware master SPI DM driver used on SoCFPGA")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
[Niklas: rewrite commit message]
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
drivers/spi/designware_spi.c