Home | History | Annotate | Line # | Download | only in pci
pchb.c revision 1.4
      1  1.4    markd /*	$NetBSD: pchb.c,v 1.4 2007/11/24 02:18:48 markd Exp $ */
      2  1.1  xtraeme 
      3  1.1  xtraeme /*-
      4  1.1  xtraeme  * Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc.
      5  1.1  xtraeme  * All rights reserved.
      6  1.1  xtraeme  *
      7  1.1  xtraeme  * This code is derived from software contributed to The NetBSD Foundation
      8  1.1  xtraeme  * by Jason R. Thorpe.
      9  1.1  xtraeme  *
     10  1.1  xtraeme  * Redistribution and use in source and binary forms, with or without
     11  1.1  xtraeme  * modification, are permitted provided that the following conditions
     12  1.1  xtraeme  * are met:
     13  1.1  xtraeme  * 1. Redistributions of source code must retain the above copyright
     14  1.1  xtraeme  *    notice, this list of conditions and the following disclaimer.
     15  1.1  xtraeme  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1  xtraeme  *    notice, this list of conditions and the following disclaimer in the
     17  1.1  xtraeme  *    documentation and/or other materials provided with the distribution.
     18  1.1  xtraeme  * 3. All advertising materials mentioning features or use of this software
     19  1.1  xtraeme  *    must display the following acknowledgement:
     20  1.1  xtraeme  *        This product includes software developed by the NetBSD
     21  1.1  xtraeme  *        Foundation, Inc. and its contributors.
     22  1.1  xtraeme  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.1  xtraeme  *    contributors may be used to endorse or promote products derived
     24  1.1  xtraeme  *    from this software without specific prior written permission.
     25  1.1  xtraeme  *
     26  1.1  xtraeme  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.1  xtraeme  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.1  xtraeme  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.1  xtraeme  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.1  xtraeme  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.1  xtraeme  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.1  xtraeme  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.1  xtraeme  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.1  xtraeme  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.1  xtraeme  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.1  xtraeme  * POSSIBILITY OF SUCH DAMAGE.
     37  1.1  xtraeme  */
     38  1.1  xtraeme 
     39  1.1  xtraeme #include <sys/cdefs.h>
     40  1.4    markd __KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.4 2007/11/24 02:18:48 markd Exp $");
     41  1.1  xtraeme 
     42  1.1  xtraeme #include <sys/types.h>
     43  1.1  xtraeme #include <sys/param.h>
     44  1.1  xtraeme #include <sys/systm.h>
     45  1.1  xtraeme #include <sys/device.h>
     46  1.1  xtraeme 
     47  1.1  xtraeme #include <machine/bus.h>
     48  1.1  xtraeme 
     49  1.1  xtraeme #include <dev/pci/pcivar.h>
     50  1.1  xtraeme #include <dev/pci/pcireg.h>
     51  1.1  xtraeme 
     52  1.1  xtraeme #include <dev/pci/pcidevs.h>
     53  1.1  xtraeme 
     54  1.1  xtraeme #include <dev/pci/agpreg.h>
     55  1.1  xtraeme #include <dev/pci/agpvar.h>
     56  1.1  xtraeme 
     57  1.1  xtraeme #include <arch/x86/pci/pchbvar.h>
     58  1.1  xtraeme 
     59  1.1  xtraeme #include "rnd.h"
     60  1.1  xtraeme 
     61  1.1  xtraeme #define PCISET_BRIDGETYPE_MASK	0x3
     62  1.1  xtraeme #define PCISET_TYPE_COMPAT	0x1
     63  1.1  xtraeme #define PCISET_TYPE_AUX		0x2
     64  1.1  xtraeme 
     65  1.1  xtraeme #define PCISET_BUSCONFIG_REG	0x48
     66  1.1  xtraeme #define PCISET_BRIDGE_NUMBER(reg)	(((reg) >> 8) & 0xff)
     67  1.1  xtraeme #define PCISET_PCI_BUS_NUMBER(reg)	(((reg) >> 16) & 0xff)
     68  1.1  xtraeme 
     69  1.1  xtraeme /* XXX should be in dev/ic/i82443reg.h */
     70  1.1  xtraeme #define	I82443BX_SDRAMC_REG	0x76
     71  1.1  xtraeme 
     72  1.1  xtraeme /* XXX should be in dev/ic/i82424{reg.var}.h */
     73  1.1  xtraeme #define I82424_CPU_BCTL_REG		0x53
     74  1.1  xtraeme #define I82424_PCI_BCTL_REG		0x54
     75  1.1  xtraeme 
     76  1.1  xtraeme #define I82424_BCTL_CPUMEM_POSTEN	0x01
     77  1.1  xtraeme #define I82424_BCTL_CPUPCI_POSTEN	0x02
     78  1.1  xtraeme #define I82424_BCTL_PCIMEM_BURSTEN	0x01
     79  1.1  xtraeme #define I82424_BCTL_PCI_BURSTEN		0x02
     80  1.1  xtraeme 
     81  1.1  xtraeme int	pchbmatch(struct device *, struct cfdata *, void *);
     82  1.1  xtraeme void	pchbattach(struct device *, struct device *, void *);
     83  1.1  xtraeme 
     84  1.1  xtraeme CFATTACH_DECL(pchb, sizeof(struct pchb_softc),
     85  1.1  xtraeme     pchbmatch, pchbattach, NULL, NULL);
     86  1.1  xtraeme 
     87  1.1  xtraeme int
     88  1.1  xtraeme pchbmatch(struct device *parent, struct cfdata *match, void *aux)
     89  1.1  xtraeme {
     90  1.1  xtraeme 	struct pci_attach_args *pa = aux;
     91  1.1  xtraeme 
     92  1.1  xtraeme 	if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE &&
     93  1.1  xtraeme 	    PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_HOST)
     94  1.1  xtraeme 		return 1;
     95  1.1  xtraeme 
     96  1.1  xtraeme 	return 0;
     97  1.1  xtraeme }
     98  1.1  xtraeme 
     99  1.1  xtraeme void
    100  1.1  xtraeme pchbattach(struct device *parent, struct device *self, void *aux)
    101  1.1  xtraeme {
    102  1.1  xtraeme #if NRND > 0
    103  1.1  xtraeme 	struct pchb_softc *sc = (void *) self;
    104  1.1  xtraeme #endif
    105  1.1  xtraeme 	struct pci_attach_args *pa = aux;
    106  1.1  xtraeme 	char devinfo[256];
    107  1.1  xtraeme 	struct pcibus_attach_args pba;
    108  1.1  xtraeme 	struct agpbus_attach_args apa;
    109  1.1  xtraeme 	pcireg_t bcreg;
    110  1.1  xtraeme 	u_char bdnum, pbnum = 0; /* XXX: gcc */
    111  1.1  xtraeme 	pcitag_t tag;
    112  1.1  xtraeme 	int doattach, attachflags, has_agp;
    113  1.1  xtraeme 
    114  1.1  xtraeme 	aprint_naive("\n");
    115  1.1  xtraeme 	aprint_normal("\n");
    116  1.1  xtraeme 
    117  1.1  xtraeme 	doattach = 0;
    118  1.1  xtraeme 	has_agp = 0;
    119  1.1  xtraeme 	attachflags = pa->pa_flags;
    120  1.1  xtraeme 
    121  1.1  xtraeme 	/*
    122  1.1  xtraeme 	 * Print out a description, and configure certain chipsets which
    123  1.1  xtraeme 	 * have auxiliary PCI buses.
    124  1.1  xtraeme 	 */
    125  1.1  xtraeme 
    126  1.1  xtraeme 	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
    127  1.1  xtraeme 	aprint_normal("%s: %s (rev. 0x%02x)\n", self->dv_xname, devinfo,
    128  1.1  xtraeme 	    PCI_REVISION(pa->pa_class));
    129  1.1  xtraeme 
    130  1.1  xtraeme 	switch (PCI_VENDOR(pa->pa_id)) {
    131  1.1  xtraeme 	/*
    132  1.1  xtraeme 	 * i386 stuff.
    133  1.1  xtraeme 	 */
    134  1.1  xtraeme 	case PCI_VENDOR_SERVERWORKS:
    135  1.1  xtraeme 		pbnum = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x44) & 0xff;
    136  1.1  xtraeme 
    137  1.1  xtraeme 		if (pbnum == 0)
    138  1.1  xtraeme 			break;
    139  1.1  xtraeme 
    140  1.1  xtraeme 		/*
    141  1.1  xtraeme 		 * This host bridge has a second PCI bus.
    142  1.1  xtraeme 		 * Configure it.
    143  1.1  xtraeme 		 */
    144  1.1  xtraeme 		switch (PCI_PRODUCT(pa->pa_id)) {
    145  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CSB5:
    146  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CSB6:
    147  1.1  xtraeme 			/* These devices show up as host bridges, but are
    148  1.1  xtraeme 			   really southbridges. */
    149  1.1  xtraeme 			break;
    150  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CMIC_HE:
    151  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CMIC_LE:
    152  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CMIC_SL:
    153  1.1  xtraeme 			/* CNBs and CIOBs are connected to these using a
    154  1.1  xtraeme 			   private bus.  The bus number register is that of
    155  1.1  xtraeme 			   the first PCI bus hanging off the CIOB.  We let
    156  1.1  xtraeme 			   the CIOB attachment handle configuring the PCI
    157  1.1  xtraeme 			   buses. */
    158  1.1  xtraeme 			break;
    159  1.1  xtraeme 		default:
    160  1.1  xtraeme 			aprint_error("%s: unknown ServerWorks chip ID "
    161  1.1  xtraeme 			    "0x%04x; trying to attach PCI buses behind it\n",
    162  1.1  xtraeme 			    self->dv_xname, PCI_PRODUCT(pa->pa_id));
    163  1.1  xtraeme 			/* FALLTHROUGH */
    164  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CNB20_LE_AGP:
    165  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CNB30_LE_PCI:
    166  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CNB20_LE_PCI:
    167  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CNB20_HE_PCI:
    168  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CNB20_HE_AGP:
    169  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CIOB_X:
    170  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CNB30_HE:
    171  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CNB20_HE_PCI2:
    172  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CIOB_X2:
    173  1.1  xtraeme 		case PCI_PRODUCT_SERVERWORKS_CIOB_E:
    174  1.1  xtraeme 			switch (attachflags &
    175  1.1  xtraeme 			    (PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED)) {
    176  1.1  xtraeme 			case 0:
    177  1.1  xtraeme 				/* Doesn't smell like there's anything there. */
    178  1.1  xtraeme 				break;
    179  1.1  xtraeme 			case PCI_FLAGS_MEM_ENABLED:
    180  1.1  xtraeme 				attachflags |= PCI_FLAGS_IO_ENABLED;
    181  1.1  xtraeme 				/* FALLTHROUGH */
    182  1.1  xtraeme 			default:
    183  1.1  xtraeme 				doattach = 1;
    184  1.1  xtraeme 				break;
    185  1.1  xtraeme 			}
    186  1.1  xtraeme 			break;
    187  1.1  xtraeme 		}
    188  1.1  xtraeme 		break;
    189  1.1  xtraeme 	case PCI_VENDOR_INTEL:
    190  1.1  xtraeme 		switch (PCI_PRODUCT(pa->pa_id)) {
    191  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82452_PB:
    192  1.1  xtraeme 			bcreg = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x40);
    193  1.1  xtraeme 			pbnum = PCISET_BRIDGE_NUMBER(bcreg);
    194  1.1  xtraeme 			if (pbnum != 0xff) {
    195  1.1  xtraeme 				pbnum++;
    196  1.1  xtraeme 				doattach = 1;
    197  1.1  xtraeme 			}
    198  1.1  xtraeme 			break;
    199  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82443BX_AGP:
    200  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82443BX_NOAGP:
    201  1.1  xtraeme 		/*
    202  1.1  xtraeme 		 * http://www.intel.com/design/chipsets/specupdt/290639.htm
    203  1.1  xtraeme 		 * says this bug is fixed in steppings >= C0 (erratum 11),
    204  1.1  xtraeme 		 * so don't tweak the bits in that case.
    205  1.1  xtraeme 		 */
    206  1.1  xtraeme 			if (!(PCI_REVISION(pa->pa_class) >= 0x03)) {
    207  1.1  xtraeme 				/*
    208  1.1  xtraeme 				 * BIOS BUG WORKAROUND!  The 82443BX
    209  1.1  xtraeme 				 * datasheet indicates that the only
    210  1.1  xtraeme 				 * legal setting for the "Idle/Pipeline
    211  1.1  xtraeme 				 * DRAM Leadoff Timing (IPLDT)" parameter
    212  1.1  xtraeme 				 * (bits 9:8) is 01.  Unfortunately, some
    213  1.1  xtraeme 				 * BIOSs do not set these bits properly.
    214  1.1  xtraeme 				 */
    215  1.1  xtraeme 				bcreg = pci_conf_read(pa->pa_pc, pa->pa_tag,
    216  1.1  xtraeme 				    I82443BX_SDRAMC_REG);
    217  1.1  xtraeme 				if ((bcreg & 0x0300) != 0x0100) {
    218  1.1  xtraeme 					aprint_verbose("%s: fixing "
    219  1.1  xtraeme 					    "Idle/Pipeline DRAM "
    220  1.1  xtraeme 					    "Leadoff Timing\n", self->dv_xname);
    221  1.1  xtraeme 					bcreg &= ~0x0300;
    222  1.1  xtraeme 					bcreg |=  0x0100;
    223  1.1  xtraeme 					pci_conf_write(pa->pa_pc, pa->pa_tag,
    224  1.1  xtraeme 					    I82443BX_SDRAMC_REG, bcreg);
    225  1.1  xtraeme 				}
    226  1.1  xtraeme 			}
    227  1.1  xtraeme 			break;
    228  1.1  xtraeme 
    229  1.1  xtraeme 		case PCI_PRODUCT_INTEL_PCI450_PB:
    230  1.1  xtraeme 			bcreg = pci_conf_read(pa->pa_pc, pa->pa_tag,
    231  1.1  xtraeme 					      PCISET_BUSCONFIG_REG);
    232  1.1  xtraeme 			bdnum = PCISET_BRIDGE_NUMBER(bcreg);
    233  1.1  xtraeme 			pbnum = PCISET_PCI_BUS_NUMBER(bcreg);
    234  1.1  xtraeme 			switch (bdnum & PCISET_BRIDGETYPE_MASK) {
    235  1.1  xtraeme 			default:
    236  1.1  xtraeme 				aprint_error("%s: bdnum=%x (reserved)\n",
    237  1.1  xtraeme 				       self->dv_xname, bdnum);
    238  1.1  xtraeme 				break;
    239  1.1  xtraeme 			case PCISET_TYPE_COMPAT:
    240  1.1  xtraeme 				aprint_verbose(
    241  1.1  xtraeme 				    "%s: Compatibility PB (bus %d)\n",
    242  1.1  xtraeme 				    self->dv_xname, pbnum);
    243  1.1  xtraeme 				break;
    244  1.1  xtraeme 			case PCISET_TYPE_AUX:
    245  1.1  xtraeme 				aprint_verbose("%s: Auxiliary PB (bus %d)\n",
    246  1.1  xtraeme 				       self->dv_xname, pbnum);
    247  1.1  xtraeme 				/*
    248  1.1  xtraeme 				 * This host bridge has a second PCI bus.
    249  1.1  xtraeme 				 * Configure it.
    250  1.1  xtraeme 				 */
    251  1.1  xtraeme 				doattach = 1;
    252  1.1  xtraeme 				break;
    253  1.1  xtraeme 			}
    254  1.1  xtraeme 			break;
    255  1.1  xtraeme 		case PCI_PRODUCT_INTEL_CDC:
    256  1.1  xtraeme 			bcreg = pci_conf_read(pa->pa_pc, pa->pa_tag,
    257  1.1  xtraeme 					      I82424_CPU_BCTL_REG);
    258  1.1  xtraeme 			if (bcreg & I82424_BCTL_CPUPCI_POSTEN) {
    259  1.1  xtraeme 				bcreg &= ~I82424_BCTL_CPUPCI_POSTEN;
    260  1.1  xtraeme 				pci_conf_write(pa->pa_pc, pa->pa_tag,
    261  1.1  xtraeme 					       I82424_CPU_BCTL_REG, bcreg);
    262  1.1  xtraeme 				aprint_verbose(
    263  1.1  xtraeme 				    "%s: disabled CPU-PCI write posting\n",
    264  1.1  xtraeme 				    self->dv_xname);
    265  1.1  xtraeme 			}
    266  1.1  xtraeme 			break;
    267  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82451NX_PXB:
    268  1.1  xtraeme 			/*
    269  1.1  xtraeme 			 * The NX chipset supports up to 2 "PXB" chips
    270  1.1  xtraeme 			 * which can drive 2 PCI buses each. Each bus
    271  1.1  xtraeme 			 * shows up as logical PCI device, with fixed
    272  1.1  xtraeme 			 * device numbers between 18 and 21.
    273  1.1  xtraeme 			 * See the datasheet at
    274  1.1  xtraeme 		ftp://download.intel.com/design/chipsets/datashts/24377102.pdf
    275  1.1  xtraeme 			 * for details.
    276  1.1  xtraeme 			 * (It would be easier to attach all the buses
    277  1.1  xtraeme 			 * at the MIOC, but less aesthetical imho.)
    278  1.1  xtraeme 			 */
    279  1.1  xtraeme 			if ((attachflags &
    280  1.1  xtraeme 			    (PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED)) ==
    281  1.1  xtraeme 			    PCI_FLAGS_MEM_ENABLED)
    282  1.1  xtraeme 				attachflags |= PCI_FLAGS_IO_ENABLED;
    283  1.1  xtraeme 
    284  1.1  xtraeme 			pbnum = 0;
    285  1.1  xtraeme 			switch (pa->pa_device) {
    286  1.1  xtraeme 			case 18: /* PXB 0 bus A - primary bus */
    287  1.1  xtraeme 				break;
    288  1.1  xtraeme 			case 19: /* PXB 0 bus B */
    289  1.1  xtraeme 				/* read SUBA0 from MIOC */
    290  1.1  xtraeme 				tag = pci_make_tag(pa->pa_pc, 0, 16, 0);
    291  1.1  xtraeme 				bcreg = pci_conf_read(pa->pa_pc, tag, 0xd0);
    292  1.1  xtraeme 				pbnum = ((bcreg & 0x0000ff00) >> 8) + 1;
    293  1.1  xtraeme 				break;
    294  1.1  xtraeme 			case 20: /* PXB 1 bus A */
    295  1.1  xtraeme 				/* read BUSNO1 from MIOC */
    296  1.1  xtraeme 				tag = pci_make_tag(pa->pa_pc, 0, 16, 0);
    297  1.1  xtraeme 				bcreg = pci_conf_read(pa->pa_pc, tag, 0xd0);
    298  1.1  xtraeme 				pbnum = (bcreg & 0xff000000) >> 24;
    299  1.1  xtraeme 				break;
    300  1.1  xtraeme 			case 21: /* PXB 1 bus B */
    301  1.1  xtraeme 				/* read SUBA1 from MIOC */
    302  1.1  xtraeme 				tag = pci_make_tag(pa->pa_pc, 0, 16, 0);
    303  1.1  xtraeme 				bcreg = pci_conf_read(pa->pa_pc, tag, 0xd4);
    304  1.1  xtraeme 				pbnum = (bcreg & 0x000000ff) + 1;
    305  1.1  xtraeme 				break;
    306  1.1  xtraeme 			}
    307  1.1  xtraeme 			if (pbnum != 0)
    308  1.1  xtraeme 				doattach = 1;
    309  1.1  xtraeme 			break;
    310  1.1  xtraeme 
    311  1.1  xtraeme 		/*
    312  1.1  xtraeme 		 * i386 and amd64 stuff.
    313  1.1  xtraeme 		 */
    314  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82810_MCH:
    315  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82810_DC100_MCH:
    316  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82810E_MCH:
    317  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82815_FULL_HUB:
    318  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82830MP_IO_1:
    319  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82845G_DRAM:
    320  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82855GM_MCH:
    321  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82865_HB:
    322  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82915G_HB:
    323  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82915GM_HB:
    324  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82945P_MCH:
    325  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82945GM_HB:
    326  1.1  xtraeme 		case PCI_PRODUCT_INTEL_82965Q_HB:
    327  1.2  jnemeth 		case PCI_PRODUCT_INTEL_82965G_HB:
    328  1.3    joerg 		case PCI_PRODUCT_INTEL_82965PM_HB:
    329  1.4    markd 		case PCI_PRODUCT_INTEL_82Q35_HB:
    330  1.4    markd 		case PCI_PRODUCT_INTEL_82G33_HB:
    331  1.4    markd 		case PCI_PRODUCT_INTEL_82Q33_HB:
    332  1.1  xtraeme 			/*
    333  1.1  xtraeme 			 * The host bridge is either in GFX mode (internal
    334  1.1  xtraeme 			 * graphics) or in AGP mode. In GFX mode, we pretend
    335  1.1  xtraeme 			 * to have AGP because the graphics memory access
    336  1.1  xtraeme 			 * is very similar and the AGP GATT code will
    337  1.1  xtraeme 			 * deal with this. In the latter case, the
    338  1.1  xtraeme 			 * pci_get_capability(PCI_CAP_AGP) test below will
    339  1.1  xtraeme 			 * fire, so we do no harm by already setting the flag.
    340  1.1  xtraeme 			 */
    341  1.1  xtraeme 			has_agp = 1;
    342  1.1  xtraeme 			break;
    343  1.1  xtraeme 		}
    344  1.1  xtraeme 		break;
    345  1.1  xtraeme 	}
    346  1.1  xtraeme 
    347  1.1  xtraeme #if NRND > 0
    348  1.1  xtraeme 	/*
    349  1.1  xtraeme 	 * Attach a random number generator, if there is one.
    350  1.1  xtraeme 	 */
    351  1.1  xtraeme 	pchb_attach_rnd(sc, pa);
    352  1.1  xtraeme #endif
    353  1.1  xtraeme 
    354  1.1  xtraeme 	/*
    355  1.1  xtraeme 	 * If we haven't detected AGP yet (via a product ID),
    356  1.1  xtraeme 	 * then check for AGP capability on the device.
    357  1.1  xtraeme 	 */
    358  1.1  xtraeme 	if (has_agp ||
    359  1.1  xtraeme 	    pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_AGP,
    360  1.1  xtraeme 			       NULL, NULL) != 0) {
    361  1.1  xtraeme 		apa.apa_pci_args = *pa;
    362  1.1  xtraeme 		config_found_ia(self, "agpbus", &apa, agpbusprint);
    363  1.1  xtraeme 	}
    364  1.1  xtraeme 
    365  1.1  xtraeme 	if (doattach) {
    366  1.1  xtraeme 		pba.pba_iot = pa->pa_iot;
    367  1.1  xtraeme 		pba.pba_memt = pa->pa_memt;
    368  1.1  xtraeme 		pba.pba_dmat = pa->pa_dmat;
    369  1.1  xtraeme 		pba.pba_dmat64 = pa->pa_dmat64;
    370  1.1  xtraeme 		pba.pba_pc = pa->pa_pc;
    371  1.1  xtraeme 		pba.pba_flags = attachflags;
    372  1.1  xtraeme 		pba.pba_bus = pbnum;
    373  1.1  xtraeme 		pba.pba_bridgetag = NULL;
    374  1.1  xtraeme 		pba.pba_pc = pa->pa_pc;
    375  1.1  xtraeme 		pba.pba_intrswiz = 0;
    376  1.1  xtraeme 		memset(&pba.pba_intrtag, 0, sizeof(pba.pba_intrtag));
    377  1.1  xtraeme 		config_found_ia(self, "pcibus", &pba, pcibusprint);
    378  1.1  xtraeme 	}
    379  1.1  xtraeme }
    380