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 73375464F0; Thu, 3 Apr 2025 09:09:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8780040A73; Thu, 3 Apr 2025 09:08:50 +0200 (CEST) Received: from mx0a-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 81CF940A71 for ; Thu, 3 Apr 2025 09:08:49 +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 5332gY0f006635 for ; Thu, 3 Apr 2025 00:08:48 -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=6 KigEyi+bIyeuCllX8VlBuCOYijKUYE3wk94MG9Tp/k=; b=SKVcnNthqhJKNqM2g ylG8MqAARBEtckuJzDx5ZhL/SDgYEhonjBTnNykvSLrPXCD0kYRoJYEXEE2yBlhW 18Dod7M/PoCO771ls137R2dSaRit2C+RTKNY0pdN+VrbuRY12zaWNmPZZr7w3gYd 7WsKRpe6KdLv2lsXtP0istP3tssaLzKQoFE7hviZSsZq2B/nY4Lc7eXF3n00nz7W rvaF5n00v50KgCk7HANgcrFY5pH5joEh0MeGAxED6MmDRnvw5vyxFlbKSLgaVPDq BHUqNvw7IuqQr8bTJXiKWA8RnNbTJYtc8WQYUtLBUK5rburRoY/2Bo4VehTnCNnm yRTcQ== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 45rvwfb9s0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 03 Apr 2025 00:08:48 -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.4; Thu, 3 Apr 2025 00:08:47 -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.4 via Frontend Transport; Thu, 3 Apr 2025 00:08:47 -0700 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id C9BD63F70DA; Thu, 3 Apr 2025 00:08:45 -0700 (PDT) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra CC: Subject: [RFC PATCH 3/4] common/cnxk: provide port type from fwdata Date: Thu, 3 Apr 2025 12:38:36 +0530 Message-ID: <20250403070837.926292-3-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250403070837.926292-1-ndabilpuram@marvell.com> References: <20250403070837.926292-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 8RklN1j9A8zKzPwy5dThzQX_G-t4WkIe X-Authority-Analysis: v=2.4 cv=V6p90fni c=1 sm=1 tr=0 ts=67ee3400 cx=c_pps a=rEv8fa4AjpPjGxpoe8rlIQ==:117 a=rEv8fa4AjpPjGxpoe8rlIQ==:17 a=XR8D0OoHHMoA:10 a=M5GUcnROAAAA:8 a=x9mx7A_yV6r5R7-WvSUA:9 a=OBjm3rFKGHvpk9ecZwUJ:22 X-Proofpoint-GUID: 8RklN1j9A8zKzPwy5dThzQX_G-t4WkIe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-03_02,2025-04-02_03,2024-11-22_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 Port type data is made available by firmware via CGX lmac specific firmware data. Extract the same. Signed-off-by: Nithin Dabilpuram --- drivers/common/cnxk/hw/nix.h | 12 ++++++++++++ drivers/common/cnxk/roc_mbox.h | 4 ++-- drivers/common/cnxk/roc_nix.h | 1 + drivers/common/cnxk/roc_nix_mac.c | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/common/cnxk/hw/nix.h b/drivers/common/cnxk/hw/nix.h index de989153ff..2aa23da037 100644 --- a/drivers/common/cnxk/hw/nix.h +++ b/drivers/common/cnxk/hw/nix.h @@ -2735,4 +2735,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 9038ca8fcf..1b0bfbc186 100644 --- a/drivers/common/cnxk/roc_mbox.h +++ b/drivers/common/cnxk/roc_mbox.h @@ -783,8 +783,8 @@ struct cgx_lmac_fwdata_s { uint32_t __io lmac_type; uint32_t __io portm_idx; uint64_t __io mgmt_port : 1; - uint64_t __io advertised_an : 1; -#define LMAC_FWDATA_RESERVED_MEM 1019 + uint64_t __io port; +#define LMAC_FWDATA_RESERVED_MEM 1018 uint64_t __io reserved[LMAC_FWDATA_RESERVED_MEM]; }; diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h index c438a4447c..65778933dd 100644 --- a/drivers/common/cnxk/roc_nix.h +++ b/drivers/common/cnxk/roc_nix.h @@ -416,6 +416,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; }; /** Maximum name length for extended statistics counters */ diff --git a/drivers/common/cnxk/roc_nix_mac.c b/drivers/common/cnxk/roc_nix_mac.c index b99f93818a..026ff41ef2 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) nix->advertised_link_modes = fw_data->fwdata.advertised_link_modes; data->supported_link_modes = nix->supported_link_modes; data->advertised_link_modes = nix->advertised_link_modes; + data->port_type = fw_data->fwdata.port; exit: mbox_put(mbox); return rc; -- 2.34.1