Message ID | 20221104045204.746124-1-colin.foster@in-advantage.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp170589wru; Thu, 3 Nov 2022 21:53:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6KgByjah5xkgnIBG3SVlBvDYbKebzJzqa1rNjj27WsJ1jNwdTlCdig36/T79aU/uVmT/08 X-Received: by 2002:a17:903:2452:b0:187:99b:c8fe with SMTP id l18-20020a170903245200b00187099bc8femr31611000pls.113.1667537605408; Thu, 03 Nov 2022 21:53:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667537605; cv=pass; d=google.com; s=arc-20160816; b=R7N3wPadKe/LnZuUXL3A0KDGVQuVB4PBPjtkU5s63GfIw70aMFIGgFufhrA11fGish 0BM2sYvksmya1Sn8Br6txOpU9OKQiaNdMlAd72ZcyGQK57bvTrA0IRk09UJLpNsx9BiW L4F0PBTQKaCHJY60LfGDxLFw5E2jKn1sjnghzUR5cvqj7zHXSAnh43N8NudYtvws/Ivd ibPuOIMHpo0dOwfGCe9mzzh1O7wuo+KLl9lIGYkHFBp7aB8A+ogCJ3CVJySW0Oeow/us SQYUXrH2n46Gvzn6GMDI3K1xzxoGtEVsYsdxCYpeAw7tqsbWlekLi60Jcg623bvBKCyV Ljmw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=OFkstsAjF2HZsft3kh4I2WvApenJcnSOsmWoyY2jZVE=; b=zu4/UFqKNBu7wJGPl5+OJYGjIVfZRlXrOjiZ07WeKIpx+jCI8iGGFR3lFitUJ+P3TW vX8jYO56h1ieXkPJO/6PTue1nyOHqlW5QlgjmhyUjEyi8xWV9G4T7fwqoGMxGhTA/PX6 FmtGSKEvjdJkRuccCoT3NtMeM3AU5i50AOam5veSgFjSAWhempyf1jGkQ8rC2loc8DEe 8PnuH6z2ICbDXoEFuRb9pukgg5GQhSNlwI25jmXwSnYGe9LODJgErKhH2x/VMeLiH6L1 drbZx3ZkJvYmiYq6inRrkL26fQPwGr4u4XYFqQAWIac/UGoLd9d7NUERiZTyMN4VPwKf d1vw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=PjQ8WeFm; 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 x3-20020a17090a8a8300b0020db4eeaed5si2084151pjn.137.2022.11.03.21.53.13; Thu, 03 Nov 2022 21:53:25 -0700 (PDT) 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=PjQ8WeFm; 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 S230350AbiKDEwW (ORCPT <rfc822;jimliu8233@gmail.com> + 99 others); Fri, 4 Nov 2022 00:52:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbiKDEwU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 4 Nov 2022 00:52:20 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2090.outbound.protection.outlook.com [40.107.244.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDD0B20F69; Thu, 3 Nov 2022 21:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VMgNW9zU9ZwMZVsBcP16T36QpytJzhE6ZsVqZx0xB3zVFFK6WtVY1hsWkoijIt2SE0wzRW+qCyyD/Q3ImYi4Rv1i1k4GOctTEAEkxRaqDU7BkpQHNuAQeC8qMcrGi1Xoiha+km7cYMqIRE9ZHwalfiEexWdb7UI8++ZGdDrLuFljFNq9I4AoqErQokZsAL7uIjACVpJaNTjAD7NqM9NN6jDrVryFX1Aqp5I2ocIlBUC2vCNQhfil6W1FOOC97Rsydh1CKy8NO5b6IhIYG6YRCyu1eufxDQ/QdkOi/5RhUZ72oUNWPPj9JkcBIZxFKJM9bJvBFLnVufO1ulroS/Ifng== 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=OFkstsAjF2HZsft3kh4I2WvApenJcnSOsmWoyY2jZVE=; b=VIdpQeSn+ljLNIaSi3WdVvWEbj8WoV1SiyrcaIyjoD7t8bE3SoCTMe6+TDjTYgRj4GygLKeLLLz5HGZEDQUGgaDbOvF1giFzpOuu87nb9czh5acpBr533rO/HLKFG/UicQijFssqeF5ohGrB065kaw5wneciumSp2itwLs8KuKmMd5cAerRBlr33u+LK01SA8z7rk0htjcyXAr+vMO8pIeJkGyS5uOQCpngFfY5Vzp6qMjn5uitrxDmZ7HLNQrI9GQKUuz7I7Pc+NaM/2+oEI9+pWPdhVDJqFgm/E3RUCpxH4ZpTM89RYMgTb2YUAukIK/VWsKlKsABGgBsJHWz0NQ== 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=OFkstsAjF2HZsft3kh4I2WvApenJcnSOsmWoyY2jZVE=; b=PjQ8WeFmjV6J6ssCrbdHLfH0A2e/Ut3k9n9xeP1l4ixFmFlj+wnh7pVgrWguz11SNBEG/RoXkAuG01ExajuI2NSf2cC7RznZgsmXDo+Q/hFJm5BFnWfUguI0v2NelTKZ+zaM51gOz9xT/fg3FA/H5864vCrGriVw7yGRMr3hNAo= 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:16 +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:15 +0000 From: Colin Foster <colin.foster@in-advantage.com> 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 <alexandre.belloni@bootlin.com>, Claudiu Manoil <claudiu.manoil@nxp.com>, John Crispin <john@phrozen.org>, 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>, Matthias Brugger <matthias.bgg@gmail.com>, 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>, Vivien Didelot <vivien.didelot@gmail.com>, Andrew Lunn <andrew@lunn.ch>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Rob Herring <robh+dt@kernel.org> Subject: [PATCH v2 net-next 0/6] dt-binding preparation for ocelot switches Date: Thu, 3 Nov 2022 21:51:58 -0700 Message-Id: <20221104045204.746124-1-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: a24eda6b-5a37-49d4-4765-08dabe20581c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oYpn623zXY0C/gwFix5u+0XQ7cKuLyG04yeDO4FHr73aOVbgBCK8xAo3ifarK8rtV4gTzrJ+2CCJ040qHSk2H0ZwecduSqzAtoNeE7CxWjXUHHI596wP4bYOG2GQyaciX4NcVFGu2DW2rv/A7GGgxd8zLpsFOebORzc8yT1bIU8U8qnulRvUo3kUv4tNyumz40AAwFhiXnE3sj6flNDPOoDLqJ0aM/GGeU2MLnVpTvUmDRupee5AsZmn45tBMxO541RDcpzdcKWXsnTLAZovg1HXmzPKXI0KE0zTB0WIH8anAsNVFcKggbTRYuHp8j/1ghfL4DrkSzQCqEdCl+7WtgoqRv/Jn/NREc66XEAbsBTpBFucq/OQ6UcH3z+1so4Px7QLLhn6a+OVA6f77CULJSqZYufSvxRaFWSMXkDktBXXsUYBsh/jReHiPc0JfD39HcKDGN6/QAufpI3WkBoKuv0IQKuN5Pf0HwPOU01lH0j+udo0oiJuaq+FcGE8EwGCTdag0qS5tgMdIDngBErEkRmogH2OXJbjNjA105606NqXjVbU+bqZlQV/U2ZmU0Ec8OLXIIsw9i2XLCWhOvfsYhtOLTLHVFJB0njZkdj/FWprAo/IGkZSLI69wcDjIfq6w4RXb/9EbZpB2BetqX0B9NRODt8MzX5eJPzxUd038jz2yR9ptw2tevlq0WBJYirEXj3RUY6d0OkaBY/GXcCN2ed1WTL1e9XpmkMIt/hwK+IViMzRf0iuP1Cqh/4zLLVgo4EUITLJNsONNTjHNcmnHEnpdII7GxNzuw3BNvUd+VA= 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);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?aiI7KU+PPdmSAWP6DEU6v9OYakA0?= =?utf-8?q?oMwZcemwbMl+HYqBV1xueZlkQwmw81dwl9NdcA5lGeMGlkfu2ttV9Lmppizd7CdU1?= =?utf-8?q?I1MLke1fS2e/8Hp+kHUDKNd8VNHVv7nXdVY87sI6O12psHbuzybqlK19i8qX0Efus?= =?utf-8?q?MYL8Zag2LqynGymvd0IRkDbFdJzNnqkTXEDlp5eN+eU4jrJ+J64FuxZXFda0xb54D?= =?utf-8?q?rCWsT8uNqocqeIuYNwe+DNvhSu9Hcdpn+Srb5D6fCVsZ8uhFwXiJvMPIK4Dul4oU9?= =?utf-8?q?hR/Em+l5Qc3CoEEL/NNNhe8PbnHM9fKTpE9SiiI/0HtmKgokwF2nuLYVBpJQB47SR?= =?utf-8?q?dDsNjAWgVPWv2StZhOox8xTpMC1rzYe2erqZxamUdVDsgXCjrrjUtn9v7g1m5w23g?= =?utf-8?q?LnJq+ACLws4KA4/pmG8Dd67hcTTJQTIM0V2c+8zbgbQqEZlaDOhwXL3bIjhqFkdow?= =?utf-8?q?paGBZDTZrCC2I1CPvdlOd/+QkbCHnZZW86ODt9BmutniwlMy1gBVTuK9kjyf6+/PN?= =?utf-8?q?cdCUnvjPCulRYbYEZtiif9wk2yvfIhwBm/YwFVdUbafMXjB52oG96U5vgf2undZ1u?= =?utf-8?q?xXqC2zIULy86SL193FejexqmRX/vEorkgKIetIqdw9ECtutuRbaUVR9voreZ37KBM?= =?utf-8?q?Zi4QM0KpXcwD8aJKhfs2o/ei6WW+WQLvBuR5imi09Ye1IPIxpr4eklLSWw1WMQsLS?= =?utf-8?q?A4ZGo8t4p8jZRzki6b6Z1FyrJZNhzOPMsTmHpn9hjO9dmMRI34SzBapiGQ5Byh1zX?= =?utf-8?q?UXCy3TGOSX0U01yGjbRS3S8HXoVY1zsX+qLhGrcFW4vWQ7e9WpV1W9tF6fmtA/azH?= =?utf-8?q?TPqywxGHi2Gbcknmhh2yngfK0wHdmd1RUV+zXbFzdtSjQEbUDyQ2dVzmRm77y7TFs?= =?utf-8?q?JLS1T/nHT5sPwargb9DYv6U/NdTm7iTX1Uk4+v3R0wBcaHluJuJ3GCC5VyCEGcWNU?= =?utf-8?q?Z7s+50ZDD7oXUHqh1tpVBsWtPpa2843ccoxMYqhWMbkWvHSJmWKjIA0J4L96ouaHV?= =?utf-8?q?NGA8oN0HPVopXAcGhRwcAHFZ8f02izWFGTOkqt5RhEtjqFUBBvw37GfSX++TLTB0V?= =?utf-8?q?0qW8cd3TVTiA40BCVHtawZ7LCg4cM+qhLi6ckGIFdIECqpdj50j+fjE3KBkz/qrZ7?= =?utf-8?q?F0WwzvF7uCEFWijLd0U+hIv4693nTHZ55zo6/UbjqYGZt+3A7h8PRZ546mDbGujid?= =?utf-8?q?d8KZWfnWaSp8vGAi8yw+G2FmqILs1PYbj6CxYCHWaOcmuG07Tzb88k9xF48/ik+JC?= =?utf-8?q?64NjSTAtYIUSTXauzjnDew/HGbg1QiTx+D47XEZAdP5zw9xpGLMPM3cXbu/5WXWni?= =?utf-8?q?VoR+7ryJwDCarDcnghLt4sENc6Sj9J6vAvNbDWZXBoFhwXEEKd2Ok4fq1GOS2+04a?= =?utf-8?q?e8n4zJj0hr5L6BbrIrKtgBI8jzH8cUptUgeXBufkdVVBYK3pAVAqLlI68LdH/mGwu?= =?utf-8?q?LR10su+1mpkMTvB8X+hUnXbTn3F8eagd/Or5ssQTHGGpof+a0cCueoMxpdo20qPy+?= =?utf-8?q?xu2pA0DBnTYgk6aGkWQWJaGoeBMqJkWjxQ=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: a24eda6b-5a37-49d4-4765-08dabe20581c 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:15.6262 (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: BO4cLDkgnryZwp9FFdUoZjpXq29jTrabxd6pIw7fnfUrL+mgKkDlQfZseZCQAjheuW4AJbxX/X1vQsnJXVvbI7v+fOHEybYyIgPYDcMVOqQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB5986 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?1748539911921053252?= X-GMAIL-MSGID: =?utf-8?q?1748539911921053252?= |
Series |
dt-binding preparation for ocelot switches
|
|
Message
Colin Foster
Nov. 4, 2022, 4:51 a.m. UTC
Ocelot switches have the abilitiy to be used internally via memory-mapped IO or externally via SPI or PCIe. This brings up issues for documentation, where the same chip might be accessed internally in a switchdev manner, or externally in a DSA configuration. This patch set is perparation to bring DSA functionality to the VSC7512, utilizing as much as possible with an almost identical VSC7514 chip. During the most recent RFC for internal ethernet switch functionality to the VSC7512, there were 10 steps laid out to adequately prepare documentation: https://lore.kernel.org/all/20221010174856.nd3n4soxk7zbmcm7@skbuf/ The full context is quoted below. This patch set represents steps 1-7 of the 10 steps, with the remaining steps to likely be part of what was the original RFC. The first two patches are specifically rewording and fixing of the MFD bindings. I kept them in this patch set since they might cause conflicts with future documentation changes that will be part of the net-next tree. I can separate them if desired. Context: ``` To end the discussion on a constructive note, I think if I were Colin, I would do the following, in the following order, according to what was expressed as a constraint: 1. Reword the "driver" word out of mscc,vsc7514-switch.yaml and express the description in terms of what the switch can do, not what the driver can do. 2. Make qca8k.yaml have "$ref: dsa.yaml#". Remove "$ref: dsa-port.yaml#" from the same schema. 3. Remove "- $ref: dsa-port.yaml#" from mediatek,mt7530.yaml. It doesn't seem to be needed, since dsa.yaml also has this. We need this because we want to make sure no one except dsa.yaml references dsa-port.yaml. 4. Move the DSA-unspecific portion from dsa.yaml into a new ethernet-switch.yaml. What remains in dsa.yaml is "dsa,member". The dsa.yaml schema will have "$ref: ethernet-switch.yaml#" for the "(ethernet-)switch" node, plus its custom additions. 5. Move the DSA-unspecific portion from dsa-port.yaml into a new ethernet-switch-port.yaml. What remains in dsa-port.yaml is: * ethernet phandle * link phandle * label property * dsa-tag-protocol property * the constraint that CPU and DSA ports must have phylink bindings 6. The ethernet-switch.yaml will have "$ref: ethernet-switch-port.yaml#" and "$ref: dsa-port.yaml". The dsa-port.yaml schema will *not* have "$ref: ethernet-switch-port.yaml#", just its custom additions. I'm not 100% on this, but I think there will be a problem if: - dsa.yaml references ethernet-switch.yaml - ethernet-switch.yaml references ethernet-switch-port.yaml - dsa.yaml also references dsa-port.yaml - dsa-port.yaml references ethernet-switch-port.yaml because ethernet-switch-port.yaml will be referenced twice. Again, not sure if this is a problem. If it isn't, things can be simpler, just make dsa-port.yaml reference ethernet-switch-port.yaml, and skip steps 2 and 3 since dsa-port.yaml containing just the DSA specifics is no longer problematic. 7. Make mscc,vsc7514-switch.yaml have "$ref: ethernet-switch.yaml#" for the "mscc,vsc7514-switch.yaml" compatible string. This will eliminate its own definitions for the generic properties: $nodename and ethernet-ports (~45 lines of code if I'm not mistaken). 8. Introduce the "mscc,vsc7512-switch" compatible string as part of mscc,vsc7514-switch.yaml, but this will have "$ref: dsa.yaml#" (this will have to be referenced by full path because they are in different folders) instead of "ethernet-switch.yaml". Doing this will include the common bindings for a switch, plus the DSA specifics. 9. Optional: rework ti,cpsw-switch.yaml, microchip,lan966x-switch.yaml, microchip,sparx5-switch.yaml to have "$ref: ethernet-switch.yaml#" which should reduce some duplication in existing schemas. 10. Question for future support of VSC7514 in DSA mode: how do we decide whether to $ref: ethernet-switch.yaml or dsa.yaml? If the parent MFD node has a compatible string similar to "mscc,vsc7512", then use DSA, otherwise use generic ethernet-switch? ``` --- v1 -> v2 * Two MFD patches were brought into the MFD tree, so are dropped * Add first patch 1/6 to allow DSA devices to add ports and port properties * Test qca8k against new dt-bindings and fix warnings. (patch 2/6) * Add tags (patch 3/6) * Fix vsc7514 refs and properties --- Colin Foster (6): dt-bindings: net: dsa: allow additional ethernet-port properties dt-bindings: net: dsa: qca8k: utilize shared dsa.yaml dt-bindings: net: dsa: mediatek,mt7530: remove unnecessary dsa-port reference dt-bindings: net: add generic ethernet-switch dt-bindings: net: add generic ethernet-switch-port binding dt-bindings: net: mscc,vsc7514-switch: utilize generic ethernet-switch.yaml .../devicetree/bindings/net/dsa/dsa-port.yaml | 27 +--------- .../devicetree/bindings/net/dsa/dsa.yaml | 26 +--------- .../bindings/net/dsa/mediatek,mt7530.yaml | 3 -- .../devicetree/bindings/net/dsa/qca8k.yaml | 18 +++---- .../bindings/net/ethernet-switch-port.yaml | 44 ++++++++++++++++ .../bindings/net/ethernet-switch.yaml | 51 +++++++++++++++++++ .../bindings/net/mscc,vsc7514-switch.yaml | 40 ++------------- MAINTAINERS | 2 + 8 files changed, 112 insertions(+), 99 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/ethernet-switch-port.yaml create mode 100644 Documentation/devicetree/bindings/net/ethernet-switch.yaml
Comments
On Thu, Nov 03, 2022 at 09:51:58PM -0700, Colin Foster wrote: > Ocelot switches have the abilitiy to be used internally via > memory-mapped IO or externally via SPI or PCIe. This brings up issues > for documentation, where the same chip might be accessed internally in a > switchdev manner, or externally in a DSA configuration. This patch set > is perparation to bring DSA functionality to the VSC7512, utilizing as > much as possible with an almost identical VSC7514 chip. > > During the most recent RFC for internal ethernet switch functionality to > the VSC7512, there were 10 steps laid out to adequately prepare > documentation: > > https://lore.kernel.org/all/20221010174856.nd3n4soxk7zbmcm7@skbuf/ > > The full context is quoted below. This patch set represents steps 1-7 of > the 10 steps, with the remaining steps to likely be part of what was the > original RFC. > > The first two patches are specifically rewording and fixing of the MFD > bindings. I kept them in this patch set since they might cause conflicts > with future documentation changes that will be part of the net-next > tree. I can separate them if desired. > > > > Context: > > ``` > To end the discussion on a constructive note, I think if I were Colin, > I would do the following, in the following order, according to what was > expressed as a constraint: > > 1. Reword the "driver" word out of mscc,vsc7514-switch.yaml and express > the description in terms of what the switch can do, not what the > driver can do. > > 2. Make qca8k.yaml have "$ref: dsa.yaml#". Remove "$ref: dsa-port.yaml#" > from the same schema. No, you need dsa-port.yaml referenced because it has DSA port properties plus custom qca8k properties. > > 3. Remove "- $ref: dsa-port.yaml#" from mediatek,mt7530.yaml. It doesn't > seem to be needed, since dsa.yaml also has this. We need this because > we want to make sure no one except dsa.yaml references dsa-port.yaml. You don't seem to need it in mediatek,mt7530.yaml, but only dsa.yaml referencing dsa-port.yaml is not what we need. dsa-port.yaml wouldn't (and didn't at one time) exist if only dsa.yaml needed it. Something like the below patch is on top of your changes is what's needed. For DSA, there are 2 cases, custom properties in 'port' nodes and no custom properties. '(ethernet-)?ports' never has custom properties AFAICT (brcm,sf2 had brcm,use-bcm-hdr in the wrong place). Bindings using only standard DSA properties need to reference 'dsa.yaml#'. Bindings with custom 'ethernet-port' node properties need to use 'dsa.yaml#/$defs/base' and then under the ethernet-port node reference dsa-port.yaml, define their custom properties, and set 'unevaluatedProperties: false'. Obviously this needs to be refactored into proper patches and/or squashed into yours. Probably a patch to fix brcm,sf2 and one to add dsa.yaml#/$defs/base, then split out switch stuff. 8<------------------------------------------------------------------- diff --git a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml index 259a0c6547f3..8d5abb05abdf 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/base 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..f323fc01b224 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/base - if: properties: compatible: diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,sf2.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,sf2.yaml index d159ac78cec1..eed16e216fb6 100644 --- a/Documentation/devicetree/bindings/net/dsa/brcm,sf2.yaml +++ b/Documentation/devicetree/bindings/net/dsa/brcm,sf2.yaml @@ -85,11 +85,16 @@ properties: ports: type: object - properties: - brcm,use-bcm-hdr: - description: if present, indicates that the switch port has Broadcom - tags enabled (per-packet metadata) - type: boolean + patternProperties: + '^port@[0-9a-f]$': + $ref: dsa-port.yaml# + unevaluatedProperties: false + + properties: + brcm,use-bcm-hdr: + description: if present, indicates that the switch port has Broadcom + tags enabled (per-packet metadata) + type: boolean required: - reg diff --git a/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml b/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml index d97fb87cccb0..0672443ea7a6 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml +++ b/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml @@ -14,6 +14,8 @@ maintainers: description: Ethernet switch port Description +$ref: /schemas/net/ethernet-switch-port.yaml# + properties: label: description: diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml index 2290a9d32b21..1b3593a36014 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml @@ -21,9 +21,6 @@ select: false $ref: "/schemas/net/ethernet-switch.yaml#" properties: - $nodename: - pattern: "^(ethernet-)?switch(@.*)?$" - dsa,member: minItems: 2 maxItems: 2 @@ -36,4 +33,20 @@ properties: additionalProperties: true +$defs: + base: + description: A DSA without any extra port properties + $ref: '#/' + + patternProperties: + "^(ethernet-)?ports$": + type: object + + patternProperties: + "^(ethernet-)?port@[0-9]+$": + description: Ethernet switch ports + $ref: /schemas/net/dsa/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..e27b1619066f 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/base 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 81f291105660..564783fcb685 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -156,21 +156,15 @@ patternProperties: patternProperties: "^(ethernet-)?port@[0-9]+$": - type: object - description: Ethernet switch ports - - properties: - reg: - description: - Port address described must be 5 or 6 for CPU port and from 0 to 5 - for user ports. - allOf: - if: required: [ ethernet ] then: properties: reg: + description: + Port address described must be 5 or 6 for CPU port and from 0 to 5 + for user ports. enum: - 5 - 6 @@ -235,7 +229,7 @@ $defs: - sgmii allOf: - - $ref: dsa.yaml# + - $ref: dsa.yaml#/$defs/base - 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..bfa2b76659c9 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/base - $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..f4f9798addae 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/base properties: compatible: diff --git a/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml b/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml index 8d93ed9c172c..a7041ae4d811 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/base - 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..13a835af9468 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/base - $ref: /schemas/spi/spi-peripheral-props.yaml# maintainers: diff --git a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml index d831d5eee437..a33abdb9ead0 100644 --- a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml +++ b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml @@ -77,8 +77,7 @@ patternProperties: type: object patternProperties: "^(ethernet-)?port@[0-6]$": - type: object - description: Ethernet switch ports + $ref: dsa-port.yaml# properties: qca,sgmii-rxclk-falling-edge: @@ -102,7 +101,7 @@ patternProperties: SGMII on the QCA8337, it is advised to set this unless a communication issue is observed. - unevaluatedProperties: true + unevaluatedProperties: false oneOf: - required: diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml index 1a7d45a8ad66..ad1793eba31a 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/base 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 7ca9c19a157c..eb9ea25efcb7 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/base properties: compatible: diff --git a/Documentation/devicetree/bindings/net/ethernet-switch.yaml b/Documentation/devicetree/bindings/net/ethernet-switch.yaml index f698857619da..0d417997c163 100644 --- a/Documentation/devicetree/bindings/net/ethernet-switch.yaml +++ b/Documentation/devicetree/bindings/net/ethernet-switch.yaml @@ -25,6 +25,8 @@ properties: patternProperties: "^(ethernet-)?ports$": type: object + additionalProperties: false + properties: '#address-cells': const: 1 @@ -36,10 +38,6 @@ patternProperties: type: object description: Ethernet switch ports - allOf: - - $ref: /schemas/net/dsa/dsa-port.yaml# - - $ref: ethernet-switch-port.yaml# - oneOf: - required: - ports @@ -48,4 +46,20 @@ oneOf: additionalProperties: true +$defs: + base: + description: An Ethernet switch without any extra port properties + $ref: '#/' + + patternProperties: + "^(ethernet-)?ports$": + type: object + + patternProperties: + "^(ethernet-)?port@[0-9]+$": + description: Ethernet switch ports + $ref: ethernet-switch-port.yaml# + unevaluatedProperties: false + + ...