From patchwork Fri Sep 8 07:11:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 112018 Delivered-To: patch@linaro.org Received: by 10.140.94.239 with SMTP id g102csp1127313qge; Fri, 8 Sep 2017 00:16:14 -0700 (PDT) X-Received: by 10.99.4.88 with SMTP id 85mr2159245pge.410.1504854974796; Fri, 08 Sep 2017 00:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504854974; cv=none; d=google.com; s=arc-20160816; b=Qkh4kb508aHpl4ASHToy1qe1MlWNpWXkySQ5gKgmkan/AcVVLAqCbT9mOPPXKvIKu4 f2YC/hmPf6Ow1/pQr8iFPLNvWUBQK69GAJ1eKDBUAk/ExmD3q9hcFRISMv1I0WsWeQTa JpHF7TcXuKWSf0co2Z5CbYTbNYQVCxyY0i3StT20LwgFikVPVgQOhijDeScBi/X6nbsJ aMWhEL/wCKW2IoJMgvWRwGUNvGmzlhb9Fi1M2L5ji4dji5EEF4vnboZuG1oHGoBm/u4I vxMLIXqtCcY1CL5tqXGj8PS99//uRcA73+htM1NoeJLbsqHgx8AkrtosUhJQYsLR5n2k eVxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=v3OUF9wjayWVPy9qPBPci63XPYFyt5bnNKMvxB0Ytbc=; b=IhtlN7hENkVC0Q84h7saX+Gdi0SZfGJfKR8od4++6xLN6UKXg1kIgms6XhAHhaHYb8 j3d/ST8/3rw1flkjeC04+3OIQ/SJFc6a36z6HKJgA2WxZpqHDmclZSVcfeQuCaiL3NxI icnro83/7MbSuhVZ9txLjlqjpaLDNffWqKsPMqER6pgBOiUyDQiWWu34sTLi6jZXBd37 cbLu0Q/O2FFyUmcPYzpB7MxkJhWtCENA4guRi/AIPw3aggN4p+KfV8fVWwPzk12eRrXd HV4D0J6nphPCnyj6OSO0xDFCjxGzT5PdR5bwL6H3IdeOISZNd/RRiAvGfJVFwtrA+p/j RsFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cOT/WfUU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x73si1121360pfk.240.2017.09.08.00.16.14; Fri, 08 Sep 2017 00:16:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cOT/WfUU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756109AbdIHHQL (ORCPT + 26 others); Fri, 8 Sep 2017 03:16:11 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:32909 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755041AbdIHHOO (ORCPT ); Fri, 8 Sep 2017 03:14:14 -0400 Received: by mail-wr0-f194.google.com with SMTP id b9so832846wra.0; Fri, 08 Sep 2017 00:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=v3OUF9wjayWVPy9qPBPci63XPYFyt5bnNKMvxB0Ytbc=; b=cOT/WfUU5zhn5ZxhajtgrZgqc1oR23G84iaRnxbK+I4c8iqSmb4qLgQwn3NZtWkEWc 20li5fGk/t8lW+/1rgGYpPPLxo1W5n20MsbWW52wxIBACkzujHXngKedcrecGNENyK0h rTDtQtBAdWW8ANecMJKspLnxUnhHwJCi4oJVlO5wpWOZhAt8ZVh2Tz/maHmogMUUf5BL 2vy9H0r5Jvu+cj1aQNz5dVv/nX30u12Qn4OUUA4WZu6P3m8jfjk87foGkQLz3E73pIKi ajSyL9v5oHIhlosaEMufDtN4tB0xlVhDGFLDVARvul04HMidwsqyW4+zh5B2P9UzbOv8 kCwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=v3OUF9wjayWVPy9qPBPci63XPYFyt5bnNKMvxB0Ytbc=; b=J9MaZerEUKuq8X1w7uYytAgM8QV4WesLqBGXRCSWUd/YWmycTbfyUTkW1QsQ29twj0 zHHSJ0wRpLjjpjfQYmVNYAxLe/YBq3Bj9mc67artg9lmjwNUdG2Knbb0fajn+CSgQ3aP TFbreZMUTpTmxEFklo4FYH5cwNh7FxubK6ES1IEKLJ5K6SIkJfXYnJTB0KwzsP2GE5gH hJSioFbNhC4nk5nyJ8KSs5xAJa+rv08beYWKFCQJ/giKwC/3KPxlspHaZysTjc1WKBMh vOIbP6/mYD0oxuOjGiVIsa7X6AxWQl1Q06XqkNiLHrWjbgkOmGSu0ckVeQFaiBkBXrUe FQxQ== X-Gm-Message-State: AHPjjUhSKkAcDveoxBOTnR/c0M30L7DmWW79+HGHOMsNf7BN3myqLiKf 78Xh8s/UMFEOAQ== X-Google-Smtp-Source: ADKCNb66qebnX3Asp0WoXrDRKAuqySN185agnrZKo6A5JceON4kvT1JToULP6KGjqBgicwBYIyOEfg== X-Received: by 10.223.174.214 with SMTP id y80mr1257142wrc.192.1504854853236; Fri, 08 Sep 2017 00:14:13 -0700 (PDT) Received: from Red.local (LFbn-MAR-1-580-96.w90-118.abo.wanadoo.fr. [90.118.159.96]) by smtp.googlemail.com with ESMTPSA id l19sm684566wrl.47.2017.09.08.00.14.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Sep 2017 00:14:12 -0700 (PDT) From: Corentin Labbe To: robh+dt@kernel.org, mark.rutland@arm.com, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, peppe.cavallaro@st.com, alexandre.torgue@st.com, andrew@lunn.ch, f.fainelli@gmail.com Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH v5 05/10] dt-bindings: net: dwmac-sun8i: update documentation about integrated PHY Date: Fri, 8 Sep 2017 09:11:51 +0200 Message-Id: <20170908071156.5115-6-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170908071156.5115-1-clabbe.montjoie@gmail.com> References: <20170908071156.5115-1-clabbe.montjoie@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch add documentation about the MDIO switch used on sun8i-h3-emac for integrated PHY. Signed-off-by: Corentin Labbe --- .../devicetree/bindings/net/dwmac-sun8i.txt | 127 +++++++++++++++++++-- 1 file changed, 120 insertions(+), 7 deletions(-) -- 2.13.5 diff --git a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt index 725f3b187886..3fa0e54825ea 100644 --- a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt +++ b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt @@ -39,7 +39,7 @@ Optional properties for the following compatibles: - allwinner,leds-active-low: EPHY LEDs are active low Required child node of emac: -- mdio bus node: should be named mdio +- mdio bus node: should be labelled mdio Required properties of the mdio node: - #address-cells: shall be 1 @@ -48,14 +48,28 @@ Required properties of the mdio node: The device node referenced by "phy" or "phy-handle" should be a child node of the mdio node. See phy.txt for the generic PHY bindings. -Required properties of the phy node with the following compatibles: +The following compatibles require an mdio-mux node called "mdio-mux": + - "allwinner,sun8i-h3-emac" + - "allwinner,sun8i-v3s-emac": +Required properties for the mdio-mux node: + - compatible = "mdio-mux" + - one child mdio for the integrated mdio + - one child mdio for the external mdio if present (V3s have none) +Required properties for the mdio-mux children node: + - reg: 0 for internal MDIO bus, 1 for external MDIO bus + +The following compatibles require a PHY node representing the integrated +PHY, under the integrated MDIO bus node if an mdio-mux node is used: - "allwinner,sun8i-h3-emac", - "allwinner,sun8i-v3s-emac": + +Required properties of the integrated phy node: - clocks: a phandle to the reference clock for the EPHY - resets: a phandle to the reset control for the EPHY +- phy-is-integrated +- Should be a child of the integrated mdio -Example: - +Example with integrated PHY: emac: ethernet@1c0b000 { compatible = "allwinner,sun8i-h3-emac"; syscon = <&syscon>; @@ -72,13 +86,112 @@ emac: ethernet@1c0b000 { phy-handle = <&int_mii_phy>; phy-mode = "mii"; allwinner,leds-active-low; + + mdio0: mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + }; + + mdio-mux { + compatible = "mdio-mux"; + #address-cells = <1>; + #size-cells = <0>; + + int_mdio: mdio@1 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + int_mii_phy: ethernet-phy@1 { + reg = <1>; + clocks = <&ccu CLK_BUS_EPHY>; + resets = <&ccu RST_BUS_EPHY>; + phy-is-integrated + }; + }; + ext_mdio: mdio@0 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; + +Example with external PHY: +emac: ethernet@1c0b000 { + compatible = "allwinner,sun8i-h3-emac"; + syscon = <&syscon>; + reg = <0x01c0b000 0x104>; + interrupts = ; + interrupt-names = "macirq"; + resets = <&ccu RST_BUS_EMAC>; + reset-names = "stmmaceth"; + clocks = <&ccu CLK_BUS_EMAC>; + clock-names = "stmmaceth"; + #address-cells = <1>; + #size-cells = <0>; + + phy-handle = <&ext_rgmii_phy>; + phy-mode = "rgmii"; + allwinner,leds-active-low; + + mdio0: mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + }; + + mdio-mux { + compatible = "mdio-mux"; + #address-cells = <1>; + #size-cells = <0>; + + int_mdio: mdio@1 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + int_mii_phy: ethernet-phy@1 { + reg = <1>; + clocks = <&ccu CLK_BUS_EPHY>; + resets = <&ccu RST_BUS_EPHY>; + phy-is-integrated + }; + }; + ext_mdio: mdio@0 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + ext_rgmii_phy: ethernet-phy@1 { + reg = <1>; + }; + }; + }; +}; + +Example with SoC without integrated PHY + +emac: ethernet@1c0b000 { + compatible = "allwinner,sun8i-a83t-emac"; + syscon = <&syscon>; + reg = <0x01c0b000 0x104>; + interrupts = ; + interrupt-names = "macirq"; + resets = <&ccu RST_BUS_EMAC>; + reset-names = "stmmaceth"; + clocks = <&ccu CLK_BUS_EMAC>; + clock-names = "stmmaceth"; + #address-cells = <1>; + #size-cells = <0>; + + phy-handle = <&ext_rgmii_phy>; + phy-mode = "rgmii"; + mdio: mdio { + compatible = "snps,dwmac-mdio"; #address-cells = <1>; #size-cells = <0>; - int_mii_phy: ethernet-phy@1 { + ext_rgmii_phy: ethernet-phy@1 { reg = <1>; - clocks = <&ccu CLK_BUS_EPHY>; - resets = <&ccu RST_BUS_EPHY>; }; }; };