p64h2apic.c revision 1.3
11.2Sfvdl/*
21.2Sfvdl * Driver for P64H2 IOxAPIC
31.2Sfvdl *
41.2Sfvdl * This is an ioapic which appears in PCI space.
51.2Sfvdl * This driver currently does nothing useful but will eventually
61.2Sfvdl * thwak the ioapic into working correctly.
71.2Sfvdl */
81.2Sfvdl
91.2Sfvdl#include <sys/param.h>
101.2Sfvdl#include <sys/systm.h>
111.2Sfvdl#include <sys/kernel.h>
121.2Sfvdl#include <sys/device.h>
131.2Sfvdl
141.2Sfvdl#include <dev/pci/pcireg.h>
151.2Sfvdl#include <dev/pci/pcivar.h>
161.2Sfvdl#include <dev/pci/pcidevs.h>
171.2Sfvdl
181.2Sfvdlstatic int	p64h2match __P((struct device *, struct cfdata *, void *));
191.2Sfvdlstatic void	p64h2attach __P((struct device *, struct device *, void *));
201.2Sfvdl
211.2Sfvdlstruct p64h2apic_softc
221.2Sfvdl{
231.2Sfvdl	pcitag_t sc_tag;
241.2Sfvdl};
251.2Sfvdl
261.3SthorpejCFATTACH_DECL(p64h2apic, sizeof(struct p64h2apic_softc),
271.3Sthorpej    p64h2match, p64h2attach, NULL, NULL);
281.2Sfvdl
291.2Sfvdlint	p64h2print __P((void *, const char *pnp));
301.2Sfvdl
311.2Sfvdl
321.2Sfvdlstatic int
331.2Sfvdlp64h2match(parent, match, aux)
341.2Sfvdl	struct device *parent;
351.2Sfvdl	struct cfdata *match;
361.2Sfvdl	void *aux;
371.2Sfvdl{
381.2Sfvdl	struct pci_attach_args *pa = aux;
391.2Sfvdl
401.2Sfvdl	if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_INTEL &&
411.2Sfvdl	    PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_82870P2_IOxAPIC)
421.2Sfvdl		return (1);
431.2Sfvdl
441.2Sfvdl	return (0);
451.2Sfvdl}
461.2Sfvdl
471.2Sfvdlstatic void
481.2Sfvdlp64h2attach(parent, self, aux)
491.2Sfvdl	struct device *parent, *self;
501.2Sfvdl	void *aux;
511.2Sfvdl{
521.2Sfvdl	struct p64h2apic_softc *sc = (void *) self;
531.2Sfvdl	struct pci_attach_args *pa = aux;
541.2Sfvdl	char devinfo[256];
551.2Sfvdl
561.2Sfvdl	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo);
571.2Sfvdl	printf(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class));
581.2Sfvdl
591.2Sfvdl	sc->sc_tag = pa->pa_tag;
601.2Sfvdl}
61