diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2001-12-16 23:49:48 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2001-12-16 23:49:48 +0000 |
commit | 4c3ee3bc825b44e31dd265ae0db047015e86da6b (patch) | |
tree | 7177501c70e488ac5260c2bcd0c5b6ca2644702c /sys/arch/mvme88k/dev/pcctwo.c | |
parent | 9e602379a914ff34ca6650a265b85e6ffe484b2d (diff) |
Revert the mvme88k to 20011212. Recent changes had not been merged correctly,
and I am fed up with dissecting diffs to put back code that disappeared.
This will likely be fixed shortly.
Diffstat (limited to 'sys/arch/mvme88k/dev/pcctwo.c')
-rw-r--r-- | sys/arch/mvme88k/dev/pcctwo.c | 75 |
1 files changed, 28 insertions, 47 deletions
diff --git a/sys/arch/mvme88k/dev/pcctwo.c b/sys/arch/mvme88k/dev/pcctwo.c index 6cf93f58b29..fc4a589aa28 100644 --- a/sys/arch/mvme88k/dev/pcctwo.c +++ b/sys/arch/mvme88k/dev/pcctwo.c @@ -1,5 +1,5 @@ -/* $OpenBSD: pcctwo.c,v 1.11 2001/12/13 08:55:51 smurph Exp $ */ +/* $OpenBSD: pcctwo.c,v 1.12 2001/12/16 23:49:46 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -56,8 +56,6 @@ #include <mvme88k/dev/pcctwofunc.h> #include <mvme88k/dev/pcctworeg.h> -#include "bussw.h" - struct pcctwosoftc { struct device sc_dev; void *sc_vaddr; /* PCC2 space */ @@ -78,8 +76,6 @@ struct cfdriver pcctwo_cd = { struct pcctworeg *sys_pcc2 = NULL; -int pcc2bus; - int pcctwo_print __P((void *args, const char *bus)); int pcctwo_scan __P((struct device *parent, void *child, void *args)); @@ -92,25 +88,25 @@ pcctwomatch(parent, vcf, args) struct pcctworeg *pcc2; /* Bomb if wrong cpu */ - switch (brdtyp) { - case BRD_187: - pcc2 = (struct pcctworeg *)(IIOV(ca->ca_paddr) + PCC2_PCC2CHIP_OFF); - break; - case BRD_197: /* pcctwo is a child of buswitch XXX smurph */ - pcc2 = (struct pcctworeg *)(IIOV(ca->ca_paddr)); - break; - default: - /* Bomb if wrong board */ - return (0); - } + switch (cputyp) { + case CPU_187: + pcc2 = (struct pcctworeg *)(IIOV(ca->ca_paddr) + PCC2_PCC2CHIP_OFF); + break; + case CPU_197: /* pcctwo is a child of buswitch XXX smurph */ + pcc2 = (struct pcctworeg *)(IIOV(ca->ca_paddr)); + break; + default: + /* Bomb if wrong cpu */ + return (0); + } - if (badvaddr((vm_offset_t)pcc2, 4)) { - printf("==> pcctwo: failed address check.\n"); - return (0); + if (badvaddr((vm_offset_t)pcc2, 4) <= 0){ + printf("==> pcctwo: failed address check.\n"); + return (0); } - if (pcc2->pcc2_chipid != PCC2_CHIPID) { - printf("==> pcctwo: wrong chip id %x.\n", pcc2->pcc2_chipid); - return (0); + if (pcc2->pcc2_chipid != PCC2_CHIPID){ + printf("==> pcctwo: wrong chip id %x.\n", pcc2->pcc2_chipid); + return (0); } return (1); } @@ -179,27 +175,14 @@ pcctwoattach(parent, self, args) */ sc->sc_paddr = ca->ca_paddr; sc->sc_vaddr = (void *)IIOV(sc->sc_paddr); - - pcc2bus = ca->ca_bustype; - - switch (pcc2bus) { - case BUS_MAIN: - sc->sc_pcc2 = (struct pcctworeg *)(sc->sc_vaddr + PCC2_PCC2CHIP_OFF); - break; -#if NBUSSW > 0 - case BUS_BUSSWITCH: - sc->sc_pcc2 = (struct pcctworeg *)sc->sc_vaddr; - /* - * fake up our address so that pcc2 child devices - * are offeset of 0xFFF00000 - XXX smurph - */ - sc->sc_paddr -= PCC2_PCC2CHIP_OFF; - sc->sc_vaddr -= PCC2_PCC2CHIP_OFF; - /* make sure the bus is mc68040 compatible */ - sc->sc_pcc2->pcc2_genctl |= PCC2_GENCTL_C040; - break; -#endif - } + switch (cputyp) { + case CPU_187: + sc->sc_pcc2 = (struct pcctworeg *)(sc->sc_vaddr + PCC2_PCC2CHIP_OFF); + break; + case CPU_197: /* pcctwo is a child of buswitch XXX smurph */ + sc->sc_pcc2 = (struct pcctworeg *)sc->sc_vaddr; + break; + } sys_pcc2 = sc->sc_pcc2; printf(": rev %d\n", sc->sc_pcc2->pcc2_chiprev); @@ -210,10 +193,8 @@ pcctwoattach(parent, self, args) /* * Set pcc2intr_mask and pcc2intr_ipl. */ -#if 0 - md.intr_mask = (u_char *)&(sc->sc_pcc2->pcc2_mask); - md.intr_ipl = (u_char *)&(sc->sc_pcc2->pcc2_ipl); -#endif + pcc2intr_ipl = (u_char *)&(sc->sc_pcc2->pcc2_ipl); + pcc2intr_mask = (u_char *)&(sc->sc_pcc2->pcc2_mask); config_search(pcctwo_scan, self, args); } |