summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2006-03-13 18:17:41 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2006-03-13 18:17:41 +0000
commitae3b292153b1def841f9d662e5aa039ae42aa3c3 (patch)
tree9684e40ccea8ed22a0a6035ddd22f8da645e8887
parent38467fcd3027e30e22574f41514a798f2afecee4 (diff)
Set the address decode bit only if the iobase 0 register is available.
Fixes the wd part of the sandisk wifi + 128 CF. Only multi function cards are affected at this time. quasi ok from uwe@
-rw-r--r--sys/dev/pcmcia/pcmcia.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c
index 38f9924723e..a3fb3085fe0 100644
--- a/sys/dev/pcmcia/pcmcia.c
+++ b/sys/dev/pcmcia/pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmcia.c,v 1.35 2005/08/05 18:21:04 fgsch Exp $ */
+/* $OpenBSD: pcmcia.c,v 1.36 2006/03/13 18:17:40 fgsch Exp $ */
/* $NetBSD: pcmcia.c,v 1.9 1998/08/13 02:10:55 eeh Exp $ */
/*
@@ -368,7 +368,7 @@ pcmcia_print(arg, pnp)
return (UNCONF);
}
-int
+int
pcmcia_card_gettype(dev)
struct device *dev;
{
@@ -492,13 +492,14 @@ pcmcia_function_enable(pf)
reg = (pf->cfe->number & PCMCIA_CCR_OPTION_CFINDEX);
reg |= PCMCIA_CCR_OPTION_LEVIREQ;
if (pcmcia_mfc(pf->sc)) {
- reg |= (PCMCIA_CCR_OPTION_FUNC_ENABLE |
- PCMCIA_CCR_OPTION_ADDR_DECODE);
+ reg |= PCMCIA_CCR_OPTION_FUNC_ENABLE;
+ if (pf->ccr_mask & (1 << (PCMCIA_CCR_IOBASE0 / 2)))
+ reg |= PCMCIA_CCR_OPTION_ADDR_DECODE;
if (pf->ih_fct)
reg |= PCMCIA_CCR_OPTION_IREQ_ENABLE;
}
-
+
pcmcia_ccr_write(pf, PCMCIA_CCR_OPTION, reg);
reg = 0;
@@ -510,13 +511,13 @@ pcmcia_function_enable(pf)
pcmcia_ccr_write(pf, PCMCIA_CCR_STATUS, reg);
pcmcia_ccr_write(pf, PCMCIA_CCR_SOCKETCOPY, 0);
-
+
if (pcmcia_mfc(pf->sc)) {
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE0,
(pf->pf_mfc_iobase >> 0) & 0xff);
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE1,
(pf->pf_mfc_iobase >> 8) & 0xff);
- pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE2,
+ pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE2,
(pf->pf_mfc_iobase >> 16) & 0xff);
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE3,
(pf->pf_mfc_iobase >> 24) & 0xff);
@@ -536,7 +537,7 @@ pcmcia_function_enable(pf)
pcmcia_ccr_read(tmp, 0x06),
pcmcia_ccr_read(tmp, 0x0A),
- pcmcia_ccr_read(tmp, 0x0C),
+ pcmcia_ccr_read(tmp, 0x0C),
pcmcia_ccr_read(tmp, 0x0E),
pcmcia_ccr_read(tmp, 0x10),
@@ -637,7 +638,8 @@ pcmcia_io_map(pf, width, offset, size, pcihp, windowp)
* don't overlap, and that the ccr's are set correctly.
*/
- if (pcmcia_mfc(pf->sc)) {
+ if (pcmcia_mfc(pf->sc) &&
+ (pf->ccr_mask & (1 << (PCMCIA_CCR_IOBASE0 / 2)))) {
bus_addr_t iobase = pcihp->addr;
bus_addr_t iomax = pcihp->addr + pcihp->size - 1;
@@ -867,7 +869,7 @@ pcmcia_intr_string(pf, ih)
return pcmcia_chip_intr_string(pf->sc->pct, pf->sc->pch, ih);
}
-int
+int
pcmcia_card_intr(arg)
void *arg;
{