| From 92c10528525804e8d66057a3796dca497ab0476b Mon Sep 17 00:00:00 2001 |
| From: Geert Uytterhoeven <geert+renesas@glider.be> |
| Date: Thu, 7 Dec 2017 11:09:21 +0100 |
| Subject: [PATCH 0162/1795] spi: rspi: Do not set SPCR_SPE in |
| qspi_set_config_register() |
| |
| The R-Car Gen2 Hardware User Manual Rev. 2.00 states: |
| |
| If the master/slave mode select bit (MSTR) is modified while the SPI |
| function enable bit (SPE) is set to 1 (that is, this module is |
| enabled), the subsequent operation cannot be guaranteed. |
| |
| Hence do not set SPCR_SPE when setting SPCR_MSTR, just like the |
| .set_config_register() implementations for other RSPI variants do. |
| |
| Note that when booted from QSPI, the boot loader will have set SPCR_MSTR |
| already, hence usually the bit is never modified by the Linux driver. |
| |
| Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| Signed-off-by: Mark Brown <broonie@kernel.org> |
| (cherry picked from commit b458a3490e46dddd5b63f59b458c9b6d2284a63f) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| --- |
| drivers/spi/spi-rspi.c | 4 ++-- |
| 1 file changed, 2 insertions(+), 2 deletions(-) |
| |
| diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c |
| index 2ce875764ca6..0835a8d88fb8 100644 |
| --- a/drivers/spi/spi-rspi.c |
| +++ b/drivers/spi/spi-rspi.c |
| @@ -377,8 +377,8 @@ static int qspi_set_config_register(struct rspi_data *rspi, int access_size) |
| /* Sets SPCMD */ |
| rspi_write16(rspi, rspi->spcmd, RSPI_SPCMD0); |
| |
| - /* Enables SPI function in master mode */ |
| - rspi_write8(rspi, SPCR_SPE | SPCR_MSTR, RSPI_SPCR); |
| + /* Sets RSPI mode */ |
| + rspi_write8(rspi, SPCR_MSTR, RSPI_SPCR); |
| |
| return 0; |
| } |
| -- |
| 2.19.0 |
| |