From 6fb58044fdc7936b5bfa059b8bcfceb1cc986954 Mon Sep 17 00:00:00 2001 From: thorpej Date: Sun, 5 May 1996 01:14:07 +0000 Subject: [PATCH] Map port 0x84 (which is used to generate a 2.6us delay) in isaattach(). Since this port is needed by at least a few drivers, export its i/o handle via isa_attach_args. --- sys/dev/isa/isa.c | 10 +++++++++- sys/dev/isa/isavar.h | 12 +++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/sys/dev/isa/isa.c b/sys/dev/isa/isa.c index 0e8dfd76a89e..83c170ca9d5e 100644 --- a/sys/dev/isa/isa.c +++ b/sys/dev/isa/isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: isa.c,v 1.81 1996/04/29 20:03:24 christos Exp $ */ +/* $NetBSD: isa.c,v 1.82 1996/05/05 01:14:07 thorpej Exp $ */ /*- * Copyright (c) 1993, 1994 Charles Hannum. All rights reserved. @@ -84,6 +84,13 @@ isaattach(parent, self, aux) sc->sc_bc = iba->iba_bc; sc->sc_ic = iba->iba_ic; + /* + * Map port 0x84, which causes a 2.5us delay when read. + * We do this now, since several drivers need it. + */ + if (bus_io_map(sc->sc_bc, 0x84, 1, &sc->sc_delayioh)) + panic("isaattach: can't map `delay port'"); /* XXX */ + TAILQ_INIT(&sc->sc_subdevs); config_scan(isascan, self); } @@ -131,6 +138,7 @@ isascan(parent, match) ia.ia_msize = cf->cf_loc[3]; ia.ia_irq = cf->cf_loc[4] == 2 ? 9 : cf->cf_loc[4]; ia.ia_drq = cf->cf_loc[5]; + ia.ia_delayioh = sc->sc_delayioh; if ((*cf->cf_attach->ca_match)(parent, dev, &ia) > 0) config_attach(parent, dev, &ia, isaprint); diff --git a/sys/dev/isa/isavar.h b/sys/dev/isa/isavar.h index 6d3e9cca67f3..b22f2e71ef06 100644 --- a/sys/dev/isa/isavar.h +++ b/sys/dev/isa/isavar.h @@ -1,4 +1,4 @@ -/* $NetBSD: isavar.h,v 1.21 1996/04/11 22:20:50 cgd Exp $ */ +/* $NetBSD: isavar.h,v 1.22 1996/05/05 01:14:14 thorpej Exp $ */ /* * Copyright (c) 1995 Chris G. Demetriou @@ -84,6 +84,8 @@ struct isa_attach_args { int ia_maddr; /* physical i/o mem addr */ u_int ia_msize; /* size of i/o memory */ void *ia_aux; /* driver specific */ + + bus_io_handle_t ia_delayioh; /* i/o handle for `delay port' */ }; #define IOBASEUNK -1 /* i/o address is unknown */ @@ -110,6 +112,14 @@ struct isa_softc { bus_chipset_tag_t sc_bc; isa_chipset_tag_t sc_ic; + + /* + * This i/o handle is used to map port 0x84, which is + * read to provide a 2.5us delay. This i/o handle + * is mapped in isaattach(), and exported to drivers + * via isa_attach_args. + */ + bus_io_handle_t sc_delayioh; }; #define cf_iobase cf_loc[0]