Hi,
We have a custom design with Orin Nano and would like to use SPI0_SCK(PZ.03) as output and control by GPIO-LED framework, userspace control GPIO by C code directly.
Default level = HIGH after boot requirement.
- Set PZ.03 = output & level HIGH
diff --git a/bootloader/generic/BCT/tegra234-mb1-bct-pinmux-p3767-hdmi-a03.dtsi b/bootloader/generic/BCT/tegra234-mb1-bct-pinmux-p3767-hdmi-a03.dtsi
index 0e5e3a420..bff1c17b1 100644
— a/bootloader/generic/BCT/tegra234-mb1-bct-pinmux-p3767-hdmi-a03.dtsi
+++ b/bootloader/generic/BCT/tegra234-mb1-bct-pinmux-p3767-hdmi-a03.dtsi
@@ -732,9 +732,9 @@
spi1_sck_pz3 {
nvidia,pins = “spi1_sck_pz3”;
nvidia,function = “rsvd1”;
- nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
- nvidia,tristate = <TEGRA_PIN_ENABLE>;
- nvidia,enable-input = <TEGRA_PIN_ENABLE>;
+ nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+ nvidia,tristate = <TEGRA_PIN_DISABLE>;
+ nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
diff --git a/bootloader/tegra234-mb1-bct-gpio-p3767-hdmi-a03.dtsi b/bootloader/tegra234-mb1-bct-gpio-p3767-hdmi-a03.dtsi
index e876b0157..8e5b9d2a7 100644
— a/bootloader/tegra234-mb1-bct-gpio-p3767-hdmi-a03.dtsi
+++ b/bootloader/tegra234-mb1-bct-gpio-p3767-hdmi-a03.dtsi
@@ -77,9 +77,10 @@
gpio-output-high = <
TEGRA234_MAIN_GPIO(Q, 3)
TEGRA234_MAIN_GPIO(A, 0)
TEGRA234_MAIN_GPIO(G, 6)
TEGRA234_MAIN_GPIO(N, 1)
+ TEGRA234_MAIN_GPIO(Z, 3)
>;
};
Result: PZ.03 level = HIGH after boot, correct
- Add GPIO-LED framework
Result: Node /sys/class/leds/uart-mode0/brightness generated and I can echo 1/0 to control GPIO level, but PZ.03 level = LOW after boot, incorrectdiff --git a/source/hardware/nvidia/t23x/nv-public/nv-platform/tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi b/source/hardware/nvidia/t23x/nv-public/nv-platform/tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi index 98780a431..5660be903 100644 — a/source/hardware/nvidia/t23x/nv-public/nv-platform/tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi +++ b/source/hardware/nvidia/t23x/nv-public/nv-platform/tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi @@ -454,6 +459,22 @@ tegra-hsp@b950000 { status = "okay"; }; + gpio { + compatible = "gpio-leds"; + status = "okay"; + uart-mode0 { + gpios = <&gpio TEGRA234_MAIN_GPIO(Z, 3) GPIO_ACTIVE_HIGH>; + }; + }; };
I had a workaround is echo 1 > /sys/class/leds/uart-mode0/brightness by systemd at booting time to correct level.
But I wish better solution.
Please provide any suggestions, beyond GPIO-LED framework also
(I considered /sys/class/gpio, but it was marked as DEPRECATED and couldn’t be named the desired name)
Thanks all very much.