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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F7CEC433EF for ; Tue, 4 Jan 2022 12:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=xB/OEJLlTajeU9uzjA07YjmOzpaNiyp69WXhxFlZcos=; b=o1MEaSEXu9GZ72 URBgKRcUkOF6WFn2AI3ANp66q91ca0Ph/h8ggTL5LG0bSCEQP09O5UNCYv5sT+nKftOZIrVJNt2Hv nTHa1AMGulGYWvbmIVndDoyj849N/mnEx973NF/X4W1avaugVzPiG8R59EZE5hXuKoVXUi4F1A6XM 9Hem4JSb7U+PhYAGvs5ZxWLuuF/Ayul5zP3G7Mp3ojg2RQ8CdxQuJ6tK0BkfZ6GwlQYzcHUJq7DmT NV5XyfiGX34SOdOPsL6xcir5YcmnhQGWwQ93fzpVj3qfcAUxWJKdja1XwrCrvWFMDRTGUTbveUJOO mkN40kftFF3/DfSD8kdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4iki-00BQuW-Oi; Tue, 04 Jan 2022 12:17:20 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4ike-00BQu7-Qw for linux-arm-kernel@lists.infradead.org; Tue, 04 Jan 2022 12:17:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QqWNNemBUxEL73cqzXct8FhwcLpCWeQp6HEGpBCZd58=; b=Cpl6L30xc2G9MnJjhbKZB6Csyo HnS/0WSvJfxIfiYlIvE1dNSdlzeMqdBTZOhSfdDYp/UMnkGk+peNb6vIFc2H3sck1lP7NRhTiC61T Vzcj8/Rg0vme1rQHjSbkQcNad1ORYuOAJzKcsKZhtT1X9OZYcd7K+M4hF8BtvoIA1MJZnP21e5jfP vs3anQNVkdeSiL+RgoOc5XZZ86aNnWMCd3krdz9xlkcSF5xiAQ+x112naoHIFC1+6R9f0SLAhPfkR BQfMpC7zO7RAYUQUAOwdq2ysXhVUQQn6psuxbkGUh4X87ab8t+zrllexaAFF8JEgMCmGxptgLY0sY ADlKL/RQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:56558) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n4ika-0006zG-VR; Tue, 04 Jan 2022 12:17:12 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1n4ikZ-0007E0-R6; Tue, 04 Jan 2022 12:17:11 +0000 Date: Tue, 4 Jan 2022 12:17:11 +0000 From: "Russell King (Oracle)" To: Corentin Labbe Cc: linus.walleij@linaro.org, ulli.kroll@googlemail.com, kuba@kernel.org, davem@davemloft.net, andrew@lunn.ch, hkallweit1@gmail.com, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: net: phy: marvell: network working with generic PHY and not with marvell PHY Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220104_041716_934991_C814F63B X-CRM114-Status: GOOD ( 33.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jan 04, 2022 at 01:09:13PM +0100, Corentin Labbe wrote: > Le Tue, Jan 04, 2022 at 11:41:40AM +0000, Russell King (Oracle) a =E9crit= : > > On Tue, Jan 04, 2022 at 12:33:15PM +0100, Corentin Labbe wrote: > > > Le Tue, Jan 04, 2022 at 11:14:46AM +0000, Russell King (Oracle) a =E9= crit : > > > > On Tue, Jan 04, 2022 at 11:58:01AM +0100, Corentin Labbe wrote: > > > > > Hello > > > > > = > > > > > I have a gemini SSI 1328 box which has a cortina ethernet MAC wit= h a Marvell 88E1118 as given by: > > > > > Marvell 88E1118 gpio-0:01: attached PHY driver (mii_bus:phy_addr= =3Dgpio-0:01, irq=3DPOLL) > > > > > So booting with CONFIG_MARVELL_PHY=3Dy lead to a non-working netw= ork with link set at 1Gbit > > > > > Setting 'max-speed =3D <100>;' (as current state in mainline dtb)= lead to a working network. > > > > > By not working, I mean kernel started with ip=3Ddhcp cannot get a= n IP. > > > > = > > > > How is the PHY connected to the host (which interface mode?) If it's > > > > RGMII, it could be that the wrong RGMII interface mode is specified= in > > > > DT. > > > > = > > > = > > > The PHY is set as RGMII in DT (arch/arm/boot/dts/gemini-ssi1328.dts) > > > The only change to the mainline dtb is removing the max-speed. > > = > > So, it's using "rgmii" with no delay configured at the PHY with the > > speed limited to 100Mbps. You then remove the speed limitation and > > it doesn't work at 1Gbps. > > = > > I think I've seen this on other platforms (imx6 + ar8035) when the > > RGMII delay is not correctly configured - it will work at slower > > speeds but not 1G. > > = > > The RGMII spec specifies that there will be a delay - and the delay can > > be introduced by either the MAC, PHY or by PCB track routing. It sounds > > to me like your boot environment configures the PHY to introduce the > > necessary delay, but then, because the DT "rgmii" mode means "no delay > > at the PHY" when you use the Marvell driver (which respects that), the > > Marvell driver configures the PHY for no delay, resulting in a non- > > working situation at 1G. > > = > > I would suggest checking how the boot environment configures the PHY, > > and change the "rgmii" mode in DT to match. There is a description of > > the four RGMII modes in Documentation/networking/phy.rst that may help > > understand what each one means. > > = > = > So if I understand, the generic PHY does not touch delays and so values s= et by bootloader are kept. Correct - the RGMII delays are not part of the standard 802.3 clause 22 register set, so the generic driver has no knowledge how to change these. > The boot environment give no clue on how the PHY is set. > Only debug showed is: > PHY 0 Addr 1 Vendor ID: 0x01410e11 > mii_write: phy_addr=3D0x1 reg_addr=3D0x4 value=3D0x5e1 = > mii_write: phy_addr=3D0x1 reg_addr=3D0x9 value=3D0x300 = > mii_write: phy_addr=3D0x1 reg_addr=3D0x0 value=3D0x1200 = > mii_write: phy_addr=3D0x1 reg_addr=3D0x0 value=3D0x9200 = > mii_write: phy_addr=3D0x1 reg_addr=3D0x0 value=3D0x1200 Hmm, it doesn't. The first two register writes set the advertisement. The last three are just the PHY reset. > Does it is possible to dump PHY registers when using generic PHY and > find delay values ? For example ethtool -d eth0 ? Even if that were possible, Marvell PHYs use a paged scheme to access configuration registers, so merely reading the 32 registers would probably not help. However, see my follow-up to my previous reply for some further thoughts. -- = RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel