TX2 Pad Voltage Configuration

Hi,
I’d like to change the DMIC_HV voltages from 1.8v to 3.3v but am having difficulty getting this working.

I am using L4T32.2 but have been following the guide in the L4T28.2 documentation, section “TX2 Configuring Pinmux GPIO and PAD”, as I couldn’t find a similar section in the L4T32.2 documentation.

I have downloaded the L4T32.2 pinmux spreadsheet nv_Jetson-TX2-Series-Pinmux-Template and after changing the DMIC_HV voltage to 3.3v and generating a pad-default.dtsi file, I execute the pinmux-dts2cfg.py command to create a new padvoltage.cfg file.

Effectively file Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pad-quill-p3310-1000-c03.cfg was modified from

##
## CFG version 1.0
## Input pad file name: tegra18x-p3310-1000-c0-cvm-config-padvoltage-default.dtsi
## Generation date: 2016-09-06 21:07
## PLEASE DO NOT EDIT THIS FILE
## This is autogenerated file using the script pinmux-dts2cfg.py
##
# AUDIO_HV   : 1.8V
# DMIC_HV    : 1.8V
# SDMMC1_HV  : 3.3V
# SDMMC2_HV  : 3.3V
# SDMMC3_HV  : 3.3V
# AO_HV      : 3.3V
# SPI        : 1.8V
# DBG        : 1.8V
# UFS        : 1.8V
pmc.major = 1;
pmc.minor = 0;
pmc.0x0c36003c = 0x0000003e; # PMC_IMPL_E_18V_PWR_0
pmc.0x0c360040 = 0x00000079; # PMC_IMPL_E_33V_PWR_0

to

##
## CFG version 1.0
## Input pad file name: tegra18x-p3310-1000-c0-cvm-config-padvoltage-default.dtsi
## Generation date: 2019-11-22 11:08
## PLEASE DO NOT EDIT THIS FILE
## This is autogenerated file using the script pinmux-dts2cfg.py
##
# AUDIO_HV   : 1.8V
# DMIC_HV    : 3.3V
# SDMMC1_HV  : 3.3V
# SDMMC2_HV  : 3.3V
# SDMMC3_HV  : 3.3V
# AO_HV      : 3.3V
# SPI        : 1.8V
# DBG        : 1.8V
# UFS        : 1.8V
pmc.major = 1;
pmc.minor = 0;
pmc.0x0c36003c = 0x0000003e; # PMC_IMPL_E_18V_PWR_0
pmc.0x0c360040 = 0x0000007d; # PMC_IMPL_E_33V_PWR_0

After re-flashing the bootloader, and enabling one of the GPIOs in the block as follows

sudo su
echo 390 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio390/direction 
echo 1 > /sys/class/gpio/gpio390/value

The voltage of pin GPIO18_MDM_COLDBOOT(GPIO3_PI.06) still measured 1.8v. I can confirm that this is the correct pin because after executing “echo 0 > /sys/class/gpio/gpio390/value”, the pin reports 0v.

Is there something else I am missing?
Do I need to re-flash the file-system for the new cfg file to take effect?
Is there a way I can observe the applied pad voltage settings on the TX2?

Thanks.

hello marc.armstrong,

you’ll need to perform a whole flash to update the pinmux configurations.
thanks

Hi,

I tried reflashing the kernel, DT and system image, however this has a detrimental effect. GPIO18 now produces a value of around 0.1v and doesn’t change when I execute echo 1 > /sys/class/gpio/gpio390/value or echo 0 > /sys/class/gpio/gpio390/value.

Do I need to actually regenerate the system.img file after updating a cfg file?
Is there a way to check the DMIC_HV voltage configuration on the running system?

Thanks

Try using devmem2 from the command line to verify that your register changes have taken place and have been maintained through the boot process.

devmem2 0x0c36003c w
devmem2 0x0c360040 w

Hi,

Thanks for the suggestion. I tried running the devmem2 commands, however this produced unexpected results.

$ sudo devmem2 0x0c36003c b
/dev/mem opened.
Memory mapped at address 0x7f9e490000.
Value at address 0xC36003C (0x7f9e49003c): 0x3E
$ sudo devmem2 0x0c360040 b
/dev/mem opened.
Memory mapped at address 0x7f9ee7a000.
Value at address 0xC360040 (0x7f9ee7a040): 0x39

The value for 0xC36003C is as expected, however 0xC360040 reads back a value different to the old (0x79) and new (0x7d) values, according to the pad cfg file.

Am I modifying the correct file?

Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pad-quill-p3310-1000-c03.cfg

