1999-11-19 06:15:28 +03:00
|
|
|
/* $NetBSD: ibus_pmax.c,v 1.6 1999/11/19 03:15:28 nisimura Exp $ */
|
1998-04-19 06:52:45 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 1998 Jonathan Stone. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by Jonathan Stone for
|
|
|
|
* the NetBSD Project.
|
|
|
|
* 4. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
|
|
|
|
1999-11-19 06:15:28 +03:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: ibus_pmax.c,v 1.6 1999/11/19 03:15:28 nisimura Exp $");
|
1999-11-19 05:11:47 +03:00
|
|
|
|
|
|
|
#include "opt_dec_3100.h"
|
|
|
|
#include "opt_dec_5100.h"
|
1998-04-19 06:52:45 +04:00
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/device.h>
|
|
|
|
|
|
|
|
#include <machine/cpu.h>
|
|
|
|
#include <machine/intr.h>
|
|
|
|
#include <pmax/ibus/ibusvar.h>
|
1999-11-15 12:50:17 +03:00
|
|
|
#include <machine/autoconf.h>
|
1998-04-19 06:52:45 +04:00
|
|
|
#include <pmax/pmax/kn01.h>
|
|
|
|
#include <pmax/pmax/pmaxtype.h>
|
|
|
|
|
|
|
|
|
1999-11-15 12:50:17 +03:00
|
|
|
static int ibus_pmax_match __P((struct device *, struct cfdata *, void *));
|
|
|
|
static void ibus_pmax_attach __P((struct device *, struct device *, void *));
|
1998-04-19 06:52:45 +04:00
|
|
|
|
1999-11-15 12:50:17 +03:00
|
|
|
struct cfattach ibus_pmax_ca = {
|
|
|
|
sizeof(struct ibus_softc), ibus_pmax_match, ibus_pmax_attach
|
1998-04-19 06:52:45 +04:00
|
|
|
};
|
|
|
|
|
1999-03-15 10:43:05 +03:00
|
|
|
#define KV(x) MIPS_PHYS_TO_KSEG1(x)
|
1998-04-19 06:52:45 +04:00
|
|
|
|
1999-11-15 12:50:17 +03:00
|
|
|
static struct ibus_attach_args kn01_devs[] = {
|
1998-10-24 03:01:44 +04:00
|
|
|
/* 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) },
|
1999-11-15 12:50:17 +03:00
|
|
|
{ "mc146818", 4, KV(KN01_SYS_CLOCK) },
|
|
|
|
#ifdef notyet
|
1998-10-24 03:01:44 +04:00
|
|
|
{ "dc", 5, KV(0x15000000), },
|
|
|
|
{ "dc", 6, KV(0x15200000), },
|
1998-04-19 06:52:45 +04:00
|
|
|
/*
|
|
|
|
* XXX Ultrix configures at 0x86400400. the first 0x400 byte are
|
|
|
|
* used for NVRAM state??
|
|
|
|
*/
|
1999-11-15 12:50:17 +03:00
|
|
|
{ "nvram", 7, KV(0x86400000), },
|
1998-04-19 06:52:45 +04:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
1999-11-15 12:50:17 +03:00
|
|
|
static int ibus_attached;
|
|
|
|
|
1998-04-19 06:52:45 +04:00
|
|
|
int
|
1999-11-15 12:50:17 +03:00
|
|
|
ibus_pmax_match(parent, cfdata, aux)
|
1998-04-19 06:52:45 +04:00
|
|
|
struct device *parent;
|
|
|
|
struct cfdata *cfdata;
|
1999-11-15 12:50:17 +03:00
|
|
|
void *aux;
|
1998-04-19 06:52:45 +04:00
|
|
|
{
|
1999-11-15 12:50:17 +03:00
|
|
|
struct mainbus_attach_args *ma = aux;
|
1998-04-19 06:52:45 +04:00
|
|
|
|
1999-11-15 12:50:17 +03:00
|
|
|
if (ibus_attached)
|
|
|
|
return 0;
|
1999-11-19 04:28:08 +03:00
|
|
|
if (systype != DS_PMAX && systype != DS_MIPSMATE)
|
1999-11-15 12:50:17 +03:00
|
|
|
return 0;
|
|
|
|
if (strcmp(ma->ma_name, "baseboard") != 0)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
1998-04-19 06:52:45 +04:00
|
|
|
|
|
|
|
void
|
1999-11-15 12:50:17 +03:00
|
|
|
ibus_pmax_attach(parent, self, aux)
|
|
|
|
struct device *parent, *self;
|
1998-04-19 06:52:45 +04:00
|
|
|
void *aux;
|
|
|
|
{
|
1999-11-15 12:50:17 +03:00
|
|
|
struct ibus_dev_attach_args ida;
|
|
|
|
|
|
|
|
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_establish = dec_3100_intr_establish;
|
|
|
|
ida.ida_disestablish = dec_3100_intr_disestablish;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef DEC_5100
|
|
|
|
case DS_MIPSMATE:
|
|
|
|
ida.ida_establish = dec_5100_intr_establish;
|
|
|
|
ida.ida_disestablish = dec_5100_intr_disestablish;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
default:
|
1999-11-17 06:42:20 +03:00
|
|
|
panic("ibus_pmax_attach: no ibus configured for systype = %d", systype);
|
1999-11-15 12:50:17 +03:00
|
|
|
}
|
1998-04-19 06:52:45 +04:00
|
|
|
|
1999-11-15 12:50:17 +03:00
|
|
|
ibusattach(parent, self, &ida);
|
1998-04-19 06:52:45 +04:00
|
|
|
}
|