Cannot set GPIO05 output-pulldown in the cboot

My pinmux spreadsheet set is here:

After that, I use pinmux-dts2cfg.py to update my BCT cfg:

diff --git a/bootloader/t186ref/BCT/tegra19x-mb1-pinmux-p3668-a01.cfg b/bootloader/t186ref/BCT/tegra19x-mb1-pinmux-p3668-a01.cfg
index 09ff5d8..da7aa27 100644
--- a/bootloader/t186ref/BCT/tegra19x-mb1-pinmux-p3668-a01.cfg
+++ b/bootloader/t186ref/BCT/tegra19x-mb1-pinmux-p3668-a01.cfg
@@ -2,7 +2,7 @@
 ## Pinmux version 1.6
 ## Input pinmux file name: tegra19x-jetson_xavier_nx_module-pinmux.dtsi
 ## Input gpio file name: tegra19x-jetson_xavier_nx_module-gpio-default.dtsi
-## Generation date: 2023-04-10 16:30
+## Generation date: 2023-04-25 14:26
 ## PLEASE DO NOT EDIT THIS FILE
 ## This is autogenerated file using the script pinmux-dts2cfg.py
 ##
@@ -86,10 +86,6 @@ pinmux.0x0c2f1200 = 0x00000003; # CONFIG CC0
 pinmux.0x0c2f120c = 0x00000000; # CONTROL CC0
 pinmux.0x0c2f1210 = 0x00000000; # OUTPUT CC0
 pinmux.0x0c302048 = 0x00000000; # GPIO spi2_sck_pcc0
-pinmux.0x0c2f1240 = 0x00000003; # CONFIG CC2
-pinmux.0x0c2f124c = 0x00000000; # CONTROL CC2
-pinmux.0x0c2f1250 = 0x00000000; # OUTPUT CC2
-pinmux.0x0c302028 = 0x00000000; # GPIO spi2_mosi_pcc2
 pinmux.0x0c2f1260 = 0x00000003; # CONFIG CC3
 pinmux.0x0c2f126c = 0x00000000; # CONTROL CC3
 pinmux.0x0c2f1270 = 0x00000000; # OUTPUT CC3
@@ -226,7 +222,7 @@ pinmux.0x0c301038 = 0x00000058; # power_on_pee4: rsvd0, pull-up, tristate-enable
 pinmux.0x0c303028 = 0x0000c000; # can0_en_paa5: rsvd0, tristate-disable, input-disable
 pinmux.0x0c302048 = 0x00000002; # spi2_sck_pcc0: rsvd2, tristate-disable, input-disable, io_high_voltage-disable, lpdr-disable
 pinmux.0x0c302050 = 0x00000002; # spi2_miso_pcc1: rsvd2, tristate-disable, input-disable, io_high_voltage-disable, lpdr-disable
-pinmux.0x0c302028 = 0x00000002; # spi2_mosi_pcc2: rsvd2, tristate-disable, input-disable, io_high_voltage-disable, lpdr-disable
+pinmux.0x0c302028 = 0x00000406; # spi2_mosi_pcc2: rsvd2, pull-down, tristate-disable, input-disable, io_high_voltage-disable, lpdr-disable
 pinmux.0x0c302038 = 0x00000002; # spi2_cs0_pcc3: rsvd2, tristate-disable, input-disable, io_high_voltage-disable, lpdr-disable
 pinmux.0x0c302000 = 0x00000056; # touch_clk_pcc4: rsvd2, pull-down, tristate-enable, input-enable, lpdr-disable

But when booting up, GPIO05 is not pulled down.
And I read the port, the result is not the same to the above cfg:

root@tegra-ubuntu:~#  cat /sys/kernel/debug/tegra_pinctrl_reg | grep 0x0c302028
Bank: 1 Reg: 0x0c302028 Val: 0x00000006 -> spi2_mosi_pcc2

Hi Xzz,

Why you configure this pin as “GPIO_PCC.02” instead of SPI use?
Do you want use this pin as GPIO or SPI interface (MOSI)?

Hi,KevinFFF,
Actually there is only two options

And I want use this pin as GPIO

The default one for “GPIO05” is showed as SPI2_MOSI, which is expected to be used.
If you don’t want to use SPI function and use GPIO instead, please set all SPI2 related pins to GPIO in pinmux table.

Hi,KevinFFF,

I found that the default GPIO5 is set to GPIO3_PCC.02 .
And there are only two options in the picture, no options related to SPI were found
So I’m confused where the SPI related settings are
image

What’s more, all SPI2 related pin are GPIO in default.

Hi,KevinFFF,
And I find a question:
What I set pinmux in the BSP was 0x00000406:

-pinmux.0x0c302028 = 0x00000002; # spi2_mosi_pcc2: rsvd2, tristate-disable, input-disable, io_high_voltage-disable, lpdr-disable
+pinmux.0x0c302028 = 0x00000406; # spi2_mosi_pcc2: rsvd2, pull-down, tristate-disable, input-disable, io_high_voltage-disable, lpdr-disable
 

But I read 0x00000006 in the system:

Why these two result defferent?
This is my flash method:
sudo ./flash.sh jetson-xavier-nx-devkit-emmc mmcblk0p1

0x00000406 => For SFIO
0x00000006 => For GPIO

It seems that you want to use these SPI related pins as GPIO, so please set 0x0c302028 to 0x00000006(GPIO, pull down).

So you mean My config is right?
But GPIO05 is pull up when booting up now.
I want it pull down.

Do you mean that you measure the GPIO05 after boot up and it is high now?

yes, I measure it when power on.

I mean the time after boot up, not after power on.
What’s the state of GPIO.05 after you boot up and enter into the desktop?

Hi,KevinFFF,
Sorry for reply late.
GPIO05 is high after boot up.

Could you control GPIO05(PCC.02) through sysfs?

#echo 319 > /sys/class/gpio/export
#cat /sys/class/gpio/PCC.02/direction
#cat /sys/class/gpio/PCC.02/value

Yes , I could.
I can control this GPIO in the kernel.
But I can’t control it before powering on to the kernel.

It should be depending on the pinmux configuration.
Could you help to provide the pinmux spreadsheet as file here for further check?

Sorry for late,
this is our Spread.
Jetson_Xavier_NX_Pinmux_Configuration_Template_v1.06-sx.rar (743.2 KB)

Could you help to provide your device tree (dtb file) for further check?

tegra194-p3668-all-p3509-0000.dtb (201.9 KB)

Could you help to find if there’s the following node in your BSP package?

If yes, please help to disable it.

		w-disable1 {
			gpio-hog;
			output-high;
			gpios = <TEGRA194_AON_GPIO(CC, 2) GPIO_ACTIVE_LOW>;
			label = "w-disable1";
-			status = "okay";
+			status = "disabled";
		};

Hi,
I have do this change before.

+++ b/hardware/nvidia/platform/t19x/jakku/kernel-dts/common/tegra194-p3668-common.dtsi
@@ -328,13 +328,13 @@
                        label = "pex_refclk_sel_high";
                        status = "disabled";
                };
-               w-disable1 {
-                       gpio-hog;
-                       output-high;
-                       gpios = <TEGRA194_AON_GPIO(CC, 2) GPIO_ACTIVE_LOW>;
-                       label = "w-disable1";
-                       status = "okay";
-               };
+               //w-disable1 {
+               //      gpio-hog;
+               //      output-high;
+               //      gpios = <TEGRA194_AON_GPIO(CC, 2) GPIO_ACTIVE_LOW>;
+               //      label = "w-disable1";
+               //      status = "okay";
+               //};

1 Like