Hello, On Thu, Jan 15, 2026 at 02:52:48PM +0100, Thomas Bonnefille wrote: > Fixes the PWM<A> that was previously used as a GPIO output instead of a > real PWM, it also reserve the framebuffer region to preserve the splash > screen while the OS is booting. > > Signed-off-by: Thomas Bonnefille <[email protected]> > Acked-by: Francesco Dolcini <[email protected]> > --- > board/toradex/colibri_imx7/colibri_imx7.c | 41 > +++++++++++++++++++++++-------- > 1 file changed, 31 insertions(+), 10 deletions(-) > > diff --git a/board/toradex/colibri_imx7/colibri_imx7.c > b/board/toradex/colibri_imx7/colibri_imx7.c > index 69a8a18d3a7..55480213c67 100644 > --- a/board/toradex/colibri_imx7/colibri_imx7.c > +++ b/board/toradex/colibri_imx7/colibri_imx7.c > @@ -18,6 +18,7 @@ > #include <asm/io.h> > #include <dm.h> > #include <dm/platform_data/serial_mxc.h> > +#include <fdt_simplefb.h> > #include <fdt_support.h> > #include <fsl_esdhc_imx.h> > #include <jffs2/load_kernel.h> > @@ -29,8 +30,10 @@ > #include <netdev.h> > #include <power/pmic.h> > #include <power/rn5t567_pmic.h> > +#include <pwm.h> > #include <usb.h> > #include <usb/ehci-ci.h> > +#include <video.h> > #include "../common/tdx-common.h" > > DECLARE_GLOBAL_DATA_PTR; > @@ -114,7 +117,7 @@ static iomux_v3_cfg_t const backlight_pads[] = { > /* Backlight On */ > MX7D_PAD_SD1_WP__GPIO5_IO1 | MUX_PAD_CTRL(NO_PAD_CTRL), > /* Backlight PWM<A> (multiplexed pin) */ > - MX7D_PAD_GPIO1_IO08__GPIO1_IO8 | MUX_PAD_CTRL(NO_PAD_CTRL), > + MX7D_PAD_GPIO1_IO08__PWM1_OUT | MUX_PAD_CTRL(NO_PAD_CTRL), > MX7D_PAD_ECSPI2_MOSI__GPIO4_IO21 | MUX_PAD_CTRL(NO_PAD_CTRL), > }; > > @@ -123,6 +126,8 @@ static iomux_v3_cfg_t const backlight_pads[] = { > > static int setup_lcd(void) > { > + int ret = 0; > + > imx_iomux_v3_setup_multiple_pads(backlight_pads, > ARRAY_SIZE(backlight_pads)); > > /* Set BL_ON */ > @@ -130,10 +135,15 @@ static int setup_lcd(void) > gpio_direction_output(GPIO_BL_ON, 1); > > /* Set PWM<A> to full brightness (assuming inversed polarity) */ > - gpio_request(GPIO_PWM_A, "PWM<A>"); > - gpio_direction_output(GPIO_PWM_A, 0); > - > - return 0; > + enable_pwm_clk(1, 0); > + ret = pwm_init(0, 0, 0); > + if (ret) > + return ret; > + ret = pwm_config(0, 0, 6666666); > + if (ret) > + return ret; > + ret = pwm_enable(0); > + return ret; > } > #endif > > @@ -142,12 +152,11 @@ static int setup_lcd(void) > */ > void board_preboot_os(void) > { > -#ifdef CONFIG_VIDEO > - gpio_direction_output(GPIO_PWM_A, 1); > - gpio_direction_output(GPIO_BL_ON, 0); > -#endif > + if (IS_ENABLED(CONFIG_VIDEO) && IS_ENABLED(CONFIG_VIDEO_REMOVE)) { > + gpio_direction_output(GPIO_PWM_A, 1); > + gpio_direction_output(GPIO_BL_ON, 0); > + }
Is this correct now that PWM_A is not used as GPIO anymore? See `backlight_pads` ?

