18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*  *********************************************************************
38c2ecf20Sopenharmony_ci    *  BCM1280/BCM1400 Board Support Package
48c2ecf20Sopenharmony_ci    *
58c2ecf20Sopenharmony_ci    *  SCD Constants and Macros			    File: bcm1480_scd.h
68c2ecf20Sopenharmony_ci    *
78c2ecf20Sopenharmony_ci    *  This module contains constants and macros useful for
88c2ecf20Sopenharmony_ci    *  manipulating the System Control and Debug module.
98c2ecf20Sopenharmony_ci    *
108c2ecf20Sopenharmony_ci    *  BCM1400 specification level: 1X55_1X80-UM100-R (12/18/03)
118c2ecf20Sopenharmony_ci    *
128c2ecf20Sopenharmony_ci    *********************************************************************
138c2ecf20Sopenharmony_ci    *
148c2ecf20Sopenharmony_ci    *  Copyright 2000,2001,2002,2003,2004,2005
158c2ecf20Sopenharmony_ci    *  Broadcom Corporation. All rights reserved.
168c2ecf20Sopenharmony_ci    *
178c2ecf20Sopenharmony_ci    ********************************************************************* */
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#ifndef _BCM1480_SCD_H
208c2ecf20Sopenharmony_ci#define _BCM1480_SCD_H
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#include <asm/sibyte/sb1250_defs.h>
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci/*  *********************************************************************
258c2ecf20Sopenharmony_ci    *  Pull in the BCM1250's SCD since lots of stuff is the same.
268c2ecf20Sopenharmony_ci    ********************************************************************* */
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#include <asm/sibyte/sb1250_scd.h>
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci/*  *********************************************************************
318c2ecf20Sopenharmony_ci    *  Some general notes:
328c2ecf20Sopenharmony_ci    *
338c2ecf20Sopenharmony_ci    *  This file is basically a "what's new" header file.  Since the
348c2ecf20Sopenharmony_ci    *  BCM1250 and the new BCM1480 (and derivatives) share many common
358c2ecf20Sopenharmony_ci    *  features, this file contains only what's new or changed from
368c2ecf20Sopenharmony_ci    *  the 1250.  (above, you can see that we include the 1250 symbols
378c2ecf20Sopenharmony_ci    *  to get the base functionality).
388c2ecf20Sopenharmony_ci    *
398c2ecf20Sopenharmony_ci    *  In software, be sure to use the correct symbols, particularly
408c2ecf20Sopenharmony_ci    *  for blocks that are different between the two chip families.
418c2ecf20Sopenharmony_ci    *  All BCM1480-specific symbols have _BCM1480_ in their names,
428c2ecf20Sopenharmony_ci    *  and all BCM1250-specific and "base" functions that are common in
438c2ecf20Sopenharmony_ci    *  both chips have no special names (this is for compatibility with
448c2ecf20Sopenharmony_ci    *  older include files).  Therefore, if you're working with the
458c2ecf20Sopenharmony_ci    *  SCD, which is very different on each chip, A_SCD_xxx implies
468c2ecf20Sopenharmony_ci    *  the BCM1250 version and A_BCM1480_SCD_xxx implies the BCM1480
478c2ecf20Sopenharmony_ci    *  version.
488c2ecf20Sopenharmony_ci    ********************************************************************* */
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci/*  *********************************************************************
518c2ecf20Sopenharmony_ci    *  System control/debug registers
528c2ecf20Sopenharmony_ci    ********************************************************************* */
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci/*
558c2ecf20Sopenharmony_ci * System Identification and Revision Register (Table 12)
568c2ecf20Sopenharmony_ci * Register: SCD_SYSTEM_REVISION
578c2ecf20Sopenharmony_ci * This register is field compatible with the 1250.
588c2ecf20Sopenharmony_ci */
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci/*
618c2ecf20Sopenharmony_ci * New part definitions
628c2ecf20Sopenharmony_ci */
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define K_SYS_PART_BCM1480	    0x1406
658c2ecf20Sopenharmony_ci#define K_SYS_PART_BCM1280	    0x1206
668c2ecf20Sopenharmony_ci#define K_SYS_PART_BCM1455	    0x1407
678c2ecf20Sopenharmony_ci#define K_SYS_PART_BCM1255	    0x1257
688c2ecf20Sopenharmony_ci#define K_SYS_PART_BCM1158	    0x1156
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci/*
718c2ecf20Sopenharmony_ci * Manufacturing Information Register (Table 14)
728c2ecf20Sopenharmony_ci * Register: SCD_SYSTEM_MANUF
738c2ecf20Sopenharmony_ci */
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci/*
768c2ecf20Sopenharmony_ci * System Configuration Register (Table 15)
778c2ecf20Sopenharmony_ci * Register: SCD_SYSTEM_CFG
788c2ecf20Sopenharmony_ci * Entire register is different from 1250, all new constants below
798c2ecf20Sopenharmony_ci */
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_RESERVED0		    _SB_MAKEMASK1(0)
828c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_HT_MINRSTCNT	    _SB_MAKEMASK1(1)
838c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_RESERVED2		    _SB_MAKEMASK1(2)
848c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_RESERVED3		    _SB_MAKEMASK1(3)
858c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_RESERVED4		    _SB_MAKEMASK1(4)
868c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_IOB_DIV		    _SB_MAKEMASK1(5)
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#define S_BCM1480_SYS_PLL_DIV		    _SB_MAKE64(6)
898c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_PLL_DIV		    _SB_MAKEMASK(5, S_BCM1480_SYS_PLL_DIV)
908c2ecf20Sopenharmony_ci#define V_BCM1480_SYS_PLL_DIV(x)	    _SB_MAKEVALUE(x, S_BCM1480_SYS_PLL_DIV)
918c2ecf20Sopenharmony_ci#define G_BCM1480_SYS_PLL_DIV(x)	    _SB_GETVALUE(x, S_BCM1480_SYS_PLL_DIV, M_BCM1480_SYS_PLL_DIV)
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci#define S_BCM1480_SYS_SW_DIV		    _SB_MAKE64(11)
948c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_SW_DIV		    _SB_MAKEMASK(5, S_BCM1480_SYS_SW_DIV)
958c2ecf20Sopenharmony_ci#define V_BCM1480_SYS_SW_DIV(x)		    _SB_MAKEVALUE(x, S_BCM1480_SYS_SW_DIV)
968c2ecf20Sopenharmony_ci#define G_BCM1480_SYS_SW_DIV(x)		    _SB_GETVALUE(x, S_BCM1480_SYS_SW_DIV, M_BCM1480_SYS_SW_DIV)
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_PCMCIA_ENABLE	    _SB_MAKEMASK1(16)
998c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_DUART1_ENABLE	    _SB_MAKEMASK1(17)
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci#define S_BCM1480_SYS_BOOT_MODE		    _SB_MAKE64(18)
1028c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_BOOT_MODE		    _SB_MAKEMASK(2, S_BCM1480_SYS_BOOT_MODE)
1038c2ecf20Sopenharmony_ci#define V_BCM1480_SYS_BOOT_MODE(x)	    _SB_MAKEVALUE(x, S_BCM1480_SYS_BOOT_MODE)
1048c2ecf20Sopenharmony_ci#define G_BCM1480_SYS_BOOT_MODE(x)	    _SB_GETVALUE(x, S_BCM1480_SYS_BOOT_MODE, M_BCM1480_SYS_BOOT_MODE)
1058c2ecf20Sopenharmony_ci#define K_BCM1480_SYS_BOOT_MODE_ROM32	    0
1068c2ecf20Sopenharmony_ci#define K_BCM1480_SYS_BOOT_MODE_ROM8	    1
1078c2ecf20Sopenharmony_ci#define K_BCM1480_SYS_BOOT_MODE_SMBUS_SMALL 2
1088c2ecf20Sopenharmony_ci#define K_BCM1480_SYS_BOOT_MODE_SMBUS_BIG   3
1098c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_BOOT_MODE_SMBUS	    _SB_MAKEMASK1(19)
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_PCI_HOST		    _SB_MAKEMASK1(20)
1128c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_PCI_ARBITER	    _SB_MAKEMASK1(21)
1138c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_BIG_ENDIAN	    _SB_MAKEMASK1(22)
1148c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_GENCLK_EN		    _SB_MAKEMASK1(23)
1158c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_GEN_PARITY_EN	    _SB_MAKEMASK1(24)
1168c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_RESERVED25	    _SB_MAKEMASK1(25)
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci#define S_BCM1480_SYS_CONFIG		    26
1198c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_CONFIG		    _SB_MAKEMASK(6, S_BCM1480_SYS_CONFIG)
1208c2ecf20Sopenharmony_ci#define V_BCM1480_SYS_CONFIG(x)		    _SB_MAKEVALUE(x, S_BCM1480_SYS_CONFIG)
1218c2ecf20Sopenharmony_ci#define G_BCM1480_SYS_CONFIG(x)		    _SB_GETVALUE(x, S_BCM1480_SYS_CONFIG, M_BCM1480_SYS_CONFIG)
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_RESERVED32	    _SB_MAKEMASK(32, 15)
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci#define S_BCM1480_SYS_NODEID		    47
1268c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_NODEID		    _SB_MAKEMASK(4, S_BCM1480_SYS_NODEID)
1278c2ecf20Sopenharmony_ci#define V_BCM1480_SYS_NODEID(x)		    _SB_MAKEVALUE(x, S_BCM1480_SYS_NODEID)
1288c2ecf20Sopenharmony_ci#define G_BCM1480_SYS_NODEID(x)		    _SB_GETVALUE(x, S_BCM1480_SYS_NODEID, M_BCM1480_SYS_NODEID)
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_CCNUMA_EN		    _SB_MAKEMASK1(51)
1318c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_CPU_RESET_0	    _SB_MAKEMASK1(52)
1328c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_CPU_RESET_1	    _SB_MAKEMASK1(53)
1338c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_CPU_RESET_2	    _SB_MAKEMASK1(54)
1348c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_CPU_RESET_3	    _SB_MAKEMASK1(55)
1358c2ecf20Sopenharmony_ci#define S_BCM1480_SYS_DISABLECPU0	    56
1368c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_DISABLECPU0	    _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU0)
1378c2ecf20Sopenharmony_ci#define S_BCM1480_SYS_DISABLECPU1	    57
1388c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_DISABLECPU1	    _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU1)
1398c2ecf20Sopenharmony_ci#define S_BCM1480_SYS_DISABLECPU2	    58
1408c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_DISABLECPU2	    _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU2)
1418c2ecf20Sopenharmony_ci#define S_BCM1480_SYS_DISABLECPU3	    59
1428c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_DISABLECPU3	    _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU3)
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_SB_SOFTRES	    _SB_MAKEMASK1(60)
1458c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_EXT_RESET		    _SB_MAKEMASK1(61)
1468c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_SYSTEM_RESET	    _SB_MAKEMASK1(62)
1478c2ecf20Sopenharmony_ci#define M_BCM1480_SYS_SW_FLAG		    _SB_MAKEMASK1(63)
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci/*
1508c2ecf20Sopenharmony_ci * Scratch Register (Table 16)
1518c2ecf20Sopenharmony_ci * Register: SCD_SYSTEM_SCRATCH
1528c2ecf20Sopenharmony_ci * Same as BCM1250
1538c2ecf20Sopenharmony_ci */
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci/*
1578c2ecf20Sopenharmony_ci * Mailbox Registers (Table 17)
1588c2ecf20Sopenharmony_ci * Registers: SCD_MBOX_{0,1}_CPU_x
1598c2ecf20Sopenharmony_ci * Same as BCM1250
1608c2ecf20Sopenharmony_ci */
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci/*
1648c2ecf20Sopenharmony_ci * See bcm1480_int.h for interrupt mapper registers.
1658c2ecf20Sopenharmony_ci */
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci/*
1698c2ecf20Sopenharmony_ci * Watchdog Timer Initial Count Registers (Table 23)
1708c2ecf20Sopenharmony_ci * Registers: SCD_WDOG_INIT_CNT_x
1718c2ecf20Sopenharmony_ci *
1728c2ecf20Sopenharmony_ci * The watchdogs are almost the same as the 1250, except
1738c2ecf20Sopenharmony_ci * the configuration register has more bits to control the
1748c2ecf20Sopenharmony_ci * other CPUs.
1758c2ecf20Sopenharmony_ci */
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci/*
1798c2ecf20Sopenharmony_ci * Watchdog Timer Configuration Registers (Table 25)
1808c2ecf20Sopenharmony_ci * Registers: SCD_WDOG_CFG_x
1818c2ecf20Sopenharmony_ci */
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci#define M_BCM1480_SCD_WDOG_ENABLE	    _SB_MAKEMASK1(0)
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci#define S_BCM1480_SCD_WDOG_RESET_TYPE	    2
1868c2ecf20Sopenharmony_ci#define M_BCM1480_SCD_WDOG_RESET_TYPE	    _SB_MAKEMASK(5, S_BCM1480_SCD_WDOG_RESET_TYPE)
1878c2ecf20Sopenharmony_ci#define V_BCM1480_SCD_WDOG_RESET_TYPE(x)    _SB_MAKEVALUE(x, S_BCM1480_SCD_WDOG_RESET_TYPE)
1888c2ecf20Sopenharmony_ci#define G_BCM1480_SCD_WDOG_RESET_TYPE(x)    _SB_GETVALUE(x, S_BCM1480_SCD_WDOG_RESET_TYPE, M_BCM1480_SCD_WDOG_RESET_TYPE)
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci#define K_BCM1480_SCD_WDOG_RESET_FULL	    0	/* actually, (x & 1) == 0  */
1918c2ecf20Sopenharmony_ci#define K_BCM1480_SCD_WDOG_RESET_SOFT	    1
1928c2ecf20Sopenharmony_ci#define K_BCM1480_SCD_WDOG_RESET_CPU0	    3
1938c2ecf20Sopenharmony_ci#define K_BCM1480_SCD_WDOG_RESET_CPU1	    5
1948c2ecf20Sopenharmony_ci#define K_BCM1480_SCD_WDOG_RESET_CPU2	    9
1958c2ecf20Sopenharmony_ci#define K_BCM1480_SCD_WDOG_RESET_CPU3	    17
1968c2ecf20Sopenharmony_ci#define K_BCM1480_SCD_WDOG_RESET_ALL_CPUS   31
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci#define M_BCM1480_SCD_WDOG_HAS_RESET	    _SB_MAKEMASK1(8)
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_ci/*
2028c2ecf20Sopenharmony_ci * General Timer Initial Count Registers (Table 26)
2038c2ecf20Sopenharmony_ci * Registers: SCD_TIMER_INIT_x
2048c2ecf20Sopenharmony_ci *
2058c2ecf20Sopenharmony_ci * The timer registers are the same as the BCM1250
2068c2ecf20Sopenharmony_ci */
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci/*
2108c2ecf20Sopenharmony_ci * ZBbus Count Register (Table 29)
2118c2ecf20Sopenharmony_ci * Register: ZBBUS_CYCLE_COUNT
2128c2ecf20Sopenharmony_ci *
2138c2ecf20Sopenharmony_ci * Same as BCM1250
2148c2ecf20Sopenharmony_ci */
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci/*
2178c2ecf20Sopenharmony_ci * ZBbus Compare Registers (Table 30)
2188c2ecf20Sopenharmony_ci * Registers: ZBBUS_CYCLE_CPx
2198c2ecf20Sopenharmony_ci *
2208c2ecf20Sopenharmony_ci * Same as BCM1250
2218c2ecf20Sopenharmony_ci */
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci/*
2258c2ecf20Sopenharmony_ci * System Performance Counter Configuration Register (Table 31)
2268c2ecf20Sopenharmony_ci * Register: PERF_CNT_CFG_0
2278c2ecf20Sopenharmony_ci *
2288c2ecf20Sopenharmony_ci * SPC_CFG_SRC[0-3] is the same as the 1250.
2298c2ecf20Sopenharmony_ci * SPC_CFG_SRC[4-7] only exist on the 1480
2308c2ecf20Sopenharmony_ci * The clear/enable bits are in different locations on the 1250 and 1480.
2318c2ecf20Sopenharmony_ci */
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci#define S_SPC_CFG_SRC4		    32
2348c2ecf20Sopenharmony_ci#define M_SPC_CFG_SRC4		    _SB_MAKEMASK(8, S_SPC_CFG_SRC4)
2358c2ecf20Sopenharmony_ci#define V_SPC_CFG_SRC4(x)	    _SB_MAKEVALUE(x, S_SPC_CFG_SRC4)
2368c2ecf20Sopenharmony_ci#define G_SPC_CFG_SRC4(x)	    _SB_GETVALUE(x, S_SPC_CFG_SRC4, M_SPC_CFG_SRC4)
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci#define S_SPC_CFG_SRC5		    40
2398c2ecf20Sopenharmony_ci#define M_SPC_CFG_SRC5		    _SB_MAKEMASK(8, S_SPC_CFG_SRC5)
2408c2ecf20Sopenharmony_ci#define V_SPC_CFG_SRC5(x)	    _SB_MAKEVALUE(x, S_SPC_CFG_SRC5)
2418c2ecf20Sopenharmony_ci#define G_SPC_CFG_SRC5(x)	    _SB_GETVALUE(x, S_SPC_CFG_SRC5, M_SPC_CFG_SRC5)
2428c2ecf20Sopenharmony_ci
2438c2ecf20Sopenharmony_ci#define S_SPC_CFG_SRC6		    48
2448c2ecf20Sopenharmony_ci#define M_SPC_CFG_SRC6		    _SB_MAKEMASK(8, S_SPC_CFG_SRC6)
2458c2ecf20Sopenharmony_ci#define V_SPC_CFG_SRC6(x)	    _SB_MAKEVALUE(x, S_SPC_CFG_SRC6)
2468c2ecf20Sopenharmony_ci#define G_SPC_CFG_SRC6(x)	    _SB_GETVALUE(x, S_SPC_CFG_SRC6, M_SPC_CFG_SRC6)
2478c2ecf20Sopenharmony_ci
2488c2ecf20Sopenharmony_ci#define S_SPC_CFG_SRC7		    56
2498c2ecf20Sopenharmony_ci#define M_SPC_CFG_SRC7		    _SB_MAKEMASK(8, S_SPC_CFG_SRC7)
2508c2ecf20Sopenharmony_ci#define V_SPC_CFG_SRC7(x)	    _SB_MAKEVALUE(x, S_SPC_CFG_SRC7)
2518c2ecf20Sopenharmony_ci#define G_SPC_CFG_SRC7(x)	    _SB_GETVALUE(x, S_SPC_CFG_SRC7, M_SPC_CFG_SRC7)
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ci/*
2548c2ecf20Sopenharmony_ci * System Performance Counter Control Register (Table 32)
2558c2ecf20Sopenharmony_ci * Register: PERF_CNT_CFG_1
2568c2ecf20Sopenharmony_ci * BCM1480 specific
2578c2ecf20Sopenharmony_ci */
2588c2ecf20Sopenharmony_ci#define M_BCM1480_SPC_CFG_CLEAR	    _SB_MAKEMASK1(0)
2598c2ecf20Sopenharmony_ci#define M_BCM1480_SPC_CFG_ENABLE    _SB_MAKEMASK1(1)
2608c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE_CHIP(1480)
2618c2ecf20Sopenharmony_ci#define M_SPC_CFG_CLEAR			M_BCM1480_SPC_CFG_CLEAR
2628c2ecf20Sopenharmony_ci#define M_SPC_CFG_ENABLE		M_BCM1480_SPC_CFG_ENABLE
2638c2ecf20Sopenharmony_ci#endif
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_ci/*
2668c2ecf20Sopenharmony_ci * System Performance Counters (Table 33)
2678c2ecf20Sopenharmony_ci * Registers: PERF_CNT_x
2688c2ecf20Sopenharmony_ci */
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ci#define S_BCM1480_SPC_CNT_COUNT		    0
2718c2ecf20Sopenharmony_ci#define M_BCM1480_SPC_CNT_COUNT		    _SB_MAKEMASK(40, S_BCM1480_SPC_CNT_COUNT)
2728c2ecf20Sopenharmony_ci#define V_BCM1480_SPC_CNT_COUNT(x)	    _SB_MAKEVALUE(x, S_BCM1480_SPC_CNT_COUNT)
2738c2ecf20Sopenharmony_ci#define G_BCM1480_SPC_CNT_COUNT(x)	    _SB_GETVALUE(x, S_BCM1480_SPC_CNT_COUNT, M_BCM1480_SPC_CNT_COUNT)
2748c2ecf20Sopenharmony_ci
2758c2ecf20Sopenharmony_ci#define M_BCM1480_SPC_CNT_OFLOW		    _SB_MAKEMASK1(40)
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci/*
2798c2ecf20Sopenharmony_ci * Bus Watcher Error Status Register (Tables 36, 37)
2808c2ecf20Sopenharmony_ci * Registers: BUS_ERR_STATUS, BUS_ERR_STATUS_DEBUG
2818c2ecf20Sopenharmony_ci * Same as BCM1250.
2828c2ecf20Sopenharmony_ci */
2838c2ecf20Sopenharmony_ci
2848c2ecf20Sopenharmony_ci/*
2858c2ecf20Sopenharmony_ci * Bus Watcher Error Data Registers (Table 38)
2868c2ecf20Sopenharmony_ci * Registers: BUS_ERR_DATA_x
2878c2ecf20Sopenharmony_ci * Same as BCM1250.
2888c2ecf20Sopenharmony_ci */
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ci/*
2918c2ecf20Sopenharmony_ci * Bus Watcher L2 ECC Counter Register (Table 39)
2928c2ecf20Sopenharmony_ci * Register: BUS_L2_ERRORS
2938c2ecf20Sopenharmony_ci * Same as BCM1250.
2948c2ecf20Sopenharmony_ci */
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ci/*
2988c2ecf20Sopenharmony_ci * Bus Watcher Memory and I/O Error Counter Register (Table 40)
2998c2ecf20Sopenharmony_ci * Register: BUS_MEM_IO_ERRORS
3008c2ecf20Sopenharmony_ci * Same as BCM1250.
3018c2ecf20Sopenharmony_ci */
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci/*
3058c2ecf20Sopenharmony_ci * Address Trap Registers
3068c2ecf20Sopenharmony_ci *
3078c2ecf20Sopenharmony_ci * Register layout same as BCM1250, almost.  The bus agents
3088c2ecf20Sopenharmony_ci * are different, and the address trap configuration bits are
3098c2ecf20Sopenharmony_ci * slightly different.
3108c2ecf20Sopenharmony_ci */
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci#define M_BCM1480_ATRAP_INDEX		  _SB_MAKEMASK(4, 0)
3138c2ecf20Sopenharmony_ci#define M_BCM1480_ATRAP_ADDRESS		  _SB_MAKEMASK(40, 0)
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_ci#define S_BCM1480_ATRAP_CFG_CNT		   0
3168c2ecf20Sopenharmony_ci#define M_BCM1480_ATRAP_CFG_CNT		   _SB_MAKEMASK(3, S_BCM1480_ATRAP_CFG_CNT)
3178c2ecf20Sopenharmony_ci#define V_BCM1480_ATRAP_CFG_CNT(x)	   _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_CNT)
3188c2ecf20Sopenharmony_ci#define G_BCM1480_ATRAP_CFG_CNT(x)	   _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_CNT, M_BCM1480_ATRAP_CFG_CNT)
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_ci#define M_BCM1480_ATRAP_CFG_WRITE	   _SB_MAKEMASK1(3)
3218c2ecf20Sopenharmony_ci#define M_BCM1480_ATRAP_CFG_ALL		   _SB_MAKEMASK1(4)
3228c2ecf20Sopenharmony_ci#define M_BCM1480_ATRAP_CFG_INV		   _SB_MAKEMASK1(5)
3238c2ecf20Sopenharmony_ci#define M_BCM1480_ATRAP_CFG_USESRC	   _SB_MAKEMASK1(6)
3248c2ecf20Sopenharmony_ci#define M_BCM1480_ATRAP_CFG_SRCINV	   _SB_MAKEMASK1(7)
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci#define S_BCM1480_ATRAP_CFG_AGENTID	8
3278c2ecf20Sopenharmony_ci#define M_BCM1480_ATRAP_CFG_AGENTID	_SB_MAKEMASK(4, S_BCM1480_ATRAP_CFG_AGENTID)
3288c2ecf20Sopenharmony_ci#define V_BCM1480_ATRAP_CFG_AGENTID(x)	_SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_AGENTID)
3298c2ecf20Sopenharmony_ci#define G_BCM1480_ATRAP_CFG_AGENTID(x)	_SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_AGENTID, M_BCM1480_ATRAP_CFG_AGENTID)
3308c2ecf20Sopenharmony_ci
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ci#define K_BCM1480_BUS_AGENT_CPU0	    0
3338c2ecf20Sopenharmony_ci#define K_BCM1480_BUS_AGENT_CPU1	    1
3348c2ecf20Sopenharmony_ci#define K_BCM1480_BUS_AGENT_NC		    2
3358c2ecf20Sopenharmony_ci#define K_BCM1480_BUS_AGENT_IOB		    3
3368c2ecf20Sopenharmony_ci#define K_BCM1480_BUS_AGENT_SCD		    4
3378c2ecf20Sopenharmony_ci#define K_BCM1480_BUS_AGENT_L2C		    6
3388c2ecf20Sopenharmony_ci#define K_BCM1480_BUS_AGENT_MC		    7
3398c2ecf20Sopenharmony_ci#define K_BCM1480_BUS_AGENT_CPU2	    8
3408c2ecf20Sopenharmony_ci#define K_BCM1480_BUS_AGENT_CPU3	    9
3418c2ecf20Sopenharmony_ci#define K_BCM1480_BUS_AGENT_PM		    10
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_ci#define S_BCM1480_ATRAP_CFG_CATTR	    12
3448c2ecf20Sopenharmony_ci#define M_BCM1480_ATRAP_CFG_CATTR	    _SB_MAKEMASK(2, S_BCM1480_ATRAP_CFG_CATTR)
3458c2ecf20Sopenharmony_ci#define V_BCM1480_ATRAP_CFG_CATTR(x)	    _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_CATTR)
3468c2ecf20Sopenharmony_ci#define G_BCM1480_ATRAP_CFG_CATTR(x)	    _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_CATTR, M_BCM1480_ATRAP_CFG_CATTR)
3478c2ecf20Sopenharmony_ci
3488c2ecf20Sopenharmony_ci#define K_BCM1480_ATRAP_CFG_CATTR_IGNORE    0
3498c2ecf20Sopenharmony_ci#define K_BCM1480_ATRAP_CFG_CATTR_UNC	    1
3508c2ecf20Sopenharmony_ci#define K_BCM1480_ATRAP_CFG_CATTR_NONCOH    2
3518c2ecf20Sopenharmony_ci#define K_BCM1480_ATRAP_CFG_CATTR_COHERENT  3
3528c2ecf20Sopenharmony_ci
3538c2ecf20Sopenharmony_ci#define M_BCM1480_ATRAP_CFG_CATTRINV	    _SB_MAKEMASK1(14)
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_ci/*
3578c2ecf20Sopenharmony_ci * Trace Event Registers (Table 47)
3588c2ecf20Sopenharmony_ci * Same as BCM1250.
3598c2ecf20Sopenharmony_ci */
3608c2ecf20Sopenharmony_ci
3618c2ecf20Sopenharmony_ci/*
3628c2ecf20Sopenharmony_ci * Trace Sequence Control Registers (Table 48)
3638c2ecf20Sopenharmony_ci * Registers: TRACE_SEQUENCE_x
3648c2ecf20Sopenharmony_ci *
3658c2ecf20Sopenharmony_ci * Same as BCM1250 except for two new fields.
3668c2ecf20Sopenharmony_ci */
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci
3698c2ecf20Sopenharmony_ci#define M_BCM1480_SCD_TRSEQ_TID_MATCH_EN    _SB_MAKEMASK1(25)
3708c2ecf20Sopenharmony_ci
3718c2ecf20Sopenharmony_ci#define S_BCM1480_SCD_TRSEQ_SWFUNC	    26
3728c2ecf20Sopenharmony_ci#define M_BCM1480_SCD_TRSEQ_SWFUNC	    _SB_MAKEMASK(2, S_BCM1480_SCD_TRSEQ_SWFUNC)
3738c2ecf20Sopenharmony_ci#define V_BCM1480_SCD_TRSEQ_SWFUNC(x)	    _SB_MAKEVALUE(x, S_BCM1480_SCD_TRSEQ_SWFUNC)
3748c2ecf20Sopenharmony_ci#define G_BCM1480_SCD_TRSEQ_SWFUNC(x)	    _SB_GETVALUE(x, S_BCM1480_SCD_TRSEQ_SWFUNC, M_BCM1480_SCD_TRSEQ_SWFUNC)
3758c2ecf20Sopenharmony_ci
3768c2ecf20Sopenharmony_ci/*
3778c2ecf20Sopenharmony_ci * Trace Control Register (Table 49)
3788c2ecf20Sopenharmony_ci * Register: TRACE_CFG
3798c2ecf20Sopenharmony_ci *
3808c2ecf20Sopenharmony_ci * BCM1480 changes to this register (other than location of the CUR_ADDR field)
3818c2ecf20Sopenharmony_ci * are defined below.
3828c2ecf20Sopenharmony_ci */
3838c2ecf20Sopenharmony_ci
3848c2ecf20Sopenharmony_ci#define S_BCM1480_SCD_TRACE_CFG_MODE	    16
3858c2ecf20Sopenharmony_ci#define M_BCM1480_SCD_TRACE_CFG_MODE	    _SB_MAKEMASK(2, S_BCM1480_SCD_TRACE_CFG_MODE)
3868c2ecf20Sopenharmony_ci#define V_BCM1480_SCD_TRACE_CFG_MODE(x)	    _SB_MAKEVALUE(x, S_BCM1480_SCD_TRACE_CFG_MODE)
3878c2ecf20Sopenharmony_ci#define G_BCM1480_SCD_TRACE_CFG_MODE(x)	    _SB_GETVALUE(x, S_BCM1480_SCD_TRACE_CFG_MODE, M_BCM1480_SCD_TRACE_CFG_MODE)
3888c2ecf20Sopenharmony_ci
3898c2ecf20Sopenharmony_ci#define K_BCM1480_SCD_TRACE_CFG_MODE_BLOCKERS	0
3908c2ecf20Sopenharmony_ci#define K_BCM1480_SCD_TRACE_CFG_MODE_BYTEEN_INT 1
3918c2ecf20Sopenharmony_ci#define K_BCM1480_SCD_TRACE_CFG_MODE_FLOW_ID	2
3928c2ecf20Sopenharmony_ci
3938c2ecf20Sopenharmony_ci#endif /* _BCM1480_SCD_H */
394