From 7e217319c375b5398bce531dd0ef6106c2386233 Mon Sep 17 00:00:00 2001 From: niklas Date: Sat, 1 Mar 1997 22:42:57 +0000 Subject: [PATCH] Corrected ISA memory mapping errors that caused PCMCIA to be broken. Thanks to Angelos who helped my debug this. --- sys/dev/isa/pcmcia_isa.c | 8 ++------ sys/dev/isa/pcmcia_pcic.c | 12 +++++++----- sys/dev/pcmcia/pcmciavar.h | 3 ++- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/sys/dev/isa/pcmcia_isa.c b/sys/dev/isa/pcmcia_isa.c index 746cd52bcf2..6c6592d910e 100644 --- a/sys/dev/isa/pcmcia_isa.c +++ b/sys/dev/isa/pcmcia_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmcia_isa.c,v 1.9 1996/11/29 22:55:05 niklas Exp $ */ +/* $OpenBSD: pcmcia_isa.c,v 1.10 1997/03/01 22:42:57 niklas Exp $ */ /* * Copyright (c) 1995,1996 John T. Kohl. All rights reserved. * Copyright (c) 1994 Stefan Grefen. All rights reserved. @@ -86,18 +86,14 @@ pcmcia_isa_init(parent, cf, aux, pca, flag) int flag; { struct pcmciabus_attach_args *pa = aux; - bus_space_handle_t memh; #ifdef PCMCIA_ISA_DEBUG if (parent != NULL) printf("PARENT %s\n", parent->dv_xname); #endif if (flag == 0) { /* match */ - if (bus_space_map(pa->pba_memt, pa->pba_maddr, pa->pba_msize, - 0, &memh)) - return 0; pca->scratch_memsiz = pa->pba_msize; - pca->scratch_memh = memh; + pca->scratch_memh = pa->pba_memh; pca->pa_memt = pa->pba_memt; #ifdef PCMCIA_ISA_DEBUG printf("pbaaddr %p maddr %x msize %x\n", diff --git a/sys/dev/isa/pcmcia_pcic.c b/sys/dev/isa/pcmcia_pcic.c index 48fedcf166a..ae2361468b7 100644 --- a/sys/dev/isa/pcmcia_pcic.c +++ b/sys/dev/isa/pcmcia_pcic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmcia_pcic.c,v 1.13 1997/01/26 11:00:07 niklas Exp $ */ +/* $OpenBSD: pcmcia_pcic.c,v 1.14 1997/03/01 22:42:58 niklas Exp $ */ /* * Copyright (c) 1995, 1996 John T. Kohl @@ -246,7 +246,7 @@ pcic_probe(parent, self, aux) void *aux; { struct pcic_softc *pcic = self; - struct pcicmaster_softc *pcicm = (struct pcicmaster_softc *) parent; + struct pcicmaster_softc *pcicm = (struct pcicmaster_softc *)parent; struct pcic_attach_args *pia = aux; u_int chip_inf = 0, ochip_inf = 0; int first = 1; @@ -279,7 +279,7 @@ pcic_probe(parent, self, aux) */ pcic->sc_ioh = pia->pia_ioh; pcic->sc_iot = pia->pia_iot; - pcic->sc_iot = pia->pia_memt; + pcic->sc_memt = pia->pia_memt; pcic->sc_adapter.nslots = 0; maxslot = 2; for (i = j = 0; i < maxslot; i++) { @@ -335,8 +335,9 @@ ok: } } if (pcic->sc_adapter.nslots != 0) { - if (bus_space_map(pia->pia_memt, pia->pia_maddr, - pia->pia_msize, 0, &pcic->sc_memh)) + if (bus_space_map(pia->pia_memt, + pcic->sc_dev.dv_cfdata->cf_loc[1], + pcic->sc_dev.dv_cfdata->cf_loc[2], 0, &pcic->sc_memh)) return 0; return 1; } @@ -438,6 +439,7 @@ pcic_attach(parent, self, aux) */ pba.pba_iot = pia->pia_iot; pba.pba_memt = pia->pia_memt; + pba.pba_memh = pcic->sc_memh; pba.pba_maddr = pia->pia_maddr; pba.pba_msize = pia->pia_msize; pba.pba_aux = &pcic->sc_adapter; diff --git a/sys/dev/pcmcia/pcmciavar.h b/sys/dev/pcmcia/pcmciavar.h index 28c2a4375ce..6260b30d41d 100644 --- a/sys/dev/pcmcia/pcmciavar.h +++ b/sys/dev/pcmcia/pcmciavar.h @@ -1,4 +1,4 @@ -/* $Id: pcmciavar.h,v 1.3 1996/11/28 23:28:17 niklas Exp $ */ +/* $Id: pcmciavar.h,v 1.4 1997/03/01 22:42:59 niklas Exp $ */ /* * Copyright (c) 1995,1996 John T. Kohl. All rights reserved. * Copyright (c) 1993, 1994 Stefan Grefen. All rights reserved. @@ -292,6 +292,7 @@ struct pcmcia_attach_args { struct pcmciabus_attach_args { bus_space_tag_t pba_iot; bus_space_tag_t pba_memt; + bus_space_tag_t pba_memh; int pba_maddr; int pba_msize; void *pba_aux; /* driver specific */ -- 2.20.1