Module Name: src
Committed By: pgoyette
Date: Mon Apr 16 04:57:42 UTC 2012
Modified Files:
src/sys/arch/x86/pci: pchb.c pchbvar.h
Log Message:
Now that we have amdnb_misc for attaching amdtemp, revert pchb.c revisions
1.27 and 1.32. This will unbreak the build.
XXX The amdtemp device currently does not seem to provide correct sensor
values.
XXX The amdnb_misc device does not currently have a rescan capability, so
the amdtemp module will not instantiate any devices (PR kern/45268
reappears).
XXX The agp attachment at the same pci device and function (which was
the motivation for attaching amdtemp at pchb) probably ought to also
be moved to attach at amdnb_miscbus.
To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/x86/pci/pchb.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/pci/pchbvar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/pci/pchb.c
diff -u src/sys/arch/x86/pci/pchb.c:1.33 src/sys/arch/x86/pci/pchb.c:1.34
--- src/sys/arch/x86/pci/pchb.c:1.33 Mon Jan 30 19:41:18 2012
+++ src/sys/arch/x86/pci/pchb.c Mon Apr 16 04:57:42 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pchb.c,v 1.33 2012/01/30 19:41:18 drochner Exp $ */
+/* $NetBSD: pchb.c,v 1.34 2012/04/16 04:57:42 pgoyette Exp $ */
/*-
* Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.33 2012/01/30 19:41:18 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.34 2012/04/16 04:57:42 pgoyette Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -72,16 +72,12 @@ __KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.3
static int pchbmatch(device_t, cfdata_t, void *);
static void pchbattach(device_t, device_t, void *);
static int pchbdetach(device_t, int);
-static int pchbrescan(device_t, const char *, const int *);
-static void pchbchilddet(device_t, device_t);
static bool pchb_resume(device_t, const pmf_qual_t *);
static bool pchb_suspend(device_t, const pmf_qual_t *);
-static void pchb_amdtempbus_configure(struct pchb_softc *);
-
CFATTACH_DECL3_NEW(pchb, sizeof(struct pchb_softc),
- pchbmatch, pchbattach, pchbdetach, NULL, pchbrescan, pchbchilddet, DVF_DETACH_SHUTDOWN);
+ pchbmatch, pchbattach, pchbdetach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN);
static int
pchbmatch(device_t parent, cfdata_t match, void *aux)
@@ -167,7 +163,8 @@ pchbattach(device_t parent, device_t sel
attachflags = pa->pa_flags;
sc->sc_dev = self;
- sc->sc_pa = *pa;
+ sc->sc_pc = pa->pa_pc;
+ sc->sc_tag = pa->pa_tag;
/*
* Print out a description, and configure certain chipsets which
@@ -437,8 +434,6 @@ pchbattach(device_t parent, device_t sel
memset(&pba.pba_intrtag, 0, sizeof(pba.pba_intrtag));
config_found_ia(self, "pcibus", &pba, pcibusprint);
}
-
- pchb_amdtempbus_configure(sc);
}
static int
@@ -454,28 +449,6 @@ pchbdetach(device_t self, int flags)
return 0;
}
-static int
-pchbrescan(device_t self, const char *ifattr, const int *locators)
-{
- struct pchb_softc *sc = device_private(self);
-
- if (ifattr_match(ifattr, "amdtempbus"))
- pchb_amdtempbus_configure(sc);
-
- return 0;
-}
-
-static void
-pchbchilddet(device_t self, device_t child)
-{
- struct pchb_softc *sc = device_private(self);
-
- if (sc->sc_amdtempbus == child) {
- sc->sc_amdtempbus = NULL;
- return;
- }
-}
-
static bool
pchb_suspend(device_t dv, const pmf_qual_t *qual)
{
@@ -484,8 +457,8 @@ pchb_suspend(device_t dv, const pmf_qual
pcitag_t tag;
int off;
- pc = sc->sc_pa.pa_pc;
- tag = sc->sc_pa.pa_tag;
+ pc = sc->sc_pc;
+ tag = sc->sc_tag;
for (off = 0x40; off <= 0xff; off += 4)
sc->sc_pciconfext[(off - 0x40) / 4] = pci_conf_read(pc, tag, off);
@@ -501,20 +474,11 @@ pchb_resume(device_t dv, const pmf_qual_
pcitag_t tag;
int off;
- pc = sc->sc_pa.pa_pc;
- tag = sc->sc_pa.pa_tag;
+ pc = sc->sc_pc;
+ tag = sc->sc_tag;
for (off = 0x40; off <= 0xff; off += 4)
pci_conf_write(pc, tag, off, sc->sc_pciconfext[(off - 0x40) / 4]);
return true;
}
-
-static void
-pchb_amdtempbus_configure(struct pchb_softc *sc)
-{
- if (sc->sc_amdtempbus != NULL)
- return;
-
- sc->sc_amdtempbus = config_found_ia(sc->sc_dev, "amdtempbus", &sc->sc_pa, NULL);
-}
Index: src/sys/arch/x86/pci/pchbvar.h
diff -u src/sys/arch/x86/pci/pchbvar.h:1.8 src/sys/arch/x86/pci/pchbvar.h:1.9
--- src/sys/arch/x86/pci/pchbvar.h:1.8 Sat Aug 20 20:01:08 2011
+++ src/sys/arch/x86/pci/pchbvar.h Mon Apr 16 04:57:42 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pchbvar.h,v 1.8 2011/08/20 20:01:08 jakllsch Exp $ */
+/* $NetBSD: pchbvar.h,v 1.9 2012/04/16 04:57:42 pgoyette Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -34,9 +34,9 @@
struct pchb_softc {
device_t sc_dev;
- device_t sc_amdtempbus;
- struct pci_attach_args sc_pa;
+ pci_chipset_tag_t sc_pc;
+ pcitag_t sc_tag;
pcireg_t sc_pciconfext[48];
};