lantiq: Print the status register whenever an error occurs

This should help finding potential problems with the SPI driver.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

SVN-Revision: 47209
This commit is contained in:
John Crispin 2015-10-19 10:08:29 +00:00
parent 2c7d536780
commit b7e4c8d3bf
2 changed files with 6 additions and 2 deletions

View 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);
+

View 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,989 @@
@@ -0,0 +1,991 @@
+/*
+ * Lantiq SoC SPI controller
+ *
@ -750,6 +750,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);
+