xref: /onnv-gate/usr/src/uts/sun4u/sys/pci/pci_regs.h (revision 4039:8a5733b96af9)
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*4039Skd93003  * Common Development and Distribution License (the "License").
6*4039Skd93003  * 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*4039Skd93003  * Copyright 2007 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_PCI_REGS_H
270Sstevel@tonic-gate #define	_SYS_PCI_REGS_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  * Offsets of registers in the interrupt block:
370Sstevel@tonic-gate  */
380Sstevel@tonic-gate 
390Sstevel@tonic-gate #define	COMMON_IB_UPA0_INTR_MAP_REG_OFFSET	0x6000
400Sstevel@tonic-gate #define	COMMON_IB_UPA1_INTR_MAP_REG_OFFSET	0x8000
410Sstevel@tonic-gate #define	COMMON_IB_SLOT_INTR_STATE_DIAG_REG	0xA800
420Sstevel@tonic-gate #define	COMMON_IB_OBIO_INTR_STATE_DIAG_REG	0xA808
430Sstevel@tonic-gate #define	COMMON_IB_SLOT_CLEAR_INTR_REG_OFFSET	0x1400
440Sstevel@tonic-gate #define	COMMON_IB_INTR_RETRY_TIMER_OFFSET	0x1A00
450Sstevel@tonic-gate 
460Sstevel@tonic-gate /*
470Sstevel@tonic-gate  * Offsets of registers in the ECC block:
480Sstevel@tonic-gate  */
490Sstevel@tonic-gate #define	COMMON_ECC_CSR_OFFSET			0x20
500Sstevel@tonic-gate #define	COMMON_UE_AFSR_OFFSET			0x30
510Sstevel@tonic-gate #define	COMMON_UE_AFAR_OFFSET			0x38
520Sstevel@tonic-gate #define	COMMON_CE_AFSR_OFFSET			0x40
530Sstevel@tonic-gate #define	COMMON_CE_AFAR_OFFSET			0x48
540Sstevel@tonic-gate 
550Sstevel@tonic-gate /*
560Sstevel@tonic-gate  * Offsets of registers in the iommu block:
570Sstevel@tonic-gate  */
580Sstevel@tonic-gate #define	COMMON_IOMMU_CTRL_REG_OFFSET		0x00000200
590Sstevel@tonic-gate #define	COMMON_IOMMU_TSB_BASE_ADDR_REG_OFFSET	0x00000208
600Sstevel@tonic-gate #define	COMMON_IOMMU_FLUSH_PAGE_REG_OFFSET	0x00000210
610Sstevel@tonic-gate 
620Sstevel@tonic-gate #define	COMMON_IOMMU_TLB_TAG_DIAG_ACC_OFFSET	0x0000A580
630Sstevel@tonic-gate #define	COMMON_IOMMU_TLB_DATA_DIAG_ACC_OFFSET	0x0000A600
640Sstevel@tonic-gate 
650Sstevel@tonic-gate /*
660Sstevel@tonic-gate  * (psycho and schizo) control register bit definitions:
670Sstevel@tonic-gate  */
680Sstevel@tonic-gate #define	COMMON_CB_CONTROL_STATUS_IGN		0x0007c00000000000ull
690Sstevel@tonic-gate #define	COMMON_CB_CONTROL_STATUS_IGN_SHIFT	46
700Sstevel@tonic-gate #define	COMMON_CB_CONTROL_STATUS_APCKEN		0x0000000000000008ull
710Sstevel@tonic-gate #define	COMMON_CB_CONTROL_STATUS_APERR		0x0000000000000004ull
720Sstevel@tonic-gate #define	COMMON_CB_CONTROL_STATUS_IAP		0x0000000000000002ull
730Sstevel@tonic-gate 
740Sstevel@tonic-gate /*
750Sstevel@tonic-gate  * (psycho and schizo) interrupt mapping register bit definitions:
760Sstevel@tonic-gate  */
770Sstevel@tonic-gate #define	COMMON_INTR_MAP_REG_VALID		0x0000000080000000ull
780Sstevel@tonic-gate #define	COMMON_INTR_MAP_REG_TID			0x000000007C000000ull
790Sstevel@tonic-gate #define	COMMON_INTR_MAP_REG_IGN			0x00000000000007C0ull
800Sstevel@tonic-gate #define	COMMON_INTR_MAP_REG_INO			0x000000000000003full
810Sstevel@tonic-gate #define	COMMON_INTR_MAP_REG_TID_SHIFT		26
820Sstevel@tonic-gate #define	COMMON_INTR_MAP_REG_IGN_SHIFT		6
830Sstevel@tonic-gate 
840Sstevel@tonic-gate /*
850Sstevel@tonic-gate  * psycho clear interrupt register bit definitions:
860Sstevel@tonic-gate  */
870Sstevel@tonic-gate #define	COMMON_CLEAR_INTR_REG_MASK		0x0000000000000003ull
880Sstevel@tonic-gate #define	COMMON_CLEAR_INTR_REG_IDLE		0x0000000000000000ull
890Sstevel@tonic-gate #define	COMMON_CLEAR_INTR_REG_RECEIVED		0x0000000000000001ull
900Sstevel@tonic-gate #define	COMMON_CLEAR_INTR_REG_RSVD		0x0000000000000002ull
910Sstevel@tonic-gate #define	COMMON_CLEAR_INTR_REG_PENDING		0x0000000000000003ull
920Sstevel@tonic-gate 
930Sstevel@tonic-gate /*
940Sstevel@tonic-gate  * psycho and schizo ECC control register bit definitions:
950Sstevel@tonic-gate  */
960Sstevel@tonic-gate #define	COMMON_ECC_CTRL_ECC_EN			0x8000000000000000ull
970Sstevel@tonic-gate #define	COMMON_ECC_CTRL_UE_INTEN		0x4000000000000000ull
980Sstevel@tonic-gate #define	COMMON_ECC_CTRL_CE_INTEN		0x2000000000000000ull
990Sstevel@tonic-gate 
1000Sstevel@tonic-gate /*
1010Sstevel@tonic-gate  * sabre ECC UE AFSR bit definitions:
1020Sstevel@tonic-gate  */
1030Sstevel@tonic-gate #define	SABRE_UE_AFSR_SDTE_SHIFT		57
1040Sstevel@tonic-gate #define	SABRE_UE_AFSR_PDTE_SHIFT		56
1050Sstevel@tonic-gate #define	SABRE_UE_ARSR_DTE_MASK			0x0000000000000003ull
1060Sstevel@tonic-gate #define	SABRE_UE_AFSR_E_SDTE			0x2
1070Sstevel@tonic-gate #define	SABRE_UE_AFSR_E_PDTE			0x1
1080Sstevel@tonic-gate 
1090Sstevel@tonic-gate /*
1100Sstevel@tonic-gate  * psycho and schizo ECC UE AFSR bit definitions:
1110Sstevel@tonic-gate  */
1120Sstevel@tonic-gate #define	COMMON_ECC_UE_AFSR_PE_SHIFT		61
1130Sstevel@tonic-gate #define	COMMON_ECC_UE_AFSR_SE_SHIFT		58
1140Sstevel@tonic-gate #define	COMMON_ECC_UE_AFSR_E_MASK		0x0000000000000007ull
1150Sstevel@tonic-gate 
1160Sstevel@tonic-gate /*
1170Sstevel@tonic-gate  * psycho and schizo ECC CE AFSR bit definitions:
1180Sstevel@tonic-gate  */
1190Sstevel@tonic-gate #define	COMMON_ECC_CE_AFSR_PE_SHIFT		61
1200Sstevel@tonic-gate #define	COMMON_ECC_CE_AFSR_SE_SHIFT		58
1210Sstevel@tonic-gate #define	COMMON_ECC_CE_AFSR_E_MASK		0x0000000000000007ull
122*4039Skd93003 
123*4039Skd93003 /*
124*4039Skd93003  * psycho and schizo ECC CE/UE AFSR bit definitions for error types:
125*4039Skd93003  */
126*4039Skd93003 #define	COMMON_ECC_AFSR_E_PIO			0x0000000000000004ull
127*4039Skd93003 #define	COMMON_ECC_AFSR_E_DRD			0x0000000000000002ull
128*4039Skd93003 #define	COMMON_ECC_AFSR_E_DWR			0x0000000000000001ull
1290Sstevel@tonic-gate 
1300Sstevel@tonic-gate /*
1310Sstevel@tonic-gate  * psycho and schizo pci control register bits:
1320Sstevel@tonic-gate  */
1330Sstevel@tonic-gate #define	COMMON_PCI_CTRL_SBH_ERR			0x0000000800000000ull
1340Sstevel@tonic-gate #define	COMMON_PCI_CTRL_SERR			0x0000000400000000ull
1350Sstevel@tonic-gate #define	COMMON_PCI_CTRL_SPEED			0x0000000200000000ull
1360Sstevel@tonic-gate 
1370Sstevel@tonic-gate /*
1380Sstevel@tonic-gate  * psycho and schizo PCI diagnostic register bit definitions:
1390Sstevel@tonic-gate  */
1400Sstevel@tonic-gate #define	COMMON_PCI_DIAG_DIS_RETRY		0x0000000000000040ull
1410Sstevel@tonic-gate #define	COMMON_PCI_DIAG_DIS_INTSYNC		0x0000000000000020ull
1420Sstevel@tonic-gate 
1430Sstevel@tonic-gate /*
1440Sstevel@tonic-gate  * psycho and schizo IOMMU control register bit definitions:
1450Sstevel@tonic-gate  */
1460Sstevel@tonic-gate #define	COMMON_IOMMU_CTRL_ENABLE	0x0000000000000001ull
1470Sstevel@tonic-gate #define	COMMON_IOMMU_CTRL_DIAG_ENABLE	0x0000000000000002ull
1480Sstevel@tonic-gate #define	COMMON_IOMMU_CTRL_TSB_SZ_SHIFT	16
1490Sstevel@tonic-gate #define	COMMON_IOMMU_CTRL_TBW_SZ_SHIFT	2
1500Sstevel@tonic-gate #define	COMMON_IOMMU_CTRL_LCK_ENABLE	0x0000000000800000ull
1510Sstevel@tonic-gate 
1520Sstevel@tonic-gate /*
1530Sstevel@tonic-gate  * psycho and schizo streaming cache control register bit definitions:
1540Sstevel@tonic-gate  */
1550Sstevel@tonic-gate #define	COMMON_SC_CTRL_ENABLE		0x0000000000000001ull
1560Sstevel@tonic-gate #define	COMMON_SC_CTRL_DIAG_ENABLE	0x0000000000000002ull
1570Sstevel@tonic-gate #define	COMMON_SC_CTRL_RR__DISABLE	0x0000000000000004ull
1580Sstevel@tonic-gate #define	COMMON_SC_CTRL_LRU_LE		0x0000000000000008ull
1590Sstevel@tonic-gate 
1600Sstevel@tonic-gate /*
1610Sstevel@tonic-gate  * offsets of PCI address spaces from base address:
1620Sstevel@tonic-gate  */
1630Sstevel@tonic-gate #define	PCI_CONFIG			0x001000000ull
1640Sstevel@tonic-gate #define	PCI_A_IO			0x002000000ull
1650Sstevel@tonic-gate #define	PCI_B_IO			0x002010000ull
1660Sstevel@tonic-gate #define	PCI_A_MEMORY			0x100000000ull
1670Sstevel@tonic-gate #define	PCI_B_MEMORY			0x180000000ull
1680Sstevel@tonic-gate #define	PCI_IO_SIZE			0x000010000ull
1690Sstevel@tonic-gate #define	PCI_MEM_SIZE			0x080000000ull
1700Sstevel@tonic-gate 
1710Sstevel@tonic-gate #ifdef	__cplusplus
1720Sstevel@tonic-gate }
1730Sstevel@tonic-gate #endif
1740Sstevel@tonic-gate 
1750Sstevel@tonic-gate #endif	/* _SYS_PCI_REGS_H */
176