From patchwork Tue Mar 1 20:15:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Harvey X-Patchwork-Id: 1599498 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K7T5H5QFQz9sGB for ; Wed, 2 Mar 2022 07:15:31 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5C65D83C00; Tue, 1 Mar 2022 21:15:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E38A783BCC; Tue, 1 Mar 2022 21:15:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from finn.localdomain (finn.gateworks.com [108.161.129.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A4DF483BBE for ; Tue, 1 Mar 2022 21:15:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tharvey@gateworks.com Received: from 068-189-091-139.biz.spectrum.com ([68.189.91.139] helo=tharvey.pdc.gateworks.com) by finn.localdomain with esmtp (Exim 4.93) (envelope-from ) id 1nP8tk-00BCKd-UN; Tue, 01 Mar 2022 20:15:05 +0000 From: Tim Harvey To: u-boot@lists.denx.de, Joe Hershberger , Ramon Fried Cc: Tim Harvey Subject: [PATCH 0/2] prevent undesired de-assertion of phy-reset Date: Tue, 1 Mar 2022 12:15:00 -0800 Message-Id: <20220301201502.28026-1-tharvey@gateworks.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Some PHY's have strict requirements on reset timings which can be violated if the PHY is taken out of reset before a proper reset pulse is performed. When gpio_request_by_name is used for reset gpios without GPIOD_IS_OUT_ACTIVE the GPIO will be de-asserted when requested taking the PHY out of reset. Resolve this by adding the GPIOD_IS_OUT_ACTIVE flag. There are 42 occurances of gpio_request_by_name in U-Boot for gpio's with 'reset' in their name yet the only one that uses GPIOD_IS_OUT_ACTIVE is drivers/net/dwc_eth_qos.c. While I think setting GPIOD_IS_OUT_ACTIVE is the right thing to do, I'm only changing the ones that I have run into issues with: drivers/net/eth-phy-uclass.c drivers/net/fec_mxc.c Both of these have functions that are called that assert, delay, de-assert, delay such that I know they will properly be taken out of reset. The Linux kernel had a similar issue [1] Tim Harvey (2): net: fec: prevent undesired de-assertion of phy-reset on request net: eth-phy: prevent undesired de-assertion of phy-reset on request drivers/net/eth-phy-uclass.c | 2 +- drivers/net/fec_mxc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)