do not enable dcache by setting CONFIG_SYS_NPCM_DCACHE_OFF=y

Signed-off-by: Jim Liu <jjl...@nuvoton.com>
---
 arch/arm/mach-npcm/npcm8xx/Kconfig |  4 ++++
 arch/arm/mach-npcm/npcm8xx/cpu.c   | 12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-npcm/npcm8xx/Kconfig 
b/arch/arm/mach-npcm/npcm8xx/Kconfig
index 5f4a0506dc..163e7e7d48 100644
--- a/arch/arm/mach-npcm/npcm8xx/Kconfig
+++ b/arch/arm/mach-npcm/npcm8xx/Kconfig
@@ -6,6 +6,10 @@ config SYS_CPU
 config SYS_SOC
        default "npcm8xx"
 
+config SYS_NPCM_DCACHE_OFF
+       bool "Do not enable dcache"
+       default n
+
 config TARGET_ARBEL_EVB
        bool "Arbel Evaluation Board"
        help
diff --git a/arch/arm/mach-npcm/npcm8xx/cpu.c b/arch/arm/mach-npcm/npcm8xx/cpu.c
index af59452609..fc691de950 100644
--- a/arch/arm/mach-npcm/npcm8xx/cpu.c
+++ b/arch/arm/mach-npcm/npcm8xx/cpu.c
@@ -81,7 +81,8 @@ int print_cpuinfo(void)
 
 int arch_cpu_init(void)
 {
-       if (!IS_ENABLED(CONFIG_SYS_DCACHE_OFF)) {
+       if (!IS_ENABLED(CONFIG_SYS_DCACHE_OFF) &&
+           !IS_ENABLED(CONFIG_SYS_NPCM_DCACHE_OFF)) {
                /* Enable cache to speed up system running */
                if (get_sctlr() & CR_M)
                        return 0;
@@ -143,3 +144,12 @@ int timer_init(void)
 
        return 0;
 }
+
+void enable_caches(void)
+{
+       icache_enable();
+
+       if (!IS_ENABLED(CONFIG_SYS_NPCM_DCACHE_OFF))
+               dcache_enable();
+
+}
-- 
2.25.1

Reply via email to