deal with renaming of asic to ioasic, and other new-tc-config changes

This commit is contained in:
cgd 1995-12-20 00:38:53 +00:00
parent 9e66508169
commit cc162e7d82
2 changed files with 34 additions and 43 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock.c,v 1.5 1995/11/23 02:33:41 cgd Exp $ */
/* $NetBSD: clock.c,v 1.6 1995/12/20 00:38:53 cgd Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -48,13 +48,14 @@
#include <sys/device.h>
#include <machine/rpb.h>
#include <machine/autoconf.h>
#include <alpha/alpha/clockvar.h>
#include "asic.h"
#if NASIC
#include <alpha/tc/asic.h> /* XXX */
#include "ioasic.h"
#if NIOASIC
#include <dev/tc/tcreg.h>
#include <dev/tc/tcvar.h>
#include <dev/tc/ioasicvar.h> /* XXX */
#endif
#include "isa.h"
@ -91,38 +92,26 @@ clockmatch(parent, cfdata, aux)
{
struct cfdata *cf = cfdata;
struct confargs *ca = aux;
#if NASIC
extern struct cfdriver asiccd;
if (parent->dv_cfdata->cf_driver == &asiccd) {
/* make sure that we're looking for this type of device. */
if (!BUS_MATCHNAME(ca, "dallas_rtc"))
return (0);
#if NIOASIC
if (parent->dv_cfdata->cf_driver == &ioasiccd) {
struct ioasicdev_attach_args *d = aux;
if (cf->cf_unit >= 1)
if (strncmp("TOY_RTC ", d->iada_modname, TC_ROM_LLEN))
return (0);
} else
#endif
#if NISA
if ((parent->dv_cfdata->cf_driver == &isacd)) {
/* Just say yes. XXX */
if (cf->cf_unit >= 1)
return 0;
struct isadev_attach_args *ida = aux;
/* XXX XXX XXX */
{
struct isadev_attach_args *ida = aux;
if (ida->ida_port[0] != 0x70 && ida->ida_port[0] != -1)
return (0);
if (ida->ida_port[0] != 0x70 && /* XXX */
ida->ida_port[0] != -1) /* XXX */
return (0);
ida->ida_port[0] = 0x70; /* XXX */
ida->ida_nports[0] = 2; /* XXX */
ida->ida_iosiz[0] = 0;
}
ida->ida_port[0] = 0x70; /* XXX */
ida->ida_nports[0] = 2; /* XXX */
ida->ida_iosiz[0] = 0;
} else
#endif
return (0);
@ -341,9 +330,11 @@ resettodr()
/*
* Wait "n" microseconds. This doesn't belong here. XXX.
*/
void
delay(n)
int n;
{
DELAY(n);
register long N = cycles_per_usec * (n);
while (N > 0)
N -= 3;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock_mc.c,v 1.3 1995/11/23 02:33:45 cgd Exp $ */
/* $NetBSD: clock_mc.c,v 1.4 1995/12/20 00:38:57 cgd Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -53,9 +53,11 @@
#include <alpha/alpha/clockvar.h>
#include <dev/ic/mc146818reg.h>
#include "tc.h"
#if NTC
/* XXX */
#include "ioasic.h"
#if NIOASIC
#include <dev/tc/tcreg.h>
#include <dev/tc/tcvar.h>
#include <dev/tc/ioasicvar.h>
#endif
#include "isa.h"
@ -86,7 +88,7 @@ struct mcclockdata {
#define mc146818_read(sc, reg) \
(*((struct mcclockdata *)sc->sc_data)->mc_read)(sc, reg)
#if NTC
#if NIOASIC
static void mc_write_tc __P((struct clock_softc *csc, u_int reg,
u_int datum));
static u_int mc_read_tc __P((struct clock_softc *csc, u_int reg));
@ -109,10 +111,6 @@ mcclock_attach(parent, self, aux)
struct clock_softc *csc = (struct clock_softc *)self;
struct isadev_attach_args *ida = aux;
register volatile struct chiptime *c;
struct confargs *ca = aux;
#if NTC
extern struct cfdriver asiccd; /* XXX */
#endif
printf(": mc146818 or compatible");
@ -120,14 +118,16 @@ mcclock_attach(parent, self, aux)
csc->sc_get = mcclock_get;
csc->sc_set = mcclock_set;
#if NTC
if (parent->dv_cfdata->cf_driver == &asiccd) {
#if NIOASIC
if (parent->dv_cfdata->cf_driver == &ioasiccd) {
struct ioasicdev_attach_args *ioasicdev = aux;
/*
* XXX should really allocate a new one and copy, or
* something. unlikely we'll have more than one...
*/
csc->sc_data = &mcclockdata_tc;
mcclockdata_tc.mc_addr = BUS_CVTADDR(ca);
mcclockdata_tc.mc_addr = (void *)ioasicdev->iada_addr;
} else
#endif
#if NISA
@ -214,7 +214,7 @@ mcclock_set(csc, ct)
}
#if NTC
#if NIOASIC
struct tc_clockdatum {
u_char datum;
char pad[3];
@ -247,7 +247,7 @@ mc_read_tc(csc, reg)
return (dp[reg].datum);
}
#endif /* NTC */
#endif /* NIOASIC */
#if NISA