9
0
Fork 0

spi: i.MX: reset controller on init

In rare cases the controller is does not work right after probe. When
this happens the registers show that the TXFIFO contains words, but
the transfer is never started. We observed that on some boards which
boot from SPI NOR. The xload SPI code leaves the controller enabled,
so the SPI controller is enabled during probe(). Disabling it before
usage (and thus resetting it) helps. We haven't found out why exactly
this happens.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2016-11-22 12:43:01 +01:00
parent 65fa5bc56d
commit 9da7e18573
1 changed files with 8 additions and 0 deletions

View File

@ -348,6 +348,13 @@ static u32 imx_xchg_single(struct spi_device *spi, u32 tx_val)
return imx_spi_maybe_reverse_bits(spi, rx_val);
}
static void cspi_2_3_init(struct imx_spi *imx)
{
void __iomem *base = imx->regs;
writel(0, base + CSPI_2_3_CTRL);
}
static void imx_spi_do_transfer(struct spi_device *spi)
{
struct imx_spi *imx = container_of(spi->master, struct imx_spi, master);
@ -519,6 +526,7 @@ static __maybe_unused struct spi_imx_devtype_data spi_imx_devtype_data_2_3 = {
.chipselect = cspi_2_3_chipselect,
.do_transfer = cspi_2_3_do_transfer,
.xchg_single = cspi_2_3_xchg_single,
.init = cspi_2_3_init,
};
static int imx_spi_dt_probe(struct imx_spi *imx)