Hello!
I’m running into a bit of an issue setting the power-on state of a GPIO pin.
To begin, we are using a Verdin SOM (iMX8M Plus) on a custom carrier board, which is based upon the Dahlia board. We are also running a b2qt image at the moment, but will be moving to a custom Yocto image.
From a hardware perspective, on the carrier board, we are running the GPIO pin (SODIMM 143 - GPIO2-IO6) to a 1.8V to 5V level shifter. There is a 1K pullup on the 5V side, as required by the level shifter.
During boot up, the desired behavior is to have the line at 0V.
I have a device tree overlay that contains the below:
&iomuxc {
pinctrl-0 = <&pinctrl_gpio1>, <&pinctrl_gpio2>,
<&pinctrl_gpio3>, <&pinctrl_gpio4>,
<&pinctrl_gpio7>, <&pinctrl_gpio8>,
<&pinctrl_gpio_hog1>, <&pinctrl_gpio_hog2>, <&pinctrl_gpio_hog3>,
<&pinctrl_hdmi_hog>, <&pinctrl_add_gpio>;
pinctrl_add_gpio: add_gpio_grp {
fsl,pins = <
MX8MP_IOMUXC_SD1_DATA4__GPIO2_IO06 0x104 /* SODIMM 143*/
>;
};
};
I can confirm that the overlay is functioning properly. If I disconnect the GPIO pin from the level shifter, I see 0V at the pin during boot up when the Pad Control Register is set to 0x104. If I change the Pad Control Register to a pull up instead of a pull down (0x144), I see 1.8V at the GPIO pin during boot up.
When the Pad Control Register is set to pull down (0x104) and the pin is connected to the level shifter, I see 1.8V at the pin during boot up. If I let the OS (Yocto Linux) boot and use sysfs to set the pin as an output with a value of 0, the GPIO pin successfully goes to 0V.
I’m suspecting that the pin is configured as an input during boot up and that is why I’m not able to drive the pin low with the level shifter attached. Do you think this might be the case? If so, is there a way to configure the pin as an output during boot up?
Thanks for your help!