spi: fix initial SPI_SR value in spi-fsl-dspi
authorAngelo Dureghello <angelo@sysam.it>
Wed, 26 Dec 2018 21:45:06 +0000 (22:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:22:22 +0000 (09:22 +0200)
[ Upstream commit aa54c1c9d90e6db75190813907190fadcce1bf45 ]

On ColdFire mcf54418, using DSPI_DMA_MODE mode, spi transfers
at first boot stage are not succeding:

m25p80 spi0.1: unrecognized JEDEC id bytes: 00, 00, 00

The reason is the SPI_SR initial value set by the driver, that
is not clearing (not setting to 1) the RF_DF flag. After a tour
on the dspi hw modules that use this driver(Vybrid, ColdFire and
ls1021a) a better init value for SR register has been set.

Signed-off-by: Angelo Dureghello <angelo@sysam.it>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-fsl-dspi.c

index cce9e34306787d0ee0c72ad39906281fc9c120d3..6da70a62e1964893e3361237e02d2424b97e31ec 100644 (file)
@@ -76,7 +76,7 @@
 #define SPI_SR                 0x2c
 #define SPI_SR_EOQF            0x10000000
 #define SPI_SR_TCFQF           0x80000000
-#define SPI_SR_CLEAR           0xdaad0000
+#define SPI_SR_CLEAR           0x9aaf0000
 
 #define SPI_RSER_TFFFE         BIT(25)
 #define SPI_RSER_TFFFD         BIT(24)