sb1250_l2c.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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
  14. * Broadcom Corporation. All rights reserved.
  15. *
  16. * This program is free software; you can redistribute it and/or
  17. * modify it under the terms of the GNU General Public License as
  18. * published by the Free Software Foundation; either version 2 of
  19. * the License, or (at your option) any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this program; if not, write to the Free Software
  28. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  29. * MA 02111-1307 USA
  30. ********************************************************************* */
  31. #ifndef _SB1250_L2C_H
  32. #define _SB1250_L2C_H
  33. #include <asm/sibyte/sb1250_defs.h>
  34. /*
  35. * Level 2 Cache Tag register (Table 5-3)
  36. */
  37. #define S_L2C_TAG_MBZ 0
  38. #define M_L2C_TAG_MBZ _SB_MAKEMASK(5, S_L2C_TAG_MBZ)
  39. #define S_L2C_TAG_INDEX 5
  40. #define M_L2C_TAG_INDEX _SB_MAKEMASK(12, S_L2C_TAG_INDEX)
  41. #define V_L2C_TAG_INDEX(x) _SB_MAKEVALUE(x, S_L2C_TAG_INDEX)
  42. #define G_L2C_TAG_INDEX(x) _SB_GETVALUE(x, S_L2C_TAG_INDEX, M_L2C_TAG_INDEX)
  43. #define S_L2C_TAG_TAG 17
  44. #define M_L2C_TAG_TAG _SB_MAKEMASK(23, S_L2C_TAG_TAG)
  45. #define V_L2C_TAG_TAG(x) _SB_MAKEVALUE(x, S_L2C_TAG_TAG)
  46. #define G_L2C_TAG_TAG(x) _SB_GETVALUE(x, S_L2C_TAG_TAG, M_L2C_TAG_TAG)
  47. #define S_L2C_TAG_ECC 40
  48. #define M_L2C_TAG_ECC _SB_MAKEMASK(6, S_L2C_TAG_ECC)
  49. #define V_L2C_TAG_ECC(x) _SB_MAKEVALUE(x, S_L2C_TAG_ECC)
  50. #define G_L2C_TAG_ECC(x) _SB_GETVALUE(x, S_L2C_TAG_ECC, M_L2C_TAG_ECC)
  51. #define S_L2C_TAG_WAY 46
  52. #define M_L2C_TAG_WAY _SB_MAKEMASK(2, S_L2C_TAG_WAY)
  53. #define V_L2C_TAG_WAY(x) _SB_MAKEVALUE(x, S_L2C_TAG_WAY)
  54. #define G_L2C_TAG_WAY(x) _SB_GETVALUE(x, S_L2C_TAG_WAY, M_L2C_TAG_WAY)
  55. #define M_L2C_TAG_DIRTY _SB_MAKEMASK1(48)
  56. #define M_L2C_TAG_VALID _SB_MAKEMASK1(49)
  57. /*
  58. * Format of level 2 cache management address (table 5-2)
  59. */
  60. #define S_L2C_MGMT_INDEX 5
  61. #define M_L2C_MGMT_INDEX _SB_MAKEMASK(12, S_L2C_MGMT_INDEX)
  62. #define V_L2C_MGMT_INDEX(x) _SB_MAKEVALUE(x, S_L2C_MGMT_INDEX)
  63. #define G_L2C_MGMT_INDEX(x) _SB_GETVALUE(x, S_L2C_MGMT_INDEX, M_L2C_MGMT_INDEX)
  64. #define S_L2C_MGMT_QUADRANT 15
  65. #define M_L2C_MGMT_QUADRANT _SB_MAKEMASK(2, S_L2C_MGMT_QUADRANT)
  66. #define V_L2C_MGMT_QUADRANT(x) _SB_MAKEVALUE(x, S_L2C_MGMT_QUADRANT)
  67. #define G_L2C_MGMT_QUADRANT(x) _SB_GETVALUE(x, S_L2C_MGMT_QUADRANT, M_L2C_MGMT_QUADRANT)
  68. #define S_L2C_MGMT_HALF 16
  69. #define M_L2C_MGMT_HALF _SB_MAKEMASK(1, S_L2C_MGMT_HALF)
  70. #define S_L2C_MGMT_WAY 17
  71. #define M_L2C_MGMT_WAY _SB_MAKEMASK(2, S_L2C_MGMT_WAY)
  72. #define V_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x, S_L2C_MGMT_WAY)
  73. #define G_L2C_MGMT_WAY(x) _SB_GETVALUE(x, S_L2C_MGMT_WAY, M_L2C_MGMT_WAY)
  74. #define S_L2C_MGMT_ECC_DIAG 21
  75. #define M_L2C_MGMT_ECC_DIAG _SB_MAKEMASK(2, S_L2C_MGMT_ECC_DIAG)
  76. #define V_L2C_MGMT_ECC_DIAG(x) _SB_MAKEVALUE(x, S_L2C_MGMT_ECC_DIAG)
  77. #define G_L2C_MGMT_ECC_DIAG(x) _SB_GETVALUE(x, S_L2C_MGMT_ECC_DIAG, M_L2C_MGMT_ECC_DIAG)
  78. #define S_L2C_MGMT_TAG 23
  79. #define M_L2C_MGMT_TAG _SB_MAKEMASK(4, S_L2C_MGMT_TAG)
  80. #define V_L2C_MGMT_TAG(x) _SB_MAKEVALUE(x, S_L2C_MGMT_TAG)
  81. #define G_L2C_MGMT_TAG(x) _SB_GETVALUE(x, S_L2C_MGMT_TAG, M_L2C_MGMT_TAG)
  82. #define M_L2C_MGMT_DIRTY _SB_MAKEMASK1(19)
  83. #define M_L2C_MGMT_VALID _SB_MAKEMASK1(20)
  84. #define A_L2C_MGMT_TAG_BASE 0x00D0000000
  85. #define L2C_ENTRIES_PER_WAY 4096
  86. #define L2C_NUM_WAYS 4
  87. #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
  88. /*
  89. * L2 Read Misc. register (A_L2_READ_MISC)
  90. */
  91. #define S_L2C_MISC_NO_WAY 10
  92. #define M_L2C_MISC_NO_WAY _SB_MAKEMASK(4, S_L2C_MISC_NO_WAY)
  93. #define V_L2C_MISC_NO_WAY(x) _SB_MAKEVALUE(x, S_L2C_MISC_NO_WAY)
  94. #define G_L2C_MISC_NO_WAY(x) _SB_GETVALUE(x, S_L2C_MISC_NO_WAY, M_L2C_MISC_NO_WAY)
  95. #define M_L2C_MISC_ECC_CLEANUP_DIS _SB_MAKEMASK1(9)
  96. #define M_L2C_MISC_MC_PRIO_LOW _SB_MAKEMASK1(8)
  97. #define M_L2C_MISC_SOFT_DISABLE_T _SB_MAKEMASK1(7)
  98. #define M_L2C_MISC_SOFT_DISABLE_B _SB_MAKEMASK1(6)
  99. #define M_L2C_MISC_SOFT_DISABLE_R _SB_MAKEMASK1(5)
  100. #define M_L2C_MISC_SOFT_DISABLE_L _SB_MAKEMASK1(4)
  101. #define M_L2C_MISC_SCACHE_DISABLE_T _SB_MAKEMASK1(3)
  102. #define M_L2C_MISC_SCACHE_DISABLE_B _SB_MAKEMASK1(2)
  103. #define M_L2C_MISC_SCACHE_DISABLE_R _SB_MAKEMASK1(1)
  104. #define M_L2C_MISC_SCACHE_DISABLE_L _SB_MAKEMASK1(0)
  105. #endif /* 1250 PASS3 || 112x PASS1 */
  106. #endif