I did some more testing.
When our unit boots up, the register value is as shown (pull up is not set):
Bank: 1 Reg: 0x0c302038 Val: 0x00000052 → spi2_cs0_pcc3
The correct register value should be 0x0000005A.
If I use the command:
sudo devmem2 0x0c302038 b 0x5a
The correct value is assigned to the register:
Bank: 1 Reg: 0x0c302038 Val: 0x0000005a → spi2_cs0_pcc3
Then I can export the pin:
echo 267 > /sys/class/gpio/export
and read the value correctly as shown:
sudo cat /sys/class/gpio/gpio267/value
1
The correct input values for that pin are read.
My question is. Is the device tree node names and setup which I provided in reply #19 and #20 correct. If the structure is correct, what would prevent the pull up from not getting initialized or possibly cleared during boot?
Just want to confirm if I understand your situation.
Currently you need to manually update the bit 3:2 to set pull up so that the GPIO can work fine.
And the pinmux cfg does not take effect in PU/PD case. Is that current problem?
Are you still using gpio-hog in your device tree? I don’t think it is needed though.
Also, I would suggest you directly write the register value to the cfg file instead of putting it in the device tree. Please check if that would make your register correct from the beginning.
Yes. I manually update bit 3:2 and the pin works fine.
Yes. The current problem is that cfg file does not appear to set the PU.
I will take the gpio hog out.
With your last point, how do you write the register value to the cfg file? Here is the current value in the cfg file: pinmux.0x0c302038 = 0x0000005a; # spi2_cs0_pcc3: rsvd2, pull-up, tristate-enable, input-enable, io_high_voltage-disable, lpdr-disable
The correct value for the register is already defined in the .cfg file.
If you are using “NX”, then you don’t need to put something into jetson-agx-xavier-devkit.conf or p2822-0000+p2888-0004.conf.
The first one is already obvious enough that is for AGX Xavier. Not Xavier NX. These two are totally different platform. Your flash to NX does not use these files at all.