spi: kirkwood_spi: implement workaround for FE-9144572
Subsystems (2)
PATCH v3 1/1 spi: kirkwood_spi: implement workaround for FE-9144572
Erratum NO. FE-9144572: The device SPI interface supports frequencies of up to 50 MHz. However, due to this erratum, when the device core clock is 250 MHz and the SPI interfaces is configured for 50MHz SPI clock and CPOL=CPHA=1 there might occur data corruption on reads from the SPI device.
Implement the workaround by setting the TMISO_SAMPLE value to 0x2 in the timing1 register.
---
I've based this as much as I can on the equivalent implementation in the Linux kernel[1], but there are differences in the u-boot spi infrastructure that means I can't be as specific when qualifying whether the workaround is needed.
[1] - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/spi/spi-orion.c#n248
Changes in v3:
- initialise drv_data for Armada XP and 375
Changes in v2:
- collect reviewed-by from Stefan
- remove mvebu_spi_type
- describe errata above mvebu_spi_50mhz_ac_timing_erratum
arch/arm/include/asm/arch-mvebu/spi.h | 6 ++++ drivers/spi/kirkwood_spi.c | 63 +++++++++++++++++++++++++++++++++-- 2 files changed, 66 insertions(+), 3 deletions(-)
arch/arm/include/asm/arch-mvebu/spi.h +6 -0
@@ -57,6 +57,12 @@ struct kwspi_registers {#define KWSPI_TXLSBF (1 << 13)#define KWSPI_RXLSBF (1 << 14) +/* Timing Parameters 1 Register */ +#define KW_SPI_TMISO_SAMPLE_OFFSET 6 +#define KW_SPI_TMISO_SAMPLE_MASK (0x3 << KW_SPI_TMISO_SAMPLE_OFFSET) +#define KW_SPI_TMISO_SAMPLE_1 (1 << KW_SPI_TMISO_SAMPLE_OFFSET) +#define KW_SPI_TMISO_SAMPLE_2 (2 << KW_SPI_TMISO_SAMPLE_OFFSET) +#define KWSPI_IRQUNMASK 1/* unmask SPI interrupt */ #define KWSPI_IRQMASK 0/* mask SPI interrupt */ #define KWSPI_SMEMRDIRQ 1/* SerMem data xfer ready irq */
drivers/spi/kirkwood_spi.c +60 -3
92 lines not on this page · raw message
Signature · 1 line
2.15.0