* [PATCH 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property
2026-07-01 12:19 [PATCH 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
@ 2026-07-01 12:19 ` AngeloGioacchino Del Regno
2026-07-01 12:19 ` [PATCH 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-01 12:19 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 dcbb7495835c..2d3db0c6fcf5 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -548,8 +548,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>,
@@ -569,7 +568,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 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
2026-07-01 12:19 [PATCH 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
2026-07-01 12:19 ` [PATCH 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property AngeloGioacchino Del Regno
@ 2026-07-01 12:19 ` AngeloGioacchino Del Regno
2026-07-01 12:35 ` sashiko-bot
2026-07-01 12:19 ` [PATCH 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-01 12:19 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 81ddb4eec48e..43159ae6da8f 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 100 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* Re: [PATCH 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
2026-07-01 12:19 ` [PATCH 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller AngeloGioacchino Del Regno
@ 2026-07-01 12:35 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-07-01 12:35 UTC (permalink / raw)
To: AngeloGioacchino Del Regno; +Cc: conor+dt, robh, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Duplicate interrupt assignment (GIC_SPI 100) in the `apdma` node breaks UART3 RX DMA channel allocation.
--
commit bbd069e5de2e64963276afa1f5a62fd9508627a3
Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
This commit adds the AP_DMA controller to the devicetree for mt8173 and
assigns the correct transmit and receive DMA channels to each of the four
UART controllers.
> diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> index 78c2ccd5be132..345098359aa58 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 100 IRQ_TYPE_LEVEL_LOW>;
[Severity: Medium]
Is this intentional to reuse GIC_SPI 100 here? The 8th interrupt in this list
(for UART3 RX, channel 7) duplicates the 6th interrupt (UART2 RX, channel 5).
If the driver requests these IRQs without IRQF_SHARED, requesting the same
IRQ again for UART3 RX could fail with -EBUSY and prevent DMA initialization
for that channel. Should this be GIC_SPI 102 instead?
> + clocks = <&pericfg CLK_PERI_AP_DMA>;
> + #dma-cells = <1>;
> + dma-requests = <8>;
> + };
> +
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260701121929.19374-1-angelogioacchino.delregno@collabora.com?part=2
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 3/7] arm64: dts: mediatek: mt8183: Add and use UART AP_DMA controller
2026-07-01 12:19 [PATCH 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
2026-07-01 12:19 ` [PATCH 1/7] arm64: dts: mediatek: mt6795: Remove deprecated UART DMA property AngeloGioacchino Del Regno
2026-07-01 12:19 ` [PATCH 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller AngeloGioacchino Del Regno
@ 2026-07-01 12:19 ` AngeloGioacchino Del Regno
2026-07-01 12:19 ` [PATCH 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-01 12:19 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 174aa8175ad6..6faaccbba580 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
@@ -1059,6 +1059,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";
@@ -1076,6 +1092,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";
};
@@ -1086,6 +1104,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";
};
@@ -1096,6 +1116,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 4/7] arm64: dts: mediatek: mt8186: Add and use UART AP_DMA controller
2026-07-01 12:19 [PATCH 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (2 preceding siblings ...)
2026-07-01 12:19 ` [PATCH 3/7] arm64: dts: mediatek: mt8183: " AngeloGioacchino Del Regno
@ 2026-07-01 12:19 ` AngeloGioacchino Del Regno
2026-07-01 12:49 ` sashiko-bot
2026-07-01 12:19 ` [PATCH 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-01 12:19 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 3fa85185e2c8..3784c1f38620 100644
--- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi
@@ -1134,6 +1134,22 @@ systimer: timer@10017000 {
clocks = <&clk13m>;
};
+ apdma: dma-controller@10200d80 {
+ compatible = "mediatek,mt8186-uart-dma", "mediatek,mt6577-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>,
+ <GIC_SPI 377 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 378 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 379 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 380 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 381 IRQ_TYPE_LEVEL_LOW>;
+ 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>;
@@ -1210,6 +1226,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";
};
@@ -1220,6 +1238,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";
};
@@ -1474,6 +1494,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* Re: [PATCH 4/7] arm64: dts: mediatek: mt8186: Add and use UART AP_DMA controller
2026-07-01 12:19 ` [PATCH 4/7] arm64: dts: mediatek: mt8186: " AngeloGioacchino Del Regno
@ 2026-07-01 12:49 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-07-01 12:49 UTC (permalink / raw)
To: AngeloGioacchino Del Regno; +Cc: robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The `apdma` node provides an incorrect number of cells in its `interrupts` property (3 instead of 4) and likely incorrect polarity, breaking DT parsing and interrupt registration.
- [Medium] Incorrect fallback compatible string `mediatek,mt6577-uart-dma` violates the DT binding schema and silently restricts DMA capabilities to 32 bits.
--
commit 9cc7e542a995507ace5b082f09a644dd3e616c00
Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
arm64: dts: mediatek: mt8186: Add and use UART AP_DMA controller
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.
This commit adds the UART DMA controller and assigns the right channels to each
of the three UART controllers to increase data TX/RX efficiency.
> diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi
> index b91f88ffae0e8..7b25c51b1b457 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,mt6577-uart-dma";
[Severity: Medium]
Does this fallback compatible string restrict the DMA bitmask?
According to the mediatek,uart-dma.yaml binding, mediatek,mt8186-uart-dma
should fall back to mediatek,mt6835-uart-dma.
Because the mtk-uart-apdma driver uses the matched compatible string to
configure the DMA mask, falling back to mt6577 restricts the controller
to 32 bits instead of the 34 bits provided by mt6835.
Could using mt6577-uart-dma here force hardware with more than 4GB of RAM
to use SWIOTLB bounce buffering for UART DMA transfers?
> + 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>,
> + <GIC_SPI 377 IRQ_TYPE_LEVEL_LOW>,
> + <GIC_SPI 378 IRQ_TYPE_LEVEL_LOW>,
> + <GIC_SPI 379 IRQ_TYPE_LEVEL_LOW>,
> + <GIC_SPI 380 IRQ_TYPE_LEVEL_LOW>,
> + <GIC_SPI 381 IRQ_TYPE_LEVEL_LOW>;
[Severity: High]
Are these interrupts missing the 4th cell?
The root interrupt controller (&gic) requires 4 cells (#interrupt-cells = <4>),
but only 3 cells are provided here for each interrupt.
The missing 4th cell will cause parsing to consume parts of the next
interrupt as the 4th cell of the current one, corrupting the entire
interrupt mapping for this device.
Additionally, GIC SPIs on MT8186 are almost exclusively active-high
(IRQ_TYPE_LEVEL_HIGH). Is IRQ_TYPE_LEVEL_LOW functionally correct for
this controller?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260701121929.19374-1-angelogioacchino.delregno@collabora.com?part=4
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 5/7] arm64: dts: mediatek: mt8188: Add and use UART AP_DMA controller
2026-07-01 12:19 [PATCH 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (3 preceding siblings ...)
2026-07-01 12:19 ` [PATCH 4/7] arm64: dts: mediatek: mt8186: " AngeloGioacchino Del Regno
@ 2026-07-01 12:19 ` AngeloGioacchino Del Regno
2026-07-01 12:57 ` sashiko-bot
2026-07-01 12:19 ` [PATCH 6/7] arm64: dts: mediatek: mt8192: " AngeloGioacchino Del Regno
2026-07-01 12:19 ` [PATCH 7/7] arm64: dts: mediatek: mt8195: " AngeloGioacchino Del Regno
6 siblings, 1 reply; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-01 12:19 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 abf443e34112..cdc549f6c0b4 100644
--- a/arch/arm64/boot/dts/mediatek/mt8188.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8188.dtsi
@@ -1319,6 +1319,31 @@ systimer: timer@10017000 {
clocks = <&clk13m>;
};
+ 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>;
+ };
+
pwrap: pwrap@10024000 {
compatible = "mediatek,mt8188-pwrap", "mediatek,mt8195-pwrap", "syscon";
reg = <0 0x10024000 0 0x1000>;
@@ -1493,6 +1518,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";
};
@@ -1502,6 +1529,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";
};
@@ -1511,6 +1540,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";
};
@@ -1520,6 +1551,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* Re: [PATCH 5/7] arm64: dts: mediatek: mt8188: Add and use UART AP_DMA controller
2026-07-01 12:19 ` [PATCH 5/7] arm64: dts: mediatek: mt8188: " AngeloGioacchino Del Regno
@ 2026-07-01 12:57 ` sashiko-bot
0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-07-01 12:57 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:
- [Low] The apdma device node is placed out of order based on its unit-address.
--
commit abad4b5e77dac5657d316ab360e0ca880d69701b
Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
arm64: dts: mediatek: mt8188: Add and use UART AP_DMA controller
This commit adds the UART DMA controller (AP_DMA) to the MT8188 SoC.
It also assigns the respective DMA channels to the four UART controllers
to improve data transmission and reception efficiency.
> diff --git a/arch/arm64/boot/dts/mediatek/mt8188.dtsi b/arch/arm64/boot/dts/mediatek/mt8188.dtsi
> index 75133794cec38..8f01d95e6d7d9 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8188.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8188.dtsi
> @@ -1338,6 +1338,31 @@ systimer: timer@10017000 {
> clocks = <&clk13m>;
> };
>
> + apdma: dma-controller@10220880 {
[Severity: Low]
This isn't a bug, but should this node be placed further down in the file
to maintain ascending unit-address order?
The unit-address 10220880 is placed here after timer@10017000 but before
pwrap@10024000 (shown below), which breaks the numerical sorting convention
for Device Tree nodes.
> + compatible = "mediatek,mt8188-uart-dma", "mediatek,mt6835-uart-dma";
[ ... ]
> + #dma-cells = <1>;
> + dma-requests = <12>;
> + };
> +
> pwrap: pwrap@10024000 {
> compatible = "mediatek,mt8188-pwrap", "mediatek,mt8195-pwrap", "syscon";
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260701121929.19374-1-angelogioacchino.delregno@collabora.com?part=5
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 6/7] arm64: dts: mediatek: mt8192: Add and use UART AP_DMA controller
2026-07-01 12:19 [PATCH 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (4 preceding siblings ...)
2026-07-01 12:19 ` [PATCH 5/7] arm64: dts: mediatek: mt8188: " AngeloGioacchino Del Regno
@ 2026-07-01 12:19 ` AngeloGioacchino Del Regno
2026-07-01 12:19 ` [PATCH 7/7] arm64: dts: mediatek: mt8195: " AngeloGioacchino Del Regno
6 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-01 12:19 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 465567c3be54..d05a5ac61534 100644
--- a/arch/arm64/boot/dts/mediatek/mt8192.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8192.dtsi
@@ -732,6 +732,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>;
@@ -756,6 +769,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";
};
@@ -766,6 +781,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 7/7] arm64: dts: mediatek: mt8195: Add and use UART AP_DMA controller
2026-07-01 12:19 [PATCH 0/7] dts: Add and use UART AP_DMA controller on MTK SoCs AngeloGioacchino Del Regno
` (5 preceding siblings ...)
2026-07-01 12:19 ` [PATCH 6/7] arm64: dts: mediatek: mt8192: " AngeloGioacchino Del Regno
@ 2026-07-01 12:19 ` AngeloGioacchino Del Regno
6 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-07-01 12:19 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 c4d400cd7638..9bec9011d0c9 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
@@ -865,6 +865,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>;
@@ -1028,6 +1053,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";
};
@@ -1038,6 +1065,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";
};
@@ -1048,6 +1077,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";
};
@@ -1058,6 +1089,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";
};
@@ -1068,6 +1101,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";
};
@@ -1078,6 +1113,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