Skip to content

Commit

Permalink
Fix SoC CPU crash on minimal variants on call to flush_cpu_dcache().
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fidergo-stephane-gourichon committed Oct 5, 2020
1 parent a9234a8 commit 48638f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions litex/soc/cores/cpu/vexriscv/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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");
Expand Down

0 comments on commit 48638f9

Please sign in to comment.