We're using ecspi4 controller to interface with a TPM device.
This is what's in our device tree:
&ecspi4 {
pinctrl-names = "default";
pinctrl-0 = <&ecspi4_pins>;
cs-gpios = <&gpio2 15 0>;
status = "okay";
tpm@0 {
compatible = "st,st33htpm-spi", "tcg,tpm_tis-spi";
pinctrl-names = "default";
pinctrl-0 = <&tpm_pins>;
reg = <0>;
spi-max-frequency = <33000000>;
#address-cells = <1>;
#size_cells = <0>;
reset-gpios = <&gpio_exp 19 GPIO_ACTIVE_LOW>; /* IO Expander GPIO P2_3 #19 */
status = "okay";
};
};
ecspi4_pins: ecspi4_pins {
fsl,pins = <
MX6UL_PAD_ENET2_RX_ER__GPIO2_IO15 0x0b0b0
MX6UL_PAD_ENET2_TX_EN__ECSPI4_MOSI 0x0b0b0
MX6UL_PAD_ENET2_TX_CLK__ECSPI4_MISO 0x0b0b0
MX6UL_PAD_ENET2_TX_DATA1__ECSPI4_SCLK 0x0b0b0
>;
};
Unfortunately, SPI communication fails with the latest v5.4 imx-linux tree. I'm talking about:
https://git.codelinaro.org/clo/imx-support/external/imx/linux-imx/-/tree/rel_imx_5.4.70_2.3.7
I'm pretty sure the chip select doesn't function (all 0xff are returned).
Our problem seems to be caused by this commit:
https://git.codelinaro.org/clo/imx-support/external/imx/linux-imx/-/commit/f0e3012be8e1fccbb28bf0a96...
When we revert this commit everything works fine!
I did not study the code yet (and I don't intend to) but somehow the mentioned commit makes our gpio2_io15 configured chip select fail. What's weird though is that another one (we use ecspi2 with MX6UL_PAD_CSI_DATA01__GPIO4_IO22 as chip select) always works well.
Anyway, can you please investigate. We'd like to understand exactly what's going on and receive a proper fix.
Thanks!