]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dmaengine: loongson: New directory for Loongson DMA controllers drivers
authorBinbin Zhou <zhoubinbin@loongson.cn>
Sat, 7 Mar 2026 03:25:10 +0000 (11:25 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 17 Mar 2026 11:18:55 +0000 (16:48 +0530)
Gather the Loongson DMA controllers under drivers/dma/loongson/

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Reviewed-by: Keguang Zhang <keguang.zhang@gmail.com>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Link: https://patch.msgid.link/0a0853a85630724741061f6fe08680610e49a06e.1772853681.git.zhoubinbin@loongson.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
MAINTAINERS
drivers/dma/Kconfig
drivers/dma/Makefile
drivers/dma/loongson/Kconfig [new file with mode: 0644]
drivers/dma/loongson/Makefile [new file with mode: 0644]
drivers/dma/loongson/loongson1-apb-dma.c [moved from drivers/dma/loongson1-apb-dma.c with 99% similarity]
drivers/dma/loongson/loongson2-apb-dma.c [moved from drivers/dma/loongson2-apb-dma.c with 99% similarity]

index b38452804a2d225c6724788e9b8eee69fd2a8325..f0cad0b6ad8f6e7981aa34f976188c352141de9c 100644 (file)
@@ -14953,7 +14953,7 @@ M:      Binbin Zhou <zhoubinbin@loongson.cn>
 L:     dmaengine@vger.kernel.org
 S:     Maintained
 F:     Documentation/devicetree/bindings/dma/loongson,ls2x-apbdma.yaml
-F:     drivers/dma/loongson2-apb-dma.c
+F:     drivers/dma/loongson/loongson2-apb-dma.c
 
 LOONGSON LS2X I2C DRIVER
 M:     Binbin Zhou <zhoubinbin@loongson.cn>
@@ -17721,6 +17721,7 @@ F:      arch/mips/boot/dts/loongson/loongson1*
 F:     arch/mips/configs/loongson1_defconfig
 F:     arch/mips/loongson32/
 F:     drivers/*/*loongson1*
+F:     drivers/dma/loongson/loongson1-apb-dma.c
 F:     drivers/mtd/nand/raw/loongson-nand-controller.c
 F:     drivers/net/ethernet/stmicro/stmmac/dwmac-loongson1.c
 F:     sound/soc/loongson/loongson1_ac97.c
index e98e3e8c5036a0578edb0dcf870953b62ea00b5a..ae6a682c9f769fe3de5501d440815616c54c3f9b 100644 (file)
@@ -376,29 +376,6 @@ config K3_DMA
          Support the DMA engine for Hisilicon K3 platform
          devices.
 
-config LOONGSON1_APB_DMA
-       tristate "Loongson1 APB DMA support"
-       depends on MACH_LOONGSON32 || COMPILE_TEST
-       select DMA_ENGINE
-       select DMA_VIRTUAL_CHANNELS
-       help
-         This selects support for the APB DMA controller in Loongson1 SoCs,
-         which is required by Loongson1 NAND and audio support.
-
-config LOONGSON2_APB_DMA
-       tristate "Loongson2 APB DMA support"
-       depends on LOONGARCH || COMPILE_TEST
-       select DMA_ENGINE
-       select DMA_VIRTUAL_CHANNELS
-       help
-         Support for the Loongson2 APB DMA controller driver. The
-         DMA controller is having single DMA channel which can be
-         configured for different peripherals like audio, nand, sdio
-         etc which is in APB bus.
-
-         This DMA controller transfers data from memory to peripheral fifo.
-         It does not support memory to memory data transfer.
-
 config LPC18XX_DMAMUX
        bool "NXP LPC18xx/43xx DMA MUX for PL080"
        depends on ARCH_LPC18XX || COMPILE_TEST
@@ -783,6 +760,8 @@ source "drivers/dma/fsl-dpaa2-qdma/Kconfig"
 
 source "drivers/dma/lgm/Kconfig"
 
+source "drivers/dma/loongson/Kconfig"
+
 source "drivers/dma/stm32/Kconfig"
 
 # clients
index df566c4958b6eec9eb551e06d8d59bb2dd103084..14aa086629d5c779ed9f79d6312b47457e167458 100644 (file)
@@ -49,8 +49,6 @@ obj-$(CONFIG_INTEL_IDMA64) += idma64.o
 obj-$(CONFIG_INTEL_IOATDMA) += ioat/
 obj-y += idxd/
 obj-$(CONFIG_K3_DMA) += k3dma.o
-obj-$(CONFIG_LOONGSON1_APB_DMA) += loongson1-apb-dma.o
-obj-$(CONFIG_LOONGSON2_APB_DMA) += loongson2-apb-dma.o
 obj-$(CONFIG_LPC18XX_DMAMUX) += lpc18xx-dmamux.o
 obj-$(CONFIG_LPC32XX_DMAMUX) += lpc32xx-dmamux.o
 obj-$(CONFIG_MILBEAUT_HDMAC) += milbeaut-hdmac.o
@@ -88,6 +86,7 @@ obj-$(CONFIG_FSL_DPAA2_QDMA) += fsl-dpaa2-qdma/
 obj-$(CONFIG_INTEL_LDMA) += lgm/
 
 obj-y += amd/
+obj-y += loongson/
 obj-y += mediatek/
 obj-y += qcom/
 obj-y += stm32/
diff --git a/drivers/dma/loongson/Kconfig b/drivers/dma/loongson/Kconfig
new file mode 100644 (file)
index 0000000..0a865a8
--- /dev/null
@@ -0,0 +1,30 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Loongson DMA controllers drivers
+#
+if MACH_LOONGSON32 || MACH_LOONGSON64 || COMPILE_TEST
+
+config LOONGSON1_APB_DMA
+       tristate "Loongson1 APB DMA support"
+       depends on MACH_LOONGSON32 || COMPILE_TEST
+       select DMA_ENGINE
+       select DMA_VIRTUAL_CHANNELS
+       help
+         This selects support for the APB DMA controller in Loongson1 SoCs,
+         which is required by Loongson1 NAND and audio support.
+
+config LOONGSON2_APB_DMA
+       tristate "Loongson2 APB DMA support"
+       depends on MACH_LOONGSON64 || COMPILE_TEST
+       select DMA_ENGINE
+       select DMA_VIRTUAL_CHANNELS
+       help
+         Support for the Loongson2 APB DMA controller driver. The
+         DMA controller is having single DMA channel which can be
+         configured for different peripherals like audio, nand, sdio
+         etc which is in APB bus.
+
+         This DMA controller transfers data from memory to peripheral fifo.
+         It does not support memory to memory data transfer.
+
+endif
diff --git a/drivers/dma/loongson/Makefile b/drivers/dma/loongson/Makefile
new file mode 100644 (file)
index 0000000..6cdd080
--- /dev/null
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_LOONGSON1_APB_DMA) += loongson1-apb-dma.o
+obj-$(CONFIG_LOONGSON2_APB_DMA) += loongson2-apb-dma.o
similarity index 99%
rename from drivers/dma/loongson1-apb-dma.c
rename to drivers/dma/loongson/loongson1-apb-dma.c
index 2e347aba9af81ebc508b3d0f1a6d7130fb2bcf2e..89786cbd20ab50215c6910891f8483562b314b89 100644 (file)
@@ -16,8 +16,8 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
-#include "dmaengine.h"
-#include "virt-dma.h"
+#include "../dmaengine.h"
+#include "../virt-dma.h"
 
 /* Loongson-1 DMA Control Register */
 #define LS1X_DMA_CTRL          0x0
similarity index 99%
rename from drivers/dma/loongson2-apb-dma.c
rename to drivers/dma/loongson/loongson2-apb-dma.c
index b981475e6779bfa51825e1f7bfab6ca177b4959e..fc7d9f4a96ecfab5dc2b17fa4e27f3923beb9772 100644 (file)
@@ -17,8 +17,8 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
-#include "dmaengine.h"
-#include "virt-dma.h"
+#include "../dmaengine.h"
+#include "../virt-dma.h"
 
 /* Global Configuration Register */
 #define LDMA_ORDER_ERG         0x0