Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp815024rwb; Wed, 28 Sep 2022 09:24:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5oX88mJuQMmXqrLq7bxUgWFTw5UOUgmHW1xzo2VVP0u1Pv7eugtmVPun0XmczFLzcafJ+0 X-Received: by 2002:a05:6402:40d3:b0:451:5249:d516 with SMTP id z19-20020a05640240d300b004515249d516mr33726653edb.154.1664382239862; Wed, 28 Sep 2022 09:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664382239; cv=none; d=google.com; s=arc-20160816; b=HnhVZa6eKoHv6xWjD3CWt8xkzN0DR0VfrVSaHpIr91s2m6src9wupEI/jxhqlXSj0u VUMW18pIt4c22vD/OtZ0IrJ4wBX5u2dXMOzB5UbsVPoJPmx0oPtqPSQ00q9w2JgQdET2 9YQckCpRWmsvB3tSGYYeCM8VneFQdqAXg7rNRtYNVM+nudgYCnCL2kUF/42THHV0JJas SPZFpZUa5Q9EUgSX8s0zRoaJTDIV/Rb7LTObakvS46kmMfAtBxBshSgsDi1rV81zvbCk +QjlkgwHGPEcDlVGspZzwa0ujAv0KiqInglMD+c1zMyVOZeVVIKMGlBF9CWusL5jU5sF z4qw== 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 :message-id:date:subject:to:from:dkim-signature; bh=vWZZWNiMdgL/tz57m+qrbONAdUONL1i0VSwNfH2Jq3Q=; b=xFo5dcc0Bk4x/pkk2XrBra7tHUiLUYrRNb6eEfKfmYGLQZgercF0erm2pxOA/Kcjka Mh9XUGevuOMT0G9Sb2X98cWY4YMkHt8ONiOqEt31jmgE0hM+7DFnHApzg2fqkmRYp8uA X6KIEY93rsKUjgk20e1/itfPv9RsGyPwlCI42JW4pPUhZJ1mfwqUTyFkLPG8hffYzNv+ 72lNKq71/lZpK2/b2YE4K6T6r3zYAtmUhu7tXYFhYE5JwjMC85Z5JL7u6i6eO05WLPUh cjEONDw/KTizQoh8aZk4ODP2GkhXxD9E1MJGftTM82ptxrsWnLukjLxycanvPE87L2KV dlXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=al0WrVlM; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i20-20020a05640242d400b00457a0fced64si7338976edc.552.2022.09.28.09.23.33; Wed, 28 Sep 2022 09:23:59 -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=@microchip.com header.s=mchp header.b=al0WrVlM; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234436AbiI1QVn (ORCPT + 99 others); Wed, 28 Sep 2022 12:21:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234324AbiI1QVi (ORCPT ); Wed, 28 Sep 2022 12:21:38 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07CC5E21C5; Wed, 28 Sep 2022 09:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1664382092; x=1695918092; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=VFLlzbowANTEuTplVjxC4dIg9DEzjoClVyh1LPKwaoA=; b=al0WrVlMYggAJMWUhnU8VCe65KKM6X5juciE44z3vYtpdO0TPj9xenMx deRXyBXtW7uu2LQJt2PiKvNINVEJ7Z3APTiEzPDH+XpnXhkSX1tyQhlwQ DMJ0pzlCZAReCbyf2O8GahOfvMPqe6K96FWiOCLzKcnAc8R0lItmaRT7n bQV3aFowvQYlrvjy5B5Hlzpb3V4kypAIbMlNc7+Cya1dLOk4n4kDxBif2 FT+7fpuF/BJbv5tmEKjLfq4Lg2lsZL4MoaZwXM/JIl/fWqbA7CzxAEbtG xdSxuONqlqI2Fkqxax+MlV2UDsqPGuQOytndIJCbPYC+gMMmfz95jP7Bj g==; X-IronPort-AV: E=Sophos;i="5.93,352,1654585200"; d="scan'208";a="182355220" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 28 Sep 2022 09:21:30 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Wed, 28 Sep 2022 09:21:29 -0700 Received: from ATX-DK-C33025.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Wed, 28 Sep 2022 09:21:28 -0700 From: Jerry Ray To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Rob Herring" , Krzysztof Kozlowski , , , , , Jerry Ray Subject: [net-next][PATCH v3] dt-bindings: dsa: lan9303: Add lan9303 yaml Date: Wed, 28 Sep 2022 11:21:28 -0500 Message-ID: <20220928162128.802-1-jerry.ray@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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: X-Mailing-List: linux-kernel@vger.kernel.org Adding the dt binding yaml for the lan9303 3-port ethernet switch. The microchip lan9354 3-port ethernet switch will also use the same binding. Signed-off-by: Jerry Ray --- v2->v3: - removed cpu labels - now patching against latest net-next v1->v2: - fixed dt_binding_check warning - added max-speed setting on the switches 10/100 ports. --- .../devicetree/bindings/net/dsa/lan9303.txt | 99 +------------- .../bindings/net/dsa/microchip,lan9303.yaml | 129 ++++++++++++++++++ MAINTAINERS | 8 ++ 3 files changed, 139 insertions(+), 97 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/dsa/microchip,lan9303.yaml diff --git a/Documentation/devicetree/bindings/net/dsa/lan9303.txt b/Documentation/devicetree/bindings/net/dsa/lan9303.txt index 46a732087f5c..8c8fedd1f00e 100644 --- a/Documentation/devicetree/bindings/net/dsa/lan9303.txt +++ b/Documentation/devicetree/bindings/net/dsa/lan9303.txt @@ -1,100 +1,5 @@ SMSC/MicroChip LAN9303 three port ethernet switch ------------------------------------------------- -Required properties: - -- compatible: should be - - "smsc,lan9303-i2c" for I2C managed mode - or - - "smsc,lan9303-mdio" for mdio managed mode - -Optional properties: - -- reset-gpios: GPIO to be used to reset the whole device -- reset-duration: reset duration in milliseconds, defaults to 200 ms - -Subnodes: - -The integrated switch subnode should be specified according to the binding -described in dsa/dsa.txt. The CPU port of this switch is always port 0. - -Note: always use 'reg = <0/1/2>;' for the three DSA ports, even if the device is -configured to use 1/2/3 instead. This hardware configuration will be -auto-detected and mapped accordingly. - -Example: - -I2C managed mode: - - master: masterdevice@X { - - fixed-link { /* RMII fixed link to LAN9303 */ - speed = <100>; - full-duplex; - }; - }; - - switch: switch@a { - compatible = "smsc,lan9303-i2c"; - reg = <0xa>; - reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>; - reset-duration = <200>; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { /* RMII fixed link to master */ - reg = <0>; - ethernet = <&master>; - }; - - port@1 { /* external port 1 */ - reg = <1>; - label = "lan1"; - }; - - port@2 { /* external port 2 */ - reg = <2>; - label = "lan2"; - }; - }; - }; - -MDIO managed mode: - - master: masterdevice@X { - phy-handle = <&switch>; - - mdio { - #address-cells = <1>; - #size-cells = <0>; - - switch: switch-phy@0 { - compatible = "smsc,lan9303-mdio"; - reg = <0>; - reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>; - reset-duration = <100>; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - ethernet = <&master>; - }; - - port@1 { /* external port 1 */ - reg = <1>; - label = "lan1"; - }; - - port@2 { /* external port 2 */ - reg = <2>; - label = "lan2"; - }; - }; - }; - }; - }; +See Documentation/devicetree/bindings/net/dsa/microchip,lan9303.yaml for the +device tree documentation covering the LAN9303 and LAN9354 devices. diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,lan9303.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,lan9303.yaml new file mode 100644 index 000000000000..818770092a2c --- /dev/null +++ b/Documentation/devicetree/bindings/net/dsa/microchip,lan9303.yaml @@ -0,0 +1,129 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/dsa/microchip,lan9303.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: LAN9303 Ethernet Switch Series Tree Bindings + +allOf: + - $ref: "dsa.yaml#" + +maintainers: + - UNGLinuxDriver@microchip.com + +properties: + compatible: + oneOf: + - enum: + - smsc,lan9303-mdio + - microchip,lan9354-mdio + - enum: + - smsc,lan9303-i2c + + reg: + maxItems: 1 + + reset-gpios: + description: Optional gpio specifier for a reset line + maxItems: 1 + + reset-duration: + description: Reset duration in milliseconds, defaults to 200 ms + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + #include + + //Ethernet switch connected via mdio to the host + ethernet0 { + #address-cells = <1>; + #size-cells = <0>; + phy-handle = <&lan9303switch>; + phy-mode = "rmii"; + fixed-link { + speed = <100>; + full-duplex; + }; + mdio { + #address-cells = <1>; + #size-cells = <0>; + lan9303switch: switch@0 { + compatible = "smsc,lan9303-mdio"; + dsa,member = <0 0>; + reg = <0>; + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + phy-mode = "rmii"; + ethernet = <ðernet>; + fixed-link { + speed = <100>; + full-duplex; + }; + }; + port@1 { + reg = <1>; + max-speed = <100>; + label = "lan1"; + }; + port@2 { + reg = <2>; + max-speed = <100>; + label = "lan2"; + }; + }; + }; + }; + }; + + //Ethernet switch connected via i2c to the host + ethernet1 { + #address-cells = <1>; + #size-cells = <0>; + phy-mode = "rmii"; + fixed-link { + speed = <100>; + full-duplex; + }; + }; + + i2c { + #address-cells = <1>; + #size-cells = <0>; + lan9303: switch@1a { + compatible = "smsc,lan9303-i2c"; + reg = <0x1a>; + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + phy-mode = "rmii"; + ethernet = <ðernet1>; + fixed-link { + speed = <100>; + full-duplex; + }; + }; + port@1 { + reg = <1>; + max-speed = <100>; + label = "lan1"; + }; + port@2 { + reg = <2>; + max-speed = <100>; + label = "lan2"; + }; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 5d58b55c5ae5..89055ff2838a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13386,6 +13386,14 @@ L: netdev@vger.kernel.org S: Maintained F: drivers/net/ethernet/microchip/lan743x_* +MICROCHIP LAN9303/LAN9354 ETHERNET SWITCH DRIVER +M: Jerry Ray +M: UNGLinuxDriver@microchip.com +L: netdev@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/net/dsa/microchip,lan9303.yaml +F: drivers/net/dsa/lan9303* + MICROCHIP LAN966X ETHERNET DRIVER M: Horatiu Vultur M: UNGLinuxDriver@microchip.com -- 2.25.1