Skip to content

Commit

Permalink
spi: bcm-qspi: MSPI_SPCR0_MSB MSTR bit exists only on legacy controllers
Browse files Browse the repository at this point in the history
Set MASTER bit on the MSPI_SPCR0_MSB only for legacy MSPI and HIF_MSPI
controllers.

Fixes: fa236a7 ("spi: bcm-qspi: Add Broadcom MSPI driver")
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Link: https://lore.kernel.org/r/20200420190853.45614-10-kdasu.kdev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Kamal Dasu authored and Mark Brown committed Apr 21, 2020
1 parent ab2b493 commit 2f5f530
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/spi/spi-bcm-qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,11 +576,17 @@ static void bcm_qspi_hw_set_parms(struct bcm_qspi *qspi,
spcr = clamp_val(spbr, bcm_qspi_spbr_min(qspi), QSPI_SPBR_MAX);
bcm_qspi_write(qspi, MSPI, MSPI_SPCR0_LSB, spcr);

spcr = MSPI_MASTER_BIT;
if (!qspi->mspi_maj_rev)
/* legacy controller */
spcr = MSPI_MASTER_BIT;
else
spcr = 0;

/* for 16 bit the data should be zero */
if (xp->bits_per_word != 16)
spcr |= xp->bits_per_word << 2;
spcr |= xp->mode & 3;

bcm_qspi_write(qspi, MSPI, MSPI_SPCR0_MSB, spcr);

if (bcm_qspi_has_fastbr(qspi)) {
Expand Down

0 comments on commit 2f5f530

Please sign in to comment.