2022-09-22 03:42 AM
we are using stm32mp157f-ev1 and we build the weston image for this board.
We want to enable the SPI-1 on this board
we had applied the following patch to enable the SPI-1
+&spi1 {
+ status = "okay";
+ pinctrl-names = "default", "sleep";
+ pinctrl-0 = <&spi1_pins_a>;
+ pinctrl-1 = <&spi1_sleep_pins_a>;
+ cs-gpios = <&gpioz 3 O>;
+ timeouts = <3>;
+
+ spidev@0 {
+ status = "okay";
+ compatible = "linux,spidev";
+ spi-max-frequency = <25000000>;
+ reg = <0>;
+ };
+};
After applying this patch file we get the following information about the SPI in boot logs.
root@stm32mp15-eval:~# dmesg | grep spi
[ 2.296064] spi-nor spi0.0: mx66l51235f (65536 Kbytes)
[ 2.302910] spi-nor spi0.1: mx66l51235f (65536 Kbytes)
[ 24.360006] spi_master spi1: /soc/spi@44004000/spidev@0 has no valid 'reg' property (-22)
[ 24.366865] spi_master spi1: Failed to create SPI device for /soc/spi@44004000/spidev@0
[ 24.427547] spi_stm32 44004000.spi: driver initialized
and in devices we can also see the SPI1
./devices:
total 0
lrwxrwxrwx 1 root root 0 Jan 1 2000 spi0.0 -> ../../../devices/platform/soc/58003000.spi/spi_master/spi0/spi0.0
lrwxrwxrwx 1 root root 0 Jan 1 2000 spi0.1 -> ../../../devices/platform/soc/58003000.spi/spi_master/spi0/spi0.1
lrwxrwxrwx 1 root root 0 Sep 21 12:11 spi1.0 -> ../../../devices/platform/soc/44004000.spi/spi_master/spi1/spi1.0
But we are not able to see any information in /dev.
What i am assuming that in /dev, there should be spidevx.y so that it can be used by user application.
Please suggest what we are missing
2022-09-22 06:49 AM
HI @HVerm.3
isn't a typo in cs-gpios line ? Should be a 0 and not an O
cs-gpios = <&gpioz 3 O>;
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'
2022-09-23 12:10 AM
Yes, it was typo error.
I would like to inform you that we do the following changes in patch file for device tree
compatible = "rohm,dh2228fv"
instead of using
compatible = "linux,spidev";
Then we can see the spidev0.0 in /dev folder
Is this right approach ?