From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55273C433EF for ; Thu, 7 Apr 2022 06:58:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5362A839BE; Thu, 7 Apr 2022 08:58:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1649314703; bh=cv3FkxibQURoFrBZhpPl0u5KYkw+4d+BUVkTryCerVQ=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EUVoUgBil6XLKOKMDq+Y7lpA/5MZjobF94fuiBVA/+2lX/X2JfAbqw3Q5aBYwVrSm gajN3B2gqAKDY/woWeYnnL03vizaBEZM39Of8Blw6QI4Dt/GF898cuobGtqwdtn+LV KALZffnjJ2EaQyCdfueYlvXIp/jLBoBoCeAwKJA6nXkKpBT25qpF2pVvmBoZIODivp /Hu3IpgxEcUe07PuPHBUgWkotehEoplwI9GNNe7W9LZFCrxeye+haKscjCMUOB4Kc5 7rhZ4beXzLoL9QVeLh0O7bjWhpXz7WQg2dTb35XoHhUcOp3non7RyTIL31C6rVZYcv YRm1T0YcfsebQ== Received: by phobos.denx.de (Postfix, from userid 109) id 1E4CC839B6; Thu, 7 Apr 2022 08:58:22 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (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 56433839BE for ; Thu, 7 Apr 2022 08:58:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4KYsfM1gnjz9sR9; Thu, 7 Apr 2022 08:58:19 +0200 (CEST) Message-ID: Date: Thu, 7 Apr 2022 08:58:15 +0200 MIME-Version: 1.0 Subject: Re: [PATCH v3 2/4] net: mvneta: add SFP TX disable handling Content-Language: en-US To: Robert Marko , u-boot@lists.denx.de, pali@kernel.org, marek.behun@nic.cz References: <20220324095739.1162965-1-robert.marko@sartura.hr> <20220324095739.1162965-2-robert.marko@sartura.hr> From: Stefan Roese In-Reply-To: <20220324095739.1162965-2-robert.marko@sartura.hr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 On 3/24/22 10:57, Robert Marko wrote: > Add support for handling SFP TX disable for MVNETA in the same fashion as > to what MVPP2 is doing in order to enable using SFP-s. > > This allows using ethernet on SFP only boards. > > Signed-off-by: Robert Marko Reviewed-by: Stefan Roese Thanks, Stefan > --- > Changes in v3: > * Check whether the SFP node is enabled > > Changes in v2: > * Parse the standard SFP node for TX disable GPIO instead of using a > custom property > > drivers/net/mvneta.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c > index 4a4268c2b2..edd818338c 100644 > --- a/drivers/net/mvneta.c > +++ b/drivers/net/mvneta.c > @@ -286,6 +286,7 @@ struct mvneta_port { > struct phy_device *phydev; > #if CONFIG_IS_ENABLED(DM_GPIO) > struct gpio_desc phy_reset_gpio; > + struct gpio_desc sfp_tx_disable_gpio; > #endif > struct mii_dev *bus; > }; > @@ -1693,6 +1694,9 @@ static int mvneta_probe(struct udevice *dev) > { > struct eth_pdata *pdata = dev_get_plat(dev); > struct mvneta_port *pp = dev_get_priv(dev); > +#if CONFIG_IS_ENABLED(DM_GPIO) > + struct ofnode_phandle_args sfp_args; > +#endif > void *blob = (void *)gd->fdt_blob; > int node = dev_of_offset(dev); > struct mii_dev *bus; > @@ -1767,6 +1771,11 @@ static int mvneta_probe(struct udevice *dev) > return ret; > > #if CONFIG_IS_ENABLED(DM_GPIO) > + ret = dev_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args); > + if (!ret && ofnode_is_enabled(sfp_args.node)) > + gpio_request_by_name_nodev(sfp_args.node, "tx-disable-gpio", 0, > + &pp->sfp_tx_disable_gpio, GPIOD_IS_OUT); > + > gpio_request_by_name(dev, "phy-reset-gpios", 0, > &pp->phy_reset_gpio, GPIOD_IS_OUT); > > @@ -1775,6 +1784,9 @@ static int mvneta_probe(struct udevice *dev) > mdelay(10); > dm_gpio_set_value(&pp->phy_reset_gpio, 0); > } > + > + if (dm_gpio_is_valid(&pp->sfp_tx_disable_gpio)) > + dm_gpio_set_value(&pp->sfp_tx_disable_gpio, 0); > #endif > > return board_network_enable(bus); Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de