Skip to contentSkip to conversation

Support display on stm32f469-disco board

PATCH In review Dario Binacchi 2 participants 15 messages Dec 11, 2023 – Dec 15, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 cover Support display on stm32f469-disco board

The series adds support for the Orise Tech OTM8009A display on the stm32f469-disco board. Substantial differences in the drivers for clock management, LTDC and DSI compared to Linux, made it necessary to modify the device tree. These changes were made in stm32f469-disco-uboot.dtsi to avoid altering the Linux device tree. It is therefore desirable, as soon as possible, to add these drivers the functionalities so that they do not require device tree properties that deviate from those present in the Linux version.

Changes in v3:
- Add Patrice Chotard's Reviewed-by tag.
- Remove RFC tag
- Split "[4/5] ARM: dts: stm32: support display on stm32f469-disco board" patch in 2 parts:
- DTS ([4/6] ARM: dts: stm32: support MIPI DSI on stm32f469-disco board)
- config and LTDC driver update ([5/6] board: stm32f469-disco: add support to display)

Changes in v2:
- Add Patrice Chotard's Reviewed-by tag to patches 1, 2 and 3 of the series.
- Fix frame buffer allocation for stm32f469 discovery board.

Dario Binacchi (6):
ARM: dts: stm32f469-disco: sync with Linux 6.5
ARM: dts: stm32: make the LTDC clock usable by the clock driver
ARM: dts: stm32: make the DSI clock usable by the clock driver
ARM: dts: stm32: support MIPI DSI on stm32f469-disco board
board: stm32f469-disco: add support to display
board: stm32f469-disco: add splash screen with stmicroelectronics logo

 arch/arm/dts/stm32f469-disco-u-boot.dtsi |  13 ++++++++++
 arch/arm/dts/stm32f469-disco.dts         |   4 +--
 configs/stm32f469-discovery_defconfig    |  16 ++++++++++++
 drivers/video/stm32/stm32_ltdc.c         |  31 +++++++++++++++++++++++
 include/configs/stm32f469-discovery.h    |   2 ++
 tools/logos/stm32f469-discovery.bmp      | Bin 0 -> 18532 bytes
 6 files changed, 64 insertions(+), 2 deletions(-)
 create mode 100644 tools/logos/stm32f469-discovery.bmp
Signature · 1 line
2.43.0
#1 lore raw

PATCH v3 1/6 ARM: dts: stm32f469-disco: sync with Linux 6.5

Sync the devicetree with linux 6.5 for stm32f746-disco board.

---

(no changes since v2)

Changes in v2:
- Add Patrice Chotard's Reviewed-by tag.

 arch/arm/dts/stm32f469-disco.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/dts/stm32f469-disco.dts +2 -2
index 6e0ffc1903be..c9acabf0f530 100644
@@ -119,7 +119,7 @@
 		};
 	};
 
-	panel-dsi@0 {
+	panel@0 {
 		compatible = "orisetech,otm8009a";
 		reg = <0>; /* dsi virtual channel (0..3) */
 		reset-gpios = <&gpioh 7 GPIO_ACTIVE_LOW>;
@@ -138,7 +138,7 @@
 	status = "okay";
 
 	port {
-		ltdc_out_dsi: endpoint@0 {
+		ltdc_out_dsi: endpoint {
 			remote-endpoint = <&dsi_in>;
 		};
 	};
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v3 1/6] ARM: dts: stm32f469-disco: sync with Linux 6.5

Quoted 29 lines · Dario Binacchi

Sync the devicetree with linux 6.5 for stm32f746-disco board.

---

(no changes since v2)

Changes in v2:
- Add Patrice Chotard's Reviewed-by tag.

 arch/arm/dts/stm32f469-disco.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/dts/stm32f469-disco.dts +1 -1
index 6e0ffc1903be..c9acabf0f530 100644
@@ -119,7 +119,7 @@
 		};
 	};
 
-	panel-dsi@0 {
+	panel@0 {
 		compatible = "orisetech,otm8009a";
 		reg = <0>; /* dsi virtual channel (0..3) */
 		reset-gpios = <&gpioh 7 GPIO_ACTIVE_LOW>;

arch/arm/dts/stm32f469-disco.dts line 144

Quoted 8 lines
arch/arm/dts/stm32f469-disco.dts +1 -1
@@ -138,7 +138,7 @@
 	status = "okay";
 
 	port {
-		ltdc_out_dsi: endpoint@0 {
+		ltdc_out_dsi: endpoint {
 			remote-endpoint = <&dsi_in>;
 		};
 	};

Applied to u-boot-stm32/next

Thanks
Patrice

#3 lore raw

PATCH v3 2/6 ARM: dts: stm32: make the LTDC clock usable by the clock driver

In reply to Dario Binacchi

As described in [1], the "clocks" property contains "a phandle to the clock device node, an index selecting between gated clocks (0) and other clocks (1), and an index specifying the clock to use." The current version of the clock driver, unlike the kernel, is currently able to properly handle nodes with "clocks" properties with an index set to 0.

This patch is preparatory for future developments that require the use of the LTDC clock.

[1] Documentation/devicetree/bindings/clock/st,stm32-rcc.txt

---

(no changes since v2)

Changes in v2:
- Add Patrice Chotard's Reviewed-by tag.

 arch/arm/dts/stm32f469-disco-u-boot.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/stm32f469-disco-u-boot.dtsi +4 -0
index c07e2022e4a8..dcc70369cd0d 100644
@@ -134,6 +134,10 @@
 	bootph-all;
 };
 
+&ltdc {
+	clocks = <&rcc 0 STM32F4_APB2_CLOCK(LTDC)>;
+};
+
 &pinctrl {
 	bootph-all;
 
Signature · 1 line
2.43.0
#4 lore raw

Re: [PATCH v3 2/6] ARM: dts: stm32: make the LTDC clock usable by the clock driver

Quoted 28 lines · Dario Binacchi

As described in [1], the "clocks" property contains "a phandle to the clock device node, an index selecting between gated clocks (0) and other clocks (1), and an index specifying the clock to use." The current version of the clock driver, unlike the kernel, is currently able to properly handle nodes with "clocks" properties with an index set to 0.

This patch is preparatory for future developments that require the use of the LTDC clock.

[1] Documentation/devicetree/bindings/clock/st,stm32-rcc.txt

---

(no changes since v2)

Changes in v2:
- Add Patrice Chotard's Reviewed-by tag.

 arch/arm/dts/stm32f469-disco-u-boot.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/stm32f469-disco-u-boot.dtsi +0 -0
index c07e2022e4a8..dcc70369cd0d 100644

arch/arm/dts/stm32f469-disco-u-boot.dtsi line 143

Quoted 10 lines
arch/arm/dts/stm32f469-disco-u-boot.dtsi +4 -0
@@ -134,6 +134,10 @@
 	bootph-all;
 };
 
+&ltdc {
+	clocks = <&rcc 0 STM32F4_APB2_CLOCK(LTDC)>;
+};
+
 &pinctrl {
 	bootph-all;
 

Applied to u-boot-stm32/next

Thanks
Patrice

#5 lore raw

PATCH v3 3/6 ARM: dts: stm32: make the DSI clock usable by the clock driver

In reply to Dario Binacchi

As described in [1], the "clocks" property contains "a phandle to the clock device node, an index selecting between gated clocks (0) and other clocks (1), and an index specifying the clock to use." The current version of the clock driver, unlike the kernel, is currently able to properly handle nodes with "clocks" properties with an index set to 0.

This patch is preparatory for future developments that require the use of the DSI clock.

[1] Documentation/devicetree/bindings/clock/st,stm32-rcc.txt

---

(no changes since v2)

Changes in v2:
- Add Patrice Chotard's Reviewed-by tag.

 arch/arm/dts/stm32f469-disco-u-boot.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/dts/stm32f469-disco-u-boot.dtsi +5 -0
index dcc70369cd0d..8e781c5a7b23 100644
@@ -90,6 +90,11 @@
 	bootph-all;
 };
 
+&dsi {
+	clocks = <&rcc 0 STM32F4_APB2_CLOCK(DSI)>,
+		 <&clk_hse>;
+};
+
 &gpioa {
 	bootph-all;
 };
Signature · 1 line
2.43.0
#6 lore raw

Re: [PATCH v3 3/6] ARM: dts: stm32: make the DSI clock usable by the clock driver

Quoted 29 lines · Dario Binacchi

As described in [1], the "clocks" property contains "a phandle to the clock device node, an index selecting between gated clocks (0) and other clocks (1), and an index specifying the clock to use." The current version of the clock driver, unlike the kernel, is currently able to properly handle nodes with "clocks" properties with an index set to 0.

This patch is preparatory for future developments that require the use of the DSI clock.

[1] Documentation/devicetree/bindings/clock/st,stm32-rcc.txt

---

(no changes since v2)

Changes in v2:
- Add Patrice Chotard's Reviewed-by tag.

 arch/arm/dts/stm32f469-disco-u-boot.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/dts/stm32f469-disco-u-boot.dtsi +0 -0
index dcc70369cd0d..8e781c5a7b23 100644
@@ -90,6 +90,11 @@
 	bootph-all;

arch/arm/dts/stm32f469-disco-u-boot.dtsi line 100

Quoted 10 lines
arch/arm/dts/stm32f469-disco-u-boot.dtsi +5 -0
 };
 
+&dsi {
+	clocks = <&rcc 0 STM32F4_APB2_CLOCK(DSI)>,
+		 <&clk_hse>;
+};
+
 &gpioa {
 	bootph-all;
 };

Applied to u-boot-stm32/next

Thanks
Patrice

#7 lore raw

PATCH v3 4/6 ARM: dts: stm32: support MIPI DSI on stm32f469-disco board

In reply to Dario Binacchi

Unlike Linux, the DSI driver requires the LTDC clock to be properly probed. Hence, the changes made to the DSI node.

---

(no changes since v1)

 arch/arm/dts/stm32f469-disco-u-boot.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/stm32f469-disco-u-boot.dtsi +4 -0
index 8e781c5a7b23..47ba9fa4a783 100644
@@ -92,7 +92,9 @@
 
 &dsi {
 	clocks = <&rcc 0 STM32F4_APB2_CLOCK(DSI)>,
+		 <&rcc 0 STM32F4_APB2_CLOCK(LTDC)>,
 		 <&clk_hse>;
+	clock-names = "pclk", "px_clk", "ref";
 };
 
 &gpioa {
@@ -140,6 +142,8 @@
 };
 
 &ltdc {
+	bootph-all;
+
 	clocks = <&rcc 0 STM32F4_APB2_CLOCK(LTDC)>;
 };
 
Signature · 1 line
2.43.0
Reviewed-by on v3 4/6
#8 lore raw

Re: [PATCH v3 4/6] ARM: dts: stm32: support MIPI DSI on stm32f469-disco board

Quoted 26 lines · Dario Binacchi

Unlike Linux, the DSI driver requires the LTDC clock to be properly probed. Hence, the changes made to the DSI node.

---

(no changes since v1)

 arch/arm/dts/stm32f469-disco-u-boot.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/stm32f469-disco-u-boot.dtsi +2 -0
index 8e781c5a7b23..47ba9fa4a783 100644
@@ -92,7 +92,9 @@
 
 &dsi {
 	clocks = <&rcc 0 STM32F4_APB2_CLOCK(DSI)>,
+		 <&rcc 0 STM32F4_APB2_CLOCK(LTDC)>,
 		 <&clk_hse>;
+	clock-names = "pclk", "px_clk", "ref";
 };
 
 &gpioa {

arch/arm/dts/stm32f469-disco-u-boot.dtsi line 149

Quoted 8 lines
arch/arm/dts/stm32f469-disco-u-boot.dtsi +2 -0
@@ -140,6 +142,8 @@
 };
 
 &ltdc {
+	bootph-all;
+
 	clocks = <&rcc 0 STM32F4_APB2_CLOCK(LTDC)>;
 };
 

Thanks
Patrice

#9 lore raw

Re: [PATCH v3 4/6] ARM: dts: stm32: support MIPI DSI on stm32f469-disco board

In reply to Dario Binacchi
Quoted 26 lines · Dario Binacchi

Unlike Linux, the DSI driver requires the LTDC clock to be properly probed. Hence, the changes made to the DSI node.

---

(no changes since v1)

 arch/arm/dts/stm32f469-disco-u-boot.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/stm32f469-disco-u-boot.dtsi +2 -0
index 8e781c5a7b23..47ba9fa4a783 100644
@@ -92,7 +92,9 @@
 
 &dsi {
 	clocks = <&rcc 0 STM32F4_APB2_CLOCK(DSI)>,
+		 <&rcc 0 STM32F4_APB2_CLOCK(LTDC)>,
 		 <&clk_hse>;
+	clock-names = "pclk", "px_clk", "ref";
 };
 
 &gpioa {

arch/arm/dts/stm32f469-disco-u-boot.dtsi line 149

Quoted 8 lines
arch/arm/dts/stm32f469-disco-u-boot.dtsi +2 -0
@@ -140,6 +142,8 @@
 };
 
 &ltdc {
+	bootph-all;
+
 	clocks = <&rcc 0 STM32F4_APB2_CLOCK(LTDC)>;
 };
 

Applied to u-boot-stm32/next

Thanks
Patrice

#10 lore raw

PATCH v3 5/6 board: stm32f469-disco: add support to display

In reply to Dario Binacchi

Add support to Orise Tech OTM8009A display on stm32f469-disco board.

It was necessary to retrieve the framebuffer address from the device tree because the address returned by the video-uclass driver pointed to a memory area that was not usable.

---

Changes in v3:
- Replace SDRAM_SIZE constant with global data gd->ram_size.

Changes in v2:
- Add DRAM_SIZE macro.
- Fix frame buffer allocation function so that it is backward compatible with boards other than the one it was introduced for (i. e. stm32f469-disco). Tested on stm32f469-disco and stm32mp157f-dk2 boards.

 configs/stm32f469-discovery_defconfig | 13 +++++++++++
 drivers/video/stm32/stm32_ltdc.c      | 31 +++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
configs/stm32f469-discovery_defconfig +13 -0
index 21c5498466cd..85e795e83e7d 100644
@@ -21,6 +21,7 @@ CONFIG_CMD_GPT=y
 # CONFIG_RANDOM_UUID is not set
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIMER=y
 # CONFIG_ISO_PARTITION is not set
@@ -40,3 +41,15 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_STM32_QSPI=y
+CONFIG_VIDEO=y
+CONFIG_BACKLIGHT_GPIO=y
+CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y
+CONFIG_VIDEO_STM32=y
+CONFIG_VIDEO_STM32_DSI=y
+CONFIG_VIDEO_STM32_MAX_XRES=480
+CONFIG_VIDEO_STM32_MAX_YRES=800
+CONFIG_BMP_16BPP=y
+CONFIG_BMP_24BPP=y
+CONFIG_BMP_32BPP=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
drivers/video/stm32/stm32_ltdc.c +31 -0
index 6fd90e33919d..4f60ba8ebeeb 100644
@@ -495,6 +495,33 @@ static void stm32_ltdc_set_layer1(struct stm32_ltdc_priv *priv, ulong fb_addr)
 	setbits_le32(priv->regs + LTDC_L1CR, LXCR_LEN);
 }
 