Do I need to modify the device tree?

Thanks

Hi,

Thanks for the suggestion. I tried running the devmem2 commands, however this produced unexpected results.

$ sudo devmem2 0x0c36003c b
/dev/mem opened.
Memory mapped at address 0x7f9e490000.
Value at address 0xC36003C (0x7f9e49003c): 0x3E
$ sudo devmem2 0x0c360040 b
/dev/mem opened.
Memory mapped at address 0x7f9ee7a000.
Value at address 0xC360040 (0x7f9ee7a040): 0x39

The value for 0xC36003C is as expected, however 0xC360040 reads back a value different to the old (0x79) and new (0x7d) values, according to the pad cfg file.

Am I modifying the correct file?

Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pad-quill-p3310-1000-c03.cfg

Do I need to modify the device tree?

Thanks

You are probably using the old 32-bit devmem2 executable from the package repository. It has a bug in it, and you need to recompile devmem2 with the latest source changes for the AArch64 64-bit architecture.

If your value is not “sticking” you have something wrong. 1) Either the place you are modifying is not correct or possibly not built into your image. 2) The address is not writable/modifiable. 3) You haven’t loaded/rebuilt it properly to your system. 4) Something is overriding it later in the boot process.

You can search the DTS/DTSI files to see if there are any references to those addresses in the device tree. You can also look inside the booted system in the /proc/device-tree directory for references. Finally, you can stop the boot process in U-Boot and read those addresses with the built-in U-Boot command line support and see if the modifications to those addresses are correct.

You might try writing to that address in U-Boot or with a recompiled devmem2 to see if you can modify that address to the value you desire.

This is the test to know if you are modifying the correct cfg file and loading it correctly:
If you don’t modify either of the two pmc addresses in the cfg, do you get the correct/default value in the kernel? If you then modify the cfg file, build, and load, do you only see only the one register update and not the other?

Thanks for your helpful response and sorry for the late reply. For some reason I didn’t an email notification.

Regarding the version of devmem2. It is reported to be arm64, as shown below. Does this look correct?

Get:1 http://ports.ubuntu.com/ubuntu-ports xenial/universe arm64 devmem2 arm64 0.0-0ubuntu1 [5,518 B]

I can use devmem2 to change the register value, as follows.

sudo devmem2 0x0c360040 b 0x79
/dev/mem opened.
Memory mapped at address 0x7f8b917000.
Value at address 0xC360040 (0x7f8b917040): 0x39
Written 0x79; readback 0x79

However the DMIC gpios still produce a voltage of 1.8v when configured a outputs.

I searched the device tree an found the following entry

pmc@c360000 {
		nvidia,restrict-voltage-switch;
		pinctrl-names = "default";
		pinctrl-0 = <&iopad_default>;

		iopad_default: iopad-defaults {
			sdmmc-io-pads {
				pins = "sdmmc1-hv", "sdmmc2-hv", "sdmmc3-hv";
				nvidia,enable-voltage-switching;
			};
		};
	};

I tried modifying this to

pmc@c360000 {
		nvidia,restrict-voltage-switch;
		pinctrl-names = "default";
		pinctrl-0 = <&iopad_default>;

		iopad_default: iopad-defaults {
			sdmmc-io-pads {
				pins = "sdmmc1-hv", "sdmmc2-hv", "sdmmc3-hv";
				nvidia,enable-voltage-switching;
			};

			dmic_hv {
				nvidia,io-pad-init-voltage = <IO_PAD_VOLTAGE_3_3V>;
			};
		};
	};

and confirmed that there is an entry in /proc/device-tree/pmc@c360000/.

Regarding the cfg file. Is there documentation to explain which cfg file to modify and how to ensure this gets applied? I modify

Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pad-quill-p3310-1000-c03.cfg

Thanks

hello marc.armstrong,

there’s MB1 BCT to specifies platform-specific data.
you’ll need to check the developer guide, please refer to Jetson TX2 Pad Voltage Configuration.
thanks

Thanks for the reference. After reading the documentation, I can confirm that I am modifying the correct file

Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pad-quill-p3310-1000-c03.cfg

yet the new setting is not being applied after flashing to the TX2.

hello marc.armstrong,

assume you’re have pinmux customization,
you should generate dtsi files through pinmux spreadsheet. then, you’ll need to copy those dtsi files to ubuntu host machine to generate cfg file to flash the board.
please refer to Jetson/AGX Xavier Update Pinmux for the steps,
you might also check Jetson/AGX Xavier Update Pinmux for pin examination.
thanks