Add an addr' locator to the ibus' bus. This allows you to wire down

unti numbers on systems which have e.g. multiple `dc' devices on the
internal bus (like the 5100).
This commit is contained in:
thorpej 1999-11-23 20:07:34 +00:00
parent 31e0e8c669
commit 98e19f8e0e
3 changed files with 38 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files.pmax,v 1.71 1999/11/16 06:00:11 nisimura Exp $
# $NetBSD: files.pmax,v 1.72 1999/11/23 20:07:34 thorpej Exp $
# DECstation-specific configuration info
# maxpartitions must be first item in files.${ARCH}.
@ -48,7 +48,7 @@ file arch/pmax/pmax/memc_3min.c dec_3min|dec_maxine
include "dev/dec/files.dec"
# 3100 and 5100 ibus under mainbus
device ibus {}
device ibus { [addr = -1] }
attach ibus at mainbus with ibus_pmax
file arch/pmax/ibus/ibus.c ibus
file arch/pmax/ibus/ibus_pmax.c ibus & (dec_3100|dec_5100)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibus.c,v 1.2 1999/11/15 09:50:29 nisimura Exp $ */
/* $NetBSD: ibus.c,v 1.3 1999/11/23 20:07:40 thorpej Exp $ */
/*
* Copyright (c) 1998 Jonathan Stone. All rights reserved.
@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: ibus.c,v 1.2 1999/11/15 09:50:29 nisimura Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibus.c,v 1.3 1999/11/23 20:07:40 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -40,8 +40,12 @@ __KERNEL_RCSID(0, "$NetBSD: ibus.c,v 1.2 1999/11/15 09:50:29 nisimura Exp $");
#include <pmax/ibus/ibusvar.h>
#include "locators.h"
extern struct cfdriver ibus_cd;
int ibussubmatch __P((struct device *, struct cfdata *, void *));
void
ibusattach(parent, self, aux)
struct device *parent, *self;
@ -56,9 +60,27 @@ ibusattach(parent, self, aux)
sc->sc_intr_establish = ida->ida_establish;
sc->sc_intr_disestablish = ida->ida_disestablish;
for (i = 0; i < ida->ida_ndevs; i++) {
config_found(self, &ida->ida_devs[i], ibusprint);
}
for (i = 0; i < ida->ida_ndevs; i++)
(void) config_found_sm(self, &ida->ida_devs[i], ibusprint,
ibussubmatch);
}
int
ibussubmatch(parent, cf, aux)
struct device *parent;
struct cfdata *cf;
void *aux;
{
struct ibus_attach_args *ia = aux;
paddr_t pa;
pa = MIPS_KSEG1_TO_PHYS(ia->ia_addr);
if (cf->cf_loc[IBUSCF_ADDR] != IBUSCF_ADDR_DEFAULT &&
cf->cf_loc[IBUSCF_ADDR] != pa)
return (0);
return ((*cf->cf_attach->ca_match)(parent, cf, aux));
}
int
@ -66,8 +88,13 @@ ibusprint(aux, pnp)
void *aux;
const char *pnp;
{
struct ibus_attach_args *ia = aux;
if (pnp)
return (QUIET);
printf("%s at %s", ia->ia_name, pnp);
printf(" addr 0x%x", MIPS_KSEG1_TO_PHYS(ia->ia_addr));
return (UNCONF);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibusvar.h,v 1.9 1999/11/19 04:34:01 simonb Exp $ */
/* $NetBSD: ibusvar.h,v 1.10 1999/11/23 20:07:40 thorpej Exp $ */
#ifndef _IBUSVAR_H_
#define _IBUSVAR_H_ 1
@ -33,9 +33,9 @@ struct ibus_dev_attach_args {
* Arguments used to attach devices to an ibus
*/
struct ibus_attach_args {
char *ia_name; /* Device name. */
const char *ia_name; /* Device name. */
int ia_cookie; /* Device slot (table entry). */
u_int32_t ia_addr; /* Device address. */
u_int32_t ia_addr; /* Device address (KSEG1). */
};
void ibusattach __P((struct device *, struct device *, void *));