* [PATCH 0/2] dmaengine: pl08x: Support the Hi3798MV100 PL080 variant
@ 2026-11-04 15:45 David Yang
2026-11-04 15:45 ` [PATCH 1/2] dmaengine: pl08x: Release the reset before reading registers David Yang
2026-11-04 15:45 ` [PATCH 2/2] dmaengine: pl08x: Use the channel count from the device tree David Yang
0 siblings, 2 replies; 3+ messages in thread
From: David Yang @ 2026-11-04 15:45 UTC (permalink / raw)
To: dmaengine; +Cc: David Yang, Vinod Koul, Frank Li, Philipp Zabel, linux-kernel
Hi3798MV100 (HiSilicon HiSTB) carries a PL080-class DMAC. The block
reports 0x0a141080 -- the ID reserved for Samsung's PL080S -- while its
register map is plain PL080 and the instance has 4 channels instead of
the 8 the plain PL080 entry claims.
Set the DT node to arm,primecell-periphid = <0x00041080> and
dma-channels = <4>, and apply the two patches to add that support.
Tested on Hi3798MV100 hardware.
David Yang (2):
dmaengine: pl08x: Release the reset before reading registers
dmaengine: pl08x: Use the channel count from the device tree
drivers/dma/amba-pl08x.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] dmaengine: pl08x: Release the reset before reading registers
2026-11-04 15:45 [PATCH 0/2] dmaengine: pl08x: Support the Hi3798MV100 PL080 variant David Yang
@ 2026-11-04 15:45 ` David Yang
2026-11-04 15:45 ` [PATCH 2/2] dmaengine: pl08x: Use the channel count from the device tree David Yang
1 sibling, 0 replies; 3+ messages in thread
From: David Yang @ 2026-11-04 15:45 UTC (permalink / raw)
To: dmaengine; +Cc: David Yang, Vinod Koul, Frank Li, Philipp Zabel, linux-kernel
amba_read_periphid() happens to release the reset. A node that carries
arm,primecell-periphid never reaches it. Release the reset ourselves.
Signed-off-by: David Yang <mmyangfl@gmail.com>
---
drivers/dma/amba-pl08x.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 543c2eb8cfa8..33ad6c42cd7f 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -75,6 +75,7 @@
#include <linux/of.h>
#include <linux/of_dma.h>
#include <linux/pm_runtime.h>
+#include <linux/reset.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/amba/pl080.h>
@@ -2695,6 +2696,7 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
struct pl08x_driver_data *pl08x;
struct vendor_data *vd = id->data;
struct device_node *np = adev->dev.of_node;
+ struct reset_control *rst;
u32 tsfr_size;
int ret = 0;
int i;
@@ -2725,6 +2727,16 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
goto out_no_ioremap;
}
+ /* Release the reset before reading registers */
+ rst = devm_reset_control_get_optional_exclusive(&adev->dev, NULL);
+ if (IS_ERR(rst)) {
+ ret = PTR_ERR(rst);
+ goto out_no_ioremap;
+ }
+ ret = reset_control_deassert(rst);
+ if (ret)
+ goto out_no_ioremap;
+
if (vd->ftdmac020) {
u32 val;
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] dmaengine: pl08x: Use the channel count from the device tree
2026-11-04 15:45 [PATCH 0/2] dmaengine: pl08x: Support the Hi3798MV100 PL080 variant David Yang
2026-11-04 15:45 ` [PATCH 1/2] dmaengine: pl08x: Release the reset before reading registers David Yang
@ 2026-11-04 15:45 ` David Yang
1 sibling, 0 replies; 3+ messages in thread
From: David Yang @ 2026-11-04 15:45 UTC (permalink / raw)
To: dmaengine; +Cc: David Yang, Vinod Koul, Frank Li, Philipp Zabel, linux-kernel
The Hi3798MV100 DMAC is a plain PL080 except for the channel count: 4
instead of 8. The part ID does not say, and the driver takes the count
from the matched vendor_data entry. dma-common.yaml already defines
dma-channels for a controller node. Honor it.
Signed-off-by: David Yang <mmyangfl@gmail.com>
---
drivers/dma/amba-pl08x.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 33ad6c42cd7f..9bcb4a3cd5a0 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -2698,6 +2698,7 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
struct device_node *np = adev->dev.of_node;
struct reset_control *rst;
u32 tsfr_size;
+ u32 channels;
int ret = 0;
int i;
@@ -2759,6 +2760,16 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
vd->dualmaster = !!(val & BIT(9));
}
+ /* Read the channel number from the node if specified */
+ if (!of_property_read_u32(np, "dma-channels", &channels) && channels) {
+ if (channels > vd->channels)
+ dev_warn(&adev->dev,
+ "using %u channels, instead of %u from the node\n",
+ vd->channels, channels);
+ else
+ vd->channels = channels;
+ }
+
/* Initialize memcpy engine */
dma_cap_set(DMA_MEMCPY, pl08x->memcpy.cap_mask);
pl08x->memcpy.dev = &adev->dev;
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-04 15:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 15:45 [PATCH 0/2] dmaengine: pl08x: Support the Hi3798MV100 PL080 variant David Yang
2026-11-04 15:45 ` [PATCH 1/2] dmaengine: pl08x: Release the reset before reading registers David Yang
2026-11-04 15:45 ` [PATCH 2/2] dmaengine: pl08x: Use the channel count from the device tree David Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®