From patchwork Fri Nov 4 04:51:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13031319 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 AE1CFC4321E for ; Fri, 4 Nov 2022 04:52:40 +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-Transfer-Encoding:Content-Type: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:In-Reply-To:References:List-Owner; bh=OFkstsAjF2HZsft3kh4I2WvApenJcnSOsmWoyY2jZVE=; b=I5rmOdX7H98f8gcQB8o06nTM98 xPzekX5roGBz+nGti1awtlv1ssDQq4HEkdVcjzT229QhojoEZBfMM6jKynpeGgJ3z3viPva4PoYid 5cXeZGb0k1ECg80RBshP3v0MbaHaMbmn25Y4o2ZwARWPhrk3GabA6Ok9K6ToQimdqM6tfBdXRmmlp arSn/j8pSLurpH3mVkDHP5/oYoVy9IZkV8LmBXIHRhWhpEo3XnO0UxM7XiI/hCbfSmOFuxvwvV3Do 0PYN5+IEjOD/sRlExvDefPz51n2aPpAtnCQpJ6DUddJ/ZFRNAml6RgoMPGq3/FlpHTrPYvwjKjHu8 9e0xpBGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqogs-002MDe-Nx; Fri, 04 Nov 2022 04:52:26 +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 1oqogp-002MBx-2F; Fri, 04 Nov 2022 04:52:25 +0000 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 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 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 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?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fnWaSp8vGAi8yw+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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221103_215223_160274_FC9C4A10 X-CRM114-Status: GOOD ( 22.87 ) 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 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