Converted to use the new bus-specific attach args.

This commit is contained in:
fredette 2001-06-27 03:00:45 +00:00
parent a50332b3e7
commit ee7503cf71
4 changed files with 64 additions and 67 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbio.c,v 1.4 2001/06/14 15:54:18 fredette Exp $ */
/* $NetBSD: mbio.c,v 1.5 2001/06/27 03:00:45 fredette Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -90,9 +90,9 @@ mbio_match(parent, cf, aux)
struct cfdata *cf;
void *aux;
{
struct confargs *ca = aux;
struct mainbus_attach_args *ma = aux;
return (cpu_has_multibus && (ca->ca_name == NULL || strcmp(cf->cf_driver->cd_name, ca->ca_name) == 0));
return (cpu_has_multibus && (ma->ma_name == NULL || strcmp(cf->cf_driver->cd_name, ma->ma_name) == 0));
}
static void
@ -101,9 +101,9 @@ mbio_attach(parent, self, aux)
struct device *self;
void *aux;
{
struct confargs *ca = aux;
struct mainbus_attach_args *ma = aux;
struct mbio_softc *sc = (struct mbio_softc *)self;
struct confargs sub_ca;
struct mbio_attach_args mba;
const char *const *cpp;
static const char *const special[] = {
/* find these first */
@ -119,8 +119,8 @@ mbio_attach(parent, self, aux)
}
printf("\n");
sc->sc_bustag = ca->ca_bustag;
sc->sc_dmatag = ca->ca_dmatag;
sc->sc_bustag = ma->ma_bustag;
sc->sc_dmatag = ma->ma_dmatag;
mbio_space_tag.cookie = sc;
mbio_space_tag.parent = sc->sc_bustag;
@ -131,20 +131,19 @@ mbio_attach(parent, self, aux)
* sun68k_bus_search about which locators must and must not
* be defined.
*/
sub_ca = *ca;
sub_ca.ca_bustag = &mbio_space_tag;
sub_ca.ca_intpri = LOCATOR_OPTIONAL;
sub_ca.ca_intvec = LOCATOR_FORBIDDEN;
mba = *ma;
mba.mba_bustag = &mbio_space_tag;
mba.mba_pri = LOCATOR_OPTIONAL;
/* Find all `early' mbio devices */
for (cpp = special; *cpp != NULL; cpp++) {
sub_ca.ca_name = *cpp;
(void)config_search(sun68k_bus_search, self, &sub_ca);
mba.mba_name = *cpp;
(void)config_search(sun68k_bus_search, self, &mba);
}
/* Find all other mbio devices */
sub_ca.ca_name = NULL;
(void)config_search(sun68k_bus_search, self, &sub_ca);
mba.mba_name = NULL;
(void)config_search(sun68k_bus_search, self, &mba);
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbmem.c,v 1.5 2001/06/14 15:54:18 fredette Exp $ */
/* $NetBSD: mbmem.c,v 1.6 2001/06/27 03:00:45 fredette Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -98,9 +98,9 @@ mbmem_match(parent, cf, aux)
struct cfdata *cf;
void *aux;
{
struct confargs *ca = aux;
struct mainbus_attach_args *ma = aux;
return (cpu_has_multibus && (ca->ca_name == NULL || strcmp(cf->cf_driver->cd_name, ca->ca_name) == 0));
return (cpu_has_multibus && (ma->ma_name == NULL || strcmp(cf->cf_driver->cd_name, ma->ma_name) == 0));
}
static void
@ -109,9 +109,9 @@ mbmem_attach(parent, self, aux)
struct device *self;
void *aux;
{
struct confargs *ca = aux;
struct mainbus_attach_args *ma = aux;
struct mbmem_softc *sc = (struct mbmem_softc *)self;
struct confargs sub_ca;
struct mbmem_attach_args mbma;
const char *const *cpp;
static const char *const special[] = {
/* find these first */
@ -127,8 +127,8 @@ mbmem_attach(parent, self, aux)
}
printf("\n");
sc->sc_bustag = ca->ca_bustag;
sc->sc_dmatag = ca->ca_dmatag;
sc->sc_bustag = ma->ma_bustag;
sc->sc_dmatag = ma->ma_dmatag;
mbmem_space_tag.cookie = sc;
mbmem_space_tag.parent = sc->sc_bustag;
@ -144,21 +144,20 @@ mbmem_attach(parent, self, aux)
* sun68k_bus_search about which locators must and must not
* be defined.
*/
sub_ca = *ca;
sub_ca.ca_bustag = &mbmem_space_tag;
sub_ca.ca_dmatag = &mbmem_dma_tag;
sub_ca.ca_intpri = LOCATOR_OPTIONAL;
sub_ca.ca_intvec = LOCATOR_FORBIDDEN;
mbma = *ma;
mbma.mbma_bustag = &mbmem_space_tag;
mbma.mbma_dmatag = &mbmem_dma_tag;
mbma.mbma_pri = LOCATOR_OPTIONAL;
/* Find all `early' mbmem devices */
for (cpp = special; *cpp != NULL; cpp++) {
sub_ca.ca_name = *cpp;
(void)config_search(sun68k_bus_search, self, &sub_ca);
mbma.mbma_name = *cpp;
(void)config_search(sun68k_bus_search, self, &mbma);
}
/* Find all other mbmem devices */
sub_ca.ca_name = NULL;
(void)config_search(sun68k_bus_search, self, &sub_ca);
mbma.mbma_name = NULL;
(void)config_search(sun68k_bus_search, self, &mbma);
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: obio.c,v 1.3 2001/06/14 15:57:59 fredette Exp $ */
/* $NetBSD: obio.c,v 1.4 2001/06/27 03:00:45 fredette Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -44,12 +44,14 @@
#include <machine/autoconf.h>
#include <machine/pmap.h>
#include <machine/idprom.h>
#include <machine/pte.h>
#include <sun2/sun2/control.h>
#include <sun2/sun2/machdep.h>
/* Does this machine have a Multibus? */
extern int cpu_has_multibus;
static int obio_match __P((struct device *, struct cfdata *, void *));
static void obio_attach __P((struct device *, struct device *, void *));
@ -94,9 +96,9 @@ obio_match(parent, cf, aux)
struct cfdata *cf;
void *aux;
{
struct confargs *ca = aux;
struct mainbus_attach_args *ma = aux;
return (ca->ca_name == NULL || strcmp(cf->cf_driver->cd_name, ca->ca_name) == 0);
return (ma->ma_name == NULL || strcmp(cf->cf_driver->cd_name, ma->ma_name) == 0);
}
static void
@ -105,9 +107,9 @@ obio_attach(parent, self, aux)
struct device *self;
void *aux;
{
struct confargs *ca = aux;
struct mainbus_attach_args *ma = aux;
struct obio_softc *sc = (struct obio_softc *)self;
struct confargs sub_ca;
struct obio_attach_args oba;
const char *const *cpp;
static const char *const special[] = {
/* find these first */
@ -123,8 +125,8 @@ obio_attach(parent, self, aux)
}
printf("\n");
sc->sc_bustag = ca->ca_bustag;
sc->sc_dmatag = ca->ca_dmatag;
sc->sc_bustag = ma->ma_bustag;
sc->sc_dmatag = ma->ma_dmatag;
obio_space_tag.cookie = sc;
obio_space_tag.parent = sc->sc_bustag;
@ -135,20 +137,19 @@ obio_attach(parent, self, aux)
* sun68k_bus_search about which locators must and must not
* be defined.
*/
sub_ca = *ca;
sub_ca.ca_bustag = &obio_space_tag;
sub_ca.ca_intpri = LOCATOR_OPTIONAL;
sub_ca.ca_intvec = LOCATOR_FORBIDDEN;
oba = *ma;
oba.oba_bustag = &obio_space_tag;
oba.oba_pri = LOCATOR_OPTIONAL;
/* Find all `early' obio devices */
for (cpp = special; *cpp != NULL; cpp++) {
sub_ca.ca_name = *cpp;
(void)config_search(sun68k_bus_search, self, &sub_ca);
oba.oba_name = *cpp;
(void)config_search(sun68k_bus_search, self, &oba);
}
/* Find all other obio devices */
sub_ca.ca_name = NULL;
(void)config_search(sun68k_bus_search, self, &sub_ca);
oba.oba_name = NULL;
(void)config_search(sun68k_bus_search, self, &oba);
}
int
@ -203,12 +204,11 @@ _obio_addr_bad(t, h, o, s)
/*
* Return nonzero if it's bad. All sun2 Multibus
* machines have all obio devices in the below
* range, and all sun2 VME machines have all obio
* devices not in the below range.
* machines have all obio devices below 0x7f0000,
* and all sun2 VME machines have all obio
* devices at or above 0x7f0000.
*/
return ((cpu_machine_id == SUN2_MACH_120) !=
(pa >= 0x2000 && pa <= 0x3800));
return ((!!cpu_has_multibus) != (pa < 0x7f0000));
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: obmem.c,v 1.3 2001/06/14 15:57:59 fredette Exp $ */
/* $NetBSD: obmem.c,v 1.4 2001/06/27 03:00:46 fredette Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -86,9 +86,9 @@ obmem_match(parent, cf, aux)
struct cfdata *cf;
void *aux;
{
struct confargs *ca = aux;
struct mainbus_attach_args *ma = aux;
return (ca->ca_name == NULL || strcmp(cf->cf_driver->cd_name, ca->ca_name) == 0);
return (ma->ma_name == NULL || strcmp(cf->cf_driver->cd_name, ma->ma_name) == 0);
}
static void
@ -97,9 +97,9 @@ obmem_attach(parent, self, aux)
struct device *self;
void *aux;
{
struct confargs *ca = aux;
struct mainbus_attach_args *ma = aux;
struct obmem_softc *sc = (struct obmem_softc *)self;
struct confargs sub_ca;
struct obmem_attach_args obma;
const char *const *cpp;
static const char *const special[] = {
/* find these first */
@ -115,8 +115,8 @@ obmem_attach(parent, self, aux)
}
printf("\n");
sc->sc_bustag = ca->ca_bustag;
sc->sc_dmatag = ca->ca_dmatag;
sc->sc_bustag = ma->ma_bustag;
sc->sc_dmatag = ma->ma_dmatag;
obmem_space_tag.cookie = sc;
obmem_space_tag.parent = sc->sc_bustag;
@ -127,20 +127,19 @@ obmem_attach(parent, self, aux)
* sun68k_bus_search about which locators must and must not
* be defined.
*/
sub_ca = *ca;
sub_ca.ca_bustag = &obmem_space_tag;
sub_ca.ca_intpri = LOCATOR_OPTIONAL;
sub_ca.ca_intvec = LOCATOR_FORBIDDEN;
obma = *ma;
obma.obma_bustag = &obmem_space_tag;
obma.obma_pri = LOCATOR_OPTIONAL;
/* Find all `early' obmem devices */
for (cpp = special; *cpp != NULL; cpp++) {
sub_ca.ca_name = *cpp;
(void)config_search(sun68k_bus_search, self, &sub_ca);
obma.obma_name = *cpp;
(void)config_search(sun68k_bus_search, self, &obma);
}
/* Find all other obmem devices */
sub_ca.ca_name = NULL;
(void)config_search(sun68k_bus_search, self, &sub_ca);
obma.obma_name = NULL;
(void)config_search(sun68k_bus_search, self, &obma);
}
int