Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*  *********************************************************************
0003     *  BCM1280/BCM1400 Board Support Package
0004     *
0005     *  SCD Constants and Macros             File: bcm1480_scd.h
0006     *
0007     *  This module contains constants and macros useful for
0008     *  manipulating the System Control and Debug module.
0009     *
0010     *  BCM1400 specification level: 1X55_1X80-UM100-R (12/18/03)
0011     *
0012     *********************************************************************
0013     *
0014     *  Copyright 2000,2001,2002,2003,2004,2005
0015     *  Broadcom Corporation. All rights reserved.
0016     *
0017     ********************************************************************* */
0018 
0019 #ifndef _BCM1480_SCD_H
0020 #define _BCM1480_SCD_H
0021 
0022 #include <asm/sibyte/sb1250_defs.h>
0023 
0024 /*  *********************************************************************
0025     *  Pull in the BCM1250's SCD since lots of stuff is the same.
0026     ********************************************************************* */
0027 
0028 #include <asm/sibyte/sb1250_scd.h>
0029 
0030 /*  *********************************************************************
0031     *  Some general notes:
0032     *
0033     *  This file is basically a "what's new" header file.  Since the
0034     *  BCM1250 and the new BCM1480 (and derivatives) share many common
0035     *  features, this file contains only what's new or changed from
0036     *  the 1250.  (above, you can see that we include the 1250 symbols
0037     *  to get the base functionality).
0038     *
0039     *  In software, be sure to use the correct symbols, particularly
0040     *  for blocks that are different between the two chip families.
0041     *  All BCM1480-specific symbols have _BCM1480_ in their names,
0042     *  and all BCM1250-specific and "base" functions that are common in
0043     *  both chips have no special names (this is for compatibility with
0044     *  older include files).  Therefore, if you're working with the
0045     *  SCD, which is very different on each chip, A_SCD_xxx implies
0046     *  the BCM1250 version and A_BCM1480_SCD_xxx implies the BCM1480
0047     *  version.
0048     ********************************************************************* */
0049 
0050 /*  *********************************************************************
0051     *  System control/debug registers
0052     ********************************************************************* */
0053 
0054 /*
0055  * System Identification and Revision Register (Table 12)
0056  * Register: SCD_SYSTEM_REVISION
0057  * This register is field compatible with the 1250.
0058  */
0059 
0060 /*
0061  * New part definitions
0062  */
0063 
0064 #define K_SYS_PART_BCM1480      0x1406
0065 #define K_SYS_PART_BCM1280      0x1206
0066 #define K_SYS_PART_BCM1455      0x1407
0067 #define K_SYS_PART_BCM1255      0x1257
0068 #define K_SYS_PART_BCM1158      0x1156
0069 
0070 /*
0071  * Manufacturing Information Register (Table 14)
0072  * Register: SCD_SYSTEM_MANUF
0073  */
0074 
0075 /*
0076  * System Configuration Register (Table 15)
0077  * Register: SCD_SYSTEM_CFG
0078  * Entire register is different from 1250, all new constants below
0079  */
0080 
0081 #define M_BCM1480_SYS_RESERVED0         _SB_MAKEMASK1(0)
0082 #define M_BCM1480_SYS_HT_MINRSTCNT      _SB_MAKEMASK1(1)
0083 #define M_BCM1480_SYS_RESERVED2         _SB_MAKEMASK1(2)
0084 #define M_BCM1480_SYS_RESERVED3         _SB_MAKEMASK1(3)
0085 #define M_BCM1480_SYS_RESERVED4         _SB_MAKEMASK1(4)
0086 #define M_BCM1480_SYS_IOB_DIV           _SB_MAKEMASK1(5)
0087 
0088 #define S_BCM1480_SYS_PLL_DIV           _SB_MAKE64(6)
0089 #define M_BCM1480_SYS_PLL_DIV           _SB_MAKEMASK(5, S_BCM1480_SYS_PLL_DIV)
0090 #define V_BCM1480_SYS_PLL_DIV(x)        _SB_MAKEVALUE(x, S_BCM1480_SYS_PLL_DIV)
0091 #define G_BCM1480_SYS_PLL_DIV(x)        _SB_GETVALUE(x, S_BCM1480_SYS_PLL_DIV, M_BCM1480_SYS_PLL_DIV)
0092 
0093 #define S_BCM1480_SYS_SW_DIV            _SB_MAKE64(11)
0094 #define M_BCM1480_SYS_SW_DIV            _SB_MAKEMASK(5, S_BCM1480_SYS_SW_DIV)
0095 #define V_BCM1480_SYS_SW_DIV(x)         _SB_MAKEVALUE(x, S_BCM1480_SYS_SW_DIV)
0096 #define G_BCM1480_SYS_SW_DIV(x)         _SB_GETVALUE(x, S_BCM1480_SYS_SW_DIV, M_BCM1480_SYS_SW_DIV)
0097 
0098 #define M_BCM1480_SYS_PCMCIA_ENABLE     _SB_MAKEMASK1(16)
0099 #define M_BCM1480_SYS_DUART1_ENABLE     _SB_MAKEMASK1(17)
0100 
0101 #define S_BCM1480_SYS_BOOT_MODE         _SB_MAKE64(18)
0102 #define M_BCM1480_SYS_BOOT_MODE         _SB_MAKEMASK(2, S_BCM1480_SYS_BOOT_MODE)
0103 #define V_BCM1480_SYS_BOOT_MODE(x)      _SB_MAKEVALUE(x, S_BCM1480_SYS_BOOT_MODE)
0104 #define G_BCM1480_SYS_BOOT_MODE(x)      _SB_GETVALUE(x, S_BCM1480_SYS_BOOT_MODE, M_BCM1480_SYS_BOOT_MODE)
0105 #define K_BCM1480_SYS_BOOT_MODE_ROM32       0
0106 #define K_BCM1480_SYS_BOOT_MODE_ROM8        1
0107 #define K_BCM1480_SYS_BOOT_MODE_SMBUS_SMALL 2
0108 #define K_BCM1480_SYS_BOOT_MODE_SMBUS_BIG   3
0109 #define M_BCM1480_SYS_BOOT_MODE_SMBUS       _SB_MAKEMASK1(19)
0110 
0111 #define M_BCM1480_SYS_PCI_HOST          _SB_MAKEMASK1(20)
0112 #define M_BCM1480_SYS_PCI_ARBITER       _SB_MAKEMASK1(21)
0113 #define M_BCM1480_SYS_BIG_ENDIAN        _SB_MAKEMASK1(22)
0114 #define M_BCM1480_SYS_GENCLK_EN         _SB_MAKEMASK1(23)
0115 #define M_BCM1480_SYS_GEN_PARITY_EN     _SB_MAKEMASK1(24)
0116 #define M_BCM1480_SYS_RESERVED25        _SB_MAKEMASK1(25)
0117 
0118 #define S_BCM1480_SYS_CONFIG            26
0119 #define M_BCM1480_SYS_CONFIG            _SB_MAKEMASK(6, S_BCM1480_SYS_CONFIG)
0120 #define V_BCM1480_SYS_CONFIG(x)         _SB_MAKEVALUE(x, S_BCM1480_SYS_CONFIG)
0121 #define G_BCM1480_SYS_CONFIG(x)         _SB_GETVALUE(x, S_BCM1480_SYS_CONFIG, M_BCM1480_SYS_CONFIG)
0122 
0123 #define M_BCM1480_SYS_RESERVED32        _SB_MAKEMASK(32, 15)
0124 
0125 #define S_BCM1480_SYS_NODEID            47
0126 #define M_BCM1480_SYS_NODEID            _SB_MAKEMASK(4, S_BCM1480_SYS_NODEID)
0127 #define V_BCM1480_SYS_NODEID(x)         _SB_MAKEVALUE(x, S_BCM1480_SYS_NODEID)
0128 #define G_BCM1480_SYS_NODEID(x)         _SB_GETVALUE(x, S_BCM1480_SYS_NODEID, M_BCM1480_SYS_NODEID)
0129 
0130 #define M_BCM1480_SYS_CCNUMA_EN         _SB_MAKEMASK1(51)
0131 #define M_BCM1480_SYS_CPU_RESET_0       _SB_MAKEMASK1(52)
0132 #define M_BCM1480_SYS_CPU_RESET_1       _SB_MAKEMASK1(53)
0133 #define M_BCM1480_SYS_CPU_RESET_2       _SB_MAKEMASK1(54)
0134 #define M_BCM1480_SYS_CPU_RESET_3       _SB_MAKEMASK1(55)
0135 #define S_BCM1480_SYS_DISABLECPU0       56
0136 #define M_BCM1480_SYS_DISABLECPU0       _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU0)
0137 #define S_BCM1480_SYS_DISABLECPU1       57
0138 #define M_BCM1480_SYS_DISABLECPU1       _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU1)
0139 #define S_BCM1480_SYS_DISABLECPU2       58
0140 #define M_BCM1480_SYS_DISABLECPU2       _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU2)
0141 #define S_BCM1480_SYS_DISABLECPU3       59
0142 #define M_BCM1480_SYS_DISABLECPU3       _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU3)
0143 
0144 #define M_BCM1480_SYS_SB_SOFTRES        _SB_MAKEMASK1(60)
0145 #define M_BCM1480_SYS_EXT_RESET         _SB_MAKEMASK1(61)
0146 #define M_BCM1480_SYS_SYSTEM_RESET      _SB_MAKEMASK1(62)
0147 #define M_BCM1480_SYS_SW_FLAG           _SB_MAKEMASK1(63)
0148 
0149 /*
0150  * Scratch Register (Table 16)
0151  * Register: SCD_SYSTEM_SCRATCH
0152  * Same as BCM1250
0153  */
0154 
0155 
0156 /*
0157  * Mailbox Registers (Table 17)
0158  * Registers: SCD_MBOX_{0,1}_CPU_x
0159  * Same as BCM1250
0160  */
0161 
0162 
0163 /*
0164  * See bcm1480_int.h for interrupt mapper registers.
0165  */
0166 
0167 
0168 /*
0169  * Watchdog Timer Initial Count Registers (Table 23)
0170  * Registers: SCD_WDOG_INIT_CNT_x
0171  *
0172  * The watchdogs are almost the same as the 1250, except
0173  * the configuration register has more bits to control the
0174  * other CPUs.
0175  */
0176 
0177 
0178 /*
0179  * Watchdog Timer Configuration Registers (Table 25)
0180  * Registers: SCD_WDOG_CFG_x
0181  */
0182 
0183 #define M_BCM1480_SCD_WDOG_ENABLE       _SB_MAKEMASK1(0)
0184 
0185 #define S_BCM1480_SCD_WDOG_RESET_TYPE       2
0186 #define M_BCM1480_SCD_WDOG_RESET_TYPE       _SB_MAKEMASK(5, S_BCM1480_SCD_WDOG_RESET_TYPE)
0187 #define V_BCM1480_SCD_WDOG_RESET_TYPE(x)    _SB_MAKEVALUE(x, S_BCM1480_SCD_WDOG_RESET_TYPE)
0188 #define G_BCM1480_SCD_WDOG_RESET_TYPE(x)    _SB_GETVALUE(x, S_BCM1480_SCD_WDOG_RESET_TYPE, M_BCM1480_SCD_WDOG_RESET_TYPE)
0189 
0190 #define K_BCM1480_SCD_WDOG_RESET_FULL       0   /* actually, (x & 1) == 0  */
0191 #define K_BCM1480_SCD_WDOG_RESET_SOFT       1
0192 #define K_BCM1480_SCD_WDOG_RESET_CPU0       3
0193 #define K_BCM1480_SCD_WDOG_RESET_CPU1       5
0194 #define K_BCM1480_SCD_WDOG_RESET_CPU2       9
0195 #define K_BCM1480_SCD_WDOG_RESET_CPU3       17
0196 #define K_BCM1480_SCD_WDOG_RESET_ALL_CPUS   31
0197 
0198 
0199 #define M_BCM1480_SCD_WDOG_HAS_RESET        _SB_MAKEMASK1(8)
0200 
0201 /*
0202  * General Timer Initial Count Registers (Table 26)
0203  * Registers: SCD_TIMER_INIT_x
0204  *
0205  * The timer registers are the same as the BCM1250
0206  */
0207 
0208 
0209 /*
0210  * ZBbus Count Register (Table 29)
0211  * Register: ZBBUS_CYCLE_COUNT
0212  *
0213  * Same as BCM1250
0214  */
0215 
0216 /*
0217  * ZBbus Compare Registers (Table 30)
0218  * Registers: ZBBUS_CYCLE_CPx
0219  *
0220  * Same as BCM1250
0221  */
0222 
0223 
0224 /*
0225  * System Performance Counter Configuration Register (Table 31)
0226  * Register: PERF_CNT_CFG_0
0227  *
0228  * SPC_CFG_SRC[0-3] is the same as the 1250.
0229  * SPC_CFG_SRC[4-7] only exist on the 1480
0230  * The clear/enable bits are in different locations on the 1250 and 1480.
0231  */
0232 
0233 #define S_SPC_CFG_SRC4          32
0234 #define M_SPC_CFG_SRC4          _SB_MAKEMASK(8, S_SPC_CFG_SRC4)
0235 #define V_SPC_CFG_SRC4(x)       _SB_MAKEVALUE(x, S_SPC_CFG_SRC4)
0236 #define G_SPC_CFG_SRC4(x)       _SB_GETVALUE(x, S_SPC_CFG_SRC4, M_SPC_CFG_SRC4)
0237 
0238 #define S_SPC_CFG_SRC5          40
0239 #define M_SPC_CFG_SRC5          _SB_MAKEMASK(8, S_SPC_CFG_SRC5)
0240 #define V_SPC_CFG_SRC5(x)       _SB_MAKEVALUE(x, S_SPC_CFG_SRC5)
0241 #define G_SPC_CFG_SRC5(x)       _SB_GETVALUE(x, S_SPC_CFG_SRC5, M_SPC_CFG_SRC5)
0242 
0243 #define S_SPC_CFG_SRC6          48
0244 #define M_SPC_CFG_SRC6          _SB_MAKEMASK(8, S_SPC_CFG_SRC6)
0245 #define V_SPC_CFG_SRC6(x)       _SB_MAKEVALUE(x, S_SPC_CFG_SRC6)
0246 #define G_SPC_CFG_SRC6(x)       _SB_GETVALUE(x, S_SPC_CFG_SRC6, M_SPC_CFG_SRC6)
0247 
0248 #define S_SPC_CFG_SRC7          56
0249 #define M_SPC_CFG_SRC7          _SB_MAKEMASK(8, S_SPC_CFG_SRC7)
0250 #define V_SPC_CFG_SRC7(x)       _SB_MAKEVALUE(x, S_SPC_CFG_SRC7)
0251 #define G_SPC_CFG_SRC7(x)       _SB_GETVALUE(x, S_SPC_CFG_SRC7, M_SPC_CFG_SRC7)
0252 
0253 /*
0254  * System Performance Counter Control Register (Table 32)
0255  * Register: PERF_CNT_CFG_1
0256  * BCM1480 specific
0257  */
0258 #define M_BCM1480_SPC_CFG_CLEAR     _SB_MAKEMASK1(0)
0259 #define M_BCM1480_SPC_CFG_ENABLE    _SB_MAKEMASK1(1)
0260 #if SIBYTE_HDR_FEATURE_CHIP(1480)
0261 #define M_SPC_CFG_CLEAR         M_BCM1480_SPC_CFG_CLEAR
0262 #define M_SPC_CFG_ENABLE        M_BCM1480_SPC_CFG_ENABLE
0263 #endif
0264 
0265 /*
0266  * System Performance Counters (Table 33)
0267  * Registers: PERF_CNT_x
0268  */
0269 
0270 #define S_BCM1480_SPC_CNT_COUNT         0
0271 #define M_BCM1480_SPC_CNT_COUNT         _SB_MAKEMASK(40, S_BCM1480_SPC_CNT_COUNT)
0272 #define V_BCM1480_SPC_CNT_COUNT(x)      _SB_MAKEVALUE(x, S_BCM1480_SPC_CNT_COUNT)
0273 #define G_BCM1480_SPC_CNT_COUNT(x)      _SB_GETVALUE(x, S_BCM1480_SPC_CNT_COUNT, M_BCM1480_SPC_CNT_COUNT)
0274 
0275 #define M_BCM1480_SPC_CNT_OFLOW         _SB_MAKEMASK1(40)
0276 
0277 
0278 /*
0279  * Bus Watcher Error Status Register (Tables 36, 37)
0280  * Registers: BUS_ERR_STATUS, BUS_ERR_STATUS_DEBUG
0281  * Same as BCM1250.
0282  */
0283 
0284 /*
0285  * Bus Watcher Error Data Registers (Table 38)
0286  * Registers: BUS_ERR_DATA_x
0287  * Same as BCM1250.
0288  */
0289 
0290 /*
0291  * Bus Watcher L2 ECC Counter Register (Table 39)
0292  * Register: BUS_L2_ERRORS
0293  * Same as BCM1250.
0294  */
0295 
0296 
0297 /*
0298  * Bus Watcher Memory and I/O Error Counter Register (Table 40)
0299  * Register: BUS_MEM_IO_ERRORS
0300  * Same as BCM1250.
0301  */
0302 
0303 
0304 /*
0305  * Address Trap Registers
0306  *
0307  * Register layout same as BCM1250, almost.  The bus agents
0308  * are different, and the address trap configuration bits are
0309  * slightly different.
0310  */
0311 
0312 #define M_BCM1480_ATRAP_INDEX         _SB_MAKEMASK(4, 0)
0313 #define M_BCM1480_ATRAP_ADDRESS       _SB_MAKEMASK(40, 0)
0314 
0315 #define S_BCM1480_ATRAP_CFG_CNT        0
0316 #define M_BCM1480_ATRAP_CFG_CNT        _SB_MAKEMASK(3, S_BCM1480_ATRAP_CFG_CNT)
0317 #define V_BCM1480_ATRAP_CFG_CNT(x)     _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_CNT)
0318 #define G_BCM1480_ATRAP_CFG_CNT(x)     _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_CNT, M_BCM1480_ATRAP_CFG_CNT)
0319 
0320 #define M_BCM1480_ATRAP_CFG_WRITE      _SB_MAKEMASK1(3)
0321 #define M_BCM1480_ATRAP_CFG_ALL        _SB_MAKEMASK1(4)
0322 #define M_BCM1480_ATRAP_CFG_INV        _SB_MAKEMASK1(5)
0323 #define M_BCM1480_ATRAP_CFG_USESRC     _SB_MAKEMASK1(6)
0324 #define M_BCM1480_ATRAP_CFG_SRCINV     _SB_MAKEMASK1(7)
0325 
0326 #define S_BCM1480_ATRAP_CFG_AGENTID 8
0327 #define M_BCM1480_ATRAP_CFG_AGENTID _SB_MAKEMASK(4, S_BCM1480_ATRAP_CFG_AGENTID)
0328 #define V_BCM1480_ATRAP_CFG_AGENTID(x)  _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_AGENTID)
0329 #define G_BCM1480_ATRAP_CFG_AGENTID(x)  _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_AGENTID, M_BCM1480_ATRAP_CFG_AGENTID)
0330 
0331 
0332 #define K_BCM1480_BUS_AGENT_CPU0        0
0333 #define K_BCM1480_BUS_AGENT_CPU1        1
0334 #define K_BCM1480_BUS_AGENT_NC          2
0335 #define K_BCM1480_BUS_AGENT_IOB         3
0336 #define K_BCM1480_BUS_AGENT_SCD         4
0337 #define K_BCM1480_BUS_AGENT_L2C         6
0338 #define K_BCM1480_BUS_AGENT_MC          7
0339 #define K_BCM1480_BUS_AGENT_CPU2        8
0340 #define K_BCM1480_BUS_AGENT_CPU3        9
0341 #define K_BCM1480_BUS_AGENT_PM          10
0342 
0343 #define S_BCM1480_ATRAP_CFG_CATTR       12
0344 #define M_BCM1480_ATRAP_CFG_CATTR       _SB_MAKEMASK(2, S_BCM1480_ATRAP_CFG_CATTR)
0345 #define V_BCM1480_ATRAP_CFG_CATTR(x)        _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_CATTR)
0346 #define G_BCM1480_ATRAP_CFG_CATTR(x)        _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_CATTR, M_BCM1480_ATRAP_CFG_CATTR)
0347 
0348 #define K_BCM1480_ATRAP_CFG_CATTR_IGNORE    0
0349 #define K_BCM1480_ATRAP_CFG_CATTR_UNC       1
0350 #define K_BCM1480_ATRAP_CFG_CATTR_NONCOH    2
0351 #define K_BCM1480_ATRAP_CFG_CATTR_COHERENT  3
0352 
0353 #define M_BCM1480_ATRAP_CFG_CATTRINV        _SB_MAKEMASK1(14)
0354 
0355 
0356 /*
0357  * Trace Event Registers (Table 47)
0358  * Same as BCM1250.
0359  */
0360 
0361 /*
0362  * Trace Sequence Control Registers (Table 48)
0363  * Registers: TRACE_SEQUENCE_x
0364  *
0365  * Same as BCM1250 except for two new fields.
0366  */
0367 
0368 
0369 #define M_BCM1480_SCD_TRSEQ_TID_MATCH_EN    _SB_MAKEMASK1(25)
0370 
0371 #define S_BCM1480_SCD_TRSEQ_SWFUNC      26
0372 #define M_BCM1480_SCD_TRSEQ_SWFUNC      _SB_MAKEMASK(2, S_BCM1480_SCD_TRSEQ_SWFUNC)
0373 #define V_BCM1480_SCD_TRSEQ_SWFUNC(x)       _SB_MAKEVALUE(x, S_BCM1480_SCD_TRSEQ_SWFUNC)
0374 #define G_BCM1480_SCD_TRSEQ_SWFUNC(x)       _SB_GETVALUE(x, S_BCM1480_SCD_TRSEQ_SWFUNC, M_BCM1480_SCD_TRSEQ_SWFUNC)
0375 
0376 /*
0377  * Trace Control Register (Table 49)
0378  * Register: TRACE_CFG
0379  *
0380  * BCM1480 changes to this register (other than location of the CUR_ADDR field)
0381  * are defined below.
0382  */
0383 
0384 #define S_BCM1480_SCD_TRACE_CFG_MODE        16
0385 #define M_BCM1480_SCD_TRACE_CFG_MODE        _SB_MAKEMASK(2, S_BCM1480_SCD_TRACE_CFG_MODE)
0386 #define V_BCM1480_SCD_TRACE_CFG_MODE(x)     _SB_MAKEVALUE(x, S_BCM1480_SCD_TRACE_CFG_MODE)
0387 #define G_BCM1480_SCD_TRACE_CFG_MODE(x)     _SB_GETVALUE(x, S_BCM1480_SCD_TRACE_CFG_MODE, M_BCM1480_SCD_TRACE_CFG_MODE)
0388 
0389 #define K_BCM1480_SCD_TRACE_CFG_MODE_BLOCKERS   0
0390 #define K_BCM1480_SCD_TRACE_CFG_MODE_BYTEEN_INT 1
0391 #define K_BCM1480_SCD_TRACE_CFG_MODE_FLOW_ID    2
0392 
0393 #endif /* _BCM1480_SCD_H */