From f0a0bf4b3ff45615231918b572a707f8acafc137 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sun, 1 Mar 2009 21:37:42 +0000 Subject: Clean up match routines vs board id; this should give 166, 172 and 176 a change to work better. --- sys/arch/mvme68k/dev/cl.c | 17 ++++++++++--- sys/arch/mvme68k/dev/flash.c | 48 ++++++++++++++++++++++-------------- sys/arch/mvme68k/dev/if_ie.c | 8 ++---- sys/arch/mvme68k/dev/osiop_mvme68k.c | 3 ++- sys/arch/mvme68k/dev/pcctwo.c | 13 +++++++--- sys/arch/mvme68k/dev/sram.c | 10 +++++--- 6 files changed, 62 insertions(+), 37 deletions(-) diff --git a/sys/arch/mvme68k/dev/cl.c b/sys/arch/mvme68k/dev/cl.c index 6fdc28fd6a2..dc47ddf252e 100644 --- a/sys/arch/mvme68k/dev/cl.c +++ b/sys/arch/mvme68k/dev/cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl.c,v 1.44 2008/01/23 16:37:57 jsing Exp $ */ +/* $OpenBSD: cl.c,v 1.45 2009/03/01 21:37:41 miod Exp $ */ /* * Copyright (c) 1995 Dale Rahn. All rights reserved. @@ -233,11 +233,18 @@ clprobe(parent, self, aux) struct clreg *cl_reg; struct confargs *ca = aux; int ret; - if (cputyp != CPU_167 && cputyp != CPU_166 && cputyp != CPU_177) - { + + switch (cputyp) { + case CPU_166: + case CPU_167: + case CPU_176: + case CPU_177: + break; + default: return 0; } - cl_reg = (struct clreg *)ca->ca_vaddr; + + cl_reg = (struct clreg *)ca->ca_vaddr; #if 0 ret = !badvaddr(&cl_reg->cl_gfrcr,1); @@ -927,7 +934,9 @@ clcnprobe(cp) int maj; switch (cputyp) { + case CPU_166: case CPU_167: + case CPU_176: case CPU_177: break; default: diff --git a/sys/arch/mvme68k/dev/flash.c b/sys/arch/mvme68k/dev/flash.c index 63d405e13eb..c07428b90a1 100644 --- a/sys/arch/mvme68k/dev/flash.c +++ b/sys/arch/mvme68k/dev/flash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: flash.c,v 1.18 2007/12/20 05:19:38 miod Exp $ */ +/* $OpenBSD: flash.c,v 1.19 2009/03/01 21:37:41 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -101,35 +101,45 @@ flashmatch(parent, cf, args) { struct confargs *ca = args; + switch (cputyp) { #ifdef MVME147 - if (cputyp == CPU_147) + case CPU_147: return (0); #endif -#ifdef MVME167 - /* - * XXX: 166 has 4 byte-wide flash rams side-by-side, and - * isn't supported (yet). - */ - if (cputyp == CPU_166) +#ifdef MVME165 + case CPU_165: return (0); - if (cputyp == CPU_167) +#endif +#ifdef MVME167 + case CPU_166: + case CPU_167: + /* + * XXX: 166 has 4 byte-wide flash rams side-by-side, and + * isn't supported (yet). + */ return (0); #endif #ifdef MVME177 - /* - * XXX: 177 has no flash. - */ - if (cputyp == CPU_177) + case CPU_176: + case CPU_177: + /* + * XXX: 177 has no flash. + */ return (0); #endif +#if defined(MVME162) || defined(MVME172) + case CPU_162: + case CPU_172: + if (badpaddr(ca->ca_paddr, 1)) + return (0); - if (badpaddr(ca->ca_paddr, 1)) + if (!mc_hasflash()) + return 0; + return (1); +#endif + default: return (0); - - if (!mc_hasflash()) - return 0; - - return (1); + } } void diff --git a/sys/arch/mvme68k/dev/if_ie.c b/sys/arch/mvme68k/dev/if_ie.c index 58c03318fa4..a3a4888cccc 100644 --- a/sys/arch/mvme68k/dev/if_ie.c +++ b/sys/arch/mvme68k/dev/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.37 2008/11/28 02:44:17 brad Exp $ */ +/* $OpenBSD: if_ie.c,v 1.38 2009/03/01 21:37:41 miod Exp $ */ /*- * Copyright (c) 1999 Steve Murphree, Jr. @@ -488,13 +488,9 @@ ieattach(parent, self, aux) case BUS_PCCTWO: pcctwointr_establish(PCC2V_IE, &sc->sc_ih, self->dv_xname); switch (cputyp) { -#ifdef MVME172 - case CPU_172: -#endif #ifdef MVME177 + case CPU_176: case CPU_177: -#endif -#if defined(MVME172) || defined(MVME177) /* no snooping on 68060 */ sys_pcc2->pcc2_ieirq = pri | PCC2_SC_INHIBIT | PCC2_IRQ_IEN | PCC2_IRQ_ICLR; diff --git a/sys/arch/mvme68k/dev/osiop_mvme68k.c b/sys/arch/mvme68k/dev/osiop_mvme68k.c index bf2a19567c3..2b8b56de9b3 100644 --- a/sys/arch/mvme68k/dev/osiop_mvme68k.c +++ b/sys/arch/mvme68k/dev/osiop_mvme68k.c @@ -1,4 +1,4 @@ -/* $OpenBSD: osiop_mvme68k.c,v 1.1 2009/02/17 22:28:40 miod Exp $ */ +/* $OpenBSD: osiop_mvme68k.c,v 1.2 2009/03/01 21:37:41 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * @@ -107,6 +107,7 @@ osiop_mvme68k_attach(struct device *parent, struct device *self, void *aux) case CPU_172: /* XXX this is a guess! Same as MVME177? */ #endif #ifdef MVME177 + case CPU_176: case CPU_177: #endif #if defined(MVME172) || defined(MVME177) diff --git a/sys/arch/mvme68k/dev/pcctwo.c b/sys/arch/mvme68k/dev/pcctwo.c index ace5323c235..f3bbc2b4a41 100644 --- a/sys/arch/mvme68k/dev/pcctwo.c +++ b/sys/arch/mvme68k/dev/pcctwo.c @@ -1,5 +1,5 @@ -/* $OpenBSD: pcctwo.c,v 1.16 2009/02/17 22:28:40 miod Exp $ */ +/* $OpenBSD: pcctwo.c,v 1.17 2009/03/01 21:37:41 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -77,9 +77,16 @@ pcctwomatch(parent, vcf, args) struct confargs *ca = args; struct pcctworeg *pcc2; - /* the PCC2 only exists on MVME16x's except the 162, right? */ - if (cputyp == CPU_162 || cputyp == CPU_147 || cputyp == CPU_172) + switch (cputyp) { + case CPU_166: + case CPU_167: + case CPU_176: + case CPU_177: + break; + default: return (0); + } + pcc2 = (struct pcctworeg *)(IIOV(ca->ca_paddr) + PCC2_PCC2CHIP_OFF); if (badvaddr((vaddr_t)pcc2, 1) || pcc2->pcc2_chipid != PCC2_CHIPID) return (0); diff --git a/sys/arch/mvme68k/dev/sram.c b/sys/arch/mvme68k/dev/sram.c index c97251234f7..90460659893 100644 --- a/sys/arch/mvme68k/dev/sram.c +++ b/sys/arch/mvme68k/dev/sram.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sram.c,v 1.18 2007/12/20 05:19:38 miod Exp $ */ +/* $OpenBSD: sram.c,v 1.19 2009/03/01 21:37:41 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -86,13 +86,14 @@ sramattach(parent, self, args) { struct confargs *ca = args; struct sramsoftc *sc = (struct sramsoftc *)self; -#ifdef MVME162 +#if defined(MVME162) || defined(MVME172) struct mcreg *mc; #endif switch (cputyp) { -#ifdef MVME162 +#if defined(MVME162) || defined(MVME172) case CPU_162: + case CPU_172: /* XXX this code will almost never be used. just in case. */ mc = sys_mc; if (!mc) @@ -115,12 +116,13 @@ sramattach(parent, self, args) break; #endif #ifdef MVME167 - case CPU_167: case CPU_166: + case CPU_167: sc->sc_len = 128*1024; /* always 128K */ break; #endif #ifdef MVME177 + case CPU_176: case CPU_177: sc->sc_len = 128*1024; /* always 128K */ break; -- cgit v1.2.3