Commit cfb2cffa authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'support-for-octeontx2-98xx-silcion'

Subbaraya Sundeep says:

====================
Support for OcteonTx2 98xx silicon

OcteonTx2 series of silicons have multiple variants, the
98xx variant has two network interface controllers (NIX blocks)
each of which supports upto 100Gbps. Similarly 98xx supports
two crypto blocks (CPT) to double the crypto performance.
The current RVU drivers support a single NIX and
CPT blocks, this patchset adds support for multiple
blocks of same type to be active at the same time.

Also the number of serdes controllers (CGX) have increased
from three to five on 98xx. Each of the CGX block supports
upto 4 physical interfaces depending on the serdes mode ie
upto 20 physical interfaces. At a time each CGX block can
be mapped to a single NIX. The HW configuration to map CGX
and NIX blocks is done by firmware.

NPC has two new interfaces added NIX1_RX and NIX1_TX
similar to NIX0 interfaces. Also MCAM entries is increased
from 4k to 16k. To support the 16k entries extended set
is added in hardware which are at completely different
register offsets. Fortunately new constant registers
can be read to figure out the extended set is present
or not.

This patch set modifies existing AF and PF drivers
in below order to support 98xx:
- Prepare for supporting multiple blocks of same type.
  Functions which operate with block type to get or set
  resources count are modified to operate with block address
- Manage allocating and freeing LFs from new NIX1 and CPT1 RVU blocks.
- NIX block specific initialization and teardown for NIX1
- Based on the mapping set by Firmware, assign the NIX block
  LFs to a PF/VF.
- Multicast entries context is setup for NIX1 along with NIX0
- NPC changes to support extended set of MCAM entries, counters
  and NIX1 interfaces to NPC.
- All the mailbox changes required for the new blocks in 98xx.
- Since there are more CGX links in 98xx the hardcoded LBK
  link value needed by netdev drivers is not sufficient any
  more. Hence AF consumers need to get the number of all links
  and calculate the LBK link.
- Debugfs changes to display NIX1 contexts similar to NIX0
- Debugfs change to display mapping between CGX, NIX and PF.
====================

