* [PATCH v2 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs
@ 2026-07-07 15:48 AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property AngeloGioacchino Del Regno
` (6 more replies)
0 siblings, 7 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-07 15:48 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 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 | 27 +++++++++++++++++
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, 159 insertions(+), 3 deletions(-)
--
2.54.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property
2026-07-07 15:48 [PATCH v2 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
@ 2026-07-07 15:48 ` AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller AngeloGioacchino Del Regno
` (5 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-07 15:48 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] 11+ messages in thread
* [PATCH v2 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
2026-07-07 15:48 [PATCH v2 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property AngeloGioacchino Del Regno
@ 2026-07-07 15:48 ` AngeloGioacchino Del Regno
2026-07-07 16:16 ` sashiko-bot
2026-07-07 15:48 ` [PATCH v2 3/7] arm64: dts: mediatek: mt8183: " AngeloGioacchino Del Regno
` (4 subsequent siblings)
6 siblings, 1 reply; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-07 15:48 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 | 27 ++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 78c2ccd5be13..7297225f61c9 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -673,6 +673,25 @@ gic: interrupt-controller@10221000 {
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
};
+ apdma: dma-controller@11000300 {
+ compatible = "mediatek,mt8173-uart-dma", "mediatek,mt6577-uart-dma";
+ reg = <0 0x11000300 0 0x80>, <0 0x11000380 0 0x80>,
+ <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 95 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>,
+ <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>;
@@ -688,6 +707,8 @@ uart0: serial@11002000 {
interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_UART0_SEL>, <&pericfg CLK_PERI_UART0>;
clock-names = "baud", "bus";
+ dmas = <&apdma 0>, <&apdma 1>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -698,6 +719,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 2>, <&apdma 3>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -708,6 +731,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 4>, <&apdma 5>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -718,6 +743,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 6>, <&apdma 7>;
+ dma-names = "tx", "rx";
status = "disabled";
};
--
2.54.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 3/7] arm64: dts: mediatek: mt8183: Add and use UART AP_DMA controller
2026-07-07 15:48 [PATCH v2 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller AngeloGioacchino Del Regno
@ 2026-07-07 15:48 ` AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 4/7] arm64: dts: mediatek: mt8186: " AngeloGioacchino Del Regno
` (3 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-07 15:48 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] 11+ messages in thread
* [PATCH v2 4/7] arm64: dts: mediatek: mt8186: Add and use UART AP_DMA controller
2026-07-07 15:48 [PATCH v2 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (2 preceding siblings ...)
2026-07-07 15:48 ` [PATCH v2 3/7] arm64: dts: mediatek: mt8183: " AngeloGioacchino Del Regno
@ 2026-07-07 15:48 ` AngeloGioacchino Del Regno
2026-07-07 16:37 ` sashiko-bot
2026-07-07 15:48 ` [PATCH v2 5/7] arm64: dts: mediatek: mt8188: " AngeloGioacchino Del Regno
` (2 subsequent siblings)
6 siblings, 1 reply; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-07 15:48 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..9fe60dee0b79 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_LOW 0>,
+ <GIC_SPI 377 IRQ_TYPE_LEVEL_LOW 0>,
+ <GIC_SPI 378 IRQ_TYPE_LEVEL_LOW 0>,
+ <GIC_SPI 379 IRQ_TYPE_LEVEL_LOW 0>,
+ <GIC_SPI 380 IRQ_TYPE_LEVEL_LOW 0>,
+ <GIC_SPI 381 IRQ_TYPE_LEVEL_LOW 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] 11+ messages in thread
* [PATCH v2 5/7] arm64: dts: mediatek: mt8188: Add and use UART AP_DMA controller
2026-07-07 15:48 [PATCH v2 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (3 preceding siblings ...)
2026-07-07 15:48 ` [PATCH v2 4/7] arm64: dts: mediatek: mt8186: " AngeloGioacchino Del Regno
@ 2026-07-07 15:48 ` AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 6/7] arm64: dts: mediatek: mt8192: " AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 7/7] arm64: dts: mediatek: mt8195: " AngeloGioacchino Del Regno
6 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-07 15:48 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] 11+ messages in thread
* [PATCH v2 6/7] arm64: dts: mediatek: mt8192: Add and use UART AP_DMA controller
2026-07-07 15:48 [PATCH v2 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (4 preceding siblings ...)
2026-07-07 15:48 ` [PATCH v2 5/7] arm64: dts: mediatek: mt8188: " AngeloGioacchino Del Regno
@ 2026-07-07 15:48 ` AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 7/7] arm64: dts: mediatek: mt8195: " AngeloGioacchino Del Regno
6 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-07 15:48 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] 11+ messages in thread
* [PATCH v2 7/7] arm64: dts: mediatek: mt8195: Add and use UART AP_DMA controller
2026-07-07 15:48 [PATCH v2 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (5 preceding siblings ...)
2026-07-07 15:48 ` [PATCH v2 6/7] arm64: dts: mediatek: mt8192: " AngeloGioacchino Del Regno
@ 2026-07-07 15:48 ` AngeloGioacchino Del Regno
2026-07-07 16:54 ` sashiko-bot
6 siblings, 1 reply; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-07 15:48 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..3306fd8c4e44 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
@@ -877,6 +877,31 @@ systimer: timer@10017000 {
clocks = <&clk13m>;
};
+ 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>;
+ };
+
pwrap: pwrap@10024000 {
compatible = "mediatek,mt8195-pwrap", "syscon";
reg = <0 0x10024000 0 0x1000>;
@@ -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] 11+ messages in thread
* Re: [PATCH v2 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
2026-07-07 15:48 ` [PATCH v2 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller AngeloGioacchino Del Regno
@ 2026-07-07 16:16 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-07-07 16:16 UTC (permalink / raw)
To: AngeloGioacchino Del Regno; +Cc: robh, devicetree, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The newly added `apdma` node uses a `reg` base address that overlaps exactly with the DMA channel already assigned to `i2c4` (`0x11000300`), leading to guaranteed probe failures for one of the devices.
--
--- Patch [2]: [PATCH v2 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller ---
commit 02e7bfa1531235c71580128c63236a6715a1e297
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 and
assigns its DMA channels to the four UART controllers. This is intended to
increase data TX/RX efficiency for the UARTs.
> diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> index 78c2ccd5be132..7297225f61c99 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> @@ -673,6 +673,25 @@ gic: interrupt-controller@10221000 {
> (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
> };
>
> + apdma: dma-controller@11000300 {
> + compatible = "mediatek,mt8173-uart-dma", "mediatek,mt6577-uart-dma";
> + reg = <0 0x11000300 0 0x80>, <0 0x11000380 0 0x80>,
[Severity: High]
Does this node's first reg region conflict with the DMA region already
assigned to the i2c4 controller?
Looking at the existing i2c4 node later in the same file:
i2c4: i2c@11011000 {
compatible = "mediatek,mt8173-i2c";
reg = <0 0x11011000 0 0x70>,
<0 0x11000300 0 0x80>;
Since both devices claim 0x11000300 and apdma is not marked as disabled,
would request_mem_region() return -EBUSY and fail to probe one of the
devices? This could break i2c4-attached devices like trackpads on
mt8173-elm boards.
> + <0 0x11000400 0 0x80>, <0 0x11000480 0 0x80>,
> + <0 0x11000500 0 0x80>, <0 0x11000580 0 0x80>,
> + <0 0x11000600 0 0x80>, <0 0x11000680 0 0x80>;
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707154841.198870-1-angelogioacchino.delregno@collabora.com?part=2
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 4/7] arm64: dts: mediatek: mt8186: Add and use UART AP_DMA controller
2026-07-07 15:48 ` [PATCH v2 4/7] arm64: dts: mediatek: mt8186: " AngeloGioacchino Del Regno
@ 2026-07-07 16:37 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-07-07 16:37 UTC (permalink / raw)
To: AngeloGioacchino Del Regno; +Cc: conor+dt, devicetree, robh
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] GICv3 SPI interrupt trigger type misconfigured as IRQ_TYPE_LEVEL_LOW.
--
--- Patch [4]: [PATCH v2 4/7] arm64: dts: mediatek: mt8186: Add and use UART AP_DMA controller ---
commit b99bac1b2094c2b77703f91408de574bf47c0652
Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
arm64: dts: mediatek: mt8186: Add and use UART AP_DMA controller
This commit adds the AP_DMA controller node to the MT8186 device tree. It also
assigns the appropriate transmit and receive DMA channels to the three UART
controllers to increase data transfer efficiency.
> diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi
> --- 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_LOW 0>,
> + <GIC_SPI 377 IRQ_TYPE_LEVEL_LOW 0>,
> + <GIC_SPI 378 IRQ_TYPE_LEVEL_LOW 0>,
> + <GIC_SPI 379 IRQ_TYPE_LEVEL_LOW 0>,
> + <GIC_SPI 380 IRQ_TYPE_LEVEL_LOW 0>,
> + <GIC_SPI 381 IRQ_TYPE_LEVEL_LOW 0>;
^^^^^^^^^^^^^^^^^^
[Severity: High]
Are active-low interrupts supported by the parent controller on this system?
These interrupts are configured as IRQ_TYPE_LEVEL_LOW, but the parent GICv3
controller natively rejects active-low SPIs.
Unlike older MediaTek systems that featured an intermediate sysirq polarity
inverter, won't the GICv3 driver return -EINVAL during request_irq() and fail
to configure the UART DMA channels?
> + clocks = <&infracfg_ao CLK_INFRA_AO_AP_DMA>;
> + #dma-cells = <1>;
> + dma-requests = <6>;
> + };
> +
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707154841.198870-1-angelogioacchino.delregno@collabora.com?part=4
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 7/7] arm64: dts: mediatek: mt8195: Add and use UART AP_DMA controller
2026-07-07 15:48 ` [PATCH v2 7/7] arm64: dts: mediatek: mt8195: " AngeloGioacchino Del Regno
@ 2026-07-07 16:54 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-07-07 16:54 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:
- [Low] The `apdma` node is placed out of order in the device tree file, violating the standard DT convention to sort nodes by their unit-address.
--
--- Patch [7]: [PATCH v2 7/7] arm64: dts: mediatek: mt8195: Add and use UART AP_DMA controller ---
commit a44a999701bce2338fffbb489d98050bb65e6842
Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
arm64: dts: mediatek: mt8195: Add and use UART AP_DMA controller
This commit adds the AP_DMA controller to the MT8195 device tree to provide
transmit and receive DMA channels for the SoC's UART controllers. The UART
nodes are updated to use these DMA channels for increased efficiency.
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
> --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
> @@ -877,6 +877,31 @@ systimer: timer@10017000 {
> clocks = <&clk13m>;
> };
>
> + apdma: dma-controller@10220880 {
> + compatible = "mediatek,mt8195-uart-dma", "mediatek,mt6835-uart-dma";
> + reg = <0 0x10220880 0 0x80>, <0 0x10220900 0 0x80>,
[ ... ]
> + #dma-cells = <1>;
> + dma-requests = <12>;
> + };
> +
> pwrap: pwrap@10024000 {
[Severity: Low]
This isn't a bug, but should the apdma node be placed further down the file
to maintain standard Device Tree unit-address sorting? The node is at unit
address 10220880, but it is inserted here before pwrap at 10024000.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707154841.198870-1-angelogioacchino.delregno@collabora.com?part=7
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-07-07 16:54 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 15:48 [PATCH v2 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller AngeloGioacchino Del Regno
2026-07-07 16:16 ` sashiko-bot
2026-07-07 15:48 ` [PATCH v2 3/7] arm64: dts: mediatek: mt8183: " AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 4/7] arm64: dts: mediatek: mt8186: " AngeloGioacchino Del Regno
2026-07-07 16:37 ` sashiko-bot
2026-07-07 15:48 ` [PATCH v2 5/7] arm64: dts: mediatek: mt8188: " AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 6/7] arm64: dts: mediatek: mt8192: " AngeloGioacchino Del Regno
2026-07-07 15:48 ` [PATCH v2 7/7] arm64: dts: mediatek: mt8195: " AngeloGioacchino Del Regno
2026-07-07 16:54 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox