From patchwork Mon Sep 12 15:01:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 9326733 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 AB0CB6077F for ; Mon, 12 Sep 2016 15:04:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C26128CBF for ; Mon, 12 Sep 2016 15:04:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90C8428D1F; Mon, 12 Sep 2016 15:04:20 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9244528CBF for ; Mon, 12 Sep 2016 15:04:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bjSkY-0006xb-RE; Mon, 12 Sep 2016 15:02:22 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bjSk5-0006dF-8n for linux-arm-kernel@lists.infradead.org; Mon, 12 Sep 2016 15:01:58 +0000 Received: by mail-wm0-x22e.google.com with SMTP id c131so62517116wmh.0 for ; Mon, 12 Sep 2016 08:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8NFQGwI2OgPTM9Gvkp/Jj3mrVAra+atvFYuTRxev3mk=; b=Gq4LUYTxFBuYHrRdgYle8HFGsF3kAN5dFESzllLOA1DiNV2afsAj5hf1OMLMu6CMPg TE0K3TphHRr5Kf8sV8uxiX+d/USWSy0d29u+R8T/qADNfCObVqlzlY395RihpGNFryZN uVz+La5A+JWnb5RYLsBKbTMTmfBOuDLLOECUnEriEs0Mw6qGJvDQTVY0Rkvca3Y+jMds n2akxVUJZUA6z9pZ/JFi6iC0KM3ZcHi45b3nqSMidgxE+u7q13e7xT7TRXetsbh6UmlB PcBvrloG2+qU/jt8d279ufSteqK6kBsArUpTDpsufvhn2rwdCFzHIhCT3UkH7NvILeFw NPvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8NFQGwI2OgPTM9Gvkp/Jj3mrVAra+atvFYuTRxev3mk=; b=JObfhaem/Duhika/e51qcPxTVONL1NjCkKcACEmbD2BECtMCkxiQcp4TQ3rZ/QPOPL 6nBrbuZ3phXQxCLG/XPIajy5WJ9+935PfreOqtiHmbUZ++/YGSwiGXa2xcgfjKif/9Km GkrdGG8GboUAaDssecJb//gV731JUrNwuJM92VB5vnNZAlEgRX4tkm+ZShn2E06tJZse O4BYmgN9zwuK5o1uo0kZ5Zf/9QEKQzXAS7IQiJgz1HrkGDnTYZ0X9K0xHFEqa79u1gTb 5Zrg+5MT1d9rBrMFZf/SM3yfzP4OwuPzx3qJAiMCqNPt8BLCOM+vRcPUUtf/JlVTNZ4E fx/g== X-Gm-Message-State: AE9vXwOm6TChkaVHuetkL4n/5ZCu4qznMJdb0Ao0QrfG75xq4LLgwrnvm6wAy6EAhU1BoA== X-Received: by 10.194.116.197 with SMTP id jy5mr15668595wjb.19.1473692489570; Mon, 12 Sep 2016 08:01:29 -0700 (PDT) Received: from Red ([2a01:cb1d:141:5200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id q139sm631710wmb.18.2016.09.12.08.01.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2016 08:01:28 -0700 (PDT) Date: Mon, 12 Sep 2016 17:01:25 +0200 From: LABBE Corentin To: Andrew Lunn Subject: Re: [PATCH v3 3/9] ARM: sun8i: dt: Add DT bindings documentation for Allwinner sun8i-emac Message-ID: <20160912150125.GA15570@Red> References: <1473425117-18645-1-git-send-email-clabbe.montjoie@gmail.com> <1473425117-18645-4-git-send-email-clabbe.montjoie@gmail.com> <20160909140413.GD30871@lunn.ch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160909140413.GD30871@lunn.ch> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160912_080153_570658_148CF182 X-CRM114-Status: GOOD ( 20.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, wens@csie.org, robh+dt@kernel.org, maxime.ripard@free-electrons.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org 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 On Fri, Sep 09, 2016 at 04:04:13PM +0200, Andrew Lunn wrote: > > +The device node referenced by "phy" or "phy-handle" should be a child node > > +of this node. See phy.txt for the generic PHY bindings. > > I've not looked at the code yet, but is this really true? Generally > there is not this limitation. You can point to any Ethernet phy > anyway, so long as it is on am MDIO bus. > > > + > > +Optional properties: > > +- allwinner,tx-delay: TX clock delay chain value. Range value is 0-0x07. Default is 0) > > +- allwinner,rx-delay: RX clock delay chain value. Range value is 0-0x1F. Default is 0) > > + > > +The TX/RX clock delay chain settings are board specific. > > + > > +Optional properties for "allwinner,sun8i-h3-emac": > > +- allwinner,leds-active-low: EPHY LEDs are active low > > + > > +Example: > > + > > +emac: ethernet@01c0b000 { > > + compatible = "allwinner,sun8i-h3-emac"; > > + syscon = <&syscon>; > > + reg = <0x01c0b000 0x104>; > > + reg-names = "emac"; > > + interrupts = ; > > + resets = <&ccu RST_BUS_EMAC>, <<&ccu RST_BUS_EPHY>; > > + reset-names = "ahb", "ephy"; > > + clocks = <&ccu CLK_BUS_EMAC>, <&ccu CLK_BUS_EPHY>; > > + clock-names = "ahb", "ephy"; > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + phy = <&phy1>; > > ethernet.txt say: > > - phy: the same as "phy-handle" property, not recommended for new bindings. > > This is a new binding, please don't support it. > > > + phy-mode = "mii"; > > + allwinner,leds-active-low; > > + > > + phy1: ethernet-phy@1 { > > + reg = <1>; > > + }; > > It is normal to place these phy nodes inside an container node called > mdio. > Hello Since the MDIO bus is a part of the sun8i-emac, does I really need to create such a mdio node ? All example I found are mdio bus with separate driver. (others driver have the phy directly in [eg]mac node. Anyway I try the following patch to solve your comments, but it breaks the PHY finding(Could not attach to PHY). Regards -->8-- &crypto { --- a/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts @@ -166,14 +166,18 @@ status = "okay"; }; +&mdio { + reg = <1>; + phy1: ethernet-phy@1 { + reg = <1>; + }; +}; + &emac { - phy = <&phy1>; + phy-handle = <&phy1>; phy-mode = "mii"; allwinner,leds-active-low; status = "okay"; - phy1: ethernet-phy@1 { - reg = <1>; - }; };/arch/arm/boot/dts/sun8i-h3.dtsi +++ b/arch/arm/boot/dts/sun8i-h3.dtsi @@ -474,6 +474,11 @@ #address-cells = <1>; #size-cells = <0>; status = "disabled"; + + mdio: mdio@0 { + #address-cells = <1>; + #size-cells = <0>; + }; }; crypto: crypto@1c15000 { --- a/drivers/net/ethernet/allwinner/sun8i-emac.c +++ b/drivers/net/ethernet/allwinner/sun8i-emac.c @@ -2122,7 +2122,7 @@ static int sun8i_emac_probe(struct platform_device *pdev) return -EINVAL; } - priv->phy_node = of_parse_phandle(node, "phy", 0); + priv->phy_node = of_parse_phandle(node, "phy-handle", 0); if (!priv->phy_node) { netdev_err(ndev, "No associated PHY\n"); return -ENODEV;