Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967182AbcCQKC6 (ORCPT ); Thu, 17 Mar 2016 06:02:58 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33719 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966709AbcCQKCy (ORCPT ); Thu, 17 Mar 2016 06:02:54 -0400 Subject: Re: [PATCH v3 2/9] net: arc_emac: add phy reset is optional for device tree To: Sergei Shtylyov References: <1457942520-12859-1-git-send-email-wxt@rock-chips.com> <1457942520-12859-3-git-send-email-wxt@rock-chips.com> <56E96656.5000101@cogentembedded.com> Cc: Caesar Wang , Heiko Stuebner , "David S. Miller" , Rob Herring , Mark Rutland , devicetree@vger.kernel.org, Pawel Moll , Ian Campbell , netdev@vger.kernel.org, Kumar Gala , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, keescook@google.com, leozwang@google.com From: Caesar Wang Message-ID: <56EA80C7.30303@gmail.com> Date: Thu, 17 Mar 2016 18:02:47 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <56E96656.5000101@cogentembedded.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2210 Lines: 81 Hi Sergei, 在 2016年03月16日 21:57, Sergei Shtylyov 写道: > Hello. > > On 3/14/2016 11:01 AM, Caesar Wang wrote: > >> This patch adds the following property for arc_emac. >> >> 1) phy-reset-gpios: >> The phy-reset-gpio is an optional property for arc emac device tree >> boot. >> Change the binding document to match the driver code. >> >> 2) phy-reset-duration: >> Different boards may require different phy reset duration. Add property >> phy-reset-duration for device tree probe, so that the boards that need >> a longer reset duration can specify it in their device tree. >> >> Anyway, we can add the above property for arc emac. >> >> Signed-off-by: Caesar Wang > > Could you have a look at drivers/net/ethernet/cadence/macb/? It > seems to be the only driver which places the PHY's "reset-gpios" prop > correctly, into the PHY subnode? I'm currently working on adding > support of this prop into phylib... I see the driver on now. /* Power up the PHY if there is a GPIO reset */ phy_node = of_get_next_available_child(np, NULL); if (phy_node) { int gpio = of_get_named_gpio(phy_node, "reset-gpios", 0); if (gpio_is_valid(gpio)) bp->reset_gpio = gpio_to_desc(gpio); gpiod_set_value(bp->reset_gpio, GPIOD_OUT_HIGH); } of_node_put(phy_node); ... Frankly, I don't like this way in device drivers. That's seem same with the /drivers/mmc/core/pwrseq_simple.c, power up the device. Is it not really reset hardware PHY from the gpio reset pin? Just power up. Of course, I hope to see and test it if you improve the PHY framework to support the phy reset.:-) --- Anyway, David had applied this series patches into net branch. Although the clock and dts patches should be applied into Heiko branch, I'm glad to see David's way. Heiko branch: https://git.kernel.org/cgit/linux/kernel/git/mmind/linux-rockchip.git/ I wish won't destory Heiko to merge in the future. -Caesar > > MBR, Sergei > > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip -- Thanks, Caesar