sudo devmem2 0x0c302048 word 0x00000400
sudo devmem2 0x0c302050 word 0x00000450
sudo devmem2 0x0c302048 word 0x00000400
sudo devmem2 0x0c302028 word 0x00000400
sudo modprobe spidev
Additional questions:
Is spidev@0 correct? Should it be spidev@2 ?
How to verify the pinmux values corresponding to the SPI2 registers? For example, what does pinmux.0x0c302048 = 0x00000400 mean? Would using devmem2 be okay?
When we decompile the file again (i.e. sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree), the extracted_proc.dtb does not reflect the changes we made. How to make sure that our changes are applied?
Thanks for replying to this message. Then how would we enable the SPI2 interface. Isn’t that the one connected to the pins listed in my initial message.
In our extracted_proc.dts file, we see spi1 = "/spi@c260000"; .I’m confused as why this refers to as being spi1.
We are pretty new to the NVIDIA environment so a short guide on how to enable the spi interface will be greatly appreciated.
The pin number from the pinmux table is the HW name it’s started from 1, however the software device function number is started from 0, So you have to minus 1 to get software bus number.
Thanks for the clarification. We will modify the spi@c260000.
After compiling it with sudo dtc -I dts -O dtb -o tegra194-p2888-0001-p2822-0000-base.dtb extracted_proc.dts, how do we make sure that our .dtb file is properly loaded?
Would you mind telling me where I can find the cfg file (instead of using devmem2)?
EDIT: We tried to use the dd and flash.sh methods, but no luck so far.
You should be able the see which dtb is applied by dmesg | grep DTS,
Then replace the same file in the …/Linux_for_tegra/kernel/dtb/ then issue the flash.sh command to update it.
After flashing Jetpack 4.2.2 using the SDKManager, I have files in ~/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_JETSON_AGX_XAVIER/Linux_for_Tegra.
From that location, I can see tegra194-p2888-0001-p2822-0000.dtb under <path to Linux_for_Tegra>/kernel/dtb. We tried to replace it, then used the flash.sh under Linux_for_Tegra, and our Jetson Xavier Module wont’t even show the desktop.
I can see from the documentation I may need to access <top>/hardware/nvidia/platform/t19x/<platform>/tegra194-mb1-bct-pinmux-gpio-P2972-<revision>.cfg. How do I get access to this file?
Source: Tegra Linux Driver
Yes, I used sudo ./flash.sh -r -k kernel-dtb jetson-xavier mmcblk0p1 with jetson-xavier instead of jetson_xavier if that makes a difference. More specifically,
After creating the .dtb file on my Jetson Xavier AGX, I copied it to my Ubuntu 18.04 host machine.
I replaced tegra194-p2888-0001-p2822-0000.dtb in my Ubuntu 18.04 host machine with this newly created .dtb file.
I ran the ./flash.sh command above.
Is there a mistake in my steps? I am not sure what could cause the image to be corrupted.
Yes, the command is correct it’s jetson-xavier instead of jetson_xavier.
Could you try the original extracted_proc.dtb if this file have problem, you may need to compile the dtb by kernel source instead of dtc.
Would you mind letting us know how to compile the dtb by kernel source?
EDIT: It turns out that compiling the originalextracted_proc.dts to tegra194-p2888-0001-p2822-0000.dtb fails. Should we have signed the compiled dtb file with l4t_sign_image.sh?
Thank you very much for your support. Following your guide and multiple other sources, I have been able to see the /dev/spidev1.0 on the NVIDIA carrier board, but when I use our own custom carrier board, it disappears.
I noticed that I can update the device tree with the following steps:
cd /boot/dtb
sudo dtc -I dtb -O dts -o extracted_proc.dts tegra194-p2888-0001-p2822-0000.dtb
This command decompiles the dtb, instead of fs as I previously did.
Edit the file extracted_proc.dts . We identified spi1 = “/spi@c260000” and made the following changes.
I finally checked the spi@c260000 status and it was okay. I also tried it once again to my custom board and finally it works. I am not sure why the SPI did not show up before. I did not do anything significant apart from rebooting the module.
Thank you very much for the assistance. I really appreciate NVIDIA’s support!