From e793207bb6c81b084e0562112725855b349c311b Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Mon, 10 Oct 2022 14:33:32 +0400 Subject: [PATCH] arch/risc-v/src/mpfs: Add a config option for enabling L2 cache Make a separate config flag for enabling L2 cache. This is on by default when compiling a standalone/bootloader configuration, but can also be disabled for special cases, such as memory testing Signed-off-by: Jukka Laitinen --- arch/risc-v/src/mpfs/Kconfig | 7 +++++++ arch/risc-v/src/mpfs/mpfs_start.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/risc-v/src/mpfs/Kconfig b/arch/risc-v/src/mpfs/Kconfig index 52cd2cd7d5..4e2f1dee91 100644 --- a/arch/risc-v/src/mpfs/Kconfig +++ b/arch/risc-v/src/mpfs/Kconfig @@ -157,6 +157,13 @@ config MPFS_DDR_TYPE default 3 if MPFS_DDR_TYPE_LPDDR3 default 4 if MPFS_DDR_TYPE_LPDDR4 +config MPFS_ENABLE_CACHE + bool "Enable L2 cache" + depends on MPFS_BOOTLOADER + default y + ---help--- + Enables L2 cache in L2LIM memory + config MPFS_EMMCSD_MUX_GPIO bool "GPIO driven EMMCSD mux" default n diff --git a/arch/risc-v/src/mpfs/mpfs_start.c b/arch/risc-v/src/mpfs/mpfs_start.c index 6873ca3f02..52fd3162fd 100644 --- a/arch/risc-v/src/mpfs/mpfs_start.c +++ b/arch/risc-v/src/mpfs/mpfs_start.c @@ -163,7 +163,7 @@ void __mpfs_start(uint64_t mhartid) * the CONFIG_MPFS_BOOTLOADER -option. */ -#ifdef CONFIG_MPFS_BOOTLOADER +#ifdef CONFIG_MPFS_ENABLE_CACHE if (mhartid == 0) { mpfs_enable_cache();