From patchwork Fri Nov 4 04:52:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13031323 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 08B60C4332F for ; Fri, 4 Nov 2022 04:53:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding: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=/QeUpcagE4U7c3tJwHU5yxD9l68Pk76ICR1i4PK62OI=; b=cB21AQtlLcPB2I/EOyNmoD8ORj i8XZ39L1QfAomES/H975PVwObYXzV3UsYmrhm7eCRX/UABLpXmrsEHFDCdE9mnLAf1e8TYiGdhiAp pnNmWN9pZlEnJeb8He4ciLmu6vmh7oqTdTh2XtkhawN8gaPC0DxgbOcpsmLPmytMBcnDi8W2JqCZc LB0g5VagwH9mCU1VulMEXtafkVPpl/OxxPaClF7B6JU2NBuLG7PazDDoptIspljv5xO/yGLYoigkV ZjwYOOvFZjpeV71BxaywFHML2eL5EGmzJP1na83Eenm1XAwae4vvbLC+lsf+p4712vEE0UTC61jpZ 3/kgA5Dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqohX-002MTy-Ui; Fri, 04 Nov 2022 04:53:07 +0000 Received: from mail-dm6nam11on2106.outbound.protection.outlook.com ([40.107.223.106] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqogv-002MBx-IG; Fri, 04 Nov 2022 04:52:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OBD+HO+FZgio9DX1z6fnKnz5hKLFZUbCppbWTDZQEgSH439fQrNcIEphwrqzL6hApDtBNWgOGBksSWoL49M2l8QTuEJiqvgvFJi1jBx+ICkAl9w/rZ8vTbRXNMBLK7ixE+8KmjfXToXxfmpm0KJH5vCOAazVaWIlitNp3PW5UEOzq5zYmVpPIT4nwJZgkOHUyMqxtrbLvzXkgcoD+UPBCqPutUTBfplgqnorcBjx4AeYUhkgRVCZHL4ghlhs/vMhf/0Q8y8nmZ0nPSYzejlUjC3tKDotDy+XjGVAiMQ6wbURagtGZcPY2/xC6tMDfc1A5TT9biRMCaKRhTE+6Ysdgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/QeUpcagE4U7c3tJwHU5yxD9l68Pk76ICR1i4PK62OI=; b=T4eYUumTgVbEVErvO15ReNA992LPC6RnSOzZNo2y/4d1RzEDmymT3C3ef9Iu9NZUnLEkVt0C1H+SkxP3AXJJ/IrlHyTDrbUnT2GzI77spBs6mm0d7Bw/8oCk565vJDuvzYNNeUFq9uJNnxK6zQF3R3MBEzQKq/xAgnyg8TTds3dw0zrPARg4ZHF+7yYjaY1iHXu4B3fHxSUlnwsZsf7r4Ci9bPpS7dNWCdWQxz0ZF0DxdaRiMXsS7OflzZXXitr7eKvJWthMxprt5GAqNJykd5HJmFC9cbJ4C6+4TpMa1Jejlf5/E2kIVCC2BLD4HMBk/AykXgeue/N06uBtuqtB6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/QeUpcagE4U7c3tJwHU5yxD9l68Pk76ICR1i4PK62OI=; b=UjMqPW22AtjxYYdzMi72zAEN7rMNAt0GHmiTMRVCXtzurwCGxEIihPpLjH0HbFjm4vApOyj7kX48Fi79mW0EDeYQZ7mJUnnyVRgRjUgw0AUpe8RrdY8LplhqYoI8RV77CC/zHu/ugmfE0iI1R5yRrCISZLMFHOkPIvcMYRwZBog= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by CY5PR10MB5986.namprd10.prod.outlook.com (2603:10b6:930:2a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.22; Fri, 4 Nov 2022 04:52:22 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::a8ed:4de9:679e:9d36]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::a8ed:4de9:679e:9d36%4]) with mapi id 15.20.5769.021; Fri, 4 Nov 2022 04:52:22 +0000 From: Colin Foster To: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Alexandre Belloni , Claudiu Manoil , John Crispin , Sean Wang , DENG Qingfang , Landen Chao , =?utf-8?b?bsOnIMOcTkFM?= , Matthias Brugger , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Vladimir Oltean , Florian Fainelli , Vivien Didelot , Andrew Lunn , Krzysztof Kozlowski , Rob Herring Subject: [PATCH v2 net-next 4/6] dt-bindings: net: add generic ethernet-switch Date: Thu, 3 Nov 2022 21:52:02 -0700 Message-Id: <20221104045204.746124-5-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104045204.746124-1-colin.foster@in-advantage.com> References: <20221104045204.746124-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BY3PR03CA0023.namprd03.prod.outlook.com (2603:10b6:a03:39a::28) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|CY5PR10MB5986:EE_ X-MS-Office365-Filtering-Correlation-Id: ed85f2a9-c88b-4ee7-2af1-08dabe205c41 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E0qSz/3ojZg5M7txnKp/D2H+5zbvIqWtz8DX4PA4TNzDXpFQW3YmAG5O5MEB4mmupzJIdbb93UbyAoRNhYlc224brHUl8uvLCcQMiAOhrVtfvmbXvGnLMPmo4PGwTT98pkvLwm8rIM8IjBIvG6wDlCmmORV4k5kcxi7BNiRhqA++JV4/C16J84hkc8Fn+tpvdIruwUFZYomCPC6ds0QfS0HLRvtmHU1FFaPG3MEvzf0SHYRW9EuMjjj5AgYfa0GIQnpIifKSYpBPFuzHOZERnMHje3N1XSvWC7d68JIHYiDEWaJz04U5om2saMwMWMEIXK63p9UdGSMuRkG1dt3sp4H2pF5P1yH5b4g4i4dDxD1nRHV1MoMCsQvKzRaqXZ0hEbDO0zw9mTAhlCifACgqdeuDtgsm+ygseikU4BDXsJZKDkfoWzps9w2gEAOayQlkU2k+SMcDih7TE8GKwFp2nAaM2kIp3WKfsMBfIUNM1JLlKgRI8kIaRzA6+RqnDyMApBKuXdcCyaaoO/sXjRY2K9N2LkJlyIsGero3nV256hm8eQk0M2UUY0LSRvrbHJ4LdXVNoW0hXnPrYyndkV3/rokPu2CyynBw5FViX4rUiPruv+e5WFV97w89DVPgM+YOpfxwj0Vh5YFz36H6Qz39pqXdMMJg9Sja2NQNWPWyhSaD9BBTETuwc7sm4LHEWsehgEnsQOFrktLszXd8+xC2Ol7BoDUMvgKr9MFNdzZkOAzF9u2h35OvWaN7EjvlLahUtRL8dmG5yqaZrc6MxXA5Vd4McV41cD/2HDiAGUROueUbflucEbjCJW3Y7nhfeh7B X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(376002)(346002)(396003)(136003)(39840400004)(366004)(451199015)(86362001)(36756003)(316002)(38350700002)(38100700002)(6666004)(8676002)(2616005)(6506007)(66946007)(478600001)(966005)(54906003)(52116002)(66476007)(44832011)(6486002)(2906002)(5660300002)(7416002)(186003)(8936002)(4326008)(6512007)(83380400001)(1076003)(66556008)(26005)(41300700001)(41533002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JwDSzjujt2hglYCF18xtLp/leaeZs+WU3+lH3oIyI6/RbM4golN/ved55rwWNoin7wQxdPY7w2xgalxZhzA38W5BPkEPKtoxXJmrxWLgMD5CkhHGgqsHTxOaaM/4Rx064ta84A+8KwEFBi26yRDdMlGVHFhnIS1eRJSUHfYXT6HQnJh3BQ2LcITuUyar998SyWDQ3zXE05RpBR3ZxV/KnJNmoTd9O3phP86K3ufvQxHNze0XtApE2u2v+NIehl4EK848+6/KkktrYQA9qanuCTJGnaBpimi2fcIutU/8wcIEKYysnDhEQLHihpvWYVvnXnw7o1AIjp6lO36GhgDIEJHtT0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2YzvclWOPNcxqtTM9jFttkIutZgE0JJUIjDCDQLvaw7MU66iGQkrbxsQjv7qxJv1DfNa8Xm91Arh9vHTI7lK4yHhk4E3zG7F1dWj7IU5vX/3ukWuHO7vZzfUj/DpWcR7s2aM0LDk2xfqYAOk6jy/ictGgIze6a36gQw1SL8fI2VEccWfwlDm1r2VWBGGTrDyR8pv0qASu79d58o= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed85f2a9-c88b-4ee7-2af1-08dabe205c41 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2022 04:52:22.4695 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UqMmY1dEalStqZNG7yplUfnfhHegZOT71b/EgxpRJ0ioGFQqzJMrz8VHjVKEe1cE652ukuPSkh6qUd0UZnUvv9pE+5lhsXsaZJh3qXw9T48= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB5986 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221103_215229_637328_DEF4EB9C X-CRM114-Status: GOOD ( 14.92 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The dsa.yaml bindings had references that can apply to non-dsa switches. To prevent duplication of this information, keep the dsa-specific information inside dsa.yaml and move the remaining generic information to the newly created ethernet-switch.yaml. Signed-off-by: Colin Foster Suggested-by: Vladimir Oltean --- v1 -> v2 * No net change, but deletions from dsa.yaml included the changes for "addionalProperties: true" under ports and "unevaluatedProperties: true" under port. --- .../devicetree/bindings/net/dsa/dsa.yaml | 28 +---------- .../bindings/net/ethernet-switch.yaml | 49 +++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 52 insertions(+), 26 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/ethernet-switch.yaml diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml index af9010c4f069..2290a9d32b21 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml @@ -18,6 +18,8 @@ description: select: false +$ref: "/schemas/net/ethernet-switch.yaml#" + properties: $nodename: pattern: "^(ethernet-)?switch(@.*)?$" @@ -32,32 +34,6 @@ properties: (single device hanging off a CPU port) must not specify this property $ref: /schemas/types.yaml#/definitions/uint32-array -patternProperties: - "^(ethernet-)?ports$": - type: object - properties: - '#address-cells': - const: 1 - '#size-cells': - const: 0 - - additionalProperties: true - - patternProperties: - "^(ethernet-)?port@[0-9]+$": - type: object - description: Ethernet switch ports - - $ref: dsa-port.yaml# - - unevaluatedProperties: true - -oneOf: - - required: - - ports - - required: - - ethernet-ports - additionalProperties: true ... diff --git a/Documentation/devicetree/bindings/net/ethernet-switch.yaml b/Documentation/devicetree/bindings/net/ethernet-switch.yaml new file mode 100644 index 000000000000..fbaac536673d --- /dev/null +++ b/Documentation/devicetree/bindings/net/ethernet-switch.yaml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/ethernet-switch.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ethernet Switch Device Tree Bindings + +maintainers: + - Andrew Lunn + - Florian Fainelli + - Vivien Didelot + +description: + This binding represents Ethernet Switches which have a dedicated CPU + port. That port is usually connected to an Ethernet Controller of the + SoC. Such setups are typical for embedded devices. + +select: false + +properties: + $nodename: + pattern: "^(ethernet-)?switch(@.*)?$" + +patternProperties: + "^(ethernet-)?ports$": + type: object + properties: + '#address-cells': + const: 1 + '#size-cells': + const: 0 + + patternProperties: + "^(ethernet-)?port@[0-9]+$": + type: object + description: Ethernet switch ports + + $ref: /schemas/net/dsa/dsa-port.yaml# + +oneOf: + - required: + - ports + - required: + - ethernet-ports + +additionalProperties: true + +... diff --git a/MAINTAINERS b/MAINTAINERS index 3106a9f0567a..3b6c3989c419 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14326,6 +14326,7 @@ M: Florian Fainelli M: Vladimir Oltean S: Maintained F: Documentation/devicetree/bindings/net/dsa/ +F: Documentation/devicetree/bindings/net/ethernet-switch.yaml F: drivers/net/dsa/ F: include/linux/dsa/ F: include/linux/platform_data/dsa.h