1997-07-21 09:39:02 +04:00
|
|
|
|
/* $NetBSD: asic.c,v 1.22 1997/07/21 05:39:40 jonathan Exp $ */
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Author: Keith Bostic, Chris G. Demetriou, Jonathan Stone
|
|
|
|
|
*
|
|
|
|
|
* Permission to use, copy, modify and distribute this software and
|
|
|
|
|
* its documentation is hereby granted, provided that both the copyright
|
|
|
|
|
* notice and this permission notice appear in all copies of the
|
|
|
|
|
* software, derivative works or modified versions, and any portions
|
|
|
|
|
* thereof, and that both notices appear in supporting documentation.
|
|
|
|
|
*
|
|
|
|
|
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
|
|
|
|
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
|
|
|
|
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
|
|
|
|
*
|
|
|
|
|
* Carnegie Mellon requests users of this software to return to
|
|
|
|
|
*
|
|
|
|
|
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
|
|
|
|
* School of Computer Science
|
|
|
|
|
* Carnegie Mellon University
|
|
|
|
|
* Pittsburgh PA 15213-3890
|
|
|
|
|
*
|
|
|
|
|
* any improvements or extensions that they make and grant Carnegie the
|
|
|
|
|
* rights to redistribute these changes.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
|
#include <sys/systm.h>
|
|
|
|
|
#include <sys/device.h>
|
1996-01-30 01:52:15 +03:00
|
|
|
|
#include <dev/tc/tcvar.h>
|
1996-05-29 10:29:02 +04:00
|
|
|
|
#include <dev/tc/ioasicvar.h>
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
1997-06-16 08:18:57 +04:00
|
|
|
|
#include <machine/bus.h> /* wbflush() */
|
1995-08-07 11:07:43 +04:00
|
|
|
|
#include <machine/autoconf.h>
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
#include <machine/rpb.h>
|
|
|
|
|
#include <alpha/tc/tc.h>
|
|
|
|
|
#include <alpha/tc/asic.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef pmax
|
|
|
|
|
#include <pmax/pmax/pmaxtype.h>
|
|
|
|
|
#include <pmax/pmax/asic.h>
|
|
|
|
|
#include <pmax/pmax/kn01.h>
|
|
|
|
|
#include <pmax/pmax/kn02.h>
|
|
|
|
|
#include <pmax/pmax/kmin.h>
|
|
|
|
|
#include <pmax/pmax/maxine.h>
|
|
|
|
|
#include <pmax/pmax/kn03.h>
|
|
|
|
|
#include <pmax/pmax/turbochannel.h> /* interrupt enable declaration */
|
|
|
|
|
|
|
|
|
|
#include <pmax/pmax/kn03.h>
|
|
|
|
|
#include <pmax/pmax/kmin.h>
|
|
|
|
|
#include <pmax/pmax/nameglue.h>
|
|
|
|
|
|
|
|
|
|
extern int cputype;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
struct asic_softc {
|
|
|
|
|
struct device sc_dv;
|
1996-05-29 10:29:02 +04:00
|
|
|
|
tc_addr_t sc_base;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Definition of the driver for autoconfig. */
|
1997-07-21 09:39:02 +04:00
|
|
|
|
int asicmatch __P((struct device *, struct cfdata *, void *));
|
1995-08-07 11:07:43 +04:00
|
|
|
|
void asicattach __P((struct device *, struct device *, void *));
|
1996-08-28 01:53:46 +04:00
|
|
|
|
int asicprint(void *, const char *);
|
1996-01-31 11:46:42 +03:00
|
|
|
|
|
|
|
|
|
/* Device locators. */
|
1997-07-17 05:17:45 +04:00
|
|
|
|
#include "locators.h"
|
|
|
|
|
#define ioasiccf_offset cf_loc[IOASICCF_OFFSET] /* offset */
|
1996-01-31 11:46:42 +03:00
|
|
|
|
|
1996-03-17 04:38:52 +03:00
|
|
|
|
struct cfattach ioasic_ca = {
|
|
|
|
|
sizeof(struct asic_softc), asicmatch, asicattach
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct cfdriver ioasic_cd = {
|
|
|
|
|
NULL, "asic", DV_DULL
|
|
|
|
|
};
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
void asic_intr_establish __P((struct confargs *, intr_handler_t,
|
1995-09-12 11:28:06 +04:00
|
|
|
|
intr_arg_t));
|
1995-08-07 11:07:43 +04:00
|
|
|
|
void asic_intr_disestablish __P((struct confargs *));
|
1996-01-30 01:52:15 +03:00
|
|
|
|
caddr_t ioasic_cvtaddr __P((struct confargs *));
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
1996-10-06 10:29:51 +04:00
|
|
|
|
#ifndef pmax
|
1995-08-07 11:07:43 +04:00
|
|
|
|
int asic_intr __P((void *));
|
|
|
|
|
#endif
|
|
|
|
|
|
1995-09-12 11:28:06 +04:00
|
|
|
|
int asic_intrnull __P((intr_arg_t));
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
struct asic_slot {
|
|
|
|
|
struct confargs as_ca;
|
|
|
|
|
u_int as_bits;
|
|
|
|
|
intr_handler_t as_handler;
|
|
|
|
|
void *as_val;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#ifdef pmax
|
1996-10-06 10:29:51 +04:00
|
|
|
|
/*#define IOASIC_DEBUG*/
|
|
|
|
|
|
1996-01-30 01:52:15 +03:00
|
|
|
|
struct asic_slot *asic_slots;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
#include "ds-asic-conf.c"
|
1996-01-30 01:52:15 +03:00
|
|
|
|
#endif /*pmax*/
|
1995-08-29 13:43:37 +04:00
|
|
|
|
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
1996-01-31 11:46:42 +03:00
|
|
|
|
#ifdef IOASIC_DEBUG
|
1996-10-13 07:39:27 +04:00
|
|
|
|
#define IOASIC_DPRINTF(x) printf x
|
1996-01-30 01:52:15 +03:00
|
|
|
|
#else
|
1997-05-24 13:30:27 +04:00
|
|
|
|
#define IOASIC_DPRINTF(x) do { if (0) printf x ; } while (0)
|
1996-01-30 01:52:15 +03:00
|
|
|
|
#endif
|
|
|
|
|
|
1995-08-07 11:07:43 +04:00
|
|
|
|
int
|
1997-07-21 09:39:02 +04:00
|
|
|
|
asicmatch(parent, cf, aux)
|
1995-08-07 11:07:43 +04:00
|
|
|
|
struct device *parent;
|
1997-07-21 09:39:02 +04:00
|
|
|
|
struct cfdata *cf;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
void *aux;
|
|
|
|
|
{
|
1996-05-29 10:29:02 +04:00
|
|
|
|
struct tc_attach_args *ta = aux;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
1996-01-31 11:46:42 +03:00
|
|
|
|
IOASIC_DPRINTF(("asicmatch: %s slot %d offset 0x%x pri %d\n",
|
1996-05-29 10:29:02 +04:00
|
|
|
|
ta->ta_modname, ta->ta_slot, ta->ta_offset, (int)ta->ta_cookie));
|
1996-01-30 01:52:15 +03:00
|
|
|
|
|
|
|
|
|
/* An IOCTL asic can only occur on the turbochannel, anyway. */
|
|
|
|
|
#ifdef notyet
|
|
|
|
|
if (parent != &tccd)
|
1995-08-07 11:07:43 +04:00
|
|
|
|
return (0);
|
1996-01-30 01:52:15 +03:00
|
|
|
|
#endif
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
/* The 3MAX (kn02) is special. */
|
1996-05-29 10:29:02 +04:00
|
|
|
|
if (TC_BUS_MATCHNAME(ta, KN02_ASIC_NAME)) {
|
1996-10-13 07:39:27 +04:00
|
|
|
|
printf("(configuring KN02 system slot as asic)\n");
|
1995-08-07 11:07:43 +04:00
|
|
|
|
goto gotasic;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make sure that we're looking for this type of device. */
|
1996-05-29 10:29:02 +04:00
|
|
|
|
if (!TC_BUS_MATCHNAME(ta, "IOCTL "))
|
1995-08-07 11:07:43 +04:00
|
|
|
|
return (0);
|
|
|
|
|
gotasic:
|
|
|
|
|
|
|
|
|
|
/* See if the unit number is valid. */
|
|
|
|
|
switch (cputype) {
|
|
|
|
|
case DS_3MIN:
|
|
|
|
|
if (cf->cf_unit > 0)
|
|
|
|
|
return (0);
|
1995-08-18 14:15:09 +04:00
|
|
|
|
asic_slots = kn03_asic_slots; /* XXX - 3min same as kn03? */
|
1995-08-07 11:07:43 +04:00
|
|
|
|
break;
|
|
|
|
|
case DS_MAXINE:
|
|
|
|
|
if (cf->cf_unit > 0)
|
|
|
|
|
return (0);
|
1995-08-18 14:15:09 +04:00
|
|
|
|
asic_slots = xine_asic_slots;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
break;
|
|
|
|
|
case DS_3MAX:
|
|
|
|
|
if (cf->cf_unit > 0)
|
|
|
|
|
return (0);
|
|
|
|
|
asic_slots = kn02_asic_slots;
|
|
|
|
|
break;
|
|
|
|
|
case DS_3MAXPLUS:
|
|
|
|
|
if (cf->cf_unit > 0)
|
|
|
|
|
return (0);
|
|
|
|
|
asic_slots = kn03_asic_slots;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
1996-10-13 07:39:27 +04:00
|
|
|
|
printf("no ASIC config table for this machine\n");
|
1995-08-07 11:07:43 +04:00
|
|
|
|
return (0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
asicattach(parent, self, aux)
|
|
|
|
|
struct device *parent, *self;
|
|
|
|
|
void *aux;
|
|
|
|
|
{
|
|
|
|
|
struct asic_softc *sc = (struct asic_softc *)self;
|
1996-05-29 10:29:02 +04:00
|
|
|
|
struct tc_attach_args *ta = aux;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
struct confargs *nca;
|
1996-05-29 10:29:02 +04:00
|
|
|
|
struct ioasicdev_attach_args ioasicdev;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
int i;
|
|
|
|
|
extern int cputype;
|
|
|
|
|
|
|
|
|
|
if (asic_slots == NULL)
|
|
|
|
|
panic("asicattach: no asic_slot map\n");
|
|
|
|
|
|
1996-01-31 11:46:42 +03:00
|
|
|
|
IOASIC_DPRINTF(("asicattach: %s\n", sc->sc_dv.dv_xname));
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
1996-05-29 10:29:02 +04:00
|
|
|
|
sc->sc_base = ta->ta_addr;
|
1996-01-30 01:52:15 +03:00
|
|
|
|
|
1996-01-31 11:46:42 +03:00
|
|
|
|
ioasic_base = sc->sc_base; /* XXX XXX XXX */
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
1995-08-10 08:30:41 +04:00
|
|
|
|
#ifdef pmax
|
1996-10-13 07:39:27 +04:00
|
|
|
|
printf("\n");
|
1995-08-10 08:30:41 +04:00
|
|
|
|
#else /* Alpha AXP: select ASIC speed */
|
1995-08-07 11:07:43 +04:00
|
|
|
|
#ifdef DEC_3000_300
|
|
|
|
|
if (cputype == ST_DEC_3000_300) {
|
1996-01-31 11:46:42 +03:00
|
|
|
|
*(volatile u_int *)IOASIC_REG_CSR(sc->sc_base) |=
|
|
|
|
|
IOASIC_CSR_FASTMODE;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
MB();
|
1996-10-13 07:39:27 +04:00
|
|
|
|
printf(": slow mode\n");
|
1995-08-07 11:07:43 +04:00
|
|
|
|
} else
|
1995-08-10 08:30:41 +04:00
|
|
|
|
#endif /*DEC_3000_300*/
|
1996-10-13 07:39:27 +04:00
|
|
|
|
printf(": fast mode\n");
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
/* Decstations use hand-craft code to enable asic interrupts */
|
1996-05-29 10:29:02 +04:00
|
|
|
|
BUS_INTR_ESTABLISH(ta, asic_intr, sc);
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
1995-08-10 08:30:41 +04:00
|
|
|
|
#endif /* Alpha AXP: select ASIC speed */
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* The MAXINE has seven pseudo-slots in its system slot */
|
|
|
|
|
#define ASIC_MAX_NSLOTS 7 /*XXX*/
|
|
|
|
|
|
|
|
|
|
/* Try to configure each CPU-internal device */
|
|
|
|
|
for (i = 0; i < ASIC_MAX_NSLOTS; i++) {
|
|
|
|
|
|
1996-01-31 11:46:42 +03:00
|
|
|
|
IOASIC_DPRINTF(("asicattach: entry %d, base addr %x\n",
|
1996-01-30 01:52:15 +03:00
|
|
|
|
i, sc->sc_base));
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
nca = &asic_slots[i].as_ca;
|
|
|
|
|
if (nca == NULL) panic ("bad asic table\n");
|
1996-01-30 01:52:15 +03:00
|
|
|
|
if (nca->ca_name == NULL || nca->ca_name[0] == 0)
|
1995-08-07 11:07:43 +04:00
|
|
|
|
break;
|
1996-01-30 01:52:15 +03:00
|
|
|
|
nca->ca_addr = ((u_int)sc->sc_base) + nca->ca_offset;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
1996-01-31 11:46:42 +03:00
|
|
|
|
IOASIC_DPRINTF((" adding %s subslot %d offset %x addr %x\n",
|
1996-01-30 01:52:15 +03:00
|
|
|
|
nca->ca_name, nca->ca_slot, nca->ca_offset,
|
|
|
|
|
nca->ca_addr));
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
1996-05-29 10:29:02 +04:00
|
|
|
|
strncpy(ioasicdev.iada_modname, nca->ca_name, TC_ROM_LLEN);
|
|
|
|
|
ioasicdev.iada_modname[TC_ROM_LLEN] = '\0';
|
|
|
|
|
ioasicdev.iada_offset = nca->ca_offset;
|
|
|
|
|
ioasicdev.iada_addr = nca->ca_addr;
|
|
|
|
|
ioasicdev.iada_cookie = (void *)nca->ca_slotpri;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
/* Tell the autoconfig machinery we've found the hardware. */
|
1996-05-29 10:29:02 +04:00
|
|
|
|
config_found(self, &ioasicdev, asicprint);
|
1995-08-07 11:07:43 +04:00
|
|
|
|
}
|
1996-01-31 11:46:42 +03:00
|
|
|
|
IOASIC_DPRINTF(("asicattach: done\n"));
|
1995-08-07 11:07:43 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
asicprint(aux, pnp)
|
|
|
|
|
void *aux;
|
1996-08-28 01:53:46 +04:00
|
|
|
|
const char *pnp;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
{
|
1996-05-29 10:29:02 +04:00
|
|
|
|
struct ioasicdev_attach_args *d = aux;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
if (pnp)
|
1996-10-13 07:39:27 +04:00
|
|
|
|
printf("%s at %s", d->iada_modname, pnp);
|
|
|
|
|
printf(" offset 0x%x", d->iada_offset);
|
|
|
|
|
printf(" priority %d", (int)d->iada_cookie);
|
1995-08-07 11:07:43 +04:00
|
|
|
|
return (UNCONF);
|
|
|
|
|
}
|
|
|
|
|
|
1996-01-31 11:46:42 +03:00
|
|
|
|
int
|
|
|
|
|
ioasic_submatch(match, d)
|
|
|
|
|
struct cfdata *match;
|
1996-05-29 10:29:02 +04:00
|
|
|
|
struct ioasicdev_attach_args *d;
|
1996-01-31 11:46:42 +03:00
|
|
|
|
{
|
|
|
|
|
|
1996-05-29 10:29:02 +04:00
|
|
|
|
return ((match->ioasiccf_offset == d->iada_offset) ||
|
1997-07-21 09:39:02 +04:00
|
|
|
|
(match->ioasiccf_offset == IOASICCF_OFFSET_DEFAULT));
|
1996-01-31 11:46:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
1995-08-07 11:07:43 +04:00
|
|
|
|
/*
|
|
|
|
|
* Save interrupt slotname and enable mask (??)
|
1996-01-30 01:52:15 +03:00
|
|
|
|
* On decstations this isn't useful, as the turbochannel
|
1995-08-07 11:07:43 +04:00
|
|
|
|
* decstations all have incompatible ways of mapping interrupts
|
|
|
|
|
* to IO ASIC or r3000 interrupt bits.
|
|
|
|
|
* Instead of writing "as_bits" directly into an IOASIC interrupt-enable
|
|
|
|
|
* register, Decstations use a machine-dependent function that
|
|
|
|
|
* interpret (pseudo-) slot numbers and do ``the right thing'' to enable
|
|
|
|
|
* or disable interrupts for a specific slot (or pseudo-slot), by
|
|
|
|
|
* slot number, on that given CPU.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
asic_intr_establish(ca, handler, val)
|
|
|
|
|
struct confargs *ca;
|
|
|
|
|
intr_handler_t handler;
|
1995-09-12 11:28:06 +04:00
|
|
|
|
intr_arg_t val;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
{
|
|
|
|
|
|
1996-01-30 01:52:15 +03:00
|
|
|
|
#if defined(DIAGNOSTIC) && defined(alpha)
|
1996-01-31 11:46:42 +03:00
|
|
|
|
if (ca->ca_slot == IOASIC_SLOT_RTC)
|
1995-08-07 11:07:43 +04:00
|
|
|
|
panic("setting clock interrupt incorrectly");
|
1996-01-30 01:52:15 +03:00
|
|
|
|
#endif /*defined(DIAGNOSTIC) && defined(alpha)*/
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
/* XXX SHOULD NOT BE THIS LITERAL */
|
|
|
|
|
if (asic_slots[ca->ca_slot].as_handler != asic_intrnull)
|
1996-10-13 07:39:27 +04:00
|
|
|
|
/*panic*/ printf("asic_intr_establish: slot %d twice", ca->ca_slot);
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* XXX We need to invent a better interface to machine-dependent
|
|
|
|
|
* interrupt-enable code, or redo the Decstation configuration
|
|
|
|
|
* tables with unused entries, so that slot is always equal
|
1996-01-30 01:52:15 +03:00
|
|
|
|
* to "priority" (software pseudo-slot number). FIXME.
|
1995-08-07 11:07:43 +04:00
|
|
|
|
*/
|
1996-01-31 11:46:42 +03:00
|
|
|
|
#if defined(IOASIC_DEBUG) && 0
|
1996-10-13 07:39:27 +04:00
|
|
|
|
printf("asic: %s: intr for entry %d slot %d pri %d\n",
|
1996-01-30 01:52:15 +03:00
|
|
|
|
ca->ca_name, ca->ca_slot, ca->ca_slotpri,
|
1996-05-29 10:29:02 +04:00
|
|
|
|
(int)asic_slots[ca->ca_slot].as_val);
|
1996-01-31 11:46:42 +03:00
|
|
|
|
#endif /*IOASIC_DEBUG*/
|
1996-01-30 01:52:15 +03:00
|
|
|
|
|
|
|
|
|
#ifdef pmax
|
1995-09-25 23:33:26 +03:00
|
|
|
|
tc_enable_interrupt(ca->ca_slotpri, handler, val, 1);
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
#else /* Alpha AXP */
|
|
|
|
|
|
|
|
|
|
/* Save handler info so it can be enabled later (??) */
|
|
|
|
|
asic_slots[ca->ca_slot].as_handler = handler;
|
|
|
|
|
asic_slots[ca->ca_slot].as_val = val;
|
|
|
|
|
#endif /* Alpha AXP */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
asic_intr_disestablish(ca)
|
|
|
|
|
struct confargs *ca;
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
#ifdef pmax
|
|
|
|
|
panic("asic_intr_disestablish: shouldn't ever be called\n");
|
|
|
|
|
#else
|
1996-01-31 11:46:42 +03:00
|
|
|
|
if (ca->ca_slot == IOASIC_SLOT_RTC)
|
1995-08-07 11:07:43 +04:00
|
|
|
|
panic("asic_intr_disestablish: can't do clock interrupt");
|
|
|
|
|
|
|
|
|
|
/* XXX SHOULD NOT BE THIS LITERAL */
|
|
|
|
|
if (asic_slots[ca->ca_slot].as_handler == asic_intrnull)
|
|
|
|
|
panic("asic_intr_disestablish: slot %d missing intr",
|
|
|
|
|
ca->ca_slot);
|
|
|
|
|
|
|
|
|
|
asic_slots[ca->ca_slot].as_handler = dsasic_intrnull;
|
|
|
|
|
asic_slots[ca->ca_slot].as_val = (void *)(long)ca->ca_slot;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
1996-01-31 11:46:42 +03:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ioasic_intr_establish(dev, cookie, level, handler, val)
|
|
|
|
|
struct device *dev;
|
|
|
|
|
void *cookie;
|
|
|
|
|
tc_intrlevel_t level;
|
|
|
|
|
intr_handler_t handler;
|
|
|
|
|
void *val;
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
(*tc_enable_interrupt)((int)cookie, handler, val, 1);
|
|
|
|
|
}
|
|
|
|
|
|
1996-01-30 01:52:15 +03:00
|
|
|
|
#ifdef alpha
|
1995-08-07 11:07:43 +04:00
|
|
|
|
/*
|
|
|
|
|
* asic_intr --
|
|
|
|
|
* ASIC interrupt handler.
|
|
|
|
|
*/
|
|
|
|
|
int
|
|
|
|
|
asic_intr(val)
|
|
|
|
|
void *val;
|
|
|
|
|
{
|
|
|
|
|
register struct asic_softc *sc = val;
|
|
|
|
|
register int i, ifound;
|
|
|
|
|
int gifound;
|
|
|
|
|
u_int32_t sir, junk;
|
|
|
|
|
volatile u_int32_t *sirp, *junkp;
|
|
|
|
|
|
1996-01-31 11:46:42 +03:00
|
|
|
|
sirp = (volatile u_int32_t *)IOASIC_REG_INTR(sc->sc_base);
|
1995-08-07 11:07:43 +04:00
|
|
|
|
|
|
|
|
|
gifound = 0;
|
|
|
|
|
do {
|
|
|
|
|
ifound = 0;
|
|
|
|
|
MB();
|
|
|
|
|
MAGIC_READ;
|
|
|
|
|
MB();
|
|
|
|
|
|
|
|
|
|
sir = *sirp;
|
|
|
|
|
for (i = 0; i < ASIC_MAX_NSLOTS; i++)
|
|
|
|
|
if (sir & asic_slots[i].as_bits) {
|
|
|
|
|
(void)(*asic_slots[i].as_handler)
|
|
|
|
|
(asic_slots[i].as_val);
|
|
|
|
|
ifound = 1;
|
|
|
|
|
}
|
|
|
|
|
gifound |= ifound;
|
|
|
|
|
} while (ifound);
|
|
|
|
|
|
|
|
|
|
return (gifound);
|
|
|
|
|
}
|
|
|
|
|
#endif /*!pmax*/
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
asic_intrnull(val)
|
1995-09-12 11:28:06 +04:00
|
|
|
|
intr_arg_t val;
|
1995-08-07 11:07:43 +04:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
panic("uncaught IOCTL ASIC intr for slot %ld\n", (long)val);
|
|
|
|
|
}
|
1996-01-31 11:46:42 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* XXX */
|
|
|
|
|
char *
|
|
|
|
|
ioasic_lance_ether_address()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return (u_char *)IOASIC_SYS_ETHER_ADDRESS(ioasic_base);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ioasic_lance_dma_setup(v)
|
|
|
|
|
void *v;
|
|
|
|
|
{
|
|
|
|
|
volatile u_int32_t *ldp;
|
|
|
|
|
tc_addr_t tca;
|
|
|
|
|
|
|
|
|
|
tca = (tc_addr_t)v;
|
|
|
|
|
|
|
|
|
|
ldp = (volatile u_int *)IOASIC_REG_LANCE_DMAPTR(ioasic_base);
|
|
|
|
|
*ldp = ((tca << 3) & ~(tc_addr_t)0x1f) | ((tca >> 29) & 0x1f);
|
|
|
|
|
tc_wmb();
|
|
|
|
|
|
|
|
|
|
*(volatile u_int32_t *)IOASIC_REG_CSR(ioasic_base) |=
|
|
|
|
|
IOASIC_CSR_DMAEN_LANCE;
|
|
|
|
|
tc_mb();
|
|
|
|
|
}
|