I wanted to let you know that I came up with a clean-ish solution that works for shutdown as well as reboot. I managed to do it with a single device-tree overlay
apalis-imx8_gpio-poweroff_overlay.dts
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
// GPIO power off handling
#include <dt-bindings/gpio/gpio.h>
/dts-v1/;
/plugin/;
/ {
compatible = "toradex,apalis-imx8", "toradex,apalis-imx8-v1.1";
};
&{/} {
gpio_poweroff: gpio-poweroff {
compatible = "gpio-poweroff";
gpios = <&lsio_gpio4 2 GPIO_ACTIVE_LOW>;
timeout-ms = <3000>;
active-delay-ms = <1000>;
inactive-delay-ms = <1000>;
priority = <1>;
// Make sure the pin is configured as GPIO
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio6>;
};
gpio_reset_moci: gpio-restart {
compatible = "gpio-restart";
gpios = <&lsio_gpio0 30 GPIO_ACTIVE_LOW>;
active-delay = <100>;
inactive-delay = <0>;
wait-delay = <0>;
priority = <192>;
// Make sure the pin is configured as GPIO
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_reset_moci>;
};
};
// If enabled, this would change the pin muxing for pinctrl_gpio6
&flexcan3 {
status = "disabled";
};
// If enabled, this would change the pin muxing for pinctrl_reset_moci
&pciea {
status = "disabled";
};
As you can see, I added a gpio-restart node for the pinctrl_reset_moci. I know that this driver is not made for that but it suited my needs for now.
Subsequently, would it be possible to keep me informed regarding a more optimal solution provided by toradex in the future?
Best regards,