1/*  *********************************************************************
2    *  SB1250 Board Support Package
3    *
4    *  L2 Cache constants and macros		File: sb1250_l2c.h
5    *
6    *  This module contains constants useful for manipulating the
7    *  level 2 cache.
8    *
9    *  SB1250 specification level:  User's manual 1/02/02
10    *
11    *********************************************************************
12    *
13    *  Copyright 2000,2001,2002,2003,2004
14    *  Broadcom Corporation. All rights reserved.
15    *
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.
22    *
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.
26    *
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.
32    *
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    ********************************************************************* */
47
48
49#ifndef _SB1250_L2C_H
50#define _SB1250_L2C_H
51
52#include "sb1250_defs.h"
53
54/*
55 * Level 2 Cache Tag register (Table 5-3)
56 */
57
58#define S_L2C_TAG_MBZ               0
59#define M_L2C_TAG_MBZ               _SB_MAKEMASK(5,S_L2C_TAG_MBZ)
60
61#define S_L2C_TAG_INDEX             5
62#define M_L2C_TAG_INDEX             _SB_MAKEMASK(12,S_L2C_TAG_INDEX)
63#define V_L2C_TAG_INDEX(x)          _SB_MAKEVALUE(x,S_L2C_TAG_INDEX)
64#define G_L2C_TAG_INDEX(x)          _SB_GETVALUE(x,S_L2C_TAG_INDEX,M_L2C_TAG_INDEX)
65
66#define S_L2C_TAG_TAG               17
67#define M_L2C_TAG_TAG               _SB_MAKEMASK(23,S_L2C_TAG_TAG)
68#define V_L2C_TAG_TAG(x)            _SB_MAKEVALUE(x,S_L2C_TAG_TAG)
69#define G_L2C_TAG_TAG(x)            _SB_GETVALUE(x,S_L2C_TAG_TAG,M_L2C_TAG_TAG)
70
71#define S_L2C_TAG_ECC               40
72#define M_L2C_TAG_ECC               _SB_MAKEMASK(6,S_L2C_TAG_ECC)
73#define V_L2C_TAG_ECC(x)            _SB_MAKEVALUE(x,S_L2C_TAG_ECC)
74#define G_L2C_TAG_ECC(x)            _SB_GETVALUE(x,S_L2C_TAG_ECC,M_L2C_TAG_ECC)
75
76#define S_L2C_TAG_WAY               46
77#define M_L2C_TAG_WAY               _SB_MAKEMASK(2,S_L2C_TAG_WAY)
78#define V_L2C_TAG_WAY(x)            _SB_MAKEVALUE(x,S_L2C_TAG_WAY)
79#define G_L2C_TAG_WAY(x)            _SB_GETVALUE(x,S_L2C_TAG_WAY,M_L2C_TAG_WAY)
80
81#define M_L2C_TAG_DIRTY             _SB_MAKEMASK1(48)
82#define M_L2C_TAG_VALID             _SB_MAKEMASK1(49)
83
84/*
85 * Format of level 2 cache management address (table 5-2)
86 */
87
88#define S_L2C_MGMT_INDEX            5
89#define M_L2C_MGMT_INDEX            _SB_MAKEMASK(12,S_L2C_MGMT_INDEX)
90#define V_L2C_MGMT_INDEX(x)         _SB_MAKEVALUE(x,S_L2C_MGMT_INDEX)
91#define G_L2C_MGMT_INDEX(x)         _SB_GETVALUE(x,S_L2C_MGMT_INDEX,M_L2C_MGMT_INDEX)
92
93#define S_L2C_MGMT_QUADRANT         15
94#define M_L2C_MGMT_QUADRANT         _SB_MAKEMASK(2,S_L2C_MGMT_QUADRANT)
95#define V_L2C_MGMT_QUADRANT(x)      _SB_MAKEVALUE(x,S_L2C_MGMT_QUADRANT)
96#define G_L2C_MGMT_QUADRANT(x)      _SB_GETVALUE(x,S_L2C_MGMT_QUADRANT,M_L2C_MGMT_QUADRANT)
97
98#define S_L2C_MGMT_HALF		    16
99#define M_L2C_MGMT_HALF	            _SB_MAKEMASK(1,S_L2C_MGMT_HALF)
100
101#define S_L2C_MGMT_WAY              17
102#define M_L2C_MGMT_WAY              _SB_MAKEMASK(2,S_L2C_MGMT_WAY)
103#define V_L2C_MGMT_WAY(x)           _SB_MAKEVALUE(x,S_L2C_MGMT_WAY)
104#define G_L2C_MGMT_WAY(x)           _SB_GETVALUE(x,S_L2C_MGMT_WAY,M_L2C_MGMT_WAY)
105
106#define S_L2C_MGMT_ECC_DIAG         21
107#define M_L2C_MGMT_ECC_DIAG         _SB_MAKEMASK(2,S_L2C_MGMT_ECC_DIAG)
108#define V_L2C_MGMT_ECC_DIAG(x)      _SB_MAKEVALUE(x,S_L2C_MGMT_ECC_DIAG)
109#define G_L2C_MGMT_ECC_DIAG(x)      _SB_GETVALUE(x,S_L2C_MGMT_ECC_DIAG,M_L2C_MGMT_ECC_DIAG)
110
111#define S_L2C_MGMT_TAG              23
112#define M_L2C_MGMT_TAG              _SB_MAKEMASK(4,S_L2C_MGMT_TAG)
113#define V_L2C_MGMT_TAG(x)           _SB_MAKEVALUE(x,S_L2C_MGMT_TAG)
114#define G_L2C_MGMT_TAG(x)           _SB_GETVALUE(x,S_L2C_MGMT_TAG,M_L2C_MGMT_TAG)
115
116#define M_L2C_MGMT_DIRTY            _SB_MAKEMASK1(19)
117#define M_L2C_MGMT_VALID            _SB_MAKEMASK1(20)
118
119#define A_L2C_MGMT_TAG_BASE         0x00D0000000
120
121#define L2C_ENTRIES_PER_WAY       4096
122#define L2C_NUM_WAYS              4
123
124
125#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
126/*
127 * L2 Read Misc. register (A_L2_READ_MISC)
128 */
129#define S_L2C_MISC_NO_WAY		10
130#define M_L2C_MISC_NO_WAY		_SB_MAKEMASK(4,S_L2C_MISC_NO_WAY)
131#define V_L2C_MISC_NO_WAY(x)		_SB_MAKEVALUE(x,S_L2C_MISC_NO_WAY)
132#define G_L2C_MISC_NO_WAY(x)		_SB_GETVALUE(x,S_L2C_MISC_NO_WAY,M_L2C_MISC_NO_WAY)
133
134#define M_L2C_MISC_ECC_CLEANUP_DIS	_SB_MAKEMASK1(9)
135#define M_L2C_MISC_MC_PRIO_LOW		_SB_MAKEMASK1(8)
136#define M_L2C_MISC_SOFT_DISABLE_T	_SB_MAKEMASK1(7)
137#define M_L2C_MISC_SOFT_DISABLE_B	_SB_MAKEMASK1(6)
138#define M_L2C_MISC_SOFT_DISABLE_R	_SB_MAKEMASK1(5)
139#define M_L2C_MISC_SOFT_DISABLE_L	_SB_MAKEMASK1(4)
140#define M_L2C_MISC_SCACHE_DISABLE_T	_SB_MAKEMASK1(3)
141#define M_L2C_MISC_SCACHE_DISABLE_B	_SB_MAKEMASK1(2)
142#define M_L2C_MISC_SCACHE_DISABLE_R	_SB_MAKEMASK1(1)
143#define M_L2C_MISC_SCACHE_DISABLE_L	_SB_MAKEMASK1(0)
144#endif /* 1250 PASS3 || 112x PASS1 */
145
146
147#endif
148