From patchwork Sat Jul 30 14:26:27 2022 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: 12932996 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15974C04A68 for ; Sat, 30 Jul 2022 14:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jZl3kfvtndNnZlRvIG3JAXK0CCW3SdqjoFFvV6GY350=; b=F8cTEvPeZHpIFp 3EJzz6AkLV4upGoG+d5LCY1s2Tu6cyLPzeD+NCMLuNxIZEcJBMvSbfbtwTU9/+ZxxCGnXSgNAsO3v dy/JHhOIPKdyEDVkVfZyU0sfJyJFMuokc/PdgNtTPLfX63voXcJyLliDy2zVkY/53Iz8bpq97gwvP ZfSO8tY/bKIIRwmC7azyzG9Gi5hnqcRAKEZBOsF3xWz4MzYv75RcGkoZ3HcidblUC/VF0LZzTSMvv Fc4+qCC7uYVDx5DEiYI6GrR0vUTL+bup9qZBCzB3946qHN/pwE/7jJyDETqJrsrzUhOCtKXbuxHBD XAJbw5PGN4/Q6PubfEQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oHnSF-001Uwt-6i; Sat, 30 Jul 2022 14:28:35 +0000 Received: from sender4-op-o14.zoho.com ([136.143.188.14]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oHnRM-001UOk-F7; Sat, 30 Jul 2022 14:27:42 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1659191238; cv=none; d=zohomail.com; s=zohoarc; b=f03rhROaXVDtoGcqF8PH7ku5ZvTJvzwMVAgWIY+C021f5wTuX8u+RKDk3J+bm02SAZ+/qCPR1+yhTBLfdpAYxVxxsbxABjaZDO4VPlcSOBy3gm5l9i/QvpAv9IkG5UqfxvuGqsD+O3SB31Tf/wIn5WiYbT1WJcdq6FtJaRHrt/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659191238; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=pqvQ2aweDe3c5fU2tkE7jlk+Hh/ZhCL0vQoiicn2OoQ=; b=LjI9BeZjVvn1rrbqJ7mdj+ITZCRjVoaODl/3t7VC0FrwglaMu5eeZFXeClxPaHPIgfrpeY/ezKXfciE616QLPjzALT7uJPMiAYe+YtnVDpFMdUrmLY95TV8DlyDy6LJX4H/0t3swgnnnNpy8/fGtcahtVQsUocZtDXPMHOFmWxU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=arinc9.com; spf=pass smtp.mailfrom=arinc.unal@arinc9.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1659191238; s=zmail; d=arinc9.com; i=arinc.unal@arinc9.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Reply-To; bh=pqvQ2aweDe3c5fU2tkE7jlk+Hh/ZhCL0vQoiicn2OoQ=; b=cSKhbQ3NvpHKGn1b29U8XmOYEpfGOl9XM9kAWUiS2PA+VH4a06NJhaxQXknTusuQ yydjSZTWU8JEuHoA0hOHE657c2+Mz134PBkTVPhSugq9JUPzKSBuKTUsyPYQjHafFdI Ccvip/JEGxnf2kge0GQJzK2JfyrVTZc1diusZ2G4= Received: from arinc9-PC.lan (37.120.152.236 [37.120.152.236]) by mx.zohomail.com with SMTPS id 1659191236549576.702841552793; Sat, 30 Jul 2022 07:27:16 -0700 (PDT) From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Sean Wang , Landen Chao , DENG Qingfang , Frank Wunderlich , Luiz Angelo Daros de Luca , Sander Vanheule , =?utf-8?q?Ren=C3=A9_van_Dorst?= , Daniel Golle , erkin.bozoglu@xeront.com, Sergio Paracuellos Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= Subject: [PATCH 4/4] dt-bindings: net: dsa: mediatek,mt7530: update json-schema Date: Sat, 30 Jul 2022 17:26:27 +0300 Message-Id: <20220730142627.29028-5-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220730142627.29028-1-arinc.unal@arinc9.com> References: <20220730142627.29028-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-ZohoMailClient: External X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220730_072740_608625_FD9907AB X-CRM114-Status: UNSURE ( 9.68 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Update the json-schema for compatible devices. - Define acceptable phy-mode values for CPU port of each compatible device. - Remove requiring the "reg" property since the referred dsa-port.yaml already does that. - Require mediatek,mcm for the described MT7621 SoCs as the compatible string is only used for MT7530 which is a part of the multi-chip module. Signed-off-by: Arınç ÜNAL --- .../bindings/net/dsa/mediatek,mt7530.yaml | 220 +++++++++++++++--- 1 file changed, 191 insertions(+), 29 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index a88e650e910b..a37a14fba9f6 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -135,35 +135,6 @@ properties: the ethsys. maxItems: 1 -patternProperties: - "^(ethernet-)?ports$": - type: object - - patternProperties: - "^(ethernet-)?port@[0-9]+$": - type: object - description: Ethernet switch ports - - unevaluatedProperties: false - - properties: - reg: - description: - Port address described must be 5 or 6 for CPU port and from 0 - to 5 for user ports. - - allOf: - - $ref: dsa-port.yaml# - - if: - properties: - label: - items: - - const: cpu - then: - required: - - reg - - phy-mode - required: - compatible - reg @@ -187,10 +158,201 @@ allOf: items: - const: mediatek,mt7530 then: + patternProperties: + "^(ethernet-)?ports$": + type: object + + patternProperties: + "^(ethernet-)?port@[0-9]+$": + type: object + description: Ethernet switch ports + + unevaluatedProperties: false + + properties: + reg: + description: + Port address described must be 5 or 6 for CPU port and from + 0 to 5 for user ports. + + allOf: + - $ref: dsa-port.yaml# + - if: + properties: + label: + items: + - const: cpu + then: + allOf: + - if: + properties: + reg: + const: 5 + then: + properties: + phy-mode: + enum: + - gmii + - mii + - rgmii + + - if: + properties: + reg: + const: 6 + then: + properties: + phy-mode: + enum: + - rgmii + - trgmii + + properties: + reg: + enum: + - 5 + - 6 + + required: + - phy-mode + required: - core-supply - io-supply + - if: + properties: + compatible: + items: + - const: mediatek,mt7531 + then: + patternProperties: + "^(ethernet-)?ports$": + type: object + + patternProperties: + "^(ethernet-)?port@[0-9]+$": + type: object + description: Ethernet switch ports + + unevaluatedProperties: false + + properties: + reg: + description: + Port address described must be 5 or 6 for CPU port and from + 0 to 5 for user ports. + + allOf: + - $ref: dsa-port.yaml# + - if: + properties: + label: + items: + - const: cpu + then: + allOf: + - if: + properties: + reg: + const: 5 + then: + properties: + phy-mode: + enum: + - 1000base-x + - 2500base-x + - rgmii + - sgmii + + - if: + properties: + reg: + const: 6 + then: + properties: + phy-mode: + enum: + - 1000base-x + - 2500base-x + - sgmii + + properties: + reg: + enum: + - 5 + - 6 + + required: + - phy-mode + + - if: + properties: + compatible: + items: + - const: mediatek,mt7621 + then: + patternProperties: + "^(ethernet-)?ports$": + type: object + + patternProperties: + "^(ethernet-)?port@[0-9]+$": + type: object + description: Ethernet switch ports + + unevaluatedProperties: false + + properties: + reg: + description: + Port address described must be 5 or 6 for CPU port and from + 0 to 5 for user ports. + + allOf: + - $ref: dsa-port.yaml# + - if: + properties: + label: + items: + - const: cpu + then: + allOf: + - if: + properties: + reg: + const: 5 + then: + properties: + phy-mode: + enum: + - gmii + - mii + - rgmii + + - if: + properties: + reg: + const: 6 + then: + properties: + phy-mode: + enum: + - rgmii + - trgmii + + properties: + reg: + enum: + - 5 + - 6 + + required: + - phy-mode + + required: + - mediatek,mcm + unevaluatedProperties: false examples: