Enable SPI0 but without using python io tool

How to enable the SPI0 by change the device tree but without using the python tool?

I see there is one file called “tegra194-p3668-all-p3509-0000-hdr40.dts”, may I change it to enable SPI0?

Thanks.

Have reference to below topic.

I find in “tegra194-p3668-all-p3509-0000-hdr40.dts” there are similar settings. won’t that file work?

And I find in another topic, it says from JT 4.6, we need to run

sudo modprobe spidev

First you need to configure the PINs by jetson-io or modify by device tree. The tegra194-p3668-all-p3509-0000-hdr40.dts is overlay file that won’t enable it default. You can just find those spi1_xxx_xxx pins to modify to “nvidia,function = “spi1”;”

Second run the sudo modprobe to load the spidev driver to generate the /dev/spidev*.*

You mean the hdr40.dts doesn’t enable the SPI by default? Or that file won’t be called? I find the SPI has been enabled in it, like:

			hdr40-pin21 {
				nvidia,pins = "spi1_miso_pz4";
				nvidia,function = "spi1";
				nvidia,pin-label = "spi1_din";
				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
			};

The hdr40.dts could enable those pins but it’s overlay need jetson-io to enable it.

https://www.kernel.org/doc/html/latest/devicetree/overlay-notes.html

@ShaneCCC

I see now. Which file I should modify for Xavier NX? I can’t find “tegra210-porg-pinmux-p3448-0000-xxx.dtsi”.

For Xavier NX I would suggest copy the pins what you need to configure in the hdr40.dts to pinmux@2430000 {}

Which file ‘pinmux@243000’ reside in?

Thanks.

I am not sure which file will be include in the NX dtb.
Please try to figure it out.

./rey/kernel-dts/tegra194-p3421-0000-a00.dts:   pinmux@2430000 {
./galen-interposer/kernel-dts/platforms/tegra194-galen-int-audio-p2888-0000-a00.dtsi:   pinmux@2430000 {
./stardust-slt-interposer/kernel-dts/stardust-slt-int-platforms/tegra194-stardust-slt-interposer-audio-e3365-1099-a00.dtsi:     pinmux@2430000 {
./sim/kernel-dts/tegra194-fpga.dtsi:    pinmux@2430000 {
./sim/kernel-dts/tegra194-sim-base.dts: pinmux@2430000 {
./sim/kernel-dts/tegra194-sim-vdk.dts:  pinmux@2430000 {
./xavier-slt/kernel-dts/common/tegra194-audio-e3365-1099.dtsi:  pinmux@2430000 {
./xavier-slt/kernel-dts/tegra194-e3360-1099-e3365-1099.dts:     pinmux@2430000 {

@ShaneCCC May I create one .dtsi file and add pinmux@2430000 {} and populate it with the SPI relevant, then compile device tree and flash? Will it work?

I attached the decompiled final .dtb file.

Thanks.

output.txt (289.3 KB)

Looks should be OK for that.
Please also checking the context you add at /proc/device-tree/pinmux@2430000/… after booted.

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