From patchwork Thu Nov 24 11:15: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: 25459 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3335013wrr; Thu, 24 Nov 2022 03:24:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf6HkXuXCXlbuVgHOsrm3JenGv1qFtRTyk/qUCaNDiWWr0qPhgUBsz2aLRrnaysv2Ye5k7Fh X-Received: by 2002:a17:90b:2684:b0:218:907c:da24 with SMTP id pl4-20020a17090b268400b00218907cda24mr27755833pjb.18.1669289069830; Thu, 24 Nov 2022 03:24:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669289069; cv=none; d=google.com; s=arc-20160816; b=U2FUYOB9jmlwmRF5R6PiM3fPwa3SVRT2oLlnmkQhq4G9ppp4/ew5eUC6J5rxUtT02k o/8KFeZSOQZ4b3vpkjG+XUJxPS7wmx0SVjCxyf7md5Xd2yY7KWZ0LPTmk+4Ur+JoNvsk YxMD+fRCzXox27ynwtGdeKeGuNER9cAd74D9hdtfmGHHU8Tz+csJNk6Fwwbd6KVZbbu4 FR1RjOLceFfTTVkIdG/+8W+xKX4dWiutOkDNhnwjwqa+j/pK9yrSiPsuWPCaR06BcAYt +Xwk9FEwt/QUXV2yJsb7c0L9LcuB3XJwFkqkh9QVNSkUDCLCx+ooVSpz2eGk36iIKAWG VgbA== 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=HV9/wEcExWLHQQPoN4mFGB5lnbuV27WEICfLca/Ccg0=; b=PDnqpMBXK2OFIrGkQTviTxt5BwjKvecpJ+XhPeDp8ipSrK7dnudlrxCuuDqU0p4RDQ Tg7Mg04bzIowQjFu22YRYydAcqBPWpkYwQBAPjMjViZv/ySUyGrxT3o6zeQrJjXng2kg IdKs+twz+NpZIxkrLIIN4HOeVeEqwAWbgBCB7vgRIByNP2bldk9a4ekDJEAHKc41275o LzNWh6wLwdDSIK8Zod+2lrGGbj/zyaKg6kkF1go1mor5bpYSfUTHIubR/izf0DJA0EtX WOs7LkZtq3LfyBwxDnRqg8U3uzWZOZErb/OlaVUkBpwl6l7hN+2eiLgE8+X4Seunh170 V4og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=dRef3dKV; 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 x2-20020a056a00188200b00573f637f587si876937pfh.227.2022.11.24.03.24.16; Thu, 24 Nov 2022 03:24: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=dRef3dKV; 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 S230048AbiKXLQb (ORCPT + 99 others); Thu, 24 Nov 2022 06:16:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230072AbiKXLQ0 (ORCPT ); Thu, 24 Nov 2022 06:16:26 -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 223A26F827; Thu, 24 Nov 2022 03:16:15 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 7F04F1C001B; Thu, 24 Nov 2022 11:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1669288573; 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=HV9/wEcExWLHQQPoN4mFGB5lnbuV27WEICfLca/Ccg0=; b=dRef3dKVQm1MjPwdeKlmDsIQg65JK/ItXzI8EhvXIW1WoZcnr2hHPmVN2E5zGsQaEW7cHe OxtGw2q/VyZ0g4sP9IjLnIPizb6/rYqEl/SCzbm5EjybyUq5hgM0G43Cx/QlXohSKoiIlo jX+WH4NEAV5KZBZ6YcJtOhL/SBz8wgdhcgTorCUB43YltD8YXTtahbFQreaeQd3LzxXmUi 3fpR8M/bDW0K+ydZAKhmdrDtmanmq/s9R0dqEhOg1PQq/DDDN4mM8vpvLXtpIAmFQmhAHY 5a8+NHfap3GfF6IAkqJ68mx2nbNSe9/xJxFQUA6T7Ksf6P2XtM+W82qUeYI0XA== From: Miquel Raynal To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Marcin Wojtas , , , Vadym Kochan , Miquel Raynal , Rob Herring Subject: [PATCH net-next v2 4/7] dt-bindings: net: marvell,prestera: Describe PCI devices of the prestera family Date: Thu, 24 Nov 2022 12:15:53 +0100 Message-Id: <20221124111556.264647-5-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221124111556.264647-1-miquel.raynal@bootlin.com> References: <20221124111556.264647-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?1750376455675632379?= X-GMAIL-MSGID: =?utf-8?q?1750376455675632379?= 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 | 62 ++++++++++++++++--- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/net/marvell,prestera.yaml b/Documentation/devicetree/bindings/net/marvell,prestera.yaml index b0a3ecca406e..5ea8b73663a5 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,12 +33,37 @@ 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 +# Ports can also be described +additionalProperties: + type: object examples: - | @@ -43,3 +73,19 @@ examples: interrupts = <33>, <34>, <35>; dfx = <&dfx>; }; + + - | + pcie@0 { + #address-cells = <3>; + #size-cells = <2>; + ranges = <0x0 0x0 0x0 0x0 0x0 0x0>; + reg = <0x0 0x0 0x0 0x0 0x0 0x0>; + device_type = "pci"; + + switch@0,0 { + reg = <0x0 0x0 0x0 0x0 0x0>; + compatible = "pci11ab,c80c"; + nvmem-cells = <&mac_address 0>; + nvmem-cell-names = "mac-address"; + }; + };