bcm1480_scd.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. /* *********************************************************************
  2. * BCM1280/BCM1400 Board Support Package
  3. *
  4. * SCD Constants and Macros File: bcm1480_scd.h
  5. *
  6. * This module contains constants and macros useful for
  7. * manipulating the System Control and Debug module.
  8. *
  9. * BCM1400 specification level: 1X55_1X80-UM100-R (12/18/03)
  10. *
  11. *********************************************************************
  12. *
  13. * Copyright 2000,2001,2002,2003,2004,2005
  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 _BCM1480_SCD_H
  32. #define _BCM1480_SCD_H
  33. #include <asm/sibyte/sb1250_defs.h>
  34. /* *********************************************************************
  35. * Pull in the BCM1250's SCD since lots of stuff is the same.
  36. ********************************************************************* */
  37. #include <asm/sibyte/sb1250_scd.h>
  38. /* *********************************************************************
  39. * Some general notes:
  40. *
  41. * This file is basically a "what's new" header file. Since the
  42. * BCM1250 and the new BCM1480 (and derivatives) share many common
  43. * features, this file contains only what's new or changed from
  44. * the 1250. (above, you can see that we include the 1250 symbols
  45. * to get the base functionality).
  46. *
  47. * In software, be sure to use the correct symbols, particularly
  48. * for blocks that are different between the two chip families.
  49. * All BCM1480-specific symbols have _BCM1480_ in their names,
  50. * and all BCM1250-specific and "base" functions that are common in
  51. * both chips have no special names (this is for compatibility with
  52. * older include files). Therefore, if you're working with the
  53. * SCD, which is very different on each chip, A_SCD_xxx implies
  54. * the BCM1250 version and A_BCM1480_SCD_xxx implies the BCM1480
  55. * version.
  56. ********************************************************************* */
  57. /* *********************************************************************
  58. * System control/debug registers
  59. ********************************************************************* */
  60. /*
  61. * System Identification and Revision Register (Table 12)
  62. * Register: SCD_SYSTEM_REVISION
  63. * This register is field compatible with the 1250.
  64. */
  65. /*
  66. * New part definitions
  67. */
  68. #define K_SYS_PART_BCM1480 0x1406
  69. #define K_SYS_PART_BCM1280 0x1206
  70. #define K_SYS_PART_BCM1455 0x1407
  71. #define K_SYS_PART_BCM1255 0x1257
  72. #define K_SYS_PART_BCM1158 0x1156
  73. /*
  74. * Manufacturing Information Register (Table 14)
  75. * Register: SCD_SYSTEM_MANUF
  76. */
  77. /*
  78. * System Configuration Register (Table 15)
  79. * Register: SCD_SYSTEM_CFG
  80. * Entire register is different from 1250, all new constants below
  81. */
  82. #define M_BCM1480_SYS_RESERVED0 _SB_MAKEMASK1(0)
  83. #define M_BCM1480_SYS_HT_MINRSTCNT _SB_MAKEMASK1(1)
  84. #define M_BCM1480_SYS_RESERVED2 _SB_MAKEMASK1(2)
  85. #define M_BCM1480_SYS_RESERVED3 _SB_MAKEMASK1(3)
  86. #define M_BCM1480_SYS_RESERVED4 _SB_MAKEMASK1(4)
  87. #define M_BCM1480_SYS_IOB_DIV _SB_MAKEMASK1(5)
  88. #define S_BCM1480_SYS_PLL_DIV _SB_MAKE64(6)
  89. #define M_BCM1480_SYS_PLL_DIV _SB_MAKEMASK(5, S_BCM1480_SYS_PLL_DIV)
  90. #define V_BCM1480_SYS_PLL_DIV(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_PLL_DIV)
  91. #define G_BCM1480_SYS_PLL_DIV(x) _SB_GETVALUE(x, S_BCM1480_SYS_PLL_DIV, M_BCM1480_SYS_PLL_DIV)
  92. #define S_BCM1480_SYS_SW_DIV _SB_MAKE64(11)
  93. #define M_BCM1480_SYS_SW_DIV _SB_MAKEMASK(5, S_BCM1480_SYS_SW_DIV)
  94. #define V_BCM1480_SYS_SW_DIV(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_SW_DIV)
  95. #define G_BCM1480_SYS_SW_DIV(x) _SB_GETVALUE(x, S_BCM1480_SYS_SW_DIV, M_BCM1480_SYS_SW_DIV)
  96. #define M_BCM1480_SYS_PCMCIA_ENABLE _SB_MAKEMASK1(16)
  97. #define M_BCM1480_SYS_DUART1_ENABLE _SB_MAKEMASK1(17)
  98. #define S_BCM1480_SYS_BOOT_MODE _SB_MAKE64(18)
  99. #define M_BCM1480_SYS_BOOT_MODE _SB_MAKEMASK(2, S_BCM1480_SYS_BOOT_MODE)
  100. #define V_BCM1480_SYS_BOOT_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_BOOT_MODE)
  101. #define G_BCM1480_SYS_BOOT_MODE(x) _SB_GETVALUE(x, S_BCM1480_SYS_BOOT_MODE, M_BCM1480_SYS_BOOT_MODE)
  102. #define K_BCM1480_SYS_BOOT_MODE_ROM32 0
  103. #define K_BCM1480_SYS_BOOT_MODE_ROM8 1
  104. #define K_BCM1480_SYS_BOOT_MODE_SMBUS_SMALL 2
  105. #define K_BCM1480_SYS_BOOT_MODE_SMBUS_BIG 3
  106. #define M_BCM1480_SYS_BOOT_MODE_SMBUS _SB_MAKEMASK1(19)
  107. #define M_BCM1480_SYS_PCI_HOST _SB_MAKEMASK1(20)
  108. #define M_BCM1480_SYS_PCI_ARBITER _SB_MAKEMASK1(21)
  109. #define M_BCM1480_SYS_BIG_ENDIAN _SB_MAKEMASK1(22)
  110. #define M_BCM1480_SYS_GENCLK_EN _SB_MAKEMASK1(23)
  111. #define M_BCM1480_SYS_GEN_PARITY_EN _SB_MAKEMASK1(24)
  112. #define M_BCM1480_SYS_RESERVED25 _SB_MAKEMASK1(25)
  113. #define S_BCM1480_SYS_CONFIG 26
  114. #define M_BCM1480_SYS_CONFIG _SB_MAKEMASK(6, S_BCM1480_SYS_CONFIG)
  115. #define V_BCM1480_SYS_CONFIG(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_CONFIG)
  116. #define G_BCM1480_SYS_CONFIG(x) _SB_GETVALUE(x, S_BCM1480_SYS_CONFIG, M_BCM1480_SYS_CONFIG)
  117. #define M_BCM1480_SYS_RESERVED32 _SB_MAKEMASK(32, 15)
  118. #define S_BCM1480_SYS_NODEID 47
  119. #define M_BCM1480_SYS_NODEID _SB_MAKEMASK(4, S_BCM1480_SYS_NODEID)
  120. #define V_BCM1480_SYS_NODEID(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_NODEID)
  121. #define G_BCM1480_SYS_NODEID(x) _SB_GETVALUE(x, S_BCM1480_SYS_NODEID, M_BCM1480_SYS_NODEID)
  122. #define M_BCM1480_SYS_CCNUMA_EN _SB_MAKEMASK1(51)
  123. #define M_BCM1480_SYS_CPU_RESET_0 _SB_MAKEMASK1(52)
  124. #define M_BCM1480_SYS_CPU_RESET_1 _SB_MAKEMASK1(53)
  125. #define M_BCM1480_SYS_CPU_RESET_2 _SB_MAKEMASK1(54)
  126. #define M_BCM1480_SYS_CPU_RESET_3 _SB_MAKEMASK1(55)
  127. #define S_BCM1480_SYS_DISABLECPU0 56
  128. #define M_BCM1480_SYS_DISABLECPU0 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU0)
  129. #define S_BCM1480_SYS_DISABLECPU1 57
  130. #define M_BCM1480_SYS_DISABLECPU1 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU1)
  131. #define S_BCM1480_SYS_DISABLECPU2 58
  132. #define M_BCM1480_SYS_DISABLECPU2 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU2)
  133. #define S_BCM1480_SYS_DISABLECPU3 59
  134. #define M_BCM1480_SYS_DISABLECPU3 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU3)
  135. #define M_BCM1480_SYS_SB_SOFTRES _SB_MAKEMASK1(60)
  136. #define M_BCM1480_SYS_EXT_RESET _SB_MAKEMASK1(61)
  137. #define M_BCM1480_SYS_SYSTEM_RESET _SB_MAKEMASK1(62)
  138. #define M_BCM1480_SYS_SW_FLAG _SB_MAKEMASK1(63)
  139. /*
  140. * Scratch Register (Table 16)
  141. * Register: SCD_SYSTEM_SCRATCH
  142. * Same as BCM1250
  143. */
  144. /*
  145. * Mailbox Registers (Table 17)
  146. * Registers: SCD_MBOX_{0,1}_CPU_x
  147. * Same as BCM1250
  148. */
  149. /*
  150. * See bcm1480_int.h for interrupt mapper registers.
  151. */
  152. /*
  153. * Watchdog Timer Initial Count Registers (Table 23)
  154. * Registers: SCD_WDOG_INIT_CNT_x
  155. *
  156. * The watchdogs are almost the same as the 1250, except
  157. * the configuration register has more bits to control the
  158. * other CPUs.
  159. */
  160. /*
  161. * Watchdog Timer Configuration Registers (Table 25)
  162. * Registers: SCD_WDOG_CFG_x
  163. */
  164. #define M_BCM1480_SCD_WDOG_ENABLE _SB_MAKEMASK1(0)
  165. #define S_BCM1480_SCD_WDOG_RESET_TYPE 2
  166. #define M_BCM1480_SCD_WDOG_RESET_TYPE _SB_MAKEMASK(5, S_BCM1480_SCD_WDOG_RESET_TYPE)
  167. #define V_BCM1480_SCD_WDOG_RESET_TYPE(x) _SB_MAKEVALUE(x, S_BCM1480_SCD_WDOG_RESET_TYPE)
  168. #define G_BCM1480_SCD_WDOG_RESET_TYPE(x) _SB_GETVALUE(x, S_BCM1480_SCD_WDOG_RESET_TYPE, M_BCM1480_SCD_WDOG_RESET_TYPE)
  169. #define K_BCM1480_SCD_WDOG_RESET_FULL 0 /* actually, (x & 1) == 0 */
  170. #define K_BCM1480_SCD_WDOG_RESET_SOFT 1
  171. #define K_BCM1480_SCD_WDOG_RESET_CPU0 3
  172. #define K_BCM1480_SCD_WDOG_RESET_CPU1 5
  173. #define K_BCM1480_SCD_WDOG_RESET_CPU2 9
  174. #define K_BCM1480_SCD_WDOG_RESET_CPU3 17
  175. #define K_BCM1480_SCD_WDOG_RESET_ALL_CPUS 31
  176. #define M_BCM1480_SCD_WDOG_HAS_RESET _SB_MAKEMASK1(8)
  177. /*
  178. * General Timer Initial Count Registers (Table 26)
  179. * Registers: SCD_TIMER_INIT_x
  180. *
  181. * The timer registers are the same as the BCM1250
  182. */
  183. /*
  184. * ZBbus Count Register (Table 29)
  185. * Register: ZBBUS_CYCLE_COUNT
  186. *
  187. * Same as BCM1250
  188. */
  189. /*
  190. * ZBbus Compare Registers (Table 30)
  191. * Registers: ZBBUS_CYCLE_CPx
  192. *
  193. * Same as BCM1250
  194. */
  195. /*
  196. * System Performance Counter Configuration Register (Table 31)
  197. * Register: PERF_CNT_CFG_0
  198. *
  199. * SPC_CFG_SRC[0-3] is the same as the 1250.
  200. * SPC_CFG_SRC[4-7] only exist on the 1480
  201. * The clear/enable bits are in different locations on the 1250 and 1480.
  202. */
  203. #define S_SPC_CFG_SRC4 32
  204. #define M_SPC_CFG_SRC4 _SB_MAKEMASK(8, S_SPC_CFG_SRC4)
  205. #define V_SPC_CFG_SRC4(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC4)
  206. #define G_SPC_CFG_SRC4(x) _SB_GETVALUE(x, S_SPC_CFG_SRC4, M_SPC_CFG_SRC4)
  207. #define S_SPC_CFG_SRC5 40
  208. #define M_SPC_CFG_SRC5 _SB_MAKEMASK(8, S_SPC_CFG_SRC5)
  209. #define V_SPC_CFG_SRC5(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC5)
  210. #define G_SPC_CFG_SRC5(x) _SB_GETVALUE(x, S_SPC_CFG_SRC5, M_SPC_CFG_SRC5)
  211. #define S_SPC_CFG_SRC6 48
  212. #define M_SPC_CFG_SRC6 _SB_MAKEMASK(8, S_SPC_CFG_SRC6)
  213. #define V_SPC_CFG_SRC6(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC6)
  214. #define G_SPC_CFG_SRC6(x) _SB_GETVALUE(x, S_SPC_CFG_SRC6, M_SPC_CFG_SRC6)
  215. #define S_SPC_CFG_SRC7 56
  216. #define M_SPC_CFG_SRC7 _SB_MAKEMASK(8, S_SPC_CFG_SRC7)
  217. #define V_SPC_CFG_SRC7(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC7)
  218. #define G_SPC_CFG_SRC7(x) _SB_GETVALUE(x, S_SPC_CFG_SRC7, M_SPC_CFG_SRC7)
  219. /*
  220. * System Performance Counter Control Register (Table 32)
  221. * Register: PERF_CNT_CFG_1
  222. * BCM1480 specific
  223. */
  224. #define M_BCM1480_SPC_CFG_CLEAR _SB_MAKEMASK1(0)
  225. #define M_BCM1480_SPC_CFG_ENABLE _SB_MAKEMASK1(1)
  226. #if SIBYTE_HDR_FEATURE_CHIP(1480)
  227. #define M_SPC_CFG_CLEAR M_BCM1480_SPC_CFG_CLEAR
  228. #define M_SPC_CFG_ENABLE M_BCM1480_SPC_CFG_ENABLE
  229. #endif
  230. /*
  231. * System Performance Counters (Table 33)
  232. * Registers: PERF_CNT_x
  233. */
  234. #define S_BCM1480_SPC_CNT_COUNT 0
  235. #define M_BCM1480_SPC_CNT_COUNT _SB_MAKEMASK(40, S_BCM1480_SPC_CNT_COUNT)
  236. #define V_BCM1480_SPC_CNT_COUNT(x) _SB_MAKEVALUE(x, S_BCM1480_SPC_CNT_COUNT)
  237. #define G_BCM1480_SPC_CNT_COUNT(x) _SB_GETVALUE(x, S_BCM1480_SPC_CNT_COUNT, M_BCM1480_SPC_CNT_COUNT)
  238. #define M_BCM1480_SPC_CNT_OFLOW _SB_MAKEMASK1(40)
  239. /*
  240. * Bus Watcher Error Status Register (Tables 36, 37)
  241. * Registers: BUS_ERR_STATUS, BUS_ERR_STATUS_DEBUG
  242. * Same as BCM1250.
  243. */
  244. /*
  245. * Bus Watcher Error Data Registers (Table 38)
  246. * Registers: BUS_ERR_DATA_x
  247. * Same as BCM1250.
  248. */
  249. /*
  250. * Bus Watcher L2 ECC Counter Register (Table 39)
  251. * Register: BUS_L2_ERRORS
  252. * Same as BCM1250.
  253. */
  254. /*
  255. * Bus Watcher Memory and I/O Error Counter Register (Table 40)
  256. * Register: BUS_MEM_IO_ERRORS
  257. * Same as BCM1250.
  258. */
  259. /*
  260. * Address Trap Registers
  261. *
  262. * Register layout same as BCM1250, almost. The bus agents
  263. * are different, and the address trap configuration bits are
  264. * slightly different.
  265. */
  266. #define M_BCM1480_ATRAP_INDEX _SB_MAKEMASK(4, 0)
  267. #define M_BCM1480_ATRAP_ADDRESS _SB_MAKEMASK(40, 0)
  268. #define S_BCM1480_ATRAP_CFG_CNT 0
  269. #define M_BCM1480_ATRAP_CFG_CNT _SB_MAKEMASK(3, S_BCM1480_ATRAP_CFG_CNT)
  270. #define V_BCM1480_ATRAP_CFG_CNT(x) _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_CNT)
  271. #define G_BCM1480_ATRAP_CFG_CNT(x) _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_CNT, M_BCM1480_ATRAP_CFG_CNT)
  272. #define M_BCM1480_ATRAP_CFG_WRITE _SB_MAKEMASK1(3)
  273. #define M_BCM1480_ATRAP_CFG_ALL _SB_MAKEMASK1(4)
  274. #define M_BCM1480_ATRAP_CFG_INV _SB_MAKEMASK1(5)
  275. #define M_BCM1480_ATRAP_CFG_USESRC _SB_MAKEMASK1(6)
  276. #define M_BCM1480_ATRAP_CFG_SRCINV _SB_MAKEMASK1(7)
  277. #define S_BCM1480_ATRAP_CFG_AGENTID 8
  278. #define M_BCM1480_ATRAP_CFG_AGENTID _SB_MAKEMASK(4, S_BCM1480_ATRAP_CFG_AGENTID)
  279. #define V_BCM1480_ATRAP_CFG_AGENTID(x) _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_AGENTID)
  280. #define G_BCM1480_ATRAP_CFG_AGENTID(x) _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_AGENTID, M_BCM1480_ATRAP_CFG_AGENTID)
  281. #define K_BCM1480_BUS_AGENT_CPU0 0
  282. #define K_BCM1480_BUS_AGENT_CPU1 1
  283. #define K_BCM1480_BUS_AGENT_NC 2
  284. #define K_BCM1480_BUS_AGENT_IOB 3
  285. #define K_BCM1480_BUS_AGENT_SCD 4
  286. #define K_BCM1480_BUS_AGENT_L2C 6
  287. #define K_BCM1480_BUS_AGENT_MC 7
  288. #define K_BCM1480_BUS_AGENT_CPU2 8
  289. #define K_BCM1480_BUS_AGENT_CPU3 9
  290. #define K_BCM1480_BUS_AGENT_PM 10
  291. #define S_BCM1480_ATRAP_CFG_CATTR 12
  292. #define M_BCM1480_ATRAP_CFG_CATTR _SB_MAKEMASK(2, S_BCM1480_ATRAP_CFG_CATTR)
  293. #define V_BCM1480_ATRAP_CFG_CATTR(x) _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_CATTR)
  294. #define G_BCM1480_ATRAP_CFG_CATTR(x) _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_CATTR, M_BCM1480_ATRAP_CFG_CATTR)
  295. #define K_BCM1480_ATRAP_CFG_CATTR_IGNORE 0
  296. #define K_BCM1480_ATRAP_CFG_CATTR_UNC 1
  297. #define K_BCM1480_ATRAP_CFG_CATTR_NONCOH 2
  298. #define K_BCM1480_ATRAP_CFG_CATTR_COHERENT 3
  299. #define M_BCM1480_ATRAP_CFG_CATTRINV _SB_MAKEMASK1(14)
  300. /*
  301. * Trace Event Registers (Table 47)
  302. * Same as BCM1250.
  303. */
  304. /*
  305. * Trace Sequence Control Registers (Table 48)
  306. * Registers: TRACE_SEQUENCE_x
  307. *
  308. * Same as BCM1250 except for two new fields.
  309. */
  310. #define M_BCM1480_SCD_TRSEQ_TID_MATCH_EN _SB_MAKEMASK1(25)
  311. #define S_BCM1480_SCD_TRSEQ_SWFUNC 26
  312. #define M_BCM1480_SCD_TRSEQ_SWFUNC _SB_MAKEMASK(2, S_BCM1480_SCD_TRSEQ_SWFUNC)
  313. #define V_BCM1480_SCD_TRSEQ_SWFUNC(x) _SB_MAKEVALUE(x, S_BCM1480_SCD_TRSEQ_SWFUNC)
  314. #define G_BCM1480_SCD_TRSEQ_SWFUNC(x) _SB_GETVALUE(x, S_BCM1480_SCD_TRSEQ_SWFUNC, M_BCM1480_SCD_TRSEQ_SWFUNC)
  315. /*
  316. * Trace Control Register (Table 49)
  317. * Register: TRACE_CFG
  318. *
  319. * BCM1480 changes to this register (other than location of the CUR_ADDR field)
  320. * are defined below.
  321. */
  322. #define S_BCM1480_SCD_TRACE_CFG_MODE 16
  323. #define M_BCM1480_SCD_TRACE_CFG_MODE _SB_MAKEMASK(2, S_BCM1480_SCD_TRACE_CFG_MODE)
  324. #define V_BCM1480_SCD_TRACE_CFG_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_SCD_TRACE_CFG_MODE)
  325. #define G_BCM1480_SCD_TRACE_CFG_MODE(x) _SB_GETVALUE(x, S_BCM1480_SCD_TRACE_CFG_MODE, M_BCM1480_SCD_TRACE_CFG_MODE)
  326. #define K_BCM1480_SCD_TRACE_CFG_MODE_BLOCKERS 0
  327. #define K_BCM1480_SCD_TRACE_CFG_MODE_BYTEEN_INT 1
  328. #define K_BCM1480_SCD_TRACE_CFG_MODE_FLOW_ID 2
  329. #endif /* _BCM1480_SCD_H */