diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-01-06 20:09:13 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-01-06 20:09:13 +0000 |
commit | 0920ef93d3e6d39407744d451307c9dc7d37b76c (patch) | |
tree | 1afd9f06e911ce81bb182483e0713d39e5a45598 /sys | |
parent | 846245f5829a18cd743d0d6f00b53fb01d98380c (diff) |
Propagate bus_space_tag_t through device attachment args structures, rather
than having them build their own. No functional change.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hp300/dev/apci.c | 3 | ||||
-rw-r--r-- | sys/arch/hp300/dev/dnkbd.c | 3 | ||||
-rw-r--r-- | sys/arch/hp300/dev/frodo.c | 16 | ||||
-rw-r--r-- | sys/arch/hp300/dev/frodovar.h | 9 | ||||
-rw-r--r-- | sys/arch/hp300/dev/hil_intio.c | 6 | ||||
-rw-r--r-- | sys/arch/hp300/dev/intio.c | 7 | ||||
-rw-r--r-- | sys/arch/hp300/dev/intiovar.h | 3 | ||||
-rw-r--r-- | sys/arch/hp300/dev/sgc.c | 4 | ||||
-rw-r--r-- | sys/arch/hp300/dev/sgcvar.h | 3 | ||||
-rw-r--r-- | sys/arch/hp300/dev/sti_sgc.c | 19 |
10 files changed, 42 insertions, 31 deletions
diff --git a/sys/arch/hp300/dev/apci.c b/sys/arch/hp300/dev/apci.c index 262ed14b345..86bbb2e4b8f 100644 --- a/sys/arch/hp300/dev/apci.c +++ b/sys/arch/hp300/dev/apci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apci.c,v 1.28 2006/01/01 11:59:37 miod Exp $ */ +/* $OpenBSD: apci.c,v 1.29 2007/01/06 20:09:12 miod Exp $ */ /* $NetBSD: apci.c,v 1.9 2000/11/02 00:35:05 eeh Exp $ */ /*- @@ -103,6 +103,7 @@ #include <sys/timeout.h> #include <machine/autoconf.h> +#include <machine/bus.h> #include <machine/cpu.h> #include <machine/hp300spu.h> diff --git a/sys/arch/hp300/dev/dnkbd.c b/sys/arch/hp300/dev/dnkbd.c index eae060937ce..59cab45630b 100644 --- a/sys/arch/hp300/dev/dnkbd.c +++ b/sys/arch/hp300/dev/dnkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dnkbd.c,v 1.12 2006/08/10 23:47:34 miod Exp $ */ +/* $OpenBSD: dnkbd.c,v 1.13 2007/01/06 20:09:12 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -38,6 +38,7 @@ #include <sys/timeout.h> #include <machine/autoconf.h> +#include <machine/bus.h> #include <machine/cpu.h> #include <dev/cons.h> diff --git a/sys/arch/hp300/dev/frodo.c b/sys/arch/hp300/dev/frodo.c index c606928f1e0..6cae385aef2 100644 --- a/sys/arch/hp300/dev/frodo.c +++ b/sys/arch/hp300/dev/frodo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frodo.c,v 1.8 2006/06/16 20:44:23 miod Exp $ */ +/* $OpenBSD: frodo.c,v 1.9 2007/01/06 20:09:12 miod Exp $ */ /* $NetBSD: frodo.c,v 1.5 1999/07/31 21:15:20 thorpej Exp $ */ /*- @@ -73,6 +73,7 @@ #include <sys/syslog.h> #include <sys/device.h> +#include <machine/bus.h> #include <machine/cpu.h> #include <machine/intr.h> #include <machine/hp300spu.h> @@ -109,11 +110,11 @@ struct cfdriver frodo_cd = { }; struct frodo_attach_args frodo_subdevs[] = { - { "dnkbd", FRODO_APCI_OFFSET(0), FRODO_INTR_APCI0 }, - { "apci", FRODO_APCI_OFFSET(1), FRODO_INTR_APCI1 }, - { "apci", FRODO_APCI_OFFSET(2), FRODO_INTR_APCI2 }, - { "apci", FRODO_APCI_OFFSET(3), FRODO_INTR_APCI3 }, - { NULL, 0, 0 }, + { "dnkbd", NULL, FRODO_APCI_OFFSET(0), FRODO_INTR_APCI0 }, + { "apci", NULL, FRODO_APCI_OFFSET(1), FRODO_INTR_APCI1 }, + { "apci", NULL, FRODO_APCI_OFFSET(2), FRODO_INTR_APCI2 }, + { "apci", NULL, FRODO_APCI_OFFSET(3), FRODO_INTR_APCI3 }, + { NULL, NULL, 0, 0 }, }; #define FRODO_IPL 5 @@ -131,7 +132,7 @@ frodomatch(parent, match, aux) if (frodo_matched) return (0); - /* only 4xx workstations can have this */ + /* only specific workstations can have this */ switch (machineid) { case HP_362: case HP_382: @@ -205,6 +206,7 @@ frodoattach(parent, self, aux) if (frodo_subdevs[i].fa_offset == FRODO_APCI_OFFSET(1) && mmuid != MMUID_425_E) continue; + frodo_subdevs[i].fa_tag = ia->ia_tag; config_found_sm(self, &frodo_subdevs[i], frodoprint, frodosubmatch); } diff --git a/sys/arch/hp300/dev/frodovar.h b/sys/arch/hp300/dev/frodovar.h index 8685c240087..b5e56e0f8fd 100644 --- a/sys/arch/hp300/dev/frodovar.h +++ b/sys/arch/hp300/dev/frodovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: frodovar.h,v 1.5 2004/09/29 07:35:52 miod Exp $ */ +/* $OpenBSD: frodovar.h,v 1.6 2007/01/06 20:09:12 miod Exp $ */ /* $NetBSD: frodovar.h,v 1.1 1997/05/12 08:03:50 thorpej Exp $ */ /* @@ -36,9 +36,10 @@ * Arguments used to attach Frodo subdevices. */ struct frodo_attach_args { - const char *fa_name; /* device name */ - int fa_offset; /* offset from Frodo base */ - int fa_line; /* Frodo interrupt line */ + const char *fa_name; /* device name */ + bus_space_tag_t fa_tag; + int fa_offset; /* offset from Frodo base */ + int fa_line; /* Frodo interrupt line */ }; #define frodocf_offset cf_loc[0] diff --git a/sys/arch/hp300/dev/hil_intio.c b/sys/arch/hp300/dev/hil_intio.c index 3f17de0ebd7..4070fcb3631 100644 --- a/sys/arch/hp300/dev/hil_intio.c +++ b/sys/arch/hp300/dev/hil_intio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hil_intio.c,v 1.6 2005/12/22 07:09:49 miod Exp $ */ +/* $OpenBSD: hil_intio.c,v 1.7 2007/01/06 20:09:12 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. @@ -32,6 +32,7 @@ #include <sys/device.h> #include <sys/conf.h> +#include <machine/bus.h> #include <machine/cpu.h> #include <machine/intr.h> @@ -74,9 +75,10 @@ void hil_intio_attach(struct device *parent, struct device *self, void *aux) { struct hil_softc *sc = (void *)self; + struct intio_attach_args *ia = aux; extern struct consdev wsdisplay_cons; - sc->sc_bst = HP300_BUS_TAG(HP300_BUS_INTIO, 0); + sc->sc_bst = ia->ia_tag; if (bus_space_map(sc->sc_bst, HILADDR - INTIOBASE, HILMAPSIZE, 0, &sc->sc_bsh) != 0) { printf(": couldn't map hil controller\n"); diff --git a/sys/arch/hp300/dev/intio.c b/sys/arch/hp300/dev/intio.c index bc5c3103288..f3308ebbe46 100644 --- a/sys/arch/hp300/dev/intio.c +++ b/sys/arch/hp300/dev/intio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intio.c,v 1.4 2005/01/15 21:13:08 miod Exp $ */ +/* $OpenBSD: intio.c,v 1.5 2007/01/06 20:09:12 miod Exp $ */ /* $NetBSD: intio.c,v 1.2 1997/01/30 09:18:54 thorpej Exp $ */ /*- @@ -45,6 +45,8 @@ #include <sys/systm.h> #include <sys/device.h> +#include <machine/bus.h> + #include <hp300/dev/intiovar.h> int intiomatch(struct device *, void *, void *); @@ -108,7 +110,10 @@ intiosearch(parent, match, aux) struct intio_attach_args ia; bzero(&ia, sizeof(ia)); + ia.ia_tag = HP300_BUS_TAG(HP300_BUS_INTIO, 0); + if ((*cf->cf_attach->ca_match)(parent, cf, &ia) > 0) config_attach(parent, cf, &ia, intioprint); + return (0); } diff --git a/sys/arch/hp300/dev/intiovar.h b/sys/arch/hp300/dev/intiovar.h index a2b34f7f566..10539f5af9c 100644 --- a/sys/arch/hp300/dev/intiovar.h +++ b/sys/arch/hp300/dev/intiovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intiovar.h,v 1.2 1997/02/03 04:47:37 downsj Exp $ */ +/* $OpenBSD: intiovar.h,v 1.3 2007/01/06 20:09:12 miod Exp $ */ /* $NetBSD: intiovar.h,v 1.2 1997/01/30 09:18:55 thorpej Exp $ */ /*- @@ -47,4 +47,5 @@ */ struct intio_attach_args { caddr_t ia_addr; /* physical address */ + bus_space_tag_t ia_tag; }; diff --git a/sys/arch/hp300/dev/sgc.c b/sys/arch/hp300/dev/sgc.c index 92e083a0827..35b1d7b22b5 100644 --- a/sys/arch/hp300/dev/sgc.c +++ b/sys/arch/hp300/dev/sgc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sgc.c,v 1.3 2006/06/16 20:44:38 miod Exp $ */ +/* $OpenBSD: sgc.c,v 1.4 2007/01/06 20:09:12 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -36,6 +36,7 @@ #include <sys/kernel.h> #include <machine/autoconf.h> +#include <machine/bus.h> #include <machine/cpu.h> #include <machine/hp300spu.h> @@ -104,6 +105,7 @@ sgcattach(parent, self, aux) bzero(&saa, sizeof(saa)); saa.saa_slot = slot; + saa.saa_iot = HP300_BUS_TAG(HP300_BUS_SGC, slot); /* Attach matching device. */ config_found(self, &saa, sgcprint); diff --git a/sys/arch/hp300/dev/sgcvar.h b/sys/arch/hp300/dev/sgcvar.h index 71a81861abd..e61c1a99548 100644 --- a/sys/arch/hp300/dev/sgcvar.h +++ b/sys/arch/hp300/dev/sgcvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sgcvar.h,v 1.1 2005/01/14 22:39:26 miod Exp $ */ +/* $OpenBSD: sgcvar.h,v 1.2 2007/01/06 20:09:12 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. @@ -33,6 +33,7 @@ struct sgc_attach_args { int saa_slot; /* slot number */ + bus_space_tag_t saa_iot; }; #ifdef _KERNEL diff --git a/sys/arch/hp300/dev/sti_sgc.c b/sys/arch/hp300/dev/sti_sgc.c index 33c6d70b840..c53379e8016 100644 --- a/sys/arch/hp300/dev/sti_sgc.c +++ b/sys/arch/hp300/dev/sti_sgc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti_sgc.c,v 1.10 2006/12/18 18:57:24 miod Exp $ */ +/* $OpenBSD: sti_sgc.c,v 1.11 2007/01/06 20:09:12 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -62,7 +62,6 @@ int sti_sgc_match(struct device *parent, void *match, void *aux) { struct sgc_attach_args *saa = aux; - bus_space_tag_t iot; /* * If we already probed it succesfully as a console device, go ahead, @@ -71,9 +70,7 @@ sti_sgc_match(struct device *parent, void *match, void *aux) if (SGC_SLOT_TO_CONSCODE(saa->saa_slot) == conscode) return (1); - iot = HP300_BUS_TAG(HP300_BUS_SGC, saa->saa_slot); - - return (sti_sgc_probe(iot, saa->saa_slot)); + return (sti_sgc_probe(saa->saa_iot, saa->saa_slot)); } void @@ -82,7 +79,6 @@ sti_sgc_attach(struct device *parent, struct device *self, void *aux) struct sti_softc *sc = (void *)self; struct sgc_attach_args *saa = aux; bus_addr_t base; - bus_space_tag_t iot; bus_space_handle_t ioh; u_int romend; int i; @@ -98,10 +94,9 @@ sti_sgc_attach(struct device *parent, struct device *self, void *aux) sti_describe(sc); } else { - iot = HP300_BUS_TAG(HP300_BUS_SGC, saa->saa_slot); base = (bus_addr_t)sgc_slottopa(saa->saa_slot); - if (bus_space_map(iot, base, PAGE_SIZE, 0, &ioh)) { + if (bus_space_map(saa->saa_iot, base, PAGE_SIZE, 0, &ioh)) { printf(": can't map frame buffer"); return; } @@ -109,16 +104,16 @@ sti_sgc_attach(struct device *parent, struct device *self, void *aux) /* * Compute real PROM size */ - romend = sti_rom_size(iot, ioh); + romend = sti_rom_size(saa->saa_iot, ioh); - bus_space_unmap(iot, ioh, PAGE_SIZE); + bus_space_unmap(saa->saa_iot, ioh, PAGE_SIZE); - if (bus_space_map(iot, base, romend, 0, &ioh)) { + if (bus_space_map(saa->saa_iot, base, romend, 0, &ioh)) { printf(": can't map frame buffer"); return; } - sc->memt = sc->iot = iot; + sc->memt = sc->iot = saa->saa_iot; sc->romh = ioh; sc->bases[0] = sc->romh; for (i = 1; i < STI_REGION_MAX; i++) |