1 /* *********************************************************************
2 * SB1250 Board Support Package
4 * Wafer ID bit definitions File: sb1250_wid.h
6 * Some preproduction BCM1250 samples use the wafer ID (WID) bits
7 * in the system_revision register in the SCD to determine which
8 * portions of the L1 and L2 caches are usable.
10 * This file describes the WID register layout.
12 *********************************************************************
14 * Copyright 2000,2001,2002,2003
15 * Broadcom Corporation. All rights reserved.
17 * This software is furnished under license and may be used and
18 * copied only in accordance with the following terms and
19 * conditions. Subject to these conditions, you may download,
20 * copy, install, use, modify and distribute modified or unmodified
21 * copies of this software in source and/or binary form. No title
22 * or ownership is transferred hereby.
24 * 1) Any source code used, modified or distributed must reproduce
25 * and retain this copyright notice and list of conditions
26 * as they appear in the source file.
28 * 2) No right is granted to use any trade name, trademark, or
29 * logo of Broadcom Corporation. The "Broadcom Corporation"
30 * name may not be used to endorse or promote products derived
31 * from this software without the prior written permission of
32 * Broadcom Corporation.
34 * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
35 * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
36 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
37 * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
38 * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
39 * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
40 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
41 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
42 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
43 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
44 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
45 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
46 * THE POSSIBILITY OF SUCH DAMAGE.
47 ********************************************************************* */
53 #include "sb1250_defs.h"
56 * To make things easier to work with, we'll assume that the
57 * WID bits have been shifted from their normal home
58 * in scd_system_revision[63:32] to bits [31..0].
60 * That is, we've already shifted right by S_SYS_WID
64 #define M_WID_BIN _SB_MAKEMASK(3,S_WID_BIN)
65 #define V_WID_BIN(x) _SB_MAKEVALUE(x,S_WID_BIN)
66 #define G_WID_BIN(x) _SB_GETVALUE(x,S_WID_BIN,M_WID_BIN)
69 #define K_WID_BIN_2CPU_FI_1D_H2 0 /* 2 full 1/4 1/2 */
70 #define K_WID_BIN_2CPU_FI_FD_F2 1 /* 2 full full full */
71 #define K_WID_BIN_2CPU_FI_FD_H2 2 /* 2 full full 1/2 */
72 #define K_WID_BIN_2CPU_3I_3D_F2 3 /* 2 3/4 3/4 full */
73 #define K_WID_BIN_2CPU_3I_3D_H2 4 /* 2 3/4 3/4 1/2 */
74 #define K_WID_BIN_1CPU_FI_FD_F2 5 /* 1 full full full */
75 #define K_WID_BIN_1CPU_FI_FD_H2 6 /* 1 full full 1/2 */
76 #define K_WID_BIN_2CPU_1I_1D_Q2 7 /* 2 1/4 1/4 1/4 */
79 * '1' bits in this mask represent bins with only one CPU
82 #define M_WID_BIN_1CPU (_SB_MAKEMASK1(K_WID_BIN_1CPU_FI_FD_F2) | \
83 _SB_MAKEMASK1(K_WID_BIN_1CPU_FI_FD_H2))
87 * '1' bits in this mask represent bins with a good L2
90 #define M_WID_BIN_F2 (_SB_MAKEMASK1(K_WID_BIN_2CPU_FI_FD_F2) | \
91 _SB_MAKEMASK1(K_WID_BIN_2CPU_3I_3D_F2) | \
92 _SB_MAKEMASK1(K_WID_BIN_1CPU_FI_FD_F2))
95 * '1' bits in this mask represent bins with 1/2 L2
98 #define M_WID_BIN_H2 (_SB_MAKEMASK1(K_WID_BIN_2CPU_FI_1D_H2) | \
99 _SB_MAKEMASK1(K_WID_BIN_2CPU_FI_FD_H2) | \
100 _SB_MAKEMASK1(K_WID_BIN_2CPU_3I_3D_H2) | \
101 _SB_MAKEMASK1(K_WID_BIN_1CPU_FI_FD_H2) )
104 * '1' bits in this mask represent bins with 1/4 L2
107 #define M_WID_BIN_Q2 (_SB_MAKEMASK1(K_WID_BIN_2CPU_1I_1D_Q2))
110 * '1' bits in this mask represent bins with 3/4 L1
113 #define M_WID_BIN_3ID (_SB_MAKEMASK1(K_WID_BIN_2CPU_3I_3D_F2) | \
114 _SB_MAKEMASK1(K_WID_BIN_2CPU_3I_3D_H2))
117 * '1' bits in this mask represent bins with a full L1I
120 #define M_WID_BIN_FI (_SB_MAKEMASK1(K_WID_BIN_2CPU_FI_1D_H2) | \
121 _SB_MAKEMASK1(K_WID_BIN_2CPU_FI_FD_F2) | \
122 _SB_MAKEMASK1(K_WID_BIN_2CPU_FI_FD_H2) | \
123 _SB_MAKEMASK1(K_WID_BIN_1CPU_FI_FD_F2) | \
124 _SB_MAKEMASK1(K_WID_BIN_1CPU_FI_FD_H2))
127 * '1' bits in this mask represent bins with a full L1D
130 #define M_WID_BIN_FD (_SB_MAKEMASK1(K_WID_BIN_2CPU_FI_FD_F2) | \
131 _SB_MAKEMASK1(K_WID_BIN_2CPU_FI_FD_H2) | \
132 _SB_MAKEMASK1(K_WID_BIN_1CPU_FI_FD_F2) | \
133 _SB_MAKEMASK1(K_WID_BIN_1CPU_FI_FD_H2))
136 * '1' bits in this mask represent bins with a full L1 (both I and D)
139 #define M_WID_BIN_FID (_SB_MAKEMASK1(K_WID_BIN_2CPU_FI_FD_F2) | \
140 _SB_MAKEMASK1(K_WID_BIN_2CPU_FI_FD_H2) | \
141 _SB_MAKEMASK1(K_WID_BIN_1CPU_FI_FD_F2) | \
142 _SB_MAKEMASK1(K_WID_BIN_1CPU_FI_FD_H2))
144 #define S_WID_L2QTR 3
145 #define M_WID_L2QTR _SB_MAKEMASK(2,S_WID_L2QTR)
146 #define V_WID_L2QTR(x) _SB_MAKEVALUE(x,S_WID_L2QTR)
147 #define G_WID_L2QTR(x) _SB_GETVALUE(x,S_WID_L2QTR,M_WID_L2QTR)
149 #define M_WID_L2HALF _SB_MAKEMASK1(4)
151 #define S_WID_CPU0_L1I 5
152 #define M_WID_CPU0_L1I _SB_MAKEMASK(2,S_WID_CPU0_L1I)
153 #define V_WID_CPU0_L1I(x) _SB_MAKEVALUE(x,S_WID_CPU0_L1I)
154 #define G_WID_CPU0_L1I(x) _SB_GETVALUE(x,S_WID_CPU0_L1I,M_WID_CPU0_L1I)
156 #define S_WID_CPU0_L1D 7
157 #define M_WID_CPU0_L1D _SB_MAKEMASK(2,S_WID_CPU0_L1D)
158 #define V_WID_CPU0_L1D(x) _SB_MAKEVALUE(x,S_WID_CPU0_L1D)
159 #define G_WID_CPU0_L1D(x) _SB_GETVALUE(x,S_WID_CPU0_L1D,M_WID_CPU0_L1D)
161 #define S_WID_CPU1_L1I 9
162 #define M_WID_CPU1_L1I _SB_MAKEMASK(2,S_WID_CPU1_L1I)
163 #define V_WID_CPU1_L1I(x) _SB_MAKEVALUE(x,S_WID_CPU1_L1I)
164 #define G_WID_CPU1_L1I(x) _SB_GETVALUE(x,S_WID_CPU1_L1I,M_WID_CPU1_L1I)
166 #define S_WID_CPU1_L1D 11
167 #define M_WID_CPU1_L1D _SB_MAKEMASK(2,S_WID_CPU1_L1D)
168 #define V_WID_CPU1_L1D(x) _SB_MAKEVALUE(x,S_WID_CPU1_L1D)
169 #define G_WID_CPU1_L1D(x) _SB_GETVALUE(x,S_WID_CPU1_L1D,M_WID_CPU1_L1D)
172 * The macros below assume that the CPU bits have been shifted into the
176 #define S_WID_CPUX_L1I 0
177 #define M_WID_CPUX_L1I _SB_MAKEMASK(2,S_WID_CPUX_L1I)
178 #define V_WID_CPUX_L1I(x) _SB_MAKEVALUE(x,S_WID_CPUX_L1I)
179 #define G_WID_CPUX_L1I(x) _SB_GETVALUE(x,S_WID_CPUX_L1I,M_WID_CPUX_L1I)
181 #define S_WID_CPUX_L1D 2
182 #define M_WID_CPUX_L1D _SB_MAKEMASK(2,S_WID_CPUX_L1D)
183 #define V_WID_CPUX_L1D(x) _SB_MAKEVALUE(x,S_WID_CPUX_L1D)
184 #define G_WID_CPUX_L1D(x) _SB_GETVALUE(x,S_WID_CPUX_L1D,M_WID_CPUX_L1D)
189 #define S_WID_WAFERID 13
190 #define M_WID_WAFERID _SB_MAKEMASK(5,S_WID_WAFERID)
191 #define V_WID_WAFERID(x) _SB_MAKEVALUE(x,S_WID_WAFERID)
192 #define G_WID_WAFERID(x) _SB_GETVALUE(x,S_WID_WAFERID,M_WID_WAFERID)
194 #define S_WID_LOTID 18
195 #define M_WID_LOTID _SB_MAKEMASK(14,S_WID_LOTID)
196 #define V_WID_LOTID(x) _SB_MAKEVALUE(x,S_WID_LOTID)
197 #define G_WID_LOTID(x) _SB_GETVALUE(x,S_WID_LOTID,M_WID_LOTID)
200 * Now, to make things even more confusing, the fuses on the chip
201 * don't exactly correspond to the bits in the register. The mask
202 * below represents bits that need to be swapped with the ones to
203 * their left. So, if bit 10 is set, swap bits 10 and 11
206 #define M_WID_SWAPBITS (_SB_MAKEMASK1(2) | _SB_MAKEMASK1(4) | _SB_MAKEMASK1(10) | \
207 _SB_MAKEMASK1(20) | _SB_MAKEMASK1(18) | _SB_MAKEMASK1(26) )
210 #define WID_UNCONVOLUTE(wid,t1,t2,t3) \
211 li t1,M_WID_SWAPBITS ; \
214 li t2,(M_WID_SWAPBITS << 1); \
217 li t3, ~((M_WID_SWAPBITS | (M_WID_SWAPBITS << 1))) ; \
222 #define WID_UNCONVOLUTE(wid) \
223 (((wid) & ~((M_WID_SWAPBITS | (M_WID_SWAPBITS << 1)))) | \
224 (((wid) & M_WID_SWAPBITS) << 1) | \
225 (((wid) & (M_WID_SWAPBITS<<1)) >> 1))