* [PATCH v3 0/7] Add and use UART AP_DMA controller on MTK SoCs
@ 2026-07-09 9:09 AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property AngeloGioacchino Del Regno
` (6 more replies)
0 siblings, 7 replies; 10+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-09 9:09 UTC (permalink / raw)
To: linux-mediatek
Cc: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
devicetree, linux-kernel, linux-arm-kernel, kernel, justin.yeh
Changes in v3:
- MT8173: Removed first DMA as it clashes with the I2C4 DMA
- MT8186: Fixed IRQ levels
- MT8195: Reordered apdma node (same as mt8188)
Changes in v2:
- Fixed node ordering in mt8188
- Fixed interrupts in mt8173
- Fixed interrupt cells and fallback compatible in mt8186
First of all: not all of them will use this and that's sure - but the
devicetree describes hardware, and this hardware was not described on
any of the SoCs that support the UART AP_DMA controller.
Besides, there is also driver support for this controller for all SoCs!
Let's add support for this IP in all of the SoCs that have it.
AngeloGioacchino Del Regno (7):
arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property
arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
arm64: dts: mediatek: mt8183: Add and use UART AP_DMA controller
arm64: dts: mediatek: mt8186: Add and use UART AP_DMA controller
arm64: dts: mediatek: mt8188: Add and use UART AP_DMA controller
arm64: dts: mediatek: mt8192: Add and use UART AP_DMA controller
arm64: dts: mediatek: mt8195: Add and use UART AP_DMA controller
arch/arm64/boot/dts/mediatek/mt6795.dtsi | 4 +--
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 22 ++++++++++++++
arch/arm64/boot/dts/mediatek/mt8183.dtsi | 22 ++++++++++++++
arch/arm64/boot/dts/mediatek/mt8186.dtsi | 22 ++++++++++++++
arch/arm64/boot/dts/mediatek/mt8188.dtsi | 33 +++++++++++++++++++++
arch/arm64/boot/dts/mediatek/mt8192.dtsi | 17 +++++++++++
arch/arm64/boot/dts/mediatek/mt8195.dtsi | 37 ++++++++++++++++++++++++
7 files changed, 154 insertions(+), 3 deletions(-)
--
2.54.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property
2026-07-09 9:09 [PATCH v3 0/7] Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
@ 2026-07-09 9:09 ` AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller AngeloGioacchino Del Regno
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-09 9:09 UTC (permalink / raw)
To: linux-mediatek
Cc: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
devicetree, linux-kernel, linux-arm-kernel, kernel, justin.yeh
Remove the mediatek,dma-33bits property as it is now deprecated
and, while at it, also remove the fallback compatible as it was
not entirely right to use anyway, because this IP is not fully
compatible with the one found in MT6577 and would create more
issues than the ones it could resolve (as in - it's better to
not probe the controller than to probe it and manage it in some
incorrect way).
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
arch/arm64/boot/dts/mediatek/mt6795.dtsi | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt6795.dtsi b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
index 134cfa77e3b1..6dd706b27830 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -547,8 +547,7 @@ uart1: serial@11003000 {
};
apdma: dma-controller@11000380 {
- compatible = "mediatek,mt6795-uart-dma",
- "mediatek,mt6577-uart-dma";
+ compatible = "mediatek,mt6795-uart-dma";
reg = <0 0x11000380 0 0x60>,
<0 0x11000400 0 0x60>,
<0 0x11000480 0 0x60>,
@@ -568,7 +567,6 @@ apdma: dma-controller@11000380 {
dma-requests = <8>;
clocks = <&pericfg CLK_PERI_AP_DMA>;
clock-names = "apdma";
- mediatek,dma-33bits;
#dma-cells = <1>;
};
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
2026-07-09 9:09 [PATCH v3 0/7] Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property AngeloGioacchino Del Regno
@ 2026-07-09 9:09 ` AngeloGioacchino Del Regno
2026-07-09 9:17 ` sashiko-bot
2026-07-09 9:09 ` [PATCH v3 3/7] arm64: dts: mediatek: mt8183: " AngeloGioacchino Del Regno
` (4 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-09 9:09 UTC (permalink / raw)
To: linux-mediatek
Cc: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
devicetree, linux-kernel, linux-arm-kernel, kernel, justin.yeh
This SoC has a DMA controller (AP_DMA) that provides one channel
for each data direction (transmit and receive) for all of the
UART controllers in the SoC.
In order to increase the efficiency of data TX/RX over the UART
controllers, add the UART DMA controller and assign the right
channels to each of the four UART controllers.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 78c2ccd5be13..18683d3b08f0 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -673,6 +673,22 @@ gic: interrupt-controller@10221000 {
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
};
+ apdma: dma-controller@11000400 {
+ compatible = "mediatek,mt8173-uart-dma", "mediatek,mt6577-uart-dma";
+ reg = <0 0x11000400 0 0x80>, <0 0x11000480 0 0x80>,
+ <0 0x11000500 0 0x80>, <0 0x11000580 0 0x80>,
+ <0 0x11000600 0 0x80>, <0 0x11000680 0 0x80>;
+ interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 98 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 99 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 100 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 101 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 102 IRQ_TYPE_LEVEL_LOW>;
+ clocks = <&pericfg CLK_PERI_AP_DMA>;
+ #dma-cells = <1>;
+ dma-requests = <8>;
+ };
+
auxadc: auxadc@11001000 {
compatible = "mediatek,mt8173-auxadc";
reg = <0 0x11001000 0 0x1000>;
@@ -698,6 +714,8 @@ uart1: serial@11003000 {
interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_UART1_SEL>, <&pericfg CLK_PERI_UART1>;
clock-names = "baud", "bus";
+ dmas = <&apdma 0>, <&apdma 1>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -708,6 +726,8 @@ uart2: serial@11004000 {
interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_UART2_SEL>, <&pericfg CLK_PERI_UART2>;
clock-names = "baud", "bus";
+ dmas = <&apdma 2>, <&apdma 3>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -718,6 +738,8 @@ uart3: serial@11005000 {
interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_UART3_SEL>, <&pericfg CLK_PERI_UART3>;
clock-names = "baud", "bus";
+ dmas = <&apdma 4>, <&apdma 5>;
+ dma-names = "tx", "rx";
status = "disabled";
};
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 3/7] arm64: dts: mediatek: mt8183: Add and use UART AP_DMA controller
2026-07-09 9:09 [PATCH v3 0/7] Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller AngeloGioacchino Del Regno
@ 2026-07-09 9:09 ` AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 4/7] arm64: dts: mediatek: mt8186: " AngeloGioacchino Del Regno
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-09 9:09 UTC (permalink / raw)
To: linux-mediatek
Cc: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
devicetree, linux-kernel, linux-arm-kernel, kernel, justin.yeh
This SoC has a DMA controller (AP_DMA) that provides one channel
for each data direction (transmit and receive) for all of the
UART controllers in the SoC.
In order to increase the efficiency of data TX/RX over the UART
controllers, add the UART DMA controller and assign the right
channels to each of the three UART controllers.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
arch/arm64/boot/dts/mediatek/mt8183.dtsi | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
index 95cc06799533..8b0992548431 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
@@ -1071,6 +1071,22 @@ gce: mailbox@10238000 {
clock-names = "gce";
};
+ apdma: dma-controller@11000780 {
+ compatible = "mediatek,mt8183-uart-dma", "mediatek,mt6577-uart-dma";
+ reg = <0 0x11000780 0 0x80>, <0 0x11000800 0 0x80>,
+ <0 0x11000880 0 0x80>, <0 0x11000900 0 0x80>,
+ <0 0x11000980 0 0x80>, <0 0x11000a00 0 0x80>;
+ interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 109 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 110 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 111 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 112 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 113 IRQ_TYPE_LEVEL_LOW>;
+ clocks = <&infracfg CLK_INFRA_AP_DMA>;
+ #dma-cells = <1>;
+ dma-requests = <6>;
+ };
+
auxadc: auxadc@11001000 {
compatible = "mediatek,mt8183-auxadc",
"mediatek,mt8173-auxadc";
@@ -1088,6 +1104,8 @@ uart0: serial@11002000 {
interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_LOW>;
clocks = <&clk26m>, <&infracfg CLK_INFRA_UART0>;
clock-names = "baud", "bus";
+ dmas = <&apdma 0>, <&apdma 1>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1098,6 +1116,8 @@ uart1: serial@11003000 {
interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_LOW>;
clocks = <&clk26m>, <&infracfg CLK_INFRA_UART1>;
clock-names = "baud", "bus";
+ dmas = <&apdma 2>, <&apdma 3>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1108,6 +1128,8 @@ uart2: serial@11004000 {
interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_LOW>;
clocks = <&clk26m>, <&infracfg CLK_INFRA_UART2>;
clock-names = "baud", "bus";
+ dmas = <&apdma 4>, <&apdma 5>;
+ dma-names = "tx", "rx";
status = "disabled";
};
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 4/7] arm64: dts: mediatek: mt8186: Add and use UART AP_DMA controller
2026-07-09 9:09 [PATCH v3 0/7] Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (2 preceding siblings ...)
2026-07-09 9:09 ` [PATCH v3 3/7] arm64: dts: mediatek: mt8183: " AngeloGioacchino Del Regno
@ 2026-07-09 9:09 ` AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 5/7] arm64: dts: mediatek: mt8188: " AngeloGioacchino Del Regno
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-09 9:09 UTC (permalink / raw)
To: linux-mediatek
Cc: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
devicetree, linux-kernel, linux-arm-kernel, kernel, justin.yeh
This SoC has a DMA controller (AP_DMA) that provides one channel
for each data direction (transmit and receive) for all of the
UART controllers in the SoC.
In order to increase the efficiency of data TX/RX over the UART
controllers, add the UART DMA controller and assign the right
channels to each of the three UART controllers.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
arch/arm64/boot/dts/mediatek/mt8186.dtsi | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi
index fded6345d422..621408439ffa 100644
--- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi
@@ -1142,6 +1142,22 @@ systimer: timer@10017000 {
clocks = <&clk13m>;
};
+ apdma: dma-controller@10200d80 {
+ compatible = "mediatek,mt8186-uart-dma", "mediatek,mt6835-uart-dma";
+ reg = <0 0x10200d80 0 0x80>, <0 0x10200e00 0 0x80>,
+ <0 0x10200e80 0 0x80>, <0 0x10200f00 0 0x80>,
+ <0 0x10200f80 0 0x80>, <0 0x10201000 0 0x80>;
+ interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 380 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 381 IRQ_TYPE_LEVEL_HIGH 0>;
+ clocks = <&infracfg_ao CLK_INFRA_AO_AP_DMA>;
+ #dma-cells = <1>;
+ dma-requests = <6>;
+ };
+
gce: mailbox@1022c000 {
compatible = "mediatek,mt8186-gce";
reg = <0 0X1022c000 0 0x4000>;
@@ -1218,6 +1234,8 @@ uart0: serial@11002000 {
interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART0>;
clock-names = "baud", "bus";
+ dmas = <&apdma 0>, <&apdma 1>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1228,6 +1246,8 @@ uart1: serial@11003000 {
interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART1>;
clock-names = "baud", "bus";
+ dmas = <&apdma 2>, <&apdma 3>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1482,6 +1502,8 @@ uart2: serial@11018000 {
interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART2>;
clock-names = "baud", "bus";
+ dmas = <&apdma 4>, <&apdma 5>;
+ dma-names = "tx", "rx";
status = "disabled";
};
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 5/7] arm64: dts: mediatek: mt8188: Add and use UART AP_DMA controller
2026-07-09 9:09 [PATCH v3 0/7] Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (3 preceding siblings ...)
2026-07-09 9:09 ` [PATCH v3 4/7] arm64: dts: mediatek: mt8186: " AngeloGioacchino Del Regno
@ 2026-07-09 9:09 ` AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 6/7] arm64: dts: mediatek: mt8192: " AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 7/7] arm64: dts: mediatek: mt8195: " AngeloGioacchino Del Regno
6 siblings, 0 replies; 10+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-09 9:09 UTC (permalink / raw)
To: linux-mediatek
Cc: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
devicetree, linux-kernel, linux-arm-kernel, kernel, justin.yeh
This SoC has a DMA controller (AP_DMA) that provides one channel
for each data direction (transmit and receive) for all of the
UART controllers in the SoC.
In order to increase the efficiency of data TX/RX over the UART
controllers, add the UART DMA controller and assign the right
channels to each of the four UART controllers that are declared.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
arch/arm64/boot/dts/mediatek/mt8188.dtsi | 33 ++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8188.dtsi b/arch/arm64/boot/dts/mediatek/mt8188.dtsi
index 75133794cec3..14a320f0c70c 100644
--- a/arch/arm64/boot/dts/mediatek/mt8188.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8188.dtsi
@@ -1360,6 +1360,31 @@ spmi: spmi@10027000 {
clock-names = "pmif_sys_ck", "pmif_tmr_ck", "spmimst_clk_mux";
};
+ apdma: dma-controller@10220880 {
+ compatible = "mediatek,mt8188-uart-dma", "mediatek,mt6835-uart-dma";
+ reg = <0 0x10220880 0 0x80>, <0 0x10220900 0 0x80>,
+ <0 0x10220980 0 0x80>, <0 0x10220a00 0 0x80>,
+ <0 0x10220a80 0 0x80>, <0 0x10220b00 0 0x80>,
+ <0 0x10220b80 0 0x80>, <0 0x10220c00 0 0x80>,
+ <0 0x10220c80 0 0x80>, <0 0x10220d00 0 0x80>,
+ <0 0x10220d80 0 0x80>, <0 0x10220e00 0 0x80>;
+ interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 179 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 181 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 185 IRQ_TYPE_LEVEL_HIGH 0>;
+ clocks = <&infracfg_ao CLK_INFRA_AO_APDMA_BCLK>;
+ #dma-cells = <1>;
+ dma-requests = <12>;
+ };
+
infra_iommu: iommu@10315000 {
compatible = "mediatek,mt8188-iommu-infra";
reg = <0 0x10315000 0 0x1000>;
@@ -1512,6 +1537,8 @@ uart0: serial@11001100 {
interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART0>;
clock-names = "baud", "bus";
+ dmas = <&apdma 0>, <&apdma 1>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1521,6 +1548,8 @@ uart1: serial@11001200 {
interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART1>;
clock-names = "baud", "bus";
+ dmas = <&apdma 2>, <&apdma 3>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1530,6 +1559,8 @@ uart2: serial@11001300 {
interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART2>;
clock-names = "baud", "bus";
+ dmas = <&apdma 4>, <&apdma 5>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1539,6 +1570,8 @@ uart3: serial@11001400 {
interrupts = <GIC_SPI 723 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART3>;
clock-names = "baud", "bus";
+ dmas = <&apdma 6>, <&apdma 7>;
+ dma-names = "tx", "rx";
status = "disabled";
};
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 6/7] arm64: dts: mediatek: mt8192: Add and use UART AP_DMA controller
2026-07-09 9:09 [PATCH v3 0/7] Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (4 preceding siblings ...)
2026-07-09 9:09 ` [PATCH v3 5/7] arm64: dts: mediatek: mt8188: " AngeloGioacchino Del Regno
@ 2026-07-09 9:09 ` AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 7/7] arm64: dts: mediatek: mt8195: " AngeloGioacchino Del Regno
6 siblings, 0 replies; 10+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-09 9:09 UTC (permalink / raw)
To: linux-mediatek
Cc: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
devicetree, linux-kernel, linux-arm-kernel, kernel, justin.yeh
This SoC has a DMA controller (AP_DMA) that provides one channel
for each data direction (transmit and receive) for all of the
UART controllers in the SoC.
In order to increase the efficiency of data TX/RX over the UART
controllers, add the UART DMA controller and assign the right
channels to its two uart controllers.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
arch/arm64/boot/dts/mediatek/mt8192.dtsi | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8192.dtsi b/arch/arm64/boot/dts/mediatek/mt8192.dtsi
index 9f8f115edd4c..898953acdb61 100644
--- a/arch/arm64/boot/dts/mediatek/mt8192.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8192.dtsi
@@ -741,6 +741,19 @@ spmi: spmi@10027000 {
assigned-clock-parents = <&topckgen CLK_TOP_OSC_D10>;
};
+ apdma: dma-controller@10217a80 {
+ compatible = "mediatek,mt8192-uart-dma", "mediatek,mt6835-uart-dma";
+ reg = <0 0x10217a80 0 0x80>, <0 0x10217b00 0 0x80>,
+ <0 0x10217b80 0 0x80>, <0 0x10217c00 0 0x80>;
+ interrupts = <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH 0>;
+ clocks = <&infracfg CLK_INFRA_AP_DMA>;
+ #dma-cells = <1>;
+ dma-requests = <4>;
+ };
+
gce: mailbox@10228000 {
compatible = "mediatek,mt8192-gce";
reg = <0 0x10228000 0 0x4000>;
@@ -765,6 +778,8 @@ uart0: serial@11002000 {
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg CLK_INFRA_UART0>;
clock-names = "baud", "bus";
+ dmas = <&apdma 0>, <&apdma 1>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -775,6 +790,8 @@ uart1: serial@11003000 {
interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg CLK_INFRA_UART1>;
clock-names = "baud", "bus";
+ dmas = <&apdma 2>, <&apdma 3>;
+ dma-names = "tx", "rx";
status = "disabled";
};
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 7/7] arm64: dts: mediatek: mt8195: Add and use UART AP_DMA controller
2026-07-09 9:09 [PATCH v3 0/7] Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (5 preceding siblings ...)
2026-07-09 9:09 ` [PATCH v3 6/7] arm64: dts: mediatek: mt8192: " AngeloGioacchino Del Regno
@ 2026-07-09 9:09 ` AngeloGioacchino Del Regno
6 siblings, 0 replies; 10+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-09 9:09 UTC (permalink / raw)
To: linux-mediatek
Cc: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
devicetree, linux-kernel, linux-arm-kernel, kernel, justin.yeh
This SoC has a DMA controller (AP_DMA) that provides one channel
for each data direction (transmit and receive) for all of the
UART controllers in the SoC.
In order to increase the efficiency of data TX/RX over the UART
controllers, add the UART DMA controller and assign the right
channels to each uart controller.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
arch/arm64/boot/dts/mediatek/mt8195.dtsi | 37 ++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
index c72e34c57629..9aaf8b6edcb5 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
@@ -904,6 +904,31 @@ spmi: spmi@10027000 {
assigned-clock-parents = <&topckgen CLK_TOP_ULPOSC1_D10>;
};
+ apdma: dma-controller@10220880 {
+ compatible = "mediatek,mt8195-uart-dma", "mediatek,mt6835-uart-dma";
+ reg = <0 0x10220880 0 0x80>, <0 0x10220900 0 0x80>,
+ <0 0x10220980 0 0x80>, <0 0x10220a00 0 0x80>,
+ <0 0x10220a80 0 0x80>, <0 0x10220b00 0 0x80>,
+ <0 0x10220b80 0 0x80>, <0 0x10220c00 0 0x80>,
+ <0 0x10220c80 0 0x80>, <0 0x10220d00 0 0x80>,
+ <0 0x10220d80 0 0x80>, <0 0x10220e00 0 0x80>;
+ interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 179 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 181 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 185 IRQ_TYPE_LEVEL_HIGH 0>;
+ clocks = <&infracfg_ao CLK_INFRA_AO_APDMA_B>;
+ #dma-cells = <1>;
+ dma-requests = <12>;
+ };
+
iommu_infra: infra-iommu@10315000 {
compatible = "mediatek,mt8195-iommu-infra";
reg = <0 0x10315000 0 0x5000>;
@@ -1040,6 +1065,8 @@ uart0: serial@11001100 {
interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART0>;
clock-names = "baud", "bus";
+ dmas = <&apdma 0>, <&apdma 1>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1050,6 +1077,8 @@ uart1: serial@11001200 {
interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART1>;
clock-names = "baud", "bus";
+ dmas = <&apdma 2>, <&apdma 3>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1060,6 +1089,8 @@ uart2: serial@11001300 {
interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART2>;
clock-names = "baud", "bus";
+ dmas = <&apdma 4>, <&apdma 5>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1070,6 +1101,8 @@ uart3: serial@11001400 {
interrupts = <GIC_SPI 723 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART3>;
clock-names = "baud", "bus";
+ dmas = <&apdma 6>, <&apdma 7>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1080,6 +1113,8 @@ uart4: serial@11001500 {
interrupts = <GIC_SPI 724 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART4>;
clock-names = "baud", "bus";
+ dmas = <&apdma 8>, <&apdma 9>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -1090,6 +1125,8 @@ uart5: serial@11001600 {
interrupts = <GIC_SPI 725 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&clk26m>, <&infracfg_ao CLK_INFRA_AO_UART5>;
clock-names = "baud", "bus";
+ dmas = <&apdma 10>, <&apdma 11>;
+ dma-names = "tx", "rx";
status = "disabled";
};
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v3 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
2026-07-09 9:09 ` [PATCH v3 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller AngeloGioacchino Del Regno
@ 2026-07-09 9:17 ` sashiko-bot
2026-07-09 10:46 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 10+ messages in thread
From: sashiko-bot @ 2026-07-09 9:17 UTC (permalink / raw)
To: AngeloGioacchino Del Regno; +Cc: devicetree, conor+dt, robh
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The AP_DMA controller specifies `dma-requests = <8>` but only provides 6 `reg` and 6 `interrupts` entries, which causes the APDMA driver to fail during probe. Additionally, the patch omits DMA assignments for `uart0` despite the commit message claiming to configure all four UART controllers.
--
--- Patch [2]: [PATCH v3 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller ---
commit ac8a25e005302375b885a8325819560714cb8e2c
Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
This commit adds the UART AP_DMA controller to the mt8173 device tree.
It also assigns DMA channels to the UART controllers to increase TX/RX
efficiency.
> In order to increase the efficiency of data TX/RX over the UART
> controllers, add the UART DMA controller and assign the right
> channels to each of the four UART controllers.
[Severity: High]
The commit message mentions assigning channels to each of the four UART
controllers, but only uart1, uart2, and uart3 are updated in the patch. Is
uart0 intentionally missing?
> diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
[ ... ]
> + apdma: dma-controller@11000400 {
> + compatible = "mediatek,mt8173-uart-dma", "mediatek,mt6577-uart-dma";
> + reg = <0 0x11000400 0 0x80>, <0 0x11000480 0 0x80>,
> + <0 0x11000500 0 0x80>, <0 0x11000580 0 0x80>,
> + <0 0x11000600 0 0x80>, <0 0x11000680 0 0x80>;
> + interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_LOW>,
> + <GIC_SPI 98 IRQ_TYPE_LEVEL_LOW>,
> + <GIC_SPI 99 IRQ_TYPE_LEVEL_LOW>,
> + <GIC_SPI 100 IRQ_TYPE_LEVEL_LOW>,
> + <GIC_SPI 101 IRQ_TYPE_LEVEL_LOW>,
> + <GIC_SPI 102 IRQ_TYPE_LEVEL_LOW>;
> + clocks = <&pericfg CLK_PERI_AP_DMA>;
> + #dma-cells = <1>;
> + dma-requests = <8>;
[Severity: High]
Does this dma-requests count of 8 match the provided reg and interrupts
arrays?
The mtk-uart-apdma driver iterates dma-requests times during probe. With only
6 resources defined in the reg and interrupts arrays,
devm_platform_ioremap_resource() will fail with -EINVAL when trying to map
the missing resources. This will cause the probe to abort, unconditionally
breaking DMA for all UARTs on this SoC.
Should dma-requests be 6 here since uart0 was omitted, or are there missing
reg and interrupts entries that should be added?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260709090924.27056-1-angelogioacchino.delregno@collabora.com?part=2
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
2026-07-09 9:17 ` sashiko-bot
@ 2026-07-09 10:46 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 10+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-09 10:46 UTC (permalink / raw)
To: sashiko-reviews; +Cc: devicetree, conor+dt, robh
On 7/9/26 11:17, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] The AP_DMA controller specifies `dma-requests = <8>` but only provides 6 `reg` and 6 `interrupts` entries, which causes the APDMA driver to fail during probe. Additionally, the patch omits DMA assignments for `uart0` despite the commit message claiming to configure all four UART controllers.
Will fix later while applying.
> --
>
> --- Patch [2]: [PATCH v3 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller ---
> commit ac8a25e005302375b885a8325819560714cb8e2c
> Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>
> arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
>
> This commit adds the UART AP_DMA controller to the mt8173 device tree.
> It also assigns DMA channels to the UART controllers to increase TX/RX
> efficiency.
>
>> In order to increase the efficiency of data TX/RX over the UART
>> controllers, add the UART DMA controller and assign the right
>> channels to each of the four UART controllers.
>
> [Severity: High]
> The commit message mentions assigning channels to each of the four UART
> controllers, but only uart1, uart2, and uart3 are updated in the patch. Is
> uart0 intentionally missing?
>
>> diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
>> --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
>> +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> [ ... ]
>> + apdma: dma-controller@11000400 {
>> + compatible = "mediatek,mt8173-uart-dma", "mediatek,mt6577-uart-dma";
>> + reg = <0 0x11000400 0 0x80>, <0 0x11000480 0 0x80>,
>> + <0 0x11000500 0 0x80>, <0 0x11000580 0 0x80>,
>> + <0 0x11000600 0 0x80>, <0 0x11000680 0 0x80>;
>> + interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_LOW>,
>> + <GIC_SPI 98 IRQ_TYPE_LEVEL_LOW>,
>> + <GIC_SPI 99 IRQ_TYPE_LEVEL_LOW>,
>> + <GIC_SPI 100 IRQ_TYPE_LEVEL_LOW>,
>> + <GIC_SPI 101 IRQ_TYPE_LEVEL_LOW>,
>> + <GIC_SPI 102 IRQ_TYPE_LEVEL_LOW>;
>> + clocks = <&pericfg CLK_PERI_AP_DMA>;
>> + #dma-cells = <1>;
>> + dma-requests = <8>;
>
> [Severity: High]
> Does this dma-requests count of 8 match the provided reg and interrupts
> arrays?
>
> The mtk-uart-apdma driver iterates dma-requests times during probe. With only
> 6 resources defined in the reg and interrupts arrays,
> devm_platform_ioremap_resource() will fail with -EINVAL when trying to map
> the missing resources. This will cause the probe to abort, unconditionally
> breaking DMA for all UARTs on this SoC.
>
> Should dma-requests be 6 here since uart0 was omitted, or are there missing
> reg and interrupts entries that should be added?
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-07-09 10:46 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09 9:09 [PATCH v3 0/7] Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller AngeloGioacchino Del Regno
2026-07-09 9:17 ` sashiko-bot
2026-07-09 10:46 ` AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 3/7] arm64: dts: mediatek: mt8183: " AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 4/7] arm64: dts: mediatek: mt8186: " AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 5/7] arm64: dts: mediatek: mt8188: " AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 6/7] arm64: dts: mediatek: mt8192: " AngeloGioacchino Del Regno
2026-07-09 9:09 ` [PATCH v3 7/7] arm64: dts: mediatek: mt8195: " AngeloGioacchino Del Regno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox