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 8E4A945B04; Thu, 10 Oct 2024 16:20:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4538D41153; Thu, 10 Oct 2024 16:15:38 +0200 (CEST) Received: from egress-ip42a.ess.de.barracuda.com (egress-ip42a.ess.de.barracuda.com [18.185.115.201]) by mails.dpdk.org (Postfix) with ESMTP id 6D3AC40E34 for ; Thu, 10 Oct 2024 16:15:11 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2104.outbound.protection.outlook.com [104.47.17.104]) by mx-outbound11-198.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Oct 2024 14:15:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=M6dxnGNaKtBaNQr94t8Cn/bwDqB/7LNiaQd6rRmg8QgQKVuhTZZrSrxYRvolVI0gpmthVeagbLdWxOTyzWTMasNJKi6geUO6D5VStFdf6EYn6FCIiJE0vY8wbBSz3xlc4EArX1yD4spaAO+YNaGoqoEVWjuDDRyGNj8lNYVdOl6k/Ymj9AQKt4JjpFR3vDs367gE8ruSECeCNOLYTIPqec4zJFzkSIFfMOPFBgFOKAB2wZWWgw/T1wHGWj3PE9n1ukdszY023fggrOFu4Tv+7KXtPWdKaUKBYVAEAT5j7IN22lcEEDhg8aUTG67brDL2jrcJqsch3J8ms931FWxV2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r6BMe9p3AS9p6jV0qdQJLmOQLAdVojFRzGfGKt6AEt4=; b=jV3AMTFNFvr2FmXTxj3+kJ4sTZAO9GjPRf5yYiJaWOEW96bgY1myefLyzCXRy1V4JspV+bR5BscBHvwQ7o0abHvtAo+GFOi3rharobddaN8YsccGEzM5doG/y9yhW/S0Ww9vJp7h8dfg2gohrLipe41jCwWFmaY64/Hj8OnueCwM78/8sRmk+pnEzz++b8UXVnimvHp74fXljza8cnz4cDDR49a5M7yNblMUMVSgCkeQS/MJp+hLrUw8kfmbYMdCJ4Wbfm0Atq3Np3zC/rkqAXDlV5QyfpX4jv5usAwYfCe6+mpxn+2rA6yJzWjsE0zBYpH4bXY2pAU0DyBjNymZ2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 178.72.21.4) smtp.rcpttodomain=dpdk.org smtp.mailfrom=napatech.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=napatech.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r6BMe9p3AS9p6jV0qdQJLmOQLAdVojFRzGfGKt6AEt4=; b=MbDB555JcKIVE+JwEKwaRBVTi25QCgo1q23tF+HGzZjDw5tu+O3OVihN0p99Qozci4fbaF52noLb35EEyXclXQNsoAI6LEmiMVpkX6jOYsvNy56vMVs8U8M6qcV8kGlDvHmscbwbKMtBvK8bomDUkuuQnl+Px0zC2LRXoyxmGuM= Received: from DU2PR04CA0070.eurprd04.prod.outlook.com (2603:10a6:10:232::15) by PA2P190MB2125.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:408::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Thu, 10 Oct 2024 14:14:59 +0000 Received: from DU6PEPF0000B61B.eurprd02.prod.outlook.com (2603:10a6:10:232:cafe::7c) by DU2PR04CA0070.outlook.office365.com (2603:10a6:10:232::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.17 via Frontend Transport; Thu, 10 Oct 2024 14:14:59 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 178.72.21.4) smtp.mailfrom=napatech.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=napatech.com; Received-SPF: Fail (protection.outlook.com: domain of napatech.com does not designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com; client-ip=178.72.21.4; helo=localhost.localdomain; Received: from localhost.localdomain (178.72.21.4) by DU6PEPF0000B61B.mail.protection.outlook.com (10.167.8.132) with Microsoft SMTP Server id 15.20.8048.13 via Frontend Transport; Thu, 10 Oct 2024 14:14:58 +0000 From: Serhii Iliushyk To: dev@dpdk.org Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com, andrew.rybchenko@oktetlabs.ru, ferruh.yigit@amd.com, Oleksandr Kolomeiets Subject: [PATCH v3 36/50] net/ntnic: add receive MAC converter (RMC) core module Date: Thu, 10 Oct 2024 16:13:51 +0200 Message-ID: <20241010141416.4063591-37-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241010141416.4063591-1-sil-plv@napatech.com> References: <20241006203728.330792-2-sil-plv@napatech.com> <20241010141416.4063591-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B61B:EE_|PA2P190MB2125:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 7b024629-095a-4d54-ea80-08dce935eca8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?pj3NqnVNdbcAYsIb2GNhSORd3us02Yf6v51L7dF5MUx5XJwxDcbqKHy4ZhOT?= =?us-ascii?Q?AvaELpoNe9lK7d7dtMSTeDy9arWoYNYg3/DnwygHJs4F1gSSic2ZB/8mvZgz?= =?us-ascii?Q?YqZWUvuo+Vb9Gi9g1FVA5HuCDZWd9wTt2emlSX7PSX5SA85aP/sLQFmKRGdR?= =?us-ascii?Q?+ijqZBereE+pCBY5OvPakjCG8X1vu23wRoEXcjMitSjrQsTlGPD6zgFOh6L+?= =?us-ascii?Q?123FhmTR2s/A8mlofznU4k3sjwuKfBuuKco7f438TZqbCMr4LSmVJujcTfEk?= =?us-ascii?Q?BNHujBUotlJTLOVBaghfjrm/c7wCFhFAPBvRgwMadA0L7aNInJGDVZWCzA74?= =?us-ascii?Q?CzPmOTJklRFA8J5tg1wuZ+faw++Tkq0z6zsvdSoTIk2hWSt3cdA/c/53aDXC?= =?us-ascii?Q?o0dVliXO3wHypvhVKXetmNLeP6m+noM1FVHBHAxKtECw9V5Jc30znYVbst/k?= =?us-ascii?Q?Pr0FE9K2smaCMNQQDT4WTx/bX3KlafIQDC1qb4lQesS+f5WUpyPG45Ayo2sD?= =?us-ascii?Q?KGFvs0xSx1DfE0QXq5r0sAMv8kf0GCFROytfvjzbEddXBqGwmhLmc6Ksn/Gg?= =?us-ascii?Q?OyHE5P9Rh5SvPOt6jeRWewKwqDAby1Gxzw+tA6+Kv4uvg+H0yWJ3Y8BKywtj?= =?us-ascii?Q?hIT1ODE2qRD7+Ba8jIDDFyT9lNK0zlbHXpQowcSZ/f8B+aMKhhuQC02rgEar?= =?us-ascii?Q?QdRtgyrqkajVt/yA97hRPLb7HKqRz8oWpPQfly+GO3NucefgJ1EWM1z4fOJj?= =?us-ascii?Q?7Em41QbIkoxEKrW6SbnTZVCULfNrkMeSALpfQNzcOvcBSCp08RJ/hz8wGpnQ?= =?us-ascii?Q?ywJrM3ZLIfF6tCYppdCLFbM0LqPtdpau5+CsFFQhIQE/7CpSvL/088IqinnG?= =?us-ascii?Q?0/iYkmMK3+12++Oa5b6IkC2tvyqVr+g19ARvfvCn/U5ORjg11ooYBiqGp94o?= =?us-ascii?Q?SfGkORHRLubQ/UelG80JKx9AmK4Q6ftiE84XC2vL+aeij6EVNhUn1lKFMBLA?= =?us-ascii?Q?KHGhbg/G7GV5hexDVwtFuCDooEMq3jjlgRl1slwfWiVqsIQuRsGNUmwEccAY?= =?us-ascii?Q?51Z/f/hLqzsWOstkRt8BrzD4yviWSJkuv+3qH/vK/YlN9T5ijZKlxxJS97fW?= =?us-ascii?Q?b+A58oUgl9e589QVYxKdw7dyGWAjyKN8iHGVNACldWtfSgbQKT6CPz8l1WpS?= =?us-ascii?Q?NlpYJY3DhpzmZM42QkF3RMNtNSZBvg1upnpeyOwLK1pbIV9A/RC5m4mcvmL7?= =?us-ascii?Q?LtmaGByv9bBPciiaPkG+USJW70LEKMQVlenqzSDfI+gfbmypK1/QkksTBw+i?= =?us-ascii?Q?Gq+pC4gptVlbKNY9jLv4Hbz+hZ131JFKxqtyPMIEcOAkjDA72eUZBB9XLX3T?= =?us-ascii?Q?gPTUjC7Ro6bxs9Jza8TjpJFV/RA4?= X-Forefront-Antispam-Report: CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:localhost.localdomain; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: qnfS6rt6h7dKgDTLTB+SsnJzM8dE1+nWIuCc/ciKkH0Vf8KIUJ2PDyZTqDRXkcrG2VIqFIwI1wb8BRndpL34LJ3YVo5RgUHjaCrH1+tpG+ir3LftsxD6K9jf5w2HgJO7OF7vzLyXUApgQau0n50fiMRrI2NL6baJDfzHAesDgBKv54RklQC49d5Brf7c7JR5AU1QZGfayYxtTLrPwl1/KP3TjM7vW1tsQVOTL+pQT1YIdPBHCNHnjiwDDBBPMEz/RunIPFXWhvTf2N04IBFJl2Zgr5H0E9o2sh7aIumjWAgpKHJ8mZ0j7iEU/EYYmFztFQAmHumDjVhhWHwj6oaroWppdj7xtHPbYjSKIqLPQq0HEb0orMPKtiSJktP3m0YzKohIZeopksPhx18R0XFj4q93X0NMo4dED6hINe8cpVu2y2MSkZxJnEbnUmWMcoxRCviDURB78s/DVVDGltPQMk3wQE4dXqd94d64tI6Dl9Ofh/JMvoH3QMdpQR1QXzzf75KPFnm7RFOlvZusjBGpbSOeQmfT4NcJEz0hEkXPDDnLov9uQC1zFznKzv3TFRA0ekGDv3Mx4EalNTBuLcIgx9PxC7wwyS4WYPCpAl4b1UKfeKETu/zs4kBQZNQDHsp70kJFQHW7HLTKuSRjb5wLZr7MfLSzL+qb54v0CYoDm1I= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 14:14:58.9986 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b024629-095a-4d54-ea80-08dce935eca8 X-MS-Exchange-CrossTenant-Id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4]; Helo=[localhost.localdomain] X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF0000B61B.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2P190MB2125 X-BESS-ID: 1728569709-303014-12776-25656-1 X-BESS-VER: 2019.1_20241004.2057 X-BESS-Apparent-Source-IP: 104.47.17.104 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoZGZsYGQGYGUNTS2NTYwtTY2N jI2NQoydQ8ycLcPNnIIinJxMTSwiTZUKk2FgCP0p/EQgAAAA== X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259630 [from cloudscan16-205.eu-central-1b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 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: Oleksandr Kolomeiets The RX MAC Converter module is part of the control mechanism of the physical ports. Signed-off-by: Oleksandr Kolomeiets --- v2 * Fix Typo/Spelling * Update release notes v3 * Remove newline characters from logs. --- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/adapter/nt4ga_adapter.c | 14 +++ drivers/net/ntnic/include/nt4ga_adapter.h | 1 + drivers/net/ntnic/include/ntnic_stat.h | 11 +++ drivers/net/ntnic/meson.build | 1 + .../net/ntnic/nthw/core/include/nthw_rmc.h | 49 ++++++++++ drivers/net/ntnic/nthw/core/nthw_rmc.c | 90 +++++++++++++++++++ .../supported/nthw_fpga_9563_055_049_0000.c | 29 +++++- .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_rmc.h | 36 ++++++++ 11 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ntnic/include/ntnic_stat.h create mode 100644 drivers/net/ntnic/nthw/core/include/nthw_rmc.h create mode 100644 drivers/net/ntnic/nthw/core/nthw_rmc.c create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rmc.h diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index 28d27366f1..705a62f226 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -106,6 +106,7 @@ New Features * Extended and fixed the implementation of the logging * Added NT flow filter init API * Added NT flow backend initialization API + * Added initialization of FPGA modules related to flow HW offload Removed Items ------------- diff --git a/drivers/net/ntnic/adapter/nt4ga_adapter.c b/drivers/net/ntnic/adapter/nt4ga_adapter.c index b710e6ae13..d9e6716c30 100644 --- a/drivers/net/ntnic/adapter/nt4ga_adapter.c +++ b/drivers/net/ntnic/adapter/nt4ga_adapter.c @@ -212,6 +212,20 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) } } + nthw_rmc_t *p_nthw_rmc = nthw_rmc_new(); + if (p_nthw_rmc == NULL) { + NT_LOG(ERR, NTNIC, "Failed to allocate memory for RMC module"); + return -1; + } + + res = nthw_rmc_init(p_nthw_rmc, p_fpga, 0); + if (res) { + NT_LOG(ERR, NTNIC, "Failed to initialize RMC module"); + return -1; + } + + nthw_rmc_unblock(p_nthw_rmc, false); + return 0; } diff --git a/drivers/net/ntnic/include/nt4ga_adapter.h b/drivers/net/ntnic/include/nt4ga_adapter.h index 93218fd45b..809135f130 100644 --- a/drivers/net/ntnic/include/nt4ga_adapter.h +++ b/drivers/net/ntnic/include/nt4ga_adapter.h @@ -27,6 +27,7 @@ typedef struct hw_info_s { * Services provided by the adapter module */ #include "nt4ga_filter.h" +#include "ntnic_stat.h" typedef struct adapter_info_s { struct nt4ga_filter_s nt4ga_filter; diff --git a/drivers/net/ntnic/include/ntnic_stat.h b/drivers/net/ntnic/include/ntnic_stat.h new file mode 100644 index 0000000000..148088fe1d --- /dev/null +++ b/drivers/net/ntnic/include/ntnic_stat.h @@ -0,0 +1,11 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#ifndef NTNIC_STAT_H_ +#define NTNIC_STAT_H_ + +#include "nthw_rmc.h" + +#endif /* NTNIC_STAT_H_ */ diff --git a/drivers/net/ntnic/meson.build b/drivers/net/ntnic/meson.build index e2eff3cf1e..66d2770da7 100644 --- a/drivers/net/ntnic/meson.build +++ b/drivers/net/ntnic/meson.build @@ -41,6 +41,7 @@ sources = files( 'nthw/core/nthw_iic.c', 'nthw/core/nthw_mac_pcs.c', 'nthw/core/nthw_pcie3.c', + 'nthw/core/nthw_rmc.c', 'nthw/core/nthw_sdc.c', 'nthw/core/nthw_si5340.c', 'nthw/flow_api/flow_api.c', diff --git a/drivers/net/ntnic/nthw/core/include/nthw_rmc.h b/drivers/net/ntnic/nthw/core/include/nthw_rmc.h new file mode 100644 index 0000000000..2345820bdc --- /dev/null +++ b/drivers/net/ntnic/nthw/core/include/nthw_rmc.h @@ -0,0 +1,49 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#ifndef NTHW_RMC_H_ +#define NTHW_RMC_H_ + +#include "nthw_fpga_model.h" + +struct nthw_rmc { + nthw_fpga_t *mp_fpga; + nthw_module_t *mp_mod_rmc; + int mn_instance; + + int mn_ports; + int mn_nims; + + bool mb_administrative_block; + + /* RMC CTRL register */ + nthw_register_t *mp_reg_ctrl; + nthw_field_t *mp_fld_ctrl_block_stat_drop; + nthw_field_t *mp_fld_ctrl_block_keep_alive; + nthw_field_t *mp_fld_ctrl_block_mac_port; + + /* RMC Status register */ + nthw_register_t *mp_reg_status; + nthw_field_t *mp_fld_sf_ram_of; + nthw_field_t *mp_fld_descr_fifo_of; + + /* RMC DBG register */ + nthw_register_t *mp_reg_dbg; + nthw_field_t *mp_fld_dbg_merge; + + /* RMC MAC_IF register */ + nthw_register_t *mp_reg_mac_if; + nthw_field_t *mp_fld_mac_if_err; +}; + +typedef struct nthw_rmc nthw_rmc_t; +typedef struct nthw_rmc nthw_rmc; + +nthw_rmc_t *nthw_rmc_new(void); +int nthw_rmc_init(nthw_rmc_t *p, nthw_fpga_t *p_fpga, int n_instance); + +void nthw_rmc_unblock(nthw_rmc_t *p, bool b_is_secondary); + +#endif /* NTHW_RMC_H_ */ diff --git a/drivers/net/ntnic/nthw/core/nthw_rmc.c b/drivers/net/ntnic/nthw/core/nthw_rmc.c new file mode 100644 index 0000000000..4a01424c24 --- /dev/null +++ b/drivers/net/ntnic/nthw/core/nthw_rmc.c @@ -0,0 +1,90 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#include "ntlog.h" + +#include "nthw_drv.h" +#include "nthw_register.h" + +#include "nthw_rmc.h" + +nthw_rmc_t *nthw_rmc_new(void) +{ + nthw_rmc_t *p = malloc(sizeof(nthw_rmc_t)); + + if (p) + memset(p, 0, sizeof(nthw_rmc_t)); + + return p; +} + +int nthw_rmc_init(nthw_rmc_t *p, nthw_fpga_t *p_fpga, int n_instance) +{ + const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str; + nthw_module_t *p_mod = nthw_fpga_query_module(p_fpga, MOD_RMC, n_instance); + + if (p == NULL) + return p_mod == NULL ? -1 : 0; + + if (p_mod == NULL) { + NT_LOG(ERR, NTHW, "%s: RMC %d: no such instance", p_adapter_id_str, n_instance); + return -1; + } + + p->mp_fpga = p_fpga; + p->mn_instance = n_instance; + p->mp_mod_rmc = p_mod; + + /* Params */ + p->mn_ports = + nthw_fpga_get_product_param(p_fpga, NT_RX_PORTS, + nthw_fpga_get_product_param(p_fpga, NT_PORTS, 0)); + p->mn_nims = nthw_fpga_get_product_param(p_fpga, NT_NIMS, 0); + p->mb_administrative_block = false; + + NT_LOG(DBG, NTHW, "%s: RMC %d", p_adapter_id_str, p->mn_instance); + + p->mp_reg_ctrl = nthw_module_get_register(p->mp_mod_rmc, RMC_CTRL); + + p->mp_fld_ctrl_block_stat_drop = + nthw_register_get_field(p->mp_reg_ctrl, RMC_CTRL_BLOCK_STATT); + p->mp_fld_ctrl_block_keep_alive = + nthw_register_get_field(p->mp_reg_ctrl, RMC_CTRL_BLOCK_KEEPA); + p->mp_fld_ctrl_block_mac_port = + nthw_register_get_field(p->mp_reg_ctrl, RMC_CTRL_BLOCK_MAC_PORT); + + p->mp_reg_status = nthw_module_query_register(p->mp_mod_rmc, RMC_STATUS); + + if (p->mp_reg_status) { + p->mp_fld_sf_ram_of = + nthw_register_get_field(p->mp_reg_status, RMC_STATUS_SF_RAM_OF); + p->mp_fld_descr_fifo_of = + nthw_register_get_field(p->mp_reg_status, RMC_STATUS_DESCR_FIFO_OF); + } + + p->mp_reg_dbg = nthw_module_query_register(p->mp_mod_rmc, RMC_DBG); + + if (p->mp_reg_dbg) + p->mp_fld_dbg_merge = nthw_register_get_field(p->mp_reg_dbg, RMC_DBG_MERGE); + + p->mp_reg_mac_if = nthw_module_query_register(p->mp_mod_rmc, RMC_MAC_IF); + + if (p->mp_reg_mac_if) + p->mp_fld_mac_if_err = nthw_register_get_field(p->mp_reg_mac_if, RMC_MAC_IF_ERR); + + return 0; +} + +void nthw_rmc_unblock(nthw_rmc_t *p, bool b_is_secondary) +{ + uint32_t n_block_mask = ~0U << (b_is_secondary ? p->mn_nims : p->mn_ports); + + /* BLOCK_STATT(0)=0 BLOCK_KEEPA(1)=0 BLOCK_MAC_PORT(8:11)=0 */ + if (!p->mb_administrative_block) { + nthw_field_clr_flush(p->mp_fld_ctrl_block_stat_drop); + nthw_field_clr_flush(p->mp_fld_ctrl_block_keep_alive); + nthw_field_set_val_flush32(p->mp_fld_ctrl_block_mac_port, n_block_mask); + } +} diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c b/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c index 9f821abf55..98b857158e 100644 --- a/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c @@ -1468,6 +1468,32 @@ static nthw_fpga_register_init_s rac_registers[] = { { RAC_RAB_OB_DATA, 4168, 32, NTHW_FPGA_REG_TYPE_RC1, 0, 1, rac_rab_ob_data_fields }, }; +static nthw_fpga_field_init_s rmc_ctrl_fields[] = { + { RMC_CTRL_BLOCK_KEEPA, 1, 1, 1 }, { RMC_CTRL_BLOCK_MAC_PORT, 2, 8, 3 }, + { RMC_CTRL_BLOCK_RPP_SLICE, 8, 10, 0 }, { RMC_CTRL_BLOCK_STATT, 1, 0, 1 }, + { RMC_CTRL_LAG_PHY_ODD_EVEN, 1, 24, 0 }, +}; + +static nthw_fpga_field_init_s rmc_dbg_fields[] = { + { RMC_DBG_MERGE, 31, 0, 0 }, +}; + +static nthw_fpga_field_init_s rmc_mac_if_fields[] = { + { RMC_MAC_IF_ERR, 31, 0, 0 }, +}; + +static nthw_fpga_field_init_s rmc_status_fields[] = { + { RMC_STATUS_DESCR_FIFO_OF, 1, 16, 0 }, + { RMC_STATUS_SF_RAM_OF, 1, 0, 0 }, +}; + +static nthw_fpga_register_init_s rmc_registers[] = { + { RMC_CTRL, 0, 25, NTHW_FPGA_REG_TYPE_RW, 771, 5, rmc_ctrl_fields }, + { RMC_DBG, 2, 31, NTHW_FPGA_REG_TYPE_RO, 0, 1, rmc_dbg_fields }, + { RMC_MAC_IF, 3, 31, NTHW_FPGA_REG_TYPE_RO, 0, 1, rmc_mac_if_fields }, + { RMC_STATUS, 1, 17, NTHW_FPGA_REG_TYPE_RO, 0, 2, rmc_status_fields }, +}; + static nthw_fpga_field_init_s rst9563_ctrl_fields[] = { { RST9563_CTRL_PTP_MMCM_CLKSEL, 1, 2, 1 }, { RST9563_CTRL_TS_CLKSEL, 1, 1, 1 }, @@ -1550,6 +1576,7 @@ static nthw_fpga_module_init_s fpga_modules[] = { { MOD_PDB, 0, MOD_PDB, 0, 9, NTHW_FPGA_BUS_TYPE_RAB1, 2560, 3, pdb_registers }, { MOD_QSL, 0, MOD_QSL, 0, 7, NTHW_FPGA_BUS_TYPE_RAB1, 1792, 8, qsl_registers }, { MOD_RAC, 0, MOD_RAC, 3, 0, NTHW_FPGA_BUS_TYPE_PCI, 8192, 14, rac_registers }, + { MOD_RMC, 0, MOD_RMC, 1, 3, NTHW_FPGA_BUS_TYPE_RAB0, 12288, 4, rmc_registers }, { MOD_RST9563, 0, MOD_RST9563, 0, 5, NTHW_FPGA_BUS_TYPE_RAB0, 1024, 5, rst9563_registers }, }; @@ -1710,5 +1737,5 @@ static nthw_fpga_prod_param_s product_parameters[] = { }; nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000 = { - 200, 9563, 55, 49, 0, 0, 1726740521, 152, product_parameters, 20, fpga_modules, + 200, 9563, 55, 49, 0, 0, 1726740521, 152, product_parameters, 21, fpga_modules, }; diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h b/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h index 51b2d99c01..5d6aac122c 100644 --- a/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h @@ -34,6 +34,7 @@ #define MOD_PDB (0xa7771bffUL) #define MOD_QSL (0x448ed859UL) #define MOD_RAC (0xae830b42UL) +#define MOD_RMC (0x236444eUL) #define MOD_RPP_LR (0xba7f945cUL) #define MOD_RST9563 (0x385d6d1dUL) #define MOD_SDC (0xd2369530UL) diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h index 8fa41eb7ea..45f9794958 100644 --- a/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h @@ -35,6 +35,7 @@ #include "nthw_fpga_reg_defs_pdb.h" #include "nthw_fpga_reg_defs_qsl.h" #include "nthw_fpga_reg_defs_rac.h" +#include "nthw_fpga_reg_defs_rmc.h" #include "nthw_fpga_reg_defs_rpl.h" #include "nthw_fpga_reg_defs_rpp_lr.h" #include "nthw_fpga_reg_defs_rst9563.h" diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rmc.h b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rmc.h new file mode 100644 index 0000000000..07a1c8f890 --- /dev/null +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rmc.h @@ -0,0 +1,36 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2024 Napatech A/S + */ + +/* + * nthw_fpga_reg_defs_rmc.h + * + * Auto-generated file - do *NOT* edit + * + */ + +#ifndef _NTHW_FPGA_REG_DEFS_RMC_ +#define _NTHW_FPGA_REG_DEFS_RMC_ + +/* RMC */ +#define NTHW_MOD_RMC (0x236444eUL) +#define RMC_CTRL (0x4c45f748UL) +#define RMC_CTRL_BLOCK_KEEPA (0x5e036c8UL) +#define RMC_CTRL_BLOCK_MAC_PORT (0x582a6486UL) +#define RMC_CTRL_BLOCK_RPP_SLICE (0x58c719cUL) +#define RMC_CTRL_BLOCK_STATT (0xb36d5342UL) +#define RMC_CTRL_LAG_PHY_ODD_EVEN (0xf4613c9UL) +#define RMC_DBG (0x578721f2UL) +#define RMC_DBG_MERGE (0xebfd6f00UL) +#define RMC_MAC_IF (0x806bb8b0UL) +#define RMC_MAC_IF_ERR (0xa79e974aUL) +#define RMC_STATUS (0x3c415d75UL) +#define RMC_STATUS_DESCR_FIFO_OF (0x7be968baUL) +#define RMC_STATUS_SF_RAM_OF (0x1832173dUL) + +#endif /* _NTHW_FPGA_REG_DEFS_RMC_ */ + +/* + * Auto-generated file - do *NOT* edit + */ -- 2.45.0