+#if IS_ENABLED(CONFIG_TARGET_STM32F469_DISCOVERY)
+static int stm32_ltdc_alloc_fb(struct udevice *dev)
+{
+	u32 sdram_size = gd->ram_size;
+	struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
+	phys_addr_t cpu;
+	dma_addr_t bus;
+	u64 dma_size;
+	int ret;
+
+	ret = dev_get_dma_range(dev, &cpu, &bus, &dma_size);
+	if (ret) {
+		dev_err(dev, "failed to get dma address\n");
+		return ret;
+	}
+
+	uc_plat->base = bus + sdram_size - ALIGN(uc_plat->size, uc_plat->align);
+	return 0;
+}
+#else
+static inline int stm32_ltdc_alloc_fb(struct udevice *dev)
+{
+	/* Delegate framebuffer allocation to video-uclass */
+	return 0;
+}
+#endif
+
 static int stm32_ltdc_probe(struct udevice *dev)
 {
 	struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
@@ -605,6 +632,10 @@ static int stm32_ltdc_probe(struct udevice *dev)
 	priv->crop_h = timings.vactive.typ;
 	priv->alpha = 0xFF;
 
+	ret = stm32_ltdc_alloc_fb(dev);
+	if (ret)
+		return ret;
+
 	dev_dbg(dev, "%dx%d %dbpp frame buffer at 0x%lx\n",
 		timings.hactive.typ, timings.vactive.typ,
 		VNBITS(priv->l2bpp), uc_plat->base);
Signature · 1 line
2.43.0
Reviewed-by on v3 5/6
#11 lore raw

Re: [PATCH v3 5/6] board: stm32f469-disco: add support to display

Quoted 89 lines · Dario Binacchi

Add support to Orise Tech OTM8009A display on stm32f469-disco board.

It was necessary to retrieve the framebuffer address from the device tree because the address returned by the video-uclass driver pointed to a memory area that was not usable.

---

Changes in v3:
- Replace SDRAM_SIZE constant with global data gd->ram_size.

Changes in v2:
- Add DRAM_SIZE macro.
- Fix frame buffer allocation function so that it is backward compatible with boards other than the one it was introduced for (i. e. stm32f469-disco). Tested on stm32f469-disco and stm32mp157f-dk2 boards.

 configs/stm32f469-discovery_defconfig | 13 +++++++++++
 drivers/video/stm32/stm32_ltdc.c      | 31 +++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
configs/stm32f469-discovery_defconfig +13 -0
index 21c5498466cd..85e795e83e7d 100644
@@ -21,6 +21,7 @@ CONFIG_CMD_GPT=y
 # CONFIG_RANDOM_UUID is not set
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIMER=y
 # CONFIG_ISO_PARTITION is not set
@@ -40,3 +41,15 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_STM32_QSPI=y
+CONFIG_VIDEO=y
+CONFIG_BACKLIGHT_GPIO=y
+CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y
+CONFIG_VIDEO_STM32=y
+CONFIG_VIDEO_STM32_DSI=y
+CONFIG_VIDEO_STM32_MAX_XRES=480
+CONFIG_VIDEO_STM32_MAX_YRES=800
+CONFIG_BMP_16BPP=y
+CONFIG_BMP_24BPP=y
+CONFIG_BMP_32BPP=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
drivers/video/stm32/stm32_ltdc.c +27 -0
index 6fd90e33919d..4f60ba8ebeeb 100644
@@ -495,6 +495,33 @@ static void stm32_ltdc_set_layer1(struct stm32_ltdc_priv *priv, ulong fb_addr)
 	setbits_le32(priv->regs + LTDC_L1CR, LXCR_LEN);
 }
 
