From: Peter Spreadborough <peter.spreadborough@broadcom.com>
- Moved P4 specific code under the P4 directory
- Added P45 skeleton code for SR to build on
Signed-off-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
---
drivers/net/bnxt/hcapi/hcapi_cfa.h | 39 ++++++++++++++++++++++++--------
drivers/net/bnxt/tf_core/tf_core.h | 2 +-
drivers/net/bnxt/tf_core/tf_device_p45.h | 16 +++++++++++++
drivers/net/bnxt/tf_core/tf_em.h | 6 -----
4 files changed, 46 insertions(+), 17 deletions(-)
create mode 100644 drivers/net/bnxt/tf_core/tf_device_p45.h
@@ -14,7 +14,15 @@
#include "hcapi_cfa_defs.h"
+#if CHIP_CFG == SR_A
+#define SUPPORT_CFA_HW_P45 1
+#undef SUPPORT_CFA_HW_P4
+#define SUPPORT_CFA_HW_P4 0
+#elif CHIP_CFG == CMB_A
#define SUPPORT_CFA_HW_P4 1
+#else
+#error "Chip not supported"
+#endif
#if SUPPORT_CFA_HW_P4 && SUPPORT_CFA_HW_P58 && SUPPORT_CFA_HW_P59
#define SUPPORT_CFA_HW_ALL 1
@@ -81,17 +89,20 @@ struct hcapi_cfa_key_result {
/* common CFA register access macros */
#define CFA_REG(x) OFFSETOF(cfa_reg_t, cfa_##x)
-#ifndef REG_WR
-#define REG_WR(_p, x, y) (*((uint32_t volatile *)(x)) = (y))
+#ifndef TF_REG_WR
+#define TF_REG_WR(_p, x, y) (*((uint32_t volatile *)(x)) = (y))
#endif
-#ifndef REG_RD
-#define REG_RD(_p, x) (*((uint32_t volatile *)(x)))
+#ifndef TF_REG_RD
+#define TF_REG_RD(_p, x) (*((uint32_t volatile *)(x)))
+#endif
+#ifndef TF_CFA_REG_RD
+#define TF_CFA_REG_RD(_p, x) \
+ TF_REG_RD(0, (uint32_t)(_p)->base_addr + CFA_REG(x))
+#endif
+#ifndef TF_CFA_REG_WR
+#define TF_CFA_REG_WR(_p, x, y) \
+ TF_REG_WR(0, (uint32_t)(_p)->base_addr + CFA_REG(x), y)
#endif
-#define CFA_REG_RD(_p, x) \
- REG_RD(0, (uint32_t)(_p)->base_addr + CFA_REG(x))
-#define CFA_REG_WR(_p, x, y) \
- REG_WR(0, (uint32_t)(_p)->base_addr + CFA_REG(x), y)
-
/* Constants used by Resource Manager Registration*/
#define RM_CLIENT_NAME_MAX_LEN 32
@@ -248,7 +259,15 @@ int hcapi_cfa_p4_mirror_hwop(struct hcapi_cfa_hwop *op,
int hcapi_cfa_p4_global_cfg_hwop(struct hcapi_cfa_hwop *op,
uint32_t type,
struct hcapi_cfa_data *config);
-#endif /* SUPPORT_CFA_HW_P4 */
+/* SUPPORT_CFA_HW_P4 */
+#elif SUPPORT_CFA_HW_P45
+int hcapi_cfa_p45_mirror_hwop(struct hcapi_cfa_hwop *op,
+ struct hcapi_cfa_data *mirror);
+int hcapi_cfa_p45_global_cfg_hwop(struct hcapi_cfa_hwop *op,
+ uint32_t type,
+ struct hcapi_cfa_data *config);
+/* SUPPORT_CFA_HW_P45 */
+#endif
/**
* HCAPI CFA device HW operation function callback definition
* This is standardized function callback hook to install different
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
-#include "hcapi/hcapi_cfa.h"
+#include "hcapi/hcapi_cfa_defs.h"
#include "tf_project.h"
/**
new file mode 100644
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019-2020 Broadcom
+ * All rights reserved.
+ */
+
+#ifndef _TF_DEVICE_P45_H_
+#define _TF_DEVICE_P45_H_
+
+#include <cfa_resource_types.h>
+
+#include "tf_core.h"
+#include "tf_rm.h"
+#include "tf_if_tbl.h"
+#include "tf_global_cfg.h"
+
+#endif /* _TF_DEVICE_P45_H_ */
@@ -9,12 +9,6 @@
#include "tf_core.h"
#include "tf_session.h"
-
-#define SUPPORT_CFA_HW_P4 1
-#define SUPPORT_CFA_HW_P58 0
-#define SUPPORT_CFA_HW_P59 0
-#define SUPPORT_CFA_HW_ALL 0
-
#include "hcapi/hcapi_cfa_defs.h"
#define TF_EM_MIN_ENTRIES (1 << 15) /* 32K */