Hello, I am modifying the device tree for spi communication on the jetson-agx-xavier-industrial custom board.
The L4T version is 35.4.1.
tegra194-soc-spi.dtsi was modified as follows.
spi0: spi@3210000 {
compatible = "nvidia,tegra186-spi";
reg = <0x0 0x03210000 0x0 0x10000>;
interrupts = <0 36 0x04>;
#address-cells = <1>;
#size-cells = <0>;
iommus = <&smmu TEGRA_SID_GPCDMA_0>;
dma-coherent;
dmas = <&gpcdma 15>, <&gpcdma 15>;
dma-names = "rx", "tx";
spi-max-frequency = <65000000>;
nvidia,clk-parents = "pll_p", "clk_m";
clocks = <&bpmp_clks TEGRA194_CLK_SPI1>,
<&bpmp_clks TEGRA194_CLK_PLLP_OUT0>,
<&bpmp_clks TEGRA194_CLK_CLK_M>;
clock-names = "spi", "pll_p", "clk_m";
resets = <&bpmp_resets TEGRA194_RESET_SPI1>;
reset-names = "spi";
status = "okay";
};
spi1: spi@c260000 {
compatible = "nvidia,tegra186-spi";
reg = <0x0 0x0c260000 0x0 0x10000>;
interrupts = <0 37 0x04>;
#address-cells = <1>;
#size-cells = <0>;
iommus = <&smmu TEGRA_SID_GPCDMA_0>;
dma-coherent;
dmas = <&gpcdma 16>, <&gpcdma 16>;
dma-names = "rx", "tx";
spi-max-frequency = <65000000>;
nvidia,clk-parents = "pll_p", "osc";
clocks = <&bpmp_clks TEGRA194_CLK_SPI2>,
<&bpmp_clks TEGRA194_CLK_PLLAON>,
<&bpmp_clks TEGRA194_CLK_OSC>;
clock-names = "spi", "pll_p", "osc";
resets = <&bpmp_resets TEGRA194_RESET_SPI2>;
reset-names = "spi";
status = "okay";
};
spi2: spi@3230000 {
compatible = "nvidia,tegra186-spi";
reg = <0x0 0x03230000 0x0 0x10000>;
interrupts = <0 38 0x04>;
#address-cells = <1>;
#size-cells = <0>;
iommus = <&smmu TEGRA_SID_GPCDMA_0>;
dma-coherent;
dmas = <&gpcdma 17>, <&gpcdma 17>;
dma-names = "rx", "tx";
spi-max-frequency = <65000000>;
nvidia,clk-parents = "pll_p", "clk_m";
clocks = <&bpmp_clks TEGRA194_CLK_SPI3>,
<&bpmp_clks TEGRA194_CLK_PLLP_OUT0>,
<&bpmp_clks TEGRA194_CLK_CLK_M>;
clock-names = "spi", "pll_p", "clk_m";
resets = <&bpmp_resets TEGRA194_RESET_SPI3>;
reset-names = "spi";
status = "okay";
};
The status of spi0, spi1, and sp2 to be used has been changed to okay, and the rest are in the default state.
In the case of tegra194-p2888-0001-p2822-0000-common.dtsi, it was written as follows.
spi@c260000 { /*SPI2 STM32*/
compatible = "nvidia,tegra186-spi";
status = "okay";
num-cs = <1>;
cs-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(C, 3) GPIO_ACTIVE_LOW>;
spi@0 { /* chip select 0 */
compatible = "tegra-spidev";
reg = <0x0>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x11>;
};
};
};
spi@3210000 { /*SPI1 HOLT*/
compatible = "nvidia,tegra186-spi";
status = "okay";
num-cs = <1>;
cs-gpios =<&tegra_main_gpio TEGRA194_MAIN_GPIO(Z, 6) GPIO_ACTIVE_LOW>;
spi@0 { /* chip select 0 */
compatible = "tegra-spidev";
reg = <0x0>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x11>;
};
};
};
spi@3230000 { /*SPI3 NVRAM*/
compatible = "nvidia,tegra186-spi";
status = "okay";
num-cs = <1>;
cs-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Y, 3) GPIO_ACTIVE_LOW>;
spi@0 { /* chip select 0 */
compatible = "tegra-spidev";
reg = <0x0>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x11>;
};
};
};
spi@3270000 {
status = "disabled";
};
spi@3300000 {
status = "disabled";
};
I know that I need to add the cs-gpios property, but if I define this property, it won’t boot. If I exclude this property, it will boot normally.
I am sharing my circuit diagram and pinmux.
In the case of pinmux, create a .cfg using the file extracted from the Excel spreadsheet and then enter the contents of the tegra19x-mb1-pinmux-p2888-0000-a00-p2822-0000-a00.cfg file under Linix_for_Tegra/bootloader/t186ref/BCT. Changed.
tegra19x-mb1-pinmux-p2888-0000-a00-p2822-0000-a00.txt (29.6 KB)
Attached is dmesg of booterror.
booterror.txt (78.8 KB)