18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* ********************************************************************* 38c2ecf20Sopenharmony_ci * SB1250 Board Support Package 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * SCD Constants and Macros File: sb1250_scd.h 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * This module contains constants and macros useful for 88c2ecf20Sopenharmony_ci * manipulating the System Control and Debug module on the 1250. 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * SB1250 specification level: User's manual 1/02/02 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 _SB1250_SCD_H 208c2ecf20Sopenharmony_ci#define _SB1250_SCD_H 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci#include <asm/sibyte/sb1250_defs.h> 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci/* ********************************************************************* 258c2ecf20Sopenharmony_ci * System control/debug registers 268c2ecf20Sopenharmony_ci ********************************************************************* */ 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci/* 298c2ecf20Sopenharmony_ci * System Revision Register (Table 4-1) 308c2ecf20Sopenharmony_ci */ 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci#define M_SYS_RESERVED _SB_MAKEMASK(8, 0) 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci#define S_SYS_REVISION _SB_MAKE64(8) 358c2ecf20Sopenharmony_ci#define M_SYS_REVISION _SB_MAKEMASK(8, S_SYS_REVISION) 368c2ecf20Sopenharmony_ci#define V_SYS_REVISION(x) _SB_MAKEVALUE(x, S_SYS_REVISION) 378c2ecf20Sopenharmony_ci#define G_SYS_REVISION(x) _SB_GETVALUE(x, S_SYS_REVISION, M_SYS_REVISION) 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_PASS1 0x01 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_PASS2 0x03 428c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_A1 0x03 /* Pass 2.0 WB */ 438c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_A2 0x04 /* Pass 2.0 FC */ 448c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_A3 0x05 /* Pass 2.1 FC */ 458c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_A4 0x06 /* Pass 2.1 WB */ 468c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_A6 0x07 /* OR 0x04 (A2) w/WID != 0 */ 478c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_A8 0x0b /* A8/A10 */ 488c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_A9 0x08 498c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_A10 K_SYS_REVISION_BCM1250_A8 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_PASS2_2 0x10 528c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_B0 K_SYS_REVISION_BCM1250_B1 538c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_B1 0x10 548c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_B2 0x11 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_C0 0x20 578c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_C1 0x21 588c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_C2 0x22 598c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_C3 0x23 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE_CHIP(1250) 628c2ecf20Sopenharmony_ci/* XXX: discourage people from using these constants. */ 638c2ecf20Sopenharmony_ci#define K_SYS_REVISION_PASS1 K_SYS_REVISION_BCM1250_PASS1 648c2ecf20Sopenharmony_ci#define K_SYS_REVISION_PASS2 K_SYS_REVISION_BCM1250_PASS2 658c2ecf20Sopenharmony_ci#define K_SYS_REVISION_PASS2_2 K_SYS_REVISION_BCM1250_PASS2_2 668c2ecf20Sopenharmony_ci#define K_SYS_REVISION_PASS3 K_SYS_REVISION_BCM1250_PASS3 678c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1250_PASS3 K_SYS_REVISION_BCM1250_C0 688c2ecf20Sopenharmony_ci#endif /* 1250 */ 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM112x_A1 0x20 718c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM112x_A2 0x21 728c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM112x_A3 0x22 738c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM112x_A4 0x23 748c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM112x_B0 0x30 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1480_S0 0x01 778c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1480_A1 0x02 788c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1480_A2 0x03 798c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1480_A3 0x04 808c2ecf20Sopenharmony_ci#define K_SYS_REVISION_BCM1480_B0 0x11 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci/*Cache size - 23:20 of revision register*/ 838c2ecf20Sopenharmony_ci#define S_SYS_L2C_SIZE _SB_MAKE64(20) 848c2ecf20Sopenharmony_ci#define M_SYS_L2C_SIZE _SB_MAKEMASK(4, S_SYS_L2C_SIZE) 858c2ecf20Sopenharmony_ci#define V_SYS_L2C_SIZE(x) _SB_MAKEVALUE(x, S_SYS_L2C_SIZE) 868c2ecf20Sopenharmony_ci#define G_SYS_L2C_SIZE(x) _SB_GETVALUE(x, S_SYS_L2C_SIZE, M_SYS_L2C_SIZE) 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ci#define K_SYS_L2C_SIZE_1MB 0 898c2ecf20Sopenharmony_ci#define K_SYS_L2C_SIZE_512KB 5 908c2ecf20Sopenharmony_ci#define K_SYS_L2C_SIZE_256KB 2 918c2ecf20Sopenharmony_ci#define K_SYS_L2C_SIZE_128KB 1 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci#define K_SYS_L2C_SIZE_BCM1250 K_SYS_L2C_SIZE_512KB 948c2ecf20Sopenharmony_ci#define K_SYS_L2C_SIZE_BCM1125 K_SYS_L2C_SIZE_256KB 958c2ecf20Sopenharmony_ci#define K_SYS_L2C_SIZE_BCM1122 K_SYS_L2C_SIZE_128KB 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_ci/* Number of CPU cores, bits 27:24 of revision register*/ 998c2ecf20Sopenharmony_ci#define S_SYS_NUM_CPUS _SB_MAKE64(24) 1008c2ecf20Sopenharmony_ci#define M_SYS_NUM_CPUS _SB_MAKEMASK(4, S_SYS_NUM_CPUS) 1018c2ecf20Sopenharmony_ci#define V_SYS_NUM_CPUS(x) _SB_MAKEVALUE(x, S_SYS_NUM_CPUS) 1028c2ecf20Sopenharmony_ci#define G_SYS_NUM_CPUS(x) _SB_GETVALUE(x, S_SYS_NUM_CPUS, M_SYS_NUM_CPUS) 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci/* XXX: discourage people from using these constants. */ 1068c2ecf20Sopenharmony_ci#define S_SYS_PART _SB_MAKE64(16) 1078c2ecf20Sopenharmony_ci#define M_SYS_PART _SB_MAKEMASK(16, S_SYS_PART) 1088c2ecf20Sopenharmony_ci#define V_SYS_PART(x) _SB_MAKEVALUE(x, S_SYS_PART) 1098c2ecf20Sopenharmony_ci#define G_SYS_PART(x) _SB_GETVALUE(x, S_SYS_PART, M_SYS_PART) 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ci/* XXX: discourage people from using these constants. */ 1128c2ecf20Sopenharmony_ci#define K_SYS_PART_SB1250 0x1250 1138c2ecf20Sopenharmony_ci#define K_SYS_PART_BCM1120 0x1121 1148c2ecf20Sopenharmony_ci#define K_SYS_PART_BCM1125 0x1123 1158c2ecf20Sopenharmony_ci#define K_SYS_PART_BCM1125H 0x1124 1168c2ecf20Sopenharmony_ci#define K_SYS_PART_BCM1122 0x1113 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ci/* The "peripheral set" (SOC type) is the low 4 bits of the "part" field. */ 1208c2ecf20Sopenharmony_ci#define S_SYS_SOC_TYPE _SB_MAKE64(16) 1218c2ecf20Sopenharmony_ci#define M_SYS_SOC_TYPE _SB_MAKEMASK(4, S_SYS_SOC_TYPE) 1228c2ecf20Sopenharmony_ci#define V_SYS_SOC_TYPE(x) _SB_MAKEVALUE(x, S_SYS_SOC_TYPE) 1238c2ecf20Sopenharmony_ci#define G_SYS_SOC_TYPE(x) _SB_GETVALUE(x, S_SYS_SOC_TYPE, M_SYS_SOC_TYPE) 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci#define K_SYS_SOC_TYPE_BCM1250 0x0 1268c2ecf20Sopenharmony_ci#define K_SYS_SOC_TYPE_BCM1120 0x1 1278c2ecf20Sopenharmony_ci#define K_SYS_SOC_TYPE_BCM1250_ALT 0x2 /* 1250pass2 w/ 1/4 L2. */ 1288c2ecf20Sopenharmony_ci#define K_SYS_SOC_TYPE_BCM1125 0x3 1298c2ecf20Sopenharmony_ci#define K_SYS_SOC_TYPE_BCM1125H 0x4 1308c2ecf20Sopenharmony_ci#define K_SYS_SOC_TYPE_BCM1250_ALT2 0x5 /* 1250pass2 w/ 1/2 L2. */ 1318c2ecf20Sopenharmony_ci#define K_SYS_SOC_TYPE_BCM1x80 0x6 1328c2ecf20Sopenharmony_ci#define K_SYS_SOC_TYPE_BCM1x55 0x7 1338c2ecf20Sopenharmony_ci 1348c2ecf20Sopenharmony_ci/* 1358c2ecf20Sopenharmony_ci * Calculate correct SOC type given a copy of system revision register. 1368c2ecf20Sopenharmony_ci * 1378c2ecf20Sopenharmony_ci * (For the assembler version, sysrev and dest may be the same register. 1388c2ecf20Sopenharmony_ci * Also, it clobbers AT.) 1398c2ecf20Sopenharmony_ci */ 1408c2ecf20Sopenharmony_ci#ifdef __ASSEMBLER__ 1418c2ecf20Sopenharmony_ci#define SYS_SOC_TYPE(dest, sysrev) \ 1428c2ecf20Sopenharmony_ci .set push ; \ 1438c2ecf20Sopenharmony_ci .set reorder ; \ 1448c2ecf20Sopenharmony_ci dsrl dest, sysrev, S_SYS_SOC_TYPE ; \ 1458c2ecf20Sopenharmony_ci andi dest, dest, (M_SYS_SOC_TYPE >> S_SYS_SOC_TYPE); \ 1468c2ecf20Sopenharmony_ci beq dest, K_SYS_SOC_TYPE_BCM1250_ALT, 991f ; \ 1478c2ecf20Sopenharmony_ci beq dest, K_SYS_SOC_TYPE_BCM1250_ALT2, 991f ; \ 1488c2ecf20Sopenharmony_ci b 992f ; \ 1498c2ecf20Sopenharmony_ci991: li dest, K_SYS_SOC_TYPE_BCM1250 ; \ 1508c2ecf20Sopenharmony_ci992: \ 1518c2ecf20Sopenharmony_ci .set pop 1528c2ecf20Sopenharmony_ci#else 1538c2ecf20Sopenharmony_ci#define SYS_SOC_TYPE(sysrev) \ 1548c2ecf20Sopenharmony_ci ((G_SYS_SOC_TYPE(sysrev) == K_SYS_SOC_TYPE_BCM1250_ALT \ 1558c2ecf20Sopenharmony_ci || G_SYS_SOC_TYPE(sysrev) == K_SYS_SOC_TYPE_BCM1250_ALT2) \ 1568c2ecf20Sopenharmony_ci ? K_SYS_SOC_TYPE_BCM1250 : G_SYS_SOC_TYPE(sysrev)) 1578c2ecf20Sopenharmony_ci#endif 1588c2ecf20Sopenharmony_ci 1598c2ecf20Sopenharmony_ci#define S_SYS_WID _SB_MAKE64(32) 1608c2ecf20Sopenharmony_ci#define M_SYS_WID _SB_MAKEMASK(32, S_SYS_WID) 1618c2ecf20Sopenharmony_ci#define V_SYS_WID(x) _SB_MAKEVALUE(x, S_SYS_WID) 1628c2ecf20Sopenharmony_ci#define G_SYS_WID(x) _SB_GETVALUE(x, S_SYS_WID, M_SYS_WID) 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ci/* 1658c2ecf20Sopenharmony_ci * System Manufacturing Register 1668c2ecf20Sopenharmony_ci * Register: SCD_SYSTEM_MANUF 1678c2ecf20Sopenharmony_ci */ 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE_1250_112x 1708c2ecf20Sopenharmony_ci/* Wafer ID: bits 31:0 */ 1718c2ecf20Sopenharmony_ci#define S_SYS_WAFERID1_200 _SB_MAKE64(0) 1728c2ecf20Sopenharmony_ci#define M_SYS_WAFERID1_200 _SB_MAKEMASK(32, S_SYS_WAFERID1_200) 1738c2ecf20Sopenharmony_ci#define V_SYS_WAFERID1_200(x) _SB_MAKEVALUE(x, S_SYS_WAFERID1_200) 1748c2ecf20Sopenharmony_ci#define G_SYS_WAFERID1_200(x) _SB_GETVALUE(x, S_SYS_WAFERID1_200, M_SYS_WAFERID1_200) 1758c2ecf20Sopenharmony_ci 1768c2ecf20Sopenharmony_ci#define S_SYS_BIN _SB_MAKE64(32) 1778c2ecf20Sopenharmony_ci#define M_SYS_BIN _SB_MAKEMASK(4, S_SYS_BIN) 1788c2ecf20Sopenharmony_ci#define V_SYS_BIN(x) _SB_MAKEVALUE(x, S_SYS_BIN) 1798c2ecf20Sopenharmony_ci#define G_SYS_BIN(x) _SB_GETVALUE(x, S_SYS_BIN, M_SYS_BIN) 1808c2ecf20Sopenharmony_ci 1818c2ecf20Sopenharmony_ci/* Wafer ID: bits 39:36 */ 1828c2ecf20Sopenharmony_ci#define S_SYS_WAFERID2_200 _SB_MAKE64(36) 1838c2ecf20Sopenharmony_ci#define M_SYS_WAFERID2_200 _SB_MAKEMASK(4, S_SYS_WAFERID2_200) 1848c2ecf20Sopenharmony_ci#define V_SYS_WAFERID2_200(x) _SB_MAKEVALUE(x, S_SYS_WAFERID2_200) 1858c2ecf20Sopenharmony_ci#define G_SYS_WAFERID2_200(x) _SB_GETVALUE(x, S_SYS_WAFERID2_200, M_SYS_WAFERID2_200) 1868c2ecf20Sopenharmony_ci 1878c2ecf20Sopenharmony_ci/* Wafer ID: bits 39:0 */ 1888c2ecf20Sopenharmony_ci#define S_SYS_WAFERID_300 _SB_MAKE64(0) 1898c2ecf20Sopenharmony_ci#define M_SYS_WAFERID_300 _SB_MAKEMASK(40, S_SYS_WAFERID_300) 1908c2ecf20Sopenharmony_ci#define V_SYS_WAFERID_300(x) _SB_MAKEVALUE(x, S_SYS_WAFERID_300) 1918c2ecf20Sopenharmony_ci#define G_SYS_WAFERID_300(x) _SB_GETVALUE(x, S_SYS_WAFERID_300, M_SYS_WAFERID_300) 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_ci#define S_SYS_XPOS _SB_MAKE64(40) 1948c2ecf20Sopenharmony_ci#define M_SYS_XPOS _SB_MAKEMASK(6, S_SYS_XPOS) 1958c2ecf20Sopenharmony_ci#define V_SYS_XPOS(x) _SB_MAKEVALUE(x, S_SYS_XPOS) 1968c2ecf20Sopenharmony_ci#define G_SYS_XPOS(x) _SB_GETVALUE(x, S_SYS_XPOS, M_SYS_XPOS) 1978c2ecf20Sopenharmony_ci 1988c2ecf20Sopenharmony_ci#define S_SYS_YPOS _SB_MAKE64(46) 1998c2ecf20Sopenharmony_ci#define M_SYS_YPOS _SB_MAKEMASK(6, S_SYS_YPOS) 2008c2ecf20Sopenharmony_ci#define V_SYS_YPOS(x) _SB_MAKEVALUE(x, S_SYS_YPOS) 2018c2ecf20Sopenharmony_ci#define G_SYS_YPOS(x) _SB_GETVALUE(x, S_SYS_YPOS, M_SYS_YPOS) 2028c2ecf20Sopenharmony_ci#endif 2038c2ecf20Sopenharmony_ci 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci/* 2068c2ecf20Sopenharmony_ci * System Config Register (Table 4-2) 2078c2ecf20Sopenharmony_ci * Register: SCD_SYSTEM_CFG 2088c2ecf20Sopenharmony_ci */ 2098c2ecf20Sopenharmony_ci 2108c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE_1250_112x 2118c2ecf20Sopenharmony_ci#define M_SYS_LDT_PLL_BYP _SB_MAKEMASK1(3) 2128c2ecf20Sopenharmony_ci#define M_SYS_PCI_SYNC_TEST_MODE _SB_MAKEMASK1(4) 2138c2ecf20Sopenharmony_ci#define M_SYS_IOB0_DIV _SB_MAKEMASK1(5) 2148c2ecf20Sopenharmony_ci#define M_SYS_IOB1_DIV _SB_MAKEMASK1(6) 2158c2ecf20Sopenharmony_ci 2168c2ecf20Sopenharmony_ci#define S_SYS_PLL_DIV _SB_MAKE64(7) 2178c2ecf20Sopenharmony_ci#define M_SYS_PLL_DIV _SB_MAKEMASK(5, S_SYS_PLL_DIV) 2188c2ecf20Sopenharmony_ci#define V_SYS_PLL_DIV(x) _SB_MAKEVALUE(x, S_SYS_PLL_DIV) 2198c2ecf20Sopenharmony_ci#define G_SYS_PLL_DIV(x) _SB_GETVALUE(x, S_SYS_PLL_DIV, M_SYS_PLL_DIV) 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_ci#define M_SYS_SER0_ENABLE _SB_MAKEMASK1(12) 2228c2ecf20Sopenharmony_ci#define M_SYS_SER0_RSTB_EN _SB_MAKEMASK1(13) 2238c2ecf20Sopenharmony_ci#define M_SYS_SER1_ENABLE _SB_MAKEMASK1(14) 2248c2ecf20Sopenharmony_ci#define M_SYS_SER1_RSTB_EN _SB_MAKEMASK1(15) 2258c2ecf20Sopenharmony_ci#define M_SYS_PCMCIA_ENABLE _SB_MAKEMASK1(16) 2268c2ecf20Sopenharmony_ci 2278c2ecf20Sopenharmony_ci#define S_SYS_BOOT_MODE _SB_MAKE64(17) 2288c2ecf20Sopenharmony_ci#define M_SYS_BOOT_MODE _SB_MAKEMASK(2, S_SYS_BOOT_MODE) 2298c2ecf20Sopenharmony_ci#define V_SYS_BOOT_MODE(x) _SB_MAKEVALUE(x, S_SYS_BOOT_MODE) 2308c2ecf20Sopenharmony_ci#define G_SYS_BOOT_MODE(x) _SB_GETVALUE(x, S_SYS_BOOT_MODE, M_SYS_BOOT_MODE) 2318c2ecf20Sopenharmony_ci#define K_SYS_BOOT_MODE_ROM32 0 2328c2ecf20Sopenharmony_ci#define K_SYS_BOOT_MODE_ROM8 1 2338c2ecf20Sopenharmony_ci#define K_SYS_BOOT_MODE_SMBUS_SMALL 2 2348c2ecf20Sopenharmony_ci#define K_SYS_BOOT_MODE_SMBUS_BIG 3 2358c2ecf20Sopenharmony_ci 2368c2ecf20Sopenharmony_ci#define M_SYS_PCI_HOST _SB_MAKEMASK1(19) 2378c2ecf20Sopenharmony_ci#define M_SYS_PCI_ARBITER _SB_MAKEMASK1(20) 2388c2ecf20Sopenharmony_ci#define M_SYS_SOUTH_ON_LDT _SB_MAKEMASK1(21) 2398c2ecf20Sopenharmony_ci#define M_SYS_BIG_ENDIAN _SB_MAKEMASK1(22) 2408c2ecf20Sopenharmony_ci#define M_SYS_GENCLK_EN _SB_MAKEMASK1(23) 2418c2ecf20Sopenharmony_ci#define M_SYS_LDT_TEST_EN _SB_MAKEMASK1(24) 2428c2ecf20Sopenharmony_ci#define M_SYS_GEN_PARITY_EN _SB_MAKEMASK1(25) 2438c2ecf20Sopenharmony_ci 2448c2ecf20Sopenharmony_ci#define S_SYS_CONFIG 26 2458c2ecf20Sopenharmony_ci#define M_SYS_CONFIG _SB_MAKEMASK(6, S_SYS_CONFIG) 2468c2ecf20Sopenharmony_ci#define V_SYS_CONFIG(x) _SB_MAKEVALUE(x, S_SYS_CONFIG) 2478c2ecf20Sopenharmony_ci#define G_SYS_CONFIG(x) _SB_GETVALUE(x, S_SYS_CONFIG, M_SYS_CONFIG) 2488c2ecf20Sopenharmony_ci 2498c2ecf20Sopenharmony_ci/* The following bits are writeable by JTAG only. */ 2508c2ecf20Sopenharmony_ci 2518c2ecf20Sopenharmony_ci#define M_SYS_CLKSTOP _SB_MAKEMASK1(32) 2528c2ecf20Sopenharmony_ci#define M_SYS_CLKSTEP _SB_MAKEMASK1(33) 2538c2ecf20Sopenharmony_ci 2548c2ecf20Sopenharmony_ci#define S_SYS_CLKCOUNT 34 2558c2ecf20Sopenharmony_ci#define M_SYS_CLKCOUNT _SB_MAKEMASK(8, S_SYS_CLKCOUNT) 2568c2ecf20Sopenharmony_ci#define V_SYS_CLKCOUNT(x) _SB_MAKEVALUE(x, S_SYS_CLKCOUNT) 2578c2ecf20Sopenharmony_ci#define G_SYS_CLKCOUNT(x) _SB_GETVALUE(x, S_SYS_CLKCOUNT, M_SYS_CLKCOUNT) 2588c2ecf20Sopenharmony_ci 2598c2ecf20Sopenharmony_ci#define M_SYS_PLL_BYPASS _SB_MAKEMASK1(42) 2608c2ecf20Sopenharmony_ci 2618c2ecf20Sopenharmony_ci#define S_SYS_PLL_IREF 43 2628c2ecf20Sopenharmony_ci#define M_SYS_PLL_IREF _SB_MAKEMASK(2, S_SYS_PLL_IREF) 2638c2ecf20Sopenharmony_ci 2648c2ecf20Sopenharmony_ci#define S_SYS_PLL_VCO 45 2658c2ecf20Sopenharmony_ci#define M_SYS_PLL_VCO _SB_MAKEMASK(2, S_SYS_PLL_VCO) 2668c2ecf20Sopenharmony_ci 2678c2ecf20Sopenharmony_ci#define S_SYS_PLL_VREG 47 2688c2ecf20Sopenharmony_ci#define M_SYS_PLL_VREG _SB_MAKEMASK(2, S_SYS_PLL_VREG) 2698c2ecf20Sopenharmony_ci 2708c2ecf20Sopenharmony_ci#define M_SYS_MEM_RESET _SB_MAKEMASK1(49) 2718c2ecf20Sopenharmony_ci#define M_SYS_L2C_RESET _SB_MAKEMASK1(50) 2728c2ecf20Sopenharmony_ci#define M_SYS_IO_RESET_0 _SB_MAKEMASK1(51) 2738c2ecf20Sopenharmony_ci#define M_SYS_IO_RESET_1 _SB_MAKEMASK1(52) 2748c2ecf20Sopenharmony_ci#define M_SYS_SCD_RESET _SB_MAKEMASK1(53) 2758c2ecf20Sopenharmony_ci 2768c2ecf20Sopenharmony_ci/* End of bits writable by JTAG only. */ 2778c2ecf20Sopenharmony_ci 2788c2ecf20Sopenharmony_ci#define M_SYS_CPU_RESET_0 _SB_MAKEMASK1(54) 2798c2ecf20Sopenharmony_ci#define M_SYS_CPU_RESET_1 _SB_MAKEMASK1(55) 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_ci#define M_SYS_UNICPU0 _SB_MAKEMASK1(56) 2828c2ecf20Sopenharmony_ci#define M_SYS_UNICPU1 _SB_MAKEMASK1(57) 2838c2ecf20Sopenharmony_ci 2848c2ecf20Sopenharmony_ci#define M_SYS_SB_SOFTRES _SB_MAKEMASK1(58) 2858c2ecf20Sopenharmony_ci#define M_SYS_EXT_RESET _SB_MAKEMASK1(59) 2868c2ecf20Sopenharmony_ci#define M_SYS_SYSTEM_RESET _SB_MAKEMASK1(60) 2878c2ecf20Sopenharmony_ci 2888c2ecf20Sopenharmony_ci#define M_SYS_MISR_MODE _SB_MAKEMASK1(61) 2898c2ecf20Sopenharmony_ci#define M_SYS_MISR_RESET _SB_MAKEMASK1(62) 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 2928c2ecf20Sopenharmony_ci#define M_SYS_SW_FLAG _SB_MAKEMASK1(63) 2938c2ecf20Sopenharmony_ci#endif /* 1250 PASS2 || 112x PASS1 */ 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_ci#endif 2968c2ecf20Sopenharmony_ci 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_ci/* 2998c2ecf20Sopenharmony_ci * Mailbox Registers (Table 4-3) 3008c2ecf20Sopenharmony_ci * Registers: SCD_MBOX_CPU_x 3018c2ecf20Sopenharmony_ci */ 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_ci#define S_MBOX_INT_3 0 3048c2ecf20Sopenharmony_ci#define M_MBOX_INT_3 _SB_MAKEMASK(16, S_MBOX_INT_3) 3058c2ecf20Sopenharmony_ci#define S_MBOX_INT_2 16 3068c2ecf20Sopenharmony_ci#define M_MBOX_INT_2 _SB_MAKEMASK(16, S_MBOX_INT_2) 3078c2ecf20Sopenharmony_ci#define S_MBOX_INT_1 32 3088c2ecf20Sopenharmony_ci#define M_MBOX_INT_1 _SB_MAKEMASK(16, S_MBOX_INT_1) 3098c2ecf20Sopenharmony_ci#define S_MBOX_INT_0 48 3108c2ecf20Sopenharmony_ci#define M_MBOX_INT_0 _SB_MAKEMASK(16, S_MBOX_INT_0) 3118c2ecf20Sopenharmony_ci 3128c2ecf20Sopenharmony_ci/* 3138c2ecf20Sopenharmony_ci * Watchdog Registers (Table 4-8) (Table 4-9) (Table 4-10) 3148c2ecf20Sopenharmony_ci * Registers: SCD_WDOG_INIT_CNT_x 3158c2ecf20Sopenharmony_ci */ 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_ci#define V_SCD_WDOG_FREQ 1000000 3188c2ecf20Sopenharmony_ci 3198c2ecf20Sopenharmony_ci#define S_SCD_WDOG_INIT 0 3208c2ecf20Sopenharmony_ci#define M_SCD_WDOG_INIT _SB_MAKEMASK(23, S_SCD_WDOG_INIT) 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_ci#define S_SCD_WDOG_CNT 0 3238c2ecf20Sopenharmony_ci#define M_SCD_WDOG_CNT _SB_MAKEMASK(23, S_SCD_WDOG_CNT) 3248c2ecf20Sopenharmony_ci 3258c2ecf20Sopenharmony_ci#define S_SCD_WDOG_ENABLE 0 3268c2ecf20Sopenharmony_ci#define M_SCD_WDOG_ENABLE _SB_MAKEMASK1(S_SCD_WDOG_ENABLE) 3278c2ecf20Sopenharmony_ci 3288c2ecf20Sopenharmony_ci#define S_SCD_WDOG_RESET_TYPE 2 3298c2ecf20Sopenharmony_ci#define M_SCD_WDOG_RESET_TYPE _SB_MAKEMASK(3, S_SCD_WDOG_RESET_TYPE) 3308c2ecf20Sopenharmony_ci#define V_SCD_WDOG_RESET_TYPE(x) _SB_MAKEVALUE(x, S_SCD_WDOG_RESET_TYPE) 3318c2ecf20Sopenharmony_ci#define G_SCD_WDOG_RESET_TYPE(x) _SB_GETVALUE(x, S_SCD_WDOG_RESET_TYPE, M_SCD_WDOG_RESET_TYPE) 3328c2ecf20Sopenharmony_ci 3338c2ecf20Sopenharmony_ci#define K_SCD_WDOG_RESET_FULL 0 /* actually, (x & 1) == 0 */ 3348c2ecf20Sopenharmony_ci#define K_SCD_WDOG_RESET_SOFT 1 3358c2ecf20Sopenharmony_ci#define K_SCD_WDOG_RESET_CPU0 3 3368c2ecf20Sopenharmony_ci#define K_SCD_WDOG_RESET_CPU1 5 3378c2ecf20Sopenharmony_ci#define K_SCD_WDOG_RESET_BOTH_CPUS 7 3388c2ecf20Sopenharmony_ci 3398c2ecf20Sopenharmony_ci/* This feature is present in 1250 C0 and later, but *not* in 112x A revs. */ 3408c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE(1250, PASS3) 3418c2ecf20Sopenharmony_ci#define S_SCD_WDOG_HAS_RESET 8 3428c2ecf20Sopenharmony_ci#define M_SCD_WDOG_HAS_RESET _SB_MAKEMASK1(S_SCD_WDOG_HAS_RESET) 3438c2ecf20Sopenharmony_ci#endif 3448c2ecf20Sopenharmony_ci 3458c2ecf20Sopenharmony_ci 3468c2ecf20Sopenharmony_ci/* 3478c2ecf20Sopenharmony_ci * Timer Registers (Table 4-11) (Table 4-12) (Table 4-13) 3488c2ecf20Sopenharmony_ci */ 3498c2ecf20Sopenharmony_ci 3508c2ecf20Sopenharmony_ci#define V_SCD_TIMER_FREQ 1000000 3518c2ecf20Sopenharmony_ci 3528c2ecf20Sopenharmony_ci#define S_SCD_TIMER_INIT 0 3538c2ecf20Sopenharmony_ci#define M_SCD_TIMER_INIT _SB_MAKEMASK(23, S_SCD_TIMER_INIT) 3548c2ecf20Sopenharmony_ci#define V_SCD_TIMER_INIT(x) _SB_MAKEVALUE(x, S_SCD_TIMER_INIT) 3558c2ecf20Sopenharmony_ci#define G_SCD_TIMER_INIT(x) _SB_GETVALUE(x, S_SCD_TIMER_INIT, M_SCD_TIMER_INIT) 3568c2ecf20Sopenharmony_ci 3578c2ecf20Sopenharmony_ci#define V_SCD_TIMER_WIDTH 23 3588c2ecf20Sopenharmony_ci#define S_SCD_TIMER_CNT 0 3598c2ecf20Sopenharmony_ci#define M_SCD_TIMER_CNT _SB_MAKEMASK(V_SCD_TIMER_WIDTH, S_SCD_TIMER_CNT) 3608c2ecf20Sopenharmony_ci#define V_SCD_TIMER_CNT(x) _SB_MAKEVALUE(x, S_SCD_TIMER_CNT) 3618c2ecf20Sopenharmony_ci#define G_SCD_TIMER_CNT(x) _SB_GETVALUE(x, S_SCD_TIMER_CNT, M_SCD_TIMER_CNT) 3628c2ecf20Sopenharmony_ci 3638c2ecf20Sopenharmony_ci#define M_SCD_TIMER_ENABLE _SB_MAKEMASK1(0) 3648c2ecf20Sopenharmony_ci#define M_SCD_TIMER_MODE _SB_MAKEMASK1(1) 3658c2ecf20Sopenharmony_ci#define M_SCD_TIMER_MODE_CONTINUOUS M_SCD_TIMER_MODE 3668c2ecf20Sopenharmony_ci 3678c2ecf20Sopenharmony_ci/* 3688c2ecf20Sopenharmony_ci * System Performance Counters 3698c2ecf20Sopenharmony_ci */ 3708c2ecf20Sopenharmony_ci 3718c2ecf20Sopenharmony_ci#define S_SPC_CFG_SRC0 0 3728c2ecf20Sopenharmony_ci#define M_SPC_CFG_SRC0 _SB_MAKEMASK(8, S_SPC_CFG_SRC0) 3738c2ecf20Sopenharmony_ci#define V_SPC_CFG_SRC0(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC0) 3748c2ecf20Sopenharmony_ci#define G_SPC_CFG_SRC0(x) _SB_GETVALUE(x, S_SPC_CFG_SRC0, M_SPC_CFG_SRC0) 3758c2ecf20Sopenharmony_ci 3768c2ecf20Sopenharmony_ci#define S_SPC_CFG_SRC1 8 3778c2ecf20Sopenharmony_ci#define M_SPC_CFG_SRC1 _SB_MAKEMASK(8, S_SPC_CFG_SRC1) 3788c2ecf20Sopenharmony_ci#define V_SPC_CFG_SRC1(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC1) 3798c2ecf20Sopenharmony_ci#define G_SPC_CFG_SRC1(x) _SB_GETVALUE(x, S_SPC_CFG_SRC1, M_SPC_CFG_SRC1) 3808c2ecf20Sopenharmony_ci 3818c2ecf20Sopenharmony_ci#define S_SPC_CFG_SRC2 16 3828c2ecf20Sopenharmony_ci#define M_SPC_CFG_SRC2 _SB_MAKEMASK(8, S_SPC_CFG_SRC2) 3838c2ecf20Sopenharmony_ci#define V_SPC_CFG_SRC2(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC2) 3848c2ecf20Sopenharmony_ci#define G_SPC_CFG_SRC2(x) _SB_GETVALUE(x, S_SPC_CFG_SRC2, M_SPC_CFG_SRC2) 3858c2ecf20Sopenharmony_ci 3868c2ecf20Sopenharmony_ci#define S_SPC_CFG_SRC3 24 3878c2ecf20Sopenharmony_ci#define M_SPC_CFG_SRC3 _SB_MAKEMASK(8, S_SPC_CFG_SRC3) 3888c2ecf20Sopenharmony_ci#define V_SPC_CFG_SRC3(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC3) 3898c2ecf20Sopenharmony_ci#define G_SPC_CFG_SRC3(x) _SB_GETVALUE(x, S_SPC_CFG_SRC3, M_SPC_CFG_SRC3) 3908c2ecf20Sopenharmony_ci 3918c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE_1250_112x 3928c2ecf20Sopenharmony_ci#define M_SPC_CFG_CLEAR _SB_MAKEMASK1(32) 3938c2ecf20Sopenharmony_ci#define M_SPC_CFG_ENABLE _SB_MAKEMASK1(33) 3948c2ecf20Sopenharmony_ci#endif 3958c2ecf20Sopenharmony_ci 3968c2ecf20Sopenharmony_ci 3978c2ecf20Sopenharmony_ci/* 3988c2ecf20Sopenharmony_ci * Bus Watcher 3998c2ecf20Sopenharmony_ci */ 4008c2ecf20Sopenharmony_ci 4018c2ecf20Sopenharmony_ci#define S_SCD_BERR_TID 8 4028c2ecf20Sopenharmony_ci#define M_SCD_BERR_TID _SB_MAKEMASK(10, S_SCD_BERR_TID) 4038c2ecf20Sopenharmony_ci#define V_SCD_BERR_TID(x) _SB_MAKEVALUE(x, S_SCD_BERR_TID) 4048c2ecf20Sopenharmony_ci#define G_SCD_BERR_TID(x) _SB_GETVALUE(x, S_SCD_BERR_TID, M_SCD_BERR_TID) 4058c2ecf20Sopenharmony_ci 4068c2ecf20Sopenharmony_ci#define S_SCD_BERR_RID 18 4078c2ecf20Sopenharmony_ci#define M_SCD_BERR_RID _SB_MAKEMASK(4, S_SCD_BERR_RID) 4088c2ecf20Sopenharmony_ci#define V_SCD_BERR_RID(x) _SB_MAKEVALUE(x, S_SCD_BERR_RID) 4098c2ecf20Sopenharmony_ci#define G_SCD_BERR_RID(x) _SB_GETVALUE(x, S_SCD_BERR_RID, M_SCD_BERR_RID) 4108c2ecf20Sopenharmony_ci 4118c2ecf20Sopenharmony_ci#define S_SCD_BERR_DCODE 22 4128c2ecf20Sopenharmony_ci#define M_SCD_BERR_DCODE _SB_MAKEMASK(3, S_SCD_BERR_DCODE) 4138c2ecf20Sopenharmony_ci#define V_SCD_BERR_DCODE(x) _SB_MAKEVALUE(x, S_SCD_BERR_DCODE) 4148c2ecf20Sopenharmony_ci#define G_SCD_BERR_DCODE(x) _SB_GETVALUE(x, S_SCD_BERR_DCODE, M_SCD_BERR_DCODE) 4158c2ecf20Sopenharmony_ci 4168c2ecf20Sopenharmony_ci#define M_SCD_BERR_MULTERRS _SB_MAKEMASK1(30) 4178c2ecf20Sopenharmony_ci 4188c2ecf20Sopenharmony_ci 4198c2ecf20Sopenharmony_ci#define S_SCD_L2ECC_CORR_D 0 4208c2ecf20Sopenharmony_ci#define M_SCD_L2ECC_CORR_D _SB_MAKEMASK(8, S_SCD_L2ECC_CORR_D) 4218c2ecf20Sopenharmony_ci#define V_SCD_L2ECC_CORR_D(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_CORR_D) 4228c2ecf20Sopenharmony_ci#define G_SCD_L2ECC_CORR_D(x) _SB_GETVALUE(x, S_SCD_L2ECC_CORR_D, M_SCD_L2ECC_CORR_D) 4238c2ecf20Sopenharmony_ci 4248c2ecf20Sopenharmony_ci#define S_SCD_L2ECC_BAD_D 8 4258c2ecf20Sopenharmony_ci#define M_SCD_L2ECC_BAD_D _SB_MAKEMASK(8, S_SCD_L2ECC_BAD_D) 4268c2ecf20Sopenharmony_ci#define V_SCD_L2ECC_BAD_D(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_BAD_D) 4278c2ecf20Sopenharmony_ci#define G_SCD_L2ECC_BAD_D(x) _SB_GETVALUE(x, S_SCD_L2ECC_BAD_D, M_SCD_L2ECC_BAD_D) 4288c2ecf20Sopenharmony_ci 4298c2ecf20Sopenharmony_ci#define S_SCD_L2ECC_CORR_T 16 4308c2ecf20Sopenharmony_ci#define M_SCD_L2ECC_CORR_T _SB_MAKEMASK(8, S_SCD_L2ECC_CORR_T) 4318c2ecf20Sopenharmony_ci#define V_SCD_L2ECC_CORR_T(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_CORR_T) 4328c2ecf20Sopenharmony_ci#define G_SCD_L2ECC_CORR_T(x) _SB_GETVALUE(x, S_SCD_L2ECC_CORR_T, M_SCD_L2ECC_CORR_T) 4338c2ecf20Sopenharmony_ci 4348c2ecf20Sopenharmony_ci#define S_SCD_L2ECC_BAD_T 24 4358c2ecf20Sopenharmony_ci#define M_SCD_L2ECC_BAD_T _SB_MAKEMASK(8, S_SCD_L2ECC_BAD_T) 4368c2ecf20Sopenharmony_ci#define V_SCD_L2ECC_BAD_T(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_BAD_T) 4378c2ecf20Sopenharmony_ci#define G_SCD_L2ECC_BAD_T(x) _SB_GETVALUE(x, S_SCD_L2ECC_BAD_T, M_SCD_L2ECC_BAD_T) 4388c2ecf20Sopenharmony_ci 4398c2ecf20Sopenharmony_ci#define S_SCD_MEM_ECC_CORR 0 4408c2ecf20Sopenharmony_ci#define M_SCD_MEM_ECC_CORR _SB_MAKEMASK(8, S_SCD_MEM_ECC_CORR) 4418c2ecf20Sopenharmony_ci#define V_SCD_MEM_ECC_CORR(x) _SB_MAKEVALUE(x, S_SCD_MEM_ECC_CORR) 4428c2ecf20Sopenharmony_ci#define G_SCD_MEM_ECC_CORR(x) _SB_GETVALUE(x, S_SCD_MEM_ECC_CORR, M_SCD_MEM_ECC_CORR) 4438c2ecf20Sopenharmony_ci 4448c2ecf20Sopenharmony_ci#define S_SCD_MEM_ECC_BAD 8 4458c2ecf20Sopenharmony_ci#define M_SCD_MEM_ECC_BAD _SB_MAKEMASK(8, S_SCD_MEM_ECC_BAD) 4468c2ecf20Sopenharmony_ci#define V_SCD_MEM_ECC_BAD(x) _SB_MAKEVALUE(x, S_SCD_MEM_ECC_BAD) 4478c2ecf20Sopenharmony_ci#define G_SCD_MEM_ECC_BAD(x) _SB_GETVALUE(x, S_SCD_MEM_ECC_BAD, M_SCD_MEM_ECC_BAD) 4488c2ecf20Sopenharmony_ci 4498c2ecf20Sopenharmony_ci#define S_SCD_MEM_BUSERR 16 4508c2ecf20Sopenharmony_ci#define M_SCD_MEM_BUSERR _SB_MAKEMASK(8, S_SCD_MEM_BUSERR) 4518c2ecf20Sopenharmony_ci#define V_SCD_MEM_BUSERR(x) _SB_MAKEVALUE(x, S_SCD_MEM_BUSERR) 4528c2ecf20Sopenharmony_ci#define G_SCD_MEM_BUSERR(x) _SB_GETVALUE(x, S_SCD_MEM_BUSERR, M_SCD_MEM_BUSERR) 4538c2ecf20Sopenharmony_ci 4548c2ecf20Sopenharmony_ci 4558c2ecf20Sopenharmony_ci/* 4568c2ecf20Sopenharmony_ci * Address Trap Registers 4578c2ecf20Sopenharmony_ci */ 4588c2ecf20Sopenharmony_ci 4598c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE_1250_112x 4608c2ecf20Sopenharmony_ci#define M_ATRAP_INDEX _SB_MAKEMASK(4, 0) 4618c2ecf20Sopenharmony_ci#define M_ATRAP_ADDRESS _SB_MAKEMASK(40, 0) 4628c2ecf20Sopenharmony_ci 4638c2ecf20Sopenharmony_ci#define S_ATRAP_CFG_CNT 0 4648c2ecf20Sopenharmony_ci#define M_ATRAP_CFG_CNT _SB_MAKEMASK(3, S_ATRAP_CFG_CNT) 4658c2ecf20Sopenharmony_ci#define V_ATRAP_CFG_CNT(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_CNT) 4668c2ecf20Sopenharmony_ci#define G_ATRAP_CFG_CNT(x) _SB_GETVALUE(x, S_ATRAP_CFG_CNT, M_ATRAP_CFG_CNT) 4678c2ecf20Sopenharmony_ci 4688c2ecf20Sopenharmony_ci#define M_ATRAP_CFG_WRITE _SB_MAKEMASK1(3) 4698c2ecf20Sopenharmony_ci#define M_ATRAP_CFG_ALL _SB_MAKEMASK1(4) 4708c2ecf20Sopenharmony_ci#define M_ATRAP_CFG_INV _SB_MAKEMASK1(5) 4718c2ecf20Sopenharmony_ci#define M_ATRAP_CFG_USESRC _SB_MAKEMASK1(6) 4728c2ecf20Sopenharmony_ci#define M_ATRAP_CFG_SRCINV _SB_MAKEMASK1(7) 4738c2ecf20Sopenharmony_ci 4748c2ecf20Sopenharmony_ci#define S_ATRAP_CFG_AGENTID 8 4758c2ecf20Sopenharmony_ci#define M_ATRAP_CFG_AGENTID _SB_MAKEMASK(4, S_ATRAP_CFG_AGENTID) 4768c2ecf20Sopenharmony_ci#define V_ATRAP_CFG_AGENTID(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_AGENTID) 4778c2ecf20Sopenharmony_ci#define G_ATRAP_CFG_AGENTID(x) _SB_GETVALUE(x, S_ATRAP_CFG_AGENTID, M_ATRAP_CFG_AGENTID) 4788c2ecf20Sopenharmony_ci 4798c2ecf20Sopenharmony_ci#define K_BUS_AGENT_CPU0 0 4808c2ecf20Sopenharmony_ci#define K_BUS_AGENT_CPU1 1 4818c2ecf20Sopenharmony_ci#define K_BUS_AGENT_IOB0 2 4828c2ecf20Sopenharmony_ci#define K_BUS_AGENT_IOB1 3 4838c2ecf20Sopenharmony_ci#define K_BUS_AGENT_SCD 4 4848c2ecf20Sopenharmony_ci#define K_BUS_AGENT_L2C 6 4858c2ecf20Sopenharmony_ci#define K_BUS_AGENT_MC 7 4868c2ecf20Sopenharmony_ci 4878c2ecf20Sopenharmony_ci#define S_ATRAP_CFG_CATTR 12 4888c2ecf20Sopenharmony_ci#define M_ATRAP_CFG_CATTR _SB_MAKEMASK(3, S_ATRAP_CFG_CATTR) 4898c2ecf20Sopenharmony_ci#define V_ATRAP_CFG_CATTR(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_CATTR) 4908c2ecf20Sopenharmony_ci#define G_ATRAP_CFG_CATTR(x) _SB_GETVALUE(x, S_ATRAP_CFG_CATTR, M_ATRAP_CFG_CATTR) 4918c2ecf20Sopenharmony_ci 4928c2ecf20Sopenharmony_ci#define K_ATRAP_CFG_CATTR_IGNORE 0 4938c2ecf20Sopenharmony_ci#define K_ATRAP_CFG_CATTR_UNC 1 4948c2ecf20Sopenharmony_ci#define K_ATRAP_CFG_CATTR_CACHEABLE 2 4958c2ecf20Sopenharmony_ci#define K_ATRAP_CFG_CATTR_NONCOH 3 4968c2ecf20Sopenharmony_ci#define K_ATRAP_CFG_CATTR_COHERENT 4 4978c2ecf20Sopenharmony_ci#define K_ATRAP_CFG_CATTR_NOTUNC 5 4988c2ecf20Sopenharmony_ci#define K_ATRAP_CFG_CATTR_NOTNONCOH 6 4998c2ecf20Sopenharmony_ci#define K_ATRAP_CFG_CATTR_NOTCOHERENT 7 5008c2ecf20Sopenharmony_ci 5018c2ecf20Sopenharmony_ci#endif /* 1250/112x */ 5028c2ecf20Sopenharmony_ci 5038c2ecf20Sopenharmony_ci/* 5048c2ecf20Sopenharmony_ci * Trace Buffer Config register 5058c2ecf20Sopenharmony_ci */ 5068c2ecf20Sopenharmony_ci 5078c2ecf20Sopenharmony_ci#define M_SCD_TRACE_CFG_RESET _SB_MAKEMASK1(0) 5088c2ecf20Sopenharmony_ci#define M_SCD_TRACE_CFG_START_READ _SB_MAKEMASK1(1) 5098c2ecf20Sopenharmony_ci#define M_SCD_TRACE_CFG_START _SB_MAKEMASK1(2) 5108c2ecf20Sopenharmony_ci#define M_SCD_TRACE_CFG_STOP _SB_MAKEMASK1(3) 5118c2ecf20Sopenharmony_ci#define M_SCD_TRACE_CFG_FREEZE _SB_MAKEMASK1(4) 5128c2ecf20Sopenharmony_ci#define M_SCD_TRACE_CFG_FREEZE_FULL _SB_MAKEMASK1(5) 5138c2ecf20Sopenharmony_ci#define M_SCD_TRACE_CFG_DEBUG_FULL _SB_MAKEMASK1(6) 5148c2ecf20Sopenharmony_ci#define M_SCD_TRACE_CFG_FULL _SB_MAKEMASK1(7) 5158c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) 5168c2ecf20Sopenharmony_ci#define M_SCD_TRACE_CFG_FORCECNT _SB_MAKEMASK1(8) 5178c2ecf20Sopenharmony_ci#endif /* 1250 PASS2 || 112x PASS1 || 1480 */ 5188c2ecf20Sopenharmony_ci 5198c2ecf20Sopenharmony_ci/* 5208c2ecf20Sopenharmony_ci * This field is the same on the 1250/112x and 1480, just located in 5218c2ecf20Sopenharmony_ci * a slightly different place in the register. 5228c2ecf20Sopenharmony_ci */ 5238c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE_1250_112x 5248c2ecf20Sopenharmony_ci#define S_SCD_TRACE_CFG_CUR_ADDR 10 5258c2ecf20Sopenharmony_ci#else 5268c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE_CHIP(1480) 5278c2ecf20Sopenharmony_ci#define S_SCD_TRACE_CFG_CUR_ADDR 24 5288c2ecf20Sopenharmony_ci#endif /* 1480 */ 5298c2ecf20Sopenharmony_ci#endif /* 1250/112x */ 5308c2ecf20Sopenharmony_ci 5318c2ecf20Sopenharmony_ci#define M_SCD_TRACE_CFG_CUR_ADDR _SB_MAKEMASK(8, S_SCD_TRACE_CFG_CUR_ADDR) 5328c2ecf20Sopenharmony_ci#define V_SCD_TRACE_CFG_CUR_ADDR(x) _SB_MAKEVALUE(x, S_SCD_TRACE_CFG_CUR_ADDR) 5338c2ecf20Sopenharmony_ci#define G_SCD_TRACE_CFG_CUR_ADDR(x) _SB_GETVALUE(x, S_SCD_TRACE_CFG_CUR_ADDR, M_SCD_TRACE_CFG_CUR_ADDR) 5348c2ecf20Sopenharmony_ci 5358c2ecf20Sopenharmony_ci/* 5368c2ecf20Sopenharmony_ci * Trace Event registers 5378c2ecf20Sopenharmony_ci */ 5388c2ecf20Sopenharmony_ci 5398c2ecf20Sopenharmony_ci#define S_SCD_TREVT_ADDR_MATCH 0 5408c2ecf20Sopenharmony_ci#define M_SCD_TREVT_ADDR_MATCH _SB_MAKEMASK(4, S_SCD_TREVT_ADDR_MATCH) 5418c2ecf20Sopenharmony_ci#define V_SCD_TREVT_ADDR_MATCH(x) _SB_MAKEVALUE(x, S_SCD_TREVT_ADDR_MATCH) 5428c2ecf20Sopenharmony_ci#define G_SCD_TREVT_ADDR_MATCH(x) _SB_GETVALUE(x, S_SCD_TREVT_ADDR_MATCH, M_SCD_TREVT_ADDR_MATCH) 5438c2ecf20Sopenharmony_ci 5448c2ecf20Sopenharmony_ci#define M_SCD_TREVT_REQID_MATCH _SB_MAKEMASK1(4) 5458c2ecf20Sopenharmony_ci#define M_SCD_TREVT_DATAID_MATCH _SB_MAKEMASK1(5) 5468c2ecf20Sopenharmony_ci#define M_SCD_TREVT_RESPID_MATCH _SB_MAKEMASK1(6) 5478c2ecf20Sopenharmony_ci#define M_SCD_TREVT_INTERRUPT _SB_MAKEMASK1(7) 5488c2ecf20Sopenharmony_ci#define M_SCD_TREVT_DEBUG_PIN _SB_MAKEMASK1(9) 5498c2ecf20Sopenharmony_ci#define M_SCD_TREVT_WRITE _SB_MAKEMASK1(10) 5508c2ecf20Sopenharmony_ci#define M_SCD_TREVT_READ _SB_MAKEMASK1(11) 5518c2ecf20Sopenharmony_ci 5528c2ecf20Sopenharmony_ci#define S_SCD_TREVT_REQID 12 5538c2ecf20Sopenharmony_ci#define M_SCD_TREVT_REQID _SB_MAKEMASK(4, S_SCD_TREVT_REQID) 5548c2ecf20Sopenharmony_ci#define V_SCD_TREVT_REQID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_REQID) 5558c2ecf20Sopenharmony_ci#define G_SCD_TREVT_REQID(x) _SB_GETVALUE(x, S_SCD_TREVT_REQID, M_SCD_TREVT_REQID) 5568c2ecf20Sopenharmony_ci 5578c2ecf20Sopenharmony_ci#define S_SCD_TREVT_RESPID 16 5588c2ecf20Sopenharmony_ci#define M_SCD_TREVT_RESPID _SB_MAKEMASK(4, S_SCD_TREVT_RESPID) 5598c2ecf20Sopenharmony_ci#define V_SCD_TREVT_RESPID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_RESPID) 5608c2ecf20Sopenharmony_ci#define G_SCD_TREVT_RESPID(x) _SB_GETVALUE(x, S_SCD_TREVT_RESPID, M_SCD_TREVT_RESPID) 5618c2ecf20Sopenharmony_ci 5628c2ecf20Sopenharmony_ci#define S_SCD_TREVT_DATAID 20 5638c2ecf20Sopenharmony_ci#define M_SCD_TREVT_DATAID _SB_MAKEMASK(4, S_SCD_TREVT_DATAID) 5648c2ecf20Sopenharmony_ci#define V_SCD_TREVT_DATAID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_DATAID) 5658c2ecf20Sopenharmony_ci#define G_SCD_TREVT_DATAID(x) _SB_GETVALUE(x, S_SCD_TREVT_DATAID, M_SCD_TREVT_DATID) 5668c2ecf20Sopenharmony_ci 5678c2ecf20Sopenharmony_ci#define S_SCD_TREVT_COUNT 24 5688c2ecf20Sopenharmony_ci#define M_SCD_TREVT_COUNT _SB_MAKEMASK(8, S_SCD_TREVT_COUNT) 5698c2ecf20Sopenharmony_ci#define V_SCD_TREVT_COUNT(x) _SB_MAKEVALUE(x, S_SCD_TREVT_COUNT) 5708c2ecf20Sopenharmony_ci#define G_SCD_TREVT_COUNT(x) _SB_GETVALUE(x, S_SCD_TREVT_COUNT, M_SCD_TREVT_COUNT) 5718c2ecf20Sopenharmony_ci 5728c2ecf20Sopenharmony_ci/* 5738c2ecf20Sopenharmony_ci * Trace Sequence registers 5748c2ecf20Sopenharmony_ci */ 5758c2ecf20Sopenharmony_ci 5768c2ecf20Sopenharmony_ci#define S_SCD_TRSEQ_EVENT4 0 5778c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_EVENT4 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT4) 5788c2ecf20Sopenharmony_ci#define V_SCD_TRSEQ_EVENT4(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT4) 5798c2ecf20Sopenharmony_ci#define G_SCD_TRSEQ_EVENT4(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT4, M_SCD_TRSEQ_EVENT4) 5808c2ecf20Sopenharmony_ci 5818c2ecf20Sopenharmony_ci#define S_SCD_TRSEQ_EVENT3 4 5828c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_EVENT3 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT3) 5838c2ecf20Sopenharmony_ci#define V_SCD_TRSEQ_EVENT3(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT3) 5848c2ecf20Sopenharmony_ci#define G_SCD_TRSEQ_EVENT3(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT3, M_SCD_TRSEQ_EVENT3) 5858c2ecf20Sopenharmony_ci 5868c2ecf20Sopenharmony_ci#define S_SCD_TRSEQ_EVENT2 8 5878c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_EVENT2 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT2) 5888c2ecf20Sopenharmony_ci#define V_SCD_TRSEQ_EVENT2(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT2) 5898c2ecf20Sopenharmony_ci#define G_SCD_TRSEQ_EVENT2(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT2, M_SCD_TRSEQ_EVENT2) 5908c2ecf20Sopenharmony_ci 5918c2ecf20Sopenharmony_ci#define S_SCD_TRSEQ_EVENT1 12 5928c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_EVENT1 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT1) 5938c2ecf20Sopenharmony_ci#define V_SCD_TRSEQ_EVENT1(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT1) 5948c2ecf20Sopenharmony_ci#define G_SCD_TRSEQ_EVENT1(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT1, M_SCD_TRSEQ_EVENT1) 5958c2ecf20Sopenharmony_ci 5968c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E0 0 5978c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E1 1 5988c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E2 2 5998c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E3 3 6008c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E0_E1 4 6018c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E1_E2 5 6028c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E2_E3 6 6038c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E0_E1_E2 7 6048c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E0_E1_E2_E3 8 6058c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E0E1 9 6068c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E0E1E2 10 6078c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E0E1E2E3 11 6088c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E0E1_E2 12 6098c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E0E1_E2E3 13 6108c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_E0E1_E2_E3 14 6118c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_IGNORED 15 6128c2ecf20Sopenharmony_ci 6138c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_TRIGGER_ALL (V_SCD_TRSEQ_EVENT1(K_SCD_TRSEQ_IGNORED) | \ 6148c2ecf20Sopenharmony_ci V_SCD_TRSEQ_EVENT2(K_SCD_TRSEQ_IGNORED) | \ 6158c2ecf20Sopenharmony_ci V_SCD_TRSEQ_EVENT3(K_SCD_TRSEQ_IGNORED) | \ 6168c2ecf20Sopenharmony_ci V_SCD_TRSEQ_EVENT4(K_SCD_TRSEQ_IGNORED)) 6178c2ecf20Sopenharmony_ci 6188c2ecf20Sopenharmony_ci#define S_SCD_TRSEQ_FUNCTION 16 6198c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_FUNCTION _SB_MAKEMASK(4, S_SCD_TRSEQ_FUNCTION) 6208c2ecf20Sopenharmony_ci#define V_SCD_TRSEQ_FUNCTION(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_FUNCTION) 6218c2ecf20Sopenharmony_ci#define G_SCD_TRSEQ_FUNCTION(x) _SB_GETVALUE(x, S_SCD_TRSEQ_FUNCTION, M_SCD_TRSEQ_FUNCTION) 6228c2ecf20Sopenharmony_ci 6238c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_FUNC_NOP 0 6248c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_FUNC_START 1 6258c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_FUNC_STOP 2 6268c2ecf20Sopenharmony_ci#define K_SCD_TRSEQ_FUNC_FREEZE 3 6278c2ecf20Sopenharmony_ci 6288c2ecf20Sopenharmony_ci#define V_SCD_TRSEQ_FUNC_NOP V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_NOP) 6298c2ecf20Sopenharmony_ci#define V_SCD_TRSEQ_FUNC_START V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_START) 6308c2ecf20Sopenharmony_ci#define V_SCD_TRSEQ_FUNC_STOP V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_STOP) 6318c2ecf20Sopenharmony_ci#define V_SCD_TRSEQ_FUNC_FREEZE V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_FREEZE) 6328c2ecf20Sopenharmony_ci 6338c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_ASAMPLE _SB_MAKEMASK1(18) 6348c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_DSAMPLE _SB_MAKEMASK1(19) 6358c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_DEBUGPIN _SB_MAKEMASK1(20) 6368c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_DEBUGCPU _SB_MAKEMASK1(21) 6378c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_CLEARUSE _SB_MAKEMASK1(22) 6388c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_ALLD_A _SB_MAKEMASK1(23) 6398c2ecf20Sopenharmony_ci#define M_SCD_TRSEQ_ALL_A _SB_MAKEMASK1(24) 6408c2ecf20Sopenharmony_ci 6418c2ecf20Sopenharmony_ci#endif 642