From 48638f936bc2e2a15fa32d1bf3588988d98e3c9d Mon Sep 17 00:00:00 2001 From: Stephane Gourichon Date: Mon, 5 Oct 2020 17:16:35 +0200 Subject: [PATCH] Fix SoC CPU crash on minimal variants on call to flush_cpu_dcache(). Generated soc.h says for example but code tester for CONFIG_CPU_VARIANT_MIN not MINIMAL. Attempted to run instruction unknown to this CPU, most likely cause of hang. --- litex/soc/cores/cpu/vexriscv/system.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litex/soc/cores/cpu/vexriscv/system.h b/litex/soc/cores/cpu/vexriscv/system.h index c1239889b..1fcfb4fba 100644 --- a/litex/soc/cores/cpu/vexriscv/system.h +++ b/litex/soc/cores/cpu/vexriscv/system.h @@ -11,7 +11,7 @@ extern "C" { __attribute__((unused)) static void flush_cpu_icache(void) { -#if defined(CONFIG_CPU_VARIANT_MIN) +#if defined(CONFIG_CPU_VARIANT_MINIMAL) /* No instruction cache */ #else asm volatile( @@ -27,7 +27,7 @@ __attribute__((unused)) static void flush_cpu_icache(void) __attribute__((unused)) static void flush_cpu_dcache(void) { -#if defined(CONFIG_CPU_VARIANT_MIN) || defined(CONFIG_CPU_VARIANT_LITE) +#if defined(CONFIG_CPU_VARIANT_MINIMAL) || defined(CONFIG_CPU_VARIANT_LITE) /* No data cache */ #else asm volatile(".word(0x500F)\n");