[PATCH] spi: imx: Don't expect DMA for i.MX{25, 35, 50, 51, 53} cspi devices

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Fri May 10 05:32:56 PDT 2024


Hello Martin,

On Wed, May 08, 2024 at 03:44:53PM +0200, Martin Kaiser wrote:
> Thus wrote Uwe Kleine-König (u.kleine-koenig at pengutronix.de):
> > While in commit 2dd33f9cec90 ("spi: imx: support DMA for imx35") it was
> > claimed that DMA works on i.MX25, i.MX31 and i.MX35 the respective
> > device trees don't add DMA channels. The Reference manuals of i.MX31 and
> > i.MX25 also don't mention the CSPI core being DMA capable. (I didn't
> > check the others.)
> 
> If I'm not mistaken, the imx25 reference manual
> 
> https://www.nxp.com/docs/en/reference-manual/IMX25RM.pdf
> 
> does say that CSPI has DMA support. Section 18.1.1 (Features) lists DMA as one
> of the features. There's also DMA events (section 3) for CSPI-1/2/3 RX, TX.

Oh indeed. I don't know what made me claim that DMA isn't mentioned in
the reference manual. Maybe I looked at the i2c chapter.

I now did:

diff --git a/arch/arm/boot/dts/nxp/imx/imx25.dtsi b/arch/arm/boot/dts/nxp/imx/imx25.dtsi
index 4a85684deff8..710b28a41bae 100644
--- a/arch/arm/boot/dts/nxp/imx/imx25.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx25.dtsi
@@ -190,6 +190,8 @@ spi1: spi at 43fa4000 {
 				reg = <0x43fa4000 0x4000>;
 				clocks = <&clks 78>, <&clks 78>;
 				clock-names = "ipg", "per";
+				dmas = <&sdma 8 1 0>, <&sdma 9 1 0>;
+				dma-names = "rx", "tx";
 				interrupts = <14>;
 				status = "disabled";
 			};
@@ -229,6 +231,8 @@ spi3: spi at 50004000 {
 				interrupts = <0>;
 				clocks = <&clks 80>, <&clks 80>;
 				clock-names = "ipg", "per";
+				dmas = <&sdma 34 1 0>, <&sdma 35 1 0>;
+				dma-names = "rx", "tx";
 				status = "disabled";
 			};
 
@@ -257,6 +261,8 @@ spi2: spi at 50010000 {
 				reg = <0x50010000 0x4000>;
 				clocks = <&clks 79>, <&clks 79>;
 				clock-names = "ipg", "per";
+				dmas = <&sdma 6 1 0>, <&sdma 7 1 0>;
+				dma-names = "rx", "tx";
 				interrupts = <13>;
 				status = "disabled";
 			};

And spi still works. I see an issue, but I think that's orthogonal to
adding DMA. Will send a formal patch when I debugged that.

Thanks for your feedback,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240510/befea63e/attachment.sig>


More information about the linux-arm-kernel mailing list