Link: https://lore.kernel.org/r/1603948549-781-1-git-send-email-sundeep.lkml@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 1a025560 e2fb3730
...@@ -145,6 +145,16 @@ int cgx_get_cgxid(void *cgxd) ...@@ -145,6 +145,16 @@ int cgx_get_cgxid(void *cgxd)
return cgx->cgx_id; return cgx->cgx_id;
} }
u8 cgx_lmac_get_p2x(int cgx_id, int lmac_id)
{
struct cgx *cgx_dev = cgx_get_pdata(cgx_id);
u64 cfg;
cfg = cgx_read(cgx_dev, lmac_id, CGXX_CMRX_CFG);
return (cfg & CMR_P2X_SEL_MASK) >> CMR_P2X_SEL_SHIFT;
}
/* Ensure the required lock for event queue(where asynchronous events are /* Ensure the required lock for event queue(where asynchronous events are
* posted) is acquired before calling this API. Else an asynchronous event(with * posted) is acquired before calling this API. Else an asynchronous event(with
* latest link status) can reach the destination before this function returns * latest link status) can reach the destination before this function returns
...@@ -814,8 +824,7 @@ static int cgx_lmac_verify_fwi_version(struct cgx *cgx) ...@@ -814,8 +824,7 @@ static int cgx_lmac_verify_fwi_version(struct cgx *cgx)
minor_ver = FIELD_GET(RESP_MINOR_VER, resp); minor_ver = FIELD_GET(RESP_MINOR_VER, resp);
dev_dbg(dev, "Firmware command interface version = %d.%d\n", dev_dbg(dev, "Firmware command interface version = %d.%d\n",
major_ver, minor_ver); major_ver, minor_ver);
if (major_ver != CGX_FIRMWARE_MAJOR_VER || if (major_ver != CGX_FIRMWARE_MAJOR_VER)
minor_ver != CGX_FIRMWARE_MINOR_VER)
return -EIO; return -EIO;
else else
return 0; return 0;
......
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
/* Registers */ /* Registers */
#define CGXX_CMRX_CFG 0x00 #define CGXX_CMRX_CFG 0x00
#define CMR_P2X_SEL_MASK GENMASK_ULL(61, 59)
#define CMR_P2X_SEL_SHIFT 59ULL
#define CMR_P2X_SEL_NIX0 1ULL
#define CMR_P2X_SEL_NIX1 2ULL
#define CMR_EN BIT_ULL(55) #define CMR_EN BIT_ULL(55)
#define DATA_PKT_TX_EN BIT_ULL(53) #define DATA_PKT_TX_EN BIT_ULL(53)
#define DATA_PKT_RX_EN BIT_ULL(54) #define DATA_PKT_RX_EN BIT_ULL(54)
...@@ -142,5 +146,6 @@ int cgx_lmac_get_pause_frm(void *cgxd, int lmac_id, ...@@ -142,5 +146,6 @@ int cgx_lmac_get_pause_frm(void *cgxd, int lmac_id,
int cgx_lmac_set_pause_frm(void *cgxd, int lmac_id, int cgx_lmac_set_pause_frm(void *cgxd, int lmac_id,
u8 tx_pause, u8 rx_pause); u8 tx_pause, u8 rx_pause);
void cgx_lmac_ptp_config(void *cgxd, int lmac_id, bool enable); void cgx_lmac_ptp_config(void *cgxd, int lmac_id, bool enable);
u8 cgx_lmac_get_p2x(int cgx_id, int lmac_id);
#endif /* CGX_H */ #endif /* CGX_H */
...@@ -174,8 +174,12 @@ enum nix_scheduler { ...@@ -174,8 +174,12 @@ enum nix_scheduler {
#define NPC_MCAM_KEY_X2 1 #define NPC_MCAM_KEY_X2 1
#define NPC_MCAM_KEY_X4 2 #define NPC_MCAM_KEY_X4 2
#define NIX_INTF_RX 0 #define NIX_INTFX_RX(a) (0x0ull | (a) << 1)
#define NIX_INTF_TX 1 #define NIX_INTFX_TX(a) (0x1ull | (a) << 1)
/* Default interfaces are NIX0_RX and NIX0_TX */
#define NIX_INTF_RX NIX_INTFX_RX(0)
#define NIX_INTF_TX NIX_INTFX_TX(0)
#define NIX_INTF_TYPE_CGX 0 #define NIX_INTF_TYPE_CGX 0
#define NIX_INTF_TYPE_LBK 1 #define NIX_INTF_TYPE_LBK 1
...@@ -206,6 +210,8 @@ enum ndc_idx_e { ...@@ -206,6 +210,8 @@ enum ndc_idx_e {
NIX0_RX = 0x0, NIX0_RX = 0x0,
NIX0_TX = 0x1, NIX0_TX = 0x1,
NPA0_U = 0x2, NPA0_U = 0x2,
NIX1_RX = 0x4,
NIX1_TX = 0x5,
}; };
enum ndc_ctype_e { enum ndc_ctype_e {
......
...@@ -86,7 +86,7 @@ struct mbox_msghdr { ...@@ -86,7 +86,7 @@ struct mbox_msghdr {
#define OTX2_MBOX_REQ_SIG (0xdead) #define OTX2_MBOX_REQ_SIG (0xdead)
#define OTX2_MBOX_RSP_SIG (0xbeef) #define OTX2_MBOX_RSP_SIG (0xbeef)
u16 sig; /* Signature, for validating corrupted msgs */ u16 sig; /* Signature, for validating corrupted msgs */
#define OTX2_MBOX_VERSION (0x0001) #define OTX2_MBOX_VERSION (0x0007)
u16 ver; /* Version of msg's structure for this ID */ u16 ver; /* Version of msg's structure for this ID */
u16 next_msgoff; /* Offset of next msg within mailbox region */ u16 next_msgoff; /* Offset of next msg within mailbox region */
int rc; /* Msg process'ed response code */ int rc; /* Msg process'ed response code */
...@@ -271,6 +271,17 @@ struct ready_msg_rsp { ...@@ -271,6 +271,17 @@ struct ready_msg_rsp {
* or to detach partial of a cetain resource type. * or to detach partial of a cetain resource type.
* Rest of the fields specify how many of what type to * Rest of the fields specify how many of what type to
* be attached. * be attached.
* To request LFs from two blocks of same type this mailbox
* can be sent twice as below:
* struct rsrc_attach *attach;
* .. Allocate memory for message ..
* attach->cptlfs = 3; <3 LFs from CPT0>
* .. Send message ..
* .. Allocate memory for message ..
* attach->modify = 1;
* attach->cpt_blkaddr = BLKADDR_CPT1;
* attach->cptlfs = 2; <2 LFs from CPT1>
* .. Send message ..
*/ */
struct rsrc_attach { struct rsrc_attach {
struct mbox_msghdr hdr; struct mbox_msghdr hdr;
...@@ -281,6 +292,7 @@ struct rsrc_attach { ...@@ -281,6 +292,7 @@ struct rsrc_attach {
u16 ssow; u16 ssow;
u16 timlfs; u16 timlfs;
u16 cptlfs; u16 cptlfs;
int cpt_blkaddr; /* BLKADDR_CPT0/BLKADDR_CPT1 or 0 for BLKADDR_CPT0 */
}; };
/* Structure for relinquishing resources. /* Structure for relinquishing resources.
...@@ -314,6 +326,8 @@ struct msix_offset_rsp { ...@@ -314,6 +326,8 @@ struct msix_offset_rsp {
u16 ssow_msixoff[MAX_RVU_BLKLF_CNT]; u16 ssow_msixoff[MAX_RVU_BLKLF_CNT];
u16 timlf_msixoff[MAX_RVU_BLKLF_CNT]; u16 timlf_msixoff[MAX_RVU_BLKLF_CNT];
u16 cptlf_msixoff[MAX_RVU_BLKLF_CNT]; u16 cptlf_msixoff[MAX_RVU_BLKLF_CNT];
u8 cpt1_lfs;
u16 cpt1_lf_msixoff[MAX_RVU_BLKLF_CNT];
}; };
struct get_hw_cap_rsp { struct get_hw_cap_rsp {
...@@ -491,6 +505,9 @@ struct nix_lf_alloc_rsp { ...@@ -491,6 +505,9 @@ struct nix_lf_alloc_rsp {
u8 lf_tx_stats; /* NIX_AF_CONST1::LF_TX_STATS */ u8 lf_tx_stats; /* NIX_AF_CONST1::LF_TX_STATS */
u16 cints; /* NIX_AF_CONST2::CINTS */ u16 cints; /* NIX_AF_CONST2::CINTS */
u16 qints; /* NIX_AF_CONST2::QINTS */ u16 qints; /* NIX_AF_CONST2::QINTS */
u8 cgx_links; /* No. of CGX links present in HW */
u8 lbk_links; /* No. of LBK links present in HW */
u8 sdp_links; /* No. of SDP links present in HW */
}; };
/* NIX AQ enqueue msg */ /* NIX AQ enqueue msg */
......
...@@ -13380,7 +13380,7 @@ static const struct npc_lt_def_cfg npc_lt_defaults = { ...@@ -13380,7 +13380,7 @@ static const struct npc_lt_def_cfg npc_lt_defaults = {
}, },
}; };
static const struct npc_mcam_kex npc_mkex_default = { static struct npc_mcam_kex npc_mkex_default = {
.mkex_sign = MKEX_SIGN, .mkex_sign = MKEX_SIGN,
.name = "default", .name = "default",
.kpu_version = NPC_KPU_PROFILE_VER, .kpu_version = NPC_KPU_PROFILE_VER,
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#define PCI_MBOX_BAR_NUM 4 #define PCI_MBOX_BAR_NUM 4
#define NAME_SIZE 32 #define NAME_SIZE 32
#define MAX_NIX_BLKS 2
/* PF_FUNC */ /* PF_FUNC */
#define RVU_PFVF_PF_SHIFT 10 #define RVU_PFVF_PF_SHIFT 10
...@@ -137,6 +138,7 @@ struct rvu_pfvf { ...@@ -137,6 +138,7 @@ struct rvu_pfvf {
u16 ssow; u16 ssow;
u16 cptlfs; u16 cptlfs;
u16 timlfs; u16 timlfs;
u16 cpt1_lfs;
u8 cgx_lmac; u8 cgx_lmac;
/* Block LF's MSIX vector info */ /* Block LF's MSIX vector info */
...@@ -182,6 +184,10 @@ struct rvu_pfvf { ...@@ -182,6 +184,10 @@ struct rvu_pfvf {
bool cgx_in_use; /* this PF/VF using CGX? */ bool cgx_in_use; /* this PF/VF using CGX? */
int cgx_users; /* number of cgx users - used only by PFs */ int cgx_users; /* number of cgx users - used only by PFs */
u8 nix_blkaddr; /* BLKADDR_NIX0/1 assigned to this PF */
u8 nix_rx_intf; /* NIX0_RX/NIX1_RX interface to NPC */
u8 nix_tx_intf; /* NIX0_TX/NIX1_TX interface to NPC */
}; };
struct nix_txsch { struct nix_txsch {
...@@ -219,6 +225,8 @@ struct nix_lso { ...@@ -219,6 +225,8 @@ struct nix_lso {
}; };
struct nix_hw { struct nix_hw {
int blkaddr;
struct rvu *rvu;
struct nix_txsch txsch[NIX_TXSCH_LVL_CNT]; /* Tx schedulers */ struct nix_txsch txsch[NIX_TXSCH_LVL_CNT]; /* Tx schedulers */
struct nix_mcast mcast; struct nix_mcast mcast;
struct nix_flowkey flowkey; struct nix_flowkey flowkey;
...@@ -251,10 +259,16 @@ struct rvu_hwinfo { ...@@ -251,10 +259,16 @@ struct rvu_hwinfo {
u8 lbk_links; u8 lbk_links;
u8 sdp_links; u8 sdp_links;
u8 npc_kpus; /* No of parser units */ u8 npc_kpus; /* No of parser units */
u8 npc_pkinds; /* No of port kinds */
u8 npc_intfs; /* No of interfaces */
u8 npc_kpu_entries; /* No of KPU entries */
u16 npc_counters; /* No of match stats counters */
bool npc_ext_set; /* Extended register set */
struct hw_cap cap; struct hw_cap cap;
struct rvu_block block[BLK_COUNT]; /* Block info */ struct rvu_block block[BLK_COUNT]; /* Block info */
struct nix_hw *nix0; struct nix_hw *nix;
struct rvu *rvu;
struct npc_pkind pkind; struct npc_pkind pkind;
struct npc_mcam mcam; struct npc_mcam mcam;
}; };
...@@ -300,7 +314,7 @@ struct npc_kpu_profile_adapter { ...@@ -300,7 +314,7 @@ struct npc_kpu_profile_adapter {
const struct npc_lt_def_cfg *lt_def; const struct npc_lt_def_cfg *lt_def;
const struct npc_kpu_profile_action *ikpu; /* array[pkinds] */ const struct npc_kpu_profile_action *ikpu; /* array[pkinds] */
const struct npc_kpu_profile *kpu; /* array[kpus] */ const struct npc_kpu_profile *kpu; /* array[kpus] */
const struct npc_mcam_kex *mkex; struct npc_mcam_kex *mkex;
size_t pkinds; size_t pkinds;
size_t kpus; size_t kpus;
}; };
...@@ -315,6 +329,7 @@ struct rvu { ...@@ -315,6 +329,7 @@ struct rvu {
struct rvu_pfvf *hwvf; struct rvu_pfvf *hwvf;
struct mutex rsrc_lock; /* Serialize resource alloc/free */ struct mutex rsrc_lock; /* Serialize resource alloc/free */
int vfs; /* Number of VFs attached to RVU */ int vfs; /* Number of VFs attached to RVU */
int nix_blkaddr[MAX_NIX_BLKS];
/* Mbox */ /* Mbox */
struct mbox_wq_info afpf_wq_info; struct mbox_wq_info afpf_wq_info;
...@@ -420,6 +435,7 @@ void rvu_free_rsrc(struct rsrc_bmap *rsrc, int id); ...@@ -420,6 +435,7 @@ void rvu_free_rsrc(struct rsrc_bmap *rsrc, int id);
int rvu_rsrc_free_count(struct rsrc_bmap *rsrc); int rvu_rsrc_free_count(struct rsrc_bmap *rsrc);
int rvu_alloc_rsrc_contig(struct rsrc_bmap *rsrc, int nrsrc); int rvu_alloc_rsrc_contig(struct rsrc_bmap *rsrc, int nrsrc);
bool rvu_rsrc_check_contig(struct rsrc_bmap *rsrc, int nrsrc); bool rvu_rsrc_check_contig(struct rsrc_bmap *rsrc, int nrsrc);
u16 rvu_get_rsrc_mapcount(struct rvu_pfvf *pfvf, int blkaddr);
int rvu_get_pf(u16 pcifunc); int rvu_get_pf(u16 pcifunc);
struct rvu_pfvf *rvu_get_pfvf(struct rvu *rvu, int pcifunc); struct rvu_pfvf *rvu_get_pfvf(struct rvu *rvu, int pcifunc);
void rvu_get_pf_numvfs(struct rvu *rvu, int pf, int *numvfs, int *hwvf); void rvu_get_pf_numvfs(struct rvu *rvu, int pf, int *numvfs, int *hwvf);
...@@ -485,6 +501,8 @@ int rvu_get_nixlf_count(struct rvu *rvu); ...@@ -485,6 +501,8 @@ int rvu_get_nixlf_count(struct rvu *rvu);
void rvu_nix_lf_teardown(struct rvu *rvu, u16 pcifunc, int blkaddr, int npalf); void rvu_nix_lf_teardown(struct rvu *rvu, u16 pcifunc, int blkaddr, int npalf);
int nix_get_nixlf(struct rvu *rvu, u16 pcifunc, int *nixlf, int *nix_blkaddr); int nix_get_nixlf(struct rvu *rvu, u16 pcifunc, int *nixlf, int *nix_blkaddr);
int nix_update_bcast_mce_list(struct rvu *rvu, u16 pcifunc, bool add); int nix_update_bcast_mce_list(struct rvu *rvu, u16 pcifunc, bool add);
struct nix_hw *get_nix_hw(struct rvu_hwinfo *hw, int blkaddr);
int rvu_get_next_nix_blkaddr(struct rvu *rvu, int blkaddr);
/* NPC APIs */ /* NPC APIs */
int rvu_npc_init(struct rvu *rvu); int rvu_npc_init(struct rvu *rvu);
...@@ -513,6 +531,10 @@ void rvu_npc_get_mcam_entry_alloc_info(struct rvu *rvu, u16 pcifunc, ...@@ -513,6 +531,10 @@ void rvu_npc_get_mcam_entry_alloc_info(struct rvu *rvu, u16 pcifunc,
void rvu_npc_get_mcam_counter_alloc_info(struct rvu *rvu, u16 pcifunc, void rvu_npc_get_mcam_counter_alloc_info(struct rvu *rvu, u16 pcifunc,
int blkaddr, int *alloc_cnt, int blkaddr, int *alloc_cnt,
int *enable_cnt); int *enable_cnt);
bool is_npc_intf_tx(u8 intf);
bool is_npc_intf_rx(u8 intf);
bool is_npc_interface_valid(struct rvu *rvu, u8 intf);
int rvu_npc_get_tx_nibble_cfg(struct rvu *rvu, u64 nibble_ena);
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
void rvu_dbg_init(struct rvu *rvu); void rvu_dbg_init(struct rvu *rvu);
......
...@@ -74,6 +74,20 @@ void *rvu_cgx_pdata(u8 cgx_id, struct rvu *rvu) ...@@ -74,6 +74,20 @@ void *rvu_cgx_pdata(u8 cgx_id, struct rvu *rvu)
return rvu->cgx_idmap[cgx_id]; return rvu->cgx_idmap[cgx_id];
} }
/* Based on P2X connectivity find mapped NIX block for a PF */
static void rvu_map_cgx_nix_block(struct rvu *rvu, int pf,
int cgx_id, int lmac_id)
{
struct rvu_pfvf *pfvf = &rvu->pf[pf];
u8 p2x;
p2x = cgx_lmac_get_p2x(cgx_id, lmac_id);
/* Firmware sets P2X_SELECT as either NIX0 or NIX1 */
pfvf->nix_blkaddr = BLKADDR_NIX0;
if (p2x == CMR_P2X_SEL_NIX1)
pfvf->nix_blkaddr = BLKADDR_NIX1;
}
static int rvu_map_cgx_lmac_pf(struct rvu *rvu) static int rvu_map_cgx_lmac_pf(struct rvu *rvu)
{ {
struct npc_pkind *pkind = &rvu->hw->pkind; struct npc_pkind *pkind = &rvu->hw->pkind;
...@@ -117,6 +131,7 @@ static int rvu_map_cgx_lmac_pf(struct rvu *rvu) ...@@ -117,6 +131,7 @@ static int rvu_map_cgx_lmac_pf(struct rvu *rvu)
rvu->cgxlmac2pf_map[CGX_OFFSET(cgx) + lmac] = 1 << pf; rvu->cgxlmac2pf_map[CGX_OFFSET(cgx) + lmac] = 1 << pf;
free_pkind = rvu_alloc_rsrc(&pkind->rsrc); free_pkind = rvu_alloc_rsrc(&pkind->rsrc);
pkind->pfchan_map[free_pkind] = ((pf) & 0x3F) << 16; pkind->pfchan_map[free_pkind] = ((pf) & 0x3F) << 16;
rvu_map_cgx_nix_block(rvu, pf, cgx, lmac);
rvu->cgx_mapped_pfs++; rvu->cgx_mapped_pfs++;
} }
} }
......
...@@ -35,7 +35,7 @@ static struct hw_reg_map txsch_reg_map[NIX_TXSCH_LVL_CNT] = { ...@@ -35,7 +35,7 @@ static struct hw_reg_map txsch_reg_map[NIX_TXSCH_LVL_CNT] = {
{0x1200, 0x12E0} } }, {0x1200, 0x12E0} } },
{NIX_TXSCH_LVL_TL3, 3, 0xFFFF, {{0x1000, 0x10E0}, {0x1600, 0x1608}, {NIX_TXSCH_LVL_TL3, 3, 0xFFFF, {{0x1000, 0x10E0}, {0x1600, 0x1608},
{0x1610, 0x1618} } }, {0x1610, 0x1618} } },
{NIX_TXSCH_LVL_TL2, 2, 0xFFFF, {{0x0E00, 0x0EE0}, {0x1700, 0x1768} } }, {NIX_TXSCH_LVL_TL2, 2, 0xFFFF, {{0x0E00, 0x0EE0}, {0x1700, 0x17B0} } },
{NIX_TXSCH_LVL_TL1, 1, 0xFFFF, {{0x0C00, 0x0D98} } }, {NIX_TXSCH_LVL_TL1, 1, 0xFFFF, {{0x0C00, 0x0D98} } },
}; };
......
...@@ -54,20 +54,20 @@ ...@@ -54,20 +54,20 @@
#define RVU_PRIV_PFX_MSIX_CFG(a) (0x8000110 | (a) << 16) #define RVU_PRIV_PFX_MSIX_CFG(a) (0x8000110 | (a) << 16)
#define RVU_PRIV_PFX_ID_CFG(a) (0x8000120 | (a) << 16) #define RVU_PRIV_PFX_ID_CFG(a) (0x8000120 | (a) << 16)
#define RVU_PRIV_PFX_INT_CFG(a) (0x8000200 | (a) << 16) #define RVU_PRIV_PFX_INT_CFG(a) (0x8000200 | (a) << 16)
#define RVU_PRIV_PFX_NIX0_CFG (0x8000300) #define RVU_PRIV_PFX_NIXX_CFG(a) (0x8000300 | (a) << 3)
#define RVU_PRIV_PFX_NPA_CFG (0x8000310) #define RVU_PRIV_PFX_NPA_CFG (0x8000310)
#define RVU_PRIV_PFX_SSO_CFG (0x8000320) #define RVU_PRIV_PFX_SSO_CFG (0x8000320)
#define RVU_PRIV_PFX_SSOW_CFG (0x8000330) #define RVU_PRIV_PFX_SSOW_CFG (0x8000330)
#define RVU_PRIV_PFX_TIM_CFG (0x8000340) #define RVU_PRIV_PFX_TIM_CFG (0x8000340)
#define RVU_PRIV_PFX_CPT0_CFG (0x8000350) #define RVU_PRIV_PFX_CPTX_CFG(a) (0x8000350 | (a) << 3)
#define RVU_PRIV_BLOCK_TYPEX_REV(a) (0x8000400 | (a) << 3) #define RVU_PRIV_BLOCK_TYPEX_REV(a) (0x8000400 | (a) << 3)
#define RVU_PRIV_HWVFX_INT_CFG(a) (0x8001280 | (a) << 16) #define RVU_PRIV_HWVFX_INT_CFG(a) (0x8001280 | (a) << 16)
#define RVU_PRIV_HWVFX_NIX0_CFG (0x8001300) #define RVU_PRIV_HWVFX_NIXX_CFG(a) (0x8001300 | (a) << 3)
#define RVU_PRIV_HWVFX_NPA_CFG (0x8001310) #define RVU_PRIV_HWVFX_NPA_CFG (0x8001310)
#define RVU_PRIV_HWVFX_SSO_CFG (0x8001320) #define RVU_PRIV_HWVFX_SSO_CFG (0x8001320)
#define RVU_PRIV_HWVFX_SSOW_CFG (0x8001330) #define RVU_PRIV_HWVFX_SSOW_CFG (0x8001330)
#define RVU_PRIV_HWVFX_TIM_CFG (0x8001340) #define RVU_PRIV_HWVFX_TIM_CFG (0x8001340)
#define RVU_PRIV_HWVFX_CPT0_CFG (0x8001350) #define RVU_PRIV_HWVFX_CPTX_CFG(a) (0x8001350 | (a) << 3)
/* RVU PF registers */ /* RVU PF registers */
#define RVU_PF_VFX_PFVF_MBOX0 (0x00000) #define RVU_PF_VFX_PFVF_MBOX0 (0x00000)
...@@ -446,6 +446,8 @@ ...@@ -446,6 +446,8 @@
#define NPC_AF_BLK_RST (0x00040) #define NPC_AF_BLK_RST (0x00040)
#define NPC_AF_MCAM_SCRUB_CTL (0x000a0) #define NPC_AF_MCAM_SCRUB_CTL (0x000a0)
#define NPC_AF_KCAM_SCRUB_CTL (0x000b0) #define NPC_AF_KCAM_SCRUB_CTL (0x000b0)
#define NPC_AF_CONST2 (0x00100)
#define NPC_AF_CONST3 (0x00110)
#define NPC_AF_KPUX_CFG(a) (0x00500 | (a) << 3) #define NPC_AF_KPUX_CFG(a) (0x00500 | (a) << 3)
#define NPC_AF_PCK_CFG (0x00600) #define NPC_AF_PCK_CFG (0x00600)
#define NPC_AF_PCK_DEF_OL2 (0x00610) #define NPC_AF_PCK_DEF_OL2 (0x00610)
...@@ -469,20 +471,7 @@ ...@@ -469,20 +471,7 @@
(0x900000 | (a) << 16 | (b) << 12 | (c) << 5 | (d) << 3) (0x900000 | (a) << 16 | (b) << 12 | (c) << 5 | (d) << 3)
#define NPC_AF_INTFX_LDATAX_FLAGSX_CFG(a, b, c) \ #define NPC_AF_INTFX_LDATAX_FLAGSX_CFG(a, b, c) \
(0x980000 | (a) << 16 | (b) << 12 | (c) << 3) (0x980000 | (a) << 16 | (b) << 12 | (c) << 3)
#define NPC_AF_MCAMEX_BANKX_CAMX_INTF(a, b, c) \
(0x1000000ull | (a) << 10 | (b) << 6 | (c) << 3)
#define NPC_AF_MCAMEX_BANKX_CAMX_W0(a, b, c) \
(0x1000010ull | (a) << 10 | (b) << 6 | (c) << 3)
#define NPC_AF_MCAMEX_BANKX_CAMX_W1(a, b, c) \
(0x1000020ull | (a) << 10 | (b) << 6 | (c) << 3)
#define NPC_AF_MCAMEX_BANKX_CFG(a, b) (0x1800000ull | (a) << 8 | (b) << 4)
#define NPC_AF_MCAMEX_BANKX_STAT_ACT(a, b) \
(0x1880000 | (a) << 8 | (b) << 4)
#define NPC_AF_MATCH_STATX(a) (0x1880008 | (a) << 8)
#define NPC_AF_INTFX_MISS_STAT_ACT(a) (0x1880040 + (a) * 0x8) #define NPC_AF_INTFX_MISS_STAT_ACT(a) (0x1880040 + (a) * 0x8)
#define NPC_AF_MCAMEX_BANKX_ACTION(a, b) (0x1900000ull | (a) << 8 | (b) << 4)
#define NPC_AF_MCAMEX_BANKX_TAG_ACT(a, b) \
(0x1900008 | (a) << 8 | (b) << 4)
#define NPC_AF_INTFX_MISS_ACT(a) (0x1a00000 | (a) << 4) #define NPC_AF_INTFX_MISS_ACT(a) (0x1a00000 | (a) << 4)
#define NPC_AF_INTFX_MISS_TAG_ACT(a) (0x1b00008 | (a) << 4) #define NPC_AF_INTFX_MISS_TAG_ACT(a) (0x1b00008 | (a) << 4)
#define NPC_AF_MCAM_BANKX_HITX(a, b) (0x1c80000 | (a) << 8 | (b) << 4) #define NPC_AF_MCAM_BANKX_HITX(a, b) (0x1c80000 | (a) << 8 | (b) << 4)
...@@ -499,6 +488,70 @@ ...@@ -499,6 +488,70 @@
#define NPC_AF_DBG_DATAX(a) (0x3001400 | (a) << 4) #define NPC_AF_DBG_DATAX(a) (0x3001400 | (a) << 4)
#define NPC_AF_DBG_RESULTX(a) (0x3001800 | (a) << 4) #define NPC_AF_DBG_RESULTX(a) (0x3001800 | (a) << 4)
#define NPC_AF_MCAMEX_BANKX_CAMX_INTF(a, b, c) ({ \
u64 offset; \
\
offset = (0x1000000ull | (a) << 10 | (b) << 6 | (c) << 3); \
if (rvu->hw->npc_ext_set) \
offset = (0x8000000ull | (a) << 8 | (b) << 22 | (c) << 3); \
offset; })
#define NPC_AF_MCAMEX_BANKX_CAMX_W0(a, b, c) ({ \
u64 offset; \
\
offset = (0x1000010ull | (a) << 10 | (b) << 6 | (c) << 3); \
if (rvu->hw->npc_ext_set) \
offset = (0x8000010ull | (a) << 8 | (b) << 22 | (c) << 3); \
offset; })
#define NPC_AF_MCAMEX_BANKX_CAMX_W1(a, b, c) ({ \
u64 offset; \
\
offset = (0x1000020ull | (a) << 10 | (b) << 6 | (c) << 3); \
if (rvu->hw->npc_ext_set) \
offset = (0x8000020ull | (a) << 8 | (b) << 22 | (c) << 3); \
offset; })
#define NPC_AF_MCAMEX_BANKX_CFG(a, b) ({ \
u64 offset; \
\
offset = (0x1800000ull | (a) << 8 | (b) << 4); \
if (rvu->hw->npc_ext_set) \
offset = (0x8000038ull | (a) << 8 | (b) << 22); \
offset; })
#define NPC_AF_MCAMEX_BANKX_ACTION(a, b) ({ \
u64 offset; \
\
offset = (0x1900000ull | (a) << 8 | (b) << 4); \
if (rvu->hw->npc_ext_set) \
offset = (0x8000040ull | (a) << 8 | (b) << 22); \
offset; }) \
#define NPC_AF_MCAMEX_BANKX_TAG_ACT(a, b) ({ \
u64 offset; \
\
offset = (0x1900008ull | (a) << 8 | (b) << 4); \
if (rvu->hw->npc_ext_set) \
offset = (0x8000048ull | (a) << 8 | (b) << 22); \
offset; }) \
#define NPC_AF_MCAMEX_BANKX_STAT_ACT(a, b) ({ \
u64 offset; \
\
offset = (0x1880000ull | (a) << 8 | (b) << 4); \
if (rvu->hw->npc_ext_set) \
offset = (0x8000050ull | (a) << 8 | (b) << 22); \
offset; }) \
#define NPC_AF_MATCH_STATX(a) ({ \
u64 offset; \
\
offset = (0x1880008ull | (a) << 8); \
if (rvu->hw->npc_ext_set) \
offset = (0x8000078ull | (a) << 8); \
offset; }) \
/* NDC */ /* NDC */
#define NDC_AF_CONST (0x00000) #define NDC_AF_CONST (0x00000)
#define NDC_AF_CLK_EN (0x00020) #define NDC_AF_CLK_EN (0x00020)
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
/* RVU Block revision IDs */ /* RVU Block revision IDs */
#define RVU_BLK_RVUM_REVID 0x01 #define RVU_BLK_RVUM_REVID 0x01
#define RVU_MULTI_BLK_VER 0x7ULL
/* RVU Block Address Enumeration */ /* RVU Block Address Enumeration */
enum rvu_block_addr_e { enum rvu_block_addr_e {
BLKADDR_RVUM = 0x0ULL, BLKADDR_RVUM = 0x0ULL,
...@@ -31,7 +33,9 @@ enum rvu_block_addr_e { ...@@ -31,7 +33,9 @@ enum rvu_block_addr_e {
BLKADDR_NDC_NIX0_RX = 0xcULL, BLKADDR_NDC_NIX0_RX = 0xcULL,
BLKADDR_NDC_NIX0_TX = 0xdULL, BLKADDR_NDC_NIX0_TX = 0xdULL,
BLKADDR_NDC_NPA0 = 0xeULL, BLKADDR_NDC_NPA0 = 0xeULL,
BLK_COUNT = 0xfULL, BLKADDR_NDC_NIX1_RX = 0x10ULL,
BLKADDR_NDC_NIX1_TX = 0x11ULL,
BLK_COUNT = 0x12ULL,
}; };
/* RVU Block Type Enumeration */ /* RVU Block Type Enumeration */
......
...@@ -531,8 +531,10 @@ static int otx2_get_link(struct otx2_nic *pfvf) ...@@ -531,8 +531,10 @@ static int otx2_get_link(struct otx2_nic *pfvf)
link = 4 * ((map >> 8) & 0xF) + ((map >> 4) & 0xF); link = 4 * ((map >> 8) & 0xF) + ((map >> 4) & 0xF);
} }
/* LBK channel */ /* LBK channel */
if (pfvf->hw.tx_chan_base < SDP_CHAN_BASE) if (pfvf->hw.tx_chan_base < SDP_CHAN_BASE) {
link = 12; map = pfvf->hw.tx_chan_base & 0x7FF;
link = pfvf->hw.cgx_links | ((map >> 8) & 0xF);
}
return link; return link;
} }
...@@ -1503,6 +1505,8 @@ void mbox_handler_nix_lf_alloc(struct otx2_nic *pfvf, ...@@ -1503,6 +1505,8 @@ void mbox_handler_nix_lf_alloc(struct otx2_nic *pfvf,
pfvf->hw.tx_chan_base = rsp->tx_chan_base; pfvf->hw.tx_chan_base = rsp->tx_chan_base;
pfvf->hw.lso_tsov4_idx = rsp->lso_tsov4_idx; pfvf->hw.lso_tsov4_idx = rsp->lso_tsov4_idx;
pfvf->hw.lso_tsov6_idx = rsp->lso_tsov6_idx; pfvf->hw.lso_tsov6_idx = rsp->lso_tsov6_idx;
pfvf->hw.cgx_links = rsp->cgx_links;
pfvf->hw.lbk_links = rsp->lbk_links;
} }
EXPORT_SYMBOL(mbox_handler_nix_lf_alloc); EXPORT_SYMBOL(mbox_handler_nix_lf_alloc);
......
...@@ -197,6 +197,8 @@ struct otx2_hw { ...@@ -197,6 +197,8 @@ struct otx2_hw {
struct otx2_drv_stats drv_stats; struct otx2_drv_stats drv_stats;
u64 cgx_rx_stats[CGX_RX_STATS_COUNT]; u64 cgx_rx_stats[CGX_RX_STATS_COUNT];
u64 cgx_tx_stats[CGX_TX_STATS_COUNT]; u64 cgx_tx_stats[CGX_TX_STATS_COUNT];
u8 cgx_links; /* No. of CGX links present in HW */
u8 lbk_links; /* No. of LBK links present in HW */
}; };
struct otx2_vf_config { struct otx2_vf_config {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment