X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Fhcapi%2Fhcapi_cfa.h;h=c58092e72dd363378884f99496bf90730d3c78ba;hb=91f7a2d437b9370bc2932125e0c17384cd9aac44;hp=0724865db1dcc301ab5ee425319b206377ed5be1;hpb=847ff69fa62dbc40793eccf0fa51d7bb3fb1639a;p=dpdk.git diff --git a/drivers/net/bnxt/hcapi/hcapi_cfa.h b/drivers/net/bnxt/hcapi/hcapi_cfa.h index 0724865db1..c58092e72d 100644 --- a/drivers/net/bnxt/hcapi/hcapi_cfa.h +++ b/drivers/net/bnxt/hcapi/hcapi_cfa.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2019-2020 Broadcom + * Copyright(c) 2019-2021 Broadcom * All rights reserved. */ @@ -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 @@ -243,7 +254,20 @@ int hcapi_cfa_p4_wc_tcam_hwop(struct hcapi_cfa_hwop *op, struct hcapi_cfa_data *obj_data); int hcapi_cfa_p4_wc_tcam_rec_hwop(struct hcapi_cfa_hwop *op, struct hcapi_cfa_data *obj_data); -#endif /* SUPPORT_CFA_HW_P4 */ +int hcapi_cfa_p4_mirror_hwop(struct hcapi_cfa_hwop *op, + struct hcapi_cfa_data *mirror); +int hcapi_cfa_p4_global_cfg_hwop(struct hcapi_cfa_hwop *op, + uint32_t type, + struct hcapi_cfa_data *config); +/* 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