[v5,net-next,04/10] dt-bindings: net: dsa: utilize base definitions for standard dsa switches
Message ID | 20221210033033.662553-5-colin.foster@in-advantage.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1119724wrr; Fri, 9 Dec 2022 19:33:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf4EuXoEa/uzZg0vXGox26L59Z1q45z16nxRGXFHZjTGPo7Tx8IMI/SJykw69hSh58a5lRVq X-Received: by 2002:a05:6402:3906:b0:461:79d8:f51a with SMTP id fe6-20020a056402390600b0046179d8f51amr7018964edb.10.1670643230378; Fri, 09 Dec 2022 19:33:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670643230; cv=pass; d=google.com; s=arc-20160816; b=1D/THOvLxqyXkkQItKMB1m0M0oi5X+zFAP+nGsAQEW5QVpDNV/TBEnWnZKe9XX5cBn ultl3jM4b9Z7hG/q+PBAxVZNvFvxMdrgSMp5WVaoayGaSGCz7Vcrpp9bB/uE0jKz4xiF Fwr+ugZOSBh2zVepBJL7kDautVzs3SNhVfmqEI2gzvfZu433hcc8oaIRVAnN+rD45FdN W0m0hd8tKOe1tSp4oe5bHwyVaxxsi31jijoClY+Gs04NdY5sgJ4EdM8cadeMY0WO3Yfy HGa4bSPjBVzrW1Dsah/nJbE2uRhGV663wJqCvgPlenXCstR6uvtysDrGCtS9mgOonC05 NNlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mTbaH0DsX36iDid8qD8cG/g7DcgpzwDTpXFm4J3I05w=; b=j5Nm19RMPgp4Lm8oOedufv22k0FjS3VOCXxadpE+w8EFl8UPn9DliCo5H0aPi2IyrV eEALWDEaS4TPIlXiyJ3s2MDTtWK6WjbS27FlO2FpqxcdKuXU1v/Yo2qBt0V4ga1iTKYa Ea+2nC24JKBM6wq/eIcR9vZIOkN+bpWfvAUhpff0BP23YW8ls6XMUs/lXTsKxyoHar/y hV46NpGfA1hEwWqTjI6Z1FXR3lJHdtlvIQMWk+OqRsihaNfMMRM8QKw+9TmkK6qaLwS7 blSWRVpXS3YHelwxL5xkYptOTYiDFcj3PYtgXDWsH70OGIDvhuwPJI50SKn4HNvfFO/w dtfQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=FM+M1ERX; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eh11-20020a0564020f8b00b004676034f552si2335190edb.45.2022.12.09.19.33.26; Fri, 09 Dec 2022 19:33:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=FM+M1ERX; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229905AbiLJDbW (ORCPT <rfc822;sophiezhao968@gmail.com> + 99 others); Fri, 9 Dec 2022 22:31:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbiLJDbH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 9 Dec 2022 22:31:07 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2101.outbound.protection.outlook.com [40.107.223.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E5AE8C685; Fri, 9 Dec 2022 19:30:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bDVnwCkmyeJ16fXo2BtWkSgch5iUPPSS7n9QSGMq2fokq8OqbAR3fO2hy4U5U+GI2VM3QowtRfRICy+1NLFqIrcafa9De7ib9XL+7qkUET8MA/ub+vTIVOS4Jl1Z/oE7xY+1JOJ4cUtaeIcMI5oSG7dZW9ydRTHmtdDM438lI9c7zTmhNnz2ZtwkB3GrL6JDxdTXwY3rQsyba3cEGTvlS5b1pdUsy/D+uPrmq/SMyhhvX8K3vEsyy2VUoYYDNtQSVGgWi698rBYJTUKBolyNH4ALHPHPH8qI2nD9G/Z8/ZeGCyFb4H28JEA+/k2fvRNRsLzRvitb2j5m5rhak53azg== 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=mTbaH0DsX36iDid8qD8cG/g7DcgpzwDTpXFm4J3I05w=; b=MVZlTuSS/5ry+LPz9TbEglkH6tSjTxL4oT2Nr++u3btG32iyCvWBqyTRntUcNA9EvmPKUFREPVVGPMNs0PCpnvOqxuJxnuS2LmemW6XmTcZVVgegGVvI2NsioXPCZVELvu5gX2CLBT24aPHbXwIOKbHYZKM/Y5bt6XE+71Y5GGm36fb0d04FcH2q8DP+WxVZHU1s7m2VoBmJMq16+5jcUeJvsU4Ihplu2juLSmfiVh05hedlT7xX/dGN3ysuqXS1fYhiuV9D+ad7asBnqsNGoQQAlQZrozoQd80Y8ElmxAUzWN+11McqLUteTcR7M4n8vBkKaYlzY4JWGUfTiUeNVg== 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=mTbaH0DsX36iDid8qD8cG/g7DcgpzwDTpXFm4J3I05w=; b=FM+M1ERXpHJYb6zhu+ooAgTmtG7EINiWsH4B1S4oxiYd2exfikwcGYTMMmWCFrk5Uid3V0vB6M3X+HCIma5fQOniElrP02NHm9Ob1LF46NeHE42dr7xvLwIpCtqLFaEpXNTv1cjRltcIiTyM+NVqvBLUUlFzK6t2p/ID6aMyVgg= 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:30:57 +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:30:57 +0000 From: Colin Foster <colin.foster@in-advantage.com> 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 <john@phrozen.org>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Manoil <claudiu.manoil@nxp.com>, Marek Vasut <marex@denx.de>, Sean Wang <sean.wang@mediatek.com>, DENG Qingfang <dqfext@gmail.com>, Landen Chao <Landen.Chao@mediatek.com>, =?utf-8?b?bsOnIMOcTkFM?= <arinc.unal@arinc9.com>, Vivien Didelot <vivien.didelot@gmail.com>, =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= <clement.leger@bootlin.com>, =?utf-8?q?Alv?= =?utf-8?q?in_=C5=A0ipraga?= <alsi@bang-olufsen.dk>, Linus Walleij <linus.walleij@linaro.org>, UNGLinuxDriver@microchip.com, Woojung Huh <woojung.huh@microchip.com>, Matthias Brugger <matthias.bgg@gmail.com>, Kurt Kanzenbach <kurt@linutronix.de>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Rob Herring <robh+dt@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>, Eric Dumazet <edumazet@google.com>, "David S. Miller" <davem@davemloft.net>, Vladimir Oltean <olteanv@gmail.com>, Florian Fainelli <f.fainelli@gmail.com>, Andrew Lunn <andrew@lunn.ch>, George McCollister <george.mccollister@gmail.com>, Rob Herring <robh@kernel.org> Subject: [PATCH v5 net-next 04/10] dt-bindings: net: dsa: utilize base definitions for standard dsa switches Date: Fri, 9 Dec 2022 19:30:27 -0800 Message-Id: <20221210033033.662553-5-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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: d2c65dba-f780-4f8b-3431-08dada5ef321 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4U/Hw97c+ytos/lWRsVqLB2vqW4U2o5spDT29Q5VYmDWxQyXrY/QeFgX05tGlMHa2pu8w9X/BXyE+FoahtqE9icYmoTQgw9gviaDy8oiTw+V82+nZlf1TuwIIaw6ELWyX0KTmLTlD4+X8vVB0k965QjY59lvWJkfChdknltslHAhCeHcmxy/hEisgt89kN8GdZ/wqngvsfsa28sSjqXSaV+knJ62kidjnt992bxCv2pBc68RTlqKqIA7t174Xblh0NAwEpueuoRuUXVz49d9/WhI0et0cn2zf2pxpugKWFvfRy756z2pDU/6lpcccVRgMP/7v5MZYgeIsVSc+f7TllgSmxI4f68cmK0XPCPsgWlAftjKfolFyK6WDg1PauzMNI7CRrdAZN9+DKQn8+5E3Bk5gn/ThHyJDWdAhEpUoWVuxLZIWjiUNF7hgYK/yW8BNgQnH9VPRaoso3yezrmbZlMC8DGqoSTevGug0zs+t99xIS9q0JJ0hNcrYla5OKAbvUtpCAN+12CYWUotvUp5eECqotpySRhtAeLLQHcUhHrXv3BHwRP6MxaP4zY1RJcVw63EcnDyl9iVmH8WnvgoDlb6AJ0sNBR7+41E00LlGus3U7cPkVaryl2NspD7DWf55IdTr6+AevZZvW7VNkytmhcvBPwLjJWcXOOFn+JFsI7xb8XAGnY4qJXlCi0B4PNT3ijq2Qd+AJy9Vs2W96KwKHlH4UaGzVL80R9fJukGw8c= 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)(136003)(366004)(376002)(346002)(396003)(39830400003)(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);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?CwjHtif8SkffAXrNRSXb1fEYhkoU?= =?utf-8?q?5UgjsoTV8qg8Bkpeg83KsEpn3Wo5L5mOCFWqkP3zCzW+Ge3ucHLScGcnpmUHEnRc4?= =?utf-8?q?h7dnnibkoyzv2/3C5BDzDlNOxGRfImH9dinEGxZhdoeA6CZuUQedRIeU1ROyCptDI?= =?utf-8?q?1pvwLUDiYBVGelOK8h6mLZUE8baLgrdSiPtdJEwNoCq7gfFm8z6SVJcQakhrfRHs1?= =?utf-8?q?0lVuYo78/ed4miuDyJV1AjmmCK1Zuk7eaM1j57DV0YdHCn1y7rxoO7jPiKyo66gj3?= =?utf-8?q?GmnkeuB5zCdBhcDsoEvzGdyemkPS41rXYT8tO52Gwgr9fwedk5yU6PkEm5BPnCPMP?= =?utf-8?q?npPZnK5acn5qYp2tjKuJ9+WCNOBeektG1gaqIMcUquWFG1yX+gV4b/piWkakHA9z/?= =?utf-8?q?8Ttf19arw1/Z5Ri3BoyimdOSEBmWB5tspzDKqAB500YaaTcig0xoaXoEJwHl/YOSF?= =?utf-8?q?M781O5hFmtYMOl4MJAqTsaFYKUTckYtcTYeMzIiphplKpySQ1wSsrZ9h8GBuqO4VW?= =?utf-8?q?ZK4XxPedcR28IodZmyjyl40RQhB5vd1NZ3/ATWzRD9ZKvWb0n7sLPiIRJlUHnmI/5?= =?utf-8?q?YVKUXa9yBkFztChgZcGWZQqv+X60MKQ6ImE27z9yme3oHi8jTdlMhhd8adMAWlAgL?= =?utf-8?q?TRa+PWeHRtXgi9VVdNZm35tguQwF23spk4yaN+9mJZ5rhpk1M6u5uoakMY8vXl52z?= =?utf-8?q?ib0BI7Z75Fu7QU5LLE/ZAOD5pWsGQdlgb9ptFjeU3EoLr8mPWW8M6sjjC9SFUZ1aq?= =?utf-8?q?q06KRoNCLiD70TIPr2ImBswJzGY3tW1w6vmAl938vI2Nob6mB/X+O0/8SVdPqLBDM?= =?utf-8?q?ebt/tJh7fDfZESDDfRchL11jNdZZA3aoh+n3qgaK8dfkxQfQj6pPeZhPR4veo7IGp?= =?utf-8?q?nbO+RtR/STM0XkLke8QaSLoPTueikTuCyrZUvJMZw4kPRy1YFP+MsqZOK2dn7WcAE?= =?utf-8?q?BQKR6Ym2u9xzOn8IOTO9pH+D/x4iTErX6s9YOHzSsUS8PlxmwHKJeIIyIv0ZsNp3V?= =?utf-8?q?aUCoVnhMPJGXlwaRqwNUozQ3/rDYDz8LNAJVPwf6Me38aDOxVVCgOdjdkpZ5ucCz9?= =?utf-8?q?edXEPgJHSha3+7pb1at9ROaoE5JnfGJPbUNgeL388rSFPnWtM/zcAqx2IARBJry5Y?= =?utf-8?q?ssSMzLfR09Jxldgp9ivKSQkBCEu1T/qT7QCHxByXIrbtVnReBlN0UGWo6s4kFKDA3?= =?utf-8?q?PxxWaGqADSST4EB+Cm7i3Mnrljg6f2YsCwSfPvTmC9y/GO17JekJfEty8YfrH80U0?= =?utf-8?q?a9Xw8uRqVnwR/hJrtedzxIdhifOa+HCITeDRn89YJI+1R5Nl6cEbZaAq5lEBiMlWA?= =?utf-8?q?+IQQJEw3biKIufJYWFdeYGlYB7oqmuXnRzwPcxmCt/p5j1jvn75lMqAmCbhIUqBtR?= =?utf-8?q?8EQVJsgMWRYnGLA4D1kyqmyUbNjB9SLI5crqapgGhbxuAlnTz8wOuSlMMgsmW6yrc?= =?utf-8?q?merkHVxVeS/q7qkZTTeA2MPb7E4Tpb3HQAAu8R0CncImVEL8HNWpjT0sGN27uqZio?= =?utf-8?q?Y8HrVRABkHkBfbbU3D4F41gRbV/4CnvJAg=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2c65dba-f780-4f8b-3431-08dada5ef321 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:30:56.8885 (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: xyZlhB8hzN6IFfQaqyz8zYQxueILpbE1H8krTFovvPPYemSvlJ2qhdU/daiUV1vxK2Vb17UmTD+4DEW/TcL6vfgP6KEFb9BM5Us0F7/Ggp0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4779 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751796395970942629?= X-GMAIL-MSGID: =?utf-8?q?1751796395970942629?= |
Series |
dt-binding preparation for ocelot switches
|
|
Commit Message
Colin Foster
Dec. 10, 2022, 3:30 a.m. UTC
DSA switches can fall into one of two categories: switches where all ports follow standard '(ethernet-)?port' properties, and switches that have additional properties for the ports. The scenario where DSA ports are all standardized can be handled by switches with a reference to the new 'dsa.yaml#/$defs/ethernet-ports'. The scenario where DSA ports require additional properties can reference '$dsa.yaml#' directly. This will allow switches to reference these standard definitions of the DSA switch, but add additional properties under the port nodes. Suggested-by: Rob Herring <robh@kernel.org> Signed-off-by: Colin Foster <colin.foster@in-advantage.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Alvin Šipraga <alsi@bang-olufsen.dk> # realtek Acked-by: Arınç ÜNAL <arinc.unal@arinc9.com> --- v4 -> v5 * Add Rob Reviewed, Arınç Acked * Defer the removal of "^(ethernet-)?switch(@.*)?$" in dsa.yaml until a later patch * Undo the move of ethernet switch ports description in mediatek,mt7530.yaml * Fix typos in commit message v3 -> v4 * Rename "$defs/base" to "$defs/ethernet-ports" to avoid implication of a "base class" and fix commit message accordingly * Add the following to the common etherent-ports node: "additionalProperties: false" "#address-cells" property "#size-cells" property * Fix "etherenet-ports@[0-9]+" to correctly be "ethernet-port@[0-9]+" * Remove unnecessary newline * Apply changes to mediatek,mt7530.yaml that were previously in a separate patch * Add Reviewed and Acked tags v3 * New patch --- .../bindings/net/dsa/arrow,xrs700x.yaml | 2 +- .../devicetree/bindings/net/dsa/brcm,b53.yaml | 2 +- .../devicetree/bindings/net/dsa/dsa.yaml | 22 +++++++++++++++++++ .../net/dsa/hirschmann,hellcreek.yaml | 2 +- .../bindings/net/dsa/mediatek,mt7530.yaml | 5 +---- .../bindings/net/dsa/microchip,ksz.yaml | 2 +- .../bindings/net/dsa/microchip,lan937x.yaml | 2 +- .../bindings/net/dsa/mscc,ocelot.yaml | 2 +- .../bindings/net/dsa/nxp,sja1105.yaml | 2 +- .../devicetree/bindings/net/dsa/realtek.yaml | 2 +- .../bindings/net/dsa/renesas,rzn1-a5psw.yaml | 2 +- 11 files changed, 32 insertions(+), 13 deletions(-)
Comments
On 10.12.2022 06:30, Colin Foster wrote: > DSA switches can fall into one of two categories: switches where all ports > follow standard '(ethernet-)?port' properties, and switches that have > additional properties for the ports. > > The scenario where DSA ports are all standardized can be handled by > switches with a reference to the new 'dsa.yaml#/$defs/ethernet-ports'. > > The scenario where DSA ports require additional properties can reference > '$dsa.yaml#' directly. This will allow switches to reference these standard > definitions of the DSA switch, but add additional properties under the port > nodes. > > Suggested-by: Rob Herring <robh@kernel.org> > Signed-off-by: Colin Foster <colin.foster@in-advantage.com> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org> > Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> > Reviewed-by: Rob Herring <robh@kernel.org> > Acked-by: Alvin Šipraga <alsi@bang-olufsen.dk> # realtek > Acked-by: Arınç ÜNAL <arinc.unal@arinc9.com> > --- > > v4 -> v5 > * Add Rob Reviewed, Arınç Acked > * Defer the removal of "^(ethernet-)?switch(@.*)?$" in dsa.yaml until a > later patch > * Undo the move of ethernet switch ports description in mediatek,mt7530.yaml > * Fix typos in commit message > > v3 -> v4 > * Rename "$defs/base" to "$defs/ethernet-ports" to avoid implication of a > "base class" and fix commit message accordingly > * Add the following to the common etherent-ports node: > "additionalProperties: false" > "#address-cells" property > "#size-cells" property > * Fix "etherenet-ports@[0-9]+" to correctly be "ethernet-port@[0-9]+" > * Remove unnecessary newline > * Apply changes to mediatek,mt7530.yaml that were previously in a separate patch > * Add Reviewed and Acked tags > > v3 > * New patch > > --- > .../bindings/net/dsa/arrow,xrs700x.yaml | 2 +- > .../devicetree/bindings/net/dsa/brcm,b53.yaml | 2 +- > .../devicetree/bindings/net/dsa/dsa.yaml | 22 +++++++++++++++++++ > .../net/dsa/hirschmann,hellcreek.yaml | 2 +- > .../bindings/net/dsa/mediatek,mt7530.yaml | 5 +---- > .../bindings/net/dsa/microchip,ksz.yaml | 2 +- > .../bindings/net/dsa/microchip,lan937x.yaml | 2 +- > .../bindings/net/dsa/mscc,ocelot.yaml | 2 +- > .../bindings/net/dsa/nxp,sja1105.yaml | 2 +- > .../devicetree/bindings/net/dsa/realtek.yaml | 2 +- > .../bindings/net/dsa/renesas,rzn1-a5psw.yaml | 2 +- > 11 files changed, 32 insertions(+), 13 deletions(-) > > diff --git a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml > index 259a0c6547f3..5888e3a0169a 100644 > --- a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml > @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# > title: Arrow SpeedChips XRS7000 Series Switch Device Tree Bindings > > allOf: > - - $ref: dsa.yaml# > + - $ref: dsa.yaml#/$defs/ethernet-ports > > maintainers: > - George McCollister <george.mccollister@gmail.com> > diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml > index 1219b830b1a4..5bef4128d175 100644 > --- a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml > @@ -66,7 +66,7 @@ required: > - reg > > allOf: > - - $ref: dsa.yaml# > + - $ref: dsa.yaml#/$defs/ethernet-ports > - if: > properties: > compatible: > diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > index 5efc0ee8edcb..9375cdcfbf96 100644 > --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > @@ -58,4 +58,26 @@ oneOf: > > additionalProperties: true > > +$defs: > + ethernet-ports: > + description: A DSA switch without any extra port properties > + $ref: '#/' > + > + patternProperties: > + "^(ethernet-)?ports$": > + type: object > + additionalProperties: false > + > + properties: > + '#address-cells': > + const: 1 > + '#size-cells': > + const: 0 > + > + patternProperties: > + "^(ethernet-)?port@[0-9]+$": > + description: Ethernet switch ports > + $ref: dsa-port.yaml# > + unevaluatedProperties: false I've got moderate experience in json-schema but shouldn't you put 'type: object' here like you did for "^(ethernet-)?ports$"? > + > ... > diff --git a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml > index 73b774eadd0b..748ef9983ce2 100644 > --- a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml > @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# > title: Hirschmann Hellcreek TSN Switch Device Tree Bindings > > allOf: > - - $ref: dsa.yaml# > + - $ref: dsa.yaml#/$defs/ethernet-ports > > maintainers: > - Andrew Lunn <andrew@lunn.ch> > diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > index f2e9ff3f580b..20312f5d1944 100644 > --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > @@ -157,9 +157,6 @@ patternProperties: > patternProperties: > "^(ethernet-)?port@[0-9]+$": > type: object This line was being removed on the previous version. Must be related to above. > - description: Ethernet switch ports > - > - unevaluatedProperties: false > > properties: > reg: Arınç
Hi Arınç, On Sat, Dec 10, 2022 at 07:24:42PM +0300, Arınç ÜNAL wrote: > On 10.12.2022 06:30, Colin Foster wrote: > > DSA a/Documentation/devicetree/bindings/net/dsa/dsa.yaml > > +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > > @@ -58,4 +58,26 @@ oneOf: > > additionalProperties: true > > +$defs: > > + ethernet-ports: > > + description: A DSA switch without any extra port properties > > + $ref: '#/' > > + > > + patternProperties: > > + "^(ethernet-)?ports$": > > + type: object > > + additionalProperties: false > > + > > + properties: > > + '#address-cells': > > + const: 1 > > + '#size-cells': > > + const: 0 > > + > > + patternProperties: > > + "^(ethernet-)?port@[0-9]+$": > > + description: Ethernet switch ports > > + $ref: dsa-port.yaml# > > + unevaluatedProperties: false > > I've got moderate experience in json-schema but shouldn't you put 'type: > object' here like you did for "^(ethernet-)?ports$"? I can't say for sure, but adding "type: object" here and removing it from mediatek,mt7530.yaml still causes the same issue I mention below. Rob's initial suggestion for this patch set (which was basically the entire implementation... many thanks again Rob) can be found here: https://lore.kernel.org/netdev/20221104200212.GA2315642-robh@kernel.org/ From what I can tell, the omission of "type: object" here was intentional. At the very least, it doesn't seem to have any effect on warnings. > > > + > > ... > > diff --git a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml > > index 73b774eadd0b..748ef9983ce2 100644 > > --- a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml > > +++ b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml > > @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# > > title: Hirschmann Hellcreek TSN Switch Device Tree Bindings > > allOf: > > - - $ref: dsa.yaml# > > + - $ref: dsa.yaml#/$defs/ethernet-ports > > maintainers: > > - Andrew Lunn <andrew@lunn.ch> > > diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > > index f2e9ff3f580b..20312f5d1944 100644 > > --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > > +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > > @@ -157,9 +157,6 @@ patternProperties: > > patternProperties: > > "^(ethernet-)?port@[0-9]+$": > > type: object > > This line was being removed on the previous version. Must be related to > above. Without the 'object' type here, I get the following warning: Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: patternProperties:^(ethernet-)?ports$:patternProperties:^(ethernet-)?port@[0-9]+$: 'anyOf' conditional failed, one must be fixed: 'type' is a required property '$ref' is a required property hint: node schemas must have a type or $ref from schema $id: http://devicetree.org/meta-schemas/core.yaml# ./Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: Error in referenced schema matching $id: http://devicetree.org/schemas/net/dsa/mediatek,mt7530.yaml SCHEMA Documentation/devicetree/bindings/processed-schema.json /home/colin/src/work/linux_vsc/linux-imx/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: ignoring, error in schema: patternProperties: ^(ethernet-)?ports$: patternProperties: ^(ethernet-)?port@[0-9]+$ I'm testing this now and I'm noticing something is going on with the "ref: dsa-port.yaml" Everything seems to work fine (in that I don't see any warnings) when I have this diff: diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index 20312f5d1944..db0122020f98 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yam @@ -156,8 +156,7 @@ patternProperties: patternProperties: "^(ethernet-)?port@[0-9]+$": - type: object - + $ref: dsa-port.yaml# properties: reg: description: @@ -165,7 +164,6 @@ patternProperties: for user ports. allOf: - - $ref: dsa-port.yaml# - if: required: [ ethernet ] then: This one has me [still] scratching my head... > > > - description: Ethernet switch ports > > - > > - unevaluatedProperties: false > > properties: > > reg: > > Arınç
On 10.12.2022 21:02, Colin Foster wrote: > Hi Arınç, > On Sat, Dec 10, 2022 at 07:24:42PM +0300, Arınç ÜNAL wrote: >> On 10.12.2022 06:30, Colin Foster wrote: >>> DSA a/Documentation/devicetree/bindings/net/dsa/dsa.yaml >>> +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml >>> @@ -58,4 +58,26 @@ oneOf: >>> additionalProperties: true >>> +$defs: >>> + ethernet-ports: >>> + description: A DSA switch without any extra port properties >>> + $ref: '#/' >>> + >>> + patternProperties: >>> + "^(ethernet-)?ports$": >>> + type: object >>> + additionalProperties: false >>> + >>> + properties: >>> + '#address-cells': >>> + const: 1 >>> + '#size-cells': >>> + const: 0 >>> + >>> + patternProperties: >>> + "^(ethernet-)?port@[0-9]+$": >>> + description: Ethernet switch ports >>> + $ref: dsa-port.yaml# >>> + unevaluatedProperties: false >> >> I've got moderate experience in json-schema but shouldn't you put 'type: >> object' here like you did for "^(ethernet-)?ports$"? > > I can't say for sure, but adding "type: object" here and removing it > from mediatek,mt7530.yaml still causes the same issue I mention below. > > Rob's initial suggestion for this patch set (which was basically the > entire implementation... many thanks again Rob) can be found here: > https://lore.kernel.org/netdev/20221104200212.GA2315642-robh@kernel.org/ > > From what I can tell, the omission of "type: object" here was > intentional. At the very least, it doesn't seem to have any effect on > warnings. > >> >>> + >>> ... >>> diff --git a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml >>> index 73b774eadd0b..748ef9983ce2 100644 >>> --- a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml >>> +++ b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml >>> @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# >>> title: Hirschmann Hellcreek TSN Switch Device Tree Bindings >>> allOf: >>> - - $ref: dsa.yaml# >>> + - $ref: dsa.yaml#/$defs/ethernet-ports >>> maintainers: >>> - Andrew Lunn <andrew@lunn.ch> >>> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml >>> index f2e9ff3f580b..20312f5d1944 100644 >>> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml >>> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml >>> @@ -157,9 +157,6 @@ patternProperties: >>> patternProperties: >>> "^(ethernet-)?port@[0-9]+$": >>> type: object >> >> This line was being removed on the previous version. Must be related to >> above. > > Without the 'object' type here, I get the following warning: > > Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: patternProperties:^(ethernet-)?ports$:patternProperties:^(ethernet-)?port@[0-9]+$: 'anyOf' conditional failed, one must be fixed: > 'type' is a required property > '$ref' is a required property > hint: node schemas must have a type or $ref > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > ./Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: Error in referenced schema matching $id: http://devicetree.org/schemas/net/dsa/mediatek,mt7530.yaml > SCHEMA Documentation/devicetree/bindings/processed-schema.json > /home/colin/src/work/linux_vsc/linux-imx/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: ignoring, error in schema: patternProperties: ^(ethernet-)?ports$: patternProperties: ^(ethernet-)?port@[0-9]+$ > > > I'm testing this now and I'm noticing something is going on with the > "ref: dsa-port.yaml" > > > Everything seems to work fine (in that I don't see any warnings) when I > have this diff: > > > diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > index 20312f5d1944..db0122020f98 100644 > --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yam > @@ -156,8 +156,7 @@ patternProperties: > > patternProperties: > "^(ethernet-)?port@[0-9]+$": > - type: object > - > + $ref: dsa-port.yaml# > properties: > reg: > description: > @@ -165,7 +164,6 @@ patternProperties: > for user ports. > > allOf: > - - $ref: dsa-port.yaml# > - if: > required: [ ethernet ] > then: > > > > This one has me [still] scratching my head... Right there with you. In addition to this, having or deleting type object on/from "^(ethernet-)?ports$" and "^(ethernet-)?port@[0-9]+$" on dsa.yaml doesn't cause any warnings (checked with make dt_binding_check DT_SCHEMA_FILES=net/dsa) which makes me question why it's there in the first place. Arınç
On Mon, Dec 12, 2022 at 12:28:06PM +0300, Arınç ÜNAL wrote: > On 10.12.2022 21:02, Colin Foster wrote: > > Hi Arınç, > > On Sat, Dec 10, 2022 at 07:24:42PM +0300, Arınç ÜNAL wrote: > > > On 10.12.2022 06:30, Colin Foster wrote: > > > > DSA a/Documentation/devicetree/bindings/net/dsa/dsa.yaml > > > > +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > > > > @@ -58,4 +58,26 @@ oneOf: > > > > additionalProperties: true > > > > +$defs: > > > > + ethernet-ports: > > > > + description: A DSA switch without any extra port properties > > > > + $ref: '#/' > > > > + > > > > + patternProperties: > > > > + "^(ethernet-)?ports$": > > > > + type: object > > > > + additionalProperties: false > > > > + > > > > + properties: > > > > + '#address-cells': > > > > + const: 1 > > > > + '#size-cells': > > > > + const: 0 > > > > + > > > > + patternProperties: > > > > + "^(ethernet-)?port@[0-9]+$": > > > > + description: Ethernet switch ports > > > > + $ref: dsa-port.yaml# > > > > + unevaluatedProperties: false > > > > > > I've got moderate experience in json-schema but shouldn't you put 'type: > > > object' here like you did for "^(ethernet-)?ports$"? > > > > I can't say for sure, but adding "type: object" here and removing it > > from mediatek,mt7530.yaml still causes the same issue I mention below. > > > > Rob's initial suggestion for this patch set (which was basically the > > entire implementation... many thanks again Rob) can be found here: > > https://lore.kernel.org/netdev/20221104200212.GA2315642-robh@kernel.org/ > > > > From what I can tell, the omission of "type: object" here was > > intentional. At the very least, it doesn't seem to have any effect on > > warnings. > > > > > > > > > + > > > > ... > > > > diff --git a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml > > > > index 73b774eadd0b..748ef9983ce2 100644 > > > > --- a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml > > > > +++ b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml > > > > @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# > > > > title: Hirschmann Hellcreek TSN Switch Device Tree Bindings > > > > allOf: > > > > - - $ref: dsa.yaml# > > > > + - $ref: dsa.yaml#/$defs/ethernet-ports > > > > maintainers: > > > > - Andrew Lunn <andrew@lunn.ch> > > > > diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > > > > index f2e9ff3f580b..20312f5d1944 100644 > > > > --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > > > > +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > > > > @@ -157,9 +157,6 @@ patternProperties: > > > > patternProperties: > > > > "^(ethernet-)?port@[0-9]+$": > > > > type: object > > > > > > This line was being removed on the previous version. Must be related to > > > above. > > > > Without the 'object' type here, I get the following warning: > > > > Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: patternProperties:^(ethernet-)?ports$:patternProperties:^(ethernet-)?port@[0-9]+$: 'anyOf' conditional failed, one must be fixed: > > 'type' is a required property > > '$ref' is a required property > > hint: node schemas must have a type or $ref > > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > > ./Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: Error in referenced schema matching $id: http://devicetree.org/schemas/net/dsa/mediatek,mt7530.yaml > > SCHEMA Documentation/devicetree/bindings/processed-schema.json > > /home/colin/src/work/linux_vsc/linux-imx/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: ignoring, error in schema: patternProperties: ^(ethernet-)?ports$: patternProperties: ^(ethernet-)?port@[0-9]+$ Is the above warning not clear? We require either 'type' or a $ref to define nodes as json-schema objects. > > I'm testing this now and I'm noticing something is going on with the > > "ref: dsa-port.yaml" > > > > > > Everything seems to work fine (in that I don't see any warnings) when I > > have this diff: > > > > > > diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > > index 20312f5d1944..db0122020f98 100644 > > --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > > +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yam > > @@ -156,8 +156,7 @@ patternProperties: > > > > patternProperties: > > "^(ethernet-)?port@[0-9]+$": > > - type: object > > - > > + $ref: dsa-port.yaml# > > properties: > > reg: > > description: > > @@ -165,7 +164,6 @@ patternProperties: > > for user ports. > > > > allOf: > > - - $ref: dsa-port.yaml# > > - if: > > required: [ ethernet ] > > then: > > > > > > > > This one has me [still] scratching my head... > > Right there with you. In addition to this, having or deleting type object > on/from "^(ethernet-)?ports$" and "^(ethernet-)?port@[0-9]+$" on dsa.yaml > doesn't cause any warnings (checked with make dt_binding_check > DT_SCHEMA_FILES=net/dsa) which makes me question why it's there in the first > place. That check probably doesn't consider an ref being under an 'allOf'. Perhaps what is missing in understanding is every schema at the top-level has an implicit 'type: object'. But nothing is ever implicit in json-schema which will silently ignore keywords which don't make sense for an instance type. Instead of a bunch of boilerplate, the processed schema has 'type' added in lots of cases such as this one. Rob
On Fri, Dec 09, 2022 at 07:30:27PM -0800, Colin Foster wrote: > DSA switches can fall into one of two categories: switches where all ports > follow standard '(ethernet-)?port' properties, and switches that have > additional properties for the ports. > > The scenario where DSA ports are all standardized can be handled by > switches with a reference to the new 'dsa.yaml#/$defs/ethernet-ports'. > > The scenario where DSA ports require additional properties can reference > '$dsa.yaml#' directly. This will allow switches to reference these standard > definitions of the DSA switch, but add additional properties under the port > nodes. > > Suggested-by: Rob Herring <robh@kernel.org> > Signed-off-by: Colin Foster <colin.foster@in-advantage.com> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org> > Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> > Reviewed-by: Rob Herring <robh@kernel.org> > Acked-by: Alvin Šipraga <alsi@bang-olufsen.dk> # realtek > Acked-by: Arınç ÜNAL <arinc.unal@arinc9.com> > --- Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Hi Rob, Arınç, On Mon, Dec 12, 2022 at 10:51:47AM -0600, Rob Herring wrote: > On Mon, Dec 12, 2022 at 12:28:06PM +0300, Arınç ÜNAL wrote: > > On 10.12.2022 21:02, Colin Foster wrote: > > > Hi Arınç, > > > On Sat, Dec 10, 2022 at 07:24:42PM +0300, Arınç ÜNAL wrote: > > > > On 10.12.2022 06:30, Colin Foster wrote: > > > --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > > > +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yam > > > @@ -156,8 +156,7 @@ patternProperties: > > > > > > patternProperties: > > > "^(ethernet-)?port@[0-9]+$": > > > - type: object > > > - > > > + $ref: dsa-port.yaml# > > > properties: > > > reg: > > > description: > > > @@ -165,7 +164,6 @@ patternProperties: > > > for user ports. > > > > > > allOf: > > > - - $ref: dsa-port.yaml# > > > - if: > > > required: [ ethernet ] > > > then: > > > > > > > > > > > > This one has me [still] scratching my head... > > > > Right there with you. In addition to this, having or deleting type object > > on/from "^(ethernet-)?ports$" and "^(ethernet-)?port@[0-9]+$" on dsa.yaml > > doesn't cause any warnings (checked with make dt_binding_check > > DT_SCHEMA_FILES=net/dsa) which makes me question why it's there in the first > > place. > > > That check probably doesn't consider an ref being under an 'allOf'. > Perhaps what is missing in understanding is every schema at the > top-level has an implicit 'type: object'. But nothing is ever implicit > in json-schema which will silently ignore keywords which don't make > sense for an instance type. Instead of a bunch of boilerplate, the > processed schema has 'type' added in lots of cases such as this one. > > Rob What do you suggest on this set? I think this is the only outstanding issue, and Jakub brought up the possibility of applying end of today (maybe 5-6 hours from now in the US). It seems like there's an issue with the dt_bindings_check that causes the "allOf: $ref" to throw a warning when it shouldn't. So removing the "type: object" was supposed to be correct, but throws warnings. It seems like keeping this patch as-is and updating it when the check gets fixed might be an acceptable path, but I'd understand if you disagree and prefer a resubmission.
On Mon, Dec 12, 2022 at 10:55:19AM -0800, Colin Foster wrote: > Hi Rob, Arınç, > > On Mon, Dec 12, 2022 at 10:51:47AM -0600, Rob Herring wrote: > > On Mon, Dec 12, 2022 at 12:28:06PM +0300, Arınç ÜNAL wrote: > > > On 10.12.2022 21:02, Colin Foster wrote: > > > > Hi Arınç, > > > > On Sat, Dec 10, 2022 at 07:24:42PM +0300, Arınç ÜNAL wrote: > > > > > On 10.12.2022 06:30, Colin Foster wrote: > > > > --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml > > > > +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yam > > > > @@ -156,8 +156,7 @@ patternProperties: > > > > > > > > patternProperties: > > > > "^(ethernet-)?port@[0-9]+$": > > > > - type: object > > > > - > > > > + $ref: dsa-port.yaml# > > > > properties: > > > > reg: > > > > description: > > > > @@ -165,7 +164,6 @@ patternProperties: > > > > for user ports. > > > > > > > > allOf: > > > > - - $ref: dsa-port.yaml# > > > > - if: > > > > required: [ ethernet ] > > > > then: > > > > > > > > > > > > > > > > This one has me [still] scratching my head... > > > > > > Right there with you. In addition to this, having or deleting type object > > > on/from "^(ethernet-)?ports$" and "^(ethernet-)?port@[0-9]+$" on dsa.yaml > > > doesn't cause any warnings (checked with make dt_binding_check > > > DT_SCHEMA_FILES=net/dsa) which makes me question why it's there in the first > > > place. > > > > > > That check probably doesn't consider an ref being under an 'allOf'. > > Perhaps what is missing in understanding is every schema at the > > top-level has an implicit 'type: object'. But nothing is ever implicit > > in json-schema which will silently ignore keywords which don't make > > sense for an instance type. Instead of a bunch of boilerplate, the > > processed schema has 'type' added in lots of cases such as this one. > > > > Rob > > What do you suggest on this set? I think this is the only outstanding > issue, and Jakub brought up the possibility of applying end of today > (maybe 5-6 hours from now in the US). > > It seems like there's an issue with the dt_bindings_check that causes > the "allOf: $ref" to throw a warning when it shouldn't. So removing the > "type: object" was supposed to be correct, but throws warnings. > > It seems like keeping this patch as-is and updating it when the check > gets fixed might be an acceptable path, but I'd understand if you > disagree and prefer a resubmission. Heads up on my plan for this. I plan to re-submit this on Monday after the merge window with the change where I move the $ref: dsa-port.yaml# to outside the allOf: section, and remove the object type as the above code suggests. Hopefully that's the right step to take.
On Thu, 22 Dec 2022 12:08:30 -0800 Colin Foster wrote: > Heads up on my plan for this. I plan to re-submit this on Monday after > the merge window with the change where I move the $ref: dsa-port.yaml# > to outside the allOf: section, and remove the object type as the above > code suggests. Hopefully that's the right step to take. FWIW in case you mean Mon, Dec 26th and net-next -- we extended the period of net-next being closed until Jan: https://lore.kernel.org/all/20221215092531.133ce653@kernel.org/
diff --git a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml index 259a0c6547f3..5888e3a0169a 100644 --- a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml +++ b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Arrow SpeedChips XRS7000 Series Switch Device Tree Bindings allOf: - - $ref: dsa.yaml# + - $ref: dsa.yaml#/$defs/ethernet-ports maintainers: - George McCollister <george.mccollister@gmail.com> diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml index 1219b830b1a4..5bef4128d175 100644 --- a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml +++ b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml @@ -66,7 +66,7 @@ required: - reg allOf: - - $ref: dsa.yaml# + - $ref: dsa.yaml#/$defs/ethernet-ports - if: properties: compatible: diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml index 5efc0ee8edcb..9375cdcfbf96 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml @@ -58,4 +58,26 @@ oneOf: additionalProperties: true +$defs: + ethernet-ports: + description: A DSA switch without any extra port properties + $ref: '#/' + + patternProperties: + "^(ethernet-)?ports$": + type: object + additionalProperties: false + + properties: + '#address-cells': + const: 1 + '#size-cells': + const: 0 + + patternProperties: + "^(ethernet-)?port@[0-9]+$": + description: Ethernet switch ports + $ref: dsa-port.yaml# + unevaluatedProperties: false + ... diff --git a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml index 73b774eadd0b..748ef9983ce2 100644 --- a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Hirschmann Hellcreek TSN Switch Device Tree Bindings allOf: - - $ref: dsa.yaml# + - $ref: dsa.yaml#/$defs/ethernet-ports maintainers: - Andrew Lunn <andrew@lunn.ch> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index f2e9ff3f580b..20312f5d1944 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -157,9 +157,6 @@ patternProperties: patternProperties: "^(ethernet-)?port@[0-9]+$": type: object - description: Ethernet switch ports - - unevaluatedProperties: false properties: reg: @@ -238,7 +235,7 @@ $defs: - sgmii allOf: - - $ref: dsa.yaml# + - $ref: dsa.yaml#/$defs/ethernet-ports - if: required: - mediatek,mcm diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml index 4da75b1f9533..a4b53434c85c 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml @@ -11,7 +11,7 @@ maintainers: - Woojung Huh <Woojung.Huh@microchip.com> allOf: - - $ref: dsa.yaml# + - $ref: dsa.yaml#/$defs/ethernet-ports - $ref: /schemas/spi/spi-peripheral-props.yaml# properties: diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml index 630bf0f8294b..4aee3bf4c2f4 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml @@ -10,7 +10,7 @@ maintainers: - UNGLinuxDriver@microchip.com allOf: - - $ref: dsa.yaml# + - $ref: dsa.yaml#/$defs/ethernet-ports properties: compatible: diff --git a/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml b/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml index 8d93ed9c172c..85014a590a35 100644 --- a/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml @@ -78,7 +78,7 @@ required: - reg allOf: - - $ref: dsa.yaml# + - $ref: dsa.yaml#/$defs/ethernet-ports - if: properties: compatible: diff --git a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml index 1e26d876d146..826e2db98974 100644 --- a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml +++ b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml @@ -13,7 +13,7 @@ description: depends on the SPI bus master driver. allOf: - - $ref: "dsa.yaml#" + - $ref: dsa.yaml#/$defs/ethernet-ports - $ref: /schemas/spi/spi-peripheral-props.yaml# maintainers: diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml index 1a7d45a8ad66..cfd69c2604ea 100644 --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Realtek switches for unmanaged switches allOf: - - $ref: dsa.yaml# + - $ref: dsa.yaml#/$defs/ethernet-ports maintainers: - Linus Walleij <linus.walleij@linaro.org> diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml index 0a0d62b6c00e..833d2f68daa1 100644 --- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml +++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml @@ -14,7 +14,7 @@ description: | handles 4 ports + 1 CPU management port. allOf: - - $ref: dsa.yaml# + - $ref: dsa.yaml#/$defs/ethernet-ports properties: compatible: