10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*2050Ssuha * Common Development and Distribution License (the "License"). 6*2050Ssuha * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*2050Ssuha * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _SYS_PCIPSY_H 270Sstevel@tonic-gate #define _SYS_PCIPSY_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 300Sstevel@tonic-gate 310Sstevel@tonic-gate #ifdef __cplusplus 320Sstevel@tonic-gate extern "C" { 330Sstevel@tonic-gate #endif 340Sstevel@tonic-gate 350Sstevel@tonic-gate /* 360Sstevel@tonic-gate * Performance counters information. 370Sstevel@tonic-gate */ 380Sstevel@tonic-gate #define PSYCHO_SHIFT_PIC0 8 390Sstevel@tonic-gate #define PSYCHO_SHIFT_PIC1 0 400Sstevel@tonic-gate 410Sstevel@tonic-gate /* 420Sstevel@tonic-gate * Psycho-specific register offsets & bit field positions. 430Sstevel@tonic-gate */ 440Sstevel@tonic-gate 450Sstevel@tonic-gate /* 460Sstevel@tonic-gate * Offsets of global registers: 470Sstevel@tonic-gate */ 480Sstevel@tonic-gate #define PSYCHO_CB_DEVICE_ID_REG_OFFSET 0x00000000 490Sstevel@tonic-gate #define PSYCHO_CB_CONTROL_STATUS_REG_OFFSET 0x00000010 500Sstevel@tonic-gate 510Sstevel@tonic-gate /* 520Sstevel@tonic-gate * psycho performance counters offsets. 530Sstevel@tonic-gate */ 540Sstevel@tonic-gate #define PSYCHO_PERF_PCR_OFFSET 0x00000100 550Sstevel@tonic-gate #define PSYCHO_PERF_PIC_OFFSET 0x00000108 560Sstevel@tonic-gate 570Sstevel@tonic-gate /* 580Sstevel@tonic-gate * Offsets of registers in the interrupt block: 590Sstevel@tonic-gate */ 600Sstevel@tonic-gate #define PSYCHO_IB_SLOT_INTR_MAP_REG_OFFSET 0x00000C00 610Sstevel@tonic-gate #define PSYCHO_IB_OBIO_INTR_MAP_REG_OFFSET 0x00001000 620Sstevel@tonic-gate #define PSYCHO_IB_OBIO_CLEAR_INTR_REG_OFFSET 0x00001800 630Sstevel@tonic-gate 640Sstevel@tonic-gate /* 650Sstevel@tonic-gate * Offsets of registers in the PBM block: 660Sstevel@tonic-gate */ 670Sstevel@tonic-gate #define PSYCHO_PCI_PBM_REG_BASE 0x00002000 680Sstevel@tonic-gate #define PSYCHO_PCI_CTRL_REG_OFFSET 0x00000000 690Sstevel@tonic-gate #define PSYCHO_PCI_ASYNC_FLT_STATUS_REG_OFFSET 0x00000010 700Sstevel@tonic-gate #define PSYCHO_PCI_ASYNC_FLT_ADDR_REG_OFFSET 0x00000018 710Sstevel@tonic-gate #define PSYCHO_PCI_DIAG_REG_OFFSET 0x00000020 720Sstevel@tonic-gate 730Sstevel@tonic-gate /* 740Sstevel@tonic-gate * Offsets of registers in the streaming cache block: 750Sstevel@tonic-gate */ 760Sstevel@tonic-gate #define PSYCHO_SC_CTRL_REG_OFFSET 0x00000800 770Sstevel@tonic-gate #define PSYCHO_SC_INVL_REG_OFFSET 0x00000808 780Sstevel@tonic-gate #define PSYCHO_SC_SYNC_REG_OFFSET 0x00000810 790Sstevel@tonic-gate #define PSYCHO_SC_A_DATA_DIAG_OFFSET 0x0000b000 800Sstevel@tonic-gate #define PSYCHO_SC_A_TAG_DIAG_OFFSET 0x0000b800 810Sstevel@tonic-gate #define PSYCHO_SC_A_LTAG_DIAG_OFFSET 0x0000b900 820Sstevel@tonic-gate #define PSYCHO_SC_B_DATA_DIAG_OFFSET 0x0000c000 830Sstevel@tonic-gate #define PSYCHO_SC_B_TAG_DIAG_OFFSET 0x0000c800 840Sstevel@tonic-gate #define PSYCHO_SC_B_LTAG_DIAG_OFFSET 0x0000c900 850Sstevel@tonic-gate 860Sstevel@tonic-gate /* 870Sstevel@tonic-gate * Address space offsets and sizes: 880Sstevel@tonic-gate */ 890Sstevel@tonic-gate #define PSYCHO_PCI_CONFIG 0x001000000ull 900Sstevel@tonic-gate #define PSYCHO_PCI_A_IO 0x002000000ull 910Sstevel@tonic-gate #define PSYCHO_PCI_B_IO 0x002010000ull 920Sstevel@tonic-gate #define PSYCHO_PCI_A_MEMORY 0x100000000ull 930Sstevel@tonic-gate #define PSYCHO_PCI_B_MEMORY 0x180000000ull 940Sstevel@tonic-gate #define PSYCHO_PCI_IO_SIZE 0x000010000ull 950Sstevel@tonic-gate #define PSYCHO_PCI_MEM_SIZE 0x080000000ull 960Sstevel@tonic-gate 970Sstevel@tonic-gate /* 980Sstevel@tonic-gate * psycho control register bit definitions: 990Sstevel@tonic-gate */ 1000Sstevel@tonic-gate #define PSYCHO_CB_CONTROL_STATUS_MODE 0x0000000000000001ull 1010Sstevel@tonic-gate #define PSYCHO_CB_CONTROL_STATUS_IMPL 0xf000000000000000ull 1020Sstevel@tonic-gate #define PSYCHO_CB_CONTROL_STATUS_IMPL_SHIFT 60 1030Sstevel@tonic-gate #define PSYCHO_CB_CONTROL_STATUS_VER 0x0f00000000000000ull 1040Sstevel@tonic-gate #define PSYCHO_CB_CONTROL_STATUS_VER_SHIFT 56 1050Sstevel@tonic-gate 1060Sstevel@tonic-gate /* 1070Sstevel@tonic-gate * psycho ECC UE AFSR bit definitions: 1080Sstevel@tonic-gate */ 1090Sstevel@tonic-gate #define PSYCHO_ECC_UE_AFSR_BYTEMASK 0x0000ffff00000000ull 1100Sstevel@tonic-gate #define PSYCHO_ECC_UE_AFSR_BYTEMASK_SHIFT 32 1110Sstevel@tonic-gate #define PSYCHO_ECC_UE_AFSR_DW_OFFSET 0x00000000e0000000ull 1120Sstevel@tonic-gate #define PSYCHO_ECC_UE_AFSR_DW_OFFSET_SHIFT 29 1130Sstevel@tonic-gate #define PSYCHO_ECC_UE_AFSR_ID 0x000000001f000000ull 1140Sstevel@tonic-gate #define PSYCHO_ECC_UE_AFSR_ID_SHIFT 24 1150Sstevel@tonic-gate #define PSYCHO_ECC_UE_AFSR_BLK 0x0000000000800000ull 1160Sstevel@tonic-gate 1170Sstevel@tonic-gate /* 1180Sstevel@tonic-gate * psycho ECC CE AFSR bit definitions: 1190Sstevel@tonic-gate */ 1200Sstevel@tonic-gate #define PSYCHO_ECC_CE_AFSR_SYND 0x00ff000000000000ull 1210Sstevel@tonic-gate #define PSYCHO_ECC_CE_AFSR_SYND_SHIFT 48 1220Sstevel@tonic-gate #define PSYCHO_ECC_CE_AFSR_BYTEMASK 0x0000ffff00000000ull 1230Sstevel@tonic-gate #define PSYCHO_ECC_CE_AFSR_BYTEMASK_SHIFT 32 1240Sstevel@tonic-gate #define PSYCHO_ECC_CE_AFSR_DW_OFFSET 0x00000000e0000000ull 1250Sstevel@tonic-gate #define PSYCHO_ECC_CE_AFSR_DW_OFFSET_SHIFT 29 1260Sstevel@tonic-gate #define PSYCHO_ECC_CE_AFSR_UPA_MID 0x000000001f000000ull 1270Sstevel@tonic-gate #define PSYCHO_ECC_CE_AFSR_UPA_MID_SHIFT 24 1280Sstevel@tonic-gate #define PSYCHO_ECC_CE_AFSR_BLK 0x0000000000800000ull 1290Sstevel@tonic-gate 1300Sstevel@tonic-gate /* 1310Sstevel@tonic-gate * psycho pci control register bits: 1320Sstevel@tonic-gate */ 1330Sstevel@tonic-gate #define PSYCHO_PCI_CTRL_ARB_PARK 0x0000000000200000ull 1340Sstevel@tonic-gate #define PSYCHO_PCI_CTRL_SBH_INT_EN 0x0000000000000400ull 1350Sstevel@tonic-gate #define PSYCHO_PCI_CTRL_WAKEUP_EN 0x0000000000000200ull 1360Sstevel@tonic-gate #define PSYCHO_PCI_CTRL_ERR_INT_EN 0x0000000000000100ull 1370Sstevel@tonic-gate #define PSYCHO_PCI_CTRL_ARB_EN_MASK 0x000000000000000full 1380Sstevel@tonic-gate 1390Sstevel@tonic-gate /* 1400Sstevel@tonic-gate * psycho PCI asynchronous fault status register bit definitions: 1410Sstevel@tonic-gate */ 1420Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_PE_SHIFT 60 1430Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_SE_SHIFT 56 1440Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_E_MA 0x0000000000000008ull 1450Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_E_TA 0x0000000000000004ull 1460Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_E_RTRY 0x0000000000000002ull 1470Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_E_PERR 0x0000000000000001ull 1480Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_E_MASK 0x000000000000000full 1490Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_BYTEMASK 0x0000ffff00000000ull 1500Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_BYTEMASK_SHIFT 32 1510Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_BLK 0x0000000080000000ull 1520Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_MID 0x000000003e000000ull 1530Sstevel@tonic-gate #define PSYCHO_PCI_AFSR_MID_SHIFT 25 1540Sstevel@tonic-gate 1550Sstevel@tonic-gate /* 1560Sstevel@tonic-gate * psycho PCI diagnostic register bit definitions: 1570Sstevel@tonic-gate */ 1580Sstevel@tonic-gate #define PSYCHO_PCI_DIAG_DIS_DWSYNC 0x0000000000000010ull 1590Sstevel@tonic-gate 1600Sstevel@tonic-gate #define PBM_AFSR_TO_PRIERR(afsr) \ 1610Sstevel@tonic-gate (afsr >> PSYCHO_PCI_AFSR_PE_SHIFT & PSYCHO_PCI_AFSR_E_MASK) 1620Sstevel@tonic-gate #define PBM_AFSR_TO_SECERR(afsr) \ 1630Sstevel@tonic-gate (afsr >> PSYCHO_PCI_AFSR_SE_SHIFT & PSYCHO_PCI_AFSR_E_MASK) 1640Sstevel@tonic-gate #define PBM_AFSR_TO_BYTEMASK(afsr) \ 1650Sstevel@tonic-gate ((afsr & PSYCHO_PCI_AFSR_BYTEMASK) >> PSYCHO_PCI_AFSR_BYTEMASK_SHIFT) 1660Sstevel@tonic-gate 1670Sstevel@tonic-gate #define PCI_BRIDGE_TYPE(cmn_p) PCI_PSYCHO 1680Sstevel@tonic-gate /* 1690Sstevel@tonic-gate * for sabre 1700Sstevel@tonic-gate */ 1710Sstevel@tonic-gate #define DMA_WRITE_SYNC_REG 0x1C20 1720Sstevel@tonic-gate 1730Sstevel@tonic-gate extern uint_t cb_thermal_intr(caddr_t a); 1740Sstevel@tonic-gate 1750Sstevel@tonic-gate #define PCI_ID_TO_IGN(pci_id) ((pci_ign_t)UPAID_TO_IGN(pci_id)) 176*2050Ssuha 177*2050Ssuha /* 178*2050Ssuha * The following macro defines the 40-bit bus width support for UPA bus 179*2050Ssuha * in DVMA and iommu bypass transfers: 180*2050Ssuha */ 181*2050Ssuha 182*2050Ssuha #define UPA_IOMMU_BYPASS_END 0xFFFC00FFFFFFFFFFull 183*2050Ssuha 1840Sstevel@tonic-gate #ifdef __cplusplus 1850Sstevel@tonic-gate } 1860Sstevel@tonic-gate #endif 1870Sstevel@tonic-gate 1880Sstevel@tonic-gate #endif /* _SYS_PCIPSY_H */ 189