From de594e44c983abcb32ea56c35608dc77e293e82f Mon Sep 17 00:00:00 2001 From: Andrew Dennison Date: Thu, 1 Feb 2024 10:18:52 +1100 Subject: [PATCH] software/bios/cmds: fix crc command with L2 cache Same CRC was always reported if the memory region was in the cache... Noticed when manually testing spiflash divisor. --- litex/soc/software/bios/cmds/cmd_bios.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litex/soc/software/bios/cmds/cmd_bios.c b/litex/soc/software/bios/cmds/cmd_bios.c index 2006dd540..5acf67140 100644 --- a/litex/soc/software/bios/cmds/cmd_bios.c +++ b/litex/soc/software/bios/cmds/cmd_bios.c @@ -115,6 +115,8 @@ static void crc_handler(int nb_params, char **params) return; } + flush_cpu_dcache(); + flush_l2_cache(); printf("CRC32: %08x", crc32((unsigned char *)addr, length)); }