Skip to contentSkip to conversation

cmd/dma: implement dmareset command

PATCH Superseded briansune 2 participants 2 messages Sep 1, 2025 – Sep 12, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

briansune

author
#0 lore raw

PATCH 1/1 cmd/dma: implement dmareset command

Add dmareset command to release PL330 DMA channel resets.

---
 cmd/Kconfig  |  7 +++++++
 cmd/Makefile |  1 +
 cmd/dma.c    | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+)
 create mode 100644 cmd/dma.c
cmd/Kconfig +7 -0
index e55a48a49af..720e3121018 100644
@@ -1149,6 +1149,13 @@ config CMD_DM
 	  can be useful to see the state of driver model for debugging or
 	  interest.
 
+config CMD_DMA
+	bool "dma - Release Reset DMA Channels for PL330 Handshake"
+	default y
+	help
+	  Provides access to Reset Manager Per2ModRst. Enables DMA
+	  channels for ARM PrimeCell PL330 via reset release.
+
 config CMD_FASTBOOT
 	bool "fastboot - Android fastboot support"
 	depends on FASTBOOT
cmd/Makefile +1 -0
index 082470fa104..748c53767b8 100644
@@ -54,6 +54,7 @@ obj-$(CONFIG_CMD_CPU) += cpu.o
 obj-$(CONFIG_CMD_DATE) += date.o
 obj-$(CONFIG_CMD_DEMO) += demo.o
 obj-$(CONFIG_CMD_DM) += dm.o
+obj-$(CONFIG_CMD_DMA) += dma.o
 obj-$(CONFIG_CMD_UFETCH) += ufetch.o
 obj-$(CONFIG_CMD_SOUND) += sound.o
 ifdef CONFIG_POST
cmd/dma.c new file +52 -0

52 lines not on this page · raw message

Signature · 1 line
2.47.1.windows.1
#1 lore raw
Quoted 15 lines · briansune

Add dmareset command to release PL330 DMA channel resets.

---
 cmd/Kconfig  |  7 +++++++
 cmd/Makefile |  1 +
 cmd/dma.c    | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+)
 create mode 100644 cmd/dma.c
cmd/Kconfig +0 -0
index e55a48a49af..720e3121018 100644

cmd/Kconfig config CMD_DM · line 1154

Quoted 6 lines
cmd/Kconfig +3 -0
@@ -1149,6 +1149,13 @@ config CMD_DM
 	  can be useful to see the state of driver model for debugging or
 	  interest.
 
+config CMD_DMA
+	bool "dma - Release Reset DMA Channels for PL330 Handshake"
+	default y

New commands should not be "default y" and this likely doesn't build in a whole lot of cases. If this is indeed PL330 specific, it should have a less-generic name.

Quoted 27 lines
cmd/Kconfig +4 -0
+	help
+	  Provides access to Reset Manager Per2ModRst. Enables DMA
+	  channels for ARM PrimeCell PL330 via reset release.
+
 config CMD_FASTBOOT
 	bool "fastboot - Android fastboot support"
 	depends on FASTBOOT
cmd/Makefile +1 -0
index 082470fa104..748c53767b8 100644
@@ -54,6 +54,7 @@ obj-$(CONFIG_CMD_CPU) += cpu.o
 obj-$(CONFIG_CMD_DATE) += date.o
 obj-$(CONFIG_CMD_DEMO) += demo.o
 obj-$(CONFIG_CMD_DM) += dm.o
+obj-$(CONFIG_CMD_DMA) += dma.o
 obj-$(CONFIG_CMD_UFETCH) += ufetch.o
 obj-$(CONFIG_CMD_SOUND) += sound.o
 ifdef CONFIG_POST
cmd/dma.c new file +2 -0
new file mode 100644
index 00000000000..b35c2f32fcc
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*

cmd/dma.c line 12

Quoted 10 lines
cmd/dma.c new file +10 -0
+ * Brian Sune <[email protected]>
+ */
+
+#include <vsprintf.h>
+#include <command.h>
+#include <asm/io.h>
+
+#ifdef CONFIG_TARGET_SOCFPGA_GEN5
+#include <asm/arch/base_addr_ac5.h>
+#endif

If this can't be done generally for ARM then we shouldn't guard the include, it needs to be part of the Kconfig dependencies.

cmd/dma.c line 17

Quoted 4 lines
cmd/dma.c new file +4 -0
+#define RSTMGR_PERMODRST 0x18   /* PERMODRST register offset */
+
+static int do_dmareset(struct cmd_tbl *cmdtp, int flag, int argc,
+	char * const argv[])

Incorrect spacing, please use checkpatch.pl to find and correct issues like this. Thanks.

Signature · 1 line
Tom