diff options
author | Sunil Goutham <sgoutham@marvell.com> | 2018-10-22 13:55:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-22 23:15:37 -0400 |
commit | 23923ea4b144ed43ad8f6e5110b06221d0ff1656 (patch) | |
tree | 14afca2f0e15c67f5f7c0ef69047561eae98d7c3 | |
parent | 21e6699e5cd60f634002ecc6b60a690ab9c21947 (diff) |
octeontx2-af: Config NPC KPU engines with parser profile
This patch configures all 16 KPUs and iKPU (pkinds) with
the KPU parser profile defined in npc_profile.h. Each KPU
engine has a 128 entry CAM, only CAM entries which are listed
in the profile are enabled and rest are left disabled.
Also
- Memory is allocated for pkind's bitmap and PFFUNC, interface
channel mapping.
- Added all CSR offsets of NPC HW block.
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/af/Makefile | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/af/npc.h | 100 | ||||
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 12 | ||||
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 203 | ||||
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h | 61 |
6 files changed, 385 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/Makefile b/drivers/net/ethernet/marvell/octeontx2/af/Makefile index 264cbd7bc1ea..06329acf9c2c 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/Makefile +++ b/drivers/net/ethernet/marvell/octeontx2/af/Makefile | |||
@@ -8,4 +8,4 @@ obj-$(CONFIG_OCTEONTX2_AF) += octeontx2_af.o | |||
8 | 8 | ||
9 | octeontx2_mbox-y := mbox.o | 9 | octeontx2_mbox-y := mbox.o |
10 | octeontx2_af-y := cgx.o rvu.o rvu_cgx.o rvu_npa.o rvu_nix.o \ | 10 | octeontx2_af-y := cgx.o rvu.o rvu_cgx.o rvu_npa.o rvu_nix.o \ |
11 | rvu_reg.o | 11 | rvu_reg.o rvu_npc.o |
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/npc.h b/drivers/net/ethernet/marvell/octeontx2/af/npc.h index 3e7ec10cf4ff..58d8f0b30646 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/npc.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/npc.h | |||
@@ -140,4 +140,104 @@ struct npc_kpu_profile { | |||
140 | struct npc_kpu_profile_action *action; | 140 | struct npc_kpu_profile_action *action; |
141 | }; | 141 | }; |
142 | 142 | ||
143 | /* NPC KPU register formats */ | ||
144 | struct npc_kpu_cam { | ||
145 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
146 | u64 rsvd_63_56 : 8; | ||
147 | u64 state : 8; | ||
148 | u64 dp2_data : 16; | ||
149 | u64 dp1_data : 16; | ||
150 | u64 dp0_data : 16; | ||
151 | #else | ||
152 | u64 dp0_data : 16; | ||
153 | u64 dp1_data : 16; | ||
154 | u64 dp2_data : 16; | ||
155 | u64 state : 8; | ||
156 | u64 rsvd_63_56 : 8; | ||
157 | #endif | ||
158 | }; | ||
159 | |||
160 | struct npc_kpu_action0 { | ||
161 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
162 | u64 rsvd_63_57 : 7; | ||
163 | u64 byp_count : 3; | ||
164 | u64 capture_ena : 1; | ||
165 | u64 parse_done : 1; | ||
166 | u64 next_state : 8; | ||
167 | u64 rsvd_43 : 1; | ||
168 | u64 capture_lid : 3; | ||
169 | u64 capture_ltype : 4; | ||
170 | u64 capture_flags : 8; | ||
171 | u64 ptr_advance : 8; | ||
172 | u64 var_len_offset : 8; | ||
173 | u64 var_len_mask : 8; | ||
174 | u64 var_len_right : 1; | ||
175 | u64 var_len_shift : 3; | ||
176 | #else | ||
177 | u64 var_len_shift : 3; | ||
178 | u64 var_len_right : 1; | ||
179 | u64 var_len_mask : 8; | ||
180 | u64 var_len_offset : 8; | ||
181 | u64 ptr_advance : 8; | ||
182 | u64 capture_flags : 8; | ||
183 | u64 capture_ltype : 4; | ||
184 | u64 capture_lid : 3; | ||
185 | u64 rsvd_43 : 1; | ||
186 | u64 next_state : 8; | ||
187 | u64 parse_done : 1; | ||
188 | u64 capture_ena : 1; | ||
189 | u64 byp_count : 3; | ||
190 | u64 rsvd_63_57 : 7; | ||
191 | #endif | ||
192 | }; | ||
193 | |||
194 | struct npc_kpu_action1 { | ||
195 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
196 | u64 rsvd_63_36 : 28; | ||
197 | u64 errlev : 4; | ||
198 | u64 errcode : 8; | ||
199 | u64 dp2_offset : 8; | ||
200 | u64 dp1_offset : 8; | ||
201 | u64 dp0_offset : 8; | ||
202 | #else | ||
203 | u64 dp0_offset : 8; | ||
204 | u64 dp1_offset : 8; | ||
205 | u64 dp2_offset : 8; | ||
206 | u64 errcode : 8; | ||
207 | u64 errlev : 4; | ||
208 | u64 rsvd_63_36 : 28; | ||
209 | #endif | ||
210 | }; | ||
211 | |||
212 | struct npc_kpu_pkind_cpi_def { | ||
213 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
214 | u64 ena : 1; | ||
215 | u64 rsvd_62_59 : 4; | ||
216 | u64 lid : 3; | ||
217 | u64 ltype_match : 4; | ||
218 | u64 ltype_mask : 4; | ||
219 | u64 flags_match : 8; | ||
220 | u64 flags_mask : 8; | ||
221 | u64 add_offset : 8; | ||
222 | u64 add_mask : 8; | ||
223 | u64 rsvd_15 : 1; | ||
224 | u64 add_shift : 3; | ||
225 | u64 rsvd_11_10 : 2; | ||
226 | u64 cpi_base : 10; | ||
227 | #else | ||
228 | u64 cpi_base : 10; | ||
229 | u64 rsvd_11_10 : 2; | ||
230 | u64 add_shift : 3; | ||
231 | u64 rsvd_15 : 1; | ||
232 | u64 add_mask : 8; | ||
233 | u64 add_offset : 8; | ||
234 | u64 flags_mask : 8; | ||
235 | u64 flags_match : 8; | ||
236 | u64 ltype_mask : 4; | ||
237 | u64 ltype_match : 4; | ||
238 | u64 lid : 3; | ||
239 | u64 rsvd_62_59 : 4; | ||
240 | u64 ena : 1; | ||
241 | #endif | ||
242 | }; | ||
143 | #endif /* NPC_H */ | 243 | #endif /* NPC_H */ |
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c index 3bf007aa4725..dc28fa2b9481 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c | |||
@@ -180,6 +180,9 @@ int rvu_get_blkaddr(struct rvu *rvu, int blktype, u16 pcifunc) | |||
180 | bool is_pf; | 180 | bool is_pf; |
181 | 181 | ||
182 | switch (blktype) { | 182 | switch (blktype) { |
183 | case BLKTYPE_NPC: | ||
184 | blkaddr = BLKADDR_NPC; | ||
185 | goto exit; | ||
183 | case BLKTYPE_NPA: | 186 | case BLKTYPE_NPA: |
184 | blkaddr = BLKADDR_NPA; | 187 | blkaddr = BLKADDR_NPA; |
185 | goto exit; | 188 | goto exit; |
@@ -566,6 +569,7 @@ static void rvu_free_hw_resources(struct rvu *rvu) | |||
566 | u64 cfg; | 569 | u64 cfg; |
567 | 570 | ||
568 | rvu_npa_freemem(rvu); | 571 | rvu_npa_freemem(rvu); |
572 | rvu_npc_freemem(rvu); | ||
569 | rvu_nix_freemem(rvu); | 573 | rvu_nix_freemem(rvu); |
570 | 574 | ||
571 | /* Free block LF bitmaps */ | 575 | /* Free block LF bitmaps */ |
@@ -771,6 +775,10 @@ init: | |||
771 | rvu_scan_block(rvu, block); | 775 | rvu_scan_block(rvu, block); |
772 | } | 776 | } |
773 | 777 | ||
778 | err = rvu_npc_init(rvu); | ||
779 | if (err) | ||
780 | return err; | ||
781 | |||
774 | err = rvu_npa_init(rvu); | 782 | err = rvu_npa_init(rvu); |
775 | if (err) | 783 | if (err) |
776 | return err; | 784 | return err; |
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h index f041d0a26ad5..e8e16a71fbed 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h | |||
@@ -100,6 +100,11 @@ struct nix_txsch { | |||
100 | u16 *pfvf_map; | 100 | u16 *pfvf_map; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | struct npc_pkind { | ||
104 | struct rsrc_bmap rsrc; | ||
105 | u32 *pfchan_map; | ||
106 | }; | ||
107 | |||
103 | struct nix_hw { | 108 | struct nix_hw { |
104 | struct nix_txsch txsch[NIX_TXSCH_LVL_CNT]; /* Tx schedulers */ | 109 | struct nix_txsch txsch[NIX_TXSCH_LVL_CNT]; /* Tx schedulers */ |
105 | }; | 110 | }; |
@@ -113,9 +118,12 @@ struct rvu_hwinfo { | |||
113 | u8 cgx_links; | 118 | u8 cgx_links; |
114 | u8 lbk_links; | 119 | u8 lbk_links; |
115 | u8 sdp_links; | 120 | u8 sdp_links; |
121 | u8 npc_kpus; /* No of parser units */ | ||
122 | |||
116 | 123 | ||
117 | struct rvu_block block[BLK_COUNT]; /* Block info */ | 124 | struct rvu_block block[BLK_COUNT]; /* Block info */ |
118 | struct nix_hw *nix0; | 125 | struct nix_hw *nix0; |
126 | struct npc_pkind pkind; | ||
119 | }; | 127 | }; |
120 | 128 | ||
121 | struct rvu { | 129 | struct rvu { |
@@ -290,4 +298,8 @@ int rvu_mbox_handler_NIX_TXSCHQ_CFG(struct rvu *rvu, | |||
290 | struct msg_rsp *rsp); | 298 | struct msg_rsp *rsp); |
291 | int rvu_mbox_handler_NIX_STATS_RST(struct rvu *rvu, struct msg_req *req, | 299 | int rvu_mbox_handler_NIX_STATS_RST(struct rvu *rvu, struct msg_req *req, |
292 | struct msg_rsp *rsp); | 300 | struct msg_rsp *rsp); |
301 | |||
302 | /* NPC APIs */ | ||
303 | int rvu_npc_init(struct rvu *rvu); | ||
304 | void rvu_npc_freemem(struct rvu *rvu); | ||
293 | #endif /* RVU_H */ | 305 | #endif /* RVU_H */ |
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c new file mode 100644 index 000000000000..01baf3e0b3e1 --- /dev/null +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | |||
@@ -0,0 +1,203 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | /* Marvell OcteonTx2 RVU Admin Function driver | ||
3 | * | ||
4 | * Copyright (C) 2018 Marvell International Ltd. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/module.h> | ||
12 | #include <linux/pci.h> | ||
13 | |||
14 | #include "rvu_struct.h" | ||
15 | #include "rvu_reg.h" | ||
16 | #include "rvu.h" | ||
17 | #include "npc.h" | ||
18 | #include "npc_profile.h" | ||
19 | |||
20 | static void npc_config_kpuaction(struct rvu *rvu, int blkaddr, | ||
21 | struct npc_kpu_profile_action *kpuaction, | ||
22 | int kpu, int entry, bool pkind) | ||
23 | { | ||
24 | struct npc_kpu_action0 action0 = {0}; | ||
25 | struct npc_kpu_action1 action1 = {0}; | ||
26 | u64 reg; | ||
27 | |||
28 | action1.errlev = kpuaction->errlev; | ||
29 | action1.errcode = kpuaction->errcode; | ||
30 | action1.dp0_offset = kpuaction->dp0_offset; | ||
31 | action1.dp1_offset = kpuaction->dp1_offset; | ||
32 | action1.dp2_offset = kpuaction->dp2_offset; | ||
33 | |||
34 | if (pkind) | ||
35 | reg = NPC_AF_PKINDX_ACTION1(entry); | ||
36 | else | ||
37 | reg = NPC_AF_KPUX_ENTRYX_ACTION1(kpu, entry); | ||
38 | |||
39 | rvu_write64(rvu, blkaddr, reg, *(u64 *)&action1); | ||
40 | |||
41 | action0.byp_count = kpuaction->bypass_count; | ||
42 | action0.capture_ena = kpuaction->cap_ena; | ||
43 | action0.parse_done = kpuaction->parse_done; | ||
44 | action0.next_state = kpuaction->next_state; | ||
45 | action0.capture_lid = kpuaction->lid; | ||
46 | action0.capture_ltype = kpuaction->ltype; | ||
47 | action0.capture_flags = kpuaction->flags; | ||
48 | action0.ptr_advance = kpuaction->ptr_advance; | ||
49 | action0.var_len_offset = kpuaction->offset; | ||
50 | action0.var_len_mask = kpuaction->mask; | ||
51 | action0.var_len_right = kpuaction->right; | ||
52 | action0.var_len_shift = kpuaction->shift; | ||
53 | |||
54 | if (pkind) | ||
55 | reg = NPC_AF_PKINDX_ACTION0(entry); | ||
56 | else | ||
57 | reg = NPC_AF_KPUX_ENTRYX_ACTION0(kpu, entry); | ||
58 | |||
59 | rvu_write64(rvu, blkaddr, reg, *(u64 *)&action0); | ||
60 | } | ||
61 | |||
62 | static void npc_config_kpucam(struct rvu *rvu, int blkaddr, | ||
63 | struct npc_kpu_profile_cam *kpucam, | ||
64 | int kpu, int entry) | ||
65 | { | ||
66 | struct npc_kpu_cam cam0 = {0}; | ||
67 | struct npc_kpu_cam cam1 = {0}; | ||
68 | |||
69 | cam1.state = kpucam->state & kpucam->state_mask; | ||
70 | cam1.dp0_data = kpucam->dp0 & kpucam->dp0_mask; | ||
71 | cam1.dp1_data = kpucam->dp1 & kpucam->dp1_mask; | ||
72 | cam1.dp2_data = kpucam->dp2 & kpucam->dp2_mask; | ||
73 | |||
74 | cam0.state = ~kpucam->state & kpucam->state_mask; | ||
75 | cam0.dp0_data = ~kpucam->dp0 & kpucam->dp0_mask; | ||
76 | cam0.dp1_data = ~kpucam->dp1 & kpucam->dp1_mask; | ||
77 | cam0.dp2_data = ~kpucam->dp2 & kpucam->dp2_mask; | ||
78 | |||
79 | rvu_write64(rvu, blkaddr, | ||
80 | NPC_AF_KPUX_ENTRYX_CAMX(kpu, entry, 0), *(u64 *)&cam0); | ||
81 | rvu_write64(rvu, blkaddr, | ||
82 | NPC_AF_KPUX_ENTRYX_CAMX(kpu, entry, 1), *(u64 *)&cam1); | ||
83 | } | ||
84 | |||
85 | static inline u64 enable_mask(int count) | ||
86 | { | ||
87 | return (((count) < 64) ? ~(BIT_ULL(count) - 1) : (0x00ULL)); | ||
88 | } | ||
89 | |||
90 | static void npc_program_kpu_profile(struct rvu *rvu, int blkaddr, int kpu, | ||
91 | struct npc_kpu_profile *profile) | ||
92 | { | ||
93 | int entry, num_entries, max_entries; | ||
94 | |||
95 | if (profile->cam_entries != profile->action_entries) { | ||
96 | dev_err(rvu->dev, | ||
97 | "KPU%d: CAM and action entries [%d != %d] not equal\n", | ||
98 | kpu, profile->cam_entries, profile->action_entries); | ||
99 | } | ||
100 | |||
101 | max_entries = rvu_read64(rvu, blkaddr, NPC_AF_CONST1) & 0xFFF; | ||
102 | |||
103 | /* Program CAM match entries for previous KPU extracted data */ | ||
104 | num_entries = min_t(int, profile->cam_entries, max_entries); | ||
105 | for (entry = 0; entry < num_entries; entry++) | ||
106 | npc_config_kpucam(rvu, blkaddr, | ||
107 | &profile->cam[entry], kpu, entry); | ||
108 | |||
109 | /* Program this KPU's actions */ | ||
110 | num_entries = min_t(int, profile->action_entries, max_entries); | ||
111 | for (entry = 0; entry < num_entries; entry++) | ||
112 | npc_config_kpuaction(rvu, blkaddr, &profile->action[entry], | ||
113 | kpu, entry, false); | ||
114 | |||
115 | /* Enable all programmed entries */ | ||
116 | num_entries = min_t(int, profile->action_entries, profile->cam_entries); | ||
117 | rvu_write64(rvu, blkaddr, | ||
118 | NPC_AF_KPUX_ENTRY_DISX(kpu, 0), enable_mask(num_entries)); | ||
119 | if (num_entries > 64) { | ||
120 | rvu_write64(rvu, blkaddr, | ||
121 | NPC_AF_KPUX_ENTRY_DISX(kpu, 1), | ||
122 | enable_mask(num_entries - 64)); | ||
123 | } | ||
124 | |||
125 | /* Enable this KPU */ | ||
126 | rvu_write64(rvu, blkaddr, NPC_AF_KPUX_CFG(kpu), 0x01); | ||
127 | } | ||
128 | |||
129 | static void npc_parser_profile_init(struct rvu *rvu, int blkaddr) | ||
130 | { | ||
131 | struct rvu_hwinfo *hw = rvu->hw; | ||
132 | int num_pkinds, num_kpus, idx; | ||
133 | struct npc_pkind *pkind; | ||
134 | |||
135 | /* Get HW limits */ | ||
136 | hw->npc_kpus = (rvu_read64(rvu, blkaddr, NPC_AF_CONST) >> 8) & 0x1F; | ||
137 | |||
138 | /* Disable all KPUs and their entries */ | ||
139 | for (idx = 0; idx < hw->npc_kpus; idx++) { | ||
140 | rvu_write64(rvu, blkaddr, | ||
141 | NPC_AF_KPUX_ENTRY_DISX(idx, 0), ~0ULL); | ||
142 | rvu_write64(rvu, blkaddr, | ||
143 | NPC_AF_KPUX_ENTRY_DISX(idx, 1), ~0ULL); | ||
144 | rvu_write64(rvu, blkaddr, NPC_AF_KPUX_CFG(idx), 0x00); | ||
145 | } | ||
146 | |||
147 | /* First program IKPU profile i.e PKIND configs. | ||
148 | * Check HW max count to avoid configuring junk or | ||
149 | * writing to unsupported CSR addresses. | ||
150 | */ | ||
151 | pkind = &hw->pkind; | ||
152 | num_pkinds = ARRAY_SIZE(ikpu_action_entries); | ||
153 | num_pkinds = min_t(int, pkind->rsrc.max, num_pkinds); | ||
154 | |||
155 | for (idx = 0; idx < num_pkinds; idx++) | ||
156 | npc_config_kpuaction(rvu, blkaddr, | ||
157 | &ikpu_action_entries[idx], 0, idx, true); | ||
158 | |||
159 | /* Program KPU CAM and Action profiles */ | ||
160 | num_kpus = ARRAY_SIZE(npc_kpu_profiles); | ||
161 | num_kpus = min_t(int, hw->npc_kpus, num_kpus); | ||
162 | |||
163 | for (idx = 0; idx < num_kpus; idx++) | ||
164 | npc_program_kpu_profile(rvu, blkaddr, | ||
165 | idx, &npc_kpu_profiles[idx]); | ||
166 | } | ||
167 | |||
168 | int rvu_npc_init(struct rvu *rvu) | ||
169 | { | ||
170 | struct npc_pkind *pkind = &rvu->hw->pkind; | ||
171 | int blkaddr, err; | ||
172 | |||
173 | blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); | ||
174 | if (blkaddr < 0) { | ||
175 | dev_err(rvu->dev, "%s: NPC block not implemented\n", __func__); | ||
176 | return -ENODEV; | ||
177 | } | ||
178 | |||
179 | /* Allocate resource bimap for pkind*/ | ||
180 | pkind->rsrc.max = (rvu_read64(rvu, blkaddr, | ||
181 | NPC_AF_CONST1) >> 12) & 0xFF; | ||
182 | err = rvu_alloc_bitmap(&pkind->rsrc); | ||
183 | if (err) | ||
184 | return err; | ||
185 | |||
186 | /* Allocate mem for pkind to PF and channel mapping info */ | ||
187 | pkind->pfchan_map = devm_kcalloc(rvu->dev, pkind->rsrc.max, | ||
188 | sizeof(u32), GFP_KERNEL); | ||
189 | if (!pkind->pfchan_map) | ||
190 | return -ENOMEM; | ||
191 | |||
192 | /* Configure KPU profile */ | ||
193 | npc_parser_profile_init(rvu, blkaddr); | ||
194 | |||
195 | return 0; | ||
196 | } | ||
197 | |||
198 | void rvu_npc_freemem(struct rvu *rvu) | ||
199 | { | ||
200 | struct npc_pkind *pkind = &rvu->hw->pkind; | ||
201 | |||
202 | kfree(pkind->rsrc.bmap); | ||
203 | } | ||
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h index d871a394e72b..09a8d61f3144 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h | |||
@@ -438,4 +438,65 @@ | |||
438 | #define NDC_AF_BLK_RST (0x002F0) | 438 | #define NDC_AF_BLK_RST (0x002F0) |
439 | #define NPC_AF_BLK_RST (0x00040) | 439 | #define NPC_AF_BLK_RST (0x00040) |
440 | 440 | ||
441 | /* NPC */ | ||
442 | #define NPC_AF_CFG (0x00000) | ||
443 | #define NPC_AF_ACTIVE_PC (0x00010) | ||
444 | #define NPC_AF_CONST (0x00020) | ||
445 | #define NPC_AF_CONST1 (0x00030) | ||
446 | #define NPC_AF_BLK_RST (0x00040) | ||
447 | #define NPC_AF_MCAM_SCRUB_CTL (0x000a0) | ||
448 | #define NPC_AF_KCAM_SCRUB_CTL (0x000b0) | ||
449 | #define NPC_AF_KPUX_CFG(a) (0x00500 | (a) << 3) | ||
450 | #define NPC_AF_PCK_CFG (0x00600) | ||
451 | #define NPC_AF_PCK_DEF_OL2 (0x00610) | ||
452 | #define NPC_AF_PCK_DEF_OIP4 (0x00620) | ||
453 | #define NPC_AF_PCK_DEF_OIP6 (0x00630) | ||
454 | #define NPC_AF_PCK_DEF_IIP4 (0x00640) | ||
455 | #define NPC_AF_KEX_LDATAX_FLAGS_CFG(a) (0x00800 | (a) << 3) | ||
456 | #define NPC_AF_INTFX_KEX_CFG(a) (0x01010 | (a) << 8) | ||
457 | #define NPC_AF_PKINDX_ACTION0(a) (0x80000ull | (a) << 6) | ||
458 | #define NPC_AF_PKINDX_ACTION1(a) (0x80008ull | (a) << 6) | ||
459 | #define NPC_AF_PKINDX_CPI_DEFX(a, b) (0x80020ull | (a) << 6 | (b) << 3) | ||
460 | #define NPC_AF_KPUX_ENTRYX_CAMX(a, b, c) \ | ||
461 | (0x100000 | (a) << 14 | (b) << 6 | (c) << 3) | ||
462 | #define NPC_AF_KPUX_ENTRYX_ACTION0(a, b) \ | ||
463 | (0x100020 | (a) << 14 | (b) << 6) | ||
464 | #define NPC_AF_KPUX_ENTRYX_ACTION1(a, b) \ | ||
465 | (0x100028 | (a) << 14 | (b) << 6) | ||
466 | #define NPC_AF_KPUX_ENTRY_DISX(a, b) (0x180000 | (a) << 6 | (b) << 3) | ||
467 | #define NPC_AF_CPIX_CFG(a) (0x200000 | (a) << 3) | ||
468 | #define NPC_AF_INTFX_LIDX_LTX_LDX_CFG(a, b, c, d) \ | ||
469 | (0x900000 | (a) << 16 | (b) << 12 | (c) << 5 | (d) << 3) | ||
470 | #define NPC_AF_INTFX_LDATAX_FLAGSX_CFG(a, b, c) \ | ||
471 | (0x980000 | (a) << 16 | (b) << 12 | (c) << 3) | ||
472 | #define NPC_AF_MCAMEX_BANKX_CAMX_INTF(a, b, c) \ | ||
473 | (0x1000000ull | (a) << 10 | (b) << 6 | (c) << 3) | ||
474 | #define NPC_AF_MCAMEX_BANKX_CAMX_W0(a, b, c) \ | ||
475 | (0x1000010ull | (a) << 10 | (b) << 6 | (c) << 3) | ||
476 | #define NPC_AF_MCAMEX_BANKX_CAMX_W1(a, b, c) \ | ||
477 | (0x1000020ull | (a) << 10 | (b) << 6 | (c) << 3) | ||
478 | #define NPC_AF_MCAMEX_BANKX_CFG(a, b) (0x1800000ull | (a) << 8 | (b) << 4) | ||
479 | #define NPC_AF_MCAMEX_BANKX_STAT_ACT(a, b) \ | ||
480 | (0x1880000 | (a) << 8 | (b) << 4) | ||
481 | #define NPC_AF_MATCH_STATX(a) (0x1880008 | (a) << 8) | ||
482 | #define NPC_AF_INTFX_MISS_STAT_ACT(a) (0x1880040 + (a) * 0x8) | ||
483 | #define NPC_AF_MCAMEX_BANKX_ACTION(a, b) (0x1900000ull | (a) << 8 | (b) << 4) | ||
484 | #define NPC_AF_MCAMEX_BANKX_TAG_ACT(a, b) \ | ||
485 | (0x1900008 | (a) << 8 | (b) << 4) | ||
486 | #define NPC_AF_INTFX_MISS_ACT(a) (0x1a00000 | (a) << 4) | ||
487 | #define NPC_AF_INTFX_MISS_TAG_ACT(a) (0x1b00008 | (a) << 4) | ||
488 | #define NPC_AF_MCAM_BANKX_HITX(a, b) (0x1c80000 | (a) << 8 | (b) << 4) | ||
489 | #define NPC_AF_LKUP_CTL (0x2000000) | ||
490 | #define NPC_AF_LKUP_DATAX(a) (0x2000200 | (a) << 4) | ||
491 | #define NPC_AF_LKUP_RESULTX(a) (0x2000400 | (a) << 4) | ||
492 | #define NPC_AF_INTFX_STAT(a) (0x2000800 | (a) << 4) | ||
493 | #define NPC_AF_DBG_CTL (0x3000000) | ||
494 | #define NPC_AF_DBG_STATUS (0x3000010) | ||
495 | #define NPC_AF_KPUX_DBG(a) (0x3000020 | (a) << 8) | ||
496 | #define NPC_AF_IKPU_ERR_CTL (0x3000080) | ||
497 | #define NPC_AF_KPUX_ERR_CTL(a) (0x30000a0 | (a) << 8) | ||
498 | #define NPC_AF_MCAM_DBG (0x3001000) | ||
499 | #define NPC_AF_DBG_DATAX(a) (0x3001400 | (a) << 4) | ||
500 | #define NPC_AF_DBG_RESULTX(a) (0x3001800 | (a) << 4) | ||
501 | |||
441 | #endif /* RVU_REG_H */ | 502 | #endif /* RVU_REG_H */ |