From patchwork Mon Jul 20 12:49:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kurt Kanzenbach X-Patchwork-Id: 1332319 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=WFQuZkPE; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=EFfpGgAT; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B9M625l8Rz9sSn for ; Mon, 20 Jul 2020 22:50:50 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729450AbgGTMup (ORCPT ); Mon, 20 Jul 2020 08:50:45 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:57552 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728224AbgGTMum (ORCPT ); Mon, 20 Jul 2020 08:50:42 -0400 From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1595249439; 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=XtACNWaES3mQkzXBC/9ErRbnkcOL4Ew5cJ2sE4iNn5c=; b=WFQuZkPE2H9fQkb5/v965EaPTDp/+mgQl4NQe6Hwnqn5eXfWc78BIRTibJtfQyMTZwsjmK iSPIdcKhy2DLqOJqkXq6de1SJTgo7HFcQM3gpVulpvbui8bRQeo1ysksV5lJiacPgdAv04 WrXHYeaOhBMHIn7Iu8nElg/MB/vrnsjkP0Bj6w8TZRntBm3Lr5hMa2rw2Co2+cbI4YqQxI JdU/6QN6eVD4sHVY48Swrf3Cx3/3LkhXWwz3ZBgS7PxUNIODAfJmIl+a3JLZDP/dcSgJ9R 6AGDKcEJSzTxzftyZyj5mDV0Kt8/UhJFKq1rHD07Ue0zRZy0ZAJgtE6VJ8ZRaQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1595249439; 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=XtACNWaES3mQkzXBC/9ErRbnkcOL4Ew5cJ2sE4iNn5c=; b=EFfpGgATyBWGJzqk6zoIu46xm35nIKtCx8dhfve4sVqdJVUhFBcj5Q6g9lawVgZPD4hyQf SmymE3/9beZVlfDA== To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Rob Herring Cc: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, devicetree@vger.kernel.org, Kurt Kanzenbach Subject: [PATCH v2 1/3] dt-bindings: net: dsa: Add DSA yaml binding Date: Mon, 20 Jul 2020 14:49:37 +0200 Message-Id: <20200720124939.4359-2-kurt@linutronix.de> In-Reply-To: <20200720124939.4359-1-kurt@linutronix.de> References: <20200720124939.4359-1-kurt@linutronix.de> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For future DSA drivers it makes sense to add a generic DSA yaml binding which can be used then. This was created using the properties from dsa.txt. It includes the ports and the dsa,member property. Suggested-by: Florian Fainelli Signed-off-by: Kurt Kanzenbach --- .../devicetree/bindings/net/dsa/dsa.yaml | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/dsa/dsa.yaml diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml new file mode 100644 index 000000000000..faea214339ca --- /dev/null +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml @@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/dsa/dsa.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ethernet Switch Device Tree Bindings + +maintainers: + - Andrew Lunn + - Florian Fainelli + - Vivien Didelot + +description: + This binding represents Ethernet Switches which have a dedicated CPU + port. That port is usually connected to an Ethernet Controller of the + SoC. Such setups are typical for embedded devices. + +select: false + +properties: + $nodename: + pattern: "^switch(@.*)?$" + + dsa,member: + minItems: 2 + maxItems: 2 + description: + A two element list indicates which DSA cluster, and position within the + cluster a switch takes. <0 0> is cluster 0, switch 0. <0 1> is cluster 0, + switch 1. <1 0> is cluster 1, switch 0. A switch not part of any cluster + (single device hanging off a CPU port) must not specify this property + $ref: /schemas/types.yaml#/definitions/uint32-array + +patternProperties: + "^(ethernet-)?ports$": + type: object + properties: + '#address-cells': + const: 1 + '#size-cells': + const: 0 + + patternProperties: + "^(ethernet-)?port@[0-9]+$": + type: object + description: Ethernet switch ports + + properties: + reg: + description: Port number + + label: + description: + Describes the label associated with this port, which will become + the netdev name + $ref: /schemas/types.yaml#definitions/string + + link: + description: + Should be a list of phandles to other switch's DSA port. This + port is used as the outgoing port towards the phandle ports. The + full routing information must be given, not just the one hop + routes to neighbouring switches + $ref: /schemas/types.yaml#definitions/phandle-array + + ethernet: + description: + Should be a phandle to a valid Ethernet device node. This host + device is what the switch port is connected to + $ref: /schemas/types.yaml#definitions/phandle + + phy-handle: true + + phy-mode: true + + fixed-link: true + + mac-address: true + + required: + - reg + + additionalProperties: false + +oneOf: + - required: + - ports + - required: + - ethernet-ports + +...