lantiq: Print the status register whenever an error occurs
[openwrt/svn-archive/archive.git] / target / linux / lantiq / patches-3.18 / 0033-SPI-MIPS-lantiq-adds-spi-xway.patch
index ed00b343368dfb9d6a0b9b853dc85d0519762133..81e5d39f21f8029d52999eba9b4699f11c02e847 100644 (file)
@@ -42,7 +42,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +obj-$(CONFIG_SPI_XWAY)                        += spi-xway.o
 --- /dev/null
 +++ b/drivers/spi/spi-xway.c
-@@ -0,0 +1,975 @@
+@@ -0,0 +1,977 @@
 +/*
 + * Lantiq SoC SPI controller
 + *
@@ -744,6 +744,8 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +      /* Disable all interrupts */
 +      ltq_spi_reg_clearbit(hw, LTQ_SPI_IRNEN_ALL, LTQ_SPI_IRNEN);
 +
++      dev_err(hw->dev, "error %x\n", ltq_spi_reg_read(hw, LTQ_SPI_STAT));
++
 +      /* Clear all error flags */
 +      ltq_spi_reg_write(hw, LTQ_SPI_WHBSTATE_CLR_ERRORS, LTQ_SPI_WHBSTATE);
 +
@@ -913,7 +915,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +      /* Read module capabilities */
 +      id = ltq_spi_reg_read(hw, LTQ_SPI_ID);
 +      hw->txfs = (id >> LTQ_SPI_ID_TXFS_SHIFT) & LTQ_SPI_ID_TXFS_MASK;
-+      hw->rxfs = (id >> LTQ_SPI_ID_TXFS_SHIFT) & LTQ_SPI_ID_TXFS_MASK;
++      hw->rxfs = (id >> LTQ_SPI_ID_RXFS_SHIFT) & LTQ_SPI_ID_RXFS_MASK;
 +      hw->dma_support = (id & LTQ_SPI_ID_CFG) ? 1 : 0;
 +
 +      ltq_spi_config_mode_set(hw);