diff options
author | Paul Irofti <pirofti@cvs.openbsd.org> | 2014-07-19 18:01:24 +0000 |
---|---|---|
committer | Paul Irofti <pirofti@cvs.openbsd.org> | 2014-07-19 18:01:24 +0000 |
commit | dfd89a6bf353f9a80a0d0e339ddd0d75a107d2b0 (patch) | |
tree | 1a1f9888eca39815a67fa5ea3e91e7aaa76e70a8 | |
parent | 0c6653d396c789c945a505c7ac4ff75c65073d87 (diff) |
Bring back pci_dopm, but disable it before powerdown.
This fixes both the Lemote reboot issue and the USB issue on the
Gdium's that miod@ spotted.
Suggested by kettenis@, thanks!
Okay miod@
-rw-r--r-- | sys/arch/loongson/dev/apm.c | 7 | ||||
-rw-r--r-- | sys/arch/loongson/loongson/machdep.c | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/sys/arch/loongson/dev/apm.c b/sys/arch/loongson/dev/apm.c index 4534e871215..4693d4cf18d 100644 --- a/sys/arch/loongson/dev/apm.c +++ b/sys/arch/loongson/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.22 2014/07/19 12:54:09 pirofti Exp $ */ +/* $OpenBSD: apm.c,v 1.23 2014/07/19 18:01:23 pirofti Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -51,6 +51,8 @@ #include <machine/cpu.h> #include <machine/apmvar.h> +#include <dev/pci/pcivar.h> /* pci_dopm */ + #include <dev/wscons/wsdisplayvar.h> #include <loongson/dev/kb3310var.h> @@ -132,6 +134,9 @@ apmmatch(struct device *parent, void *match, void *aux) void apmattach(struct device *parent, struct device *self, void *aux) { + /* Enable PCI Power Management. */ + pci_dopm = 1; + printf("\n"); } diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c index 29c41a1b40d..60f2a66f214 100644 --- a/sys/arch/loongson/loongson/machdep.c +++ b/sys/arch/loongson/loongson/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.56 2014/07/13 22:53:39 uebayasi Exp $ */ +/* $OpenBSD: machdep.c,v 1.57 2014/07/19 18:01:23 pirofti Exp $ */ /* * Copyright (c) 2009, 2010, 2014 Miodrag Vallat. @@ -936,8 +936,10 @@ boot(int howto) haltsys: doshutdownhooks(); mainbus = device_mainbus(); - if (mainbus != NULL) + if (mainbus != NULL) { + pci_dopm = 0; config_suspend(mainbus, DVACT_POWERDOWN); + } if (howto & RB_HALT) { if (howto & RB_POWERDOWN) { |