From 29712b437339bf9ae36affa6b922340b059cd153 Mon Sep 17 00:00:00 2001 From: Frank Wunderlich Date: Wed, 9 Jul 2025 13:09:37 +0200 Subject: [PATCH 1/6] dt-bindings: net: mediatek,net: update mac subnode pattern for mt7988 MT7888 have 3 Macs and so its nodes have names from mac0 - mac2. Update pattern to fix this. Signed-off-by: Frank Wunderlich Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20250709111147.11843-2-linux@fw-web.de Signed-off-by: Jakub Kicinski --- Documentation/devicetree/bindings/net/mediatek,net.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/mediatek,net.yaml b/Documentation/devicetree/bindings/net/mediatek,net.yaml index 9e02fd80af83..175d1d011dc6 100644 --- a/Documentation/devicetree/bindings/net/mediatek,net.yaml +++ b/Documentation/devicetree/bindings/net/mediatek,net.yaml @@ -382,7 +382,7 @@ allOf: - const: xgp3 patternProperties: - "^mac@[0-1]$": + "^mac@[0-2]$": type: object unevaluatedProperties: false allOf: From 356dea0baf4c0903ac188bf18e8ff1af0866c930 Mon Sep 17 00:00:00 2001 From: Frank Wunderlich Date: Wed, 9 Jul 2025 13:09:38 +0200 Subject: [PATCH 2/6] dt-bindings: net: mediatek,net: allow up to 8 IRQs Increase the maximum IRQ count to 8 (4 FE + 4 RSS/LRO). Frame-engine-IRQs (max 4): MT7621, MT7628: 1 FE-IRQ MT7622, MT7623: 3 FE-IRQs (only two used by the driver for now) MT7981, MT7986, MT7988: 4 FE-IRQs (only two used by the driver for now) Mediatek Filogic SoCs (mt798x) have 4 additional IRQs for RSS and/or LRO. So MT798x have 8 IRQs in total. MT7981 does not have a ethernet-node yet. MT7986 Ethernet node is updated with RSS/LRO IRQs in this series. MT7988 Ethernet node is added in this series. Signed-off-by: Frank Wunderlich Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20250709111147.11843-3-linux@fw-web.de Signed-off-by: Jakub Kicinski --- .../devicetree/bindings/net/mediatek,net.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/net/mediatek,net.yaml b/Documentation/devicetree/bindings/net/mediatek,net.yaml index 175d1d011dc6..99dc0401eb9a 100644 --- a/Documentation/devicetree/bindings/net/mediatek,net.yaml +++ b/Documentation/devicetree/bindings/net/mediatek,net.yaml @@ -40,7 +40,7 @@ properties: interrupts: minItems: 1 - maxItems: 4 + maxItems: 8 power-domains: maxItems: 1 @@ -272,7 +272,7 @@ allOf: then: properties: interrupts: - minItems: 4 + minItems: 8 clocks: minItems: 15 @@ -310,7 +310,7 @@ allOf: then: properties: interrupts: - minItems: 4 + minItems: 8 clocks: minItems: 15 @@ -348,7 +348,7 @@ allOf: then: properties: interrupts: - minItems: 4 + minItems: 8 clocks: minItems: 24 @@ -507,7 +507,11 @@ examples: interrupts = , , , - ; + , + , + , + , + ; clocks = <ðsys CLK_ETH_FE_EN>, <ðsys CLK_ETH_GP2_EN>, <ðsys CLK_ETH_GP1_EN>, From 23ac2a71bdbd5d12616d46f276b7a7a06e74a8c3 Mon Sep 17 00:00:00 2001 From: Frank Wunderlich Date: Wed, 9 Jul 2025 13:09:39 +0200 Subject: [PATCH 3/6] dt-bindings: net: mediatek,net: allow irq names In preparation for MT7988 and RSS/LRO allow the interrupt-names property. In this way driver can request the interrupts by name which is much more readable in the driver code and SoC's dtsi than relying on a specific order. Frame-engine-IRQs (fe0..3): MT7621, MT7628: 1 FE-IRQ MT7622, MT7623: 3 FE-IRQs (only two used by the driver for now) MT7981, MT7986: 4 FE-IRQs (only two used by the driver for now) RSS/LRO IRQs (pdma0..3) additional only on Filogic (MT798x) with count of 4. So all IRQ-names (8) for Filogic. Set boundaries for all compatibles same as irq count. Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20250709111147.11843-4-linux@fw-web.de Signed-off-by: Jakub Kicinski --- .../devicetree/bindings/net/mediatek,net.yaml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Documentation/devicetree/bindings/net/mediatek,net.yaml b/Documentation/devicetree/bindings/net/mediatek,net.yaml index 99dc0401eb9a..d2b5461e73bc 100644 --- a/Documentation/devicetree/bindings/net/mediatek,net.yaml +++ b/Documentation/devicetree/bindings/net/mediatek,net.yaml @@ -42,6 +42,18 @@ properties: minItems: 1 maxItems: 8 + interrupt-names: + minItems: 1 + items: + - const: fe0 + - const: fe1 + - const: fe2 + - const: fe3 + - const: pdma0 + - const: pdma1 + - const: pdma2 + - const: pdma3 + power-domains: maxItems: 1 @@ -135,6 +147,10 @@ allOf: minItems: 3 maxItems: 3 + interrupt-names: + minItems: 3 + maxItems: 3 + clocks: minItems: 4 maxItems: 4 @@ -166,6 +182,9 @@ allOf: interrupts: maxItems: 1 + interrupt-names: + maxItems: 1 + clocks: minItems: 2 maxItems: 2 @@ -192,6 +211,10 @@ allOf: minItems: 3 maxItems: 3 + interrupt-names: + minItems: 3 + maxItems: 3 + clocks: minItems: 11 maxItems: 11 @@ -232,6 +255,10 @@ allOf: minItems: 3 maxItems: 3 + interrupt-names: + minItems: 3 + maxItems: 3 + clocks: minItems: 17 maxItems: 17 @@ -274,6 +301,9 @@ allOf: interrupts: minItems: 8 + interrupt-names: + minItems: 8 + clocks: minItems: 15 maxItems: 15 @@ -312,6 +342,9 @@ allOf: interrupts: minItems: 8 + interrupt-names: + minItems: 8 + clocks: minItems: 15 maxItems: 15 @@ -350,6 +383,9 @@ allOf: interrupts: minItems: 8 + interrupt-names: + minItems: 8 + clocks: minItems: 24 maxItems: 24 From c4582a31efd92ea74ecf75c727443a167dfe0577 Mon Sep 17 00:00:00 2001 From: Frank Wunderlich Date: Wed, 9 Jul 2025 13:09:40 +0200 Subject: [PATCH 4/6] dt-bindings: net: mediatek,net: add sram property Meditak Filogic SoCs (MT798x) have dedicated MMIO-SRAM for dma operations. MT7981 and MT7986 currently use static offset to ethernet MAC register which will be changed in separate patch once this way is accepted. Add "sram" property to map ethernet controller to dedicated mmio-sram node. Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20250709111147.11843-5-linux@fw-web.de Signed-off-by: Jakub Kicinski --- .../devicetree/bindings/net/mediatek,net.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/net/mediatek,net.yaml b/Documentation/devicetree/bindings/net/mediatek,net.yaml index d2b5461e73bc..b45f67f92e80 100644 --- a/Documentation/devicetree/bindings/net/mediatek,net.yaml +++ b/Documentation/devicetree/bindings/net/mediatek,net.yaml @@ -66,6 +66,10 @@ properties: - const: gmac - const: ppe + sram: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to mmio SRAM + mediatek,ethsys: $ref: /schemas/types.yaml#/definitions/phandle description: @@ -162,6 +166,8 @@ allOf: - const: gp1 - const: gp2 + sram: false + mediatek,infracfg: false mediatek,wed: false @@ -194,6 +200,8 @@ allOf: - const: ethif - const: fe + sram: false + mediatek,infracfg: false mediatek,wed: false @@ -233,6 +241,8 @@ allOf: - const: sgmii_ck - const: eth2pll + sram: false + mediatek,infracfg: false mediatek,sgmiisys: @@ -283,6 +293,8 @@ allOf: - const: sgmii_ck - const: eth2pll + sram: false + mediatek,sgmiisys: minItems: 2 maxItems: 2 From 588cb646ce709770d31f8dc0d2f63e8f86763a9d Mon Sep 17 00:00:00 2001 From: Frank Wunderlich Date: Wed, 9 Jul 2025 13:09:41 +0200 Subject: [PATCH 5/6] dt-bindings: net: dsa: mediatek,mt7530: add dsa-port definition for mt7988 Add own dsa-port binding for SoC with internal switch where only phy-mode 'internal' is valid. Signed-off-by: Frank Wunderlich Reviewed-by: Rob Herring (Arm) Reviewed-by: AngeloGioacchino Del Regno Link: https://patch.msgid.link/20250709111147.11843-6-linux@fw-web.de Signed-off-by: Jakub Kicinski --- .../bindings/net/dsa/mediatek,mt7530.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index 51205f9f2985..9b983fdbf3c7 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -190,6 +190,18 @@ required: - reg $defs: + builtin-dsa-port: + patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-6]$": + if: + required: [ ethernet ] + then: + properties: + phy-mode: + const: internal + mt7530-dsa-port: patternProperties: "^(ethernet-)?ports$": @@ -297,7 +309,7 @@ allOf: - airoha,en7581-switch - airoha,an7583-switch then: - $ref: "#/$defs/mt7530-dsa-port" + $ref: "#/$defs/builtin-dsa-port" properties: gpio-controller: false mediatek,mcm: false From 66a44adf4c3db082cfccd82679004346a66d1ea8 Mon Sep 17 00:00:00 2001 From: Frank Wunderlich Date: Wed, 9 Jul 2025 13:09:42 +0200 Subject: [PATCH 6/6] dt-bindings: net: dsa: mediatek,mt7530: add internal mdio bus Mt7988 buildin switch has own mdio bus where ge-phys are connected. Add related property for this. Signed-off-by: Frank Wunderlich Reviewed-by: Rob Herring (Arm) Reviewed-by: AngeloGioacchino Del Regno Link: https://patch.msgid.link/20250709111147.11843-7-linux@fw-web.de Signed-off-by: Jakub Kicinski --- .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index 9b983fdbf3c7..815a90808901 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -136,6 +136,16 @@ properties: See Documentation/devicetree/bindings/regulator/mt6323-regulator.txt for details for the regulator setup on these boards. + mdio: + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + + properties: + mediatek,pio: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle pointing to the mediatek pinctrl node. + mediatek,mcm: type: boolean description: