[PATCH 1/3] dt-bindings: dma: mediatek,uart-dma: drop mediatek,dma-33bits property

Max Shevchenko via B4 Relay posted 3 patches 1 week, 3 days ago
[PATCH 1/3] dt-bindings: dma: mediatek,uart-dma: drop mediatek,dma-33bits property
Posted by Max Shevchenko via B4 Relay 1 week, 3 days ago
From: Max Shevchenko <wctrl@proton.me>

Many newer SoCs support more than 33 bits for DMA.
Drop the property in order to switch to the platform data.

The reference SoCs were taken from the downstream kernel (6.6) for
the MT6991 SoC.

Signed-off-by: Max Shevchenko <wctrl@proton.me>
---
 Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml b/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
index dab468a88942d694525aa391f695c44d192f0c42..9dfdfe81af7edbe3540e4b757547a5d5e6ae810c 100644
--- a/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
+++ b/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
@@ -22,12 +22,14 @@ properties:
       - items:
           - enum:
               - mediatek,mt2712-uart-dma
-              - mediatek,mt6795-uart-dma
               - mediatek,mt8365-uart-dma
               - mediatek,mt8516-uart-dma
           - const: mediatek,mt6577-uart-dma
       - enum:
-          - mediatek,mt6577-uart-dma
+          - mediatek,mt6577-uart-dma  # 32 bits
+          - mediatek,mt6795-uart-dma  # 33 bits
+          - mediatek,mt6779-uart-dma  # 34 bits
+          - mediatek,mt6985-uart-dma  # 35 bits
 
   reg:
     minItems: 1
@@ -56,10 +58,6 @@ properties:
       Number of virtual channels of the UART APDMA controller
     maximum: 16
 
-  mediatek,dma-33bits:
-    type: boolean
-    description: Enable 33-bits UART APDMA support
-
 required:
   - compatible
   - reg
@@ -116,7 +114,6 @@ examples:
             dma-requests = <12>;
             clocks = <&pericfg CLK_PERI_AP_DMA>;
             clock-names = "apdma";
-            mediatek,dma-33bits;
             #dma-cells = <1>;
         };
     };

-- 
2.51.0
Re: [PATCH 1/3] dt-bindings: dma: mediatek,uart-dma: drop mediatek,dma-33bits property
Posted by Rob Herring 1 week, 2 days ago
On Sun, Sep 21, 2025 at 02:03:40PM +0300, Max Shevchenko wrote:
> Many newer SoCs support more than 33 bits for DMA.
> Drop the property in order to switch to the platform data.
> 
> The reference SoCs were taken from the downstream kernel (6.6) for
> the MT6991 SoC.
> 
> Signed-off-by: Max Shevchenko <wctrl@proton.me>
> ---
>  Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml b/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
> index dab468a88942d694525aa391f695c44d192f0c42..9dfdfe81af7edbe3540e4b757547a5d5e6ae810c 100644
> --- a/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
> +++ b/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
> @@ -22,12 +22,14 @@ properties:
>        - items:
>            - enum:
>                - mediatek,mt2712-uart-dma
> -              - mediatek,mt6795-uart-dma
>                - mediatek,mt8365-uart-dma
>                - mediatek,mt8516-uart-dma
>            - const: mediatek,mt6577-uart-dma
>        - enum:
> -          - mediatek,mt6577-uart-dma
> +          - mediatek,mt6577-uart-dma  # 32 bits
> +          - mediatek,mt6795-uart-dma  # 33 bits

Unless all existing s/w supported mediatek,mt6795-uart-dma, you just 
broke this platform which was relying on the fallback compatible. 

> +          - mediatek,mt6779-uart-dma  # 34 bits
> +          - mediatek,mt6985-uart-dma  # 35 bits
>  
>    reg:
>      minItems: 1
> @@ -56,10 +58,6 @@ properties:
>        Number of virtual channels of the UART APDMA controller
>      maximum: 16
>  
> -  mediatek,dma-33bits:
> -    type: boolean
> -    description: Enable 33-bits UART APDMA support

If this is in use, you need to mark it 'deprecated' instead.

> -
>  required:
>    - compatible
>    - reg
> @@ -116,7 +114,6 @@ examples:
>              dma-requests = <12>;
>              clocks = <&pericfg CLK_PERI_AP_DMA>;
>              clock-names = "apdma";
> -            mediatek,dma-33bits;
>              #dma-cells = <1>;
>          };
>      };
> 
> -- 
> 2.51.0
>
Re: [PATCH 1/3] dt-bindings: dma: mediatek,uart-dma: drop mediatek,dma-33bits property
Posted by Max Shevchenko 1 week, 1 day ago
On Monday, September 22nd, 2025 at 11:47 PM, Rob Herring <robh@kernel.org> wrote:

> On Sun, Sep 21, 2025 at 02:03:40PM +0300, Max Shevchenko wrote:
> 
> > Many newer SoCs support more than 33 bits for DMA.
> > Drop the property in order to switch to the platform data.
> > 
> > The reference SoCs were taken from the downstream kernel (6.6) for
> > the MT6991 SoC.
> > 
> > Signed-off-by: Max Shevchenko wctrl@proton.me
> > ---
> > Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml | 11 ++++-------
> > 1 file changed, 4 insertions(+), 7 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml b/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
> > index dab468a88942d694525aa391f695c44d192f0c42..9dfdfe81af7edbe3540e4b757547a5d5e6ae810c 100644
> > --- a/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
> > +++ b/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
> > @@ -22,12 +22,14 @@ properties:
> > - items:
> > - enum:
> > - mediatek,mt2712-uart-dma
> > - - mediatek,mt6795-uart-dma
> > - mediatek,mt8365-uart-dma
> > - mediatek,mt8516-uart-dma
> > - const: mediatek,mt6577-uart-dma
> > - enum:
> > - - mediatek,mt6577-uart-dma
> > + - mediatek,mt6577-uart-dma # 32 bits
> > + - mediatek,mt6795-uart-dma # 33 bits
> 
> 
> Unless all existing s/w supported mediatek,mt6795-uart-dma, you just
> broke this platform which was relying on the fallback compatible.
> 


As of v6.17-rc6 and linux-next 20250922, the only user of the
mediatek,mt6795-uart-dma compatible is the MT6795 itself, which also
uses the mediatek,dma-33bits property. The second patch makes driver
to set the DMA bitmask based on the compatible.
Therefore I don't think it breaks the platform.

> > + - mediatek,mt6779-uart-dma # 34 bits
> > + - mediatek,mt6985-uart-dma # 35 bits
> > 
> > reg:
> > minItems: 1
> > @@ -56,10 +58,6 @@ properties:
> > Number of virtual channels of the UART APDMA controller
> > maximum: 16
> > 
> > - mediatek,dma-33bits:
> > - type: boolean
> > - description: Enable 33-bits UART APDMA support
> 
> 
> If this is in use, you need to mark it 'deprecated' instead.
> 


The same question here, third patch removes this property from its
sole user. Does it actually need to be marked as deprecated and
not deleted?

> > -
> > required:
> > - compatible
> > - reg
> > @@ -116,7 +114,6 @@ examples:
> > dma-requests = <12>;
> > clocks = <&pericfg CLK_PERI_AP_DMA>;
> > clock-names = "apdma";
> > - mediatek,dma-33bits;
> > #dma-cells = <1>;
> > };
> > };
> > 
> > --
> > 2.51.0

Sincerely,
Max