Source-Changes-HG archive

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

[src/trunk]: src/sys/dev 1. Do not apply 5 V on a CardBus card.



details:   https://anonhg.NetBSD.org/src/rev/1baa7b523b54
branches:  trunk
changeset: 483978:1baa7b523b54
user:      haya <haya%NetBSD.org@localhost>
date:      Wed Mar 22 09:35:06 2000 +0000

description:
1. Do not apply 5 V on a CardBus card.
2. Do not avoid ISA hole when a device requires more than
   256-byte io space.
3. Remove sending CardBus bridge's function number to
   cardbus stack.  This number is not needed for anyone.

diffstat:

 sys/dev/cardbus/cardbus.c    |  24 ++++++------------------
 sys/dev/cardbus/cardbusvar.h |   3 +--
 sys/dev/cardbus/cardslot.c   |  17 ++++++++---------
 sys/dev/pci/pccbb.c          |  15 +++++++--------
 sys/dev/pci/pccbbvar.h       |   3 ++-
 5 files changed, 24 insertions(+), 38 deletions(-)

diffs (157 lines):

diff -r 2bd0b7c4da2a -r 1baa7b523b54 sys/dev/cardbus/cardbus.c
--- a/sys/dev/cardbus/cardbus.c Wed Mar 22 08:20:18 2000 +0000
+++ b/sys/dev/cardbus/cardbus.c Wed Mar 22 09:35:06 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cardbus.c,v 1.22 2000/03/07 09:36:52 haya Exp $        */
+/*     $NetBSD: cardbus.c,v 1.23 2000/03/22 09:35:06 haya Exp $        */
 
 /*
  * Copyright (c) 1997, 1998, 1999 and 2000
@@ -126,20 +126,6 @@
     return 0;
   }
 
-#if 0
-  /* which function? */
-  if (cf->cbslotcf_func != CBSLOT_UNK_FUNC &&
-      cf->cbslotcf_func != cba->cba_function) {
-    DPRINTF(("cardbusmatch: function differs %d <=> %d\n",
-            cf->cbslotcf_func, cba->cba_function));
-    return 0;
-  }
-#endif
-
-  if (cba->cba_function < 0 || cba->cba_function > 255) {
-    return 0;
-  }
-
   return 1;
 }
 
@@ -723,10 +709,12 @@
 
     if (sc->sc_poweron_func == 0) {
        /* switch to 3V and/or wait for power to stabilize */
-       if (cdstatus & CARDBUS_3V_CARD)
+       if (cdstatus & CARDBUS_3V_CARD) {
            sc->sc_cf->cardbus_power(sc->sc_cc, CARDBUS_VCC_3V);
-       else
-           sc->sc_cf->cardbus_power(sc->sc_cc, CARDBUS_VCC_5V);
+       } else {
+           /* No cards other than 3.3V cards. */
+           return;
+       }
        (sc->sc_cf->cardbus_ctrl)(sc->sc_cc, CARDBUS_RESET);
     }
     sc->sc_poweron_func |= (1 << function);
diff -r 2bd0b7c4da2a -r 1baa7b523b54 sys/dev/cardbus/cardbusvar.h
--- a/sys/dev/cardbus/cardbusvar.h      Wed Mar 22 08:20:18 2000 +0000
+++ b/sys/dev/cardbus/cardbusvar.h      Wed Mar 22 09:35:06 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cardbusvar.h,v 1.15 2000/02/04 07:59:20 haya Exp $     */
+/*     $NetBSD: cardbusvar.h,v 1.16 2000/03/22 09:35:06 haya Exp $     */
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -228,7 +228,6 @@
   bus_dma_tag_t cba_dmat;      /* DMA tag */
 
   int cba_bus;                 /* cardbus bus number */
-  int cba_function;            /* slot number on this Host Bus Adaptor */
 
   cardbus_chipset_tag_t cba_cc;        /* cardbus chipset */
   cardbus_function_tag_t cba_cf; /* cardbus functions */
diff -r 2bd0b7c4da2a -r 1baa7b523b54 sys/dev/cardbus/cardslot.c
--- a/sys/dev/cardbus/cardslot.c        Wed Mar 22 08:20:18 2000 +0000
+++ b/sys/dev/cardbus/cardslot.c        Wed Mar 22 09:35:06 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cardslot.c,v 1.8 2000/01/31 08:49:07 haya Exp $        */
+/*     $NetBSD: cardslot.c,v 1.9 2000/03/22 09:35:06 haya Exp $        */
 
 /*
  * Copyright (c) 1999 and 2000
@@ -205,17 +205,16 @@
 
 STATIC int
 cardslot_cb_print(aux, pnp)
-     void *aux;
-     const char *pnp;
+       void *aux;
+       const char *pnp;
 {
-  struct cbslot_attach_args *cba = aux;
+       struct cbslot_attach_args *cba = aux;
 
-  if (pnp) {
-    printf("cardbus at %s", pnp);
-    printf(" function %d subordinate bus %d", cba->cba_function, cba->cba_bus);
-  }
+       if (pnp) {
+               printf("cardbus at %s subordinate bus %d", pnp, cba->cba_bus);
+       }
 
-  return UNCONF;
+       return UNCONF;
 }
 
 
diff -r 2bd0b7c4da2a -r 1baa7b523b54 sys/dev/pci/pccbb.c
--- a/sys/dev/pci/pccbb.c       Wed Mar 22 08:20:18 2000 +0000
+++ b/sys/dev/pci/pccbb.c       Wed Mar 22 09:35:06 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pccbb.c,v 1.35 2000/03/14 10:26:10 enami Exp $ */
+/*     $NetBSD: pccbb.c,v 1.36 2000/03/22 09:35:07 haya Exp $  */
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -627,7 +627,6 @@
                cba.cba_iot = sc->sc_iot;
                cba.cba_memt = sc->sc_memt;
                cba.cba_dmat = sc->sc_dmat;
-               cba.cba_function = 0;
                cba.cba_bus = (busreg >> 8) & 0x0ff;
                cba.cba_cc = (void *)sc;
                cba.cba_cf = &pccbb_funcs;
@@ -2775,6 +2774,12 @@
                if (align < 4) {
                        return 1;
                }
+               /* XXX: hack for avoiding ISA image */
+               if (mask < 0x0100) {
+                       mask = 0x3ff;
+                       addr = 0x300;
+               }
+
        } else {
                DPRINTF(
                    ("pccbb_rbus_cb_space_alloc: Bus space tag %x is NOT used.\n",
@@ -2783,12 +2788,6 @@
                /* XXX: panic here? */
        }
 
-       /* XXX: hack for avoiding ISA image */
-       if (mask < 0x3ff) {
-               mask = 0x3ff;
-               addr = 0x300;
-       }
-
        if (rbus_space_alloc(rb, addr, size, mask, align, flags, addrp, bshp)) {
                printf("%s: <rbus> no bus space\n", sc->sc_dev.dv_xname);
                return 1;
diff -r 2bd0b7c4da2a -r 1baa7b523b54 sys/dev/pci/pccbbvar.h
--- a/sys/dev/pci/pccbbvar.h    Wed Mar 22 08:20:18 2000 +0000
+++ b/sys/dev/pci/pccbbvar.h    Wed Mar 22 09:35:06 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pccbbvar.h,v 1.10 2000/03/15 00:38:40 haya Exp $       */
+/*     $NetBSD: pccbbvar.h,v 1.11 2000/03/22 09:35:08 haya Exp $       */
 /*
  * Copyright (c) 1999 HAYAKAWA Koichi.  All rights reserved.
  *
@@ -155,6 +155,7 @@
 
        /* interrupt handler list on the bridge */
        struct pccbb_intrhand_list *sc_pil;
+       int sc_pil_intr_enable; /* can i call intr handler for child device? */
 };
 
 /*



Home | Main Index | Thread Index | Old Index