From 7640180e7c5cb02741c7b0a0b48839b46c3bacaf Mon Sep 17 00:00:00 2001 From: Alain Volmat Date: Tue, 17 Jun 2025 11:17:24 +0200 Subject: [PATCH] soc: st: stm32: set default SMH attribute for LTDC/video buffers The SMH attribute when using the XSPI PSRAM is set to EXTERNAL (2) within the driver hence set default for both LTDC and video buffer SMH attribute to 2 if all conditions are validated. Signed-off-by: Alain Volmat --- soc/st/stm32/Kconfig.defconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/soc/st/stm32/Kconfig.defconfig b/soc/st/stm32/Kconfig.defconfig index 18f343b9324..5068f14c754 100644 --- a/soc/st/stm32/Kconfig.defconfig +++ b/soc/st/stm32/Kconfig.defconfig @@ -85,4 +85,17 @@ config FLASH_BASE_ADDRESS if $(DT_FLASH_PARENT_IS_XSPI) default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) +# The XSPI PSRAM driver creates a SMH region with attribute SMH_REG_ATTR_EXTERNAL (2) +# If applicable set the LTDC / VIDEO_BUFFER SMH attribute to SMH_REG_ATTR_EXTERNAL (2) +# in order to be able to allocate from the XSPI PSRAM +if MEMC_STM32_XSPI_PSRAM && SHARED_MULTI_HEAP + +config STM32_LTDC_FB_SMH_ATTRIBUTE + default 2 if STM32_LTDC_FB_USE_SHARED_MULTI_HEAP + +config VIDEO_BUFFER_SMH_ATTRIBUTE + default 2 if VIDEO_BUFFER_USE_SHARED_MULTI_HEAP + +endif # MEMC_STM32_XSPI_PSRAM && SHARED_MULTI_HEAP + endif # SOC_FAMILY_STM32