Make separate device lists for the 3100 and 5100, and add a way to probe

for optional `dc' devices on the 5100.
This commit is contained in:
thorpej 1999-11-24 00:04:06 +00:00
parent d901f6eae0
commit 298f4b27f4
4 changed files with 56 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibus.c,v 1.3 1999/11/23 20:07:40 thorpej Exp $ */
/* $NetBSD: ibus.c,v 1.4 1999/11/24 00:04:06 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.3 1999/11/23 20:07:40 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibus.c,v 1.4 1999/11/24 00:04:06 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -53,6 +53,7 @@ ibusattach(parent, self, aux)
{
struct ibus_softc *sc = (struct ibus_softc *)self;
struct ibus_dev_attach_args *ida = aux;
struct ibus_attach_args *ia;
int i;
printf("\n");
@ -60,9 +61,18 @@ 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++)
(void) config_found_sm(self, &ida->ida_devs[i], ibusprint,
ibussubmatch);
/*
* Loop through the devices and attach them. If a probe-size
* is specified, it's an optional item on the platform and
* do a badaddr() test to make sure it's there.
*/
for (i = 0; i < ida->ida_ndevs; i++) {
ia = &ida->ida_devs[i];
if (ia->ia_basz != 0 &&
badaddr((caddr_t)ia->ia_addr, ia->ia_basz) != 0)
continue;
(void) config_found_sm(self, ia, ibusprint, ibussubmatch);
}
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibus_3max.c,v 1.1 1999/11/15 09:50:30 nisimura Exp $ */
/* $NetBSD: ibus_3max.c,v 1.2 1999/11/24 00:04:06 thorpej Exp $ */
/*
* Copyright (c) 1999 Tohru Nishimura. All rights reserved.
@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: ibus_3max.c,v 1.1 1999/11/15 09:50:30 nisimura Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibus_3max.c,v 1.2 1999/11/24 00:04:06 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -46,10 +46,11 @@ __KERNEL_RCSID(0, "$NetBSD: ibus_3max.c,v 1.1 1999/11/15 09:50:30 nisimura Exp $
#define KV(x) MIPS_PHYS_TO_KSEG1(x)
static struct ibus_attach_args kn02sys_devs[] = {
{ "mc146818", 0, KV(KN02_SYS_CLOCK), },
{ "dc", 1, KV(KN02_SYS_DZ), },
struct ibus_attach_args kn02sys_devs[] = {
{ "mc146818", 0, KV(KN02_SYS_CLOCK), 0, },
{ "dc", 1, KV(KN02_SYS_DZ), 0, },
};
const int kn02sys_ndevs = sizeof(kn02sys_devs) / sizeof(kn02sys_devs[0]);
static int kn02sys_match __P((struct device *, struct cfdata *, void *));
static void kn02sys_attach __P((struct device *, struct device *, void *));
@ -83,7 +84,7 @@ kn02sys_attach(parent, self, aux)
ida.ida_busname = "ibus";
ida.ida_devs = kn02sys_devs;
ida.ida_ndevs = sizeof(kn02sys_devs) / sizeof(kn02sys_devs[0]);
ida.ida_ndevs = kn02sys_ndevs;
ida.ida_establish = sc->sc_intr_establish;
ida.ida_disestablish = sc->sc_intr_disestablish;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibus_pmax.c,v 1.6 1999/11/19 03:15:28 nisimura Exp $ */
/* $NetBSD: ibus_pmax.c,v 1.7 1999/11/24 00:04:06 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_pmax.c,v 1.6 1999/11/19 03:15:28 nisimura Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibus_pmax.c,v 1.7 1999/11/24 00:04:06 thorpej Exp $");
#include "opt_dec_3100.h"
#include "opt_dec_5100.h"
@ -58,23 +58,36 @@ struct cfattach ibus_pmax_ca = {
#define KV(x) MIPS_PHYS_TO_KSEG1(x)
static struct ibus_attach_args kn01_devs[] = {
/* name cookie addr */
{ "pm", 0, KV(KN01_PHYS_FBUF_START) },
{ "dc", 1, KV(KN01_SYS_DZ) },
{ "lance", 2, KV(KN01_SYS_LANCE) },
{ "sii", 3, KV(KN01_SYS_SII) },
{ "mc146818", 4, KV(KN01_SYS_CLOCK) },
#ifdef notyet
{ "dc", 5, KV(0x15000000), },
{ "dc", 6, KV(0x15200000), },
#ifdef DEC_3100
struct ibus_attach_args ibus_pmax_devs[] = {
{ "pm", 0, KV(KN01_PHYS_FBUF_START), 0 },
{ "dc", 1, KV(KN01_SYS_DZ), 0 },
{ "lance", 2, KV(KN01_SYS_LANCE), 0 },
{ "sii", 3, KV(KN01_SYS_SII), 0 },
{ "mc146818", 4, KV(KN01_SYS_CLOCK), 0 },
};
const int ibus_pmax_ndevs = sizeof(ibus_pmax_devs) / sizeof(ibus_pmax_devs[0]);
#endif /* DEC_3100 */
#ifdef DEC_5100
struct ibus_attach_args ibus_mipsmate_devs[] = {
{ "dc", 1, KV(KN01_SYS_DZ), 0 },
{ "lance", 2, KV(KN01_SYS_LANCE), 0 },
{ "sii", 3, KV(KN01_SYS_SII), 0 },
{ "mc146818", 4, KV(KN01_SYS_CLOCK), 0 },
{ "dc", 5, KV(0x15000000), 2 },
{ "dc", 6, KV(0x15200000), 2 },
#if 0
/*
* XXX Ultrix configures at 0x86400400. the first 0x400 byte are
* used for NVRAM state??
* Ultrix configures it at 0x86400400. The first 0x400 bytes
* used for VMRAM state??
*/
{ "nvram", 7, KV(0x86400000), },
{ "nvram", 7, KV(0x86400000), 0 },
#endif
};
const int ibus_mipsmate_ndevs =
sizeof(ibus_mipsmate_devs) / sizeof(ibus_mipsmate_devs[0]);
#endif /* DEC_5100 */
static int ibus_attached;
@ -106,17 +119,19 @@ ibus_pmax_attach(parent, self, aux)
ibus_attached = 1;
ida.ida_busname = "ibus";
ida.ida_devs = kn01_devs;
ida.ida_ndevs = sizeof(kn01_devs) / sizeof(kn01_devs[0]);
switch (systype) {
#ifdef DEC_3100
case DS_PMAX:
ida.ida_devs = ibus_pmax_devs;
ida.ida_ndevs = ibus_pmax_ndevs;
ida.ida_establish = dec_3100_intr_establish;
ida.ida_disestablish = dec_3100_intr_disestablish;
break;
#endif
#ifdef DEC_5100
case DS_MIPSMATE:
ida.ida_devs = ibus_mipsmate_devs;
ida.ida_ndevs = ibus_mipsmate_ndevs;
ida.ida_establish = dec_5100_intr_establish;
ida.ida_disestablish = dec_5100_intr_disestablish;
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibusvar.h,v 1.10 1999/11/23 20:07:40 thorpej Exp $ */
/* $NetBSD: ibusvar.h,v 1.11 1999/11/24 00:04:06 thorpej Exp $ */
#ifndef _IBUSVAR_H_
#define _IBUSVAR_H_ 1
@ -36,6 +36,7 @@ struct ibus_attach_args {
const char *ia_name; /* Device name. */
int ia_cookie; /* Device slot (table entry). */
u_int32_t ia_addr; /* Device address (KSEG1). */
int ia_basz; /* badaddr() size */
};
void ibusattach __P((struct device *, struct device *, void *));