summaryrefslogtreecommitdiff
path: root/sys/dev/pci/pccbb.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-06-25 21:53:46 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-06-25 21:53:46 +0000
commitfff2546a7d7ebdf0345911dab6b38cb25328157f (patch)
tree22076f7b295c87d2939fe6b2ffeb452dae7df794 /sys/dev/pci/pccbb.c
parent32374a66958e8b58792173b4382711c86d8c1c5e (diff)
add topic97b support; from netbsd and tested by Pedro la Peu <pedro@am-gen.org>
Diffstat (limited to 'sys/dev/pci/pccbb.c')
-rw-r--r--sys/dev/pci/pccbb.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c
index f3ecb3afc55..9bbb07f4462 100644
--- a/sys/dev/pci/pccbb.c
+++ b/sys/dev/pci/pccbb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccbb.c,v 1.31 2002/07/23 17:53:25 drahn Exp $ */
+/* $OpenBSD: pccbb.c,v 1.32 2003/06/25 21:53:45 mickey Exp $ */
/* $NetBSD: pccbb.c,v 1.42 2000/06/16 23:41:35 cgd Exp $ */
/*
@@ -769,6 +769,30 @@ pccbb_chipinit(sc)
DPRINTF(("0x%x\n", reg));
pci_conf_write(pc, tag, TOPIC_SLOT_CTRL, reg);
break;
+
+ case CB_TOPIC97:
+ reg = pci_conf_read(pc, tag, TOPIC_SLOT_CTRL);
+ DPRINTF(("%s: topic slot ctrl reg 0x%x -> ",
+ sc->sc_dev.dv_xname, reg));
+ reg |= (TOPIC_SLOT_CTRL_SLOTON | TOPIC_SLOT_CTRL_SLOTEN |
+ TOPIC_SLOT_CTRL_ID_LOCK | TOPIC_SLOT_CTRL_CARDBUS);
+ reg &= ~TOPIC_SLOT_CTRL_SWDETECT;
+ reg |= TOPIC97_SLOT_CTRL_PCIINT;
+ reg &= ~(TOPIC97_SLOT_CTRL_STSIRQP | TOPIC97_SLOT_CTRL_IRQP);
+ DPRINTF(("0x%x\n", reg));
+ pci_conf_write(pc, tag, TOPIC_SLOT_CTRL, reg);
+
+ /* make sure to assert LV card support bits */
+ bus_space_write_1(sc->sc_base_memt, sc->sc_base_memh,
+ 0x800 + 0x3e, bus_space_read_1(sc->sc_base_memt,
+ sc->sc_base_memh, 0x800 + 0x3e) | 0x03);
+
+ /* Power on the controller if the BIOS didn't */
+ reg = pci_conf_read(pc, tag, TOPIC100_PMCSR);
+ if ((reg & TOPIC100_PMCSR_MASK) != TOPIC100_PMCSR_D0)
+ pci_conf_write(pc, tag, TOPIC100_PMCSR,
+ (reg & ~TOPIC100_PMCSR_MASK) | TOPIC100_PMCSR_D0);
+ break;
}
/* Close all memory and I/O windows. */