From patchwork Thu Nov 17 21:55:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 21950 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp641114wrr; Thu, 17 Nov 2022 13:57:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf4fOz6emBGlaX1dvgw6ZD40Pso5yfXDzt4FV0p0dDhBW9Fyksqkp4Zz06Uf7KeE66i6Sktd X-Received: by 2002:a63:31d1:0:b0:476:f92f:874f with SMTP id x200-20020a6331d1000000b00476f92f874fmr3873017pgx.24.1668722237422; Thu, 17 Nov 2022 13:57:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668722237; cv=none; d=google.com; s=arc-20160816; b=ZzZu+vE5ti2O7vAMAlkBORsm4OWjQSrJ27eU3Md5S/rQenkyrWh84Nobjva122In/2 ha3hTrsnTD2pFzVDEXkSts5iA/PfQKufVAFcDtFzS/mfprrWHP2ajs/rym7+w1O4vOYd j/NPDI9744QrNlwpp/HCmk6E+b4u4ZK43hBuZVy5euGjN2WkYyOdZmsO2GW8LeDp8aYg miScN2hzgGIqJv4+IuxqEa0U1rYNe58CYzilS8xdBRX91z8RTJJQ/r62xQCc7FJvaJ/A wMBjb1Pkexjpbx7aqIjwFwJFujDF85QGeeaJSGtaNxj0aSNICRJpmlRw0Dz2HVvbngOK HiKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dy/zzJT6DIPjgbiAzHq6ScoLM5NS3WFOG+VWUarCYNs=; b=PL3PpP61vr00XQSnVfQATsREKoa7fcZQTv+5zatI/vV86+Qmma4GGEi8r9RO2i+jyY 9haSSahgs0yCBx5yL9tDhONn2btodzxUaCkroJAknQtg/Vi4jc5JB7zYq8DUqOWzkm+Y umaebNwR9RmkOaQX+GZsGGvu654dhARHrr6FWpkiwuaXrOJMzL1vOfWUjb5qRsBvPRbE l8m4nnMzPbigkLhPSCkOCi5Lrb6E4ZMOU/FU9EeBwGJUeCiyjqFkWKrknVBydNSaniG4 mhMGaZjU11ptd7baZqSFkfVuLHP1OQf4+MShPFY9xJg9HZ45bifWmCOa67n6vHEmAy34 22FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YJyPFOEc; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 64-20020a620643000000b005639db953adsi1832849pfg.68.2022.11.17.13.57.02; Thu, 17 Nov 2022 13:57:17 -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=@bootlin.com header.s=gm1 header.b=YJyPFOEc; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241002AbiKQV4W (ORCPT + 99 others); Thu, 17 Nov 2022 16:56:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240927AbiKQV4H (ORCPT ); Thu, 17 Nov 2022 16:56:07 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E997D701AF; Thu, 17 Nov 2022 13:56:03 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id D5FF01C0005; Thu, 17 Nov 2022 21:56:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668722162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dy/zzJT6DIPjgbiAzHq6ScoLM5NS3WFOG+VWUarCYNs=; b=YJyPFOEc0Fftj1KifivI9hXN6MHseSPaVBUZRY+QvNdA6sxo7p5iGrzLRUdun10tIqyx+l BwU0puFbdkC18lbROivYpXbS8+vzOm1VFkK2yu+xiNSEE+JNuAugiLkU/70C76lg79jMej 7gxVL3pTArmJRUYjaPVmBDtFtY3LPtDX/UWmUu0cgEvkhTAJect+7O5DWORMYZhJxLB1xY babykq8cJpTGGjB7l3wQwFJyVczACcV1Jdbbj0yusGUffY+9qYDCFG9QKJug49lztyL5UV U2h6L8L98hxvYZ/oxnNhIorPvYBieAD7T4aCHOveld37g5R/6NgrOub0sDiu5g== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org Cc: Marcin Wojtas , Russell King , Taras Chornyi , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Miquel Raynal , Vadym Kochan Subject: [PATCH 1/6] Revert "dt-bindings: marvell,prestera: Add description for device-tree bindings" Date: Thu, 17 Nov 2022 22:55:52 +0100 Message-Id: <20221117215557.1277033-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117215557.1277033-1-miquel.raynal@bootlin.com> References: <20221117215557.1277033-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749782088744340716?= X-GMAIL-MSGID: =?utf-8?q?1749782088744340716?= This reverts commit 40acc05271abc2852c32622edbebd75698736b9b. marvell,prestera.txt is an old file describing the old Alleycat3 standalone switches. The commit mentioned above actually hacked these bindings to add support for a device tree property for a more modern version of the IP connected over PCI, using only the generic compatible in order to retrieve the device node from the prestera driver to read one static property. The problematic property discussed here is "base-mac-provider". The original intent was to point to a nvmem device which could produce the relevant nvmem-cell. This property has never been acked by DT maintainers and fails all the layering that has been brought with the nvmem bindings by pointing at a nvmem producer, bypassing the existing nvmem bindings, rather than a nvmem cell directly. Furthermore, the property cannot even be used upstream because it expected the ONIE tlv driver to produce a specific cell, driver which used nacked bindings and thus was never merged, replaced by a more integrated concept: the nvmem-layout. So let's forget about this temporary addition, safely avoiding the need for any backward compatibility handling. A new (yaml) binding file will be brought with the prestera bindings, and there we will actually include a description of the modern IP over PCI, including the right way to point to a nvmem cell. Cc: Vadym Kochan Cc: Taras Chornyi Signed-off-by: Miquel Raynal Acked-by: Rob Herring --- .../bindings/net/marvell,prestera.txt | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/Documentation/devicetree/bindings/net/marvell,prestera.txt b/Documentation/devicetree/bindings/net/marvell,prestera.txt index e28938ddfdf5..83370ebf5b89 100644 --- a/Documentation/devicetree/bindings/net/marvell,prestera.txt +++ b/Documentation/devicetree/bindings/net/marvell,prestera.txt @@ -45,37 +45,3 @@ dfx-server { ranges = <0 MBUS_ID(0x08, 0x00) 0 0x100000>; reg = ; }; - -Marvell Prestera SwitchDev bindings ------------------------------------ -Optional properties: -- compatible: must be "marvell,prestera" -- base-mac-provider: describes handle to node which provides base mac address, - might be a static base mac address or nvme cell provider. - -Example: - -eeprom_mac_addr: eeprom-mac-addr { - compatible = "eeprom,mac-addr-cell"; - status = "okay"; - - nvmem = <&eeprom_at24>; -}; - -prestera { - compatible = "marvell,prestera"; - status = "okay"; - - base-mac-provider = <&eeprom_mac_addr>; -}; - -The current implementation of Prestera Switchdev PCI interface driver requires -that BAR2 is assigned to 0xf6000000 as base address from the PCI IO range: - -&cp0_pcie0 { - ranges = <0x81000000 0x0 0xfb000000 0x0 0xfb000000 0x0 0xf0000 - 0x82000000 0x0 0xf6000000 0x0 0xf6000000 0x0 0x2000000 - 0x82000000 0x0 0xf9000000 0x0 0xf9000000 0x0 0x100000>; - phys = <&cp0_comphy0 0>; - status = "okay"; -}; From patchwork Thu Nov 17 21:55:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 21949 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp641025wrr; Thu, 17 Nov 2022 13:57:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf4+G0vS8RmaZ551e3ya1MwamqHM3O/Sw2sAI09kwAD0ToISqkzfFJbHpeNO6ODc22VcTgNl X-Received: by 2002:a62:1447:0:b0:56b:d027:214 with SMTP id 68-20020a621447000000b0056bd0270214mr4811632pfu.79.1668722219971; Thu, 17 Nov 2022 13:56:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668722219; cv=none; d=google.com; s=arc-20160816; b=nC9EDsswUwrbVRaS21YavUv5qOpVCITeuv+o4lF2q3yEBBjZyiD7whF10WyA4Libim RPQyz21/VB7Aec+AaSi81+iRUPp60L2egp7QWBegjhyKLoCzm+PW3qclU+NbUEMgBxiW FEe2hO/bCbjNs6FA41R7j0An2s8Y7hzEFxQ/EXXCW3a20A1/x4ufyfCVolYoDThilb3t zRcScJNqBYF7wryYnT4G8NRvah8dUqwc/QjKC9uvAH3OM6nbstoN8GWtaOMlW8EMkr0d w+CMVioKFwvvtSUBYWI+Rl0UqBeW3hgLC+d181kXxjSfFHVs82aAiRed69xhL01k8FC5 8q1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BfPYpwFw+JIzja3Q3OeYl2Qetdc/wSXMPCm2N01jyAk=; b=GTJxylHFzbFy+D+MYfgEoLJ3pUFhivPYbrf+MMECTohw0+XJcNCVFQg6pcPEjO2gTx lNe1CDZP4OnyRjWY3J3S1Ktae3iRBr7kD1GKQxo7murqajJDEqtOM0tQSZX9oOyJ/daF 4gP2jB7J1x/9XbGD2+Y1OUJTsCbYGCRZ4roaYnBjBUyKorU+7hopAmcj1WDl8n7X1767 58vab2bCADdxU6YBJ3PWPXhVmzxq4ci55obD3j7b7V9hGginfZeJr/YCyFF4Eaf1xHZ0 DB9aAUpaXqxmuvHUMkp+6lz3JN17NtiwfAMXIUyMmguJFMexZzjMr+lWb6RmntX1zQ6z t3QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=TifaughF; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020a056a0022cc00b00557bb4f6977si2034134pfj.106.2022.11.17.13.56.24; Thu, 17 Nov 2022 13:56:59 -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=@bootlin.com header.s=gm1 header.b=TifaughF; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240955AbiKQV4J (ORCPT + 99 others); Thu, 17 Nov 2022 16:56:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240924AbiKQV4H (ORCPT ); Thu, 17 Nov 2022 16:56:07 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C322A701B1; Thu, 17 Nov 2022 13:56:05 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id D65FA1C0004; Thu, 17 Nov 2022 21:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668722164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BfPYpwFw+JIzja3Q3OeYl2Qetdc/wSXMPCm2N01jyAk=; b=TifaughFUXInS7qkNbiXMv18rofUv4SYpxL7Pj8hC2vlwvyLmqCN/uZiPILci0evs8FmZ3 wrf4PVVRfI6mVHhaaUgk6O3W4ulqebmqohn9xCr2KJjA1GrPqemj57I+iljPhw3fUE4Dg2 bJetUUKSPMWfPyVAHQWbYRVz2qF24jkb3aBrq3xhOy40rzdRiOhcuUIZu8uZPsbDGNBaRJ ff4R5czcHFiTDnuJSB2iLKVJyIs/oEHXd/0ZEkIhYtnlQwdMT9tbH0FGcqCqy8Mox+VyXj 0EtW/sOHUQAuEeqrM4CNdPSJ82m2eX4b0mSOsBeV30nONmQD8+3Kj50OacSUEg== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org Cc: Marcin Wojtas , Russell King , Taras Chornyi , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Miquel Raynal Subject: [PATCH 2/6] dt-bindings: net: marvell,dfx-server: Convert to yaml Date: Thu, 17 Nov 2022 22:55:53 +0100 Message-Id: <20221117215557.1277033-3-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117215557.1277033-1-miquel.raynal@bootlin.com> References: <20221117215557.1277033-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749782070231243493?= X-GMAIL-MSGID: =?utf-8?q?1749782070231243493?= Even though this description is not used anywhere upstream (no matching driver), while on this file I decided I would try a conversion to yaml in order to clarify the prestera family description. I cannot keep the nodename dfx-server@xxxx so I switched to dfx-bus@xxxx which matches simple-bus.yaml. Otherwise I took the example context from the only user of this compatible: armada-xp-98dx3236.dtsi, which is a rather old and not perfect DT. Signed-off-by: Miquel Raynal --- I am fine dropping this file entirely as well, if judged useless. --- .../bindings/net/marvell,dfx-server.yaml | 60 +++++++++++++++++++ .../bindings/net/marvell,prestera.txt | 18 ------ 2 files changed, 60 insertions(+), 18 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/marvell,dfx-server.yaml diff --git a/Documentation/devicetree/bindings/net/marvell,dfx-server.yaml b/Documentation/devicetree/bindings/net/marvell,dfx-server.yaml new file mode 100644 index 000000000000..72151a78396f --- /dev/null +++ b/Documentation/devicetree/bindings/net/marvell,dfx-server.yaml @@ -0,0 +1,60 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/marvell,dfx-server.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Marvell Prestera DFX server + +maintainers: + - Miquel Raynal + +select: + properties: + compatible: + contains: + const: marvell,dfx-server + required: + - compatible + +properties: + compatible: + items: + - const: marvell,dfx-server + - const: simple-bus + + reg: true + + ranges: true + + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + +required: + - compatible + - reg + - ranges + +# The DFX server may expose clocks described as subnodes +additionalProperties: true + +examples: + - | + + #define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16)) + bus@0 { + reg = <0 0>; + #address-cells = <2>; + #size-cells = <1>; + + dfx-bus@ac000000 { + compatible = "marvell,dfx-server", "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 MBUS_ID(0x08, 0x00) 0 0x100000>; + reg = ; + }; + }; diff --git a/Documentation/devicetree/bindings/net/marvell,prestera.txt b/Documentation/devicetree/bindings/net/marvell,prestera.txt index 83370ebf5b89..8868d774da67 100644 --- a/Documentation/devicetree/bindings/net/marvell,prestera.txt +++ b/Documentation/devicetree/bindings/net/marvell,prestera.txt @@ -27,21 +27,3 @@ switch { dfx = <&dfx>; }; }; - -DFX Server bindings -------------------- - -Required properties: -- compatible: must be "marvell,dfx-server", "simple-bus" -- ranges: describes the address mapping of a memory-mapped bus. -- reg: address and length of the register set for the device. - -Example: - -dfx-server { - compatible = "marvell,dfx-server", "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 MBUS_ID(0x08, 0x00) 0 0x100000>; - reg = ; -}; From patchwork Thu Nov 17 21:55:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 21951 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp641124wrr; Thu, 17 Nov 2022 13:57:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Z6+k/+A4i6ucZb8ZYpV9croH/dqlJUlaAENiGliIPuvpoyKyJwLLz3Vc5aWE7j/Ythmkb X-Received: by 2002:a17:903:2782:b0:186:9cd5:d8d0 with SMTP id jw2-20020a170903278200b001869cd5d8d0mr4300164plb.168.1668722238050; Thu, 17 Nov 2022 13:57:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668722238; cv=none; d=google.com; s=arc-20160816; b=EAhtceg7MlsFXZCTnYyIDoIWxqd4inw9ooRrF4a9slAacvermUwWkfXfXF/bUAcPS4 nFIgioNcLaqs77oP8OwsPLz3KgYYmYTNMPoTpT1AjbPAnDLrV6jFoh4++gITWEmJTEAy 0jqwsLvn4lVxBHlLvCimXJahtfY2ukm3ccWCvWJVuX/4HpA53n0Yg6zvi+OZL5+kOxw7 A1gqNBW2/ip+jVIa+zkXfScgKs92KP5M3wTH0iL/FX3RtaCpFFP5VV4OK249Yoih78tV d8YMUBEYsxH3Cwt6mvMZBLHxN9MVEl0luvzFDm3VzwCsa/XPHQqMjCvJZWm277gMB4Mh 2Mpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ax0tNqoYutdKrIUuwqnf5IT6Ev2gIDY96QxRhHlvipw=; b=hfGMzoy2eWsw+RD3z+pkcTNxyzp3O1tgMLp25Pgm6McQIYSJfCvGlFcCdKlFFEKENg 7fablm48Rb+Z6TyfRzOzMs3U4JiGnvNJpkkqISqPXJXG2eqYIF4UFXYYRSm/QT2iNPs+ a+Bqz11D52YQ6MmZUgrZuEh3PK1cTLfCxz6YfKHOkGS/1Xv8KrPHuuB1N0TNuUru9Ijz BBggyM7w4FOGPjpdeN5wz4UHPhBM3QLfZjlwsbS60Jtw+A0oyvASqzlmJwNflQv9bNuq UlbrXdsYputCY8EtZ+ddnM8GxrHsjDSepQiq9CWktrUdyBfnvfk50rujLjpyI7ii6GEZ rQmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=e4cTCixn; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a056a0002cc00b005638baac87csi1712368pft.64.2022.11.17.13.57.04; Thu, 17 Nov 2022 13:57:18 -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=@bootlin.com header.s=gm1 header.b=e4cTCixn; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241011AbiKQV40 (ORCPT + 99 others); Thu, 17 Nov 2022 16:56:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240954AbiKQV4I (ORCPT ); Thu, 17 Nov 2022 16:56:08 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CEF36D48A; Thu, 17 Nov 2022 13:56:07 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id A580A1C0008; Thu, 17 Nov 2022 21:56:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668722166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ax0tNqoYutdKrIUuwqnf5IT6Ev2gIDY96QxRhHlvipw=; b=e4cTCixnOAi104+PoXmpHttdVUikNISxuJ/Uq41VOiMMQdgGuHW28PDgbvu1ZdW42eNMiX l+iA8x4YwYI4Io1tRxbaC+t9cJBPg8sAm9AQ+lkumc+uqRhMA7SPhpK8uFMFOwlfJI6KMj nTDePALFSCXqJSMCY5SCAxFzpUpqfVnD5208NyexV2iwAj76HxvN5AA6vooPg5JMo05b04 pkqt5tlmpjZULqnXmqGVW+hq+Z2m+kqvZFfzI9b46Ys69S0dF9oIAU5fpldqPi1vJfA0y8 y0fQZ+ItghMgGtq2NuNWN9ymhvXrM8+43jAi8ADZp/R4dNjouD1qGNpzliD9gg== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org Cc: Marcin Wojtas , Russell King , Taras Chornyi , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Miquel Raynal Subject: [PATCH 3/6] dt-bindings: net: marvell,prestera: Convert to yaml Date: Thu, 17 Nov 2022 22:55:54 +0100 Message-Id: <20221117215557.1277033-4-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117215557.1277033-1-miquel.raynal@bootlin.com> References: <20221117215557.1277033-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749782089702775479?= X-GMAIL-MSGID: =?utf-8?q?1749782089702775479?= The currently described switch family is named AlleyCat3, it is a memory mapped switch found on Armada XP boards. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring --- This patch (and the original txt file) can also be dropped if judged not worth the conversion as anyway in both cases there is no driver upstream for these devices. --- .../bindings/net/marvell,prestera.txt | 29 ------------ .../bindings/net/marvell,prestera.yaml | 45 +++++++++++++++++++ 2 files changed, 45 insertions(+), 29 deletions(-) delete mode 100644 Documentation/devicetree/bindings/net/marvell,prestera.txt create mode 100644 Documentation/devicetree/bindings/net/marvell,prestera.yaml diff --git a/Documentation/devicetree/bindings/net/marvell,prestera.txt b/Documentation/devicetree/bindings/net/marvell,prestera.txt deleted file mode 100644 index 8868d774da67..000000000000 --- a/Documentation/devicetree/bindings/net/marvell,prestera.txt +++ /dev/null @@ -1,29 +0,0 @@ -Marvell Prestera Switch Chip bindings -------------------------------------- - -Required properties: -- compatible: must be "marvell,prestera" and one of the following - "marvell,prestera-98dx3236", - "marvell,prestera-98dx3336", - "marvell,prestera-98dx4251", -- reg: address and length of the register set for the device. -- interrupts: interrupt for the device - -Optional properties: -- dfx: phandle reference to the "DFX Server" node - -Example: - -switch { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 MBUS_ID(0x03, 0x00) 0 0x100000>; - - packet-processor@0 { - compatible = "marvell,prestera-98dx3236", "marvell,prestera"; - reg = <0 0x4000000>; - interrupts = <33>, <34>, <35>; - dfx = <&dfx>; - }; -}; diff --git a/Documentation/devicetree/bindings/net/marvell,prestera.yaml b/Documentation/devicetree/bindings/net/marvell,prestera.yaml new file mode 100644 index 000000000000..b0a3ecca406e --- /dev/null +++ b/Documentation/devicetree/bindings/net/marvell,prestera.yaml @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/marvell,prestera.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Marvell Prestera AlleyCat3 switch + +maintainers: + - Miquel Raynal + +properties: + compatible: + items: + - enum: + - marvell,prestera-98dx3236 + - marvell,prestera-98dx3336 + - marvell,prestera-98dx4251 + - const: marvell,prestera + + reg: + maxItems: 1 + + interrupts: + maxItems: 3 + + dfx: + description: Reference to the DFX Server bus node. + $ref: /schemas/types.yaml#/definitions/phandle + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + packet-processor@0 { + compatible = "marvell,prestera-98dx3236", "marvell,prestera"; + reg = <0 0x4000000>; + interrupts = <33>, <34>, <35>; + dfx = <&dfx>; + }; From patchwork Thu Nov 17 21:55:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 21952 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp641233wrr; Thu, 17 Nov 2022 13:57:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Lul8RHJbTo9kp+cmIj4/1UUr5nmx3Ny6Rppc3HFA4CLCo0srPQdecdZEIf85zqxJuBeXx X-Received: by 2002:a50:fb89:0:b0:461:ecca:e8a with SMTP id e9-20020a50fb89000000b00461ecca0e8amr3913569edq.139.1668722260174; Thu, 17 Nov 2022 13:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668722260; cv=none; d=google.com; s=arc-20160816; b=uheX7pAlQFubcGnfLEjMii7WgUXgPI8TZLK/xlcmOXmf8/tsIQ8x6wkw7kKZkGc+OM T9K/XlgODGLRBTk03FRVtpDyPoQ7Jn0EPDfcx1afDf39VoIs67wud3Ro2Dq9rdjpkw1j IVzDHkwlAv8INpbsn+xGRsNQfaCIlhx21bovE/SSEA3AVXQz4CxZ5yTXC4sPMcoPjxkb 5HlHe6/mkDVDvG/TUgIi5PyEVrGZByrYY65moHp0+rxe3nfmFVcQ/7op8bg1lTc5iEn/ Aj9YRtwpPnwUgk6MMupbSVFIxZLUFIp4jEBPqt4EdK99RU1ktzitkCgtuBJSIiWz4o7q 6RNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yawSIzf80y+QPuk3p4CbTozUsBVN5TQDmNLqiNFv4Ko=; b=JTwN8WGRO5V8/ATkHmtr8PHxRwBrx0Xys38m6yk43bSUuZKZFUTRDlYyBC4wJ/1PCN qAZrHF6uSX1Wa9p4NbY+QvyrAr9yzYgG1pI7cv+60p86PSQvfnGvfoz0k+CZ11vaMpKc 4ux1hBIrKVrfyCAY+B3CCRqC+rdDnkszQAfw1eWaOdmP1HSOpwxy7E9TgMEesvbmRXbA 2fuo9e/0OQshv7kf1xOcglmi5o7XOEoNMVm5lBzfDs2mW0IcK54ftg/uY0n0OAaZEh1V BEpFwrcQvh9tWdChx/wUCJWjCNFt+j34RMoWly0WYme8C44jHJyfbg5Zqy/dhYcjMtLr SXUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ojAzpIa8; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020a05640226c400b0045743696acbsi1926976edd.139.2022.11.17.13.57.15; Thu, 17 Nov 2022 13:57:40 -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=@bootlin.com header.s=gm1 header.b=ojAzpIa8; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241027AbiKQV4m (ORCPT + 99 others); Thu, 17 Nov 2022 16:56:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240967AbiKQV4K (ORCPT ); Thu, 17 Nov 2022 16:56:10 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B14C701AF; Thu, 17 Nov 2022 13:56:09 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 83D961C0006; Thu, 17 Nov 2022 21:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668722168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yawSIzf80y+QPuk3p4CbTozUsBVN5TQDmNLqiNFv4Ko=; b=ojAzpIa8PSRxBGZ/3V/HQ+oOPwwBAw/DEbRDE8Zlcpuu6QRGjD9oQU2H93x5tSWQC57mUM 1EtWUHraeLj7DFAX8Nf5WgCDgo8w1jzn23sAJsqhddDa8Ip5eTGREIWVcUnY8lH7+ER6Pm zpQY/J7ZRimd1jLZVUwh0kJJpmkCH25IPYbEHcZLIw2YY3hF2SeKM2jMvBJyiEKhOg/Ex0 47ug83K9aCpCnxNncx7+67ln06UGin0Hc/kaRdlAYHu26GyRZ1pxHmGPCXQzf3tHtob2GK yVAJ1QRzJQU9+APnkHyc9BJWJr0dKklb6vy2hOlFTd74IbYuRyQxMf+k6erdZQ== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org Cc: Marcin Wojtas , Russell King , Taras Chornyi , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Miquel Raynal Subject: [PATCH 4/6] dt-bindings: net: marvell,prestera: Describe PCI devices of the prestera family Date: Thu, 17 Nov 2022 22:55:55 +0100 Message-Id: <20221117215557.1277033-5-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117215557.1277033-1-miquel.raynal@bootlin.com> References: <20221117215557.1277033-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749782112637177708?= X-GMAIL-MSGID: =?utf-8?q?1749782112637177708?= Even though the devices have very little in common beside the name and the main "switch" feature, Marvell Prestera switch family is also composed of PCI-only devices which can receive additional static properties, like nvmem cells to point at MAC addresses, for instance. Let's describe them. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring --- .../bindings/net/marvell,prestera.yaml | 55 ++++++++++++++++--- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/net/marvell,prestera.yaml b/Documentation/devicetree/bindings/net/marvell,prestera.yaml index b0a3ecca406e..f159fadf86ec 100644 --- a/Documentation/devicetree/bindings/net/marvell,prestera.yaml +++ b/Documentation/devicetree/bindings/net/marvell,prestera.yaml @@ -4,19 +4,24 @@ $id: http://devicetree.org/schemas/net/marvell,prestera.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Marvell Prestera AlleyCat3 switch +title: Marvell Prestera switch family maintainers: - Miquel Raynal properties: compatible: - items: + oneOf: + - items: + - enum: + - marvell,prestera-98dx3236 + - marvell,prestera-98dx3336 + - marvell,prestera-98dx4251 + - const: marvell,prestera - enum: - - marvell,prestera-98dx3236 - - marvell,prestera-98dx3336 - - marvell,prestera-98dx4251 - - const: marvell,prestera + - pci11ab,c804 + - pci11ab,c80c + - pci11ab,cc1e reg: maxItems: 1 @@ -28,10 +33,33 @@ properties: description: Reference to the DFX Server bus node. $ref: /schemas/types.yaml#/definitions/phandle + nvmem-cells: true + + nvmem-cell-names: true + +if: + properties: + compatible: + contains: + const: marvell,prestera + +# Memory mapped AlleyCat3 family +then: + properties: + nvmem-cells: false + nvmem-cell-names: false + required: + - interrupts + +# PCI Aldrin family +else: + properties: + interrupts: false + dfx: false + required: - compatible - reg - - interrupts additionalProperties: false @@ -43,3 +71,16 @@ examples: interrupts = <33>, <34>, <35>; dfx = <&dfx>; }; + + - | + pcie { + #address-cells = <3>; + #size-cells = <2>; + + switch@0,0 { + reg = <0x0 0x0 0x0 0x0 0x0>; + compatible = "pci11ab,c80c"; + nvmem-cells = <&mac_address 0>; + nvmem-cell-names = "mac-address"; + }; + }; From patchwork Thu Nov 17 21:55:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 21954 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp641507wrr; Thu, 17 Nov 2022 13:58:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf6tFbHZsiQWKCqEJgmuLkF0igsgm52Ei4o/C0nAa1r0J9RZd0qU99LxHOncuQvVztpPKuWL X-Received: by 2002:a63:ef42:0:b0:438:a46b:63f2 with SMTP id c2-20020a63ef42000000b00438a46b63f2mr3949920pgk.572.1668722309931; Thu, 17 Nov 2022 13:58:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668722309; cv=none; d=google.com; s=arc-20160816; b=YREOVN1ooIKYjbDtyO9QOy5Qj0yW2wrr+Pt7qex+V44GiMXIvoVvae3tVE4wU5CPb7 SIfwL4Qx2Eztbz6jTGnl31fijHpmzQK2BHM3AfEjGGzIT/82mf+UH4st2XwQBM9V5w96 i+ntDqpMVK1r6Xd+jAJ78roKV2eAL6271xSYrI2oVbeT3uasbMsgQrWK0sxKWwvyTmSr f7+bQVf7t6vWWSH4TVKaS93neZ6M4FB+OaggVqbNIW1zTv1gcMifiObKZfGWTP7oKXmx XGRzR3bAfdukqVPIlujpI9GCgsLPhY0nBmOTZ7YdVrC61+dCrRbybBSrhE4ZDG0BasK1 j4Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EiTXZxb081Yq5NNkWBz6w6sjlyDhWaDs7oz/56WKrNA=; b=BzhXw/tnnpe7aL2I4cC8lBzOf7SS+z1zU31LdK/TUCQVJSnbjoAEAIYJkp/UuBHhjr 6QzXA6vjOlTT+3jSOmvABytp+YJlXcXU/WOU4uZTPxsckJLBW3K3AzeHzvdVx1uwwjMz XBbqSesyOAPYzuMUiSd+Pvd+DdzfYYzijFCXV4T2xT8fkc+UQZzqOUSvdVmtEcGzVaB3 bdGPKvrrgAbLH9e8Ypc/ZQ+qTR0E1tQrd36+KZtC89eMjBG0x4oa9wIhVYYab6TtPGjT Ys13avJMW6Oj9Gfk9Y+LTXHaMVZsHmwICBRcu1ypNDRdgVPA71M6wc8DeLxLZbEvoU+p EEOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=G5Tf20En; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c22-20020a631c16000000b0046efd063864si2012069pgc.109.2022.11.17.13.58.17; Thu, 17 Nov 2022 13:58:29 -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=@bootlin.com header.s=gm1 header.b=G5Tf20En; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241075AbiKQV5G (ORCPT + 99 others); Thu, 17 Nov 2022 16:57:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240975AbiKQV4M (ORCPT ); Thu, 17 Nov 2022 16:56:12 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AA117208F; Thu, 17 Nov 2022 13:56:11 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 601D31C0005; Thu, 17 Nov 2022 21:56:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668722170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EiTXZxb081Yq5NNkWBz6w6sjlyDhWaDs7oz/56WKrNA=; b=G5Tf20EnfkAQSv27n4L27uE2jLAH3+81NXSpi6NWygE3N22a/E6UYI1OkS0qhQ6p0XATsZ OPgAj40ILTgLbMhYyOILXCWyqeNH5ghkwi0PDyRbiSgRTHrrLB1i3cQq5Th0BkZfVaCGiu S3IOVFhGA6mLXf/TmkBUZekrK4Iegw4TzCtkOWmTTn8lY8szMq6XVb0XRyHSptCCOW2xFb LLfClmSu/h3Eu6KiMpzWmc65cV9dMBh7wyMUl5fBIAeF0bHtHeacL4G+xeRMYm5ixRxKqO iMIoPhxk9lI9ZizylLOGXu0YUL2wODN7x3L4ZRKGRFOOnCzQqyRnrh36Owb8Jg== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org Cc: Marcin Wojtas , Russell King , Taras Chornyi , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Miquel Raynal Subject: [PATCH net-next 5/6] net: marvell: prestera: Avoid unnecessary DT lookups Date: Thu, 17 Nov 2022 22:55:56 +0100 Message-Id: <20221117215557.1277033-6-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117215557.1277033-1-miquel.raynal@bootlin.com> References: <20221117215557.1277033-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749782164972862371?= X-GMAIL-MSGID: =?utf-8?q?1749782164972862371?= This driver fist makes an expensive DT lookup to retrieve its DT node (this is a PCI driver) in order to later search for the base-mac-provider property. This property has no reality upstream and this code should not have been accepted like this in the first place. Instead, there is a proper nvmem interface that should be used. Let's avoid these extra lookups and rely on the nvmem internal logic. Signed-off-by: Miquel Raynal --- .../net/ethernet/marvell/prestera/prestera_main.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c index 24f9d6024745..d4b48f674a88 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_main.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c @@ -862,17 +862,10 @@ static void prestera_event_handlers_unregister(struct prestera_switch *sw) static int prestera_switch_set_base_mac_addr(struct prestera_switch *sw) { - struct device_node *base_mac_np; - int ret = 0; - - if (sw->np) { - base_mac_np = of_parse_phandle(sw->np, "base-mac-provider", 0); - if (base_mac_np) { - ret = of_get_mac_address(base_mac_np, sw->base_mac); - of_node_put(base_mac_np); - } - } + int ret; + if (sw->np) + ret = of_get_mac_address(sw->np, sw->base_mac); if (!is_valid_ether_addr(sw->base_mac) || ret) { eth_random_addr(sw->base_mac); dev_info(prestera_dev(sw), "using random base mac address\n"); @@ -1376,7 +1369,7 @@ static int prestera_switch_init(struct prestera_switch *sw) { int err; - sw->np = of_find_compatible_node(NULL, NULL, "marvell,prestera"); + sw->np = sw->dev->dev->of_node; err = prestera_hw_switch_init(sw); if (err) { From patchwork Thu Nov 17 21:55:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 21953 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp641339wrr; Thu, 17 Nov 2022 13:58:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf4zjB6VHs6NCAOobDjdGmoESChgC0o2yAmcdHy0xd6GuJ7AK++j3rWR12ex2fFhiQTzRuiH X-Received: by 2002:a17:902:ee89:b0:188:7a1f:fb18 with SMTP id a9-20020a170902ee8900b001887a1ffb18mr4788684pld.0.1668722281194; Thu, 17 Nov 2022 13:58:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668722281; cv=none; d=google.com; s=arc-20160816; b=Z3lv+/yaQut/j0Rx1YF6sVbcGMm9c6HA56uDCRRclqIBKK1FkMeDnRs3znsli7H2Fw XtTj9Jooh5nySxBSXsQXZCnv/AqTu3XCqsrYAukBzOikTez257VqCtq2zdSac6vju+jN vbq2kooiMxEj0eWzd1qg/JDw++e45/uG4U8seCk1/eIdLSCzxzuDPhqRxw5q8MtY0dKZ zEuC2EkFWWQKA/e2ZF/D9AAxm7+K1T/+9uo5e0VHxn3Znji+xhYCHyFH1YVhfBEkXHoW Fws02LWBPHYr47D4mW47xSfPxoIf9Y7EY9XbGqE+9HesyZebP6hGOozBeiaOQ4TNPXXq uKmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pnwcTEHTghwysLoyLNFVglyZaxT5Ls5k3YuYD2ZlLQk=; b=oXDS6i5dfqTasutVSVPNwod1/UZ0L4dCXS0XLJ8hlRPtSn5QD6SoKn/uVZrbDVf+bz F5FOdn6MHfT0pykLKj32AoNlRubqqDpVPhbQHn58a/pEeeclk0MoggP1Iwl4vtmfdjm7 0YiOo2pcOQDXo4GDKpAzMlkBsyr8/1QvXBCenl2yT5Qkd3X/EqRZN1+IKPr31P8Wnvpc tkoNE20Yz9Cmk62Mol/wR8JcRhT+rE2KluScaTDiDCZlv9Y+Q+hDLjKCFvzpEsBHuxuU 7XMiNV3skT8zHhibbALW7NJPFHv5/5J2REKNMznhf8JH7ibbcNhipB3+SFp1YF93ItFa ZuUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=pGduEhje; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w19-20020a170902d3d300b001825b1375ebsi1854322plb.544.2022.11.17.13.57.47; Thu, 17 Nov 2022 13:58:01 -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=@bootlin.com header.s=gm1 header.b=pGduEhje; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241045AbiKQV5D (ORCPT + 99 others); Thu, 17 Nov 2022 16:57:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241014AbiKQV4g (ORCPT ); Thu, 17 Nov 2022 16:56:36 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0694C720AF; Thu, 17 Nov 2022 13:56:12 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 2F74E1C0002; Thu, 17 Nov 2022 21:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668722171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pnwcTEHTghwysLoyLNFVglyZaxT5Ls5k3YuYD2ZlLQk=; b=pGduEhjemQPZpFe5yPmEqyzpTHt+2IF7nJ0J79XTjsXLCnJ6FaMTCtWNYI4y5b9Ir5oNO0 siuTj+UeXGN94dZ4kUWDf2pEeR96X/rph/aHn9UGUC3OseFPmwnSLGs6RRYQod5ItahMt5 V07els7hoQ8ncswGxXbeUHqRpbjL9bFagFpeSJpgazZgF/IXTKGtHR+mupY/0bRm9BCjda RTtHPlW1XAw6DeIM7PULKz56KWNWeVYLIlmww7/qKR6xLaQKJj0ARBJ4tNKDpqFqYYH/79 OOjXjHRLtf9Y7R3/0YFrJs3eG6/03t8O0XNfN0ty9IfjpDKfW8/ge4QO6UK+pw== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org Cc: Marcin Wojtas , Russell King , Taras Chornyi , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Miquel Raynal Subject: [PATCH net-next 6/6] net: mvpp2: Consider NVMEM cells as possible MAC address source Date: Thu, 17 Nov 2022 22:55:57 +0100 Message-Id: <20221117215557.1277033-7-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117215557.1277033-1-miquel.raynal@bootlin.com> References: <20221117215557.1277033-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749782134926212929?= X-GMAIL-MSGID: =?utf-8?q?1749782134926212929?= The ONIE standard describes the organization of tlv (type-length-value) arrays commonly stored within NVMEM devices on common networking hardware. Several drivers already make use of NVMEM cells for purposes like retrieving a default MAC address provided by the manufacturer. What made ONIE tables unusable so far was the fact that the information where "dynamically" located within the table depending on the manufacturer wishes, while Linux NVMEM support only allowed statically defined NVMEM cells. Fortunately, this limitation was eventually tackled with the introduction of discoverable cells through the use of NVMEM layouts, making it possible to extract and consistently use the content of tables like ONIE's tlv arrays. Parsing this table at runtime in order to get various information is now possible. So, because many Marvell networking switches already follow this standard, let's consider using NVMEM cells as a new valid source of information when looking for a base MAC address, which is one of the primary uses of these new fields. Indeed, manufacturers following the ONIE standard are encouraged to provide a default MAC address there, so let's eventually use it if no other MAC address has been found using the existing methods. Link: https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html Signed-off-by: Miquel Raynal --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index eb0fb8128096..7c8c323f4411 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -6104,6 +6104,12 @@ static void mvpp2_port_copy_mac_addr(struct net_device *dev, struct mvpp2 *priv, } } + if (!of_get_mac_address(to_of_node(fwnode), hw_mac_addr)) { + *mac_from = "nvmem cell"; + eth_hw_addr_set(dev, hw_mac_addr); + return; + } + *mac_from = "random"; eth_hw_addr_random(dev); }