summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-05-01 02:19:47 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-05-01 02:19:47 +0000
commit25084ada4974efc0f9508b242c29f37ea98fc5c1 (patch)
tree8002f841f8af7f5de0beb0c84d367a06468a6478 /sys/dev
parent1350f93f53d8a77c0e0f9408944d24f0cfc49b2c (diff)
restore socket base addr and bus number on resume; from netbsd
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/pccbb.c12
-rw-r--r--sys/dev/pci/pccbbvar.h5
2 files changed, 15 insertions, 2 deletions
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c
index acba630b010..40558d3263e 100644
--- a/sys/dev/pci/pccbb.c
+++ b/sys/dev/pci/pccbb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccbb.c,v 1.17 2001/02/01 03:38:08 aaron Exp $ */
+/* $OpenBSD: pccbb.c,v 1.18 2001/05/01 02:19:46 mickey Exp $ */
/* $NetBSD: pccbb.c,v 1.42 2000/06/16 23:41:35 cgd Exp $ */
/*
@@ -472,6 +472,8 @@ pccbbattach(parent, self, aux)
sc->sc_dmat = pa->pa_dmat;
sc->sc_tag = pa->pa_tag;
sc->sc_function = pa->pa_function;
+ sc->sc_sockbase = sock_base;
+ sc->sc_busnum = busreg;
sc->sc_intrline = pa->pa_intrline;
sc->sc_intrtag = pa->pa_intrtag;
@@ -3154,6 +3156,14 @@ pccbb_powerhook(why, arg)
}
if (why == PWR_RESUME) {
+ if (pci_conf_read (sc->sc_pc, sc->sc_tag, PCI_SOCKBASE) == 0)
+ /* BIOS did not recover this register */
+ pci_conf_write (sc->sc_pc, sc->sc_tag,
+ PCI_SOCKBASE, sc->sc_sockbase);
+ if (pci_conf_read (sc->sc_pc, sc->sc_tag, PCI_BUSNUM) == 0)
+ /* BIOS did not recover this register */
+ pci_conf_write (sc->sc_pc, sc->sc_tag,
+ PCI_BUSNUM, sc->sc_busnum);
/* CSC Interrupt: Card detect interrupt on */
reg = bus_space_read_4(base_memt, base_memh, CB_SOCKET_MASK);
/* Card detect intr is turned on. */
diff --git a/sys/dev/pci/pccbbvar.h b/sys/dev/pci/pccbbvar.h
index 243be204c27..c54804b189e 100644
--- a/sys/dev/pci/pccbbvar.h
+++ b/sys/dev/pci/pccbbvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccbbvar.h,v 1.4 2001/01/27 04:44:20 mickey Exp $ */
+/* $OpenBSD: pccbbvar.h,v 1.5 2001/05/01 02:19:46 mickey Exp $ */
/* $NetBSD: pccbbvar.h,v 1.13 2000/06/08 10:28:29 haya Exp $ */
/*
* Copyright (c) 1999 HAYAKAWA Koichi. All rights reserved.
@@ -142,6 +142,9 @@ struct pccbb_softc {
bus_addr_t sc_io_start; /* CardBus/PCMCIA io start */
bus_addr_t sc_io_end; /* CardBus/PCMCIA io end */
+ pcireg_t sc_sockbase; /* Socket base register */
+ pcireg_t sc_busnum; /* bus number */
+
/* CardBus stuff */
struct cardslot_softc *sc_csc;