[PATCH 02/10] m68k: add DMA global pool setup
From: Angelo Dureghello
Date: Tue Dec 01 2026 - 17:40:29 EST
Add DMA global pool setup.
Signed-off-by: Angelo Dureghello <angelo@xxxxxxxxxxxxxxxx>
---
arch/m68k/coldfire/Makefile | 2 ++
arch/m68k/coldfire/dma.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+)
diff --git a/arch/m68k/coldfire/Makefile b/arch/m68k/coldfire/Makefile
index c56bc0dc7f2e..00f646f1c42f 100644
--- a/arch/m68k/coldfire/Makefile
+++ b/arch/m68k/coldfire/Makefile
@@ -35,6 +35,8 @@ obj-$(CONFIG_COLDFIRE_PIT_TIMER) += pit.o
obj-$(CONFIG_COLDFIRE_TIMERS) += timers.o
obj-$(CONFIG_COLDFIRE_SLTIMERS) += sltimers.o
+obj-$(CONFIG_DMA_GLOBAL_POOL) += dma.o
+
obj-$(CONFIG_NETtel) += nettel.o
obj-$(CONFIG_CLEOPATRA) += nettel.o
obj-$(CONFIG_FIREBEE) += firebee.o
diff --git a/arch/m68k/coldfire/dma.c b/arch/m68k/coldfire/dma.c
new file mode 100644
index 000000000000..7c23884d048a
--- /dev/null
+++ b/arch/m68k/coldfire/dma.c
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * dma.c -- common ColdFire SoC dma support
+ *
+ * (C) Copyright 2026, Angelo Dureghello <angelo@xxxxxxxxxxxxxxxx>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file COPYING in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/dma-map-ops.h>
+#include <linux/init.h>
+#include <linux/sizes.h>
+
+#define DMA_POOL_SIZE CONFIG_DMA_GLOBAL_POOL_SIZE
+#define DMA_POOL_PHYS_ADDR (CONFIG_RAMBASE + \
+ CONFIG_RAMSIZE - DMA_POOL_SIZE)
+
+static int __init coldfire_dma_init(void)
+{
+ if (WARN_ON(!IS_ALIGNED(DMA_POOL_PHYS_ADDR, SZ_16M) ||
+ !IS_ALIGNED(DMA_POOL_SIZE, SZ_16M)))
+ return -EINVAL;
+
+ return dma_init_global_coherent(DMA_POOL_PHYS_ADDR, DMA_POOL_SIZE);
+}
+
+core_initcall(coldfire_dma_init);
+
--
2.56.1