From patchwork Sun Sep 17 12:47:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13388561 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBD2D33FA; Sun, 17 Sep 2023 12:48:12 +0000 (UTC) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74C32D9; Sun, 17 Sep 2023 05:48:10 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5CAA4C0002; Sun, 17 Sep 2023 12:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1694954889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AAozQf5veG9fcNRrq+yazpmSWFWK3c8BmsCcPtHQ9n8=; b=aqoyFajfqCCla3hh1RxRwP5PcE9fy9aHZJE+JpUZ7sksitMubsP93Qeh602LvI1QYeN2DZ xekhyIyxJHykKbeT+Udfu6Jl+T4UUgdWc+M5fNYVrcfdEkS52xDCPy3TRAXBu77GZTcoJC Va7kFC6lu1wTP7wIZpiM+0z1qk+7nEohD+9moSLnv2/MAsM18sVwdwmjc6oTTCEit8HPdJ Kb6CrP8kLzUvG3+H8cZe3F0ufLEbxcNDMsIrCPIPl122Y9ghUP45FmFV3KWNU3GrBmM3YQ rrfo45y4X4yaXHTdbDo+24Bd7rdUCTvW4b9oPjmQfAueZrmxIqcW6x+oaK9uMA== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: =?unknown-8bit?q?=22David_S=2E_Miller=22_=3Cdavem=40davemloft=2Enet=3E?= =?unknown-8bit?q?=2C_Eric_Dumazet_=3Cedumazet=40google=2Ecom=3E=2C_Jakub_Ki?= =?unknown-8bit?q?cinski_=3Ckuba=40kernel=2Eorg=3E=2C_Paolo_Abeni_=3Cpabeni?= =?unknown-8bit?q?=40redhat=2Ecom=3E=2C_Rob_Herring_=3Crobh+dt=40kernel=2Eor?= =?unknown-8bit?q?g=3E=2C_Krzysztof_Kozlowski_=3Ckrzysztof=2Ekozlowski+dt=40?= =?unknown-8bit?q?linaro=2Eorg=3E=2C_Conor_Dooley_=3Cconor+dt=40kernel=2Eorg?= =?unknown-8bit?q?=3E=2C_Matthias_Brugger_=3Cmatthias=2Ebgg=40gmail=2Ecom=3E?= =?unknown-8bit?q?=2C_AngeloGioacchino_Del_Regno_=3Cangelogioacchino=2Edelre?= =?unknown-8bit?q?gno=40collabora=2Ecom=3E=2C_=B1n=C3=A7_=C3=9CNAL__=3Carinc?= =?unknown-8bit?q?=2Eunal=40arinc9=2Ecom=3E=2C_Lorenzo_Bianconi_=3Clorenzo?= =?unknown-8bit?q?=40kernel=2Eorg=3E=2C_Felix_Fietkau_=3Cnbd=40nbd=2Ename=3E?= =?unknown-8bit?q?=2C_Daniel_Golle_=3Cdaniel=40makrotopia=2Eorg=3E?= Cc: Krzysztof Kozlowski , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next 2/2] dt-bindings: net: mediatek,net: move mediatek,mt7621-eth to another schema Date: Sun, 17 Sep 2023 15:47:23 +0300 Message-Id: <20230917124723.143202-2-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230917124723.143202-1-arinc.unal@arinc9.com> References: <20230917124723.143202-1-arinc.unal@arinc9.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org The bindings for mediatek,mt7621-eth contradict with some of the rules on the top level schema of mediatek,net.yaml: - resets must be two items. resets with "maxItems: 3" at the top level implies "minItems: 3" and cannot be overriden under a subschema. - reset-names items must be "fe" and "eth". reset-names items defined on the top level schema cannot be overridden under a subschema. Therefore, move mediatek,mt7621-eth to another schema. Fix the order of clock-names items. Do not define the properties that don't apply to this hardware. Require more properties. Add an example. Fixes: 1cbf487d7d3a ("dt-bindings: net: mediatek,net: add missing mediatek,mt7621-eth") Signed-off-by: Arınç ÜNAL --- .../bindings/net/mediatek,mt7621-eth.yaml | 143 ++++++++++++++++++ .../devicetree/bindings/net/mediatek,net.yaml | 27 ---- 2 files changed, 143 insertions(+), 27 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/mediatek,mt7621-eth.yaml diff --git a/Documentation/devicetree/bindings/net/mediatek,mt7621-eth.yaml b/Documentation/devicetree/bindings/net/mediatek,mt7621-eth.yaml new file mode 100644 index 000000000000..4f39d7124693 --- /dev/null +++ b/Documentation/devicetree/bindings/net/mediatek,mt7621-eth.yaml @@ -0,0 +1,143 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/mediatek,mt7621-eth.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MT7621 Frame Engine Ethernet controller + +maintainers: + - Arınç ÜNAL + +description: + The frame engine ethernet controller can be found on MediaTek MT7621 SoC. This + SoC has got dual GMAC ports. + +properties: + compatible: + const: mediatek,mt7621-eth + + reg: + maxItems: 1 + + clocks: + maxItems: 2 + + clock-names: + items: + - const: fe + - const: ethif + + interrupts: + maxItems: 1 + + resets: + maxItems: 2 + + reset-names: + items: + - const: fe + - const: eth + + mediatek,ethsys: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the syscon node that handles the port setup. + + mdio-bus: + $ref: mdio.yaml# + unevaluatedProperties: false + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +patternProperties: + "^mac@[0-1]$": + type: object + unevaluatedProperties: false + allOf: + - $ref: ethernet-controller.yaml# + description: + Ethernet MAC node + properties: + compatible: + const: mediatek,eth-mac + + reg: + maxItems: 1 + + required: + - reg + - compatible + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - resets + - reset-names + - mediatek,ethsys + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + + soc { + #address-cells = <1>; + #size-cells = <1>; + + ethernet: ethernet@1e100000 { + compatible = "mediatek,mt7621-eth"; + reg = <0x1e100000 0x10000>; + + clocks = <&sysc MT7621_CLK_FE>, <&sysc MT7621_CLK_ETH>; + clock-names = "fe", "ethif"; + + #address-cells = <1>; + #size-cells = <0>; + + resets = <&sysc MT7621_RST_FE>, <&sysc MT7621_RST_ETH>; + reset-names = "fe", "eth"; + + interrupt-parent = <&gic>; + interrupts = ; + + mediatek,ethsys = <&sysc>; + + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>, <&rgmii2_pins>; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "rgmii"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "rgmii"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/net/mediatek,net.yaml b/Documentation/devicetree/bindings/net/mediatek,net.yaml index 0b2cb1897310..dc6f2424002e 100644 --- a/Documentation/devicetree/bindings/net/mediatek,net.yaml +++ b/Documentation/devicetree/bindings/net/mediatek,net.yaml @@ -19,7 +19,6 @@ properties: enum: - mediatek,mt2701-eth - mediatek,mt7623-eth - - mediatek,mt7621-eth - mediatek,mt7622-eth - mediatek,mt7629-eth - mediatek,mt7981-eth @@ -140,32 +139,6 @@ allOf: mediatek,wed-pcie: false - - if: - properties: - compatible: - contains: - enum: - - mediatek,mt7621-eth - then: - properties: - interrupts: - maxItems: 1 - - clocks: - minItems: 2 - maxItems: 2 - - clock-names: - items: - - const: ethif - - const: fe - - mediatek,infracfg: false - - mediatek,wed: false - - mediatek,wed-pcie: false - - if: properties: compatible: