Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ICH patch for testing



Hi all,
if you have ichlpcib in your system, please test that it can still
reboot and powerdown with the attached patch. I am especially interested
in reports from ICH3 and ICH4 with speedstep support.

This patch is for PR 40487.

Joerg
Index: ichlpcib.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/arch/x86/pci/ichlpcib.c,v
retrieving revision 1.14
diff -u -p -r1.14 ichlpcib.c
--- ichlpcib.c  13 Oct 2008 15:10:51 -0000      1.14
+++ ichlpcib.c  27 Jan 2009 15:06:22 -0000
@@ -86,6 +86,9 @@ struct lpcib_softc {
        uint32_t                sc_hpet_reg;
 #endif
 
+       /* Speedstep */
+       pcireg_t                sc_pmcon_orig;
+
        /* Power management */
        pcireg_t                sc_pirq[2];
        pcireg_t                sc_pmcon;
@@ -96,6 +99,7 @@ static int lpcibmatch(device_t, cfdata_t
 static void lpcibattach(device_t, device_t, void *);
 static bool lpcib_suspend(device_t PMF_FN_PROTO);
 static bool lpcib_resume(device_t PMF_FN_PROTO);
+static bool lpcib_shutdown(device_t, int);
 
 static void pmtimer_configure(device_t);
 
@@ -205,6 +209,9 @@ lpcibattach(device_t parent, device_t se
                return;
        }
 
+       sc->sc_pmcon_orig = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
+           LPCIB_PCI_GEN_PMCON_1);
+
        /* For ICH6 and later, always enable RCBA */
        if (sc->sc_has_rcba) {
                pcireg_t rcba;
@@ -241,11 +248,23 @@ lpcibattach(device_t parent, device_t se
 #endif
 
        /* Install power handler */
-       if (!pmf_device_register(self, lpcib_suspend, lpcib_resume))
+       if (!pmf_device_register1(self, lpcib_suspend, lpcib_resume,
+           lpcib_shutdown))
                aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
 static bool
+lpcib_shutdown(device_t dv, int howto)
+{
+       struct lpcib_softc *sc = device_private(dv);
+
+       pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
+           LPCIB_PCI_GEN_PMCON_1, sc->sc_pmcon_orig);
+
+       return true;
+}
+
+static bool
 lpcib_suspend(device_t dv PMF_FN_ARGS)
 {
        struct lpcib_softc *sc = device_private(dv);


Home | Main Index | Thread Index | Old Index