From patchwork Fri Aug 18 12:21:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 9908533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6228560382 for ; Fri, 18 Aug 2017 12:25:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5180F28B52 for ; Fri, 18 Aug 2017 12:25:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4620C28C81; Fri, 18 Aug 2017 12:25:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DD78B28B52 for ; Fri, 18 Aug 2017 12:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=fI76hjFv8572oj+rbWh8yneZpESO1HMQ/I0hzlvhbrI=; b=pPYyi1yhqn9YBy2W8yjkDiWHby 103fDrQI4gM82bci3gya2sBp4ifbe9s/w8rl1u4NQFd27E/0EtV0aYyoy+nuIi7OW5NtZ1YnRz1g1 R345bFioFOkAQlHMRQ6f7j7GCgu+szfsGejgqXxzR5RJ6BKbrb7EjBlmnd75lLhbzuvlW0tRfSxsr tYWkQSOlVjIIdSDSUAOz6yOR67XezIi5+yJ9+d+DGNRkaSRFrRRQEUjQjeND1Ni5jmxHYNvFyEby1 tOQO/kL5HyCrbWTPOZkPFmzs+cODieZDonNN+DGTZdyZn9Etkd6Qy8ADZ/AnMd7IiZsI/NgiJ4tVW aBBoLVJA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1digKz-0001Ep-Hd; Fri, 18 Aug 2017 12:25:17 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1digKF-0007U9-An for linux-arm-kernel@lists.infradead.org; Fri, 18 Aug 2017 12:24:38 +0000 Received: by mail-wr0-x242.google.com with SMTP id 49so7223009wrw.5 for ; Fri, 18 Aug 2017 05:24:10 -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=ux4eSRT8KVEbNENdhnHvlTloj0TZ4mNIutHDQ7Ap2mc=; b=Bk9HGDD/8FXEDyyy20BHZ1RYmaRoyAZ6kMe5RWQcm2r5UH38uqGIVE+XtcBqgotsxq GEhJSElf0dvwna3oHJpGUOW9wrKsOOnOHAi2ZXtmyhFL79wAiQtAoKJnl7BPGyGHpn7L OJv0TSeUAa91yxILN0G6z2HqFvWC1Sk+TFLkh9Jzx64L04CDbExCGK9RhtripgfUZi8B sP61uKWRDazQ19+PnGBnYYHOoGb67GfeDunE8RyztHXonO/lju6FUDwRIHv1ZaGXpXz1 7TqaGnKxf5oyu+9rgRgwUBRxGmWg40EUEAkXwxiztV3LXnpoOKkmNzfFEucMbVtEnXq8 aGXw== 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=ux4eSRT8KVEbNENdhnHvlTloj0TZ4mNIutHDQ7Ap2mc=; b=hDe3d2IYeAO6MmeIXkNHyMJqCRCbedVJxD9O3lIxEmahMWt2qJJnHy/8dnUQVidHJM 0xgv2GlfHKl2WD+zN+1F6n5KOsXX2F9f69CQVan+C7fyVcqJ2slz/VaXfK4e+DGAHug2 4BIIUcNitfCtYdEV8hRFCwu4iLb5JY2fLJKJzikS8FeNUaFGuNeZp+bZeJ2EOEkA1KRO SnYKQ5gqEUnz3I4QzYer3JhavIkRe2NGw2GpJGSrVu3qMUJJ7X2+2udIvABKJ7Ht7c/u ccSplOxtm8NX48BsCDViAh9pbelm/g1/dP1h8rEvnUOqXzXr5jvkYAgo+ycvBg91Hi+9 h0qQ== X-Gm-Message-State: AHYfb5jhPmi+U8RVYh0JRvvZs9CQ2R09ZUrN8itIPFYIZwXmvjmXecUF O7d67eHVjfJbKg== X-Received: by 10.28.109.69 with SMTP id i66mr1347063wmc.44.1503059048657; Fri, 18 Aug 2017 05:24:08 -0700 (PDT) Received: from Red.local (LFbn-1-7109-228.w90-116.abo.wanadoo.fr. [90.116.45.228]) by smtp.googlemail.com with ESMTPSA id b23sm7754738wrd.40.2017.08.18.05.24.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Aug 2017 05:24:08 -0700 (PDT) From: Corentin Labbe To: robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, wens@csie.org, peppe.cavallaro@st.com, alexandre.torgue@st.com Subject: [PATCH v3 4/4] dt-bindings: net: dwmac-sun8i: update documentation about integrated PHY Date: Fri, 18 Aug 2017 14:21:18 +0200 Message-Id: <20170818122118.4925-5-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170818122118.4925-1-clabbe.montjoie@gmail.com> References: <20170818122118.4925-1-clabbe.montjoie@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170818_052432_015680_DB42FECD X-CRM114-Status: GOOD ( 12.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Corentin Labbe , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | 112 +++++++++++++++++++-- 1 file changed, 105 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt index 725f3b187886..631084122532 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 named mdio (or mdio_parent in case of H3) Required properties of the mdio node: - #address-cells: shall be 1 @@ -48,14 +48,21 @@ 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: +Required mdio-mux nodes for the following compatibles: + - "allwinner,sun8i-h3-emac", +- a mdio-mux node with compatible = "allwinner,sun8i-h3-mdio-switch" + - mdio-parent-bus: The parent bus is "mdio_parent" + - two child mdio, one for the integrated mdio, one for the external mdio + +Required properties of the integrated phy node with the following compatibles: - "allwinner,sun8i-h3-emac", - "allwinner,sun8i-v3s-emac": - 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>; @@ -75,10 +82,101 @@ emac: ethernet@1c0b000 { mdio: mdio { #address-cells = <1>; #size-cells = <0>; - int_mii_phy: ethernet-phy@1 { + }; + mdio-mux { + compatible = "allwinner,sun8i-h3-mdio-switch"; + mdio-parent-bus = <&mdio>; + #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@0 { + reg = <0>; + #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; + mdio: mdio { + #address-cells = <1>; + #size-cells = <0>; + }; + mdio-mux { + compatible = "allwinner,sun8i-h3-mdio-switch"; + mdio-parent-bus = <&mdio>; + #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@0 { + reg = <0>; + #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 { + #address-cells = <1>; + #size-cells = <0>; + ext_rgmii_phy: ethernet-phy@1 { reg = <1>; - clocks = <&ccu CLK_BUS_EPHY>; - resets = <&ccu RST_BUS_EPHY>; }; }; };