diff options
author | Jason Wu <jason.wu@petalogix.com> | 2012-11-23 15:05:08 +1000 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2013-02-04 12:09:49 +0100 |
commit | 85e9c65f8a9615ac11257939e5dbd601ee811be4 (patch) | |
tree | da0a56263a9daa5033feb7cf978cf5d8c03ca095 /drivers | |
parent | 9fc6a06ad36994db21ca77013a8ba1c2a88e359c (diff) | |
download | u-boot-imx-85e9c65f8a9615ac11257939e5dbd601ee811be4.zip u-boot-imx-85e9c65f8a9615ac11257939e5dbd601ee811be4.tar.gz u-boot-imx-85e9c65f8a9615ac11257939e5dbd601ee811be4.tar.bz2 |
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')
-rw-r--r-- | drivers/spi/xilinx_spi.c | 2 | ||||
-rw-r--r-- | drivers/spi/xilinx_spi.h | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c index 52a4134..db01cc2 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 32610d2..69d0b94 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; |