1*1a59d1b8SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 2384740dcSRalf Baechle /* ********************************************************************* 3384740dcSRalf Baechle * SB1250 Board Support Package 4384740dcSRalf Baechle * 5384740dcSRalf Baechle * SCD Constants and Macros File: sb1250_scd.h 6384740dcSRalf Baechle * 7384740dcSRalf Baechle * This module contains constants and macros useful for 8384740dcSRalf Baechle * manipulating the System Control and Debug module on the 1250. 9384740dcSRalf Baechle * 10384740dcSRalf Baechle * SB1250 specification level: User's manual 1/02/02 11384740dcSRalf Baechle * 12384740dcSRalf Baechle ********************************************************************* 13384740dcSRalf Baechle * 14384740dcSRalf Baechle * Copyright 2000,2001,2002,2003,2004,2005 15384740dcSRalf Baechle * Broadcom Corporation. All rights reserved. 16384740dcSRalf Baechle * 17384740dcSRalf Baechle ********************************************************************* */ 18384740dcSRalf Baechle 19384740dcSRalf Baechle #ifndef _SB1250_SCD_H 20384740dcSRalf Baechle #define _SB1250_SCD_H 21384740dcSRalf Baechle 22a1ce3928SDavid Howells #include <asm/sibyte/sb1250_defs.h> 23384740dcSRalf Baechle 24384740dcSRalf Baechle /* ********************************************************************* 25384740dcSRalf Baechle * System control/debug registers 26384740dcSRalf Baechle ********************************************************************* */ 27384740dcSRalf Baechle 28384740dcSRalf Baechle /* 29384740dcSRalf Baechle * System Revision Register (Table 4-1) 30384740dcSRalf Baechle */ 31384740dcSRalf Baechle 32384740dcSRalf Baechle #define M_SYS_RESERVED _SB_MAKEMASK(8, 0) 33384740dcSRalf Baechle 34384740dcSRalf Baechle #define S_SYS_REVISION _SB_MAKE64(8) 35384740dcSRalf Baechle #define M_SYS_REVISION _SB_MAKEMASK(8, S_SYS_REVISION) 36384740dcSRalf Baechle #define V_SYS_REVISION(x) _SB_MAKEVALUE(x, S_SYS_REVISION) 37384740dcSRalf Baechle #define G_SYS_REVISION(x) _SB_GETVALUE(x, S_SYS_REVISION, M_SYS_REVISION) 38384740dcSRalf Baechle 39384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_PASS1 0x01 40384740dcSRalf Baechle 41384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_PASS2 0x03 42384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_A1 0x03 /* Pass 2.0 WB */ 43384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_A2 0x04 /* Pass 2.0 FC */ 44384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_A3 0x05 /* Pass 2.1 FC */ 45384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_A4 0x06 /* Pass 2.1 WB */ 46384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_A6 0x07 /* OR 0x04 (A2) w/WID != 0 */ 47384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_A8 0x0b /* A8/A10 */ 48384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_A9 0x08 49384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_A10 K_SYS_REVISION_BCM1250_A8 50384740dcSRalf Baechle 51384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_PASS2_2 0x10 52384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_B0 K_SYS_REVISION_BCM1250_B1 53384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_B1 0x10 54384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_B2 0x11 55384740dcSRalf Baechle 56384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_C0 0x20 57384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_C1 0x21 58384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_C2 0x22 59384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_C3 0x23 60384740dcSRalf Baechle 61384740dcSRalf Baechle #if SIBYTE_HDR_FEATURE_CHIP(1250) 62384740dcSRalf Baechle /* XXX: discourage people from using these constants. */ 63384740dcSRalf Baechle #define K_SYS_REVISION_PASS1 K_SYS_REVISION_BCM1250_PASS1 64384740dcSRalf Baechle #define K_SYS_REVISION_PASS2 K_SYS_REVISION_BCM1250_PASS2 65384740dcSRalf Baechle #define K_SYS_REVISION_PASS2_2 K_SYS_REVISION_BCM1250_PASS2_2 66384740dcSRalf Baechle #define K_SYS_REVISION_PASS3 K_SYS_REVISION_BCM1250_PASS3 67384740dcSRalf Baechle #define K_SYS_REVISION_BCM1250_PASS3 K_SYS_REVISION_BCM1250_C0 68384740dcSRalf Baechle #endif /* 1250 */ 69384740dcSRalf Baechle 70384740dcSRalf Baechle #define K_SYS_REVISION_BCM112x_A1 0x20 71384740dcSRalf Baechle #define K_SYS_REVISION_BCM112x_A2 0x21 72384740dcSRalf Baechle #define K_SYS_REVISION_BCM112x_A3 0x22 73384740dcSRalf Baechle #define K_SYS_REVISION_BCM112x_A4 0x23 74384740dcSRalf Baechle #define K_SYS_REVISION_BCM112x_B0 0x30 75384740dcSRalf Baechle 76384740dcSRalf Baechle #define K_SYS_REVISION_BCM1480_S0 0x01 77384740dcSRalf Baechle #define K_SYS_REVISION_BCM1480_A1 0x02 78384740dcSRalf Baechle #define K_SYS_REVISION_BCM1480_A2 0x03 79384740dcSRalf Baechle #define K_SYS_REVISION_BCM1480_A3 0x04 80384740dcSRalf Baechle #define K_SYS_REVISION_BCM1480_B0 0x11 81384740dcSRalf Baechle 82384740dcSRalf Baechle /*Cache size - 23:20 of revision register*/ 83384740dcSRalf Baechle #define S_SYS_L2C_SIZE _SB_MAKE64(20) 84384740dcSRalf Baechle #define M_SYS_L2C_SIZE _SB_MAKEMASK(4, S_SYS_L2C_SIZE) 85384740dcSRalf Baechle #define V_SYS_L2C_SIZE(x) _SB_MAKEVALUE(x, S_SYS_L2C_SIZE) 86384740dcSRalf Baechle #define G_SYS_L2C_SIZE(x) _SB_GETVALUE(x, S_SYS_L2C_SIZE, M_SYS_L2C_SIZE) 87384740dcSRalf Baechle 88384740dcSRalf Baechle #define K_SYS_L2C_SIZE_1MB 0 89384740dcSRalf Baechle #define K_SYS_L2C_SIZE_512KB 5 90384740dcSRalf Baechle #define K_SYS_L2C_SIZE_256KB 2 91384740dcSRalf Baechle #define K_SYS_L2C_SIZE_128KB 1 92384740dcSRalf Baechle 93384740dcSRalf Baechle #define K_SYS_L2C_SIZE_BCM1250 K_SYS_L2C_SIZE_512KB 94384740dcSRalf Baechle #define K_SYS_L2C_SIZE_BCM1125 K_SYS_L2C_SIZE_256KB 95384740dcSRalf Baechle #define K_SYS_L2C_SIZE_BCM1122 K_SYS_L2C_SIZE_128KB 96384740dcSRalf Baechle 97384740dcSRalf Baechle 98384740dcSRalf Baechle /* Number of CPU cores, bits 27:24 of revision register*/ 99384740dcSRalf Baechle #define S_SYS_NUM_CPUS _SB_MAKE64(24) 100384740dcSRalf Baechle #define M_SYS_NUM_CPUS _SB_MAKEMASK(4, S_SYS_NUM_CPUS) 101384740dcSRalf Baechle #define V_SYS_NUM_CPUS(x) _SB_MAKEVALUE(x, S_SYS_NUM_CPUS) 102384740dcSRalf Baechle #define G_SYS_NUM_CPUS(x) _SB_GETVALUE(x, S_SYS_NUM_CPUS, M_SYS_NUM_CPUS) 103384740dcSRalf Baechle 104384740dcSRalf Baechle 105384740dcSRalf Baechle /* XXX: discourage people from using these constants. */ 106384740dcSRalf Baechle #define S_SYS_PART _SB_MAKE64(16) 107384740dcSRalf Baechle #define M_SYS_PART _SB_MAKEMASK(16, S_SYS_PART) 108384740dcSRalf Baechle #define V_SYS_PART(x) _SB_MAKEVALUE(x, S_SYS_PART) 109384740dcSRalf Baechle #define G_SYS_PART(x) _SB_GETVALUE(x, S_SYS_PART, M_SYS_PART) 110384740dcSRalf Baechle 111384740dcSRalf Baechle /* XXX: discourage people from using these constants. */ 112384740dcSRalf Baechle #define K_SYS_PART_SB1250 0x1250 113384740dcSRalf Baechle #define K_SYS_PART_BCM1120 0x1121 114384740dcSRalf Baechle #define K_SYS_PART_BCM1125 0x1123 115384740dcSRalf Baechle #define K_SYS_PART_BCM1125H 0x1124 116384740dcSRalf Baechle #define K_SYS_PART_BCM1122 0x1113 117384740dcSRalf Baechle 118384740dcSRalf Baechle 119384740dcSRalf Baechle /* The "peripheral set" (SOC type) is the low 4 bits of the "part" field. */ 120384740dcSRalf Baechle #define S_SYS_SOC_TYPE _SB_MAKE64(16) 121384740dcSRalf Baechle #define M_SYS_SOC_TYPE _SB_MAKEMASK(4, S_SYS_SOC_TYPE) 122384740dcSRalf Baechle #define V_SYS_SOC_TYPE(x) _SB_MAKEVALUE(x, S_SYS_SOC_TYPE) 123384740dcSRalf Baechle #define G_SYS_SOC_TYPE(x) _SB_GETVALUE(x, S_SYS_SOC_TYPE, M_SYS_SOC_TYPE) 124384740dcSRalf Baechle 125384740dcSRalf Baechle #define K_SYS_SOC_TYPE_BCM1250 0x0 126384740dcSRalf Baechle #define K_SYS_SOC_TYPE_BCM1120 0x1 127384740dcSRalf Baechle #define K_SYS_SOC_TYPE_BCM1250_ALT 0x2 /* 1250pass2 w/ 1/4 L2. */ 128384740dcSRalf Baechle #define K_SYS_SOC_TYPE_BCM1125 0x3 129384740dcSRalf Baechle #define K_SYS_SOC_TYPE_BCM1125H 0x4 130384740dcSRalf Baechle #define K_SYS_SOC_TYPE_BCM1250_ALT2 0x5 /* 1250pass2 w/ 1/2 L2. */ 131384740dcSRalf Baechle #define K_SYS_SOC_TYPE_BCM1x80 0x6 132384740dcSRalf Baechle #define K_SYS_SOC_TYPE_BCM1x55 0x7 133384740dcSRalf Baechle 134384740dcSRalf Baechle /* 135384740dcSRalf Baechle * Calculate correct SOC type given a copy of system revision register. 136384740dcSRalf Baechle * 137384740dcSRalf Baechle * (For the assembler version, sysrev and dest may be the same register. 138384740dcSRalf Baechle * Also, it clobbers AT.) 139384740dcSRalf Baechle */ 140384740dcSRalf Baechle #ifdef __ASSEMBLER__ 141384740dcSRalf Baechle #define SYS_SOC_TYPE(dest, sysrev) \ 142384740dcSRalf Baechle .set push ; \ 143384740dcSRalf Baechle .set reorder ; \ 144384740dcSRalf Baechle dsrl dest, sysrev, S_SYS_SOC_TYPE ; \ 145384740dcSRalf Baechle andi dest, dest, (M_SYS_SOC_TYPE >> S_SYS_SOC_TYPE); \ 146384740dcSRalf Baechle beq dest, K_SYS_SOC_TYPE_BCM1250_ALT, 991f ; \ 147384740dcSRalf Baechle beq dest, K_SYS_SOC_TYPE_BCM1250_ALT2, 991f ; \ 148384740dcSRalf Baechle b 992f ; \ 149384740dcSRalf Baechle 991: li dest, K_SYS_SOC_TYPE_BCM1250 ; \ 150384740dcSRalf Baechle 992: \ 151384740dcSRalf Baechle .set pop 152384740dcSRalf Baechle #else 153384740dcSRalf Baechle #define SYS_SOC_TYPE(sysrev) \ 154384740dcSRalf Baechle ((G_SYS_SOC_TYPE(sysrev) == K_SYS_SOC_TYPE_BCM1250_ALT \ 155384740dcSRalf Baechle || G_SYS_SOC_TYPE(sysrev) == K_SYS_SOC_TYPE_BCM1250_ALT2) \ 156384740dcSRalf Baechle ? K_SYS_SOC_TYPE_BCM1250 : G_SYS_SOC_TYPE(sysrev)) 157384740dcSRalf Baechle #endif 158384740dcSRalf Baechle 159384740dcSRalf Baechle #define S_SYS_WID _SB_MAKE64(32) 160384740dcSRalf Baechle #define M_SYS_WID _SB_MAKEMASK(32, S_SYS_WID) 161384740dcSRalf Baechle #define V_SYS_WID(x) _SB_MAKEVALUE(x, S_SYS_WID) 162384740dcSRalf Baechle #define G_SYS_WID(x) _SB_GETVALUE(x, S_SYS_WID, M_SYS_WID) 163384740dcSRalf Baechle 164384740dcSRalf Baechle /* 165384740dcSRalf Baechle * System Manufacturing Register 166384740dcSRalf Baechle * Register: SCD_SYSTEM_MANUF 167384740dcSRalf Baechle */ 168384740dcSRalf Baechle 169384740dcSRalf Baechle #if SIBYTE_HDR_FEATURE_1250_112x 170384740dcSRalf Baechle /* Wafer ID: bits 31:0 */ 171384740dcSRalf Baechle #define S_SYS_WAFERID1_200 _SB_MAKE64(0) 172384740dcSRalf Baechle #define M_SYS_WAFERID1_200 _SB_MAKEMASK(32, S_SYS_WAFERID1_200) 173384740dcSRalf Baechle #define V_SYS_WAFERID1_200(x) _SB_MAKEVALUE(x, S_SYS_WAFERID1_200) 174384740dcSRalf Baechle #define G_SYS_WAFERID1_200(x) _SB_GETVALUE(x, S_SYS_WAFERID1_200, M_SYS_WAFERID1_200) 175384740dcSRalf Baechle 176384740dcSRalf Baechle #define S_SYS_BIN _SB_MAKE64(32) 177384740dcSRalf Baechle #define M_SYS_BIN _SB_MAKEMASK(4, S_SYS_BIN) 178384740dcSRalf Baechle #define V_SYS_BIN(x) _SB_MAKEVALUE(x, S_SYS_BIN) 179384740dcSRalf Baechle #define G_SYS_BIN(x) _SB_GETVALUE(x, S_SYS_BIN, M_SYS_BIN) 180384740dcSRalf Baechle 181384740dcSRalf Baechle /* Wafer ID: bits 39:36 */ 182384740dcSRalf Baechle #define S_SYS_WAFERID2_200 _SB_MAKE64(36) 183384740dcSRalf Baechle #define M_SYS_WAFERID2_200 _SB_MAKEMASK(4, S_SYS_WAFERID2_200) 184384740dcSRalf Baechle #define V_SYS_WAFERID2_200(x) _SB_MAKEVALUE(x, S_SYS_WAFERID2_200) 185384740dcSRalf Baechle #define G_SYS_WAFERID2_200(x) _SB_GETVALUE(x, S_SYS_WAFERID2_200, M_SYS_WAFERID2_200) 186384740dcSRalf Baechle 187384740dcSRalf Baechle /* Wafer ID: bits 39:0 */ 188384740dcSRalf Baechle #define S_SYS_WAFERID_300 _SB_MAKE64(0) 189384740dcSRalf Baechle #define M_SYS_WAFERID_300 _SB_MAKEMASK(40, S_SYS_WAFERID_300) 190384740dcSRalf Baechle #define V_SYS_WAFERID_300(x) _SB_MAKEVALUE(x, S_SYS_WAFERID_300) 191384740dcSRalf Baechle #define G_SYS_WAFERID_300(x) _SB_GETVALUE(x, S_SYS_WAFERID_300, M_SYS_WAFERID_300) 192384740dcSRalf Baechle 193384740dcSRalf Baechle #define S_SYS_XPOS _SB_MAKE64(40) 194384740dcSRalf Baechle #define M_SYS_XPOS _SB_MAKEMASK(6, S_SYS_XPOS) 195384740dcSRalf Baechle #define V_SYS_XPOS(x) _SB_MAKEVALUE(x, S_SYS_XPOS) 196384740dcSRalf Baechle #define G_SYS_XPOS(x) _SB_GETVALUE(x, S_SYS_XPOS, M_SYS_XPOS) 197384740dcSRalf Baechle 198384740dcSRalf Baechle #define S_SYS_YPOS _SB_MAKE64(46) 199384740dcSRalf Baechle #define M_SYS_YPOS _SB_MAKEMASK(6, S_SYS_YPOS) 200384740dcSRalf Baechle #define V_SYS_YPOS(x) _SB_MAKEVALUE(x, S_SYS_YPOS) 201384740dcSRalf Baechle #define G_SYS_YPOS(x) _SB_GETVALUE(x, S_SYS_YPOS, M_SYS_YPOS) 202384740dcSRalf Baechle #endif 203384740dcSRalf Baechle 204384740dcSRalf Baechle 205384740dcSRalf Baechle /* 206384740dcSRalf Baechle * System Config Register (Table 4-2) 207384740dcSRalf Baechle * Register: SCD_SYSTEM_CFG 208384740dcSRalf Baechle */ 209384740dcSRalf Baechle 210384740dcSRalf Baechle #if SIBYTE_HDR_FEATURE_1250_112x 211384740dcSRalf Baechle #define M_SYS_LDT_PLL_BYP _SB_MAKEMASK1(3) 212384740dcSRalf Baechle #define M_SYS_PCI_SYNC_TEST_MODE _SB_MAKEMASK1(4) 213384740dcSRalf Baechle #define M_SYS_IOB0_DIV _SB_MAKEMASK1(5) 214384740dcSRalf Baechle #define M_SYS_IOB1_DIV _SB_MAKEMASK1(6) 215384740dcSRalf Baechle 216384740dcSRalf Baechle #define S_SYS_PLL_DIV _SB_MAKE64(7) 217384740dcSRalf Baechle #define M_SYS_PLL_DIV _SB_MAKEMASK(5, S_SYS_PLL_DIV) 218384740dcSRalf Baechle #define V_SYS_PLL_DIV(x) _SB_MAKEVALUE(x, S_SYS_PLL_DIV) 219384740dcSRalf Baechle #define G_SYS_PLL_DIV(x) _SB_GETVALUE(x, S_SYS_PLL_DIV, M_SYS_PLL_DIV) 220384740dcSRalf Baechle 221384740dcSRalf Baechle #define M_SYS_SER0_ENABLE _SB_MAKEMASK1(12) 222384740dcSRalf Baechle #define M_SYS_SER0_RSTB_EN _SB_MAKEMASK1(13) 223384740dcSRalf Baechle #define M_SYS_SER1_ENABLE _SB_MAKEMASK1(14) 224384740dcSRalf Baechle #define M_SYS_SER1_RSTB_EN _SB_MAKEMASK1(15) 225384740dcSRalf Baechle #define M_SYS_PCMCIA_ENABLE _SB_MAKEMASK1(16) 226384740dcSRalf Baechle 227384740dcSRalf Baechle #define S_SYS_BOOT_MODE _SB_MAKE64(17) 228384740dcSRalf Baechle #define M_SYS_BOOT_MODE _SB_MAKEMASK(2, S_SYS_BOOT_MODE) 229384740dcSRalf Baechle #define V_SYS_BOOT_MODE(x) _SB_MAKEVALUE(x, S_SYS_BOOT_MODE) 230384740dcSRalf Baechle #define G_SYS_BOOT_MODE(x) _SB_GETVALUE(x, S_SYS_BOOT_MODE, M_SYS_BOOT_MODE) 231384740dcSRalf Baechle #define K_SYS_BOOT_MODE_ROM32 0 232384740dcSRalf Baechle #define K_SYS_BOOT_MODE_ROM8 1 233384740dcSRalf Baechle #define K_SYS_BOOT_MODE_SMBUS_SMALL 2 234384740dcSRalf Baechle #define K_SYS_BOOT_MODE_SMBUS_BIG 3 235384740dcSRalf Baechle 236384740dcSRalf Baechle #define M_SYS_PCI_HOST _SB_MAKEMASK1(19) 237384740dcSRalf Baechle #define M_SYS_PCI_ARBITER _SB_MAKEMASK1(20) 238384740dcSRalf Baechle #define M_SYS_SOUTH_ON_LDT _SB_MAKEMASK1(21) 239384740dcSRalf Baechle #define M_SYS_BIG_ENDIAN _SB_MAKEMASK1(22) 240384740dcSRalf Baechle #define M_SYS_GENCLK_EN _SB_MAKEMASK1(23) 241384740dcSRalf Baechle #define M_SYS_LDT_TEST_EN _SB_MAKEMASK1(24) 242384740dcSRalf Baechle #define M_SYS_GEN_PARITY_EN _SB_MAKEMASK1(25) 243384740dcSRalf Baechle 244384740dcSRalf Baechle #define S_SYS_CONFIG 26 245384740dcSRalf Baechle #define M_SYS_CONFIG _SB_MAKEMASK(6, S_SYS_CONFIG) 246384740dcSRalf Baechle #define V_SYS_CONFIG(x) _SB_MAKEVALUE(x, S_SYS_CONFIG) 247384740dcSRalf Baechle #define G_SYS_CONFIG(x) _SB_GETVALUE(x, S_SYS_CONFIG, M_SYS_CONFIG) 248384740dcSRalf Baechle 249384740dcSRalf Baechle /* The following bits are writeable by JTAG only. */ 250384740dcSRalf Baechle 251384740dcSRalf Baechle #define M_SYS_CLKSTOP _SB_MAKEMASK1(32) 252384740dcSRalf Baechle #define M_SYS_CLKSTEP _SB_MAKEMASK1(33) 253384740dcSRalf Baechle 254384740dcSRalf Baechle #define S_SYS_CLKCOUNT 34 255384740dcSRalf Baechle #define M_SYS_CLKCOUNT _SB_MAKEMASK(8, S_SYS_CLKCOUNT) 256384740dcSRalf Baechle #define V_SYS_CLKCOUNT(x) _SB_MAKEVALUE(x, S_SYS_CLKCOUNT) 257384740dcSRalf Baechle #define G_SYS_CLKCOUNT(x) _SB_GETVALUE(x, S_SYS_CLKCOUNT, M_SYS_CLKCOUNT) 258384740dcSRalf Baechle 259384740dcSRalf Baechle #define M_SYS_PLL_BYPASS _SB_MAKEMASK1(42) 260384740dcSRalf Baechle 261384740dcSRalf Baechle #define S_SYS_PLL_IREF 43 262384740dcSRalf Baechle #define M_SYS_PLL_IREF _SB_MAKEMASK(2, S_SYS_PLL_IREF) 263384740dcSRalf Baechle 264384740dcSRalf Baechle #define S_SYS_PLL_VCO 45 265384740dcSRalf Baechle #define M_SYS_PLL_VCO _SB_MAKEMASK(2, S_SYS_PLL_VCO) 266384740dcSRalf Baechle 267384740dcSRalf Baechle #define S_SYS_PLL_VREG 47 268384740dcSRalf Baechle #define M_SYS_PLL_VREG _SB_MAKEMASK(2, S_SYS_PLL_VREG) 269384740dcSRalf Baechle 270384740dcSRalf Baechle #define M_SYS_MEM_RESET _SB_MAKEMASK1(49) 271384740dcSRalf Baechle #define M_SYS_L2C_RESET _SB_MAKEMASK1(50) 272384740dcSRalf Baechle #define M_SYS_IO_RESET_0 _SB_MAKEMASK1(51) 273384740dcSRalf Baechle #define M_SYS_IO_RESET_1 _SB_MAKEMASK1(52) 274384740dcSRalf Baechle #define M_SYS_SCD_RESET _SB_MAKEMASK1(53) 275384740dcSRalf Baechle 276384740dcSRalf Baechle /* End of bits writable by JTAG only. */ 277384740dcSRalf Baechle 278384740dcSRalf Baechle #define M_SYS_CPU_RESET_0 _SB_MAKEMASK1(54) 279384740dcSRalf Baechle #define M_SYS_CPU_RESET_1 _SB_MAKEMASK1(55) 280384740dcSRalf Baechle 281384740dcSRalf Baechle #define M_SYS_UNICPU0 _SB_MAKEMASK1(56) 282384740dcSRalf Baechle #define M_SYS_UNICPU1 _SB_MAKEMASK1(57) 283384740dcSRalf Baechle 284384740dcSRalf Baechle #define M_SYS_SB_SOFTRES _SB_MAKEMASK1(58) 285384740dcSRalf Baechle #define M_SYS_EXT_RESET _SB_MAKEMASK1(59) 286384740dcSRalf Baechle #define M_SYS_SYSTEM_RESET _SB_MAKEMASK1(60) 287384740dcSRalf Baechle 288384740dcSRalf Baechle #define M_SYS_MISR_MODE _SB_MAKEMASK1(61) 289384740dcSRalf Baechle #define M_SYS_MISR_RESET _SB_MAKEMASK1(62) 290384740dcSRalf Baechle 291384740dcSRalf Baechle #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 292384740dcSRalf Baechle #define M_SYS_SW_FLAG _SB_MAKEMASK1(63) 293384740dcSRalf Baechle #endif /* 1250 PASS2 || 112x PASS1 */ 294384740dcSRalf Baechle 295384740dcSRalf Baechle #endif 296384740dcSRalf Baechle 297384740dcSRalf Baechle 298384740dcSRalf Baechle /* 299384740dcSRalf Baechle * Mailbox Registers (Table 4-3) 300384740dcSRalf Baechle * Registers: SCD_MBOX_CPU_x 301384740dcSRalf Baechle */ 302384740dcSRalf Baechle 303384740dcSRalf Baechle #define S_MBOX_INT_3 0 304384740dcSRalf Baechle #define M_MBOX_INT_3 _SB_MAKEMASK(16, S_MBOX_INT_3) 305384740dcSRalf Baechle #define S_MBOX_INT_2 16 306384740dcSRalf Baechle #define M_MBOX_INT_2 _SB_MAKEMASK(16, S_MBOX_INT_2) 307384740dcSRalf Baechle #define S_MBOX_INT_1 32 308384740dcSRalf Baechle #define M_MBOX_INT_1 _SB_MAKEMASK(16, S_MBOX_INT_1) 309384740dcSRalf Baechle #define S_MBOX_INT_0 48 310384740dcSRalf Baechle #define M_MBOX_INT_0 _SB_MAKEMASK(16, S_MBOX_INT_0) 311384740dcSRalf Baechle 312384740dcSRalf Baechle /* 313384740dcSRalf Baechle * Watchdog Registers (Table 4-8) (Table 4-9) (Table 4-10) 314384740dcSRalf Baechle * Registers: SCD_WDOG_INIT_CNT_x 315384740dcSRalf Baechle */ 316384740dcSRalf Baechle 317384740dcSRalf Baechle #define V_SCD_WDOG_FREQ 1000000 318384740dcSRalf Baechle 319384740dcSRalf Baechle #define S_SCD_WDOG_INIT 0 320384740dcSRalf Baechle #define M_SCD_WDOG_INIT _SB_MAKEMASK(23, S_SCD_WDOG_INIT) 321384740dcSRalf Baechle 322384740dcSRalf Baechle #define S_SCD_WDOG_CNT 0 323384740dcSRalf Baechle #define M_SCD_WDOG_CNT _SB_MAKEMASK(23, S_SCD_WDOG_CNT) 324384740dcSRalf Baechle 325384740dcSRalf Baechle #define S_SCD_WDOG_ENABLE 0 326384740dcSRalf Baechle #define M_SCD_WDOG_ENABLE _SB_MAKEMASK1(S_SCD_WDOG_ENABLE) 327384740dcSRalf Baechle 328384740dcSRalf Baechle #define S_SCD_WDOG_RESET_TYPE 2 329384740dcSRalf Baechle #define M_SCD_WDOG_RESET_TYPE _SB_MAKEMASK(3, S_SCD_WDOG_RESET_TYPE) 330384740dcSRalf Baechle #define V_SCD_WDOG_RESET_TYPE(x) _SB_MAKEVALUE(x, S_SCD_WDOG_RESET_TYPE) 331384740dcSRalf Baechle #define G_SCD_WDOG_RESET_TYPE(x) _SB_GETVALUE(x, S_SCD_WDOG_RESET_TYPE, M_SCD_WDOG_RESET_TYPE) 332384740dcSRalf Baechle 333384740dcSRalf Baechle #define K_SCD_WDOG_RESET_FULL 0 /* actually, (x & 1) == 0 */ 334384740dcSRalf Baechle #define K_SCD_WDOG_RESET_SOFT 1 335384740dcSRalf Baechle #define K_SCD_WDOG_RESET_CPU0 3 336384740dcSRalf Baechle #define K_SCD_WDOG_RESET_CPU1 5 337384740dcSRalf Baechle #define K_SCD_WDOG_RESET_BOTH_CPUS 7 338384740dcSRalf Baechle 339384740dcSRalf Baechle /* This feature is present in 1250 C0 and later, but *not* in 112x A revs. */ 340384740dcSRalf Baechle #if SIBYTE_HDR_FEATURE(1250, PASS3) 341384740dcSRalf Baechle #define S_SCD_WDOG_HAS_RESET 8 342384740dcSRalf Baechle #define M_SCD_WDOG_HAS_RESET _SB_MAKEMASK1(S_SCD_WDOG_HAS_RESET) 343384740dcSRalf Baechle #endif 344384740dcSRalf Baechle 345384740dcSRalf Baechle 346384740dcSRalf Baechle /* 347384740dcSRalf Baechle * Timer Registers (Table 4-11) (Table 4-12) (Table 4-13) 348384740dcSRalf Baechle */ 349384740dcSRalf Baechle 350384740dcSRalf Baechle #define V_SCD_TIMER_FREQ 1000000 351384740dcSRalf Baechle 352384740dcSRalf Baechle #define S_SCD_TIMER_INIT 0 353384740dcSRalf Baechle #define M_SCD_TIMER_INIT _SB_MAKEMASK(23, S_SCD_TIMER_INIT) 354384740dcSRalf Baechle #define V_SCD_TIMER_INIT(x) _SB_MAKEVALUE(x, S_SCD_TIMER_INIT) 355384740dcSRalf Baechle #define G_SCD_TIMER_INIT(x) _SB_GETVALUE(x, S_SCD_TIMER_INIT, M_SCD_TIMER_INIT) 356384740dcSRalf Baechle 357384740dcSRalf Baechle #define V_SCD_TIMER_WIDTH 23 358384740dcSRalf Baechle #define S_SCD_TIMER_CNT 0 359384740dcSRalf Baechle #define M_SCD_TIMER_CNT _SB_MAKEMASK(V_SCD_TIMER_WIDTH, S_SCD_TIMER_CNT) 360384740dcSRalf Baechle #define V_SCD_TIMER_CNT(x) _SB_MAKEVALUE(x, S_SCD_TIMER_CNT) 361384740dcSRalf Baechle #define G_SCD_TIMER_CNT(x) _SB_GETVALUE(x, S_SCD_TIMER_CNT, M_SCD_TIMER_CNT) 362384740dcSRalf Baechle 363384740dcSRalf Baechle #define M_SCD_TIMER_ENABLE _SB_MAKEMASK1(0) 364384740dcSRalf Baechle #define M_SCD_TIMER_MODE _SB_MAKEMASK1(1) 365384740dcSRalf Baechle #define M_SCD_TIMER_MODE_CONTINUOUS M_SCD_TIMER_MODE 366384740dcSRalf Baechle 367384740dcSRalf Baechle /* 368384740dcSRalf Baechle * System Performance Counters 369384740dcSRalf Baechle */ 370384740dcSRalf Baechle 371384740dcSRalf Baechle #define S_SPC_CFG_SRC0 0 372384740dcSRalf Baechle #define M_SPC_CFG_SRC0 _SB_MAKEMASK(8, S_SPC_CFG_SRC0) 373384740dcSRalf Baechle #define V_SPC_CFG_SRC0(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC0) 374384740dcSRalf Baechle #define G_SPC_CFG_SRC0(x) _SB_GETVALUE(x, S_SPC_CFG_SRC0, M_SPC_CFG_SRC0) 375384740dcSRalf Baechle 376384740dcSRalf Baechle #define S_SPC_CFG_SRC1 8 377384740dcSRalf Baechle #define M_SPC_CFG_SRC1 _SB_MAKEMASK(8, S_SPC_CFG_SRC1) 378384740dcSRalf Baechle #define V_SPC_CFG_SRC1(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC1) 379384740dcSRalf Baechle #define G_SPC_CFG_SRC1(x) _SB_GETVALUE(x, S_SPC_CFG_SRC1, M_SPC_CFG_SRC1) 380384740dcSRalf Baechle 381384740dcSRalf Baechle #define S_SPC_CFG_SRC2 16 382384740dcSRalf Baechle #define M_SPC_CFG_SRC2 _SB_MAKEMASK(8, S_SPC_CFG_SRC2) 383384740dcSRalf Baechle #define V_SPC_CFG_SRC2(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC2) 384384740dcSRalf Baechle #define G_SPC_CFG_SRC2(x) _SB_GETVALUE(x, S_SPC_CFG_SRC2, M_SPC_CFG_SRC2) 385384740dcSRalf Baechle 386384740dcSRalf Baechle #define S_SPC_CFG_SRC3 24 387384740dcSRalf Baechle #define M_SPC_CFG_SRC3 _SB_MAKEMASK(8, S_SPC_CFG_SRC3) 388384740dcSRalf Baechle #define V_SPC_CFG_SRC3(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC3) 389384740dcSRalf Baechle #define G_SPC_CFG_SRC3(x) _SB_GETVALUE(x, S_SPC_CFG_SRC3, M_SPC_CFG_SRC3) 390384740dcSRalf Baechle 391384740dcSRalf Baechle #if SIBYTE_HDR_FEATURE_1250_112x 392384740dcSRalf Baechle #define M_SPC_CFG_CLEAR _SB_MAKEMASK1(32) 393384740dcSRalf Baechle #define M_SPC_CFG_ENABLE _SB_MAKEMASK1(33) 394384740dcSRalf Baechle #endif 395384740dcSRalf Baechle 396384740dcSRalf Baechle 397384740dcSRalf Baechle /* 398384740dcSRalf Baechle * Bus Watcher 399384740dcSRalf Baechle */ 400384740dcSRalf Baechle 401384740dcSRalf Baechle #define S_SCD_BERR_TID 8 402384740dcSRalf Baechle #define M_SCD_BERR_TID _SB_MAKEMASK(10, S_SCD_BERR_TID) 403384740dcSRalf Baechle #define V_SCD_BERR_TID(x) _SB_MAKEVALUE(x, S_SCD_BERR_TID) 404384740dcSRalf Baechle #define G_SCD_BERR_TID(x) _SB_GETVALUE(x, S_SCD_BERR_TID, M_SCD_BERR_TID) 405384740dcSRalf Baechle 406384740dcSRalf Baechle #define S_SCD_BERR_RID 18 407384740dcSRalf Baechle #define M_SCD_BERR_RID _SB_MAKEMASK(4, S_SCD_BERR_RID) 408384740dcSRalf Baechle #define V_SCD_BERR_RID(x) _SB_MAKEVALUE(x, S_SCD_BERR_RID) 409384740dcSRalf Baechle #define G_SCD_BERR_RID(x) _SB_GETVALUE(x, S_SCD_BERR_RID, M_SCD_BERR_RID) 410384740dcSRalf Baechle 411384740dcSRalf Baechle #define S_SCD_BERR_DCODE 22 412384740dcSRalf Baechle #define M_SCD_BERR_DCODE _SB_MAKEMASK(3, S_SCD_BERR_DCODE) 413384740dcSRalf Baechle #define V_SCD_BERR_DCODE(x) _SB_MAKEVALUE(x, S_SCD_BERR_DCODE) 414384740dcSRalf Baechle #define G_SCD_BERR_DCODE(x) _SB_GETVALUE(x, S_SCD_BERR_DCODE, M_SCD_BERR_DCODE) 415384740dcSRalf Baechle 416384740dcSRalf Baechle #define M_SCD_BERR_MULTERRS _SB_MAKEMASK1(30) 417384740dcSRalf Baechle 418384740dcSRalf Baechle 419384740dcSRalf Baechle #define S_SCD_L2ECC_CORR_D 0 420384740dcSRalf Baechle #define M_SCD_L2ECC_CORR_D _SB_MAKEMASK(8, S_SCD_L2ECC_CORR_D) 421384740dcSRalf Baechle #define V_SCD_L2ECC_CORR_D(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_CORR_D) 422384740dcSRalf Baechle #define G_SCD_L2ECC_CORR_D(x) _SB_GETVALUE(x, S_SCD_L2ECC_CORR_D, M_SCD_L2ECC_CORR_D) 423384740dcSRalf Baechle 424384740dcSRalf Baechle #define S_SCD_L2ECC_BAD_D 8 425384740dcSRalf Baechle #define M_SCD_L2ECC_BAD_D _SB_MAKEMASK(8, S_SCD_L2ECC_BAD_D) 426384740dcSRalf Baechle #define V_SCD_L2ECC_BAD_D(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_BAD_D) 427384740dcSRalf Baechle #define G_SCD_L2ECC_BAD_D(x) _SB_GETVALUE(x, S_SCD_L2ECC_BAD_D, M_SCD_L2ECC_BAD_D) 428384740dcSRalf Baechle 429384740dcSRalf Baechle #define S_SCD_L2ECC_CORR_T 16 430384740dcSRalf Baechle #define M_SCD_L2ECC_CORR_T _SB_MAKEMASK(8, S_SCD_L2ECC_CORR_T) 431384740dcSRalf Baechle #define V_SCD_L2ECC_CORR_T(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_CORR_T) 432384740dcSRalf Baechle #define G_SCD_L2ECC_CORR_T(x) _SB_GETVALUE(x, S_SCD_L2ECC_CORR_T, M_SCD_L2ECC_CORR_T) 433384740dcSRalf Baechle 434384740dcSRalf Baechle #define S_SCD_L2ECC_BAD_T 24 435384740dcSRalf Baechle #define M_SCD_L2ECC_BAD_T _SB_MAKEMASK(8, S_SCD_L2ECC_BAD_T) 436384740dcSRalf Baechle #define V_SCD_L2ECC_BAD_T(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_BAD_T) 437384740dcSRalf Baechle #define G_SCD_L2ECC_BAD_T(x) _SB_GETVALUE(x, S_SCD_L2ECC_BAD_T, M_SCD_L2ECC_BAD_T) 438384740dcSRalf Baechle 439384740dcSRalf Baechle #define S_SCD_MEM_ECC_CORR 0 440384740dcSRalf Baechle #define M_SCD_MEM_ECC_CORR _SB_MAKEMASK(8, S_SCD_MEM_ECC_CORR) 441384740dcSRalf Baechle #define V_SCD_MEM_ECC_CORR(x) _SB_MAKEVALUE(x, S_SCD_MEM_ECC_CORR) 442384740dcSRalf Baechle #define G_SCD_MEM_ECC_CORR(x) _SB_GETVALUE(x, S_SCD_MEM_ECC_CORR, M_SCD_MEM_ECC_CORR) 443384740dcSRalf Baechle 444384740dcSRalf Baechle #define S_SCD_MEM_ECC_BAD 8 445384740dcSRalf Baechle #define M_SCD_MEM_ECC_BAD _SB_MAKEMASK(8, S_SCD_MEM_ECC_BAD) 446384740dcSRalf Baechle #define V_SCD_MEM_ECC_BAD(x) _SB_MAKEVALUE(x, S_SCD_MEM_ECC_BAD) 447384740dcSRalf Baechle #define G_SCD_MEM_ECC_BAD(x) _SB_GETVALUE(x, S_SCD_MEM_ECC_BAD, M_SCD_MEM_ECC_BAD) 448384740dcSRalf Baechle 449384740dcSRalf Baechle #define S_SCD_MEM_BUSERR 16 450384740dcSRalf Baechle #define M_SCD_MEM_BUSERR _SB_MAKEMASK(8, S_SCD_MEM_BUSERR) 451384740dcSRalf Baechle #define V_SCD_MEM_BUSERR(x) _SB_MAKEVALUE(x, S_SCD_MEM_BUSERR) 452384740dcSRalf Baechle #define G_SCD_MEM_BUSERR(x) _SB_GETVALUE(x, S_SCD_MEM_BUSERR, M_SCD_MEM_BUSERR) 453384740dcSRalf Baechle 454384740dcSRalf Baechle 455384740dcSRalf Baechle /* 456384740dcSRalf Baechle * Address Trap Registers 457384740dcSRalf Baechle */ 458384740dcSRalf Baechle 459384740dcSRalf Baechle #if SIBYTE_HDR_FEATURE_1250_112x 460384740dcSRalf Baechle #define M_ATRAP_INDEX _SB_MAKEMASK(4, 0) 461384740dcSRalf Baechle #define M_ATRAP_ADDRESS _SB_MAKEMASK(40, 0) 462384740dcSRalf Baechle 463384740dcSRalf Baechle #define S_ATRAP_CFG_CNT 0 464384740dcSRalf Baechle #define M_ATRAP_CFG_CNT _SB_MAKEMASK(3, S_ATRAP_CFG_CNT) 465384740dcSRalf Baechle #define V_ATRAP_CFG_CNT(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_CNT) 466384740dcSRalf Baechle #define G_ATRAP_CFG_CNT(x) _SB_GETVALUE(x, S_ATRAP_CFG_CNT, M_ATRAP_CFG_CNT) 467384740dcSRalf Baechle 468384740dcSRalf Baechle #define M_ATRAP_CFG_WRITE _SB_MAKEMASK1(3) 469384740dcSRalf Baechle #define M_ATRAP_CFG_ALL _SB_MAKEMASK1(4) 470384740dcSRalf Baechle #define M_ATRAP_CFG_INV _SB_MAKEMASK1(5) 471384740dcSRalf Baechle #define M_ATRAP_CFG_USESRC _SB_MAKEMASK1(6) 472384740dcSRalf Baechle #define M_ATRAP_CFG_SRCINV _SB_MAKEMASK1(7) 473384740dcSRalf Baechle 474384740dcSRalf Baechle #define S_ATRAP_CFG_AGENTID 8 475384740dcSRalf Baechle #define M_ATRAP_CFG_AGENTID _SB_MAKEMASK(4, S_ATRAP_CFG_AGENTID) 476384740dcSRalf Baechle #define V_ATRAP_CFG_AGENTID(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_AGENTID) 477384740dcSRalf Baechle #define G_ATRAP_CFG_AGENTID(x) _SB_GETVALUE(x, S_ATRAP_CFG_AGENTID, M_ATRAP_CFG_AGENTID) 478384740dcSRalf Baechle 479384740dcSRalf Baechle #define K_BUS_AGENT_CPU0 0 480384740dcSRalf Baechle #define K_BUS_AGENT_CPU1 1 481384740dcSRalf Baechle #define K_BUS_AGENT_IOB0 2 482384740dcSRalf Baechle #define K_BUS_AGENT_IOB1 3 483384740dcSRalf Baechle #define K_BUS_AGENT_SCD 4 484384740dcSRalf Baechle #define K_BUS_AGENT_L2C 6 485384740dcSRalf Baechle #define K_BUS_AGENT_MC 7 486384740dcSRalf Baechle 487384740dcSRalf Baechle #define S_ATRAP_CFG_CATTR 12 488384740dcSRalf Baechle #define M_ATRAP_CFG_CATTR _SB_MAKEMASK(3, S_ATRAP_CFG_CATTR) 489384740dcSRalf Baechle #define V_ATRAP_CFG_CATTR(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_CATTR) 490384740dcSRalf Baechle #define G_ATRAP_CFG_CATTR(x) _SB_GETVALUE(x, S_ATRAP_CFG_CATTR, M_ATRAP_CFG_CATTR) 491384740dcSRalf Baechle 492384740dcSRalf Baechle #define K_ATRAP_CFG_CATTR_IGNORE 0 493384740dcSRalf Baechle #define K_ATRAP_CFG_CATTR_UNC 1 494384740dcSRalf Baechle #define K_ATRAP_CFG_CATTR_CACHEABLE 2 495384740dcSRalf Baechle #define K_ATRAP_CFG_CATTR_NONCOH 3 496384740dcSRalf Baechle #define K_ATRAP_CFG_CATTR_COHERENT 4 497384740dcSRalf Baechle #define K_ATRAP_CFG_CATTR_NOTUNC 5 498384740dcSRalf Baechle #define K_ATRAP_CFG_CATTR_NOTNONCOH 6 499384740dcSRalf Baechle #define K_ATRAP_CFG_CATTR_NOTCOHERENT 7 500384740dcSRalf Baechle 501384740dcSRalf Baechle #endif /* 1250/112x */ 502384740dcSRalf Baechle 503384740dcSRalf Baechle /* 504384740dcSRalf Baechle * Trace Buffer Config register 505384740dcSRalf Baechle */ 506384740dcSRalf Baechle 507384740dcSRalf Baechle #define M_SCD_TRACE_CFG_RESET _SB_MAKEMASK1(0) 508384740dcSRalf Baechle #define M_SCD_TRACE_CFG_START_READ _SB_MAKEMASK1(1) 509384740dcSRalf Baechle #define M_SCD_TRACE_CFG_START _SB_MAKEMASK1(2) 510384740dcSRalf Baechle #define M_SCD_TRACE_CFG_STOP _SB_MAKEMASK1(3) 511384740dcSRalf Baechle #define M_SCD_TRACE_CFG_FREEZE _SB_MAKEMASK1(4) 512384740dcSRalf Baechle #define M_SCD_TRACE_CFG_FREEZE_FULL _SB_MAKEMASK1(5) 513384740dcSRalf Baechle #define M_SCD_TRACE_CFG_DEBUG_FULL _SB_MAKEMASK1(6) 514384740dcSRalf Baechle #define M_SCD_TRACE_CFG_FULL _SB_MAKEMASK1(7) 515384740dcSRalf Baechle #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) 516384740dcSRalf Baechle #define M_SCD_TRACE_CFG_FORCECNT _SB_MAKEMASK1(8) 517384740dcSRalf Baechle #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ 518384740dcSRalf Baechle 519384740dcSRalf Baechle /* 520384740dcSRalf Baechle * This field is the same on the 1250/112x and 1480, just located in 521384740dcSRalf Baechle * a slightly different place in the register. 522384740dcSRalf Baechle */ 523384740dcSRalf Baechle #if SIBYTE_HDR_FEATURE_1250_112x 524384740dcSRalf Baechle #define S_SCD_TRACE_CFG_CUR_ADDR 10 525384740dcSRalf Baechle #else 526384740dcSRalf Baechle #if SIBYTE_HDR_FEATURE_CHIP(1480) 527384740dcSRalf Baechle #define S_SCD_TRACE_CFG_CUR_ADDR 24 528384740dcSRalf Baechle #endif /* 1480 */ 529384740dcSRalf Baechle #endif /* 1250/112x */ 530384740dcSRalf Baechle 531384740dcSRalf Baechle #define M_SCD_TRACE_CFG_CUR_ADDR _SB_MAKEMASK(8, S_SCD_TRACE_CFG_CUR_ADDR) 532384740dcSRalf Baechle #define V_SCD_TRACE_CFG_CUR_ADDR(x) _SB_MAKEVALUE(x, S_SCD_TRACE_CFG_CUR_ADDR) 533384740dcSRalf Baechle #define G_SCD_TRACE_CFG_CUR_ADDR(x) _SB_GETVALUE(x, S_SCD_TRACE_CFG_CUR_ADDR, M_SCD_TRACE_CFG_CUR_ADDR) 534384740dcSRalf Baechle 535384740dcSRalf Baechle /* 536384740dcSRalf Baechle * Trace Event registers 537384740dcSRalf Baechle */ 538384740dcSRalf Baechle 539384740dcSRalf Baechle #define S_SCD_TREVT_ADDR_MATCH 0 540384740dcSRalf Baechle #define M_SCD_TREVT_ADDR_MATCH _SB_MAKEMASK(4, S_SCD_TREVT_ADDR_MATCH) 541384740dcSRalf Baechle #define V_SCD_TREVT_ADDR_MATCH(x) _SB_MAKEVALUE(x, S_SCD_TREVT_ADDR_MATCH) 542384740dcSRalf Baechle #define G_SCD_TREVT_ADDR_MATCH(x) _SB_GETVALUE(x, S_SCD_TREVT_ADDR_MATCH, M_SCD_TREVT_ADDR_MATCH) 543384740dcSRalf Baechle 544384740dcSRalf Baechle #define M_SCD_TREVT_REQID_MATCH _SB_MAKEMASK1(4) 545384740dcSRalf Baechle #define M_SCD_TREVT_DATAID_MATCH _SB_MAKEMASK1(5) 546384740dcSRalf Baechle #define M_SCD_TREVT_RESPID_MATCH _SB_MAKEMASK1(6) 547384740dcSRalf Baechle #define M_SCD_TREVT_INTERRUPT _SB_MAKEMASK1(7) 548384740dcSRalf Baechle #define M_SCD_TREVT_DEBUG_PIN _SB_MAKEMASK1(9) 549384740dcSRalf Baechle #define M_SCD_TREVT_WRITE _SB_MAKEMASK1(10) 550384740dcSRalf Baechle #define M_SCD_TREVT_READ _SB_MAKEMASK1(11) 551384740dcSRalf Baechle 552384740dcSRalf Baechle #define S_SCD_TREVT_REQID 12 553384740dcSRalf Baechle #define M_SCD_TREVT_REQID _SB_MAKEMASK(4, S_SCD_TREVT_REQID) 554384740dcSRalf Baechle #define V_SCD_TREVT_REQID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_REQID) 555384740dcSRalf Baechle #define G_SCD_TREVT_REQID(x) _SB_GETVALUE(x, S_SCD_TREVT_REQID, M_SCD_TREVT_REQID) 556384740dcSRalf Baechle 557384740dcSRalf Baechle #define S_SCD_TREVT_RESPID 16 558384740dcSRalf Baechle #define M_SCD_TREVT_RESPID _SB_MAKEMASK(4, S_SCD_TREVT_RESPID) 559384740dcSRalf Baechle #define V_SCD_TREVT_RESPID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_RESPID) 560384740dcSRalf Baechle #define G_SCD_TREVT_RESPID(x) _SB_GETVALUE(x, S_SCD_TREVT_RESPID, M_SCD_TREVT_RESPID) 561384740dcSRalf Baechle 562384740dcSRalf Baechle #define S_SCD_TREVT_DATAID 20 563384740dcSRalf Baechle #define M_SCD_TREVT_DATAID _SB_MAKEMASK(4, S_SCD_TREVT_DATAID) 564384740dcSRalf Baechle #define V_SCD_TREVT_DATAID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_DATAID) 565384740dcSRalf Baechle #define G_SCD_TREVT_DATAID(x) _SB_GETVALUE(x, S_SCD_TREVT_DATAID, M_SCD_TREVT_DATID) 566384740dcSRalf Baechle 567384740dcSRalf Baechle #define S_SCD_TREVT_COUNT 24 568384740dcSRalf Baechle #define M_SCD_TREVT_COUNT _SB_MAKEMASK(8, S_SCD_TREVT_COUNT) 569384740dcSRalf Baechle #define V_SCD_TREVT_COUNT(x) _SB_MAKEVALUE(x, S_SCD_TREVT_COUNT) 570384740dcSRalf Baechle #define G_SCD_TREVT_COUNT(x) _SB_GETVALUE(x, S_SCD_TREVT_COUNT, M_SCD_TREVT_COUNT) 571384740dcSRalf Baechle 572384740dcSRalf Baechle /* 573384740dcSRalf Baechle * Trace Sequence registers 574384740dcSRalf Baechle */ 575384740dcSRalf Baechle 576384740dcSRalf Baechle #define S_SCD_TRSEQ_EVENT4 0 577384740dcSRalf Baechle #define M_SCD_TRSEQ_EVENT4 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT4) 578384740dcSRalf Baechle #define V_SCD_TRSEQ_EVENT4(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT4) 579384740dcSRalf Baechle #define G_SCD_TRSEQ_EVENT4(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT4, M_SCD_TRSEQ_EVENT4) 580384740dcSRalf Baechle 581384740dcSRalf Baechle #define S_SCD_TRSEQ_EVENT3 4 582384740dcSRalf Baechle #define M_SCD_TRSEQ_EVENT3 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT3) 583384740dcSRalf Baechle #define V_SCD_TRSEQ_EVENT3(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT3) 584384740dcSRalf Baechle #define G_SCD_TRSEQ_EVENT3(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT3, M_SCD_TRSEQ_EVENT3) 585384740dcSRalf Baechle 586384740dcSRalf Baechle #define S_SCD_TRSEQ_EVENT2 8 587384740dcSRalf Baechle #define M_SCD_TRSEQ_EVENT2 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT2) 588384740dcSRalf Baechle #define V_SCD_TRSEQ_EVENT2(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT2) 589384740dcSRalf Baechle #define G_SCD_TRSEQ_EVENT2(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT2, M_SCD_TRSEQ_EVENT2) 590384740dcSRalf Baechle 591384740dcSRalf Baechle #define S_SCD_TRSEQ_EVENT1 12 592384740dcSRalf Baechle #define M_SCD_TRSEQ_EVENT1 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT1) 593384740dcSRalf Baechle #define V_SCD_TRSEQ_EVENT1(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT1) 594384740dcSRalf Baechle #define G_SCD_TRSEQ_EVENT1(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT1, M_SCD_TRSEQ_EVENT1) 595384740dcSRalf Baechle 596384740dcSRalf Baechle #define K_SCD_TRSEQ_E0 0 597384740dcSRalf Baechle #define K_SCD_TRSEQ_E1 1 598384740dcSRalf Baechle #define K_SCD_TRSEQ_E2 2 599384740dcSRalf Baechle #define K_SCD_TRSEQ_E3 3 600384740dcSRalf Baechle #define K_SCD_TRSEQ_E0_E1 4 601384740dcSRalf Baechle #define K_SCD_TRSEQ_E1_E2 5 602384740dcSRalf Baechle #define K_SCD_TRSEQ_E2_E3 6 603384740dcSRalf Baechle #define K_SCD_TRSEQ_E0_E1_E2 7 604384740dcSRalf Baechle #define K_SCD_TRSEQ_E0_E1_E2_E3 8 605384740dcSRalf Baechle #define K_SCD_TRSEQ_E0E1 9 606384740dcSRalf Baechle #define K_SCD_TRSEQ_E0E1E2 10 607384740dcSRalf Baechle #define K_SCD_TRSEQ_E0E1E2E3 11 608384740dcSRalf Baechle #define K_SCD_TRSEQ_E0E1_E2 12 609384740dcSRalf Baechle #define K_SCD_TRSEQ_E0E1_E2E3 13 610384740dcSRalf Baechle #define K_SCD_TRSEQ_E0E1_E2_E3 14 611384740dcSRalf Baechle #define K_SCD_TRSEQ_IGNORED 15 612384740dcSRalf Baechle 613384740dcSRalf Baechle #define K_SCD_TRSEQ_TRIGGER_ALL (V_SCD_TRSEQ_EVENT1(K_SCD_TRSEQ_IGNORED) | \ 614384740dcSRalf Baechle V_SCD_TRSEQ_EVENT2(K_SCD_TRSEQ_IGNORED) | \ 615384740dcSRalf Baechle V_SCD_TRSEQ_EVENT3(K_SCD_TRSEQ_IGNORED) | \ 616384740dcSRalf Baechle V_SCD_TRSEQ_EVENT4(K_SCD_TRSEQ_IGNORED)) 617384740dcSRalf Baechle 618384740dcSRalf Baechle #define S_SCD_TRSEQ_FUNCTION 16 619384740dcSRalf Baechle #define M_SCD_TRSEQ_FUNCTION _SB_MAKEMASK(4, S_SCD_TRSEQ_FUNCTION) 620384740dcSRalf Baechle #define V_SCD_TRSEQ_FUNCTION(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_FUNCTION) 621384740dcSRalf Baechle #define G_SCD_TRSEQ_FUNCTION(x) _SB_GETVALUE(x, S_SCD_TRSEQ_FUNCTION, M_SCD_TRSEQ_FUNCTION) 622384740dcSRalf Baechle 623384740dcSRalf Baechle #define K_SCD_TRSEQ_FUNC_NOP 0 624384740dcSRalf Baechle #define K_SCD_TRSEQ_FUNC_START 1 625384740dcSRalf Baechle #define K_SCD_TRSEQ_FUNC_STOP 2 626384740dcSRalf Baechle #define K_SCD_TRSEQ_FUNC_FREEZE 3 627384740dcSRalf Baechle 628384740dcSRalf Baechle #define V_SCD_TRSEQ_FUNC_NOP V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_NOP) 629384740dcSRalf Baechle #define V_SCD_TRSEQ_FUNC_START V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_START) 630384740dcSRalf Baechle #define V_SCD_TRSEQ_FUNC_STOP V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_STOP) 631384740dcSRalf Baechle #define V_SCD_TRSEQ_FUNC_FREEZE V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_FREEZE) 632384740dcSRalf Baechle 633384740dcSRalf Baechle #define M_SCD_TRSEQ_ASAMPLE _SB_MAKEMASK1(18) 634384740dcSRalf Baechle #define M_SCD_TRSEQ_DSAMPLE _SB_MAKEMASK1(19) 635384740dcSRalf Baechle #define M_SCD_TRSEQ_DEBUGPIN _SB_MAKEMASK1(20) 636384740dcSRalf Baechle #define M_SCD_TRSEQ_DEBUGCPU _SB_MAKEMASK1(21) 637384740dcSRalf Baechle #define M_SCD_TRSEQ_CLEARUSE _SB_MAKEMASK1(22) 638384740dcSRalf Baechle #define M_SCD_TRSEQ_ALLD_A _SB_MAKEMASK1(23) 639384740dcSRalf Baechle #define M_SCD_TRSEQ_ALL_A _SB_MAKEMASK1(24) 640384740dcSRalf Baechle 641384740dcSRalf Baechle #endif 642