Gpio04,power led as normal gpio

I am using orin nx, based on jp5.1.2, we want to use GPIO04 (PCC.00) as a normal GPIO, but its default function is Baseboard Power LED Control. The system will control this gpio after startup and wake-up from sleep. I searched the device tree and did not find the location where this gpio is defined. Therefore, I would like to know

  1. How to remove the system’s control over this gpio (not use it as a power LED)
  2. Let it be configured as a normal gpio in the device tree (such as configuring it for interrupt input)

Hi 1031150349,

Are you using the devkit or custom board for Orin NX?

Have you configure pinmux for PCC.00 before use?
Please share the full device tree for further check.

I am using the devkit and the default pinmux settings. It is wrong here, gpio04 should be PCC.01.
I used fdtdump to export the contents of tegra234-p3767-0000-p3768-0000-a0.dtb
a1.zip (61.2 KB)
tegra234-p3767-0000-p3768-0000-a0.zip (60.0 KB)
My concern is that the power led will control this io, which may affect my normal use.

Yes, GPIO04 should be PCC.01 as shown in pinmux spreadsheet.
image

It seems this pin is configured as Output/High by default.
I cannot find any driver using/controlling this pin.

Could you run the following command to check if this pins been used?

$ sudo cat /sys/kernel/debug/gpio|grep PCC.01

If not, I think you can still control this GPIO manually.
May I also know what’s your use case to control this pin?

This is my output.

$ sudo cat /sys/kernel/debug/gpio|grep PCC.01
 gpio-329 (PCC.01              )

I will use it as interrupt input io. I use sysfs to configure it as input. After waking up from sleep, its status will change to output. This is my test:

root@zme-0020-backup-minimal:/sys/class/gpio/PCC.01# cat direction 
in
root@zme-0020-backup-minimal:/sys/class/gpio/PCC.01# cat value 
0
root@zme-0020-backup-minimal:/sys/class/gpio/PCC.01# systemctl suspend
root@zme-0020-backup-minimal:/sys/class/gpio/PCC.01# ����
                                                         ��[   104.977058] Camera-FW on t234-rce-safe started
TCU early console enabled.
��
  ��I/TC: Secondary CPU 1 initializing
I/TC: Secondary CPU 1 switching to normal world boot
I/TC: Secondary CPU 2 initializing
I/TC: Secondary CPU 2 switching to normal world boot
I/TC: Seconda��DCE: F��r��W Boot Done
��y CPU 3 initializing
I/TC: Secondary CPU 3 switching to normal world boot
I/TC: Secondary CPU 8 initializing
I/TC: Secondary CPU 8 switching to normal world boot
I/TC: Secondary CPU 9 initializing
I/TC: Secondary CPU 9 switching to normal world boot
I/TC: Secondary CPU 10 initializ��[   105.186220] Camera-FW on t234-rce-safe ready SHA1=8676d22a (crt 2.922 ms, total boot 212.289 ms)
��ing
I/TC: Secondary CPU 10 switching to normal world boot
I/TC: Secondary CPU 11 initializing
I/TC: Secondary CPU 11 switching to normal world boot
��[   90.102216] queueing ieee80211 work while going to suspend
[   90.102219] queueing ieee80211 work while going to suspend
[   90.181326] CPU:0, Error: dce-fabric@0xde00000, irq=28
[   90.181329] **************************************
[   90.181331] CPU:0, Error:dce-fabric, Errmon:4
[   90.181339]    Error Code            : SLAVE_ERR
[   90.181341]    Overflow              : Multiple SLAVE_ERR
[   90.181350] 
[   90.181351]    Error Code            : SLAVE_ERR
[   90.181353]    MASTER_ID             : DCE
[   90.181356]    Address               : 0xdc9ed80
[   90.181358]    Cache                 : 0x3 -- Bufferable Modifiable 
[   90.181361]    Protection            : 0x2 -- Unprivileged, Non-Secure, Data Access
[   90.181362]    Access_Type           : Read
[   90.181364]    Access_ID             : 0x0
[   90.181366]    Fabric                : dce-fabric
[   90.181367]    Slave_Id              : 0x5
[   90.181369]    Burst_length          : 0x7
[   90.181370]    Burst_type            : 0x1
[   90.181372]    Beat_size             : 0x3
[   90.181373]    VQC                   : 0x0
[   90.181375]    GRPSEC                : 0x3f
[   90.181376]    FALCONSEC             : 0x0
[   90.181379]  **************************************
[   90.341043] IRQ 321: no longer affine to CPU1
[   90.341085] CPU1: shutdown
[   90.343950] IRQ 322: no longer affine to CPU2
[   90.343986] CPU2: shutdown
[   90.346415] IRQ 323: no longer affine to CPU3
[   90.346449] CPU3: shutdown
[   90.348344] IRQ 324: no longer affine to CPU4
[   90.348377] CPU4: shutdown
[   90.351268] IRQ 325: no longer affine to CPU5
[   90.351292] CPU5: shutdown
[   90.353855] IRQ 326: no longer affine to CPU6
[   90.353875] CPU6: shutdown
[   90.357202] IRQ 117: no longer affine to CPU7
[   90.357433] IRQ 327: no longer affine to CPU7
[   90.357577] CPU7: shutdown
[   91.348045] PM: dpm_run_callback(): platform_pm_resume+0x0/0x80 returns -110
[   91.348049] PM: Device 3ae0000.nvrng failed to resume: error -110
[   91.660255] ACPI: <n/a>: failed to evaluate _DSM (0x1001)
[   91.660259] ACPI: <n/a>: failed to evaluate _DSM (0x1001)

root@zme-0020-backup-minimal:/sys/class/gpio/PCC.01# cat direction 
out
root@zme-0020-backup-minimal:/sys/class/gpio/PCC.01# cat value 
1
root@zme-0020-backup-minimal:/sys/class/gpio/PCC.01# 

I tested it on jp5.1.5 and its status was not changed.
I noticed that this seems to be related to another topic I posted.

This gpio will change state after wakeup, is my guess correct?

Yes, there’s the known issue in r35.4.1, please simply verify with the latest r35.6.1 instead.

We would also suggest you configuring it as Input/Int PD in pinmux spreadsheet if you want to use it as an INPUT pin for interrupt.

Thinks for help.

As I mentioned before, the new version does not have this problem