1# Copyright (c) 2025 Henrik Lindblom <henrik.lindblom@vaisala.com>
2# SPDX-License-Identifier: Apache-2.0
3
4menuconfig CACHE_STM32
5	bool "STM32 cache driver"
6	select CACHE_HAS_DRIVER
7	depends on CACHE_MANAGEMENT
8	help
9	  Enable support for the STM32 ICACHE / DCACHE peripheral present in some STM32 chips.
10
11if CACHE_STM32
12
13# "default n" for L5 is legacy - could be removed?
14config CACHE_STM32_ICACHE_DIRECT_MAPPING
15	bool "Use 1-way associative mapping for ICACHE"
16	default n if SOC_SERIES_STM32L5X
17	default y
18	help
19	  Use ICACHE in direct mapping (1-way associative) mode instead of the default n-way
20	  associative cache mode.
21
22	  This option reduces power consumption but slightly reduces cache's performance.
23
24endif # CACHE_STM32
25