18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public 38c2ecf20Sopenharmony_ci * License. See the file "COPYING" in the main directory of this archive 48c2ecf20Sopenharmony_ci * for more details. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Derived from IRIX <sys/SN/SN0/hubpi.h>, revision 1.28. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. 98c2ecf20Sopenharmony_ci * Copyright (C) 1999 by Ralf Baechle 108c2ecf20Sopenharmony_ci */ 118c2ecf20Sopenharmony_ci#ifndef _ASM_SN_SN0_HUBPI_H 128c2ecf20Sopenharmony_ci#define _ASM_SN_SN0_HUBPI_H 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#include <linux/types.h> 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci/* 178c2ecf20Sopenharmony_ci * Hub I/O interface registers 188c2ecf20Sopenharmony_ci * 198c2ecf20Sopenharmony_ci * All registers in this file are subject to change until Hub chip tapeout. 208c2ecf20Sopenharmony_ci * All register "addresses" are actually offsets. Use the LOCAL_HUB 218c2ecf20Sopenharmony_ci * or REMOTE_HUB macros to synthesize an actual address 228c2ecf20Sopenharmony_ci */ 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#define PI_BASE 0x000000 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci/* General protection and control registers */ 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci#define PI_CPU_PROTECT 0x000000 /* CPU Protection */ 298c2ecf20Sopenharmony_ci#define PI_PROT_OVERRD 0x000008 /* Clear CPU Protection bit */ 308c2ecf20Sopenharmony_ci#define PI_IO_PROTECT 0x000010 /* Interrupt Pending Protection */ 318c2ecf20Sopenharmony_ci#define PI_REGION_PRESENT 0x000018 /* Indicates whether region exists */ 328c2ecf20Sopenharmony_ci#define PI_CPU_NUM 0x000020 /* CPU Number ID */ 338c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE 0x000028 /* Cached Alias Size */ 348c2ecf20Sopenharmony_ci#define PI_MAX_CRB_TIMEOUT 0x000030 /* Maximum Timeout for CRB */ 358c2ecf20Sopenharmony_ci#define PI_CRB_SFACTOR 0x000038 /* Scale factor for CRB timeout */ 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* CALIAS values */ 388c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_0 0 398c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_4K 1 408c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_8K 2 418c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_16K 3 428c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_32K 4 438c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_64K 5 448c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_128K 6 458c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_256K 7 468c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_512K 8 478c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_1M 9 488c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_2M 10 498c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_4M 11 508c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_8M 12 518c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_16M 13 528c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_32M 14 538c2ecf20Sopenharmony_ci#define PI_CALIAS_SIZE_64M 15 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci/* Processor control and status checking */ 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci#define PI_CPU_PRESENT_A 0x000040 /* CPU Present A */ 588c2ecf20Sopenharmony_ci#define PI_CPU_PRESENT_B 0x000048 /* CPU Present B */ 598c2ecf20Sopenharmony_ci#define PI_CPU_ENABLE_A 0x000050 /* CPU Enable A */ 608c2ecf20Sopenharmony_ci#define PI_CPU_ENABLE_B 0x000058 /* CPU Enable B */ 618c2ecf20Sopenharmony_ci#define PI_REPLY_LEVEL 0x000060 /* Reply Level */ 628c2ecf20Sopenharmony_ci#define PI_HARDRESET_BIT 0x020068 /* Bit cleared by s/w on SR */ 638c2ecf20Sopenharmony_ci#define PI_NMI_A 0x000070 /* NMI to CPU A */ 648c2ecf20Sopenharmony_ci#define PI_NMI_B 0x000078 /* NMI to CPU B */ 658c2ecf20Sopenharmony_ci#define PI_NMI_OFFSET (PI_NMI_B - PI_NMI_A) 668c2ecf20Sopenharmony_ci#define PI_SOFTRESET 0x000080 /* Softreset (to both CPUs) */ 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ci/* Regular Interrupt register checking. */ 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci#define PI_INT_PEND_MOD 0x000090 /* Write to set pending ints */ 718c2ecf20Sopenharmony_ci#define PI_INT_PEND0 0x000098 /* Read to get pending ints */ 728c2ecf20Sopenharmony_ci#define PI_INT_PEND1 0x0000a0 /* Read to get pending ints */ 738c2ecf20Sopenharmony_ci#define PI_INT_MASK0_A 0x0000a8 /* Interrupt Mask 0 for CPU A */ 748c2ecf20Sopenharmony_ci#define PI_INT_MASK1_A 0x0000b0 /* Interrupt Mask 1 for CPU A */ 758c2ecf20Sopenharmony_ci#define PI_INT_MASK0_B 0x0000b8 /* Interrupt Mask 0 for CPU B */ 768c2ecf20Sopenharmony_ci#define PI_INT_MASK1_B 0x0000c0 /* Interrupt Mask 1 for CPU B */ 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci#define PI_INT_MASK_OFFSET 0x10 /* Offset from A to B */ 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci/* Crosscall interrupts */ 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci#define PI_CC_PEND_SET_A 0x0000c8 /* CC Interrupt Pending Set, CPU A */ 838c2ecf20Sopenharmony_ci#define PI_CC_PEND_SET_B 0x0000d0 /* CC Interrupt Pending Set, CPU B */ 848c2ecf20Sopenharmony_ci#define PI_CC_PEND_CLR_A 0x0000d8 /* CC Interrupt Pending Clr, CPU A */ 858c2ecf20Sopenharmony_ci#define PI_CC_PEND_CLR_B 0x0000e0 /* CC Interrupt Pending Clr, CPU B */ 868c2ecf20Sopenharmony_ci#define PI_CC_MASK 0x0000e8 /* CC Interrupt mask */ 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ci#define PI_INT_SET_OFFSET 0x08 /* Offset from A to B */ 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci/* Realtime Counter and Profiler control registers */ 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_ci#define PI_RT_COUNT 0x030100 /* Real Time Counter */ 938c2ecf20Sopenharmony_ci#define PI_RT_COMPARE_A 0x000108 /* Real Time Compare A */ 948c2ecf20Sopenharmony_ci#define PI_RT_COMPARE_B 0x000110 /* Real Time Compare B */ 958c2ecf20Sopenharmony_ci#define PI_PROFILE_COMPARE 0x000118 /* L5 int to both cpus when == RTC */ 968c2ecf20Sopenharmony_ci#define PI_RT_PEND_A 0x000120 /* Set if RT int for A pending */ 978c2ecf20Sopenharmony_ci#define PI_RT_PEND_B 0x000128 /* Set if RT int for B pending */ 988c2ecf20Sopenharmony_ci#define PI_PROF_PEND_A 0x000130 /* Set if Prof int for A pending */ 998c2ecf20Sopenharmony_ci#define PI_PROF_PEND_B 0x000138 /* Set if Prof int for B pending */ 1008c2ecf20Sopenharmony_ci#define PI_RT_EN_A 0x000140 /* RT int for CPU A enable */ 1018c2ecf20Sopenharmony_ci#define PI_RT_EN_B 0x000148 /* RT int for CPU B enable */ 1028c2ecf20Sopenharmony_ci#define PI_PROF_EN_A 0x000150 /* PROF int for CPU A enable */ 1038c2ecf20Sopenharmony_ci#define PI_PROF_EN_B 0x000158 /* PROF int for CPU B enable */ 1048c2ecf20Sopenharmony_ci#define PI_RT_LOCAL_CTRL 0x000160 /* RT control register */ 1058c2ecf20Sopenharmony_ci#define PI_RT_FILTER_CTRL 0x000168 /* GCLK Filter control register */ 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci#define PI_COUNT_OFFSET 0x08 /* A to B offset for all counts */ 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ci/* Built-In Self Test support */ 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ci#define PI_BIST_WRITE_DATA 0x000200 /* BIST write data */ 1128c2ecf20Sopenharmony_ci#define PI_BIST_READ_DATA 0x000208 /* BIST read data */ 1138c2ecf20Sopenharmony_ci#define PI_BIST_COUNT_TARG 0x000210 /* BIST Count and Target */ 1148c2ecf20Sopenharmony_ci#define PI_BIST_READY 0x000218 /* BIST Ready indicator */ 1158c2ecf20Sopenharmony_ci#define PI_BIST_SHIFT_LOAD 0x000220 /* BIST control */ 1168c2ecf20Sopenharmony_ci#define PI_BIST_SHIFT_UNLOAD 0x000228 /* BIST control */ 1178c2ecf20Sopenharmony_ci#define PI_BIST_ENTER_RUN 0x000230 /* BIST control */ 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ci/* Graphics control registers */ 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci#define PI_GFX_PAGE_A 0x000300 /* Graphics page A */ 1228c2ecf20Sopenharmony_ci#define PI_GFX_CREDIT_CNTR_A 0x000308 /* Graphics credit counter A */ 1238c2ecf20Sopenharmony_ci#define PI_GFX_BIAS_A 0x000310 /* Graphics bias A */ 1248c2ecf20Sopenharmony_ci#define PI_GFX_INT_CNTR_A 0x000318 /* Graphics interrupt counter A */ 1258c2ecf20Sopenharmony_ci#define PI_GFX_INT_CMP_A 0x000320 /* Graphics interrupt comparator A */ 1268c2ecf20Sopenharmony_ci#define PI_GFX_PAGE_B 0x000328 /* Graphics page B */ 1278c2ecf20Sopenharmony_ci#define PI_GFX_CREDIT_CNTR_B 0x000330 /* Graphics credit counter B */ 1288c2ecf20Sopenharmony_ci#define PI_GFX_BIAS_B 0x000338 /* Graphics bias B */ 1298c2ecf20Sopenharmony_ci#define PI_GFX_INT_CNTR_B 0x000340 /* Graphics interrupt counter B */ 1308c2ecf20Sopenharmony_ci#define PI_GFX_INT_CMP_B 0x000348 /* Graphics interrupt comparator B */ 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_ci#define PI_GFX_OFFSET (PI_GFX_PAGE_B - PI_GFX_PAGE_A) 1338c2ecf20Sopenharmony_ci#define PI_GFX_PAGE_ENABLE 0x0000010000000000LL 1348c2ecf20Sopenharmony_ci 1358c2ecf20Sopenharmony_ci/* Error and timeout registers */ 1368c2ecf20Sopenharmony_ci#define PI_ERR_INT_PEND 0x000400 /* Error Interrupt Pending */ 1378c2ecf20Sopenharmony_ci#define PI_ERR_INT_MASK_A 0x000408 /* Error Interrupt mask for CPU A */ 1388c2ecf20Sopenharmony_ci#define PI_ERR_INT_MASK_B 0x000410 /* Error Interrupt mask for CPU B */ 1398c2ecf20Sopenharmony_ci#define PI_ERR_STACK_ADDR_A 0x000418 /* Error stack address for CPU A */ 1408c2ecf20Sopenharmony_ci#define PI_ERR_STACK_ADDR_B 0x000420 /* Error stack address for CPU B */ 1418c2ecf20Sopenharmony_ci#define PI_ERR_STACK_SIZE 0x000428 /* Error Stack Size */ 1428c2ecf20Sopenharmony_ci#define PI_ERR_STATUS0_A 0x000430 /* Error Status 0A */ 1438c2ecf20Sopenharmony_ci#define PI_ERR_STATUS0_A_RCLR 0x000438 /* Error Status 0A clear on read */ 1448c2ecf20Sopenharmony_ci#define PI_ERR_STATUS1_A 0x000440 /* Error Status 1A */ 1458c2ecf20Sopenharmony_ci#define PI_ERR_STATUS1_A_RCLR 0x000448 /* Error Status 1A clear on read */ 1468c2ecf20Sopenharmony_ci#define PI_ERR_STATUS0_B 0x000450 /* Error Status 0B */ 1478c2ecf20Sopenharmony_ci#define PI_ERR_STATUS0_B_RCLR 0x000458 /* Error Status 0B clear on read */ 1488c2ecf20Sopenharmony_ci#define PI_ERR_STATUS1_B 0x000460 /* Error Status 1B */ 1498c2ecf20Sopenharmony_ci#define PI_ERR_STATUS1_B_RCLR 0x000468 /* Error Status 1B clear on read */ 1508c2ecf20Sopenharmony_ci#define PI_SPOOL_CMP_A 0x000470 /* Spool compare for CPU A */ 1518c2ecf20Sopenharmony_ci#define PI_SPOOL_CMP_B 0x000478 /* Spool compare for CPU B */ 1528c2ecf20Sopenharmony_ci#define PI_CRB_TIMEOUT_A 0x000480 /* Timed out CRB entries for A */ 1538c2ecf20Sopenharmony_ci#define PI_CRB_TIMEOUT_B 0x000488 /* Timed out CRB entries for B */ 1548c2ecf20Sopenharmony_ci#define PI_SYSAD_ERRCHK_EN 0x000490 /* Enables SYSAD error checking */ 1558c2ecf20Sopenharmony_ci#define PI_BAD_CHECK_BIT_A 0x000498 /* Force SYSAD check bit error */ 1568c2ecf20Sopenharmony_ci#define PI_BAD_CHECK_BIT_B 0x0004a0 /* Force SYSAD check bit error */ 1578c2ecf20Sopenharmony_ci#define PI_NACK_CNT_A 0x0004a8 /* Consecutive NACK counter */ 1588c2ecf20Sopenharmony_ci#define PI_NACK_CNT_B 0x0004b0 /* " " for CPU B */ 1598c2ecf20Sopenharmony_ci#define PI_NACK_CMP 0x0004b8 /* NACK count compare */ 1608c2ecf20Sopenharmony_ci#define PI_STACKADDR_OFFSET (PI_ERR_STACK_ADDR_B - PI_ERR_STACK_ADDR_A) 1618c2ecf20Sopenharmony_ci#define PI_ERRSTAT_OFFSET (PI_ERR_STATUS0_B - PI_ERR_STATUS0_A) 1628c2ecf20Sopenharmony_ci#define PI_RDCLR_OFFSET (PI_ERR_STATUS0_A_RCLR - PI_ERR_STATUS0_A) 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ci/* Bits in PI_ERR_INT_PEND */ 1658c2ecf20Sopenharmony_ci#define PI_ERR_SPOOL_CMP_B 0x00000001 /* Spool end hit high water */ 1668c2ecf20Sopenharmony_ci#define PI_ERR_SPOOL_CMP_A 0x00000002 1678c2ecf20Sopenharmony_ci#define PI_ERR_SPUR_MSG_B 0x00000004 /* Spurious message intr. */ 1688c2ecf20Sopenharmony_ci#define PI_ERR_SPUR_MSG_A 0x00000008 1698c2ecf20Sopenharmony_ci#define PI_ERR_WRB_TERR_B 0x00000010 /* WRB TERR */ 1708c2ecf20Sopenharmony_ci#define PI_ERR_WRB_TERR_A 0x00000020 1718c2ecf20Sopenharmony_ci#define PI_ERR_WRB_WERR_B 0x00000040 /* WRB WERR */ 1728c2ecf20Sopenharmony_ci#define PI_ERR_WRB_WERR_A 0x00000080 1738c2ecf20Sopenharmony_ci#define PI_ERR_SYSSTATE_B 0x00000100 /* SysState parity error */ 1748c2ecf20Sopenharmony_ci#define PI_ERR_SYSSTATE_A 0x00000200 1758c2ecf20Sopenharmony_ci#define PI_ERR_SYSAD_DATA_B 0x00000400 /* SysAD data parity error */ 1768c2ecf20Sopenharmony_ci#define PI_ERR_SYSAD_DATA_A 0x00000800 1778c2ecf20Sopenharmony_ci#define PI_ERR_SYSAD_ADDR_B 0x00001000 /* SysAD addr parity error */ 1788c2ecf20Sopenharmony_ci#define PI_ERR_SYSAD_ADDR_A 0x00002000 1798c2ecf20Sopenharmony_ci#define PI_ERR_SYSCMD_DATA_B 0x00004000 /* SysCmd data parity error */ 1808c2ecf20Sopenharmony_ci#define PI_ERR_SYSCMD_DATA_A 0x00008000 1818c2ecf20Sopenharmony_ci#define PI_ERR_SYSCMD_ADDR_B 0x00010000 /* SysCmd addr parity error */ 1828c2ecf20Sopenharmony_ci#define PI_ERR_SYSCMD_ADDR_A 0x00020000 1838c2ecf20Sopenharmony_ci#define PI_ERR_BAD_SPOOL_B 0x00040000 /* Error spooling to memory */ 1848c2ecf20Sopenharmony_ci#define PI_ERR_BAD_SPOOL_A 0x00080000 1858c2ecf20Sopenharmony_ci#define PI_ERR_UNCAC_UNCORR_B 0x00100000 /* Uncached uncorrectable */ 1868c2ecf20Sopenharmony_ci#define PI_ERR_UNCAC_UNCORR_A 0x00200000 1878c2ecf20Sopenharmony_ci#define PI_ERR_SYSSTATE_TAG_B 0x00400000 /* SysState tag parity error */ 1888c2ecf20Sopenharmony_ci#define PI_ERR_SYSSTATE_TAG_A 0x00800000 1898c2ecf20Sopenharmony_ci#define PI_ERR_MD_UNCORR 0x01000000 /* Must be cleared in MD */ 1908c2ecf20Sopenharmony_ci 1918c2ecf20Sopenharmony_ci#define PI_ERR_CLEAR_ALL_A 0x00aaaaaa 1928c2ecf20Sopenharmony_ci#define PI_ERR_CLEAR_ALL_B 0x00555555 1938c2ecf20Sopenharmony_ci 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci/* 1968c2ecf20Sopenharmony_ci * The following three macros define all possible error int pends. 1978c2ecf20Sopenharmony_ci */ 1988c2ecf20Sopenharmony_ci 1998c2ecf20Sopenharmony_ci#define PI_FATAL_ERR_CPU_A (PI_ERR_SYSSTATE_TAG_A | \ 2008c2ecf20Sopenharmony_ci PI_ERR_BAD_SPOOL_A | \ 2018c2ecf20Sopenharmony_ci PI_ERR_SYSCMD_ADDR_A | \ 2028c2ecf20Sopenharmony_ci PI_ERR_SYSCMD_DATA_A | \ 2038c2ecf20Sopenharmony_ci PI_ERR_SYSAD_ADDR_A | \ 2048c2ecf20Sopenharmony_ci PI_ERR_SYSAD_DATA_A | \ 2058c2ecf20Sopenharmony_ci PI_ERR_SYSSTATE_A) 2068c2ecf20Sopenharmony_ci 2078c2ecf20Sopenharmony_ci#define PI_MISC_ERR_CPU_A (PI_ERR_UNCAC_UNCORR_A | \ 2088c2ecf20Sopenharmony_ci PI_ERR_WRB_WERR_A | \ 2098c2ecf20Sopenharmony_ci PI_ERR_WRB_TERR_A | \ 2108c2ecf20Sopenharmony_ci PI_ERR_SPUR_MSG_A | \ 2118c2ecf20Sopenharmony_ci PI_ERR_SPOOL_CMP_A) 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_ci#define PI_FATAL_ERR_CPU_B (PI_ERR_SYSSTATE_TAG_B | \ 2148c2ecf20Sopenharmony_ci PI_ERR_BAD_SPOOL_B | \ 2158c2ecf20Sopenharmony_ci PI_ERR_SYSCMD_ADDR_B | \ 2168c2ecf20Sopenharmony_ci PI_ERR_SYSCMD_DATA_B | \ 2178c2ecf20Sopenharmony_ci PI_ERR_SYSAD_ADDR_B | \ 2188c2ecf20Sopenharmony_ci PI_ERR_SYSAD_DATA_B | \ 2198c2ecf20Sopenharmony_ci PI_ERR_SYSSTATE_B) 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_ci#define PI_MISC_ERR_CPU_B (PI_ERR_UNCAC_UNCORR_B | \ 2228c2ecf20Sopenharmony_ci PI_ERR_WRB_WERR_B | \ 2238c2ecf20Sopenharmony_ci PI_ERR_WRB_TERR_B | \ 2248c2ecf20Sopenharmony_ci PI_ERR_SPUR_MSG_B | \ 2258c2ecf20Sopenharmony_ci PI_ERR_SPOOL_CMP_B) 2268c2ecf20Sopenharmony_ci 2278c2ecf20Sopenharmony_ci#define PI_ERR_GENERIC (PI_ERR_MD_UNCORR) 2288c2ecf20Sopenharmony_ci 2298c2ecf20Sopenharmony_ci/* 2308c2ecf20Sopenharmony_ci * Error types for PI_ERR_STATUS0_[AB] and error stack: 2318c2ecf20Sopenharmony_ci * Use the write types if WRBRRB is 1 else use the read types 2328c2ecf20Sopenharmony_ci */ 2338c2ecf20Sopenharmony_ci 2348c2ecf20Sopenharmony_ci/* Fields in PI_ERR_STATUS0_[AB] */ 2358c2ecf20Sopenharmony_ci#define PI_ERR_ST0_TYPE_MASK 0x0000000000000007 2368c2ecf20Sopenharmony_ci#define PI_ERR_ST0_TYPE_SHFT 0 2378c2ecf20Sopenharmony_ci#define PI_ERR_ST0_REQNUM_MASK 0x0000000000000038 2388c2ecf20Sopenharmony_ci#define PI_ERR_ST0_REQNUM_SHFT 3 2398c2ecf20Sopenharmony_ci#define PI_ERR_ST0_SUPPL_MASK 0x000000000001ffc0 2408c2ecf20Sopenharmony_ci#define PI_ERR_ST0_SUPPL_SHFT 6 2418c2ecf20Sopenharmony_ci#define PI_ERR_ST0_CMD_MASK 0x0000000001fe0000 2428c2ecf20Sopenharmony_ci#define PI_ERR_ST0_CMD_SHFT 17 2438c2ecf20Sopenharmony_ci#define PI_ERR_ST0_ADDR_MASK 0x3ffffffffe000000 2448c2ecf20Sopenharmony_ci#define PI_ERR_ST0_ADDR_SHFT 25 2458c2ecf20Sopenharmony_ci#define PI_ERR_ST0_OVERRUN_MASK 0x4000000000000000 2468c2ecf20Sopenharmony_ci#define PI_ERR_ST0_OVERRUN_SHFT 62 2478c2ecf20Sopenharmony_ci#define PI_ERR_ST0_VALID_MASK 0x8000000000000000 2488c2ecf20Sopenharmony_ci#define PI_ERR_ST0_VALID_SHFT 63 2498c2ecf20Sopenharmony_ci 2508c2ecf20Sopenharmony_ci/* Fields in PI_ERR_STATUS1_[AB] */ 2518c2ecf20Sopenharmony_ci#define PI_ERR_ST1_SPOOL_MASK 0x00000000001fffff 2528c2ecf20Sopenharmony_ci#define PI_ERR_ST1_SPOOL_SHFT 0 2538c2ecf20Sopenharmony_ci#define PI_ERR_ST1_TOUTCNT_MASK 0x000000001fe00000 2548c2ecf20Sopenharmony_ci#define PI_ERR_ST1_TOUTCNT_SHFT 21 2558c2ecf20Sopenharmony_ci#define PI_ERR_ST1_INVCNT_MASK 0x0000007fe0000000 2568c2ecf20Sopenharmony_ci#define PI_ERR_ST1_INVCNT_SHFT 29 2578c2ecf20Sopenharmony_ci#define PI_ERR_ST1_CRBNUM_MASK 0x0000038000000000 2588c2ecf20Sopenharmony_ci#define PI_ERR_ST1_CRBNUM_SHFT 39 2598c2ecf20Sopenharmony_ci#define PI_ERR_ST1_WRBRRB_MASK 0x0000040000000000 2608c2ecf20Sopenharmony_ci#define PI_ERR_ST1_WRBRRB_SHFT 42 2618c2ecf20Sopenharmony_ci#define PI_ERR_ST1_CRBSTAT_MASK 0x001ff80000000000 2628c2ecf20Sopenharmony_ci#define PI_ERR_ST1_CRBSTAT_SHFT 43 2638c2ecf20Sopenharmony_ci#define PI_ERR_ST1_MSGSRC_MASK 0xffe0000000000000 2648c2ecf20Sopenharmony_ci#define PI_ERR_ST1_MSGSRC_SHFT 53 2658c2ecf20Sopenharmony_ci 2668c2ecf20Sopenharmony_ci/* Fields in the error stack */ 2678c2ecf20Sopenharmony_ci#define PI_ERR_STK_TYPE_MASK 0x0000000000000003 2688c2ecf20Sopenharmony_ci#define PI_ERR_STK_TYPE_SHFT 0 2698c2ecf20Sopenharmony_ci#define PI_ERR_STK_SUPPL_MASK 0x0000000000000038 2708c2ecf20Sopenharmony_ci#define PI_ERR_STK_SUPPL_SHFT 3 2718c2ecf20Sopenharmony_ci#define PI_ERR_STK_REQNUM_MASK 0x00000000000001c0 2728c2ecf20Sopenharmony_ci#define PI_ERR_STK_REQNUM_SHFT 6 2738c2ecf20Sopenharmony_ci#define PI_ERR_STK_CRBNUM_MASK 0x0000000000000e00 2748c2ecf20Sopenharmony_ci#define PI_ERR_STK_CRBNUM_SHFT 9 2758c2ecf20Sopenharmony_ci#define PI_ERR_STK_WRBRRB_MASK 0x0000000000001000 2768c2ecf20Sopenharmony_ci#define PI_ERR_STK_WRBRRB_SHFT 12 2778c2ecf20Sopenharmony_ci#define PI_ERR_STK_CRBSTAT_MASK 0x00000000007fe000 2788c2ecf20Sopenharmony_ci#define PI_ERR_STK_CRBSTAT_SHFT 13 2798c2ecf20Sopenharmony_ci#define PI_ERR_STK_CMD_MASK 0x000000007f800000 2808c2ecf20Sopenharmony_ci#define PI_ERR_STK_CMD_SHFT 23 2818c2ecf20Sopenharmony_ci#define PI_ERR_STK_ADDR_MASK 0xffffffff80000000 2828c2ecf20Sopenharmony_ci#define PI_ERR_STK_ADDR_SHFT 31 2838c2ecf20Sopenharmony_ci 2848c2ecf20Sopenharmony_ci/* Error type in the error status or stack on Read CRBs */ 2858c2ecf20Sopenharmony_ci#define PI_ERR_RD_PRERR 1 2868c2ecf20Sopenharmony_ci#define PI_ERR_RD_DERR 2 2878c2ecf20Sopenharmony_ci#define PI_ERR_RD_TERR 3 2888c2ecf20Sopenharmony_ci 2898c2ecf20Sopenharmony_ci/* Error type in the error status or stack on Write CRBs */ 2908c2ecf20Sopenharmony_ci#define PI_ERR_WR_WERR 0 2918c2ecf20Sopenharmony_ci#define PI_ERR_WR_PWERR 1 2928c2ecf20Sopenharmony_ci#define PI_ERR_WR_TERR 3 2938c2ecf20Sopenharmony_ci 2948c2ecf20Sopenharmony_ci/* Read or Write CRB in error status or stack */ 2958c2ecf20Sopenharmony_ci#define PI_ERR_RRB 0 2968c2ecf20Sopenharmony_ci#define PI_ERR_WRB 1 2978c2ecf20Sopenharmony_ci#define PI_ERR_ANY_CRB 2 2988c2ecf20Sopenharmony_ci 2998c2ecf20Sopenharmony_ci/* Address masks in the error status and error stack are not the same */ 3008c2ecf20Sopenharmony_ci#define ERR_STK_ADDR_SHFT 7 3018c2ecf20Sopenharmony_ci#define ERR_STAT0_ADDR_SHFT 3 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_ci#define PI_MIN_STACK_SIZE 4096 /* For figuring out the size to set */ 3048c2ecf20Sopenharmony_ci#define PI_STACK_SIZE_SHFT 12 /* 4k */ 3058c2ecf20Sopenharmony_ci 3068c2ecf20Sopenharmony_ci#define ERR_STACK_SIZE_BYTES(_sz) \ 3078c2ecf20Sopenharmony_ci ((_sz) ? (PI_MIN_STACK_SIZE << ((_sz) - 1)) : 0) 3088c2ecf20Sopenharmony_ci 3098c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 3108c2ecf20Sopenharmony_ci/* 3118c2ecf20Sopenharmony_ci * format of error stack and error status registers. 3128c2ecf20Sopenharmony_ci */ 3138c2ecf20Sopenharmony_ci 3148c2ecf20Sopenharmony_cistruct err_stack_format { 3158c2ecf20Sopenharmony_ci u64 sk_addr : 33, /* address */ 3168c2ecf20Sopenharmony_ci sk_cmd : 8, /* message command */ 3178c2ecf20Sopenharmony_ci sk_crb_sts : 10, /* status from RRB or WRB */ 3188c2ecf20Sopenharmony_ci sk_rw_rb : 1, /* RRB == 0, WRB == 1 */ 3198c2ecf20Sopenharmony_ci sk_crb_num : 3, /* WRB (0 to 7) or RRB (0 to 4) */ 3208c2ecf20Sopenharmony_ci sk_t5_req : 3, /* RRB T5 request number */ 3218c2ecf20Sopenharmony_ci sk_suppl : 3, /* lowest 3 bit of supplemental */ 3228c2ecf20Sopenharmony_ci sk_err_type: 3; /* error type */ 3238c2ecf20Sopenharmony_ci}; 3248c2ecf20Sopenharmony_ci 3258c2ecf20Sopenharmony_citypedef union pi_err_stack { 3268c2ecf20Sopenharmony_ci u64 pi_stk_word; 3278c2ecf20Sopenharmony_ci struct err_stack_format pi_stk_fmt; 3288c2ecf20Sopenharmony_ci} pi_err_stack_t; 3298c2ecf20Sopenharmony_ci 3308c2ecf20Sopenharmony_cistruct err_status0_format { 3318c2ecf20Sopenharmony_ci u64 s0_valid : 1, /* Valid */ 3328c2ecf20Sopenharmony_ci s0_ovr_run : 1, /* Overrun, spooled to memory */ 3338c2ecf20Sopenharmony_ci s0_addr : 37, /* address */ 3348c2ecf20Sopenharmony_ci s0_cmd : 8, /* message command */ 3358c2ecf20Sopenharmony_ci s0_supl : 11, /* message supplemental field */ 3368c2ecf20Sopenharmony_ci s0_t5_req : 3, /* RRB T5 request number */ 3378c2ecf20Sopenharmony_ci s0_err_type: 3; /* error type */ 3388c2ecf20Sopenharmony_ci}; 3398c2ecf20Sopenharmony_ci 3408c2ecf20Sopenharmony_citypedef union pi_err_stat0 { 3418c2ecf20Sopenharmony_ci u64 pi_stat0_word; 3428c2ecf20Sopenharmony_ci struct err_status0_format pi_stat0_fmt; 3438c2ecf20Sopenharmony_ci} pi_err_stat0_t; 3448c2ecf20Sopenharmony_ci 3458c2ecf20Sopenharmony_cistruct err_status1_format { 3468c2ecf20Sopenharmony_ci u64 s1_src : 11, /* message source */ 3478c2ecf20Sopenharmony_ci s1_crb_sts : 10, /* status from RRB or WRB */ 3488c2ecf20Sopenharmony_ci s1_rw_rb : 1, /* RRB == 0, WRB == 1 */ 3498c2ecf20Sopenharmony_ci s1_crb_num : 3, /* WRB (0 to 7) or RRB (0 to 4) */ 3508c2ecf20Sopenharmony_ci s1_inval_cnt:10, /* signed invalidate counter RRB */ 3518c2ecf20Sopenharmony_ci s1_to_cnt : 8, /* crb timeout counter */ 3528c2ecf20Sopenharmony_ci s1_spl_cnt : 21; /* number spooled to memory */ 3538c2ecf20Sopenharmony_ci}; 3548c2ecf20Sopenharmony_ci 3558c2ecf20Sopenharmony_citypedef union pi_err_stat1 { 3568c2ecf20Sopenharmony_ci u64 pi_stat1_word; 3578c2ecf20Sopenharmony_ci struct err_status1_format pi_stat1_fmt; 3588c2ecf20Sopenharmony_ci} pi_err_stat1_t; 3598c2ecf20Sopenharmony_ci 3608c2ecf20Sopenharmony_citypedef u64 rtc_time_t; 3618c2ecf20Sopenharmony_ci 3628c2ecf20Sopenharmony_ci#endif /* !__ASSEMBLY__ */ 3638c2ecf20Sopenharmony_ci 3648c2ecf20Sopenharmony_ci 3658c2ecf20Sopenharmony_ci/* Bits in PI_SYSAD_ERRCHK_EN */ 3668c2ecf20Sopenharmony_ci#define PI_SYSAD_ERRCHK_ECCGEN 0x01 /* Enable ECC generation */ 3678c2ecf20Sopenharmony_ci#define PI_SYSAD_ERRCHK_QUALGEN 0x02 /* Enable data quality signal gen. */ 3688c2ecf20Sopenharmony_ci#define PI_SYSAD_ERRCHK_SADP 0x04 /* Enable SysAD parity checking */ 3698c2ecf20Sopenharmony_ci#define PI_SYSAD_ERRCHK_CMDP 0x08 /* Enable SysCmd parity checking */ 3708c2ecf20Sopenharmony_ci#define PI_SYSAD_ERRCHK_STATE 0x10 /* Enable SysState parity checking */ 3718c2ecf20Sopenharmony_ci#define PI_SYSAD_ERRCHK_QUAL 0x20 /* Enable data quality checking */ 3728c2ecf20Sopenharmony_ci#define PI_SYSAD_CHECK_ALL 0x3f /* Generate and check all signals. */ 3738c2ecf20Sopenharmony_ci 3748c2ecf20Sopenharmony_ci/* Interrupt pending bits on R10000 */ 3758c2ecf20Sopenharmony_ci 3768c2ecf20Sopenharmony_ci#define HUB_IP_PEND0 0x0400 3778c2ecf20Sopenharmony_ci#define HUB_IP_PEND1_CC 0x0800 3788c2ecf20Sopenharmony_ci#define HUB_IP_RT 0x1000 3798c2ecf20Sopenharmony_ci#define HUB_IP_PROF 0x2000 3808c2ecf20Sopenharmony_ci#define HUB_IP_ERROR 0x4000 3818c2ecf20Sopenharmony_ci#define HUB_IP_MASK 0x7c00 3828c2ecf20Sopenharmony_ci 3838c2ecf20Sopenharmony_ci/* PI_RT_LOCAL_CTRL mask and shift definitions */ 3848c2ecf20Sopenharmony_ci 3858c2ecf20Sopenharmony_ci#define PRLC_USE_INT_SHFT 16 3868c2ecf20Sopenharmony_ci#define PRLC_USE_INT_MASK (UINT64_CAST 1 << 16) 3878c2ecf20Sopenharmony_ci#define PRLC_USE_INT (UINT64_CAST 1 << 16) 3888c2ecf20Sopenharmony_ci#define PRLC_GCLK_SHFT 15 3898c2ecf20Sopenharmony_ci#define PRLC_GCLK_MASK (UINT64_CAST 1 << 15) 3908c2ecf20Sopenharmony_ci#define PRLC_GCLK (UINT64_CAST 1 << 15) 3918c2ecf20Sopenharmony_ci#define PRLC_GCLK_COUNT_SHFT 8 3928c2ecf20Sopenharmony_ci#define PRLC_GCLK_COUNT_MASK (UINT64_CAST 0x7f << 8) 3938c2ecf20Sopenharmony_ci#define PRLC_MAX_COUNT_SHFT 1 3948c2ecf20Sopenharmony_ci#define PRLC_MAX_COUNT_MASK (UINT64_CAST 0x7f << 1) 3958c2ecf20Sopenharmony_ci#define PRLC_GCLK_EN_SHFT 0 3968c2ecf20Sopenharmony_ci#define PRLC_GCLK_EN_MASK (UINT64_CAST 1) 3978c2ecf20Sopenharmony_ci#define PRLC_GCLK_EN (UINT64_CAST 1) 3988c2ecf20Sopenharmony_ci 3998c2ecf20Sopenharmony_ci/* PI_RT_FILTER_CTRL mask and shift definitions */ 4008c2ecf20Sopenharmony_ci 4018c2ecf20Sopenharmony_ci/* 4028c2ecf20Sopenharmony_ci * Bits for NACK_CNT_A/B and NACK_CMP 4038c2ecf20Sopenharmony_ci */ 4048c2ecf20Sopenharmony_ci#define PI_NACK_CNT_EN_SHFT 20 4058c2ecf20Sopenharmony_ci#define PI_NACK_CNT_EN_MASK 0x100000 4068c2ecf20Sopenharmony_ci#define PI_NACK_CNT_MASK 0x0fffff 4078c2ecf20Sopenharmony_ci#define PI_NACK_CNT_MAX 0x0fffff 4088c2ecf20Sopenharmony_ci 4098c2ecf20Sopenharmony_ci#endif /* _ASM_SN_SN0_HUBPI_H */ 410