+#if IS_ENABLED(CONFIG_TARGET_STM32F469_DISCOVERY)
+static int stm32_ltdc_alloc_fb(struct udevice *dev)
+{
+	u32 sdram_size = gd->ram_size;
+	struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
+	phys_addr_t cpu;
+	dma_addr_t bus;
+	u64 dma_size;
+	int ret;
+
+	ret = dev_get_dma_range(dev, &cpu, &bus, &dma_size);
+	if (ret) {
+		dev_err(dev, "failed to get dma address\n");
+		return ret;
+	}
+
+	uc_plat->base = bus + sdram_size - ALIGN(uc_plat->size, uc_plat->align);
+	return 0;
+}
+#else
+static inline int stm32_ltdc_alloc_fb(struct udevice *dev)
+{
+	/* Delegate framebuffer allocation to video-uclass */
+	return 0;
+}
+#endif
+
 static int stm32_ltdc_probe(struct udevice *dev)
 {
 	struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);

drivers/video/stm32/stm32_ltdc.c static int stm32_ltdc_probe(struct udevice *dev) · line 641

Quoted 10 lines
drivers/video/stm32/stm32_ltdc.c +4 -0
@@ -605,6 +632,10 @@ static int stm32_ltdc_probe(struct udevice *dev)
 	priv->crop_h = timings.vactive.typ;
 	priv->alpha = 0xFF;
 
