1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */ 2*4882a593Smuzhiyun /* ********************************************************************* 3*4882a593Smuzhiyun * BCM1280/BCM1480 Board Support Package 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * L2 Cache constants and macros File: bcm1480_l2c.h 6*4882a593Smuzhiyun * 7*4882a593Smuzhiyun * This module contains constants useful for manipulating the 8*4882a593Smuzhiyun * level 2 cache. 9*4882a593Smuzhiyun * 10*4882a593Smuzhiyun * BCM1400 specification level: 1280-UM100-D2 (11/14/03) 11*4882a593Smuzhiyun * 12*4882a593Smuzhiyun ********************************************************************* 13*4882a593Smuzhiyun * 14*4882a593Smuzhiyun * Copyright 2000,2001,2002,2003 15*4882a593Smuzhiyun * Broadcom Corporation. All rights reserved. 16*4882a593Smuzhiyun * 17*4882a593Smuzhiyun ********************************************************************* */ 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun 20*4882a593Smuzhiyun #ifndef _BCM1480_L2C_H 21*4882a593Smuzhiyun #define _BCM1480_L2C_H 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun #include <asm/sibyte/sb1250_defs.h> 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun /* 26*4882a593Smuzhiyun * Format of level 2 cache management address (Table 55) 27*4882a593Smuzhiyun */ 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun #define S_BCM1480_L2C_MGMT_INDEX 5 30*4882a593Smuzhiyun #define M_BCM1480_L2C_MGMT_INDEX _SB_MAKEMASK(12, S_BCM1480_L2C_MGMT_INDEX) 31*4882a593Smuzhiyun #define V_BCM1480_L2C_MGMT_INDEX(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_INDEX) 32*4882a593Smuzhiyun #define G_BCM1480_L2C_MGMT_INDEX(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_INDEX, M_BCM1480_L2C_MGMT_INDEX) 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun #define S_BCM1480_L2C_MGMT_WAY 17 35*4882a593Smuzhiyun #define M_BCM1480_L2C_MGMT_WAY _SB_MAKEMASK(3, S_BCM1480_L2C_MGMT_WAY) 36*4882a593Smuzhiyun #define V_BCM1480_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_WAY) 37*4882a593Smuzhiyun #define G_BCM1480_L2C_MGMT_WAY(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_WAY, M_BCM1480_L2C_MGMT_WAY) 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun #define M_BCM1480_L2C_MGMT_DIRTY _SB_MAKEMASK1(20) 40*4882a593Smuzhiyun #define M_BCM1480_L2C_MGMT_VALID _SB_MAKEMASK1(21) 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun #define S_BCM1480_L2C_MGMT_ECC_DIAG 22 43*4882a593Smuzhiyun #define M_BCM1480_L2C_MGMT_ECC_DIAG _SB_MAKEMASK(2, S_BCM1480_L2C_MGMT_ECC_DIAG) 44*4882a593Smuzhiyun #define V_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_ECC_DIAG) 45*4882a593Smuzhiyun #define G_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_ECC_DIAG, M_BCM1480_L2C_MGMT_ECC_DIAG) 46*4882a593Smuzhiyun 47*4882a593Smuzhiyun #define A_BCM1480_L2C_MGMT_TAG_BASE 0x00D0000000 48*4882a593Smuzhiyun 49*4882a593Smuzhiyun #define BCM1480_L2C_ENTRIES_PER_WAY 4096 50*4882a593Smuzhiyun #define BCM1480_L2C_NUM_WAYS 8 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun 53*4882a593Smuzhiyun /* 54*4882a593Smuzhiyun * Level 2 Cache Tag register (Table 59) 55*4882a593Smuzhiyun */ 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun #define S_BCM1480_L2C_TAG_MBZ 0 58*4882a593Smuzhiyun #define M_BCM1480_L2C_TAG_MBZ _SB_MAKEMASK(5, S_BCM1480_L2C_TAG_MBZ) 59*4882a593Smuzhiyun 60*4882a593Smuzhiyun #define S_BCM1480_L2C_TAG_INDEX 5 61*4882a593Smuzhiyun #define M_BCM1480_L2C_TAG_INDEX _SB_MAKEMASK(12, S_BCM1480_L2C_TAG_INDEX) 62*4882a593Smuzhiyun #define V_BCM1480_L2C_TAG_INDEX(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_INDEX) 63*4882a593Smuzhiyun #define G_BCM1480_L2C_TAG_INDEX(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_INDEX, M_BCM1480_L2C_TAG_INDEX) 64*4882a593Smuzhiyun 65*4882a593Smuzhiyun /* Note that index bit 16 is also tag bit 40 */ 66*4882a593Smuzhiyun #define S_BCM1480_L2C_TAG_TAG 17 67*4882a593Smuzhiyun #define M_BCM1480_L2C_TAG_TAG _SB_MAKEMASK(23, S_BCM1480_L2C_TAG_TAG) 68*4882a593Smuzhiyun #define V_BCM1480_L2C_TAG_TAG(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_TAG) 69*4882a593Smuzhiyun #define G_BCM1480_L2C_TAG_TAG(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_TAG, M_BCM1480_L2C_TAG_TAG) 70*4882a593Smuzhiyun 71*4882a593Smuzhiyun #define S_BCM1480_L2C_TAG_ECC 40 72*4882a593Smuzhiyun #define M_BCM1480_L2C_TAG_ECC _SB_MAKEMASK(6, S_BCM1480_L2C_TAG_ECC) 73*4882a593Smuzhiyun #define V_BCM1480_L2C_TAG_ECC(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_ECC) 74*4882a593Smuzhiyun #define G_BCM1480_L2C_TAG_ECC(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_ECC, M_BCM1480_L2C_TAG_ECC) 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun #define S_BCM1480_L2C_TAG_WAY 46 77*4882a593Smuzhiyun #define M_BCM1480_L2C_TAG_WAY _SB_MAKEMASK(3, S_BCM1480_L2C_TAG_WAY) 78*4882a593Smuzhiyun #define V_BCM1480_L2C_TAG_WAY(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_WAY) 79*4882a593Smuzhiyun #define G_BCM1480_L2C_TAG_WAY(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_WAY, M_BCM1480_L2C_TAG_WAY) 80*4882a593Smuzhiyun 81*4882a593Smuzhiyun #define M_BCM1480_L2C_TAG_DIRTY _SB_MAKEMASK1(49) 82*4882a593Smuzhiyun #define M_BCM1480_L2C_TAG_VALID _SB_MAKEMASK1(50) 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun #define S_BCM1480_L2C_DATA_ECC 51 85*4882a593Smuzhiyun #define M_BCM1480_L2C_DATA_ECC _SB_MAKEMASK(10, S_BCM1480_L2C_DATA_ECC) 86*4882a593Smuzhiyun #define V_BCM1480_L2C_DATA_ECC(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_DATA_ECC) 87*4882a593Smuzhiyun #define G_BCM1480_L2C_DATA_ECC(x) _SB_GETVALUE(x, S_BCM1480_L2C_DATA_ECC, M_BCM1480_L2C_DATA_ECC) 88*4882a593Smuzhiyun 89*4882a593Smuzhiyun 90*4882a593Smuzhiyun /* 91*4882a593Smuzhiyun * L2 Misc0 Value Register (Table 60) 92*4882a593Smuzhiyun */ 93*4882a593Smuzhiyun 94*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC0_WAY_REMOTE 0 95*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC0_WAY_REMOTE _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_REMOTE) 96*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC0_WAY_REMOTE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_REMOTE, M_BCM1480_L2C_MISC0_WAY_REMOTE) 97*4882a593Smuzhiyun 98*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC0_WAY_LOCAL 8 99*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC0_WAY_LOCAL _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_LOCAL) 100*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC0_WAY_LOCAL(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_LOCAL, M_BCM1480_L2C_MISC0_WAY_LOCAL) 101*4882a593Smuzhiyun 102*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC0_WAY_ENABLE 16 103*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC0_WAY_ENABLE _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_ENABLE) 104*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC0_WAY_ENABLE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_ENABLE, M_BCM1480_L2C_MISC0_WAY_ENABLE) 105*4882a593Smuzhiyun 106*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC0_CACHE_DISABLE 24 107*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC0_CACHE_DISABLE _SB_MAKEMASK(2, S_BCM1480_L2C_MISC0_CACHE_DISABLE) 108*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC0_CACHE_DISABLE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_CACHE_DISABLE, M_BCM1480_L2C_MISC0_CACHE_DISABLE) 109*4882a593Smuzhiyun 110*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC0_CACHE_QUAD 26 111*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC0_CACHE_QUAD _SB_MAKEMASK(2, S_BCM1480_L2C_MISC0_CACHE_QUAD) 112*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC0_CACHE_QUAD(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_CACHE_QUAD, M_BCM1480_L2C_MISC0_CACHE_QUAD) 113*4882a593Smuzhiyun 114*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC0_MC_PRIORITY 30 115*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC0_MC_PRIORITY _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_MC_PRIORITY) 116*4882a593Smuzhiyun 117*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC0_ECC_CLEANUP 31 118*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC0_ECC_CLEANUP _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_ECC_CLEANUP) 119*4882a593Smuzhiyun 120*4882a593Smuzhiyun 121*4882a593Smuzhiyun /* 122*4882a593Smuzhiyun * L2 Misc1 Value Register (Table 60) 123*4882a593Smuzhiyun */ 124*4882a593Smuzhiyun 125*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC1_WAY_AGENT_0 0 126*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC1_WAY_AGENT_0 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_0) 127*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC1_WAY_AGENT_0(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_0, M_BCM1480_L2C_MISC1_WAY_AGENT_0) 128*4882a593Smuzhiyun 129*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC1_WAY_AGENT_1 8 130*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC1_WAY_AGENT_1 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_1) 131*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC1_WAY_AGENT_1(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_1, M_BCM1480_L2C_MISC1_WAY_AGENT_1) 132*4882a593Smuzhiyun 133*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC1_WAY_AGENT_2 16 134*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC1_WAY_AGENT_2 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_2) 135*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC1_WAY_AGENT_2(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_2, M_BCM1480_L2C_MISC1_WAY_AGENT_2) 136*4882a593Smuzhiyun 137*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC1_WAY_AGENT_3 24 138*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC1_WAY_AGENT_3 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_3) 139*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC1_WAY_AGENT_3(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_3, M_BCM1480_L2C_MISC1_WAY_AGENT_3) 140*4882a593Smuzhiyun 141*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC1_WAY_AGENT_4 32 142*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC1_WAY_AGENT_4 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_4) 143*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC1_WAY_AGENT_4(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_4, M_BCM1480_L2C_MISC1_WAY_AGENT_4) 144*4882a593Smuzhiyun 145*4882a593Smuzhiyun 146*4882a593Smuzhiyun /* 147*4882a593Smuzhiyun * L2 Misc2 Value Register (Table 60) 148*4882a593Smuzhiyun */ 149*4882a593Smuzhiyun 150*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC2_WAY_AGENT_8 0 151*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC2_WAY_AGENT_8 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_8) 152*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC2_WAY_AGENT_8(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC2_WAY_AGENT_8, M_BCM1480_L2C_MISC2_WAY_AGENT_8) 153*4882a593Smuzhiyun 154*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC2_WAY_AGENT_9 8 155*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC2_WAY_AGENT_9 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_9) 156*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC2_WAY_AGENT_9(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC2_WAY_AGENT_9, M_BCM1480_L2C_MISC2_WAY_AGENT_9) 157*4882a593Smuzhiyun 158*4882a593Smuzhiyun #define S_BCM1480_L2C_MISC2_WAY_AGENT_A 16 159*4882a593Smuzhiyun #define M_BCM1480_L2C_MISC2_WAY_AGENT_A _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_A) 160*4882a593Smuzhiyun #define G_BCM1480_L2C_MISC2_WAY_AGENT_A(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC2_WAY_AGENT_A, M_BCM1480_L2C_MISC2_WAY_AGENT_A) 161*4882a593Smuzhiyun 162*4882a593Smuzhiyun 163*4882a593Smuzhiyun #endif /* _BCM1480_L2C_H */ 164