Skip to content

Commit 83b33d1

Browse files
hfruchet-stkartben
authored andcommitted
drivers: display: stm32_ltdc: configure RIF for LTDC layer 1
Configure RIF for LTDC layer 1. Signed-off-by: Hugues Fruchet <[email protected]>
1 parent 873bba0 commit 83b33d1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

drivers/display/Kconfig.stm32_ltdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ menuconfig STM32_LTDC
88
default y
99
depends on DT_HAS_ST_STM32_LTDC_ENABLED
1010
select USE_STM32_HAL_LTDC
11+
select USE_STM32_HAL_RIF if SOC_SERIES_STM32N6X
1112
select CACHE_MANAGEMENT if CPU_HAS_DCACHE
1213
select PINCTRL
1314
help

drivers/display/display_stm32_ltdc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ static int stm32_ltdc_init(const struct device *dev)
311311
int err;
312312
const struct display_stm32_ltdc_config *config = dev->config;
313313
struct display_stm32_ltdc_data *data = dev->data;
314+
#if defined(CONFIG_SOC_SERIES_STM32N6X)
315+
RIMC_MasterConfig_t rimc = {0};
316+
#endif
314317

315318
/* Configure and set display on/off GPIO */
316319
if (config->disp_on_gpio.port) {
@@ -436,6 +439,15 @@ static int stm32_ltdc_init(const struct device *dev)
436439
return err;
437440
}
438441

442+
#if defined(CONFIG_SOC_SERIES_STM32N6X)
443+
/* Configure RIF for LTDC layer 1 */
444+
rimc.MasterCID = RIF_CID_1;
445+
rimc.SecPriv = RIF_ATTRIBUTE_SEC | RIF_ATTRIBUTE_PRIV;
446+
HAL_RIF_RIMC_ConfigMasterAttributes(RIF_MASTER_INDEX_LTDC1 , &rimc);
447+
HAL_RIF_RISC_SetSlaveSecureAttributes(RIF_RISC_PERIPH_INDEX_LTDCL1,
448+
RIF_ATTRIBUTE_SEC | RIF_ATTRIBUTE_PRIV);
449+
#endif
450+
439451
/* Disable layer 2, since it not used */
440452
__HAL_LTDC_LAYER_DISABLE(&data->hltdc, LTDC_LAYER_2);
441453

0 commit comments

Comments
 (0)