Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp288046pxf; Tue, 6 Apr 2021 22:37:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlNbvuRB4ohAhks3nvIHNwD3Qjr3z9d1Ci11TQWw4o5T53SgPG+YcAOr8xcAnXIp+Xko6d X-Received: by 2002:a05:6602:1689:: with SMTP id s9mr1150231iow.171.1617773860475; Tue, 06 Apr 2021 22:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617773860; cv=none; d=google.com; s=arc-20160816; b=U+VCOAivLWF8DaEojUn0IvEHVgUiT+xNfO/wACqGzaRrN61e0RgdJIFEJZJKnVuAIs Onm/v2NQquJ1W3mKzH2u131OeuwKc5GJcqSBzYv/qMWf30OXu4SJcaQAA7Zgem+XQ0cR jUgSSHWRCt//8O6D2adxoOyB9675RLrFy/83x7xBvQhtJYwxLA+uAJWOW0p9wbY8Yqqp TSqVG5aRwB6GxkI4oeShfPREAjLcoSHZOVBI1bzK01dIA2C7JtotCSrE2t6KtcHEXdcF Xh5TD3JPnm/NXheLczeAroD8+6EB01II2dcL/wgMhkon8w0Qb/sDaKQ90K0FoYBoxSRT cPsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=LCrjvacXjY6vuInUs/qPIlb3a0mNcuUeH9+Oy9wpxUs=; b=VTx3D87LdXwcz274nW4c8ZKLiyXK+tB4bTey+XlOBb0qbRZOlp455NegMfWNHKJ+UQ VrfD+LiZDVB5Rqf8EB+m3yyWbVtMlahE79Ixcw7pw7UfhV6VhiDpm23ToM7I376mc88G y2ny5RC2hPiV447/nz3rBl+AC80bkKzPsfIH9640jl+mpM+BxWOiKjOZW27jX59B1Qxv VqKgVZvueM+E9wezM5LyCOvWYF5UuJ9fNI8BgeT0S6f00DjNiPV8qjcuM6pSX7dHYBG3 SqZIjYKb4+DUOmsc/Q3HDpxnLjR7kSKAdJG6ajygP2bb3XqPMsSoPZ1x28STEtezKBpn w+mQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si12876321ilg.68.2021.04.06.22.37.28; Tue, 06 Apr 2021 22:37:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345588AbhDFPVv (ORCPT + 99 others); Tue, 6 Apr 2021 11:21:51 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:35960 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233393AbhDFPVt (ORCPT ); Tue, 6 Apr 2021 11:21:49 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lTnW7-00F8gN-Pt; Tue, 06 Apr 2021 17:21:23 +0200 Date: Tue, 6 Apr 2021 17:21:23 +0200 From: Andrew Lunn To: DENG Qingfang Cc: "David S. Miller" , Florian Fainelli , Heiner Kallweit , Jakub Kicinski , Landen Chao , Matthias Brugger , Russell King , Sean Wang , Vivien Didelot , Vladimir Oltean , Rob Herring , Linus Walleij , Greg Kroah-Hartman , Sergio Paracuellos , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-staging@lists.linux.dev, devicetree@vger.kernel.org, netdev@vger.kernel.org, Weijie Gao , Chuanhong Guo , =?iso-8859-1?Q?Ren=E9?= van Dorst Subject: Re: [RFC net-next 1/4] net: phy: add MediaTek PHY driver Message-ID: References: <20210406141819.1025864-1-dqfext@gmail.com> <20210406141819.1025864-2-dqfext@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210406141819.1025864-2-dqfext@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 06, 2021 at 10:18:16PM +0800, DENG Qingfang wrote: > Add support for MediaTek PHYs found in MT7530 and MT7531 switches. Do you know if this PHY is available standalone? > +static int mt7531_phy_config_init(struct phy_device *phydev) > +{ > + mtk_phy_config_init(phydev); > + > + /* PHY link down power saving enable */ > + phy_set_bits(phydev, 0x17, BIT(4)); > + phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, 0xc6, 0x300); > + > + /* Set TX Pair delay selection */ > + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x13, 0x404); > + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x14, 0x404); This gets me worried about RGMII delays. We have had bad backwards compatibility problems with PHY drivers which get RGMII delays wrong. Since this is an internal PHY, i suggest you add a test to the beginning of mt7531_phy_config_init(): if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL) return -EINVAL; We can then solve RGMII problems when somebody actually needs RGMII. Andrew