Jetson Nano, Enable spi1 and spi2 in the device tree

Hi community,
I use a jetson nano devKit B01 (3448).
After struggling to recompile the device tree (but know it’s working), I would like to know which file(s) to modify to:

  • authorize spi1 and sp2 on the 40 pin connector
  • modify some parameters of ttyTHS1 (serial located on pins 8 and 10 of the 40 pin connector)

I want to know if I have to modify dts or dtsi files?

regards, Bernard

You can enable SPI by jetson-io. Have googling should be able found referencing.

1 Like

Hi,
I know that I can use jetson-io.
But I want also to modify some uart parameters that I cannot with jetson-io.
I want to modify the dma mode to rx, tx in order to comply with this post :

(solution found by AS409 contributor).
So if I need to modify DT, by the way I want to enable spi1 and spi2.

Is there a clear and step-by-step doc do modify DT and waht file to modifiy to do that?

regards

You can modify those pin like jetson-io do.
Find the spi*_xxx_xxx like below to modify the “nvidia, function” to “spi*”

		header-40pin-pinmux {
			phandle = <0x136>;
			linux,phandle = <0x136>;

			pin37 {
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x1>;
				nvidia,pins = "spi2_mosi_pb4";
				nvidia,function = "spi2";
			};

			pin28 {
				nvidia,io-high-voltage = <0x1>;
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x0>;
				nvidia,pins = "gen1_i2c_scl_pj1";
				nvidia,function = "i2c1";
			};

			pin27 {
				nvidia,io-high-voltage = <0x1>;
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x0>;
				nvidia,pins = "gen1_i2c_sda_pj0";
				nvidia,function = "i2c1";
			};

			pin26 {
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x2>;
				nvidia,pins = "spi1_cs1_pc4";
				nvidia,function = "spi1";
			};

			pin24 {
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x2>;
				nvidia,pins = "spi1_cs0_pc3";
				nvidia,function = "spi1";
			};

			pin23 {
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x1>;
				nvidia,pins = "spi1_sck_pc2";
				nvidia,function = "spi1";
			};

			pin22 {
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x1>;
				nvidia,pins = "spi2_miso_pb5";
				nvidia,function = "spi2";
			};

			pin21 {
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x1>;
				nvidia,pins = "spi1_miso_pc1";
				nvidia,function = "spi1";
			};

			pin19 {
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x1>;
				nvidia,pins = "spi1_mosi_pc0";
				nvidia,function = "spi1";
			};

			pin18 {
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x2>;
				nvidia,pins = "spi2_cs0_pb7";
				nvidia,function = "spi2";
			};

			pin16 {
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x2>;
				nvidia,pins = "spi2_cs1_pdd0";
				nvidia,function = "spi2";
			};

			pin13 {
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x1>;
				nvidia,pins = "spi2_sck_pb6";
				nvidia,function = "spi2";
			};

			pin10 {
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x1>;
				nvidia,pull = <0x2>;
				nvidia,pins = "uart2_rx_pg1";
				nvidia,function = "uartb";
			};

			pin8 {
				nvidia,enable-input = <0x0>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x0>;
				nvidia,pins = "uart2_tx_pg0";
				nvidia,function = "uartb";
			};

			pin5 {
				nvidia,io-high-voltage = <0x1>;
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x0>;
				nvidia,pins = "gen2_i2c_scl_pj2";
				nvidia,function = "i2c2";
			};

			pin3 {
				nvidia,io-high-voltage = <0x1>;
				nvidia,enable-input = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,pull = <0x0>;
				nvidia,pins = "gen2_i2c_sda_pj3";
				nvidia,function = "i2c2";
			};
		};

1 Like

Thanks ,

spi: Ok but is the name of this file ?
uart : In this file there is no dma to set for the uart.
If you read the link I gave in my previous post:
" It appears we’ve stumbled upon a “solution” to this issue. The upstream device tree from Nvidia does not completely enable the RX DMA for UARTC (possibly all of them). This forces PIO mode for receiving on that UART.
Added dma-names = "rx", "tx"; to the &uartc attribute in the device tree, in my case nvidia/platform/t210/porg/kernel-dts/tegra210.dts .
In a 15 hour test, there were no corrupted messages. Testing will continue but as of now, this is the accepted solution."

I m looking for the file to modify in order to set the dma-names = “rx”, “tx”;
(because I dont get the file mentioned by AS409)
Is it a dts file or a dtsi files ?

Regards
Bernard

For the SPI it could be tegra210-porg-pinmux-p3448-0000-xxx.dtsi

1 Like

And for the modification mentioned by AS409 to add dma-names = "rx", "tx";
what is the file ?
I found something in “hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-
common.dtsi” under the serial@70006000 bracket…but is it the right file ?

1 Like

Should be the right file.

OK Thanks,

But can you explain clearly the differences between dts and dtsi (i for included) files.
With Nvidia SDK manager, I get lot of dtsi files , but also lot of dts files.
Only dtsi can be modified? true ?

1 Like

They are the same both of them can modify.

1 Like

OK but what files concerned the Jetson nano devKit B01 ?
In the list joined there are lot of tegra210-p3448-0000-P3449-0000-xxxx.
Some followed by b00, some by a02, some by hdr40. Can you explain the right ones?
And better…is there a Nvidia doc explaining all that? …it will gain time instead of Q/A via the forum.
regards, Bernard

Checking the dmesg | grep -i kernel to know which dtb was applied to your device.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.