I use on an imx8qxp based board the sources from:
https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-thud -m imx-4.19.35-1.0.0.xml
Now the customer wants to use the lpspi module @ 5a030000 (Signals SPI3_X).
Unfortunately there is no support yet in above sources. Anyone used this spi3 module yet on imx8qxp?
I tried to add parts in DTS, but driver fails in enabling clock:
[ 2.372624] fsl_lpspi 5a030000.lpspi: failed to enable clock
[ 2.378433] fsl_lpspi: probe of 5a030000.lpspi failed with error -22
clock dump:
cat /sys/kernel/debug/clk/clk_summary | grep spi
spi3_div 0 0 0 0 0 0 50000
spi3_clk 0 0 0 0 0 0 50000
spi2_div 1 1 0 24000000 0 0 50000
spi2_clk 1 1 0 24000000 0 0 50000
spi1_div 0 0 0 0 0 0 50000
spi1_clk 0 0 0 0 0 0 50000
spi0_div 1 1 0 24000000 0 0 50000
spi0_clk 1 1 0 24000000 0 0 50000
fspi_1_div 0 0 0 0 0 0 50000
fspi_1_clk 0 0 0 0 0 0 50000
fspi_0_div 0 0 0 28571428 0 0 50000
fspi_0_clk 0 0 0 28571428 0 0 50000
fspi1_ipg_s_clk 0 0 0 200000000 0 0 50000
fspi1_ipg_clk 0 0 0 200000000 0 0 50000
fspi0_ipg_s_clk 0 0 0 200000000 0 0 50000
fspi0_ipg_clk 0 0 0 200000000 0 0 50000
fspi1_hclk_clk 0 0 0 100000000 0 0 50000
fspi0_hclk_clk 0 0 0 100000000 0 0 50000
spi3_ipg_clk 0 0 0 120000000 0 0 50000
spi2_ipg_clk 1 1 0 120000000 0 0 50000
spi1_ipg_clk 0 0 0 120000000 0 0 50000
spi0_ipg_clk 1 1 0 120000000 0 0 50000
So the question is, is there any reason why this part is not enabled in official sources?
Needs this some additonal work in firmware?
Thanks!
Hello Aldo,
I can now approve, that your patch works for me.
Thanks!
bye,
Heiko
Hello,
Indeed it is not enabled as you said, I believe that this is because LCDIF uses the same pads as SPI3.
As you can see by the dump, spi0 and spi2 are enabled, you may also take a look here:
https://source.codeaurora.org/external/imx/linux-imx/commit/arch/arm64/boot/dts/freescale/fsl-imx8dx...
Could you try with the patch attached and let me know if it works?
Thank you,
Best regards,
Aldo.
Hi,
My custom board connects two devices to SPI3, but how can SPI3 CS1 work? This pin could not be configured as GPIO.
Yong
Hello Aldo,
I forgot to add my patch, I had the same approach, but with a typo in it.
Comparing now with your patch and I found it, many thanks!
spi3 driver starts now probing spi device, so it looks now much more better. But I have to wait for a new hardware as we have problem with spi device.
I give you feedback here, if we have fixed it.
Many thanks!
bye,
Heiko
Hello,
Glad that it help you, please let us know if it worked!
Best regards,
Aldo.
Hello Aldo,
we see now, that cs is toggling as expected, but no data is read from device. Same chip (mcp2517fd is on spi0 and spi2
and works fine).
dump spi0:
│ │ <> [ 2.432886] ---------------- spi0.0 ----------------
│ │ <> [ 2.437884] Transfer 0
│ │ <> [ 2.440262] dump_transfer: tx buf: 00 00
│ │ <> [ 2.444203] dump_transfer: rx buf: (null)
│ │ <> [ 2.451495] ---------------- spi0.0 ----------------
│ │ <> [ 2.456494] Transfer 0
│ │ <> [ 2.458862] dump_transfer: tx buf: 3e 00 00 00 00 00
│ │ <> [ 2.463858] dump_transfer: rx buf: 00 00 60 04 00 00
dump spi3:
│ │ <> [ 4.998462] ---------------- spi2.0 ----------------
│ │ <> [ 5.003464] Transfer 0
│ │ <> [ 5.005855] dump_transfer: tx buf: 00 00
│ │ <> [ 5.009810] dump_transfer: rx buf: (null)
│ │ <> [ 5.016944] ---------------- spi2.0 ----------------
│ │ <> [ 5.021938] Transfer 0
│ │ <> [ 5.024314] dump_transfer: tx buf: 3e 00 00 00 00 00
│ │ <> [ 5.029293] dump_transfer: rx buf: 00 00 00 00 00 00
May I can get more infos with a scope...
bye,
Heiko