Skip to content

arm64: dts: imx93-kontron: set correct lpspi for eeram and assign clock

EERAM was assigned to an incorrect lpspi bus in device tree.

In this MR:

  • fixed lpspi bus number for EERAM
  • assigned clock and clock rate for the correct lpspi bus

Note: there is still an issue with dma setup:

[    2.213476] fsl_lpspi 42720000.spi: dma setup error -19, use pio

There are following commits in mainline kernel, that add dma support for lpspi and lpi2c:

commit cd6cb1fff35aa519b3cb2d53477b01fc0f1cf088
Author: Peng Fan <peng.fan@nxp.com>
Date:   Fri Apr 19 11:36:58 2024 +0800

    arm64: dts: imx93: add dma support for lpspi[1..8]
    
    Add dma support for lpspi[1..8]
    
    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Reviewed-by: Frank Li <Frank.Li@nxp.com>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>
    
commit 7eb9efd28f117b3f14d1c14794e4131075a4dc29
Author: Peng Fan <peng.fan@nxp.com>
Date:   Fri Apr 19 11:36:57 2024 +0800

    arm64: dts: imx93: add dma support for lpi2c[1..8]
    
    Add dma support for lpi2c[1..8].
    
    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Reviewed-by: Frank Li <Frank.Li@nxp.com>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>

commit 76c54d53aaa0c349442764c0f639450a05089707
Author: Peng Fan <peng.fan@nxp.com>
Date:   Fri Apr 19 11:36:56 2024 +0800

    arm64: dts: imx93: use FSL_EDMA_RX for rx channel
    
    Use FSL_EDMA_RX for dma rx channel bitmask, which is intuitive.
    
    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Reviewed-by: Frank Li <Frank.Li@nxp.com>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>

But EERAM stops working with them:

root@kontron-mx93:~# cp /dev/mtdblock0 mtd1
[   50.878707] fsl_lpspi 42720000.spi: I/O Error in DMA TX
[   50.886702] mchp48l640 spi0.0: SPI transfer failed: -110
[   50.894724] spi_master spi0: failed to transfer one message from queue
[   50.906875] spi_master spi0: noqueue transfer failed
[   50.912009] I/O error, dev mtdblock0, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 2 prio class 0
[   52.958724] fsl_lpspi 42720000.spi: I/O Error in DMA TX
[   52.966702] mchp48l640 spi0.0: SPI transfer failed: -110
[   52.974721] spi_master spi0: failed to transfer one message from queue
[   52.986869] spi_master spi0: noqueue transfer failed
[   52.992000] I/O error, dev mtdblock0, sector 8 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
[   55.042702] fsl_lpspi 42720000.spi: I/O Error in DMA TX
[   55.047969] mchp48l640 spi0.0: SPI transfer failed: -110
[   55.053310] spi_master spi0: failed to transfer one message from queue
[   55.059852] spi_master spi0: noqueue transfer failed
[   55.064841] I/O error, dev mtdblock0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[   55.073514] Buffer I/O error on dev mtdblock0, logical block 0, async page read
cp: error reading '/dev/mtdblock0': Input/output error
root@kontron-mx93:~# 

So due to the following reasons I decided not to apply them for now:

  • while it may be an issue with lpspi8 only (NXP imx93-14x14-evk-sja1105 removes dma for lpspi8), we can`t really test if DMA support is working for other busses
  • EERAM already works without DMA
Edited by Mikhail Vaniulin

Merge request reports

Loading