Now that we have amdnb_misc for attaching amdtemp, revert pchb.c revisions trunk
authorpgoyette <pgoyette@NetBSD.org>
Mon, 16 Apr 2012 04:57:42 +0000
branchtrunk
changeset 210665 946433fe4e0d
parent 210664 d565b13ce880
child 210666 92ce661990d3
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.
sys/arch/x86/pci/pchb.c
sys/arch/x86/pci/pchbvar.h
--- a/sys/arch/x86/pci/pchb.c	Sun Apr 15 21:20:16 2012 +0000
+++ b/sys/arch/x86/pci/pchb.c	Mon Apr 16 04:57:42 2012 +0000
@@ -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 @@
 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 @@
 	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 @@
 		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 @@
 	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 @@
 	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 @@
 	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);
-}
--- a/sys/arch/x86/pci/pchbvar.h	Sun Apr 15 21:20:16 2012 +0000
+++ b/sys/arch/x86/pci/pchbvar.h	Mon Apr 16 04:57:42 2012 +0000
@@ -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];
 };