From patchwork Fri May 24 13:06:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sneh Shah X-Patchwork-Id: 13673161 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 A319EC25B74 for ; Fri, 24 May 2024 13:07:58 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iAD3RAtEAMZO+ALwjJT8Gi34MeOM+vKPg11Z84ezUMQ=; b=kb8g2BB9amj3un ek5NIE8lklDv/Wv5g6hBEX7w93SLjEVUMPk8m5NxtnqDVtcRaz4cZ7/BgsZ7cC0909ueDe3kc+eZV ga2MSIt672My+grwGdroW0zrns6bm6jB7BHRlh8j2KIBpobU1dFDoePfykNh9Ki55s+amrQaG4lrS GIaDDQat4w4E1R+VHElUZ9SfNIvW99V+KBgFrWwq6b0y4E6Z/BBv06DPXzIwVZdBBt9U9SrCFAqYr aitGe6LMhX5A4cmbggDpPv7+PfIqTTLz8njSJxmGAts0lX8uTdI5evhXymxmtFRlUhXtJz6xJq0P+ ZpoaixlL5R/w6mG0kGHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAUe8-00000008w1z-1MbM; Fri, 24 May 2024 13:07:44 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAUe1-00000008w0g-3hgl for linux-arm-kernel@lists.infradead.org; Fri, 24 May 2024 13:07:40 +0000 Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44OA3cTs004407; Fri, 24 May 2024 13:07:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:date:from:in-reply-to:message-id:references:subject:to; s= qcppdkim1; bh=U6LfJRZ69tJELkQow2T90K4dj8s3g65UkcpWeUxp53w=; b=ZR 8KkIbaKTshdx/+ci4OHtENEYH7ETIAn2rL6b+4SIvIakVZR4wKXEPpnLwu5cUHTs mY36xZ7oAGv7UzQdQWf86fQPxixYIGaPpPxoff6Nta8DaZtwn1EUM1UyveAKJDN/ pFhCo1lGT7xAzWeCFi6Mnxuo0r0e+BnoFjUfPmxIa7uM9tu6VzNrA5ieccUpoo5K DVZxJ7fUkxA7dp1pWEy+KF/JjxmIyIgggWPvc2ScsgMzYuA/8WTxg6n13SpPJz+7 YjzyESjcTitOduwbi8Qu9vodG1F6ign8ak43JXDxn5CHJjZSvrqabvf1PAlJ4BBU uj6Vp8vpQc73jZ8PT8Vw== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yaa8kjfbb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 May 2024 13:07:21 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 44OD7AWE013849; Fri, 24 May 2024 13:07:17 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3y9qgsns62-1; Fri, 24 May 2024 13:07:17 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 44OD7Hqi014302; Fri, 24 May 2024 13:07:17 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-snehshah-hyd.qualcomm.com [10.147.246.35]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 44OD7H3T014301; Fri, 24 May 2024 13:07:17 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2319345) id 0E0EC5006A4; Fri, 24 May 2024 18:37:16 +0530 (+0530) From: Sneh Shah To: Vinod Koul , Bhupesh Sharma , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Halaney , Russell King Cc: Sneh Shah , kernel@quicinc.com Subject: [PATCH net-next 2/2] net: stmmac: dwmac-qcom-ethqos: Enable support for 2500BASEX Date: Fri, 24 May 2024 18:36:53 +0530 Message-Id: <20240524130653.30666-3-quic_snehshah@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240524130653.30666-1-quic_snehshah@quicinc.com> References: <20240524130653.30666-1-quic_snehshah@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: i1FNlcwi3B_zQ9k7EToeSWHmwJDZKw__ X-Proofpoint-GUID: i1FNlcwi3B_zQ9k7EToeSWHmwJDZKw__ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-24_04,2024-05-24_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 phishscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2405240090 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240524_060737_955307_79DEAB58 X-CRM114-Status: GOOD ( 13.10 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org With integrated PCS qcom mac supports both SGMII and 2500BASEX mode. Implement get_interfaces to add support for 2500BASEX. Signed-off-by: Sneh Shah --- .../net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index e254b21fdb59..dad6e2448475 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -731,6 +731,13 @@ static void ethqos_clks_disable(void *data) ethqos_clks_config(data, false); } +static void ethqos_get_interfaces(struct stmmac_priv *priv) +{ + if (priv->plat->phy_interface == PHY_INTERFACE_MODE_SGMII) + __set_bit(PHY_INTERFACE_MODE_2500BASEX, + priv->phylink_config.supported_interfaces); +}; + static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv) { struct plat_stmmacenet_data *plat_dat = priv->plat; @@ -786,6 +793,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ethqos->configure_func = ethqos_configure_rgmii; break; case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_2500BASEX: ethqos->configure_func = ethqos_configure_sgmii; break; default: @@ -851,6 +859,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev) plat_dat->serdes_powerdown = qcom_ethqos_serdes_powerdown; } + if (plat_dat->flags & STMMAC_FLAG_HAS_INTEGRATED_PCS) + plat_dat->get_interfaces = ethqos_get_interfaces; + /* Enable TSO on queue0 and enable TBS on rest of the queues */ for (i = 1; i < plat_dat->tx_queues_to_use; i++) plat_dat->tx_queues_cfg[i].tbs_en = 1;