Hello Toradex Community,
in my current project I’ve two ICs connected to the ecspi1. The CS line of the first IC is connected to the ecspi1 CS and the CS line of the second IC to a common GPIO. To be able to communicate with both ICs I would like to disable the SPI CS and use it as common GPIO as well.
To solve this issue I’ve read several topics in this forum and at NXP but non of them could get me to the final solution. At my current state of configuration I am using the following dts file
// Definitions for the FXAS21002C Gyroscope
/dts-v1/;
/plugin/;
#include "imx8mp-pinfunc.h"
/ {
compatible = "toradex,verdin-imx8mp";
};
&{/} {
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_spi_cs_ISO1H816G>;
/* SODIMM 202 - ISO1H816G_CS_0 */
ISO1H816G_CS_0 {
gpios = <&gpio5 9 0>;
default-state = "on";
};
/* SODIMM 54 - ISO1H816G_CS_1 */
ISO1H816G_CS_1 {
gpios = <&gpio1 8 0>;
default-state = "on";
};
};
};
&ecspi1 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
fsl,espi-num-chipselects = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
};
&iomuxc {
pinctrl_spi_cs_ISO1H816G: spi_cs_ISO1H816G_grp {
fsl,pins = <
MX8MP_IOMUXC_ECSPI1_SS0__GPIO5_IO09 0x106 /* SODIMM 202 */
MX8MP_IOMUXC_GPIO1_IO08__GPIO1_IO08 0x106 /* SODIMM 218 */
>;
};
};
After flashing this to my Verdin (V1.1A) modul
dmesg | grep spi
returns the following lines
[ 0.921734] imx8mp-pinctrl 30330000.pinctrl: pin MX8MP_IOMUXC_ECSPI1_SS0 already requested by leds; cannot claim for 30820000.spi
[ 0.921747] imx8mp-pinctrl 30330000.pinctrl: pin-123 (30820000.spi) status -22
[ 0.921756] imx8mp-pinctrl 30330000.pinctrl: could not request pin 123 (MX8MP_IOMUXC_ECSPI1_SS0) from group ecspi1grp on device 30330000.pinctrl
[ 0.921766] spi_imx 30820000.spi: Error applying setting, reverse things back
and in the /dev/ folder I do not find any spi
ls /dev/spi*
ls: cannot access ‘/dev/spi*’: No such file or directory
If I remove the configuration of GPIO5 IO09 from iomuxc I receive no error messages from spi and find the expected interface within the /dev/ folder. Therefore I assume the SPI to be enabled and functional in general.
Another attempt I’ve made was replacing the entire configuration of pinctrl_ecspi1 in iomuxc without a CS Pin configured. But with this attempt I’ve received the following message.
spi_imx 30820000.spi: error -EBUSY: bitbang start failed
I’m looking forward to read your ideas what I could try next.
Best regards
KDehren