sysfs GPIO settings don't appear to match pinmux settings

Is there a way to make the sysfs GPIO settings match what’s in the pinmux config?

For example, I’ve modified the pinmux such that:

# cat /sys/kernel/debug/tegra_pinctrl_reg | grep bb0
Bank: 1 Reg: 0x0c303040 Val: 0x0000c008 -> can1_stb_pbb0

Which as far as I can tell, has bit 6 set to 0 so this should not be an input pin. However,

# echo 254 > /sys/class/gpio/export
# cat /sys/class/gpio/gpio254/direction
in

The pin is definitely in an output mode since I can see it being raised on a scope, but I don’t understand why sysfs thinks it’s incorrect.

hello thorntonc,

may I know more details about your pinmux configuration, did you customize Pinmux to configure the pin.
could you please also share the modification you had done for us reference,

BTW,
some pins were restricted with direction by hardware, you might check Topic 1063247 as see-also.
thanks

Yes, all I’ve done from the default pinmux was modify

pinmux.0x0c303040 = 0x0000c008;

Based on what was in the TRM.

I’m pretty sure this pin can be an output pin, since I’m seeing the pin act as an output pin when I scope. Furthermore when I ‘echo “high” > /sys/class/gpio/gpio254/direction’, it properly flips the value of the direction file in sysfs, I’m just wondering why the two are out of sync on boot.

hello thorntonc,

did you mean you modify the *.cfg file to flash the board?
you should note that there’s [PLEASE DO NOT EDIT THIS FILE] in the header for awareness.

please access pinmux spreadsheet through download center, you’ll found a button to generate dtsi files.
you may also check Jetson AGX Xavier MB1 Platform Configuration session for the steps to customize.
thanks