+	ret = stm32_ltdc_alloc_fb(dev);
+	if (ret)
+		return ret;
+
 	dev_dbg(dev, "%dx%d %dbpp frame buffer at 0x%lx\n",
 		timings.hactive.typ, timings.vactive.typ,
 		VNBITS(priv->l2bpp), uc_plat->base);

Thanks
Patrice

#12 lore raw

Re: [PATCH v3 5/6] board: stm32f469-disco: add support to display

In reply to Dario Binacchi
Quoted 89 lines · Dario Binacchi

Add support to Orise Tech OTM8009A display on stm32f469-disco board.

It was necessary to retrieve the framebuffer address from the device tree because the address returned by the video-uclass driver pointed to a memory area that was not usable.

---

Changes in v3:
- Replace SDRAM_SIZE constant with global data gd->ram_size.

Changes in v2:
- Add DRAM_SIZE macro.
- Fix frame buffer allocation function so that it is backward compatible with boards other than the one it was introduced for (i. e. stm32f469-disco). Tested on stm32f469-disco and stm32mp157f-dk2 boards.

 configs/stm32f469-discovery_defconfig | 13 +++++++++++
 drivers/video/stm32/stm32_ltdc.c      | 31 +++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
configs/stm32f469-discovery_defconfig +13 -0
index 21c5498466cd..85e795e83e7d 100644
@@ -21,6 +21,7 @@ CONFIG_CMD_GPT=y
 # CONFIG_RANDOM_UUID is not set
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIMER=y
 # CONFIG_ISO_PARTITION is not set
@@ -40,3 +41,15 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_STM32_QSPI=y
+CONFIG_VIDEO=y
+CONFIG_BACKLIGHT_GPIO=y
+CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y
+CONFIG_VIDEO_STM32=y
+CONFIG_VIDEO_STM32_DSI=y
+CONFIG_VIDEO_STM32_MAX_XRES=480
+CONFIG_VIDEO_STM32_MAX_YRES=800
+CONFIG_BMP_16BPP=y
+CONFIG_BMP_24BPP=y
+CONFIG_BMP_32BPP=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
drivers/video/stm32/stm32_ltdc.c +27 -0
index 6fd90e33919d..4f60ba8ebeeb 100644
@@ -495,6 +495,33 @@ static void stm32_ltdc_set_layer1(struct stm32_ltdc_priv *priv, ulong fb_addr)
 	setbits_le32(priv->regs + LTDC_L1CR, LXCR_LEN);
 }
 
+#if IS_ENABLED(CONFIG_TARGET_STM32F469_DISCOVERY)
+static int stm32_ltdc_alloc_fb(struct udevice *dev)
+{
+	u32 sdram_size = gd->ram_size;
+	struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
+	phys_addr_t cpu;
+	dma_addr_t bus;
+	u64 dma_size;
+	int ret;
+
+	ret = dev_get_dma_range(dev, &cpu, &bus, &dma_size);
+	if (ret) {
+		dev_err(dev, "failed to get dma address\n");
+		return ret;
+	}
+
+	uc_plat->base = bus + sdram_size - ALIGN(uc_plat->size, uc_plat->align);
+	return 0;
+}
+#else
+static inline int stm32_ltdc_alloc_fb(struct udevice *dev)
+{
+	/* Delegate framebuffer allocation to video-uclass */
+	return 0;
+}
+#endif
+
 static int stm32_ltdc_probe(struct udevice *dev)
 {
 	struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);

drivers/video/stm32/stm32_ltdc.c static int stm32_ltdc_probe(struct udevice *dev) · line 641

Quoted 10 lines
drivers/video/stm32/stm32_ltdc.c +4 -0
@@ -605,6 +632,10 @@ static int stm32_ltdc_probe(struct udevice *dev)
 	priv->crop_h = timings.vactive.typ;
 	priv->alpha = 0xFF;
 
+	ret = stm32_ltdc_alloc_fb(dev);
+	if (ret)
+		return ret;
+
 	dev_dbg(dev, "%dx%d %dbpp frame buffer at 0x%lx\n",
 		timings.hactive.typ, timings.vactive.typ,
 		VNBITS(priv->l2bpp), uc_plat->base);

Applied to u-boot-stm32/next

Thanks
Patrice

#13 lore raw

PATCH v3 6/6 board: stm32f469-disco: add splash screen with stmicroelectronics logo

In reply to Dario Binacchi

Display the STMicroelectronics logo with features VIDEO_LOGO and SPLASH_SCREEN on stm32f469-disco board.

---

Changes in v3:
- Add Patrice Chotard's Reviewed-by tag.
- Remove RFC tag
- Split "[4/5] ARM: dts: stm32: support display on stm32f469-disco board" patch in 2 parts:
- DTS ([4/6] ARM: dts: stm32: support MIPI DSI on stm32f469-disco board)
- config and LTDC driver update ([5/6] board: stm32f469-disco: add support to display)

