Setting GPIO as output from u-boot

Hi all,
we need to set Pin PE6 on Jetson Nano Devkit as output at high level for self-locking the power supply.
I tried with the Ecxel-sheet and csv files, but the configuration is still special funktion. The next thing i tried is jetson-io.py. But it determines immediately without error message.
What is the syntax to set pinmux to GPIO output and pin level to high in .dtsi file?
Thanks in advance!

hello joachim.platzer,

may I know what’s your actual use-case?
there’s L4T Driver Package (BSP) Sources, as you can see, u-boot sources is public available. you may have customization to control GPIOs, please also check developer guide, U-Boot Customization for reference,
thanks

Hi JerryChang,
we have to set Pin PE6 as early as possible for holding the power supply of a battery driven device. I tried with these manuals and also tried it with jetson-io. But no success. Surely my fault.
There are only examples for using SPI in u-boot, but none for GPIO.
I want to know the syntax to set PE6 as GPIO Output in state high in the dts-file (pinmux, output configuration and state).

hello joachim.platzer,

had you have pinmux customization to change pin direction and also initial state?
you should overwrite the default board configure with the generate dtsi files and flashing the board.
for example,

			pe6 {
				nvidia,pins = "pe6";
				nvidia,function = "rsvd0";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};

Hello Jerry Chang,
i’m struggeling at NVIDIA Jetson Linux Developer Guide : Platform Adaptation and Bring-Up | NVIDIA Docs

5.Copy the generated .dtsi files from the directory that contains the spreadsheet to the following locations:

jetson_nano_module-pinmux.dtsi to <src_path>/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448--.dtsi

jetson_nano_module-gpio.dtsi to <src_path>/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-jetson-cv-gpio-p2597-2180-a00.dtsi
I think it should be:
5.Copy the generated .dtsi files from the directory that contains the spreadsheet to the following locations:

jetson_nano_module-pinmux.dtsi to <src_path>/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-pinmux---.dtsi

jetson_nano_module-gpio.dtsi to <src_path>/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-jetson-cv-gpio---.dtsi

p2597 is TX1, so i think it is not usable with nano.
Or am i wrong? Is there a better HowTo?
I’ll try to modify the dts-file and check it that works.

hello joachim.platzer,

Jetson Nano looks for device tree blob to apply board configurations. it’s p3448 for Nano series.
one ways to confirm the device tree blob you’re used is digging into flashing logs.
for example,
this is the exact dtb binary flashed to my Nano platform.

[ 260.8830 ] Writing partition DTB with tegra210-p3448-0000-p3449-0000-a02.dtb.encrypt

after that, please look back to public sources,
there’s dtsi source that you should have modification,
for example,
$L4T_Sources/r32.5/Linux_for_Tegra/source/public/hardware./nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-a02.dts

hope this helps your development,
thanks

It helps a little bit for understanding. I don’t have this message in my logs because i only update the bootloader.flash_uboot_output.txt (10.9 KB)
I asume your dtb is for the kernel.
There is a u-boot.dtb in /Linux_for_tegra/sources/u-boot created by me, but when i decompile it, there is no entry with PE6.
Thanks for your support

hello joachim.platzer,

please perform a complete flash process to apply the board configurations.
thanks

Hello JerryChang,
unfortunately it doesn’t work anymore.[build_nano_error.txt|attachment]build_nano_error.txt (3.1 KB)
How can i increase the size of loop device? I tried
sd_blob_size=$(“${l4t_tools_dir}/nvptparser.py”

“${signed_image_dir}/${signed_cfg}” “${storage}” | awk -F’[=;]’ '{sum +=

(int($6 / (4096 * 512)) + 1)} END {printf “%dM\n”, sum + 2}')

but it’s the same problem.

hello joachim.platzer,

please check Building the NVIDIA Kernel; you may overwrite the dtsi files then build the device tree blob,
please update the device tree blob by using flash.sh to flash the images. see Basic Flash Script Usage.
thanks