2023-03-13 04:57 AM
Hello,
my system is based on an STM32MP151x, running embedded Linux (Buildroot generated + all the ST patches, v5.3.56). I am suing an SPI connection to an external hardware but so far, i am not able to set the SPI clock to 20MHz and higher.
Looking at the code (spidev, spi) it looks like the controller is just picking the default value (12 MHz) whatever the value i am using in my IOCTL call (i am using user space spidev ioctl to setup the SPI).
Is there a specific DTS section i might have omitted which would allow me to setup these higher SPI speeds ?
Thanks,
Jacques
Solved! Go to Solution.
2023-03-13 07:25 AM
Yes, most clock setup are in TF-A (and/or OP-TEE if used).
Files could be quickly are generated by CubeMX where clock setup is maybe more friendly than reading reference manual and Device Tree bindings and source code.
Regards,
2023-03-13 05:33 AM
Hi @JSamo.2 ,
Maybe look at your Device Tree:
spi-max-frequency = <xxxx>;
https://wiki.st.com/stm32mpu/wiki/SPI_device_tree_configuration#DT_configuration_-28board_level-29
and as well as related SPI kernel clock setting which should be high enough for the required output frequency.
st,pkcs = <......>;
https://wiki.st.com/stm32mpu/wiki/Clock_device_tree_configuration#STM32MP15x_lines
12MHz is likely because the SPI receive a 24MHz kernel clock (HSE) and so the driver is selecting the highest possible choice with this clock.
Regards,
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'
2023-03-13 07:05 AM
Thanks for the answer.
I understand that this st,pkcs setting is to be done in the TF-A dts ?
2023-03-13 07:25 AM
Yes, most clock setup are in TF-A (and/or OP-TEE if used).
Files could be quickly are generated by CubeMX where clock setup is maybe more friendly than reading reference manual and Device Tree bindings and source code.
Regards,