Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6518343rwr; Mon, 24 Apr 2023 22:48:28 -0700 (PDT) X-Google-Smtp-Source: AKy350a/JUT2zpQXnFLrNKorYtCu7dzqKONJ5+lYhAUYy/qSS2euS96lIItfCmz/04jHfLqyw1cQ X-Received: by 2002:a17:902:eb8f:b0:1a6:494b:5b0 with SMTP id q15-20020a170902eb8f00b001a6494b05b0mr15079202plg.40.1682401708285; Mon, 24 Apr 2023 22:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682401708; cv=none; d=google.com; s=arc-20160816; b=B5v4FvUrRpyIYAtygltWV1RQI8x/rzK68vw8ghaui7LMKM1AUkXQmrC2ceJRCEmEbR rmBmri31xfOu4X+6BwJ1nR1zgtD8ZgM4latbAbc8hOGNmrungmgIdTecSNHatqVXY3+l 1ElU/OUDRqRIhBkbZWA55fDW6HpILSVIUN1NusKS2n+Ol9WPwN/Vv0d34yxFJS+fZVJX yPxbH8fvsQDgRyWLEZ21tyY5YxXCJOkngEvQjH38jATTeO2BPQopCN6R0QWnUES4kUMc DqpdMruaPX+39o4Vi8iv3dIycQVRRkj0t37G3A1tLjl2utSUjql4op0e0Oqkoy5TRJZB xSig== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3wDxwAR+CCOnwWR6upvy6Zihsi8yqla39FCimDo+1BM=; b=pThYAkE6AAH8U8cgyThhZHrjFlewX5SDWgMqfUJec8IH+1zu3q5NObGttms3cL6aLa FKZEnwpmAmjId+ZJV17nFKErePbCvSMhfrHhGrhFKiFSvUWzXTq5+oPjyJBae9xyXTKB NB9ACttmS5SX8F/xeS00ZrSt02xuXMTqf9rIwYs1pbRTUXD+LZc4mfM+XL/Sut0SSC2U W4OSQOSX5CSbpHFsh4BvSIDijBiFaJEDHfCtARaCLmwb+EzFrTIDdNyAmY8cHB9yhYUg U6ftPAhezmtJxc8nqnnkk/sICxUJEquD19WHZMoVQJ6DCH/T5OG6HG2dsKZWtimTAslz q6cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BV74RoKd; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a63460b000000b0051aed25131asi12902986pga.252.2023.04.24.22.48.17; Mon, 24 Apr 2023 22:48:28 -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=BV74RoKd; 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 S232661AbjDYFpF (ORCPT + 99 others); Tue, 25 Apr 2023 01:45:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233167AbjDYFpD (ORCPT ); Tue, 25 Apr 2023 01:45:03 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93F4F83EC; Mon, 24 Apr 2023 22:45:00 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33P5ifmp104119; Tue, 25 Apr 2023 00:44:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1682401481; bh=3wDxwAR+CCOnwWR6upvy6Zihsi8yqla39FCimDo+1BM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=BV74RoKdPWYIXkTDAic5TBueevO2QWIMX8XZ6Bagx8t6RJ8jpKD88H9U+d9PcdMtx c1Xgp40xzaq7Mzsg1HOH+2ipGSi8w7BgLK6LVNdO+bMd9xABEJHUa9faV3v3r5A/dP 2vFPp3l8XcP+jE73IOwxCvj9uF/8Ulg9lv0kszmM= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33P5if1g112335 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 25 Apr 2023 00:44:41 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 25 Apr 2023 00:44:41 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 25 Apr 2023 00:44:41 -0500 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33P5iURp124283; Tue, 25 Apr 2023 00:44:38 -0500 From: Siddharth Vadapalli To: , , , , , , CC: , , , , Subject: [RFC PATCH 2/2] net: phy: dp83869: fix mii mode when rgmii strap cfg is used Date: Tue, 25 Apr 2023 11:14:29 +0530 Message-ID: <20230425054429.3956535-3-s-vadapalli@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230425054429.3956535-1-s-vadapalli@ti.com> References: <20230425054429.3956535-1-s-vadapalli@ti.com> 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.6 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,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Grygorii Strashko 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 Signed-off-by: Siddharth Vadapalli --- drivers/net/phy/dp83869.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c index 9ab5eff502b7..8dbc502bcd9e 100644 --- a/drivers/net/phy/dp83869.c +++ b/drivers/net/phy/dp83869.c @@ -692,8 +692,11 @@ 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) + phy_ctrl_val |= DP83869_OP_MODE_MII; ret = phy_write_mmd(phydev, DP83869_DEVADDR, DP83869_OP_MODE, - dp83869->mode); + phy_ctrl_val); if (ret) return ret; -- 2.25.1