Message ID | 20230508070359.357474-1-s-vadapalli@ti.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1967150vqo; Mon, 8 May 2023 00:16:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6nfPTrjLezf9AgK9GM6Wx+OIx4672G2pR5GiKFPiiK0VYkEVmR1+wNSKfTuBqqPId0dqNS X-Received: by 2002:a05:6a00:1916:b0:63d:2b95:5476 with SMTP id y22-20020a056a00191600b0063d2b955476mr12436877pfi.23.1683530194784; Mon, 08 May 2023 00:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683530194; cv=none; d=google.com; s=arc-20160816; b=mxcE9GAsqLZTYTVulAsTffvltALPfWoYhyaCQAadSzWLTiFVcdIkNQCIsP9gQhco96 RblFojD/DoVYeOjZNo30HQtcpeOiroufvDyt0KB1xjngeZnZ2Cs75XgRhXcaDB2B+8W4 8FcwnSf11ahbcHIlHd0qedCVT2QoLvkvkiEzR2tNd3xyfxiLM+4Zg9I66P5jGQAJsqDY FEmLDJWyuxcyBTeQUn+6XgpUUDS+e1qsQR5bcO6dtlR99WWziQlcU8x4+mSoMzXhTDrP CSxEtmcjPmUW9B5EH5+/nQbN5YbWDLprvwd9DW63QZgwrO6uhyOgxh7wpyNt+ucQTWvX CvcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=chEfS61x65xMVhUCjFBAUnEr02zz7hnvBnAi5qM39/g=; b=tjyB0lLCl0stNFuUZFRnpcMs3ylbKWhopKc4gFvh5t6eqQ3Rql/hhkOQCgYjAH5NA9 Src0TGYK+UC4EQKrLRugTud+PtWmH57GXQdrik4W87VFXMKZi8z+4CmsXL+ihCH5s1Qn yVtZI5JwIzktQcwyqdyWj6y0+h1BXdDIurP4PT5w8xYrOW3p6sp/mcGEwzkJ15vbXIe9 xgCVE3IpgV7oLiVCdJhHtSShF2Rue4nJE+YRInefb+ffaGVQrLi71U+6rHfuHDiu4d2a zPYqx3uL1uM7GWtVFbHprc4ByO1YOEVw+HNT5giHwK6FXyo0lD1g8XNhiqlHHvVO9oEI ifxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="WfL/Z/Yo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt8-20020a632908000000b00502f4fd0c16si7767371pgb.653.2023.05.08.00.16.21; Mon, 08 May 2023 00:16:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="WfL/Z/Yo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233230AbjEHHFd (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Mon, 8 May 2023 03:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233293AbjEHHFC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 8 May 2023 03:05:02 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AAFA1E991; Mon, 8 May 2023 00:04:26 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3487440J112127; Mon, 8 May 2023 02:04:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1683529444; bh=chEfS61x65xMVhUCjFBAUnEr02zz7hnvBnAi5qM39/g=; h=From:To:CC:Subject:Date; b=WfL/Z/Yom0nFGVEtslS333Z+GMddMog0YwPxr42Pfv+UtJNi4eZTKm/qePqzh+wq6 /SrSRiwhxRs6CDbo64FmWtqGHvI2xOeV5Xj/TJG4ztIFfdmYk/35cTrvNdUzb5K4eJ k3h1IWoa8Z84GmVPRO/D6us0BVWV9OV3ToRlFZ6s= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3487440V029859 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 8 May 2023 02:04:04 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 8 May 2023 02:04:03 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 8 May 2023 02:04:03 -0500 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 34873xcx035885; Mon, 8 May 2023 02:04:00 -0500 From: Siddharth Vadapalli <s-vadapalli@ti.com> To: <andrew@lunn.ch>, <hkallweit1@gmail.com>, <linux@armlinux.org.uk>, <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com> CC: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <srk@ti.com>, <s-vadapalli@ti.com> Subject: [PATCH net-next] net: phy: dp83869: support mii mode when rgmii strap cfg is used Date: Mon, 8 May 2023 12:33:59 +0530 Message-ID: <20230508070359.357474-1-s-vadapalli@ti.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765309357491234760?= X-GMAIL-MSGID: =?utf-8?q?1765309357491234760?= |
Series |
[net-next] net: phy: dp83869: support mii mode when rgmii strap cfg is used
|
|
Commit Message
Siddharth Vadapalli
May 8, 2023, 7:03 a.m. UTC
From: Grygorii Strashko <grygorii.strashko@ti.com> The DP83869 PHY on TI's k3-am642-evm supports both MII and RGMII interfaces and is configured by default to use RGMII interface (strap). However, the board design allows switching dynamically to MII interface for testing purposes by applying different set of pinmuxes. To support switching to MII interface, update the DP83869 PHY driver to configure OP_MODE_DECODE.RGMII_MII_SEL(bit 5) properly when MII PHY interface mode is requested. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> --- RFC patch at: https://lore.kernel.org/r/20230425054429.3956535-3-s-vadapalli@ti.com/ Changes since RFC patch: - Change patch subject to PATCH net-next. - Reword commit message to indicate that the patch adds new support and is not intended to be a bug fix. - Add check to ensure that MII mode is requested only with valid operational modes. drivers/net/phy/dp83869.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
Comments
On Mon, May 08, 2023 at 12:33:59PM +0530, Siddharth Vadapalli wrote: > From: Grygorii Strashko <grygorii.strashko@ti.com> > > The DP83869 PHY on TI's k3-am642-evm supports both MII and RGMII > interfaces and is configured by default to use RGMII interface (strap). > However, the board design allows switching dynamically to MII interface > for testing purposes by applying different set of pinmuxes. > > To support switching to MII interface, update the DP83869 PHY driver to > configure OP_MODE_DECODE.RGMII_MII_SEL(bit 5) properly when MII PHY > interface mode is requested. > > Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> > Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
Hello: This patch was applied to netdev/net-next.git (main) by Paolo Abeni <pabeni@redhat.com>: On Mon, 8 May 2023 12:33:59 +0530 you wrote: > From: Grygorii Strashko <grygorii.strashko@ti.com> > > The DP83869 PHY on TI's k3-am642-evm supports both MII and RGMII > interfaces and is configured by default to use RGMII interface (strap). > However, the board design allows switching dynamically to MII interface > for testing purposes by applying different set of pinmuxes. > > [...] Here is the summary with links: - [net-next] net: phy: dp83869: support mii mode when rgmii strap cfg is used https://git.kernel.org/netdev/net-next/c/94e86ef1b801 You are awesome, thank you!
diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c index 9ab5eff502b7..fa8c6fdcf301 100644 --- a/drivers/net/phy/dp83869.c +++ b/drivers/net/phy/dp83869.c @@ -692,8 +692,19 @@ static int dp83869_configure_mode(struct phy_device *phydev, /* Below init sequence for each operational mode is defined in * section 9.4.8 of the datasheet. */ + phy_ctrl_val = dp83869->mode; + if (phydev->interface == PHY_INTERFACE_MODE_MII) { + if (dp83869->mode == DP83869_100M_MEDIA_CONVERT || + dp83869->mode == DP83869_RGMII_100_BASE) { + phy_ctrl_val |= DP83869_OP_MODE_MII; + } else { + phydev_err(phydev, "selected op-mode is not valid with MII mode\n"); + return -EINVAL; + } + } + ret = phy_write_mmd(phydev, DP83869_DEVADDR, DP83869_OP_MODE, - dp83869->mode); + phy_ctrl_val); if (ret) return ret;