From 56d472410a1881a2cee64afdc8084b49a804dbdb Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 26 Dec 1995 18:13:50 +0000 Subject: from netbsd: deal with renaming of asic to ioasic, and other new-tc-config changes --- sys/arch/alpha/alpha/clock.c | 49 +++++++++++++++++------------------------ sys/arch/alpha/alpha/clock_mc.c | 28 +++++++++++------------ 2 files changed, 34 insertions(+), 43 deletions(-) diff --git a/sys/arch/alpha/alpha/clock.c b/sys/arch/alpha/alpha/clock.c index bf41c872648..ec01cf72089 100644 --- a/sys/arch/alpha/alpha/clock.c +++ b/sys/arch/alpha/alpha/clock.c @@ -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 #include -#include #include -#include "asic.h" -#if NASIC -#include /* XXX */ +#include "ioasic.h" +#if NIOASIC +#include +#include +#include /* 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 && /* XXX */ - ida->ida_port[0] != -1) /* XXX */ - return (0); + if (ida->ida_port[0] != 0x70 && ida->ida_port[0] != -1) + 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; } diff --git a/sys/arch/alpha/alpha/clock_mc.c b/sys/arch/alpha/alpha/clock_mc.c index 28529ce8fdd..04f6792703d 100644 --- a/sys/arch/alpha/alpha/clock_mc.c +++ b/sys/arch/alpha/alpha/clock_mc.c @@ -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 #include -#include "tc.h" -#if NTC - /* XXX */ +#include "ioasic.h" +#if NIOASIC +#include +#include +#include #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 -- cgit v1.2.3