Hello, I want to simply toggle a GPIO low and then high in uboot and then set up the device tree such that the pin is held high after system is booted.
I was able to do this successfully for Apalis GPIO8 which is available on my Evaluation Board on the X4 header labeled GPIO8. I did this with a modification to “board/toradex/apalis-tk1/apalis-tk1.c” in uboot and a modification to “arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-gpio.dtsi” in the kernel device tree. In both cases, I used TEGRA_GPIO(DD, 2) per page 33 of the datasheet: https://docs.toradex.com/103129-apalis-tk1-datasheet.pdf
So that all worked as expected, so I anticipated that just transitioning the behavior from GPIO8 to GPIO3 would be easy. However, it does not work for me. I’m using TEGRA_GPIO(N, 4) as that is the port/offset I see in the datasheet. However, I did notice a comment in “arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-gpio.dtsi” that made it seem that TEGRA_GPIO(V, 4) would be GPIO3. So I did try this as well but it did not work.
I also just tried exporting gpio-108 using sysfs since 108 is the mapping for GPIO N,4 according to GPIO Alphanumeric to GPIO Numeric Assignment | Toradex Developer Center
This did not work. I got an error: “Device or resource busy”.
If I read /sys/kernel/debug/gpio, I see the following:
GPIOs 0-255, platform/6000d000.gpio, tegra-gpio:
gpio-63 (+V1.05_AVDD_HDMI_PLL) out hi
gpio-70 (temp_alert ) in hi
gpio-74 (apalis-tk1-k20-int2 ) out hi
gpio-108 (VCC_USBO1 ) out lo
gpio-109 (VCC_USBH(2A|2C|2D|3|) out hi
gpio-117 (WOL_GPIO ) in hi
gpio-118 (LAN_DEV_OFF_N ) out hi
gpio-146 (LAN_RESET_N ) out hi
gpio-164 (RESET_MOCI_CTRL ) out hi
gpio-170 (sdhci_cd ) in lo
gpio-171 (sdhci_cd ) in hi
gpio-172 (sysfs ) out hi
gpio-178 (apalis-tk1-k20-ezpcs) out hi
gpio-222 (apalis-tk1-k20-reset) out hi
gpio-233 (PEX_PERST_N ) out hi
gpio-234 (sysfs ) out lo
gpio-235 (WAKE1_MICO ) in hi
GPIOs 856-1015, platform/apalis-tk1-k20-gpio, can sleep:
GPIOs 1016-1023, platform/as3722-pinctrl, as3722-gpio, can sleep:
gpio-1018 (+V3.3 ) out hi
root@apalis-tk1:~#
Can you help my understand what I am missing in regards to controlling Apalis GPIO3?