From patchwork Wed Nov 4 08:50:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4973 Delivered-To: michael@amarulasolutions.com Received: by 2002:a05:7301:6783:b0:36a:3487:1c26 with SMTP id qo3csp69732dyb; Wed, 4 Nov 2026 00:52:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBzwh3aVB+ytcscKXPOunk/LjDpC9N4G1Lr8qJELH0UVc4lTDqTOyFdJ/ob8SbSs0+3RU2BehCeZ@amarulasolutions.com X-Received: by 2002:a05:600c:3b87:b0:4a2:150f:1607 with SMTP id 5b1f17b1804b1-4ac1709ad56mr370489665e9.13.1793782349312; Wed, 04 Nov 2026 00:52:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793782349; cv=none; d=google.com; s=arc-20260327; b=bRPXCPsMiS2VfsLpiMIOcqZ+C5momp/hjRnJ+oW5pch/pXkJSMK7zrhp5L4EixDmve vcsfDI7UnM6wAme1OiesFtZqTmnWIHcMmFMP8Wrrp+Kn/6yKulS4YLgJ/Ck/Hi2sn0Vv 3oWI5lhrFCz2fgRuwXa7MF8yOJ8XMCXWCYMxcZx8uA/3xxzmU7IUWb0A127XgCNT74RA j7Lcft9N0h4jFjhjU/ck1C1wqXLFxGYW9p8XlOo7HYXjxo+8pEV+S5FHOBPJExjVwfEy yENBn+2U20BWnfsnFGRDoP0ExdCHB9POgdsCxCRT26PIpgnqUeUG0fb3oylbRW6lkSD9 aEFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=wucyZpRbmTQjG17TJZGaKYFcprJ9JI8ZgO2QVfoWZyw=; fh=+i1jhd7Uxs2NJNofv1KWkF58mVhHqU8EV8xdw3Of44w=; b=hFhWZuAbsrqGjtSFBXeBxmpsm92UVo/S6LgEBtKH87WM53VSpyTC10E007LjxSplRD UG2TLfqZt1lqXjhQ8oO/dIZLa4C1I9gN5akG9Qy3jOYR/8SprUDaLKB4vTp5po/BVoa1 6CM/xelkOIbzxqXyPZf+p9BN4J0D3xWu2JZmEpSG08G/LYgQib4J8ylZtHf7lt4slI4w oi+bPmunWw7wSFBpzDeY6qEjo++OU6hI42ZG7PuvsMcFBHucKlYV4vD4W+525rcWo1Vx omyfkr1t1LpXDXshktzNrpLFrhmear/wj89kZpNzWDUmdZR8hP/7PgM0FMsSNV6cjqhJ uGsQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NMqPpbXf; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-4b43e2524edsor2429245e9.17.2026.11.04.00.52.29 for (Google Transport Security); Wed, 04 Nov 2026 00:52:29 -0800 (PST) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NMqPpbXf; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1793782349; x=1794387149; darn=amarulasolutions.com; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wucyZpRbmTQjG17TJZGaKYFcprJ9JI8ZgO2QVfoWZyw=; b=NMqPpbXf7oKFng6gvvKdYpjLI3pVAFI2+pr4uuPMnkzotcpTfs7sMeGI7A/t8vINTi AsV+G1NjBCIMjp3MnZq+J5r2NBifdI3NxXLhqVh9Sm5NlDxWhPWf22Sx99gQAy6pwD4J iE7rRfZCp/7YIZoSxW+3LZuNx3uvLP4l7UEdQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793782349; x=1794387149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=wucyZpRbmTQjG17TJZGaKYFcprJ9JI8ZgO2QVfoWZyw=; b=HFNE6kHp+YAhgVramrhNi6GDxcPiBbWXz+1XkZ/ntmckYVGEGJlqM9MCQmsMywYdV9 Az0qhipwMifsPHqV94GRLDCFlV8ZjfNHcR9b/exS6dT40HCcYBhiUzM6eMoLtTTgezVi x6sb2qBF13+hziQcHwm7o4EDNeooKBWu0MFeYYAwuD0H51BwieXT1u6XedU2Fa1arSpG AM/BOfRN7KVNwzoJhBsBe9Z3kXs/NQzdcIwu6OjOMOBaaeQqSD7e45wUN65aDF8YPBMg vxvpT3q2pRK7jKuY/LPeRwgc8znRGStSg4o5n15+s/EZj6/AHnCCfxTFMsvlMsbGcCC3 aLMg== X-Forwarded-Encrypted: i=1; AKwUvBzLmwoDuKkB0+KwRCWak935E6swX0HK7pWTFZyBS4Z0IyWMauRYhWq8JReZLx49yOZkBIoYUknL@amarulasolutions.com X-Gm-Message-State: APuU4Z+m/1cBaqGmaA6wfJRvtYI+6QU4X5tUGMN3YI4B07XHb72Ht8Ph J6f2ghGRsVeXi9H33ocj0HuoLeVvmX8SPMSjvjRXHhfAh8g3jgmREZgZjqdle06vugGB/Q== X-Gm-Gg: AYBFou3OFTjrf6vMk50H3aCJR3Vo/fhHek44L6f/uixAnA+HQ8e1dbD6o0iNgpmOoZc PVOTDiA2IMaAVL01Pu63RSOe9zGLOkG3PByOaJNA5R0IHwZzUwBg4E1uHLtvIPyZsTfc40sD2It 3MNarzHsQL07JW0eFsWM4nqqRreoMNkLh7tT7TfOMfKHTad82pn7acncF6PmTJ/25+S8sEEISLw p/PZbwg1gMxNor0H3Ks7+D0nIZex2BcpXdR1jGzk7q8awjsEYPZVllzQkD2r3QQHniwVMRZDFnT 15nhJCCJEOk28FZlyJaYV16tEJJ6FBkkpHC8tULqzH0a005l+jvaEV4VM4W1fLid7JiVUyrMPzN rn34OqT8ffIj70cADZpijEiFzxlI02pgNyiQ48xoT/RcLcS4uNSpxtrJY1jHzc8/Nas1639VTBP u30xMfZeKL81WOCLX7WdfyPJv7NW2FFeN0tT/ylRDLruaG1DMNqS916XFuLXVaok+EZEFuVqJgr ZeQsCg2OCAGK6r58WsHJIwIpQKTe5JLktLc++UpgAV/2EwiSazzrgiwUt62oo6vUQRKh+fjuySI SYtd9eq66PFJwLnjMP2ApJabatjNXMFFOGI8XW+OqxagBJLII0gc9Aykql+IDCDxv9hw6e1XNW2 7QHq2EBnEKrZMnUbumsSu7bS9gqju X-Received: by 2002:a05:600c:4e88:b0:4a3:59c7:f226 with SMTP id 5b1f17b1804b1-4ac16bc4713mr363757205e9.6.1793782348625; Wed, 04 Nov 2026 00:52:28 -0800 (PST) Return-Path: Received: from dario-ThinkPad-P14s-Gen-5.. ([109.54.139.206]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4b413312a4fsm20555915e9.1.2026.11.04.00.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2026 00:52:28 -0800 (PST) From: Dario Binacchi To: Patrice Chotard , Patrick Delaunay Cc: linux-amarula@amarulasolutions.com, michael@amarulasolutions.com, Dario Binacchi , Ilias Apalodimas , Tom Rini , u-boot@lists.u-boot-project.org, uboot-stm32@st-md-mailman.stormreply.com Subject: [PATCH 31/33] board: engicam: stm32mp2: add splash screen Date: Wed, 4 Nov 2026 09:50:04 +0100 Message-ID: <20261104085036.4012238-32-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261104085036.4012238-1-dario.binacchi@amarulasolutions.com> References: <20261104085036.4012238-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Describe the RGB and LVDS displays in the U-Boot devicetree and show a splash screen on the one selected by the "display" environment variable. The U-Boot devicetree can only be fixed up before relocation, when the environment is not loaded yet. So, once the environment is loaded, unbind the panels not selected before the video devices are probed. If the selected display is not described, as for a display supported by Linux only, unbind the video devices too, so that U-Boot does not touch the display controller. The splash image is loaded from the partition 10 of the boot device, falling back to the built-in Engicam logo. Signed-off-by: Dario Binacchi --- ...m32mp257d-engicam-microgea-rmm-u-boot.dtsi | 88 +++++++++++++++ board/engicam/stm32mp2/microgea-stm32mp2.env | 8 ++ board/engicam/stm32mp2/stm32mp2.c | 104 ++++++++++++++++++ configs/stm32mp25-microgea-rmm_defconfig | 15 +++ 4 files changed, 215 insertions(+) -- 2.43.0 diff --git a/arch/arm/dts/stm32mp257d-engicam-microgea-rmm-u-boot.dtsi b/arch/arm/dts/stm32mp257d-engicam-microgea-rmm-u-boot.dtsi index 4cc0d47e999d..feca4e7d5f26 100644 --- a/arch/arm/dts/stm32mp257d-engicam-microgea-rmm-u-boot.dtsi +++ b/arch/arm/dts/stm32mp257d-engicam-microgea-rmm-u-boot.dtsi @@ -4,6 +4,7 @@ * Copyright (C) 2026 Engicam srl */ +#include #include "stm32mp25-u-boot.dtsi" / { @@ -12,6 +13,93 @@ }; }; +/ { + panel-lvds { + compatible = "ampire,am-1280800w8tzqw-t00h"; + backlight = <&backlight>; + power-supply = <®_3v3>; + + port { + lvds_panel_in: endpoint { + remote-endpoint = <&lvds_out>; + }; + }; + }; +}; + +/* + * Displays supported for the splash screen: the Rocktech RK050HR345-CT106A + * RGB one and the Ampire AM-1280800W8TZQW-T00H LVDS one. Linux describes + * them in devicetree overlays instead, and the board code keeps only the + * one selected by the "display" environment variable. + */ +<dc { + /* RGB output: the pixel clock is the LTDC kernel clock */ + clocks = <&rcc CK_KER_LTDC>, <&rcc CK_BUS_LTDC>, <&syscfg>, <&lvds>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <<dc_pins_a>; + pinctrl-1 = <<dc_sleep_pins_a>; + bootph-all; + status = "okay"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + ltdc_out_rgb: endpoint@0 { + reg = <0>; + remote-endpoint = <&rgb_panel_in>; + }; + + ltdc_out_lvds: endpoint@1 { + reg = <1>; + remote-endpoint = <&lvds_in>; + }; + }; +}; + +&lvds { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + lvds_in: endpoint { + remote-endpoint = <<dc_out_lvds>; + }; + }; + + port@1 { + reg = <1>; + + lvds_out: endpoint { + remote-endpoint = <&lvds_panel_in>; + }; + }; + }; +}; + +&spi1 { + display@0 { + compatible = "rocktech,rk050hr345-ct106a", "ilitek,ili9806e"; + reg = <0>; + vdd-supply = <®_3v3>; + spi-max-frequency = <10000000>; + reset-gpios = <&gpiob 6 GPIO_ACTIVE_LOW>; + backlight = <&backlight>; + + port { + rgb_panel_in: endpoint { + remote-endpoint = <<dc_out_rgb>; + }; + }; + }; +}; + &usart2 { bootph-all; }; diff --git a/board/engicam/stm32mp2/microgea-stm32mp2.env b/board/engicam/stm32mp2/microgea-stm32mp2.env index 2a65b14231a3..94c78c0fff1a 100644 --- a/board/engicam/stm32mp2/microgea-stm32mp2.env +++ b/board/engicam/stm32mp2/microgea-stm32mp2.env @@ -13,3 +13,11 @@ */ display=rk050hr345-ct106a extension_overlay_addr=0x90300000 + +/* + * Splash screen, centered: splashfile in the partition 10 of the boot + * device or, if missing, the built-in Engicam logo + */ +splashfile=splash.bmp +splashimage=CONFIG_SYS_LOAD_ADDR +splashpos=m,m diff --git a/board/engicam/stm32mp2/stm32mp2.c b/board/engicam/stm32mp2/stm32mp2.c index de06d21764c2..51274f6b9dc7 100644 --- a/board/engicam/stm32mp2/stm32mp2.c +++ b/board/engicam/stm32mp2/stm32mp2.c @@ -8,10 +8,17 @@ #include #include +#include #include +#include #include #include +#include +#include +#include +#include #include +#include #include int checkboard(void) @@ -42,6 +49,103 @@ static const char *microgea_get_display(void) return display; } +/* + * The U-Boot devicetree describes the displays supported for the splash + * screen. Their panel compatible is ",", where + * is the display fitted on the carrier board. + */ +static bool microgea_panel_is_display(struct udevice *panel, + const char *display) +{ + const char *compat, *model; + + compat = dev_read_string(panel, "compatible"); + if (!compat) + return false; + + model = strchr(compat, ','); + + return model && !strcmp(model + 1, display); +} + +/* + * Before the video devices are probed, drop the panels other than the + * one of the display fitted on the carrier board, so that the display + * controller drives it. If that display is not described, drop the video + * devices too, leaving the display controller untouched for Linux. + * This must run after the environment is loaded, hence EVT_SETTINGS_R. + */ +static int microgea_settings_r(void) +{ + const char *display = microgea_get_display(); + struct udevice *dev, *next; + bool found = false; + int ret; + + uclass_find_first_device(UCLASS_PANEL, &dev); + while (dev) { + next = dev; + uclass_find_next_device(&next); + + if (display && microgea_panel_is_display(dev, display)) { + found = true; + } else { + ret = device_unbind(dev); + if (ret) + return ret; + } + + dev = next; + } + + if (found) + return 0; + + while (!uclass_find_first_device(UCLASS_VIDEO, &dev) && dev) { + ret = device_unbind(dev); + if (ret) + return ret; + } + + return 0; +} +EVENT_SPY_SIMPLE(EVT_SETTINGS_R, microgea_settings_r); + +#if CONFIG_IS_ENABLED(SPLASH_SOURCE) +static struct splash_location microgea_splash_locations[] = { + { + .name = "mmc", + .storage = SPLASH_STORAGE_MMC, + .flags = SPLASH_STORAGE_FS, + }, +}; + +/* + * Load the splash image, "splashfile", from the partition 10 of the + * boot MMC device, i.e. the SD card or the eMMC. If not available, fall + * back to the built-in logo. + */ +int splash_screen_prepare(void) +{ + static char devpart[8]; + u32 bootmode = get_bootmode(); + unsigned int instance = (bootmode & TAMP_BOOT_INSTANCE_MASK) - 1; + + switch (bootmode & TAMP_BOOT_DEVICE_MASK) { + case BOOT_FLASH_SD: + case BOOT_FLASH_EMMC: + snprintf(devpart, sizeof(devpart), "%u:a", instance); + microgea_splash_locations[0].devpart = devpart; + if (!splash_source_load(microgea_splash_locations, + ARRAY_SIZE(microgea_splash_locations))) + return 0; + break; + } + + return splash_video_logo_load(); +} +#endif + int board_late_init(void) { const char *fdt_compat; diff --git a/configs/stm32mp25-microgea-rmm_defconfig b/configs/stm32mp25-microgea-rmm_defconfig index 34933f1e7e41..9fee56512488 100644 --- a/configs/stm32mp25-microgea-rmm_defconfig +++ b/configs/stm32mp25-microgea-rmm_defconfig @@ -38,6 +38,7 @@ CONFIG_CMD_PWM=y # CONFIG_CMD_LOADB is not set CONFIG_CMD_MMC=y CONFIG_CMD_MTD=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y CONFIG_CMD_RNG=y @@ -98,6 +99,20 @@ CONFIG_DM_SPI=y CONFIG_STM32_OSPI=y CONFIG_STM32_SPI=y # CONFIG_OPTEE_TA_AVB is not set +CONFIG_VIDEO=y +CONFIG_VIDEO_LOGO=y +CONFIG_SYS_WHITE_ON_BLACK=y +CONFIG_VIDEO_LCD_ILITEK_ILI9806E=y +CONFIG_VIDEO_STM32=y +CONFIG_VIDEO_STM32_LVDS=y +CONFIG_VIDEO_STM32_MAX_XRES=1280 +CONFIG_VIDEO_STM32_MAX_YRES=854 +CONFIG_SPLASH_SCREEN=y +CONFIG_SPLASH_SCREEN_ALIGN=y +CONFIG_SPLASH_SOURCE=y +CONFIG_BMP_16BPP=y +CONFIG_BMP_24BPP=y +CONFIG_BMP_32BPP=y CONFIG_WDT=y CONFIG_WDT_STM32MP=y CONFIG_WDT_ARM_SMC=y