[PATCH 03/10] m68k: mcf54415: add defines for DMA global pool

From: Angelo Dureghello

Date: Tue Dec 01 2026 - 17:40:58 EST


Add ACR4 register configuration to enable a non cacheable area in SDRAM,
to enable DMA global pool on that area.

Signed-off-by: Angelo Dureghello <angelo@xxxxxxxxxxxxxxxx>
---
arch/m68k/include/asm/m54xxacr.h | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/arch/m68k/include/asm/m54xxacr.h b/arch/m68k/include/asm/m54xxacr.h
index 466df7b03c6b..e5e6981d9e2b 100644
--- a/arch/m68k/include/asm/m54xxacr.h
+++ b/arch/m68k/include/asm/m54xxacr.h
@@ -90,6 +90,13 @@
#define CACHE_INIT (CACR_DCINVA+CACR_BCINVA+CACR_ICINVA)

#if defined(CONFIG_MMU)
+
+#if defined(CONFIG_CACHE_COPYBACK)
+#define ACR_CACHE_MODE ACR_CM_CP
+#else
+#define ACR_CACHE_MODE ACR_CM_WT
+#endif
+
/*
* If running with the MMU enabled then we need to map the internal
* register region as non-cacheable. And then we map all our RAM as
@@ -97,13 +104,19 @@
*/
#define ACR0_MODE (ACR_BA(IOMEMBASE)+ACR_ADMSK(IOMEMSIZE)+ \
ACR_ENABLE+ACR_SUPER+ACR_CM_OFF_PRE+ACR_SP)
-#if defined(CONFIG_CACHE_COPYBACK)
-#define ACR1_MODE (ACR_BA(CONFIG_RAMBASE)+ACR_ADMSK(CONFIG_RAMSIZE)+ \
- ACR_ENABLE+ACR_SUPER+ACR_SP+ACR_CM_CP)
+#if defined(CONFIG_DMA_GLOBAL_POOL)
+#define RAM_CACHEABLE (CONFIG_RAMSIZE-CONFIG_DMA_GLOBAL_POOL_SIZE)
+#define ACR1_MODE (ACR_BA(CONFIG_RAMBASE+RAM_CACHEABLE)+ \
+ ACR_ADMSK(CONFIG_DMA_GLOBAL_POOL_SIZE)+ \
+ ACR_ENABLE+ACR_SUPER+ACR_CM_OFF_PRE+ACR_SP)
+ /* ACR4 (lower priority): full RAM cacheable */
+#define ACR4_MODE (ACR_BA(CONFIG_RAMBASE)+ACR_ADMSK(CONFIG_RAMSIZE)+ \
+ ACR_ENABLE+ACR_SUPER+ACR_SP+ACR_CACHE_MODE)
#else
#define ACR1_MODE (ACR_BA(CONFIG_RAMBASE)+ACR_ADMSK(CONFIG_RAMSIZE)+ \
- ACR_ENABLE+ACR_SUPER+ACR_SP+ACR_CM_WT)
+ ACR_ENABLE+ACR_SUPER+ACR_SP+ACR_CACHE_MODE)
#endif
+
#define ACR2_MODE 0
#define ACR3_MODE (ACR_BA(CONFIG_RAMBASE)+ACR_ADMSK(CONFIG_RAMSIZE)+ \
ACR_ENABLE+ACR_SUPER+ACR_SP)

--
2.56.1