MI ioasic softc and child-device structs, gc duplicate struct definitions.
Add MI ioasic functions, but dont enable on alpha until tested.
This commit is contained in:
parent
b0eb09de11
commit
ef79649fc1
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ioasic.c,v 1.20 1999/02/12 01:50:30 thorpej Exp $ */
|
||||
/* $NetBSD: ioasic.c,v 1.21 1999/03/15 01:25:27 jonathan Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -68,7 +68,7 @@
|
|||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.20 1999/02/12 01:50:30 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.21 1999/03/15 01:25:27 jonathan Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
|
@ -87,16 +87,6 @@ __KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.20 1999/02/12 01:50:30 thorpej Exp $");
|
|||
#include <alpha/tc/ioasicreg.h>
|
||||
#include <dev/tc/ioasicvar.h>
|
||||
|
||||
struct ioasic_softc {
|
||||
struct device sc_dv;
|
||||
|
||||
tc_addr_t sc_base;
|
||||
void *sc_cookie;
|
||||
|
||||
bus_dma_tag_t sc_dmat;
|
||||
bus_dmamap_t sc_lance_dmam;
|
||||
};
|
||||
|
||||
/* Definition of the driver for autoconfig. */
|
||||
int ioasicmatch __P((struct device *, struct cfdata *, void *));
|
||||
void ioasicattach __P((struct device *, struct device *, void *));
|
||||
|
@ -120,12 +110,7 @@ int ioasic_intrnull __P((void *));
|
|||
|
||||
#define IOASIC_NCOOKIES 4
|
||||
|
||||
struct ioasic_dev {
|
||||
char *iad_modname;
|
||||
tc_offset_t iad_offset;
|
||||
void *iad_cookie;
|
||||
u_int32_t iad_intrbits;
|
||||
} ioasic_devs[] = {
|
||||
struct ioasic_dev ioasic_devs[] = {
|
||||
/* XXX lance name */
|
||||
{ "lance", IOASIC_SLOT_3_START, C(IOASIC_DEV_LANCE),
|
||||
IOASIC_INTR_LANCE, },
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: asic.c,v 1.32 1999/03/14 23:59:53 jonathan Exp $ */
|
||||
/* $NetBSD: asic.c,v 1.33 1999/03/15 01:25:27 jonathan Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
|
@ -67,13 +67,6 @@
|
|||
tc_addr_t ioasic_base = 0;
|
||||
|
||||
/* tables of child devices on an ioasic bus. */
|
||||
struct ioasic_dev {
|
||||
char *iad_modname;
|
||||
tc_offset_t iad_offset;
|
||||
void *iad_cookie;
|
||||
u_int32_t iad_intrbits;
|
||||
};
|
||||
|
||||
#define C(x) ((void*)(x))
|
||||
#define ASIC_NDEVS(x) (sizeof(x)/sizeof(x[0]))
|
||||
#define ARRAY_SIZEOF(x) (sizeof((x)) / sizeof ((x)[0]))
|
||||
|
@ -111,10 +104,6 @@ const int kn02_ioasic_ndevs = ARRAY_SIZEOF(kn02_ioasic_devs);
|
|||
#endif /* DEC_3MAX */
|
||||
#endif /* pmax */
|
||||
|
||||
struct asic_softc {
|
||||
struct device sc_dv;
|
||||
tc_addr_t sc_base;
|
||||
};
|
||||
|
||||
/* Definition of the driver for autoconfig. */
|
||||
int ioasicmatch __P((struct device *, struct cfdata *, void *));
|
||||
|
@ -126,7 +115,7 @@ int ioasicprint(void *, const char *);
|
|||
#define ioasiccf_offset cf_loc[IOASICCF_OFFSET] /* offset */
|
||||
|
||||
struct cfattach ioasic_ca = {
|
||||
sizeof(struct asic_softc), ioasicmatch, ioasicattach
|
||||
sizeof(struct ioasic_softc), ioasicmatch, ioasicattach
|
||||
};
|
||||
|
||||
#ifdef pmax
|
||||
|
@ -176,10 +165,9 @@ ioasicattach(parent, self, aux)
|
|||
struct device *parent, *self;
|
||||
void *aux;
|
||||
{
|
||||
struct asic_softc *sc = (struct asic_softc *)self;
|
||||
struct ioasic_softc *sc = (struct ioasic_softc *)self;
|
||||
struct tc_attach_args *ta = aux;
|
||||
struct ioasicdev_attach_args idev;
|
||||
int i, nslots;
|
||||
int ndevs;
|
||||
|
||||
/* See if the unit number is valid. */
|
||||
switch (systype) {
|
||||
|
@ -188,21 +176,21 @@ ioasicattach(parent, self, aux)
|
|||
case DS_3MAXPLUS:
|
||||
/* 3min ioasic addressees are the same as 3maxplus. */
|
||||
ioasic_devs = kn03_ioasic_devs;
|
||||
nslots = kn03_ioasic_ndevs;
|
||||
ndevs = kn03_ioasic_ndevs;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef DEC_MAXINE
|
||||
case DS_MAXINE:
|
||||
ioasic_devs = xine_ioasic_devs;
|
||||
nslots = xine_ioasic_ndevs;
|
||||
ndevs = xine_ioasic_ndevs;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef DEC_3MAX
|
||||
case DS_3MAX:
|
||||
ioasic_devs = kn02_ioasic_devs;
|
||||
nslots = kn02_ioasic_ndevs;
|
||||
ndevs = kn02_ioasic_ndevs;
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
@ -236,42 +224,7 @@ ioasicattach(parent, self, aux)
|
|||
/*
|
||||
* Try to configure each ioctl asic baseboard device.
|
||||
*/
|
||||
for (i = 0; i < nslots; i++) {
|
||||
strncpy(idev.iada_modname, ioasic_devs[i].iad_modname,
|
||||
TC_ROM_LLEN);
|
||||
idev.iada_modname[TC_ROM_LLEN] = '\0';
|
||||
idev.iada_offset = ioasic_devs[i].iad_offset;
|
||||
idev.iada_addr = sc->sc_base + ioasic_devs[i].iad_offset;
|
||||
idev.iada_cookie = ioasic_devs[i].iad_cookie;
|
||||
/* XXX bus-space handle */
|
||||
|
||||
/* Tell the autoconfig machinery we've found the hardware. */
|
||||
config_found(self, &idev, ioasicprint);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
ioasicprint(aux, pnp)
|
||||
void *aux;
|
||||
const char *pnp;
|
||||
{
|
||||
struct ioasicdev_attach_args *d = aux;
|
||||
|
||||
if (pnp)
|
||||
printf("%s at %s", d->iada_modname, pnp);
|
||||
printf(" offset 0x%x", d->iada_offset);
|
||||
printf(" priority %d", (int)d->iada_cookie);
|
||||
return (UNCONF);
|
||||
}
|
||||
|
||||
int
|
||||
ioasic_submatch(match, d)
|
||||
struct cfdata *match;
|
||||
struct ioasicdev_attach_args *d;
|
||||
{
|
||||
|
||||
return ((match->ioasiccf_offset == d->iada_offset) ||
|
||||
(match->ioasiccf_offset == IOASICCF_OFFSET_DEFAULT));
|
||||
ioasic_attach_devs(sc, ioasic_devs, ndevs);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: files.tc,v 1.13 1998/07/21 17:36:06 drochner Exp $
|
||||
# $NetBSD: files.tc,v 1.14 1999/03/15 01:25:26 jonathan Exp $
|
||||
#
|
||||
# Config file and device description for machine-independent
|
||||
# TurboChannel code. Included by ports that need it.
|
||||
|
@ -12,6 +12,7 @@ file dev/tc/tc.c tc needs-flag
|
|||
# The TurboChannel IOCTL ASIC
|
||||
device ioasic { offset = -1 }
|
||||
attach ioasic at tc
|
||||
#file dev/tc/ioasic_subr.c ioasic
|
||||
|
||||
# LANCE attachments.
|
||||
# lance device defined in sys/conf/files
|
||||
|
@ -23,6 +24,10 @@ attach le at tc with le_tc: le24, le_dec_subr
|
|||
file dev/tc/if_le_ioasic.c le_ioasic needs-flag # for le_iomem
|
||||
file dev/tc/if_le_tc.c le_tc
|
||||
|
||||
# ioasic audio
|
||||
attach audioamd at ioasic with am7930_ioasic
|
||||
file dev/tc/am7930_ioasic.c am7930_ioasic
|
||||
|
||||
|
||||
# DEC DEFTA TC FDDI Controller
|
||||
device fta: pdq, fddi, ifnet, arp
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Keith Bostic, Chris G. Demetriou
|
||||
*
|
||||
* 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/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: ioasic_subr.c,v 1.1 1999/03/15 01:25:26 jonathan Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/device.h>
|
||||
#include <dev/tc/tcvar.h>
|
||||
#include <dev/tc/ioasicvar.h>
|
||||
|
||||
int ioasicprint(void *, const char *);
|
||||
|
||||
int
|
||||
ioasicprint(aux, pnp)
|
||||
void *aux;
|
||||
const char *pnp;
|
||||
{
|
||||
struct ioasicdev_attach_args *d = aux;
|
||||
|
||||
if (pnp)
|
||||
printf("%s at %s", d->iada_modname, pnp);
|
||||
printf(" offset 0x%lx", (long)d->iada_offset);
|
||||
return (UNCONF);
|
||||
}
|
||||
|
||||
int
|
||||
ioasic_submatch(match, d)
|
||||
struct cfdata *match;
|
||||
struct ioasicdev_attach_args *d;
|
||||
{
|
||||
|
||||
return ((match->ioasiccf_offset == d->iada_offset) ||
|
||||
(match->ioasiccf_offset == IOASIC_OFFSET_UNKNOWN));
|
||||
}
|
||||
|
||||
void
|
||||
ioasic_attach_devs(sc, ioasic_devs, ioasic_ndevs)
|
||||
struct ioasic_softc *sc;
|
||||
struct ioasic_dev *ioasic_devs;
|
||||
int ioasic_ndevs;
|
||||
{
|
||||
struct ioasicdev_attach_args idev;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Try to configure each device.
|
||||
*/
|
||||
for (i = 0; i < ioasic_ndevs; i++) {
|
||||
strncpy(idev.iada_modname, ioasic_devs[i].iad_modname,
|
||||
TC_ROM_LLEN);
|
||||
idev.iada_modname[TC_ROM_LLEN] = '\0';
|
||||
idev.iada_offset = ioasic_devs[i].iad_offset;
|
||||
idev.iada_addr = sc->sc_base + ioasic_devs[i].iad_offset;
|
||||
idev.iada_cookie = ioasic_devs[i].iad_cookie;
|
||||
|
||||
/* Tell the autoconfig machinery we've found the hardware. */
|
||||
config_found(&sc->sc_dv, &idev, ioasicprint);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ioasicvar.h,v 1.5 1998/01/19 02:50:19 thorpej Exp $ */
|
||||
/* $NetBSD: ioasicvar.h,v 1.6 1999/03/15 01:25:26 jonathan Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
|
@ -31,6 +31,14 @@
|
|||
* IOASIC subdevice attachment information.
|
||||
*/
|
||||
|
||||
/* motherboard-specific autoconfiguration tables of ioasic child devices. */
|
||||
struct ioasic_dev {
|
||||
char *iad_modname;
|
||||
tc_offset_t iad_offset;
|
||||
void *iad_cookie;
|
||||
u_int32_t iad_intrbits;
|
||||
};
|
||||
|
||||
/* Attachment arguments. */
|
||||
struct ioasicdev_attach_args {
|
||||
char iada_modname[TC_ROM_LLEN];
|
||||
|
@ -45,6 +53,16 @@ struct ioasicdev_attach_args {
|
|||
|
||||
#define IOASIC_OFFSET_UNKNOWN IOASICCF_OFFSET_DEFAULT
|
||||
|
||||
struct ioasic_softc {
|
||||
struct device sc_dv;
|
||||
|
||||
tc_addr_t sc_base;
|
||||
void *sc_cookie;
|
||||
|
||||
bus_dma_tag_t sc_dmat;
|
||||
bus_dmamap_t sc_lance_dmam;
|
||||
};
|
||||
|
||||
/*
|
||||
* XXX Some drivers need direct access to IOASIC registers.
|
||||
*/
|
||||
|
@ -64,6 +82,9 @@ void ioasic_intr_disestablish __P((struct device *, void *));
|
|||
*/
|
||||
int ioasic_submatch __P((struct cfdata *, struct ioasicdev_attach_args *));
|
||||
char *ioasic_lance_ether_address __P((void));
|
||||
#ifndef __alpha__
|
||||
void ioasic_attach_devs __P((struct ioasic_softc *sc,
|
||||
struct ioasic_dev *ioasic_devs, int ioasic_ndevs));
|
||||
|
||||
#ifndef alpha
|
||||
void ioasic_lance_dma_setup __P((void *));
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue