Hello, I am writing an SPI SLAVE driver for an imx8qmlpddr4arm2 board with Yocto. I have problems adding the slave entry on the dts file. In particular, when I test the code, my slave keeps waiting for ever to receive something, even if the other board sends data.
My code:
fsl-imx8qm.dtsi:
lpspi0: lpspi@5a000000 {
compatible = "fsl,imx7ulp-spi";
reg = <0x0 0x5a000000 0x0 0x10000>;
interrupts = <GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&gic>;
clocks = <&clk IMX8QM_SPI0_CLK>,
<&clk IMX8QM_SPI0_IPG_CLK>;
clock-names = "per", "ipg";
power-domains = <&pd_dma_lpspi0>;
status = "disabled";
};
fsl-imx8qm-lpddr4arm2.dts
pinctrl_lpspi0: lpspi0grp {
fsl,pins = <
SC_P_SPI0_SCK_DMA_SPI0_SCK 0x0600004c
SC_P_SPI0_SDO_DMA_SPI0_SDO 0x0600004c
SC_P_SPI0_SDI_DMA_SPI0_SDI 0x0600004c
>;
};
pinctrl_lpspi0_cs: lpspi0cs {
fsl,pins = <
SC_P_SPI0_CS1_DMA_SPI0_CS1 0x21
>;
};
&lpspi0 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lpspi0 &pinctrl_lpspi0_cs>;
status = "okay";
spi-slave;
slave {
compatible = "linux,spislave";
};
};
Is correct to set the cs pin as DMA or it is better to set it as GPIO? What is the difference?
And the number 0x21, do I need to change something? I am reading the manual but I cannot understend what I have to modify. Can I use 0x0600004c as the other signals? I have not found anything on the web that could help me.
Thank you in advance a lot!
Erica
Solved! Go to Solution.
Hi Erica
example of i.MX8QM lpspi dts can be found on
fsl-imx8qm-lpddr4-arm2-lpspi.dts\freescale\dts\boot\arm64\arch - linux-imx - i.MX Linux kernel
spi-fsl-lpspi.txt\spi\bindings\devicetree\Documentation - linux-imx - i.MX Linux kernel
linux lpspidriver: linux/drivers/spi/spi-fsl-lpspi.c
spi-fsl-lpspi.c\spi\drivers - linux-imx - i.MX Linux kernel
For pad configuration (number 0x21,0x0600004c) one can look at documentation in SCFW Porting Kit
and fsl,imx8qm-pinctrl.txt\pinctrl\bindings\devicetree\Documentation - linux-imx - i.MX Linux kernel
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Erica
example of i.MX8QM lpspi dts can be found on
fsl-imx8qm-lpddr4-arm2-lpspi.dts\freescale\dts\boot\arm64\arch - linux-imx - i.MX Linux kernel
spi-fsl-lpspi.txt\spi\bindings\devicetree\Documentation - linux-imx - i.MX Linux kernel
linux lpspidriver: linux/drivers/spi/spi-fsl-lpspi.c
spi-fsl-lpspi.c\spi\drivers - linux-imx - i.MX Linux kernel
For pad configuration (number 0x21,0x0600004c) one can look at documentation in SCFW Porting Kit
and fsl,imx8qm-pinctrl.txt\pinctrl\bindings\devicetree\Documentation - linux-imx - i.MX Linux kernel
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------