aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2014-11-20 11:24:17 -0500
committerMark Brown <broonie@kernel.org>2014-11-21 13:12:42 -0500
commit194ed900cac2070175c6e6bf6d23e6bb7400a0f2 (patch)
treec8fe90cddf110c794e35109e7c91b9a183036881 /drivers/spi
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
spi: fsl-spi: Don't use cpm_command on CPM1
On CPM1, when the SPI parameter RAM is relocated to somewhere else than the default location, in accordance with freescale documentation (refer micropatch SPI application note EB662), init RX/TX params command shall not be used because it doesn't take into account the new location, and overwrites data that is in original location of SPI param ram at addresses SCC2 param base + (u32*)0x88 (u16*)0x90 (u32*)0x98 (u16*)0xA0, hence breaking activity on SCC2 if SCC2 is used in a mode like QMC for instance. Therefore, the action shall be done manually as described by freescale and as was already partly done by the driver. Reported-by: Patrick Vasseur <patrick.vasseur@c-s.fr> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Tested-by: Patrick Vasseur <patrick.vasseur@c-s.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-fsl-cpm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-cpm.c b/drivers/spi/spi-fsl-cpm.c
index c5dd20beee22..e85ab1cb17a2 100644
--- a/drivers/spi/spi-fsl-cpm.c
+++ b/drivers/spi/spi-fsl-cpm.c
@@ -56,12 +56,15 @@ void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi)
56 qe_issue_cmd(QE_INIT_TX_RX, mspi->subblock, 56 qe_issue_cmd(QE_INIT_TX_RX, mspi->subblock,
57 QE_CR_PROTOCOL_UNSPECIFIED, 0); 57 QE_CR_PROTOCOL_UNSPECIFIED, 0);
58 } else { 58 } else {
59 cpm_command(CPM_SPI_CMD, CPM_CR_INIT_TRX);
60 if (mspi->flags & SPI_CPM1) { 59 if (mspi->flags & SPI_CPM1) {
60 out_be32(&mspi->pram->rstate, 0);
61 out_be16(&mspi->pram->rbptr, 61 out_be16(&mspi->pram->rbptr,
62 in_be16(&mspi->pram->rbase)); 62 in_be16(&mspi->pram->rbase));
63 out_be32(&mspi->pram->tstate, 0);
63 out_be16(&mspi->pram->tbptr, 64 out_be16(&mspi->pram->tbptr,
64 in_be16(&mspi->pram->tbase)); 65 in_be16(&mspi->pram->tbase));
66 } else {
67 cpm_command(CPM_SPI_CMD, CPM_CR_INIT_TRX);
65 } 68 }
66 } 69 }
67} 70}