Skip to content

Commit 0760d5d

Browse files
Abe Kohandelbroonie
authored andcommitted
spi: dw: Add compatible for Intel Mount Evans SoC
The Intel Mount Evans SoC's Integrated Management Complex uses the SPI controller for access to a NOR SPI FLASH. However, the SoC doesn't provide a mechanism to override the native chip select signal. This driver doesn't use DMA for memory operations when a chip select override is not provided due to the native chip select timing behavior. As a result no DMA configuration is done for the controller and this configuration is not tested. The controller also has an errata where a full TX FIFO can result in data corruption. The suggested workaround is to never completely fill the FIFO. The TX FIFO has a size of 32 so the fifo_len is set to 31. Signed-off-by: Abe Kohandel <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 8098a93 commit 0760d5d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

drivers/spi/spi-dw-mmio.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,31 @@ static int dw_spi_intel_init(struct platform_device *pdev,
236236
return 0;
237237
}
238238

239+
/*
240+
* The Intel Mount Evans SoC's Integrated Management Complex uses the
241+
* SPI controller for access to a NOR SPI FLASH. However, the SoC doesn't
242+
* provide a mechanism to override the native chip select signal.
243+
*
244+
* This driver doesn't use DMA for memory operations when a chip select
245+
* override is not provided due to the native chip select timing behavior.
246+
* As a result no DMA configuration is done for the controller and this
247+
* configuration is not tested.
248+
*/
249+
static int dw_spi_mountevans_imc_init(struct platform_device *pdev,
250+
struct dw_spi_mmio *dwsmmio)
251+
{
252+
/*
253+
* The Intel Mount Evans SoC's Integrated Management Complex DW
254+
* apb_ssi_v4.02a controller has an errata where a full TX FIFO can
255+
* result in data corruption. The suggested workaround is to never
256+
* completely fill the FIFO. The TX FIFO has a size of 32 so the
257+
* fifo_len is set to 31.
258+
*/
259+
dwsmmio->dws.fifo_len = 31;
260+
261+
return 0;
262+
}
263+
239264
static int dw_spi_canaan_k210_init(struct platform_device *pdev,
240265
struct dw_spi_mmio *dwsmmio)
241266
{
@@ -405,6 +430,10 @@ static const struct of_device_id dw_spi_mmio_of_match[] = {
405430
{ .compatible = "snps,dwc-ssi-1.01a", .data = dw_spi_hssi_init},
406431
{ .compatible = "intel,keembay-ssi", .data = dw_spi_intel_init},
407432
{ .compatible = "intel,thunderbay-ssi", .data = dw_spi_intel_init},
433+
{
434+
.compatible = "intel,mountevans-imc-ssi",
435+
.data = dw_spi_mountevans_imc_init,
436+
},
408437
{ .compatible = "microchip,sparx5-spi", dw_spi_mscc_sparx5_init},
409438
{ .compatible = "canaan,k210-spi", dw_spi_canaan_k210_init},
410439
{ .compatible = "amd,pensando-elba-spi", .data = dw_spi_elba_init},

0 commit comments

Comments
 (0)