Changes in v2:
- Add Patrice Chotard's Reviewed-by tag to patches 1, 2 and 3 of the series.
- Fix frame buffer allocation for stm32f469 discovery board.

 configs/stm32f469-discovery_defconfig |   3 +++
 include/configs/stm32f469-discovery.h |   2 ++
 tools/logos/stm32f469-discovery.bmp   | Bin 0 -> 18532 bytes
 3 files changed, 5 insertions(+)
 create mode 100644 tools/logos/stm32f469-discovery.bmp
configs/stm32f469-discovery_defconfig +3 -0
index 85e795e83e7d..b7e35aeae200 100644
@@ -42,12 +42,15 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_STM32_QSPI=y
 CONFIG_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_BACKLIGHT_GPIO=y
 CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y
 CONFIG_VIDEO_STM32=y
 CONFIG_VIDEO_STM32_DSI=y
 CONFIG_VIDEO_STM32_MAX_XRES=480
 CONFIG_VIDEO_STM32_MAX_YRES=800
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_BMP_16BPP=y
 CONFIG_BMP_24BPP=y
 CONFIG_BMP_32BPP=y
include/configs/stm32f469-discovery.h +2 -0
index 62a7e9af0c56..75bb9cd8d06f 100644
@@ -31,6 +31,8 @@
 			"scriptaddr=0x00418000\0"		\
 			"pxefile_addr_r=0x00428000\0" \
 			"ramdisk_addr_r=0x00438000\0"		\
+			"splashimage=0x00448000\0" \
+			"splashpos=m,m\0" \
 			BOOTENV
 
 #endif /* __CONFIG_H */
tools/logos/stm32f469-discovery.bmp new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..ecc8d984218fb13fddf0ba9cf68f2cfad829e289
GIT binary patch
Signature · 1 line
2.43.0
#14 lore raw

Re: [PATCH v3 6/6] board: stm32f469-disco: add splash screen with stmicroelectronics logo

tools/logos/stm32f469-discovery.bmp

Quoted 273 lines · Dario Binacchi

Display the STMicroelectronics logo with features VIDEO_LOGO and SPLASH_SCREEN on stm32f469-disco board.

---

Changes in v3:
- Add Patrice Chotard's Reviewed-by tag.
- Remove RFC tag
- Split "[4/5] ARM: dts: stm32: support display on stm32f469-disco board" patch in 2 parts:
- DTS ([4/6] ARM: dts: stm32: support MIPI DSI on stm32f469-disco board)
- config and LTDC driver update ([5/6] board: stm32f469-disco: add support to display)

Changes in v2:
- Add Patrice Chotard's Reviewed-by tag to patches 1, 2 and 3 of the series.
- Fix frame buffer allocation for stm32f469 discovery board.

 configs/stm32f469-discovery_defconfig |   3 +++
 include/configs/stm32f469-discovery.h |   2 ++
 tools/logos/stm32f469-discovery.bmp   | Bin 0 -> 18532 bytes
 3 files changed, 5 insertions(+)
 create mode 100644 tools/logos/stm32f469-discovery.bmp
configs/stm32f469-discovery_defconfig +3 -0
index 85e795e83e7d..b7e35aeae200 100644
@@ -42,12 +42,15 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_STM32_QSPI=y
 CONFIG_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_BACKLIGHT_GPIO=y
 CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y
 CONFIG_VIDEO_STM32=y
 CONFIG_VIDEO_STM32_DSI=y
 CONFIG_VIDEO_STM32_MAX_XRES=480
 CONFIG_VIDEO_STM32_MAX_YRES=800
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_BMP_16BPP=y
 CONFIG_BMP_24BPP=y
 CONFIG_BMP_32BPP=y
include/configs/stm32f469-discovery.h +2 -0
index 62a7e9af0c56..75bb9cd8d06f 100644
@@ -31,6 +31,8 @@
 			"scriptaddr=0x00418000\0"		\
 			"pxefile_addr_r=0x00428000\0" \
 			"ramdisk_addr_r=0x00438000\0"		\
+			"splashimage=0x00448000\0" \
+			"splashpos=m,m\0" \
 			BOOTENV
 
 #endif /* __CONFIG_H */
tools/logos/stm32f469-discovery.bmp new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..ecc8d984218fb13fddf0ba9cf68f2cfad829e289
GIT binary patch

Applied to u-boot-stm32/next

Thanks
Patrice