summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>1999-12-07 07:11:49 +0000
committerthorpej <thorpej@NetBSD.org>1999-12-07 07:11:49 +0000
commit3d60aecdd76460aec7da49139f0752d6dd67a25e (patch)
treecd4db249b90cfd6a9bb797e81ef478cb5993c447
parentac20942bc531a0f59196f83ccb41ead978970a02 (diff)
Make sure to bring the chip out of sleep mode. From Masanori Kanaoka.
-rw-r--r--sys/dev/cardbus/if_tlp_cardbus.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/dev/cardbus/if_tlp_cardbus.c b/sys/dev/cardbus/if_tlp_cardbus.c
index d0c851a1a69..19ccdb052fb 100644
--- a/sys/dev/cardbus/if_tlp_cardbus.c
+++ b/sys/dev/cardbus/if_tlp_cardbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tlp_cardbus.c,v 1.1 1999/11/19 18:23:35 thorpej Exp $ */
+/* $NetBSD: if_tlp_cardbus.c,v 1.2 1999/12/07 07:11:49 thorpej Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -227,6 +227,26 @@ tlp_cardbus_attach(parent, self, aux)
(sc->sc_rev >> 4) & 0xf, sc->sc_rev & 0xf);
/*
+ * Check to see if the device is in power-save mode, and
+ * bring it out if necessary.
+ */
+ switch (sc->sc_chip) {
+ case TULIP_CHIP_21142:
+ case TULIP_CHIP_21143:
+ /*
+ * Clear the "sleep mode" bit in the CFDA register.
+ */
+ reg = cardbus_conf_read(cc, cf, ca->ca_tag, TULIP_PCI_CFDA);
+ if (reg & CFDA_SLEEP)
+ cardbus_conf_write(cc, cf, ca->ca_tag, TULIP_PCI_CFDA,
+ reg & ~CFDA_SLEEP);
+ break;
+
+ default:
+ /* Nothing. */
+ }
+
+ /*
* Map the device.
*/
csc->sc_csr = PCI_COMMAND_MASTER_ENABLE;