From patchwork Wed Sep 27 07:34:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 114361 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4722840qgf; Wed, 27 Sep 2017 00:38:59 -0700 (PDT) X-Received: by 10.99.115.92 with SMTP id d28mr527891pgn.280.1506497939891; Wed, 27 Sep 2017 00:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506497939; cv=none; d=google.com; s=arc-20160816; b=ERQ0B6LhyLnqGA6ZrHEtb8hGNrLMi3iX6nhPBT+2dU14tPWIukgCkgVrsoDXqtIIi+ ZnCTLfZltRTLLGIe3ZI1hCJKSQi3ypMRhwaGAvJ6ZyAe7ebbmo1DrXrMOS8zMg4VGeVo FYUvJtzuzRm6NGGudPm/BO6+r2wslCtmJwT/sWMAZtRcbi7Dxyv+DmVghBNXsbNd7haY 1nAS4vedLedzIw+rujfae4eTElnPy+ta6SrVMYUEyhayKaxQNf42Wim5wFmH8JlQ3kPc x4Z+imoJJEB8ZT7EA68mO9ztWyhcIcaLHLrh1nzf/qTq/3QVmmEdvO7eJNNtlk5IwEsK oyWQ== 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=32R5TgMDZYCR9hvyqW2q/ceSSSJ6voqy3f/ojhl7Mu4=; b=YIOjAgAKwXiKLksFb4V0Wi4Qi6eVKn47YmwyLUzeWcs5MwlkNLTegoNHB0R/ENQin7 R6YCEgCJlQ8AC8bwwlKn+uGsmw10mdQuBgoy4b7heqTw1CLD5AmwAlztktPFwyGd29AF Qv1Y7TTVT4lg0UVeBYlorMKfxgBndCN0JF+Vs/pj1CXXVPrUZs8XwyAjV/S9g5HMymOu J/o/3PU/bGYEyUsZnyK4v6rV52y4YDDCi8o37KYXQfyAQowVR9MyRXTCUM8OyXbswRRG M1XSRCDMKCC4nb/3XSLzbFSIChz+zUGtzZV79fIbocattxepzyOetFgLh1fnmNlUTb3i f2BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r2K1lJHP; 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 l6si703733pgp.68.2017.09.27.00.38.59; Wed, 27 Sep 2017 00:38:59 -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=r2K1lJHP; 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 S1752622AbdI0Hi6 (ORCPT + 26 others); Wed, 27 Sep 2017 03:38:58 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:38901 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797AbdI0Hgk (ORCPT ); Wed, 27 Sep 2017 03:36:40 -0400 Received: by mail-wr0-f193.google.com with SMTP id p37so3667399wrb.5; Wed, 27 Sep 2017 00:36:39 -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=32R5TgMDZYCR9hvyqW2q/ceSSSJ6voqy3f/ojhl7Mu4=; b=r2K1lJHPgJxZmkrEIyVfdD0CX6a3zli3Y+hFzdCJvL4AvVB/uxgf1q0acfX44MlS3g 6lCh2g00Vo2cGhdwzrFrvCK72EQAVEH5FYOq2BdUMczTwtUsIWxiW+QUj5NwO9LmFrxY L9Y/l8h6QI+SOk9vHlN3duw6sN/peoPTg6BH1L9xAA8bkPfp0gAZQGm9+n1Dx4XvAqB9 ILX3gQtS/Xk6Vvzd7sEASAI3L/D33D+WafSO6SEftMOc7eiQ00Mwjwl1xMAAPvA1enLl FkS5yUPY2RJm7OZQFmh7/TTpDFywunRbKHLdkX4d9McLc4QLhYOzyj2xXtO9Cd+d6SqE 5j/g== 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=32R5TgMDZYCR9hvyqW2q/ceSSSJ6voqy3f/ojhl7Mu4=; b=SRu7oi96hrpYexY9Vq3K/pO76qjdt3MYwEcceKmTm3h7mrRxXA+jqbXUjDZfZZ1sX2 XF3wKCQ/aulrOIks1T3TqKRctSgm7sMMlJ4gqon+WvHev1uTFnJzfKRWnEHgZO6YHFEz 3P/HHDcRkLaj8087qqaUsJMy3BgKzRkBKk1h1PnymU5c+0iMsg9St3ELadi5NL0+eLi7 vs5/R1omSTMGGw59yIEGtWXpgqiBQKLmJ0PQm/6ANUT4D00JWtGp8wPuxEiJAF3vHulX Onw4BohnSUJLk06ongNuJCBBOxdM191fRCDXQd8c8jEcMPN5f/9j5Loy1O+tEICHc30/ 9Wpg== X-Gm-Message-State: AHPjjUiUs3Yfo/97P68sArtQE0Nuj8j2W89Q6E+W9JJ9nNTXt9xx+w2F 2E5OxTnxe3Iv7WKPIAh0z6Y= X-Google-Smtp-Source: AOwi7QCqIEwkvnXqe/ldfz+9v//c0DIl86m5v4pS5NeeVgqK+0dbxib1sbRSFOHUhi9ETXhGl0EwBw== X-Received: by 10.223.176.98 with SMTP id g31mr500107wra.117.1506497798742; Wed, 27 Sep 2017 00:36:38 -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 n9sm5660526wmd.12.2017.09.27.00.36.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Sep 2017 00:36:38 -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, frowand.list@gmail.com Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH v6 05/11] dt-bindings: net: dwmac-sun8i: update documentation about integrated PHY Date: Wed, 27 Sep 2017 09:34:08 +0200 Message-Id: <20170927073414.17361-6-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170927073414.17361-1-clabbe.montjoie@gmail.com> References: <20170927073414.17361-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 | 138 +++++++++++++++++++-- 1 file changed, 126 insertions(+), 12 deletions(-) -- 2.13.5 diff --git a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt index 725f3b187886..e2ef4683df08 100644 --- a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt +++ b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt @@ -4,18 +4,18 @@ This device is a platform glue layer for stmmac. Please see stmmac.txt for the other unchanged properties. Required properties: -- compatible: should be one of the following string: +- compatible: must be one of the following string: "allwinner,sun8i-a83t-emac" "allwinner,sun8i-h3-emac" "allwinner,sun8i-v3s-emac" "allwinner,sun50i-a64-emac" - reg: address and length of the register for the device. - interrupts: interrupt for the device -- interrupt-names: should be "macirq" +- interrupt-names: must be "macirq" - clocks: A phandle to the reference clock for this device -- clock-names: should be "stmmaceth" +- clock-names: must be "stmmaceth" - resets: A phandle to the reset control for this device -- reset-names: should be "stmmaceth" +- reset-names: must be "stmmaceth" - phy-mode: See ethernet.txt - phy-handle: See ethernet.txt - #address-cells: shall be 1 @@ -39,23 +39,38 @@ 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: with compatible "snps,dwmac-mdio" Required properties of the mdio node: - #address-cells: shall be 1 - #size-cells: shall be 0 -The device node referenced by "phy" or "phy-handle" should be a child node +The device node referenced by "phy" or "phy-handle" must 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 that the mdio node have a mdio-mux child +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: 1 for internal MDIO bus, 2 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 +- Must be a child of the integrated mdio -Example: - +Example with integrated PHY: emac: ethernet@1c0b000 { compatible = "allwinner,sun8i-h3-emac"; syscon = <&syscon>; @@ -72,13 +87,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 = <1>; + #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@2 { + reg = <2>; + #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 = <1>; + #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@2 { + reg = <2>; + #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>; }; }; };