18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* ********************************************************************* 38c2ecf20Sopenharmony_ci * BCM1280/BCM1480 Board Support Package 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * L2 Cache constants and macros File: bcm1480_l2c.h 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * This module contains constants useful for manipulating the 88c2ecf20Sopenharmony_ci * level 2 cache. 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * BCM1400 specification level: 1280-UM100-D2 (11/14/03) 118c2ecf20Sopenharmony_ci * 128c2ecf20Sopenharmony_ci ********************************************************************* 138c2ecf20Sopenharmony_ci * 148c2ecf20Sopenharmony_ci * Copyright 2000,2001,2002,2003 158c2ecf20Sopenharmony_ci * Broadcom Corporation. All rights reserved. 168c2ecf20Sopenharmony_ci * 178c2ecf20Sopenharmony_ci ********************************************************************* */ 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#ifndef _BCM1480_L2C_H 218c2ecf20Sopenharmony_ci#define _BCM1480_L2C_H 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#include <asm/sibyte/sb1250_defs.h> 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci/* 268c2ecf20Sopenharmony_ci * Format of level 2 cache management address (Table 55) 278c2ecf20Sopenharmony_ci */ 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MGMT_INDEX 5 308c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MGMT_INDEX _SB_MAKEMASK(12, S_BCM1480_L2C_MGMT_INDEX) 318c2ecf20Sopenharmony_ci#define V_BCM1480_L2C_MGMT_INDEX(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_INDEX) 328c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_MGMT_INDEX(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_INDEX, M_BCM1480_L2C_MGMT_INDEX) 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MGMT_WAY 17 358c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MGMT_WAY _SB_MAKEMASK(3, S_BCM1480_L2C_MGMT_WAY) 368c2ecf20Sopenharmony_ci#define V_BCM1480_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_WAY) 378c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_MGMT_WAY(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_WAY, M_BCM1480_L2C_MGMT_WAY) 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MGMT_DIRTY _SB_MAKEMASK1(20) 408c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MGMT_VALID _SB_MAKEMASK1(21) 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MGMT_ECC_DIAG 22 438c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MGMT_ECC_DIAG _SB_MAKEMASK(2, S_BCM1480_L2C_MGMT_ECC_DIAG) 448c2ecf20Sopenharmony_ci#define V_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_ECC_DIAG) 458c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_ECC_DIAG, M_BCM1480_L2C_MGMT_ECC_DIAG) 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci#define A_BCM1480_L2C_MGMT_TAG_BASE 0x00D0000000 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci#define BCM1480_L2C_ENTRIES_PER_WAY 4096 508c2ecf20Sopenharmony_ci#define BCM1480_L2C_NUM_WAYS 8 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci/* 548c2ecf20Sopenharmony_ci * Level 2 Cache Tag register (Table 59) 558c2ecf20Sopenharmony_ci */ 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_TAG_MBZ 0 588c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_TAG_MBZ _SB_MAKEMASK(5, S_BCM1480_L2C_TAG_MBZ) 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_TAG_INDEX 5 618c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_TAG_INDEX _SB_MAKEMASK(12, S_BCM1480_L2C_TAG_INDEX) 628c2ecf20Sopenharmony_ci#define V_BCM1480_L2C_TAG_INDEX(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_INDEX) 638c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_TAG_INDEX(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_INDEX, M_BCM1480_L2C_TAG_INDEX) 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci/* Note that index bit 16 is also tag bit 40 */ 668c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_TAG_TAG 17 678c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_TAG_TAG _SB_MAKEMASK(23, S_BCM1480_L2C_TAG_TAG) 688c2ecf20Sopenharmony_ci#define V_BCM1480_L2C_TAG_TAG(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_TAG) 698c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_TAG_TAG(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_TAG, M_BCM1480_L2C_TAG_TAG) 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_TAG_ECC 40 728c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_TAG_ECC _SB_MAKEMASK(6, S_BCM1480_L2C_TAG_ECC) 738c2ecf20Sopenharmony_ci#define V_BCM1480_L2C_TAG_ECC(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_ECC) 748c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_TAG_ECC(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_ECC, M_BCM1480_L2C_TAG_ECC) 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_TAG_WAY 46 778c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_TAG_WAY _SB_MAKEMASK(3, S_BCM1480_L2C_TAG_WAY) 788c2ecf20Sopenharmony_ci#define V_BCM1480_L2C_TAG_WAY(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_WAY) 798c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_TAG_WAY(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_WAY, M_BCM1480_L2C_TAG_WAY) 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_TAG_DIRTY _SB_MAKEMASK1(49) 828c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_TAG_VALID _SB_MAKEMASK1(50) 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_DATA_ECC 51 858c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_DATA_ECC _SB_MAKEMASK(10, S_BCM1480_L2C_DATA_ECC) 868c2ecf20Sopenharmony_ci#define V_BCM1480_L2C_DATA_ECC(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_DATA_ECC) 878c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_DATA_ECC(x) _SB_GETVALUE(x, S_BCM1480_L2C_DATA_ECC, M_BCM1480_L2C_DATA_ECC) 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci/* 918c2ecf20Sopenharmony_ci * L2 Misc0 Value Register (Table 60) 928c2ecf20Sopenharmony_ci */ 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC0_WAY_REMOTE 0 958c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC0_WAY_REMOTE _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_REMOTE) 968c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_MISC0_WAY_REMOTE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_REMOTE, M_BCM1480_L2C_MISC0_WAY_REMOTE) 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC0_WAY_LOCAL 8 998c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC0_WAY_LOCAL _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_LOCAL) 1008c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_MISC0_WAY_LOCAL(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_LOCAL, M_BCM1480_L2C_MISC0_WAY_LOCAL) 1018c2ecf20Sopenharmony_ci 1028c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC0_WAY_ENABLE 16 1038c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC0_WAY_ENABLE _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_ENABLE) 1048c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_MISC0_WAY_ENABLE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_ENABLE, M_BCM1480_L2C_MISC0_WAY_ENABLE) 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC0_CACHE_DISABLE 24 1078c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC0_CACHE_DISABLE _SB_MAKEMASK(2, S_BCM1480_L2C_MISC0_CACHE_DISABLE) 1088c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_MISC0_CACHE_DISABLE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_CACHE_DISABLE, M_BCM1480_L2C_MISC0_CACHE_DISABLE) 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC0_CACHE_QUAD 26 1118c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC0_CACHE_QUAD _SB_MAKEMASK(2, S_BCM1480_L2C_MISC0_CACHE_QUAD) 1128c2ecf20Sopenharmony_ci#define G_BCM1480_L2C_MISC0_CACHE_QUAD(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_CACHE_QUAD, M_BCM1480_L2C_MISC0_CACHE_QUAD) 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC0_MC_PRIORITY 30 1158c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC0_MC_PRIORITY _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_MC_PRIORITY) 1168c2ecf20Sopenharmony_ci 1178c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC0_ECC_CLEANUP 31 1188c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC0_ECC_CLEANUP _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_ECC_CLEANUP) 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci/* 1228c2ecf20Sopenharmony_ci * L2 Misc1 Value Register (Table 60) 1238c2ecf20Sopenharmony_ci */ 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC1_WAY_AGENT_0 0 1268c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC1_WAY_AGENT_0 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_0) 1278c2ecf20Sopenharmony_ci#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) 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC1_WAY_AGENT_1 8 1308c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC1_WAY_AGENT_1 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_1) 1318c2ecf20Sopenharmony_ci#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) 1328c2ecf20Sopenharmony_ci 1338c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC1_WAY_AGENT_2 16 1348c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC1_WAY_AGENT_2 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_2) 1358c2ecf20Sopenharmony_ci#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) 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC1_WAY_AGENT_3 24 1388c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC1_WAY_AGENT_3 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_3) 1398c2ecf20Sopenharmony_ci#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) 1408c2ecf20Sopenharmony_ci 1418c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC1_WAY_AGENT_4 32 1428c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC1_WAY_AGENT_4 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_4) 1438c2ecf20Sopenharmony_ci#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) 1448c2ecf20Sopenharmony_ci 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_ci/* 1478c2ecf20Sopenharmony_ci * L2 Misc2 Value Register (Table 60) 1488c2ecf20Sopenharmony_ci */ 1498c2ecf20Sopenharmony_ci 1508c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC2_WAY_AGENT_8 0 1518c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC2_WAY_AGENT_8 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_8) 1528c2ecf20Sopenharmony_ci#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) 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC2_WAY_AGENT_9 8 1558c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC2_WAY_AGENT_9 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_9) 1568c2ecf20Sopenharmony_ci#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) 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_ci#define S_BCM1480_L2C_MISC2_WAY_AGENT_A 16 1598c2ecf20Sopenharmony_ci#define M_BCM1480_L2C_MISC2_WAY_AGENT_A _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_A) 1608c2ecf20Sopenharmony_ci#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) 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_ci 1638c2ecf20Sopenharmony_ci#endif /* _BCM1480_L2C_H */ 164