1 /* *********************************************************************
2 * BCM1280/BCM1480 Board Support Package
4 * Hash and Route Block constants File: bcm1480_hr.h
6 * This module contains constants and macros useful for
7 * programming the hash and route block of each rx port.
9 * BCM1400 specification level: 1X55_1X80-UM100-D4 (11/24/03)
11 *********************************************************************
13 * Copyright 2000,2001,2002,2003,2004
14 * Broadcom Corporation. All rights reserved.
16 * This software is furnished under license and may be used and
17 * copied only in accordance with the following terms and
18 * conditions. Subject to these conditions, you may download,
19 * copy, install, use, modify and distribute modified or unmodified
20 * copies of this software in source and/or binary form. No title
21 * or ownership is transferred hereby.
23 * 1) Any source code used, modified or distributed must reproduce
24 * and retain this copyright notice and list of conditions
25 * as they appear in the source file.
27 * 2) No right is granted to use any trade name, trademark, or
28 * logo of Broadcom Corporation. The "Broadcom Corporation"
29 * name may not be used to endorse or promote products derived
30 * from this software without the prior written permission of
31 * Broadcom Corporation.
33 * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
34 * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
35 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
36 * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
37 * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
38 * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
39 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
40 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
41 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
42 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
43 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
44 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
45 * THE POSSIBILITY OF SUCH DAMAGE.
46 ********************************************************************* */
51 #include "sb1250_defs.h"
53 * H&R to PMI mapping register
56 #define S_BCM1480_HR_RX2PMI_MAP_LO 0
57 #define M_BCM1480_HR_RX2PMI_MAP_LO _SB_MAKEMASK(4,S_BCM1480_HR_RX2PMI_MAP_LO)
58 #define V_BCM1480_HR_RX2PMI_MAP_LO(x) _SB_MAKEVALUE(x,S_BCM1480_HR_RX2PMI_MAP_LO)
59 #define G_BCM1480_HR_RX2PMI_MAP_LO(x) _SB_GETVALUE(x,S_BCM1480_HR_RX2PMI_MAP_LO,M_BCM1480_HR_RX2PMI_MAP_LO)
61 #define K_BCM1480_HR_RX2PMI_MAP_7_0 0
62 #define K_BCM1480_HR_RX2PMI_MAP_15_8 1
63 #define K_BCM1480_HR_RX2PMI_MAP_23_16 2
64 #define K_BCM1480_HR_RX2PMI_MAP_31_24 3
66 #define S_BCM1480_HR_RX2PMI_MAP_HI 4
67 #define M_BCM1480_HR_RX2PMI_MAP_HI _SB_MAKEMASK(4,S_BCM1480_HR_RX2PMI_MAP_HI)
68 #define V_BCM1480_HR_RX2PMI_MAP_HI(x) _SB_MAKEVALUE(x,S_BCM1480_HR_RX2PMI_MAP_HI)
69 #define G_BCM1480_HR_RX2PMI_MAP_HI(x) _SB_GETVALUE(x,S_BCM1480_HR_RX2PMI_MAP_HI,M_BCM1480_HR_RX2PMI_MAP_HI)
73 * H&R Configuration Register (Table 283)
76 #define S_BCM1480_HR_HEADER_PTR 0
77 #define M_BCM1480_HR_HEADER_PTR _SB_MAKEMASK(8,S_BCM1480_HR_HEADER_PTR)
78 #define V_BCM1480_HR_HEADER_PTR(x) _SB_MAKEVALUE(x,S_BCM1480_HR_HEADER_PTR)
79 #define G_BCM1480_HR_HEADER_PTR(x) _SB_GETVALUE(x,S_BCM1480_HR_HEADER_PTR,M_BCM1480_HR_HEADER_PTR)
81 #define M_BCM1480_HR_HDR_PTR_IMMD _SB_MAKEMASK1(8)
82 #define M_BCM1480_HR_SELECT_PTNUM_TO_TAG _SB_MAKEMASK1(9)
83 #define M_BCM1480_HR_PT_UNMATCH_ENABLE _SB_MAKEMASK1(10)
84 #define M_BCM1480_HR_PT_MULTIMATCH_ENABLE _SB_MAKEMASK1(11)
87 /* XXX The following have field name clashes. Resolution deferred. */
90 * Rule Operand Configuration Entry (Table 284)
93 #define S_BCM1480_HR_RULE_OP_OPERAND_3 0
94 #define M_BCM1480_HR_RULE_OP_OPERAND_3 _SB_MAKEMASK(8,S_BCM1480_HR_RULE_OP_OPERAND_3)
95 #define V_BCM1480_HR_RULE_OP_OPERAND_3(x) _SB_MAKEVALUE(x,S_BCM1480_HR_RULE_OP_OPERAND_3)
96 #define G_BCM1480_HR_RULE_OP_OPERAND_3(x) _SB_GETVALUE(x,S_BCM1480_HR_RULE_OP_OPERAND_3,M_BCM1480_HR_RULE_OP_OPERAND_3)
98 #define S_BCM1480_HR_RULE_OP_OPERAND_2 8
99 #define M_BCM1480_HR_RULE_OP_OPERAND_2 _SB_MAKEMASK(8,S_BCM1480_HR_RULE_OP_OPERAND_2)
100 #define V_BCM1480_HR_RULE_OP_OPERAND_2(x) _SB_MAKEVALUE(x,S_BCM1480_HR_RULE_OP_OPERAND_2)
101 #define G_BCM1480_HR_RULE_OP_OPERAND_2(x) _SB_GETVALUE(x,S_BCM1480_HR_RULE_OP_OPERAND_2,M_BCM1480_HR_RULE_OP_OPERAND_2)
103 #define S_BCM1480_HR_RULE_OP_OPERAND_1 16
104 #define M_BCM1480_HR_RULE_OP_OPERAND_1 _SB_MAKEMASK(8,S_BCM1480_HR_RULE_OP_OPERAND_1)
105 #define V_BCM1480_HR_RULE_OP_OPERAND_1(x) _SB_MAKEVALUE(x,S_BCM1480_HR_RULE_OP_OPERAND_1)
106 #define G_BCM1480_HR_RULE_OP_OPERAND_1(x) _SB_GETVALUE(x,S_BCM1480_HR_RULE_OP_OPERAND_1,M_BCM1480_HR_RULE_OP_OPERAND_1)
108 #define S_BCM1480_HR_RULE_OP_OPERAND_0 24
109 #define M_BCM1480_HR_RULE_OP_OPERAND_0 _SB_MAKEMASK(8,S_BCM1480_HR_RULE_OP_OPERAND_0)
110 #define V_BCM1480_HR_RULE_OP_OPERAND_0(x) _SB_MAKEVALUE(x,S_BCM1480_HR_RULE_OP_OPERAND_0)
111 #define G_BCM1480_HR_RULE_OP_OPERAND_0(x) _SB_GETVALUE(x,S_BCM1480_HR_RULE_OP_OPERAND_0,M_BCM1480_HR_RULE_OP_OPERAND_0)
113 #define S_BCM1480_HR_RULE_OP_ENABLE_3 32
114 #define M_BCM1480_HR_RULE_OP_ENABLE_3 _SB_MAKEMASK(8,S_BCM1480_HR_RULE_OP_ENABLE_3)
115 #define V_BCM1480_HR_RULE_OP_ENABLE_3(x) _SB_MAKEVALUE(x,S_BCM1480_HR_RULE_OP_ENABLE_3)
116 #define G_BCM1480_HR_RULE_OP_ENABLE_3(x) _SB_GETVALUE(x,S_BCM1480_HR_RULE_OP_ENABLE_3,M_BCM1480_HR_RULE_OP_ENABLE_3)
118 #define S_BCM1480_HR_RULE_OP_ENABLE_2 40
119 #define M_BCM1480_HR_RULE_OP_ENABLE_2 _SB_MAKEMASK(8,S_BCM1480_HR_RULE_OP_ENABLE_2)
120 #define V_BCM1480_HR_RULE_OP_ENABLE_2(x) _SB_MAKEVALUE(x,S_BCM1480_HR_RULE_OP_ENABLE_2)
121 #define G_BCM1480_HR_RULE_OP_ENABLE_2(x) _SB_GETVALUE(x,S_BCM1480_HR_RULE_OP_ENABLE_2,M_BCM1480_HR_RULE_OP_ENABLE_2)
123 #define S_BCM1480_HR_RULE_OP_ENABLE_1 48
124 #define M_BCM1480_HR_RULE_OP_ENABLE_1 _SB_MAKEMASK(8,S_BCM1480_HR_RULE_OP_ENABLE_1)
125 #define V_BCM1480_HR_RULE_OP_ENABLE_1(x) _SB_MAKEVALUE(x,S_BCM1480_HR_RULE_OP_ENABLE_1)
126 #define G_BCM1480_HR_RULE_OP_ENABLE_1(x) _SB_GETVALUE(x,S_BCM1480_HR_RULE_OP_ENABLE_1,M_BCM1480_HR_RULE_OP_ENABLE_1)
128 #define S_BCM1480_HR_RULE_OP_ENABLE_0 56
129 #define M_BCM1480_HR_RULE_OP_ENABLE_0 _SB_MAKEMASK(8,S_BCM1480_HR_RULE_OP_ENABLE_0)
130 #define V_BCM1480_HR_RULE_OP_ENABLE_0(x) _SB_MAKEVALUE(x,S_BCM1480_HR_RULE_OP_ENABLE_0)
131 #define G_BCM1480_HR_RULE_OP_ENABLE_0(x) _SB_GETVALUE(x,S_BCM1480_HR_RULE_OP_ENABLE_0,M_BCM1480_HR_RULE_OP_ENABLE_0)
135 * Rule Type Configuration Entry (Table 285)
138 /* XXX WORD_OFFSET - clashes */
139 #define S_BCM1480_HR_RULE_TYPE_WORD_OFST_0 0
140 #define M_BCM1480_HR_RULE_TYPE_WORD_OFST_0 _SB_MAKEMASK(6,S_BCM1480_HR_RULE_TYPE_WORD_OFST_0)
141 #define V_BCM1480_HR_RULE_TYPE_WORD_OFST_0(x) _SB_MAKEVALUE(x,S_BCM1480_HR_RULE_TYPE_WORD_OFST_0)
142 #define G_BCM1480_HR_RULE_TYPE_WORD_OFST_0(x) _SB_GETVALUE(x,S_BCM1480_HR_RULE_TYPE_WORD_OFST_0,M_BCM1480_HR_RULE_TYPE_WORD_OFST_0)
144 /* XXX SELECT - clashes */
145 #define M_BCM1480_HR_RULE_TYPE_SEL_0 _SB_MAKEMASK1(8)
148 * Path Definition Entry (Table 286)
152 #define S_BCM1480_HR_ENABLE 0
153 #define M_BCM1480_HR_ENABLE _SB_MAKEMASK(16,S_BCM1480_HR_ENABLE)
154 #define V_BCM1480_HR_ENABLE(x) _SB_MAKEVALUE(x,S_BCM1480_HR_ENABLE)
155 #define G_BCM1480_HR_ENABLE(x) _SB_GETVALUE(x,S_BCM1480_HR_ENABLE,M_BCM1480_HR_ENABLE)
157 #define S_BCM1480_HR_TEST 16
158 #define M_BCM1480_HR_TEST _SB_MAKEMASK(16,S_BCM1480_HR_TEST)
159 #define V_BCM1480_HR_TEST(x) _SB_MAKEVALUE(x,S_BCM1480_HR_TEST)
160 #define G_BCM1480_HR_TEST(x) _SB_GETVALUE(x,S_BCM1480_HR_TEST,M_BCM1480_HR_TEST)
162 #define S_BCM1480_HR_PATH_DATA 32
163 #define M_BCM1480_HR_PATH_DATA _SB_MAKEMASK(16,S_BCM1480_HR_PATH_DATA)
164 #define V_BCM1480_HR_PATH_DATA(x) _SB_MAKEVALUE(x,S_BCM1480_HR_PATH_DATA)
165 #define G_BCM1480_HR_PATH_DATA(x) _SB_GETVALUE(x,S_BCM1480_HR_PATH_DATA,M_BCM1480_HR_PATH_DATA)
167 #define S_BCM1480_HR_PATH_DATA_DEST 44
168 #define M_BCM1480_HR_PATH_DATA_DEST _SB_MAKEMASK(2,S_BCM1480_HR_PATH_DATA_DEST)
169 #define V_BCM1480_HR_PATH_DATA_DEST(x) _SB_MAKEVALUE(x,S_BCM1480_HR_PATH_DATA_DEST)
170 #define G_BCM1480_HR_PATH_DATA_DEST(x) _SB_GETVALUE(x,S_BCM1480_HR_PATH_DATA_DEST,M_BCM1480_HR_PATH_DATA_DEST)
172 #define S_BCM1480_HR_PATH_DATA_VC 36
173 #define M_BCM1480_HR_PATH_DATA_VC _SB_MAKEMASK(4,S_BCM1480_HR_PATH_DATA_VC)
174 #define V_BCM1480_HR_PATH_DATA_VC(x) _SB_MAKEVALUE(x,S_BCM1480_HR_PATH_DATA_VC)
175 #define G_BCM1480_HR_PATH_DATA_VC(x) _SB_GETVALUE(x,S_BCM1480_HR_PATH_DATA_VC,M_BCM1480_HR_PATH_DATA_VC)
177 #define S_BCM1480_HR_PATH_DATA_NDEST 32
178 #define M_BCM1480_HR_PATH_DATA_NDEST _SB_MAKEMASK(4,S_BCM1480_HR_PATH_DATA_NDEST)
179 #define V_BCM1480_HR_PATH_DATA_NDEST(x) _SB_MAKEVALUE(x,S_BCM1480_HR_PATH_DATA_NDEST)
180 #define G_BCM1480_HR_PATH_DATA_NDEST(x) _SB_GETVALUE(x,S_BCM1480_HR_PATH_DATA_NDEST,M_BCM1480_HR_PATH_DATA_NDEST)
182 #define S_BCM1480_HR_PATH_TYPE 48
183 #define M_BCM1480_HR_PATH_TYPE _SB_MAKEMASK(3,S_BCM1480_HR_PATH_TYPE)
184 #define V_BCM1480_HR_PATH_TYPE(x) _SB_MAKEVALUE(x,S_BCM1480_HR_PATH_TYPE)
185 #define G_BCM1480_HR_PATH_TYPE(x) _SB_GETVALUE(x,S_BCM1480_HR_PATH_TYPE,M_BCM1480_HR_PATH_TYPE)
186 #define K_BCM1480_HR_PATH_TYPE_OVC 0x0
187 #define K_BCM1480_HR_PATH_TYPE_RTI 0x1
188 #define K_BCM1480_HR_PATH_TYPE_HA_LEAF0 0x2
189 #define K_BCM1480_HR_PATH_TYPE_EX_LEAF0 0x4
195 * Hash leaf0 Data Word Definition Entry (Table 287)
198 #define S_BCM1480_HR_ENABLE_3 0
199 #define M_BCM1480_HR_ENABLE_3 _SB_MAKEMASK(8,S_BCM1480_HR_ENABLE_3)
200 #define V_BCM1480_HR_ENABLE_3(x) _SB_MAKEVALUE(x,S_BCM1480_HR_ENABLE_3)
201 #define G_BCM1480_HR_ENABLE_3(x) _SB_GETVALUE(x,S_BCM1480_HR_ENABLE_3,M_BCM1480_HR_ENABLE_3)
203 #define S_BCM1480_HR_ENABLE_2 8
204 #define M_BCM1480_HR_ENABLE_2 _SB_MAKEMASK(8,S_BCM1480_HR_ENABLE_2)
205 #define V_BCM1480_HR_ENABLE_2(x) _SB_MAKEVALUE(x,S_BCM1480_HR_ENABLE_2)
206 #define G_BCM1480_HR_ENABLE_2(x) _SB_GETVALUE(x,S_BCM1480_HR_ENABLE_2,M_BCM1480_HR_ENABLE_2)
208 #define S_BCM1480_HR_ENABLE_1 16
209 #define M_BCM1480_HR_ENABLE_1 _SB_MAKEMASK(8,S_BCM1480_HR_ENABLE_1)
210 #define V_BCM1480_HR_ENABLE_1(x) _SB_MAKEVALUE(x,S_BCM1480_HR_ENABLE_1)
211 #define G_BCM1480_HR_ENABLE_1(x) _SB_GETVALUE(x,S_BCM1480_HR_ENABLE_1,M_BCM1480_HR_ENABLE_1)
213 #define S_BCM1480_HR_ENABLE_0 24
214 #define M_BCM1480_HR_ENABLE_0 _SB_MAKEMASK(8,S_BCM1480_HR_ENABLE_0)
215 #define V_BCM1480_HR_ENABLE_0(x) _SB_MAKEVALUE(x,S_BCM1480_HR_ENABLE_0)
216 #define G_BCM1480_HR_ENABLE_0(x) _SB_GETVALUE(x,S_BCM1480_HR_ENABLE_0,M_BCM1480_HR_ENABLE_0)
218 #define S_BCM1480_HR_WORD_OFFSET 32
219 #define M_BCM1480_HR_WORD_OFFSET _SB_MAKEMASK(6,S_BCM1480_HR_WORD_OFFSET)
220 #define V_BCM1480_HR_WORD_OFFSET(x) _SB_MAKEVALUE(x,S_BCM1480_HR_WORD_OFFSET)
221 #define G_BCM1480_HR_WORD_OFFSET(x) _SB_GETVALUE(x,S_BCM1480_HR_WORD_OFFSET,M_BCM1480_HR_WORD_OFFSET)
223 #define M_BCM1480_HR_SELECT _SB_MAKEMASK1(40)
226 * Extract leaf0 Extract Definition Register (Table 288)
229 #define S_BCM1480_HR_WORD_OFFSET_LOW 0
230 #define M_BCM1480_HR_WORD_OFFSET_LOW _SB_MAKEMASK(6,S_BCM1480_HR_WORD_OFFSET_LOW)
231 #define V_BCM1480_HR_WORD_OFFSET_LOW(x) _SB_MAKEVALUE(x,S_BCM1480_HR_WORD_OFFSET_LOW)
232 #define G_BCM1480_HR_WORD_OFFSET_LOW(x) _SB_GETVALUE(x,S_BCM1480_HR_WORD_OFFSET_LOW,M_BCM1480_HR_WORD_OFFSET_LOW)
234 #define M_BCM1480_HR_SELECT_LOW _SB_MAKEMASK1(8)
236 #define S_BCM1480_HR_ENABLE_LOW 16
237 #define M_BCM1480_HR_ENABLE_LOW _SB_MAKEMASK(4,S_BCM1480_HR_ENABLE_LOW)
238 #define V_BCM1480_HR_ENABLE_LOW(x) _SB_MAKEVALUE(x,S_BCM1480_HR_ENABLE_LOW)
239 #define G_BCM1480_HR_ENABLE_LOW(x) _SB_GETVALUE(x,S_BCM1480_HR_ENABLE_LOW,M_BCM1480_HR_ENABLE_LOW)
241 #define S_BCM1480_HR_NIB_OFFSET_LOW 20
242 #define M_BCM1480_HR_NIB_OFFSET_LOW _SB_MAKEMASK(3,S_BCM1480_HR_NIB_OFFSET_LOW)
243 #define V_BCM1480_HR_NIB_OFFSET_LOW(x) _SB_MAKEVALUE(x,S_BCM1480_HR_NIB_OFFSET_LOW)
244 #define G_BCM1480_HR_NIB_OFFSET_LOW(x) _SB_GETVALUE(x,S_BCM1480_HR_NIB_OFFSET_LOW,M_BCM1480_HR_NIB_OFFSET_LOW)
246 #define S_BCM1480_HR_WORD_OFFSET_HIGH 32
247 #define M_BCM1480_HR_WORD_OFFSET_HIGH _SB_MAKEMASK(6,S_BCM1480_HR_WORD_OFFSET_HIGH)
248 #define V_BCM1480_HR_WORD_OFFSET_HIGH(x) _SB_MAKEVALUE(x,S_BCM1480_HR_WORD_OFFSET_HIGH)
249 #define G_BCM1480_HR_WORD_OFFSET_HIGH(x) _SB_GETVALUE(x,S_BCM1480_HR_WORD_OFFSET_HIGH,M_BCM1480_HR_WORD_OFFSET_HIGH)
251 #define M_BCM1480_HR_SELECT_HIGH _SB_MAKEMASK1(40)
253 #define S_BCM1480_HR_ENABLE_HIGH 48
254 #define M_BCM1480_HR_ENABLE_HIGH _SB_MAKEMASK(4,S_BCM1480_HR_ENABLE_HIGH)
255 #define V_BCM1480_HR_ENABLE_HIGH(x) _SB_MAKEVALUE(x,S_BCM1480_HR_ENABLE_HIGH)
256 #define G_BCM1480_HR_ENABLE_HIGH(x) _SB_GETVALUE(x,S_BCM1480_HR_ENABLE_HIGH,M_BCM1480_HR_ENABLE_HIGH)
258 #define S_BCM1480_HR_NIB_OFFSET_HIGH 52
259 #define M_BCM1480_HR_NIB_OFFSET_HIGH _SB_MAKEMASK(3,S_BCM1480_HR_NIB_OFFSET_HIGH)
260 #define V_BCM1480_HR_NIB_OFFSET_HIGH(x) _SB_MAKEVALUE(x,S_BCM1480_HR_NIB_OFFSET_HIGH)
261 #define G_BCM1480_HR_NIB_OFFSET_HIGH(x) _SB_GETVALUE(x,S_BCM1480_HR_NIB_OFFSET_HIGH,M_BCM1480_HR_NIB_OFFSET_HIGH)
264 * RX0 Route Table Definition Entry (Table 289)
267 #define S_BCM1480_HR_NEXT_DEST 0
268 #define M_BCM1480_HR_NEXT_DEST _SB_MAKEMASK(4,S_BCM1480_HR_NEXT_DEST)
269 #define V_BCM1480_HR_NEXT_DEST(x) _SB_MAKEVALUE(x,S_BCM1480_HR_NEXT_DEST)
270 #define G_BCM1480_HR_NEXT_DEST(x) _SB_GETVALUE(x,S_BCM1480_HR_NEXT_DEST,M_BCM1480_HR_NEXT_DEST)
272 #define S_BCM1480_HR_OVC_IQ 4
273 #define M_BCM1480_HR_OVC_IQ _SB_MAKEMASK(4,S_BCM1480_HR_OVC_IQ)
274 #define V_BCM1480_HR_OVC_IQ(x) _SB_MAKEVALUE(x,S_BCM1480_HR_OVC_IQ)
275 #define G_BCM1480_HR_OVC_IQ(x) _SB_GETVALUE(x,S_BCM1480_HR_OVC_IQ,M_BCM1480_HR_OVC_IQ)
277 #define S_BCM1480_HR_DEST 12
278 #define M_BCM1480_HR_DEST _SB_MAKEMASK(2,S_BCM1480_HR_DEST)
279 #define V_BCM1480_HR_DEST(x) _SB_MAKEVALUE(x,S_BCM1480_HR_DEST)
280 #define G_BCM1480_HR_DEST(x) _SB_GETVALUE(x,S_BCM1480_HR_DEST,M_BCM1480_HR_DEST)
281 #define K_BCM1480_HR_DEST_TX0 0x0
282 #define K_BCM1480_HR_DEST_TX1 0x1
283 #define K_BCM1480_HR_DEST_TX2 0x2
284 #define K_BCM1480_HR_DEST_PMI 0x3
287 * Default Path Register (Table 290)
290 /* Uses PATH_DATA and PATH_TYPE fields from Path Definition (Table 286) */
292 #endif /* _BCM1480_HR_H */