From patchwork Fri Aug 11 13:25:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 9895865 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 596B560325 for ; Fri, 11 Aug 2017 13:26:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4856728C2B for ; Fri, 11 Aug 2017 13:26:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CEFA28C2D; Fri, 11 Aug 2017 13:26:06 +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 B435E28C2B for ; Fri, 11 Aug 2017 13:26:05 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ktwj48rq9t6gDf7ANOhSsrnpLXat2dAmBBM6LNMm460=; b=djkqe55RsOe6Vq K3+2gkaA/+7fQj2RUR3MdAX9HuEh0YKhvdgZKG0uR5PJV/MZTvEaVqP2afN2PIjyIeu+pS6e20b0v /0+idIbYUOYijAKgIN/iF6Fi+JWtwtkz+4qDBZH9F82pFprP+LKmlJPEokWp9lP8kN24jBBKWe/yS mp81W3myDRV1si8M5IoEQ3Kv25vkblIET7NJNbUt5plPM60rDxJmDj8s4ENm/e10hccaXWeaEAJQx /KbgXFKRCc5FSVhmGzUtx21tznmqpICRpeZZq2dVL9CXO3f9bpYol7dOtvCxFiHdwXBsrdhwu5BpL c2MQfLXb7RdkrQ5imRzw==; 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 1dg9wu-0002mO-QG; Fri, 11 Aug 2017 13:26:00 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dg9wq-0002hI-69 for linux-arm-kernel@lists.infradead.org; Fri, 11 Aug 2017 13:25:58 +0000 Received: by mail-wm0-x243.google.com with SMTP id y206so6473202wmd.5 for ; Fri, 11 Aug 2017 06:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ITY2DUoB7XFvJJb2yDIp6C6Hy8Vdl4cWgTb80l3j4Fg=; b=NrZl/H8c3M0Vv2p3Wm8/Dkj5xaHmSQDnTPBgQ3B9t4XfsxbAZtb+FFZKkEo+auyH9c tUFa4swxQXXmze570/OHbxLO57XpkECoD4Y5/f0un/acOQVKlPEK0UcuBkFqXbuVJjlA yQkevFz5YUKNvJlQw1gz8qMaLREixVaMVGznqGwy787+RzQG+fS7GWIZIpUZJpm2ID2A NvnE+VTlOhQHE9IZ3+BOKiIefKau/SXivUgQDYMmABJwguHHqShvXaFI5w2aCn5MOClJ eIwLlhnpT9OWgdiz4mQ198YVPbxZDJeO1AijX0j96DWJCgCjgFnQMptuD7wcpp1A0WlM PKJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ITY2DUoB7XFvJJb2yDIp6C6Hy8Vdl4cWgTb80l3j4Fg=; b=UBHfZ7LfVV+ltFy3GFuYPqk/2jFJ1MRDar3cXwEMQBZs53SksSM7ymYjbFm30pOt4t 8XQxWdv4YstFtTlk3T6tYxUcuQeuWLXrkx6qmCNxfXfUVopMzS0V0bgOxdvTFEU/MNRt Dovfv6V5Qu+al25PwHdnBX1Y55u89strON0fQhHH2oT9pDHz0dgCnAyu19X0m9qzrUlp SfI/3lnMslkgK1YBnroeTyyYoNAWKpAJq2TcULrM69RpGZWU7faqmjLTdgbchXVhjo70 Ja0BaNHd9rbDfm0aWfszq8qeTY6C6yEBNSGuMk6HvAJi6Q3aB+rUAAeO3Gnhfj+LONAK bJEQ== X-Gm-Message-State: AHYfb5iAUv6OUjdHkHTVOEHqHekO2Sn4MGqPPZFG4yiFfvR1cAfG22Tm lHAjUw+kmw2wQA== X-Received: by 10.28.99.196 with SMTP id x187mr9248503wmb.125.1502457934243; Fri, 11 Aug 2017 06:25:34 -0700 (PDT) Received: from Red ([2a01:cb1d:16e:1300:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id m77sm1010785wmd.21.2017.08.11.06.25.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Aug 2017 06:25:33 -0700 (PDT) Date: Fri, 11 Aug 2017 15:25:26 +0200 From: Corentin Labbe To: Chen-Yu Tsai , robh+dt@kernel.org, mark.rutland@arm.com, f.fainelli@gmail.com Subject: Re: [PATCH 2/3] ARM: sun8i: sunxi-h3-h5: add phy-is-integrated property to internal PHY Message-ID: <20170811132526.GD25147@Red> References: <20170810085129.20463-1-clabbe.montjoie@gmail.com> <20170810085129.20463-3-clabbe.montjoie@gmail.com> <20170811080543.GA25147@Red> <20170811081920.GB25147@Red> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170811_062556_400453_7D73EA7B X-CRM114-Status: GOOD ( 26.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 , alexandre.torgue@st.com, andrew@lunn.ch, netdev , Russell King , linux-kernel , Giuseppe Cavallaro , Maxime Ripard , linux-arm-kernel 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, Aug 11, 2017 at 04:22:11PM +0800, Chen-Yu Tsai wrote: > On Fri, Aug 11, 2017 at 4:19 PM, Corentin Labbe > wrote: > > On Fri, Aug 11, 2017 at 04:11:13PM +0800, Chen-Yu Tsai wrote: > >> On Fri, Aug 11, 2017 at 4:05 PM, Corentin Labbe > >> wrote: > >> > On Fri, Aug 11, 2017 at 10:42:51AM +0800, Chen-Yu Tsai wrote: > >> >> Hi, > >> >> > >> >> On Thu, Aug 10, 2017 at 4:51 PM, Corentin Labbe > >> >> wrote: > >> >> > This patch add the new phy-is-integrated property to the internal PHY > >> >> > node. > >> >> > > >> >> > Signed-off-by: Corentin Labbe > >> >> > --- > >> >> > arch/arm/boot/dts/sunxi-h3-h5.dtsi | 1 + > >> >> > 1 file changed, 1 insertion(+) > >> >> > > >> >> > diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi > >> >> > index 4b599b5d26f6..54fc24e4c569 100644 > >> >> > --- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi > >> >> > +++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi > >> >> > @@ -425,6 +425,7 @@ > >> >> > reg = <1>; > >> >> > clocks = <&ccu CLK_BUS_EPHY>; > >> >> > resets = <&ccu RST_BUS_EPHY>; > >> >> > + phy-is-integrated; > >> >> > >> >> You also need to "delete" this property at the board level for > >> >> any board that has the external PHY at address <1>. Otherwise > >> >> they will stop working. This is due to the internal and external > >> >> PHYs having the same path and node name in the device tree, so > >> >> they are effectively the same node. > >> >> > >> >> ChenYu > >> >> > >> > > >> > They have not the same name, ext_rgmii_phy vs int_mii_phy. > >> > >> That is just the label. The label plays no part in device tree merging. The path > >> > >> /soc/ethernet@1c30000/mdio/ethernet-phy@1 > >> > >> is the same. You can look under > >> > >> /proc/device-tree/soc/ethernet@1c30000/mdio > >> > >> on the OrangePI Plus 2E or any other H3 board that uses an > >> external PHY at address 1. > >> > >> ChenYu > > > > Since we get the phy node by phy-handle and not by path, I think all should be good. > > You are not getting me. The fact that the two seemingly separate > nodes are merged together means, whatever properties you put in > the internal PHY node, also affect the external PHY node. Once > compiled, they are the SAME node. Hello Rob, florian, mark Adding a delete property on all external ethernet-phy@1 is a bit overkill, and I dont like the idea that nodes are merged. What do you think about other possible solutions: - Using integrated-phy@1 for the integrated PHY node name - Using a fake address like 31 (see patch below) If you have any other solution... Regards From fe39183946f7f4a6e21bce38fd8e4c1413012d68 Mon Sep 17 00:00:00 2001 From: Corentin Labbe Date: Fri, 11 Aug 2017 14:49:54 +0200 Subject: [PATCH] ARM: sun8i: sunxi-h3-h5: Prevent merge of external and integrated PHY Actually, some external and integrated PHY are merged due to same dtnode name "ethernet-phy@1". This is problematic when we will want to use the phy-is-integrated property. (Need to delete it on all external PHY node) An easy solution is to set integrated PHY nodeaddresss at a fake one that would never be used. Since board makers currently only provides PHY at addresses 1 and 7, we will use 31. Signed-off-by: Corentin Labbe --- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi index 54fc24e4c569..2110b0069e33 100644 --- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi +++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi @@ -420,7 +420,15 @@ mdio: mdio { #address-cells = <1>; #size-cells = <0>; - int_mii_phy: ethernet-phy@1 { + /* + * Using 31 permits to make a separation between + * this integrated PHY and external ones. + * Without it, external "ethernet-phy@1" will be + * merged with it (due to same dtnode name). + * Board makers currently only provides PHY at + * addresses 1 and 7. + */ + int_mii_phy: ethernet-phy@31 { compatible = "ethernet-phy-ieee802.3-c22"; reg = <1>; clocks = <&ccu CLK_BUS_EPHY>;