From patchwork Tue May 30 10:44:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 768541 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wcVcR3s7Gz9s3T for ; Tue, 30 May 2017 20:45:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751415AbdE3Ko6 (ORCPT ); Tue, 30 May 2017 06:44:58 -0400 Received: from nbd.name ([46.4.11.11]:50255 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249AbdE3Koz (ORCPT ); Tue, 30 May 2017 06:44:55 -0400 From: John Crispin To: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S . Miller" , Sean Wang Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, John Crispin , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH V2 1/3] Documentation: devicetree: add multiple cpu port DSA binding Date: Tue, 30 May 2017 12:44:17 +0200 Message-Id: <20170530104419.6052-1-john@phrozen.org> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Extend the DSA binding documentation, adding the new property required when there is more than one CPU port attached to the switch. Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: John Crispin --- Documentation/devicetree/bindings/net/dsa/dsa.txt | 61 ++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.txt b/Documentation/devicetree/bindings/net/dsa/dsa.txt index cfe8f64eca4f..c164eb38ccc5 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa.txt +++ b/Documentation/devicetree/bindings/net/dsa/dsa.txt @@ -55,6 +55,11 @@ A user port has the following optional property: - label : Describes the label associated with this port, which will become the netdev name. +- cpu : Option for non "cpu"/"dsa" ports. A phandle to a + "cpu" port, which will be used for passing packets + from this port to the host. If not present, the first + "cpu" port will be used. + Port child nodes may also contain the following optional standardised properties, described in binding documents: @@ -71,7 +76,7 @@ properties, described in binding documents: Documentation/devicetree/bindings/net/fixed-link.txt for details. -Example +Examples The following example shows three switches on three MDIO busses, linked into one DSA cluster. @@ -264,6 +269,60 @@ linked into one DSA cluster. }; }; +The following example shows a switch that has two cpu ports each connecting +to a different MAC. + +&mdio0 { + switch@0 { + compatible = "mediatek,mt7530"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + label = "lan0"; + cpu = <&cpu_port1>; + }; + + port@1 { + reg = <1>; + label = "lan1"; + cpu = <&cpu_port1>; + }; + + port@2 { + reg = <2>; + label = "lan2"; + cpu = <&cpu_port1>; + }; + + port@3 { + reg = <3>; + label = "wan"; + cpu = <&cpu_port2>; + }; + + cpu_port2: port@5 { + reg = <5>; + label = "cpu"; + ethernet = <&gmac2>; + phy-mode = "trgmii"; + }; + + cpu_port1: port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac1>; + phy-mode = "trgmii"; + }; + }; + }; +}; + Deprecated Binding ------------------