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 X-Spam-Level: X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3EEDC433B4 for ; Tue, 11 May 2021 11:11:48 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F2AA61352 for ; Tue, 11 May 2021 11:11:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F2AA61352 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=AytjlqPjVjBGHPrRtgvQ0LJ6O0sIw06bafPhCBl0mfQ=; b=DNryuMtSkZqc2t+n7Q86Qelsa fUfrIgLTyODELVsthGig5QcAWzM40fAvl/ddn+FGvronf9qCaAundJ2od9pRKOhjumKmobooEYis0 08UxISFr6bX3H/+5Asa5rRB/ZYSkvfxwTnCAs+ZHH40AGzFkRIeCGb1Ozz7fenxCxMrA78C7kwE9P FSkc7M+mdC72NhskyviSCPDMhxISVXA3Wr86jYkR+McWiFQkxd3AHLBpDyXmBZMGlC5yZyO0qkQBT WskvkCgC+erkVYLKlW4jh/UQO+aV14WYLpdWrManxDI+eZI9Mp+I3Hf4O4nGJxj+cB0cF36fokxeo Kqjhvgk7g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgQHU-00H4xu-Ca; Tue, 11 May 2021 11:10:28 +0000 Received: from [2607:7c80:54:e::133] (helo=bombadil.infradead.org) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgHWw-00G4Ry-D1 for linux-arm-kernel@desiato.infradead.org; Tue, 11 May 2021 01:49:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=sowjHbtq4ACpOKj9t4ndmI7onYam+ERIVTjJ8SpjVao=; b=q2z8iorsSddO1GNUPr+g/NrUdh DeDiH2+DhIAg1C1zvQZ8E1REXTKoitXhk1v/7ldTeoEO9FX1W5cVr8IpSO0WsiayjyH77ttZtJHS5 1UV+DJBkbZYOZ0wzRo+SQh67Px2Pzg3u1G0BEBqsskdg/BNoBF8O/ChRHpEAelVgBm0Nr0Adns3EN Qzz/w8RBYZN1N7Wu/h8O5Tj6QJ0m9cSbpy4xDZB7oF3dC50Vi5CNNvCpUSbbS8pVi+otY2MQHCwyy eXE9PxTavqUTKdneKRvtRY77tWS8DIgKXiTbULYHRy1VboKdjaQOSDJl/9A1lBgZa0eC7NU4LixZY FI+KJw/g==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgHWt-009FFu-HJ for linux-arm-kernel@lists.infradead.org; Tue, 11 May 2021 01:49:48 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 71510616E8; Tue, 11 May 2021 01:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620697787; bh=eZrzgpTyyO5Blp6/LDxMMaLmtZs1tELZ4/7dFk3gLco=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fJhqWJRLw+CPWIVo4ulxbq2qE/g1QN3h3r11Vp/Jrcyc84wwvshpmdybYw4zbjkCD ufFdxlbGMpcx+F3VCg1qrmeX+TTLVTs9KdID8jea2Dt6lMOW1dyxdytXKfySQx35BD R7Fn5WBNRIvF8fvh66TrYbDd7MeEBNoSuOiB8kzeaLd0Xq/+2ZCyvCin7eeLs736P7 kNSuoih4e1Q7bh3s/blHmggB3QvT82rhy6dzIYPuMAWha6mbVufGMABde7DmPL14li DvPN5hhZSAU7Jp46KX0l2aw4xQ5BOp1BmNICcf+HY5ZlBzW4yhHlS7Ovwc1yQTNiZ6 H48LHRPBY2kqQ== Date: Tue, 11 May 2021 09:49:41 +0800 From: Shawn Guo To: Oleksij Rempel Cc: Sascha Hauer , Andrew Lunn , Florian Fainelli , Heiner Kallweit , Philippe Schenker , kernel@pengutronix.de, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, Fabio Estevam , David Jander , Russell King Subject: Re: [PATCH v2 1/7] ARM: imx6q: remove PHY fixup for KSZ9031 Message-ID: <20210511014937.GK27585@dragon> References: <20210309112615.625-1-o.rempel@pengutronix.de> <20210309112615.625-2-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210309112615.625-2-o.rempel@pengutronix.de> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_184947_640263_5C231DAD X-CRM114-Status: GOOD ( 25.68 ) /bin/ln: failed to access 'reaver_cache/texts/20210510_184947_640263_5C231DAD': No such file or directory X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_184947_640263_5C231DAD X-CRM114-Status: GOOD ( 22.13 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 09, 2021 at 12:26:09PM +0100, Oleksij Rempel wrote: > Starting with: > > bcf3440c6dd7 ("net: phy: micrel: add phy-mode support for the KSZ9031 PHY") > > the micrel phy driver started respecting phy-mode for the KSZ9031 PHY. > At least with kernel v5.8 configuration provided by this fixup was > overwritten by the micrel driver. > > This fixup was providing following configuration: > > RX path: 2.58ns delay > rx -0.42 (left shift) + rx_clk +0.96ns (right shift) = > 1,38 + 1,2 internal RX delay = 2.58ns > TX path: 0.96ns delay > tx (no delay) + tx_clk 0.96ns (right shift) = 0.96ns > > This configuration is outside of the recommended RGMII clock skew delays > and about in the middle of: rgmii-idrx and rgmii-id > > Since most embedded systems do not have enough place to introduce > significant clock skew, rgmii-id is the way to go. > > In case this patch breaks network functionality on your system, build > kernel with enabled MICREL_PHY. If it is still not working then try > following device tree options: > 1. Set (or change) phy-mode in DT to: > phy-mode = "rgmii-id"; > This actives internal delay for both RX and TX. > 1. Set (or change) phy-mode in DT to: > phy-mode = "rgmii-idrx"; > This actives internal delay for RX only. > 3. Use following DT properties: > phy-mode = "rgmii"; > txen-skew-psec = <0>; > rxdv-skew-psec = <0>; > rxd0-skew-psec = <0>; > rxd1-skew-psec = <0>; > rxd2-skew-psec = <0>; > rxd3-skew-psec = <0>; > rxc-skew-psec = <1860>; > txc-skew-psec = <1860>; > This activates the internal delays for RX and TX, with the value as > the fixup that is removed in this patch. > > Signed-off-by: Oleksij Rempel > Acked-by: Philippe Schenker > --- > arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts | 2 +- > arch/arm/mach-imx/mach-imx6q.c | 23 ----------------------- I have different branch for DTS and mach-imx change. Please split the changes. Shawn > 2 files changed, 1 insertion(+), 24 deletions(-) > > diff --git a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts > index fa2307d8ce86..c713ac03b3b9 100644 > --- a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts > +++ b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts > @@ -112,7 +112,7 @@ flash: m25p80@0 { > &fec { > pinctrl-names = "default"; > pinctrl-0 = <&pinctrl_enet>; > - phy-mode = "rgmii"; > + phy-mode = "rgmii-id"; > phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; > phy-supply = <&vgen2_1v2_eth>; > status = "okay"; > diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c > index 703998ebb52e..78205f90da27 100644 > --- a/arch/arm/mach-imx/mach-imx6q.c > +++ b/arch/arm/mach-imx/mach-imx6q.c > @@ -40,27 +40,6 @@ static int ksz9021rn_phy_fixup(struct phy_device *phydev) > return 0; > } > > -static void mmd_write_reg(struct phy_device *dev, int device, int reg, int val) > -{ > - phy_write(dev, 0x0d, device); > - phy_write(dev, 0x0e, reg); > - phy_write(dev, 0x0d, (1 << 14) | device); > - phy_write(dev, 0x0e, val); > -} > - > -static int ksz9031rn_phy_fixup(struct phy_device *dev) > -{ > - /* > - * min rx data delay, max rx/tx clock delay, > - * min rx/tx control delay > - */ > - mmd_write_reg(dev, 2, 4, 0); > - mmd_write_reg(dev, 2, 5, 0); > - mmd_write_reg(dev, 2, 8, 0x003ff); > - > - return 0; > -} > - > /* > * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High > * as they are used for slots1-7 PERST# > @@ -152,8 +131,6 @@ static void __init imx6q_enet_phy_init(void) > if (IS_BUILTIN(CONFIG_PHYLIB)) { > phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, > ksz9021rn_phy_fixup); > - phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK, > - ksz9031rn_phy_fixup); > phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffef, > ar8031_phy_fixup); > phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef, > -- > 2.29.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel