Home | History | Annotate | Line # | Download | only in pci
cia.c revision 1.47.2.2
      1  1.47.2.2  he /* $NetBSD: cia.c,v 1.47.2.2 2000/02/06 17:29:37 he Exp $ */
      2  1.47.2.2  he 
      3  1.47.2.2  he /*-
      4  1.47.2.2  he  * Copyright (c) 1998 The NetBSD Foundation, Inc.
      5  1.47.2.2  he  * All rights reserved.
      6  1.47.2.2  he  *
      7  1.47.2.2  he  * This code is derived from software contributed to The NetBSD Foundation
      8  1.47.2.2  he  * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
      9  1.47.2.2  he  * NASA Ames Research Center.
     10  1.47.2.2  he  *
     11  1.47.2.2  he  * Redistribution and use in source and binary forms, with or without
     12  1.47.2.2  he  * modification, are permitted provided that the following conditions
     13  1.47.2.2  he  * are met:
     14  1.47.2.2  he  * 1. Redistributions of source code must retain the above copyright
     15  1.47.2.2  he  *    notice, this list of conditions and the following disclaimer.
     16  1.47.2.2  he  * 2. Redistributions in binary form must reproduce the above copyright
     17  1.47.2.2  he  *    notice, this list of conditions and the following disclaimer in the
     18  1.47.2.2  he  *    documentation and/or other materials provided with the distribution.
     19  1.47.2.2  he  * 3. All advertising materials mentioning features or use of this software
     20  1.47.2.2  he  *    must display the following acknowledgement:
     21  1.47.2.2  he  *	This product includes software developed by the NetBSD
     22  1.47.2.2  he  *	Foundation, Inc. and its contributors.
     23  1.47.2.2  he  * 4. Neither the name of The NetBSD Foundation nor the names of its
     24  1.47.2.2  he  *    contributors may be used to endorse or promote products derived
     25  1.47.2.2  he  *    from this software without specific prior written permission.
     26  1.47.2.2  he  *
     27  1.47.2.2  he  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     28  1.47.2.2  he  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     29  1.47.2.2  he  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     30  1.47.2.2  he  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     31  1.47.2.2  he  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     32  1.47.2.2  he  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     33  1.47.2.2  he  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     34  1.47.2.2  he  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     35  1.47.2.2  he  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     36  1.47.2.2  he  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     37  1.47.2.2  he  * POSSIBILITY OF SUCH DAMAGE.
     38  1.47.2.2  he  */
     39  1.47.2.2  he 
     40  1.47.2.2  he /*
     41  1.47.2.2  he  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
     42  1.47.2.2  he  * All rights reserved.
     43  1.47.2.2  he  *
     44  1.47.2.2  he  * Author: Chris G. Demetriou
     45  1.47.2.2  he  *
     46  1.47.2.2  he  * Permission to use, copy, modify and distribute this software and
     47  1.47.2.2  he  * its documentation is hereby granted, provided that both the copyright
     48  1.47.2.2  he  * notice and this permission notice appear in all copies of the
     49  1.47.2.2  he  * software, derivative works or modified versions, and any portions
     50  1.47.2.2  he  * thereof, and that both notices appear in supporting documentation.
     51  1.47.2.2  he  *
     52  1.47.2.2  he  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     53  1.47.2.2  he  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     54  1.47.2.2  he  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     55  1.47.2.2  he  *
     56  1.47.2.2  he  * Carnegie Mellon requests users of this software to return to
     57  1.47.2.2  he  *
     58  1.47.2.2  he  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     59  1.47.2.2  he  *  School of Computer Science
     60  1.47.2.2  he  *  Carnegie Mellon University
     61  1.47.2.2  he  *  Pittsburgh PA 15213-3890
     62  1.47.2.2  he  *
     63  1.47.2.2  he  * any improvements or extensions that they make and grant Carnegie the
     64  1.47.2.2  he  * rights to redistribute these changes.
     65  1.47.2.2  he  */
     66  1.47.2.2  he 
     67  1.47.2.2  he #include "opt_dec_eb164.h"
     68  1.47.2.2  he #include "opt_dec_kn20aa.h"
     69  1.47.2.2  he #include "opt_dec_550.h"
     70  1.47.2.2  he #include "opt_dec_1000a.h"
     71  1.47.2.2  he #include "opt_dec_1000.h"
     72  1.47.2.2  he 
     73  1.47.2.2  he #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
     74  1.47.2.2  he 
     75  1.47.2.2  he __KERNEL_RCSID(0, "$NetBSD: cia.c,v 1.47.2.2 2000/02/06 17:29:37 he Exp $");
     76  1.47.2.2  he 
     77  1.47.2.2  he #include <sys/param.h>
     78  1.47.2.2  he #include <sys/systm.h>
     79  1.47.2.2  he #include <sys/kernel.h>
     80  1.47.2.2  he #include <sys/malloc.h>
     81  1.47.2.2  he #include <sys/device.h>
     82  1.47.2.2  he #include <vm/vm.h>
     83  1.47.2.2  he 
     84  1.47.2.2  he #include <machine/autoconf.h>
     85  1.47.2.2  he #include <machine/rpb.h>
     86  1.47.2.2  he 
     87  1.47.2.2  he #include <dev/isa/isareg.h>
     88  1.47.2.2  he #include <dev/isa/isavar.h>
     89  1.47.2.2  he 
     90  1.47.2.2  he #include <dev/pci/pcireg.h>
     91  1.47.2.2  he #include <dev/pci/pcivar.h>
     92  1.47.2.2  he #include <alpha/pci/ciareg.h>
     93  1.47.2.2  he #include <alpha/pci/ciavar.h>
     94  1.47.2.2  he 
     95  1.47.2.2  he #ifdef DEC_KN20AA
     96  1.47.2.2  he #include <alpha/pci/pci_kn20aa.h>
     97  1.47.2.2  he #endif
     98  1.47.2.2  he #ifdef DEC_EB164
     99  1.47.2.2  he #include <alpha/pci/pci_eb164.h>
    100  1.47.2.2  he #endif
    101  1.47.2.2  he #ifdef DEC_550
    102  1.47.2.2  he #include <alpha/pci/pci_550.h>
    103  1.47.2.2  he #endif
    104  1.47.2.2  he #ifdef DEC_1000A
    105  1.47.2.2  he #include <alpha/pci/pci_1000a.h>
    106  1.47.2.2  he #endif
    107  1.47.2.2  he #ifdef DEC_1000
    108  1.47.2.2  he #include <alpha/pci/pci_1000.h>
    109  1.47.2.2  he #endif
    110  1.47.2.2  he 
    111  1.47.2.2  he int	ciamatch __P((struct device *, struct cfdata *, void *));
    112  1.47.2.2  he void	ciaattach __P((struct device *, struct device *, void *));
    113  1.47.2.2  he 
    114  1.47.2.2  he struct cfattach cia_ca = {
    115  1.47.2.2  he 	sizeof(struct cia_softc), ciamatch, ciaattach,
    116  1.47.2.2  he };
    117  1.47.2.2  he 
    118  1.47.2.2  he extern struct cfdriver cia_cd;
    119  1.47.2.2  he 
    120  1.47.2.2  he static int	ciaprint __P((void *, const char *pnp));
    121  1.47.2.2  he 
    122  1.47.2.2  he /* There can be only one. */
    123  1.47.2.2  he int ciafound;
    124  1.47.2.2  he struct cia_config cia_configuration;
    125  1.47.2.2  he 
    126  1.47.2.2  he /*
    127  1.47.2.2  he  * This determines if we attempt to use BWX for PCI bus and config space
    128  1.47.2.2  he  * access.  Some systems, notably with Pyxis, don't fare so well unless
    129  1.47.2.2  he  * BWX is used.
    130  1.47.2.2  he  *
    131  1.47.2.2  he  * EXCEPT!  Some devices have a really hard time if BWX is used (WHY?!).
    132  1.47.2.2  he  * So, we decouple the uses for PCI config space and PCI bus space.
    133  1.47.2.2  he  */
    134  1.47.2.2  he 
    135  1.47.2.2  he #ifndef CIA_PCI_USE_BWX
    136  1.47.2.2  he #define	CIA_PCI_USE_BWX	1
    137  1.47.2.2  he #endif
    138  1.47.2.2  he 
    139  1.47.2.2  he #ifndef	CIA_BUS_USE_BWX
    140  1.47.2.2  he #define	CIA_BUS_USE_BWX	0
    141  1.47.2.2  he #endif
    142  1.47.2.2  he 
    143  1.47.2.2  he int	cia_pci_use_bwx = CIA_PCI_USE_BWX;
    144  1.47.2.2  he int	cia_bus_use_bwx = CIA_BUS_USE_BWX;
    145  1.47.2.2  he 
    146  1.47.2.2  he int
    147  1.47.2.2  he ciamatch(parent, match, aux)
    148  1.47.2.2  he 	struct device *parent;
    149  1.47.2.2  he 	struct cfdata *match;
    150  1.47.2.2  he 	void *aux;
    151  1.47.2.2  he {
    152  1.47.2.2  he 	struct mainbus_attach_args *ma = aux;
    153  1.47.2.2  he 
    154  1.47.2.2  he 	/* Make sure that we're looking for a CIA. */
    155  1.47.2.2  he 	if (strcmp(ma->ma_name, cia_cd.cd_name) != 0)
    156  1.47.2.2  he 		return (0);
    157  1.47.2.2  he 
    158  1.47.2.2  he 	if (ciafound)
    159  1.47.2.2  he 		return (0);
    160  1.47.2.2  he 
    161  1.47.2.2  he 	return (1);
    162  1.47.2.2  he }
    163  1.47.2.2  he 
    164  1.47.2.2  he /*
    165  1.47.2.2  he  * Set up the chipset's function pointers.
    166  1.47.2.2  he  */
    167  1.47.2.2  he void
    168  1.47.2.2  he cia_init(ccp, mallocsafe)
    169  1.47.2.2  he 	struct cia_config *ccp;
    170  1.47.2.2  he 	int mallocsafe;
    171  1.47.2.2  he {
    172  1.47.2.2  he 
    173  1.47.2.2  he 	ccp->cc_hae_mem = REGVAL(CIA_CSR_HAE_MEM);
    174  1.47.2.2  he 	ccp->cc_hae_io = REGVAL(CIA_CSR_HAE_IO);
    175  1.47.2.2  he 	ccp->cc_rev = REGVAL(CIA_CSR_REV) & REV_MASK;
    176  1.47.2.2  he 
    177  1.47.2.2  he 	/*
    178  1.47.2.2  he 	 * Determine if we have a Pyxis.  Only two systypes can
    179  1.47.2.2  he 	 * have this: the EB164 systype (AlphaPC164LX and AlphaPC164SX)
    180  1.47.2.2  he 	 * and the DEC_550 systype (Miata).
    181  1.47.2.2  he 	 */
    182  1.47.2.2  he 	if ((cputype == ST_EB164 &&
    183  1.47.2.2  he 	     (hwrpb->rpb_variation & SV_ST_MASK) >= SV_ST_ALPHAPC164LX_400) ||
    184  1.47.2.2  he 	    cputype == ST_DEC_550)
    185  1.47.2.2  he 		ccp->cc_flags |= CCF_ISPYXIS;
    186  1.47.2.2  he 
    187  1.47.2.2  he 	/*
    188  1.47.2.2  he 	 * ALCOR/ALCOR2 Revisions >= 2 and Pyxis have the CNFG register.
    189  1.47.2.2  he 	 */
    190  1.47.2.2  he 	if (ccp->cc_rev >= 2 || (ccp->cc_flags & CCF_ISPYXIS) != 0)
    191  1.47.2.2  he 		ccp->cc_cnfg = REGVAL(CIA_CSR_CNFG);
    192  1.47.2.2  he 	else
    193  1.47.2.2  he 		ccp->cc_cnfg = 0;
    194  1.47.2.2  he 
    195  1.47.2.2  he 	/*
    196  1.47.2.2  he 	 * Use BWX iff:
    197  1.47.2.2  he 	 *
    198  1.47.2.2  he 	 *	- It hasn't been disbled by the user,
    199  1.47.2.2  he 	 *	- it's enabled in CNFG,
    200  1.47.2.2  he 	 *	- we're implementation version ev5,
    201  1.47.2.2  he 	 *	- BWX is enabled in the CPU's capabilities mask (yes,
    202  1.47.2.2  he 	 *	  the bit is really cleared if the capability exists...)
    203  1.47.2.2  he 	 */
    204  1.47.2.2  he 	if ((cia_pci_use_bwx || cia_bus_use_bwx) &&
    205  1.47.2.2  he 	    (ccp->cc_cnfg & CNFG_BWEN) != 0 &&
    206  1.47.2.2  he 	    alpha_implver() == ALPHA_IMPLVER_EV5 &&
    207  1.47.2.2  he 	    alpha_amask(ALPHA_AMASK_BWX) == 0) {
    208  1.47.2.2  he 		u_int32_t ctrl;
    209  1.47.2.2  he 
    210  1.47.2.2  he 		if (cia_pci_use_bwx)
    211  1.47.2.2  he 			ccp->cc_flags |= CCF_PCI_USE_BWX;
    212  1.47.2.2  he 		if (cia_bus_use_bwx)
    213  1.47.2.2  he 			ccp->cc_flags |= CCF_BUS_USE_BWX;
    214  1.47.2.2  he 
    215  1.47.2.2  he 		/*
    216  1.47.2.2  he 		 * For whatever reason, the firmware seems to enable PCI
    217  1.47.2.2  he 		 * loopback mode if it also enables BWX.  Make sure it's
    218  1.47.2.2  he 		 * enabled if we have an old, buggy firmware rev.
    219  1.47.2.2  he 		 */
    220  1.47.2.2  he 		alpha_mb();
    221  1.47.2.2  he 		ctrl = REGVAL(CIA_CSR_CTRL);
    222  1.47.2.2  he 		if ((ctrl & CTRL_PCI_LOOP_EN) == 0) {
    223  1.47.2.2  he 			REGVAL(CIA_CSR_CTRL) = ctrl | CTRL_PCI_LOOP_EN;
    224  1.47.2.2  he 			alpha_mb();
    225  1.47.2.2  he 		}
    226  1.47.2.2  he 	}
    227  1.47.2.2  he 
    228  1.47.2.2  he 	if (!ccp->cc_initted) {
    229  1.47.2.2  he 		/* don't do these twice since they set up extents */
    230  1.47.2.2  he 		if (ccp->cc_flags & CCF_BUS_USE_BWX) {
    231  1.47.2.2  he 			cia_bwx_bus_io_init(&ccp->cc_iot, ccp);
    232  1.47.2.2  he 			cia_bwx_bus_mem_init(&ccp->cc_memt, ccp);
    233  1.47.2.2  he 		} else {
    234  1.47.2.2  he 			cia_swiz_bus_io_init(&ccp->cc_iot, ccp);
    235  1.47.2.2  he 			cia_swiz_bus_mem_init(&ccp->cc_memt, ccp);
    236  1.47.2.2  he 		}
    237  1.47.2.2  he 	}
    238  1.47.2.2  he 	ccp->cc_mallocsafe = mallocsafe;
    239  1.47.2.2  he 
    240  1.47.2.2  he 	cia_pci_init(&ccp->cc_pc, ccp);
    241  1.47.2.2  he 
    242  1.47.2.2  he 	ccp->cc_initted = 1;
    243  1.47.2.2  he }
    244  1.47.2.2  he 
    245  1.47.2.2  he void
    246  1.47.2.2  he ciaattach(parent, self, aux)
    247  1.47.2.2  he 	struct device *parent, *self;
    248  1.47.2.2  he 	void *aux;
    249  1.47.2.2  he {
    250  1.47.2.2  he 	struct cia_softc *sc = (struct cia_softc *)self;
    251  1.47.2.2  he 	struct cia_config *ccp;
    252  1.47.2.2  he 	struct pcibus_attach_args pba;
    253  1.47.2.2  he 	char bits[64];
    254  1.47.2.2  he 	const char *name;
    255  1.47.2.2  he 	int pass;
    256  1.47.2.2  he 
    257  1.47.2.2  he 	/* note that we've attached the chipset; can't have 2 CIAs. */
    258  1.47.2.2  he 	ciafound = 1;
    259  1.47.2.2  he 
    260  1.47.2.2  he 	/*
    261  1.47.2.2  he 	 * set up the chipset's info; done once at console init time
    262  1.47.2.2  he 	 * (maybe), but we must do it here as well to take care of things
    263  1.47.2.2  he 	 * that need to use memory allocation.
    264  1.47.2.2  he 	 */
    265  1.47.2.2  he 	ccp = sc->sc_ccp = &cia_configuration;
    266  1.47.2.2  he 	cia_init(ccp, 1);
    267  1.47.2.2  he 
    268  1.47.2.2  he 	if (ccp->cc_flags & CCF_ISPYXIS) {
    269  1.47.2.2  he 		name = "Pyxis";
    270  1.47.2.2  he 		pass = ccp->cc_rev;
    271  1.47.2.2  he 	} else {
    272  1.47.2.2  he 		name = "ALCOR/ALCOR2";
    273  1.47.2.2  he 		pass = ccp->cc_rev + 1;
    274  1.47.2.2  he 	}
    275  1.47.2.2  he 
    276  1.47.2.2  he 	printf(": DECchip 2117x Core Logic Chipset (%s), pass %d\n",
    277  1.47.2.2  he 	    name, pass);
    278  1.47.2.2  he 	if (ccp->cc_cnfg)
    279  1.47.2.2  he 		printf("%s: extended capabilities: %s\n", self->dv_xname,
    280  1.47.2.2  he 		    bitmask_snprintf(ccp->cc_cnfg, CIA_CSR_CNFG_BITS,
    281  1.47.2.2  he 		    bits, sizeof(bits)));
    282  1.47.2.2  he 
    283  1.47.2.2  he 	switch (ccp->cc_flags & (CCF_PCI_USE_BWX|CCF_BUS_USE_BWX)) {
    284  1.47.2.2  he 	case CCF_PCI_USE_BWX|CCF_BUS_USE_BWX:
    285  1.47.2.2  he 		name = "PCI config and bus";
    286  1.47.2.2  he 		break;
    287  1.47.2.2  he 	case CCF_PCI_USE_BWX:
    288  1.47.2.2  he 		name = "PCI config";
    289  1.47.2.2  he 		break;
    290  1.47.2.2  he 	case CCF_BUS_USE_BWX:
    291  1.47.2.2  he 		name = "bus";
    292  1.47.2.2  he 		break;
    293  1.47.2.2  he 	default:
    294  1.47.2.2  he 		name = NULL;
    295  1.47.2.2  he 		break;
    296  1.47.2.2  he 	}
    297  1.47.2.2  he 	if (name != NULL)
    298  1.47.2.2  he 		printf("%s: using BWX for %s access\n", self->dv_xname, name);
    299  1.47.2.2  he 
    300  1.47.2.2  he #ifdef DEC_550
    301  1.47.2.2  he 	if (cputype == ST_DEC_550 &&
    302  1.47.2.2  he 	    (hwrpb->rpb_variation & SV_ST_MASK) < SV_ST_MIATA_1_5) {
    303  1.47.2.2  he 		/*
    304  1.47.2.2  he 		 * Miata 1 systems have a bug: DMA cannot cross
    305  1.47.2.2  he 		 * an 8k boundary!  Make sure PCI read prefetching
    306  1.47.2.2  he 		 * is disabled on these chips.  Note that secondary
    307  1.47.2.2  he 		 * PCI busses don't have this problem, because of
    308  1.47.2.2  he 		 * the way PPBs handle PCI read requests.
    309  1.47.2.2  he 		 *
    310  1.47.2.2  he 		 * In the 21174 Technical Reference Manual, this is
    311  1.47.2.2  he 		 * actually documented as "Pyxis Pass 1", but apparently
    312  1.47.2.2  he 		 * there are chips that report themselves as "Pass 1"
    313  1.47.2.2  he 		 * which do not have the bug!  Miatas with the Cypress
    314  1.47.2.2  he 		 * PCI-ISA bridge (i.e. Miata 1.5 and Miata 2) do not
    315  1.47.2.2  he 		 * have the bug, so we use this check.
    316  1.47.2.2  he 		 *
    317  1.47.2.2  he 		 * NOTE: This bug is actually worked around in cia_dma.c,
    318  1.47.2.2  he 		 * when direct-mapped DMA maps are created.
    319  1.47.2.2  he 		 *
    320  1.47.2.2  he 		 * XXX WE NEED TO THINK ABOUT HOW TO HANDLE THIS FOR
    321  1.47.2.2  he 		 * XXX SGMAP DMA MAPPINGS!
    322  1.47.2.2  he 		 */
    323  1.47.2.2  he 		u_int32_t ctrl;
    324  1.47.2.2  he 
    325  1.47.2.2  he 		/* XXX no bets... */
    326  1.47.2.2  he 		printf("%s: WARNING: Pyxis pass 1 DMA bug; no bets...\n",
    327  1.47.2.2  he 		    self->dv_xname);
    328  1.47.2.2  he 
    329  1.47.2.2  he 		alpha_mb();
    330  1.47.2.2  he 		ctrl = REGVAL(CIA_CSR_CTRL);
    331  1.47.2.2  he 		ctrl &= ~(CTRL_RD_TYPE|CTRL_RL_TYPE|CTRL_RM_TYPE);
    332  1.47.2.2  he 		REGVAL(CIA_CSR_CTRL) = ctrl;
    333  1.47.2.2  he 		alpha_mb();
    334  1.47.2.2  he 	}
    335  1.47.2.2  he #endif /* DEC_550 */
    336  1.47.2.2  he 
    337  1.47.2.2  he 	cia_dma_init(ccp);
    338  1.47.2.2  he 
    339  1.47.2.2  he 	switch (cputype) {
    340  1.47.2.2  he #ifdef DEC_KN20AA
    341  1.47.2.2  he 	case ST_DEC_KN20AA:
    342  1.47.2.2  he 		pci_kn20aa_pickintr(ccp);
    343  1.47.2.2  he 		break;
    344  1.47.2.2  he #endif
    345  1.47.2.2  he 
    346  1.47.2.2  he #ifdef DEC_EB164
    347  1.47.2.2  he 	case ST_EB164:
    348  1.47.2.2  he 		pci_eb164_pickintr(ccp);
    349  1.47.2.2  he 		break;
    350  1.47.2.2  he #endif
    351  1.47.2.2  he 
    352  1.47.2.2  he #ifdef DEC_550
    353  1.47.2.2  he 	case ST_DEC_550:
    354  1.47.2.2  he 		pci_550_pickintr(ccp);
    355  1.47.2.2  he 		break;
    356  1.47.2.2  he #endif
    357  1.47.2.2  he 
    358  1.47.2.2  he #ifdef DEC_1000A
    359  1.47.2.2  he 	case ST_DEC_1000A:
    360  1.47.2.2  he 		pci_1000a_pickintr(ccp, &ccp->cc_iot, &ccp->cc_memt,
    361  1.47.2.2  he 			&ccp->cc_pc);
    362  1.47.2.2  he 		break;
    363  1.47.2.2  he #endif
    364  1.47.2.2  he 
    365  1.47.2.2  he #ifdef DEC_1000
    366  1.47.2.2  he 	case ST_DEC_1000:
    367  1.47.2.2  he 		pci_1000_pickintr(ccp, &ccp->cc_iot, &ccp->cc_memt,
    368  1.47.2.2  he 			&ccp->cc_pc);
    369  1.47.2.2  he 		break;
    370  1.47.2.2  he #endif
    371  1.47.2.2  he 
    372  1.47.2.2  he 	default:
    373  1.47.2.2  he 		panic("ciaattach: shouldn't be here, really...");
    374  1.47.2.2  he 	}
    375  1.47.2.2  he 
    376  1.47.2.2  he 	pba.pba_busname = "pci";
    377  1.47.2.2  he 	pba.pba_iot = &ccp->cc_iot;
    378  1.47.2.2  he 	pba.pba_memt = &ccp->cc_memt;
    379  1.47.2.2  he 	pba.pba_dmat =
    380  1.47.2.2  he 	    alphabus_dma_get_tag(&ccp->cc_dmat_direct, ALPHA_BUS_PCI);
    381  1.47.2.2  he 	pba.pba_pc = &ccp->cc_pc;
    382  1.47.2.2  he 	pba.pba_bus = 0;
    383  1.47.2.2  he 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
    384  1.47.2.2  he 	config_found(self, &pba, ciaprint);
    385  1.47.2.2  he }
    386  1.47.2.2  he 
    387  1.47.2.2  he static int
    388  1.47.2.2  he ciaprint(aux, pnp)
    389  1.47.2.2  he 	void *aux;
    390  1.47.2.2  he 	const char *pnp;
    391  1.47.2.2  he {
    392  1.47.2.2  he 	register struct pcibus_attach_args *pba = aux;
    393  1.47.2.2  he 
    394  1.47.2.2  he 	/* only PCIs can attach to CIAs; easy. */
    395  1.47.2.2  he 	if (pnp)
    396  1.47.2.2  he 		printf("%s at %s", pba->pba_busname, pnp);
    397  1.47.2.2  he 	printf(" bus %d", pba->pba_bus);
    398  1.47.2.2  he 	return (UNCONF);
    399  1.47.2.2  he }
    400