how to test spi with DMA

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to test spi with DMA

568 Views
emr1
Contributor I

Hi,

I wonder about how I can aware of DMA properties, how I can show that the DMA is active?

We have development board base on imx8mp and in user manuals it says as follows:

6.8 SPI Bus
MSC SM2S-IMX8PLUS SMARC™ offers two Enhanced Configurable SPI (ECSPI) busses with two slave-select signals each.
Key features of the ECSPI include:
• Full-duplex synchronous serial interface
• Master/Slave configurable
• Two Chip Select (CS) signals to support multiple peripherals
• Transfer continuation function allows unlimited length data transfers
• 32-bit wide by 64-entry FIFO for both transmit and receive data
• Polarity and phase of the Chip Select (CS) and SPI Clock (SCLK) are configurable
• Direct Memory Access (DMA) support

And I have attached the .dts file to this message, I do not know how to activate DMA specification, also how to test weather it works via DMA specification. Could you give detail about it?

Thank you for your time and consideration,

Best Regards

 

0 Kudos
Reply
1 Reply

546 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @emr1 

I hope you are doing well.

There is no need to make change the device tree.
As dma properties for ecspi are already defined in imx8mp.dtsi as below.

ecspi1: spi@30820000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,imx8mp-ecspi", "fsl,imx6ul-ecspi";
reg = <0x30820000 0x10000>;
interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MP_CLK_ECSPI1_ROOT>,
<&clk IMX8MP_CLK_ECSPI1_ROOT>;
clock-names = "ipg", "per";
assigned-clock-rates = <80000000>;
assigned-clocks = <&clk IMX8MP_CLK_ECSPI1>;
assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_800M>;
dmas = <&sdma1 0 7 1>, <&sdma1 1 7 2>;
dma-names = "rx", "tx";
status = "disabled";
};

By Default, Dma transfer is enabled in ecspi driver by use_dma kernel parameter in spi-imx.c driver.

Dma mode is disabled in driver under some configurations (such as slavemode & transfer length). Please see spi_imx_can_dma() in spi-imx.c driver for such conditions.

One can cross-check this by printing degugging information in kernel with highest log level and below kernel options.
CONFIG_SPI_DEBUG=y

Thanks & Regards,

Sanket Parekh

0 Kudos
Reply