I’m porting our device tree changes from Jetpack 4.6 to Jetpack 5.0.2 and stumbled upon not working SPI. We are using custom carrier board with changed pinmux (changed pinmux and device tree changes/additions were fully tested with Jetpack 4.6 without issues).
In JP5.0.2 signal pins MOSI and SCLK seems to be working (checked with logic analyzer), but CS pins are always in high state without change. So it seems, that I have some kind of issue with proper configuration of CS pins.
Also I’m unable to manually export CS pins, so it seems like they are already in use with the driver, but the CS signal is not behaving as expected.
New device tree modification (JP 5.0.2) - not working CS pins:
spi@3230000{
status = "okay";
compatible = "nvidia,tegra186-spi";
num-cs = <3>;
cs-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Y, 3) GPIO_ACTIVE_LOW>,
<&tegra_main_gpio TEGRA194_MAIN_GPIO(Y, 4) GPIO_ACTIVE_LOW>,
<&tegra_main_gpio TEGRA194_MAIN_GPIO(R, 0) GPIO_ACTIVE_LOW>;
spi@0 {
compatible = "tegra-spidev";
reg = <0x0>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
spi@1 {
compatible = "tegra-spidev";
reg = <0x1>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
spi@2 {
compatible = "tegra-spidev";
reg = <0x2>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
};
Older device tree modification (JP 4.6) - working without issues:
spi@3230000{
status = "okay";
compatible = "nvidia,tegra186-spi";
num-cs = <3>;
cs-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Y, 3) GPIO_ACTIVE_LOW>,
<&tegra_main_gpio TEGRA194_MAIN_GPIO(Y, 4) GPIO_ACTIVE_LOW>,
<&tegra_main_gpio TEGRA194_MAIN_GPIO(R, 0) GPIO_ACTIVE_LOW>;
spi@0 {
compatible = "spidev";
reg = <0x0>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
spi@1 {
compatible = "spidev";
reg = <0x1>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
spi@2 {
compatible = "spidev";
reg = <0x2>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
};
Are you able to point me in right direction?