diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-09-28 22:14:36 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-09-28 22:14:36 +0000 |
commit | ac8974a8de51edc4a7838f60167f279ffe4da0b9 (patch) | |
tree | 95026edc8f122d449b80e72d52fb684b9f5506c3 | |
parent | 71b6b72592a47df0b36c753bb3aaa6ecf29d2cd6 (diff) |
Clean various MVME188 related routines, fixing typos and removing unnecessary
diagnostic code in the process.
-rw-r--r-- | sys/arch/mvme88k/dev/syscon.c | 25 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vme.c | 21 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/locore_c_routines.c | 5 |
3 files changed, 28 insertions, 23 deletions
diff --git a/sys/arch/mvme88k/dev/syscon.c b/sys/arch/mvme88k/dev/syscon.c index 37b4cd44939..76c7c030de3 100644 --- a/sys/arch/mvme88k/dev/syscon.c +++ b/sys/arch/mvme88k/dev/syscon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscon.c,v 1.11 2003/06/02 07:06:56 deraadt Exp $ */ +/* $OpenBSD: syscon.c,v 1.12 2003/09/28 22:14:33 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -76,8 +76,8 @@ struct sysconsoftc { void *sc_paddr; struct sysconreg *sc_syscon; /* the actual registers */ struct intrhand sc_abih; /* `abort' switch */ - struct intrhand sc_acih; /* `ac fial' */ - struct intrhand sc_sfih; /* `sys fial' */ + struct intrhand sc_acih; /* `ac fail' */ + struct intrhand sc_sfih; /* `sys fail' */ struct intrhand sc_m188ih; /* `m188 interrupt' */ }; @@ -97,7 +97,7 @@ struct cfdriver syscon_cd = { NULL, "syscon", DV_DULL, 0 }; -struct sysconreg *sys_syscon = NULL; +struct sysconreg *sys_syscon; int syscon_print(void *args, const char *bus); int syscon_scan(struct device *parent, void *child, void *args); @@ -111,9 +111,17 @@ sysconmatch(parent, vcf, args) struct sysconreg *syscon; /* Don't match if wrong cpu */ - if (brdtyp != BRD_188) return (0); /* The only one... */ - /* Uh, MVME188 better have on of these, so always match if it - * is a MVME188... */ + if (brdtyp != BRD_188) + return (0); + + /* Only allow one instance */ + if (sys_syscon != NULL) + return (0); + + /* + * Uh, MVME188 better have on of these, so always match if it + * is a MVME188... + */ syscon = (struct sysconreg *)(IIOV(ca->ca_paddr)); return (1); } @@ -174,9 +182,6 @@ sysconattach(parent, self, args) struct confargs *ca = args; struct sysconsoftc *sc = (struct sysconsoftc *)self; - if (sys_syscon) - panic("syscon already attached!"); - /* * since we know ourself to land in intiobase land, * we must adjust our address diff --git a/sys/arch/mvme88k/dev/vme.c b/sys/arch/mvme88k/dev/vme.c index 952ad59f815..c404f19efe5 100644 --- a/sys/arch/mvme88k/dev/vme.c +++ b/sys/arch/mvme88k/dev/vme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.c,v 1.20 2003/06/04 04:11:37 deraadt Exp $ */ +/* $OpenBSD: vme.c,v 1.21 2003/09/28 22:14:33 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1995 Theo de Raadt @@ -290,11 +290,9 @@ vmeattach(parent, self, args) struct vmesoftc *sc = (struct vmesoftc *)self; struct confargs *ca = args; - /* XXX any initialization to do? */ - sc->sc_vaddr = ca->ca_vaddr; - vmebustype = ca->ca_bustype; + switch (ca->ca_bustype) { #if NPCCTWO > 0 case BUS_PCCTWO: @@ -309,9 +307,12 @@ vmeattach(parent, self, args) } vmevecbase = VME2_GET_VBR1(vme2) + 0x10; scon = (vme2->vme2_tctl & VME2_TCTL_SCON); - printf(": vector base 0x%x, %ssystem controller\n", vmevecbase, scon ? "" : "not "); + printf(": vector base 0x%x", vmevecbase); + if (scon != 0) + printf(", system controller"); if (scon) sys_vme2 = vme2; + printf("\n"); vme2chip_init(sc); } break; @@ -319,17 +320,19 @@ vmeattach(parent, self, args) #if NSYSCON > 0 case BUS_SYSCON: { - char sconc; + u_int8_t sconc; vmevecbase = 0x80; /* Hard coded for MVME188 */ - sconc = *(char *)GLOBAL1; - sconc &= M188_SYSCON; - printf(": %ssystem controller\n", sconc ? "" : "not "); + sconc = *(volatile u_int8_t *)GLOBAL1; + if (ISSET(sconc, M188_SYSCON)) + printf(": system controller"); + printf("\n"); vmesyscon_init(sc); } break; #endif } + while (config_found(self, NULL, NULL)) ; } diff --git a/sys/arch/mvme88k/mvme88k/locore_c_routines.c b/sys/arch/mvme88k/mvme88k/locore_c_routines.c index 88cc8cc852c..c666d855281 100644 --- a/sys/arch/mvme88k/mvme88k/locore_c_routines.c +++ b/sys/arch/mvme88k/mvme88k/locore_c_routines.c @@ -1,4 +1,4 @@ -/* $OpenBSD: locore_c_routines.c,v 1.34 2003/09/26 23:37:04 miod Exp $ */ +/* $OpenBSD: locore_c_routines.c,v 1.35 2003/09/28 22:14:35 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -441,9 +441,6 @@ setlevel(unsigned int level) unsigned int mask; int cpu = cpu_number(); - if (level > 7) { - panic("setlevel: bad level 0x%x", level); - } mask = int_mask_val[level]; if (cpu != master_cpu) |