Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Patch the CLKRUN enable bit on ToPIC chips.



details:   https://anonhg.NetBSD.org/src/rev/829eb27c675a
branches:  trunk
changeset: 532098:829eb27c675a
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Fri May 31 13:34:03 2002 +0000

description:
Patch the CLKRUN enable bit on ToPIC chips.

diffstat:

 sys/dev/pci/pccbb.c |  16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r 1b224d5a5dc6 -r 829eb27c675a sys/dev/pci/pccbb.c
--- a/sys/dev/pci/pccbb.c       Fri May 31 13:30:36 2002 +0000
+++ b/sys/dev/pci/pccbb.c       Fri May 31 13:34:03 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pccbb.c,v 1.76 2002/05/31 09:54:52 haya Exp $  */
+/*     $NetBSD: pccbb.c,v 1.77 2002/05/31 13:34:03 mycroft Exp $       */
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.76 2002/05/31 09:54:52 haya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.77 2002/05/31 13:34:03 mycroft Exp $");
 
 /*
 #define CBB_DEBUG
@@ -1245,7 +1245,7 @@
 {
        struct pccbb_softc *sc = (struct pccbb_softc *)ct;
 
-       u_int32_t status, sock_ctrl;
+       u_int32_t status, sock_ctrl, reg_ctrl;
        bus_space_tag_t memt = sc->sc_base_memt;
        bus_space_handle_t memh = sc->sc_base_memh;
 
@@ -1357,6 +1357,16 @@
                return 0;
        }
 
+       if (sc->sc_chipset == CB_TOPIC97) {
+               reg_ctrl = pci_conf_read(sc->sc_pc, sc->sc_tag, TOPIC_REG_CTRL);
+               reg_ctrl &= ~TOPIC97_REG_CTRL_TESTMODE;
+               if ((command & CARDBUS_VCCMASK) == CARDBUS_VCC_0V)
+                       reg_ctrl &= ~TOPIC97_REG_CTRL_CLKRUN_ENA;
+               else
+                       reg_ctrl |= TOPIC97_REG_CTRL_CLKRUN_ENA;
+               pci_conf_write(sc->sc_pc, sc->sc_tag, TOPIC_REG_CTRL, reg_ctrl);
+       }
+
        /*
         * XXX delay 300 ms: though the standard defines that the Vcc set-up
         * time is 20 ms, some PC-Card bridge requires longer duration.



Home | Main Index | Thread Index | Old Index