From 2c4172cd3c91bbe2226143cb3345c0a057e20f7c Mon Sep 17 00:00:00 2001 From: Xianbin Zhu Date: Wed, 28 Oct 2026 20:56:05 +0800 Subject: [PATCH] platform: generic: spacemit: k1: rename cache flush operation MRAOP_ICACHE_INVALID is used to flush the local D-cache before a hart stops, so the name incorrectly describes I-cache invalidation. Rename it to MRAOP_CACHE_FLUSH without changing its encoded value. Signed-off-by: Xianbin Zhu Reviewed-by: E Shattow Co-developed-by: Troy Mitchell Signed-off-by: Troy Mitchell Tested-by: E Shattow Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20261028-spacemit-k3-v6-2-01d984f60941@linux.spacemit.com Signed-off-by: Anup Patel --- lib/utils/hsm/fdt_hsm_spacemit.c | 2 +- platform/generic/include/spacemit/k1.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/utils/hsm/fdt_hsm_spacemit.c b/lib/utils/hsm/fdt_hsm_spacemit.c index 868e49bf..99c52335 100644 --- a/lib/utils/hsm/fdt_hsm_spacemit.c +++ b/lib/utils/hsm/fdt_hsm_spacemit.c @@ -92,7 +92,7 @@ static int spacemit_hart_stop(void) asm volatile ("fence iorw, iorw"); /* flush local dcache */ - csr_write(CSR_MRAOP, MRAOP_ICACHE_INVALID); + csr_write(CSR_MRAOP, MRAOP_CACHE_FLUSH); asm volatile ("fence iorw, iorw"); /* disable dcache */ diff --git a/platform/generic/include/spacemit/k1.h b/platform/generic/include/spacemit/k1.h index 7095bc08..8d4f5344 100644 --- a/platform/generic/include/spacemit/k1.h +++ b/platform/generic/include/spacemit/k1.h @@ -20,8 +20,7 @@ /* ECC enable */ #define MSETUP_ECCE BIT(16) -/* icache invalidation */ -#define MRAOP_ICACHE_INVALID GENMASK(1, 0) +#define MRAOP_CACHE_FLUSH GENMASK(1, 0) #define PMU_AP_BASE 0xd4282800