Skip to content

Add Pinmux Register Address Lookup Tool#130

Merged
anhmiuhv merged 19 commits intoNVIDIA:masterfrom
tganeshram:pinmux_lookup
Sep 26, 2025
Merged

Add Pinmux Register Address Lookup Tool#130
anhmiuhv merged 19 commits intoNVIDIA:masterfrom
tganeshram:pinmux_lookup

Conversation

@tganeshram
Copy link
Contributor

Simple tool to lookup pin mux register address for Jetson GPIO pins. User must specify the BOARD mode GPIO pin number.

@@ -0,0 +1,79 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add #!/usr/bin/env python

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rename this file to gpio_pinmux_lookup.py

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add documentation on how to use this in the README

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove _ between pin and mux

tganeshram and others added 2 commits September 23, 2025 09:08
…IN_NX_PIN_DEFS with correct pinmux registers. Extracts data from tegra234_groups and tegra234_aon_groups in pinctrl file.

Co-authored-by: Tharun Ganeshram <tharun.ganeshram@gmail.com>
Co-authored-by: Tharun Ganeshram <tharun.ganeshram@gmail.com>
x[2],
pwm_chip_dir=pwm_dirs.get(x[7], None),
pwm_id=x[8],
reg_block_base_addr=x[9] if 9 < len(x) else None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update this for the new data structure?


try:
mem_fd = os.open('/dev/mem', os.O_RDONLY | os.O_SYNC)
reg_address = ch_info.reg_block_base_addr + ch_info.reg_offset
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the data structure change i think this need to change also

…sting logic for changed data structure

Co-authored-by: Tharun Ganeshram <tharun.ganeshram@gmail.com>
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2019-2025, NVIDIA CORPORATION. All rights reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a new file so it would be

2025

@@ -1,4 +1,4 @@
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an old file so it should be

2023-2025

* Pinctrl data for the NVIDIA Tegra234 pinmux
*
* Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2021-2025, NVIDIA CORPORATION. All rights reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically you dont need to change this 😅

Co-authored-by: Tharun Ganeshram <tharun.ganeshram@gmail.com>
Co-authored-by: Tharun Ganeshram <tharun.ganeshram@gmail.com>
GPIO.setwarnings(True)
mem_fd = os.open('/dev/mem', os.O_RDWR | os.O_SYNC)
# These depend on the pin being BCM 4 for Orin nano/nx
PIN_REGISTER_ADDR = 0x02448000 + 0x28
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update the PIN_REGISTER_ADDR to 0x02448030

Co-authored-by: Tharun Ganeshram <tharun.ganeshram@gmail.com>
@anhmiuhv anhmiuhv merged commit 4e2cf9a into NVIDIA:master Sep 26, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet