1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright (c) 1994-1998 by Sun Microsystems, Inc. 24*7c478bd9Sstevel@tonic-gate * All rights reserved. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #ifndef _SYS_PCI_SIMBA_H 28*7c478bd9Sstevel@tonic-gate #define _SYS_PCI_SIMBA_H 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 33*7c478bd9Sstevel@tonic-gate extern "C" { 34*7c478bd9Sstevel@tonic-gate #endif 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gate /* 37*7c478bd9Sstevel@tonic-gate * This files contains info specific to Simba (pci to pci bridge) 38*7c478bd9Sstevel@tonic-gate * The rest of info common to simba and DecNet are in "pci.h" 39*7c478bd9Sstevel@tonic-gate */ 40*7c478bd9Sstevel@tonic-gate 41*7c478bd9Sstevel@tonic-gate /* 42*7c478bd9Sstevel@tonic-gate * Simba configuration space registers. 43*7c478bd9Sstevel@tonic-gate */ 44*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_SECSTATUS 0x1e /* secondary status */ 45*7c478bd9Sstevel@tonic-gate 46*7c478bd9Sstevel@tonic-gate /* 47*7c478bd9Sstevel@tonic-gate * Simba device specific registers. 48*7c478bd9Sstevel@tonic-gate */ 49*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_MATER_RETRY_LIMIT 0xc0 /* primary master retry limit */ 50*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_DMA_AFSR 0xc8 /* dma afsr */ 51*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_DMA_AFAR 0xd0 /* dma afar */ 52*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_PIOTGT_RTY_LIMIT 0xd8 /* pio target retry limit */ 53*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_PIOTGT_LATE_TIMER 0xd9 /* pio target retry limit */ 54*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_DMATGT_RTY_LIMIT 0xda /* dma target retry limit */ 55*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_DMATGT_LATE_TIMER 0xdb /* dma target retry limit */ 56*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_TGT_RETRY_LIMIT 0xdc /* primary master retry limit */ 57*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_SECBRIDGE_CTL 0xdd /* secondary bridge control */ 58*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_ADDR_MAP 0xdf /* address map */ 59*7c478bd9Sstevel@tonic-gate 60*7c478bd9Sstevel@tonic-gate /* 61*7c478bd9Sstevel@tonic-gate * Psycho compatible registers. 62*7c478bd9Sstevel@tonic-gate */ 63*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_CTL_STAT 0xe0 /* control-status */ 64*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_PIO_AFSR 0xe8 /* pio afsr */ 65*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_PIO_AFAR 0xf0 /* pio afar */ 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gate /* 68*7c478bd9Sstevel@tonic-gate * Simba device specific registers. 69*7c478bd9Sstevel@tonic-gate */ 70*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_DIAGNOSTICS 0xf8 /* diagnostics */ 71*7c478bd9Sstevel@tonic-gate 72*7c478bd9Sstevel@tonic-gate 73*7c478bd9Sstevel@tonic-gate /* 74*7c478bd9Sstevel@tonic-gate * primary/secondary timer reg mask(addrs = 0x0d/0x1b). 75*7c478bd9Sstevel@tonic-gate */ 76*7c478bd9Sstevel@tonic-gate #define PCI_LATENCY_TMR_LO 0x7 /* read only part, 0x0 */ 77*7c478bd9Sstevel@tonic-gate #define PCI_LATENCY_TMR_HI 0xf8 /* programable part */ 78*7c478bd9Sstevel@tonic-gate 79*7c478bd9Sstevel@tonic-gate /* 80*7c478bd9Sstevel@tonic-gate * PCI secondary status register bits. 81*7c478bd9Sstevel@tonic-gate * All bit definitions are the same as primary status register, 82*7c478bd9Sstevel@tonic-gate * but the meaning of bit 14 relates to secondary bus. 83*7c478bd9Sstevel@tonic-gate */ 84*7c478bd9Sstevel@tonic-gate 85*7c478bd9Sstevel@tonic-gate 86*7c478bd9Sstevel@tonic-gate /* 87*7c478bd9Sstevel@tonic-gate * Secondary control bit defines(addrs = 0xdd). 88*7c478bd9Sstevel@tonic-gate */ 89*7c478bd9Sstevel@tonic-gate #define PCI_SEC_CNTL_PIO_PREF 0x1 /* prefetch dma reads as pio */ 90*7c478bd9Sstevel@tonic-gate #define PCI_SEC_CNTL_CONVT_MRM 0x2 /* convert mem multiple read */ 91*7c478bd9Sstevel@tonic-gate 92*7c478bd9Sstevel@tonic-gate /* 93*7c478bd9Sstevel@tonic-gate * Psycho ctrl/status reg bit defines(addrs = 0xe0). 94*7c478bd9Sstevel@tonic-gate */ 95*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_SLOT_ENAM_MASK 0xf /* slot arbiter enable mask */ 96*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_SEC_ERRINIT_ENAB 0x100 /* 1=forward SERR to primary */ 97*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_WAKEUP_ENAB 0x200 /* not used, reads as 0 */ 98*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_SBH_INT_ENAB 0x400 /* not used, reads as 0 */ 99*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_SLOT_PRIORITY 0xf0000 /* slot arb priority mask */ 100*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_CPU_PRIORITY 0x100000 /* pio arb priority (simba) */ 101*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_PBUS_PARK_ENAB 0x200000 /* pci bus parking enable */ 102*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_INTER_ARB_ENAB 0x100000000 /* enable internal arb */ 103*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_PCI_SPEED 0x200000000 /* not used, reads as 0 */ 104*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_PCI_SYS_ERROR 0x800000000 /* set, if err on 2ndary */ 105*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_PCI_SBH_ERROR 0x1000000000 /* not used, reads as 0 */ 106*7c478bd9Sstevel@tonic-gate 107*7c478bd9Sstevel@tonic-gate /* 108*7c478bd9Sstevel@tonic-gate * Psycho AFSR reg bit defines(addrs = 0xe8). 109*7c478bd9Sstevel@tonic-gate */ 110*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_ERR_NUM 0xff /* error index number */ 111*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_MID_MASK (0x1f<<25) /* mid mask, reads 0 */ 112*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_BLK (1<<31) /* block, reads 0 */ 113*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_BYTE_MASK (0xffff<<32) /* byte mask, reads 0 */ 114*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_SEC_APERR (1<<54) /* 2ndary adr par err */ 115*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_PRI_APERR (1<<55) /* pri addr par err */ 116*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_SEC_PERR (1<<56) /* 2nd data par err */ 117*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_SEC_RTRY_ERR (1<<57) /* 2nd retry err */ 118*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_SEC_TA_ERR (1<<58) /* 2nd tgt abort err */ 119*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_SEC_MA_ERR (1<<59) /* 2nd mstr abort err */ 120*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_PRI_PERR (1<<60) /* pri data par error */ 121*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_PRI_RTRY_ERR (1<<61) /* pri retry error */ 122*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_PRI_TA_ERR (1<<62) /* mstr tgt abort err */ 123*7c478bd9Sstevel@tonic-gate #define PCI_PSYCHO_PRI_MA_ERR (1<<63) /* mstr mstr abrt err */ 124*7c478bd9Sstevel@tonic-gate 125*7c478bd9Sstevel@tonic-gate 126*7c478bd9Sstevel@tonic-gate /* 127*7c478bd9Sstevel@tonic-gate * notice: In Simba, AFAR will log statring address of transaction with error 128*7c478bd9Sstevel@tonic-gate * The byte offset will be logged in [7:0] of AFSR. 129*7c478bd9Sstevel@tonic-gate */ 130*7c478bd9Sstevel@tonic-gate 131*7c478bd9Sstevel@tonic-gate /* 132*7c478bd9Sstevel@tonic-gate * Diagnostics reg bit defines(size=d word)(addrs = 0xf8). 133*7c478bd9Sstevel@tonic-gate */ 134*7c478bd9Sstevel@tonic-gate #define PCI_DIAG_IDMA_WDATA_PAR 0x1 /* invert dma wr data parity */ 135*7c478bd9Sstevel@tonic-gate #define PCI_DIAG_IDMA_RDATA_PAR 0x2 /* invert dma rd data parity */ 136*7c478bd9Sstevel@tonic-gate #define PCI_DIAG_IDMA_ADDR_PAR 0x4 /* invert dma addr parity */ 137*7c478bd9Sstevel@tonic-gate #define PCI_DIAG_IPIO_WDATA_PAR 0x10 /* invert pio wr data parity */ 138*7c478bd9Sstevel@tonic-gate #define PCI_DIAG_IPIO_RDATA_PAR 0x20 /* invert pio rd data parity */ 139*7c478bd9Sstevel@tonic-gate #define PCI_DIAG_IPIO_ADDR_PAR 0x40 /* invert pio addr parity */ 140*7c478bd9Sstevel@tonic-gate 141*7c478bd9Sstevel@tonic-gate /* 142*7c478bd9Sstevel@tonic-gate * usefull defines. 143*7c478bd9Sstevel@tonic-gate */ 144*7c478bd9Sstevel@tonic-gate #define PCI_UNLIMITED_RETRY 0x0 /* unlimitted retry */ 145*7c478bd9Sstevel@tonic-gate #define PCI_UNLIMITED_LATENCY 0x0 /* unlimitted latency */ 146*7c478bd9Sstevel@tonic-gate 147*7c478bd9Sstevel@tonic-gate /* 148*7c478bd9Sstevel@tonic-gate * vendor & device id for simba. 149*7c478bd9Sstevel@tonic-gate */ 150*7c478bd9Sstevel@tonic-gate #define PCI_SIMBA_VENID 0x108e /* vendor id for simba */ 151*7c478bd9Sstevel@tonic-gate #define PCI_SIMBA_DEVID 0x5000 /* device id for simba */ 152*7c478bd9Sstevel@tonic-gate 153*7c478bd9Sstevel@tonic-gate /* 154*7c478bd9Sstevel@tonic-gate * programming interface for simba. 155*7c478bd9Sstevel@tonic-gate */ 156*7c478bd9Sstevel@tonic-gate #define PCI_SIMBA_PRI 0x0 /* prog interface for simba */ 157*7c478bd9Sstevel@tonic-gate 158*7c478bd9Sstevel@tonic-gate /* 159*7c478bd9Sstevel@tonic-gate * master/secondary latency timer value. 160*7c478bd9Sstevel@tonic-gate */ 161*7c478bd9Sstevel@tonic-gate #define PCI_LATENCY_TIMER_VAL 0x28 /* timer value for simba */ 162*7c478bd9Sstevel@tonic-gate 163*7c478bd9Sstevel@tonic-gate /* 164*7c478bd9Sstevel@tonic-gate * primary bus number for simba. 165*7c478bd9Sstevel@tonic-gate */ 166*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_PRIBUS_NUM 0x0 /* primary bus # for simba */ 167*7c478bd9Sstevel@tonic-gate 168*7c478bd9Sstevel@tonic-gate /* 169*7c478bd9Sstevel@tonic-gate * secondary bus number for simba. 170*7c478bd9Sstevel@tonic-gate */ 171*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_SECBUS_NUM_ONE 0x1 /* secondary bus number one */ 172*7c478bd9Sstevel@tonic-gate #define PCI_BCNF_SECBUS_NUM_TWO 0x2 /* secondary bus number two */ 173*7c478bd9Sstevel@tonic-gate 174*7c478bd9Sstevel@tonic-gate 175*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 176*7c478bd9Sstevel@tonic-gate } 177*7c478bd9Sstevel@tonic-gate #endif 178*7c478bd9Sstevel@tonic-gate 179*7c478bd9Sstevel@tonic-gate #endif /* _SYS_PCI_SIMBA_H */ 180