From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E78EE489AF; Thu, 23 Oct 2025 09:55:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59591402D9; Thu, 23 Oct 2025 09:55:01 +0200 (CEST) Received: from mx0a-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id E3967402C3 for ; Thu, 23 Oct 2025 09:54:59 +0200 (CEST) Received: from pps.filterd (m0431384.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59N3hdoN029708 for ; Thu, 23 Oct 2025 00:54:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=X Wr98Z7VSaq0wHMzZpqbKsrJJ/E+4Vo4hGbeJuwBbUc=; b=IVcb/UOHaZAixjX0B Q9A++Y81YXq4uYpmHOD9PV6nratOB8gf5q5OjmNkyT+vD+VxeufGPLkYTK2G11fJ zUAw1gPeAlwTTZuo4Ww5IUfB1BJguN1SliamBoTJ8c4MkwC0nsc6gKWNRpX1Hjqv WXMAbJ787agCPR5gFWPpeDi7tUS04Cs5IrGvb2B7kcDIBXTKWsNgl07zlIC3fjlW vGD3YmFIr8dz+WtVs8XEA/Eq2l+r21mTDGpLT37bkVNsILAeYhEXF4znTdguSV+3 eJfdMO3/yxvWrZfas3vrZH0Yjf5SyPe7v/ZW/6dce1F0s/aeqyYvulQUz6f3dNYj dgQng== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 49ycq48ds3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Oct 2025 00:54:58 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.25; Thu, 23 Oct 2025 00:55:07 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.25 via Frontend Transport; Thu, 23 Oct 2025 00:55:07 -0700 Received: from cavium-3070-BM23.. (unknown [10.28.34.25]) by maili.marvell.com (Postfix) with ESMTP id 49E973F7090; Thu, 23 Oct 2025 00:54:56 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra CC: Subject: [PATCH v5 2/6] common/cnxk: provide port type from fwdata Date: Thu, 23 Oct 2025 13:23:26 +0530 Message-ID: <20251023075450.4145667-2-skori@marvell.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251023075450.4145667-1-skori@marvell.com> References: <20251023053728.4091023-6-skori@marvell.com> <20251023075450.4145667-1-skori@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDIzMDAzMSBTYWx0ZWRfX1yTOZSnaeSeu cjLh5rYD6NbuZVTJLDPhj0TKRyE6Uc7/CQdfbTNpYM+qXSMUWP0YQ2E12UoKL4p+vysjk1hGJ3y osCAVWF45sHxLQCVmFYdBn8jqGnNrwPiOwxCDzkTd7f65dMCyLeHSqCIr1Dcu4d7a+RK3FRFD3j kbJBWWnnoeD9dxmaJ+nihwMod6qlwhpNtQwlTzgv3XcdaoET7jb+jjdZiNQpoD0Qq1BQZI7DM0a sNXD0tL08X2SA0xwgIK1Pd6sjbUFFIXMiaIGD7GGRXWBfSh73SHQKb2RhePYV6dajsy+846GBck DdtH/YucFxOV+wSmdyChfk1OiMo26GZfVj1k3K+z1ukxsRnUz00i6sLNxfDFW8AfADyY6yCQAMa SxyqujloA5vkcAdgYiCaAaAkUg74+w== X-Authority-Analysis: v=2.4 cv=fI80HJae c=1 sm=1 tr=0 ts=68f9df52 cx=c_pps a=rEv8fa4AjpPjGxpoe8rlIQ==:117 a=rEv8fa4AjpPjGxpoe8rlIQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=M5GUcnROAAAA:8 a=x9mx7A_yV6r5R7-WvSUA:9 a=OBjm3rFKGHvpk9ecZwUJ:22 X-Proofpoint-GUID: AodMDeBd3unYpaLc4IyWfbS800SHS7QB X-Proofpoint-ORIG-GUID: AodMDeBd3unYpaLc4IyWfbS800SHS7QB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-22_08,2025-10-22_01,2025-03-28_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Sunil Kumar Kori Retrieves type of port from firmware data. Signed-off-by: Nithin Dabilpuram Signed-off-by: Sunil Kumar Kori --- drivers/common/cnxk/hw/nix.h | 12 ++++++++++++ drivers/common/cnxk/roc_mbox.h | 13 +++++++++++-- drivers/common/cnxk/roc_nix.h | 1 + drivers/common/cnxk/roc_nix_mac.c | 1 + 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/common/cnxk/hw/nix.h b/drivers/common/cnxk/hw/nix.h index f344d4de99..c438f18145 100644 --- a/drivers/common/cnxk/hw/nix.h +++ b/drivers/common/cnxk/hw/nix.h @@ -2751,4 +2751,16 @@ enum cgx_mode { CGX_MODE_MAX /* = 51 */ }; +/* CGX Port types from kernel */ +enum cgx_port_type { + CGX_PORT_TP = 0x0, + CGX_PORT_AUI, + CGX_PORT_MII, + CGX_PORT_FIBRE, + CGX_PORT_BNC, + CGX_PORT_DA, + CGX_PORT_NONE = 0xef, + CGX_PORT_OTHER = 0xff, +}; + #endif /* __NIX_HW_H__ */ diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h index 7fec23772f..66a3dd2125 100644 --- a/drivers/common/cnxk/roc_mbox.h +++ b/drivers/common/cnxk/roc_mbox.h @@ -755,8 +755,17 @@ enum fec_type { }; struct phy_s { - uint64_t __io can_change_mod_type : 1; - uint64_t __io mod_type : 1; + struct { + uint64_t __io can_change_mod_type : 1; + uint64_t __io mod_type : 1; + uint64_t __io has_fec_stats : 1; + } misc; + struct fec_stats_s { + uint32_t __io rsfec_corr_cws; + uint32_t __io rsfec_uncorr_cws; + uint32_t __io brfec_corr_blks; + uint32_t __io brfec_uncorr_blks; + } fec_stats; }; struct cgx_lmac_fwdata_s { diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h index 41334327bb..a62ddf4732 100644 --- a/drivers/common/cnxk/roc_nix.h +++ b/drivers/common/cnxk/roc_nix.h @@ -507,6 +507,7 @@ struct roc_nix_link_info { struct roc_nix_mac_fwdata { uint64_t advertised_link_modes; uint64_t supported_link_modes; + uint64_t port_type; uint64_t supported_an; }; diff --git a/drivers/common/cnxk/roc_nix_mac.c b/drivers/common/cnxk/roc_nix_mac.c index 08b4f30810..376ff48522 100644 --- a/drivers/common/cnxk/roc_nix_mac.c +++ b/drivers/common/cnxk/roc_nix_mac.c @@ -436,6 +436,7 @@ roc_nix_mac_fwdata_get(struct roc_nix *roc_nix, struct roc_nix_mac_fwdata *data) data->supported_link_modes = nix->supported_link_modes; data->advertised_link_modes = nix->advertised_link_modes; data->supported_an = fw_data->fwdata.supported_an; + data->port_type = fw_data->fwdata.port; exit: mbox_put(mbox); return rc; -- 2.43.0