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 1D5CAC433EF for ; Sat, 18 Dec 2021 22:59:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0BE7B8306E; Sat, 18 Dec 2021 23:59:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=nic.cz 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 01ADE83046; Sat, 18 Dec 2021 23:59:18 +0100 (CET) Received: from mail.nic.cz (lists.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B02008306E for ; Sat, 18 Dec 2021 23:59:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from thinkpad (unknown [IPv6:2a0e:b107:ae1:0:3e97:eff:fe61:c680]) by mail.nic.cz (Postfix) with ESMTPSA id B35E913FC28; Sat, 18 Dec 2021 23:59:13 +0100 (CET) Date: Sat, 18 Dec 2021 23:59:13 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Tony Dinh Cc: U-Boot Mailing List , Stefan Roese , David Purdy , Tom Rini , Pali Roh_r Subject: Re: [PATCH 7/8] arm: kirkwood: Pogoplug-V4 : Add board implementation Message-ID: <20211218235913.7c5e30ee@thinkpad> In-Reply-To: <20211218042335.5865-8-mibodhi@gmail.com> References: <20211218042335.5865-1-mibodhi@gmail.com> <20211218042335.5865-8-mibodhi@gmail.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean > +#if defined(CONFIG_RESET_PHY_R) > +/* Configure and initialize PHY */ > +void reset_phy(void) > +{ > + u16 reg; > + int phyaddr; > + char *name = "ethernet-controller@72000"; > + char *eth0_path = "/ocp@f1000000/ethernet-controller@72000"; > + > + if (miiphy_set_current_dev(name)) > + return; > + > + phyaddr = fdt_get_phy_addr(eth0_path); > + if (phyaddr < 0) > + return; > + > + /* > + * Enable RGMII delay on Tx and Rx for CPU port > + * Ref: sec 4.7.2 of chip datasheet > + */ > + miiphy_write(name, phyaddr, MV88E1116_PGADR_REG, 2); > + miiphy_read(name, phyaddr, MV88E1116_MAC_CTRL_REG, ®); > + reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL); > + miiphy_write(name, phyaddr, MV88E1116_MAC_CTRL_REG, reg); > + miiphy_write(name, phyaddr, MV88E1116_PGADR_REG, 0); > + > + /* reset the phy */ > + miiphy_reset(name, phyaddr); > + > + printf("88E1116 Initialized on %s\n", name); > +} This PHY has a driver in U-Boot, drivers/net/phy/marvell.c, structure M88E1118_driver. There the m88e1118_config() method already does one thing of what you are doing here: enabling rgmii delays. It also sets LED config, but does not reset the PHY. You can add call to phy_reset() there... Marek