From patchwork Sat Dec 10 03:30:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13070230 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 4BFABC4332F for ; Sat, 10 Dec 2022 03:35:45 +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=RGwqSJwMf4J6Ws5zpdOvOqRnf3Vl7AfF+h+K0au4gCc=; b=QqWqGLq0/28z4A e0M5t39r0fxy19u6J6QZht5/Mf/cgkD4tTQz3WoaA1R57KqE88wvfXL0gdoVD1AR7abTooLWSdwc6 BrEQq+5pn88l2BdoRKnhR/h6wlM8FyX/JeR+gLckgHa1ijJnArzcBT8XJ4d3Ef/BGlpPpbpXdEuCw nNp8I8sryto0lsE+gnK5UwodBWqNXs9mCHosdZxq/XMRPb+MgntXX7Jumri5l00xOMNzC5pw4Wdcy gonhCs8v+jEBA+/MN2otOeg9o+Wl9z2YuzOvtfx1J9vTgiomVJVFlb1bZsK2GvFcqso+DU+l2BBf3 i1wrs0iNWCyXZPCpBLdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3qd5-00DqrE-5i; Sat, 10 Dec 2022 03:34:23 +0000 Received: from mail-dm6nam11on2114.outbound.protection.outlook.com ([40.107.223.114] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3qZz-00DpXH-DR; Sat, 10 Dec 2022 03:31:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F/p6fTO7OIGpIe2iA4pbInJ+zs5VyRG/oLEJH7h8SMnWY42K9CVQu764WLtJ0CRimVHwxM17kFoX1h9DyMBE0LX7bphu5CetxS1XF+mJUfc4EvJfVv99EfmGgbKqbfYYJXhUgU8s1SDnlS8jGIalFKfOqwa++KYijkE0SX8nt7a4b3oaXBSXjnvgP68nImCfhf8QlqFrrV07JMfqA1DLXoiNHkSO5kDWay000m/aTiT5U4uABO1FntS08H2qEsrPol+xpnfU/doyNPaVKCi50vjKSyXKCfIRE2yRykobXiVkIaaWUjgpdhfFFLUM4EciXrD0oKk+UzLiEnI7iQMJ7g== 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=Q5hNntqGzN9rH0fjC8DcpkCZvtk9WSt9ek01aV71mT8=; b=VPtVqYU8NjqDiN9JaCgVE7hdqH+gpnTxuWxG2tEuolcTmfv7r42MFqcD4es3UaVJL/QS8BMIAM7ATwqRc78hfYS+7awRgOVH8r33rZYK2FKG6tUD4/NcfbY9+mN0H+Rp7kgK6Y5/d1QdOxw9+cKpqHC4EZYlVeR3oIQN6KloniqhevoBpCkekVYXCzvD6YFE4U8xZ3AUt2ZA4msxq5b0yHXzeR1k2CZ+h8KZsT3c5HDRHRMW5uaYvkJ/CufFlIh7cFZ/LV0l1fKpgMizOF4mnsvLjwXl/jhDYeCgGYInv0KbyMGA9e0ehDdlvVS9/xBLlhtgIxgXF11rsHe5mf1oaA== 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=Q5hNntqGzN9rH0fjC8DcpkCZvtk9WSt9ek01aV71mT8=; b=hJFXO1NJSmL7Vv9kia0NubWX5RhQHAWIenbtfrFuZ1UUNGppxQUZr2nYmhFJyMzNSIgFUO9KjrTRoi11z76iPVCLpic8afi4V9AB5MRKzloxA8MQwDFzgKxUE33GpBduCm6nWqjx+gE5hiLLUTTXzoqQTTgtMqUMogr7ANiLFOY= 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 SA2PR10MB4779.namprd10.prod.outlook.com (2603:10b6:806:11f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Sat, 10 Dec 2022 03:31:06 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::45b5:a860:9cea:a74c]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::45b5:a860:9cea:a74c%4]) with mapi id 15.20.5880.014; Sat, 10 Dec 2022 03:31:06 +0000 From: Colin Foster To: linux-renesas-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org Cc: John Crispin , Alexandre Belloni , Claudiu Manoil , Marek Vasut , Sean Wang , DENG Qingfang , Landen Chao , =?utf-8?b?bsOnIMOcTkFM?= , Vivien Didelot , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , =?utf-8?q?Alv?= =?utf-8?q?in_=C5=A0ipraga?= , Linus Walleij , UNGLinuxDriver@microchip.com, Woojung Huh , Matthias Brugger , Kurt Kanzenbach , Krzysztof Kozlowski , Rob Herring , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Vladimir Oltean , Florian Fainelli , Andrew Lunn , George McCollister , Rob Herring Subject: [PATCH v5 net-next 08/10] dt-bindings: net: add generic ethernet-switch Date: Fri, 9 Dec 2022 19:30:31 -0800 Message-Id: <20221210033033.662553-9-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221210033033.662553-1-colin.foster@in-advantage.com> References: <20221210033033.662553-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BY5PR13CA0002.namprd13.prod.outlook.com (2603:10b6:a03:180::15) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|SA2PR10MB4779:EE_ X-MS-Office365-Filtering-Correlation-Id: fcb39849-5549-4407-0e7f-08dada5ef8ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EIxvGSBe0xtBdKNA7ZI26EejtJtHTJWSUqmco/0Dfn9VqGN14JXaHM/4fKXFFHCdRHv1VWGxYC5kZ7ObFgNU/T8D04WP54mUJil/Wl/zs+ZbDNdutZBFMMvLS3XIP8sLE5lfXrzCfF/VsKXqi65rSKb9w5foWmiukmwbYhI/XGgbKCEoQtY7wOULxBRPj+W/o4Umd7MAKX4+sNLgST48mbdnBwkbm7HVClZwQlAmSOcQb7ILeUNZG6E3tSvstU90CD9L5IznxEmF7O+YX4Hh4uoBKoBEyk1912TGROP5tiBc5FksmnsVgCOmjIQJK7ZjU6MSdlyRfjQ+gUKPk8QMZSfreAYZ3Co0H8hUw5mKKSQ+3/P4+LFORyt3dXOMmTuAm1RJhMf3oWs9nbPQfoz9oWcHaS6zCVOIQJHEmq/jDcYy1zmrhNJJQ5PaXyCOctPzf0qOtNUNcPro3D51Tgugtx59dJLrEEyk3QmgSs+v6cjRrFKGk8mT7u22jWBE6BW1L1oUZWRjcMCpreAzZ8RQA7x1GXv+nZKhZI13WOtg/Dc97gK2H2AgzekkZz4oUOO/MK5fp8/hB+V446ecEZx0fEOA1E3W2FQxsC1K1nqoxXBKSvbcoznqWvh527UJS/0+3GWed0pj7r4gZ59WjaPmQHG/lp97lJWFmJUgMC24V6NtlapcMRlYLLcNaQECvEWFSooiSGTx0MUYMh6L4gNO0ymj232xMzLWaVt6Tl6k3Grv7jdYuFGBstVUaV4mYM9a 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)(39840400004)(136003)(366004)(376002)(346002)(396003)(451199015)(6486002)(966005)(478600001)(52116002)(2906002)(6506007)(6666004)(86362001)(36756003)(6512007)(26005)(44832011)(186003)(7406005)(7416002)(8936002)(5660300002)(38100700002)(1076003)(38350700002)(2616005)(4326008)(41300700001)(83380400001)(54906003)(66476007)(66556008)(8676002)(66946007)(316002)(41533002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YL1xNeTLduoFr5UQyGviGC29Smd/6HacrWuUPdMK9mpNtrGXgTWuAl34ev6PNxbB9DjM5rzxpYB/HsZEXGDDklIerAlCBGmJxXJ0eFK/Dmwr0OSrw5dX02d2TvND7jPddA2Rm8PBoWK/5tNRJvNDjNGacvWye3vOY0s4bR5X+CShDpO2ET7Qrp+HToHemhcs/Y9e2oF+LQIkEae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C+4cK+nZM4M9pSLIzGn7SLFjbFSku/UB3T5ixswmATukPoXWD+dI9MV6uSpbh5599+Thdxw002ZfeejCZ/fXFKJ05HbNcSPrRmVBxRce54CLY5wGhbulG+BcahzFon9pSBbb3z06cAcaq3I8qzQ9eRF2MLdxJRejbIyYLaP7ZjFbxFdyYGqSbJH07YVRE1G2B9nX9N6BU2Klv5kthhDCeqXk4l1JnxtTjtqc9hAyxdtdE83dFs4UJGRPh6i25KkGgI5tTFWwThaZXCB26wWT8tnKmsRGYkAlItcMAB/YxO+gmqVt0G6rjVFos8kPR3OQjf++1cLGzqk5LroFlt1j3xf5dZ5WKCMkCkIYWCtG6c= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcb39849-5549-4407-0e7f-08dada5ef8ec X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2022 03:31:06.6065 (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: h/VWv1x0QMaJ1tMyH5sP1AnCbxCSKjT0fJvjxTsFCo4e6DO+1mNuAEkIQzAkSXke6O9S7FR3F49Eb076ol9VUqjv9MErva9WIUE14mtJ/DE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4779 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_193111_501274_06706DDC X-CRM114-Status: GOOD ( 15.47 ) 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 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 Reviewed-by: Florian Fainelli Reviewed-by: Rob Herring Reviewed-by: Vladimir Oltean --- v4 -> v5 * Add Rob Reviewed tag * Remove "^(ethernet-)?switch(@.*)?$" from dsa.yaml in this patch, instead of dt-bindings: net: dsa: allow additional ethernet-port properties * Change Vivien to Vladimir to sync with MAINTAINERS * Remove quotes around ref: /schemas/net/ethernet-switch.yaml# v3 -> v4 * Update ethernet-ports and ethernet-port nodes to match what the new dsa.yaml has. Namely: "unevaluatedProperties: false" instead of "additionalProperties: true" "additionalProperties: true" instead of "unevaluatedProperties: true" for ethernet-ports and ethernet-port, respectively. * Add Florian Reviewed tag v2 -> v3 * Change ethernet-switch.yaml title from "Ethernet Switch Device Tree Bindings" to "Generic Ethernet Switch" * Rework ethernet-switch.yaml description * Add base defs structure for switches that don't have any additional properties. * Add "additionalProperties: true" under "^(ethernet-)?ports$" node * Correct port reference from /schemas/net/dsa/dsa-port.yaml# to ethernet-controller.yaml# 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 | 31 +-------- .../bindings/net/ethernet-switch.yaml | 66 +++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 69 insertions(+), 29 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 98a79be3bffe..4a90168b15b7 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml @@ -18,10 +18,9 @@ description: select: false -properties: - $nodename: - pattern: "^(ethernet-)?switch(@.*)?$" +$ref: /schemas/net/ethernet-switch.yaml# +properties: dsa,member: minItems: 2 maxItems: 2 @@ -32,32 +31,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 - - unevaluatedProperties: false - - patternProperties: - "^(ethernet-)?port@[0-9]+$": - type: object - description: Ethernet switch ports - - $ref: dsa-port.yaml# - - additionalProperties: true - -oneOf: - - required: - - ports - - required: - - ethernet-ports - additionalProperties: true $defs: diff --git a/Documentation/devicetree/bindings/net/ethernet-switch.yaml b/Documentation/devicetree/bindings/net/ethernet-switch.yaml new file mode 100644 index 000000000000..2466d05f9a6f --- /dev/null +++ b/Documentation/devicetree/bindings/net/ethernet-switch.yaml @@ -0,0 +1,66 @@ +# 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: Generic Ethernet Switch + +maintainers: + - Andrew Lunn + - Florian Fainelli + - Vladimir Oltean + +description: + Ethernet switches are multi-port Ethernet controllers. Each port has + its own number and is represented as its own Ethernet controller. + The minimum required functionality is to pass packets to software. + They may or may not be able to forward packets automonously between + ports. + +select: false + +properties: + $nodename: + pattern: "^(ethernet-)?switch(@.*)?$" + +patternProperties: + "^(ethernet-)?ports$": + type: object + unevaluatedProperties: false + + properties: + '#address-cells': + const: 1 + '#size-cells': + const: 0 + + patternProperties: + "^(ethernet-)?port@[0-9]+$": + type: object + description: Ethernet switch ports + + $ref: ethernet-controller.yaml# + + additionalProperties: true + +oneOf: + - required: + - ports + - required: + - ethernet-ports + +additionalProperties: true + +$defs: + base: + description: An ethernet switch without any extra port properties + $ref: '#/' + + patternProperties: + "^(ethernet-)?port@[0-9]+$": + description: Ethernet switch ports + $ref: ethernet-controller.yaml# + unevaluatedProperties: false + +... diff --git a/MAINTAINERS b/MAINTAINERS index 52aeb86c1167..d574cae901b3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14337,6 +14337,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