summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorJason Wu <jason.wu@petalogix.com>2012-11-23 15:05:08 +1000
committerMichal Simek <michal.simek@xilinx.com>2013-02-04 12:09:49 +0100
commit85e9c65f8a9615ac11257939e5dbd601ee811be4 (patch)
treeda0a56263a9daa5033feb7cf978cf5d8c03ca095 /drivers/spi
parent9fc6a06ad36994db21ca77013a8ba1c2a88e359c (diff)
spi: xilinx_spi: Perform software reset during slave setup
to make sure it is in the clear state. Signed-off-by: Jason Wu <huanyu@xilinx.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/xilinx_spi.c2
-rw-r--r--drivers/spi/xilinx_spi.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index 52a4134f18..db01cc25f7 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -99,6 +99,8 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
debug("%s: bus:%i cs:%i base:%p mode:%x max_hz:%d\n", __func__,
bus, cs, xilspi->regs, xilspi->mode, xilspi->freq);
+ writel(SPISSR_RESET_VALUE, &xilspi->regs->srr);
+
return &xilspi->slave;
}
diff --git a/drivers/spi/xilinx_spi.h b/drivers/spi/xilinx_spi.h
index 32610d2a12..69d0b94058 100644
--- a/drivers/spi/xilinx_spi.h
+++ b/drivers/spi/xilinx_spi.h
@@ -119,6 +119,9 @@ struct xilinx_spi_reg {
#define SPIRFOR_OCYVAL_POS 0
#define SPIRFOR_OCYVAL_MASK (0xf << SPIRFOR_OCYVAL_POS)
+/* SPI Software Reset Register (ssr) */
+#define SPISSR_RESET_VALUE 0x0a
+
struct xilinx_spi_slave {
struct spi_slave slave;
struct xilinx_spi_reg *regs;