diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2010-07-10 19:32:26 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2010-07-10 19:32:26 +0000 |
commit | 9a9eb00f7b2ba1a461a4f0e474e2d8431e727018 (patch) | |
tree | 9aced9ad7d9f9287739626262ea6f8bb85e23935 /sys/arch/sparc/dev | |
parent | ab98f8b4b2be806732331cc202bf10bf268cac9f (diff) |
sun4e (i.e. SPARCengine 1e) support. This platform is a mix between sun4 and
sun4c, as it has a sun4c OpenPROM but a sun4 8KB pagesize. VME devices are
not supported yet.
ok deraadt@
Diffstat (limited to 'sys/arch/sparc/dev')
-rw-r--r-- | sys/arch/sparc/dev/bwtwo.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc/dev/cgsix.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc/dev/dma.c | 12 | ||||
-rw-r--r-- | sys/arch/sparc/dev/esp.c | 14 | ||||
-rw-r--r-- | sys/arch/sparc/dev/fb.c | 24 | ||||
-rw-r--r-- | sys/arch/sparc/dev/fd.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc/dev/if_le.c | 28 | ||||
-rw-r--r-- | sys/arch/sparc/dev/lebuffer.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc/dev/led.c | 41 | ||||
-rw-r--r-- | sys/arch/sparc/dev/sbus.c | 13 | ||||
-rw-r--r-- | sys/arch/sparc/dev/sbusreg.h | 12 | ||||
-rw-r--r-- | sys/arch/sparc/dev/z8530kbd.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc/dev/zs.c | 18 | ||||
-rw-r--r-- | sys/arch/sparc/dev/zs_kgdb.c | 4 |
14 files changed, 104 insertions, 88 deletions
diff --git a/sys/arch/sparc/dev/bwtwo.c b/sys/arch/sparc/dev/bwtwo.c index 918eec695ff..a479974d9bf 100644 --- a/sys/arch/sparc/dev/bwtwo.c +++ b/sys/arch/sparc/dev/bwtwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwtwo.c,v 1.37 2010/06/07 19:43:45 miod Exp $ */ +/* $OpenBSD: bwtwo.c,v 1.38 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: bwtwo.c,v 1.33 1997/05/24 20:16:02 pk Exp $ */ /* @@ -240,7 +240,7 @@ bwtwoattach(struct device *parent, struct device *self, void *args) case BUS_SBUS: obp_name: -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) nam = getpropstring(node, "model"); #endif break; @@ -272,7 +272,7 @@ obp_name: } #endif - if (CPU_ISSUN4COR4M) + if (!CPU_ISSUN4) isconsole = node == fbnode; sc->sc_phys = ca->ca_ra.ra_reg[0]; diff --git a/sys/arch/sparc/dev/cgsix.c b/sys/arch/sparc/dev/cgsix.c index c38b4605ba5..847787ab987 100644 --- a/sys/arch/sparc/dev/cgsix.c +++ b/sys/arch/sparc/dev/cgsix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgsix.c,v 1.42 2010/06/07 19:43:45 miod Exp $ */ +/* $OpenBSD: cgsix.c,v 1.43 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: cgsix.c,v 1.33 1997/08/07 19:12:30 pk Exp $ */ /* @@ -253,7 +253,7 @@ cgsixattach(struct device *parent, struct device *self, void *args) } #endif - if (CPU_ISSUN4COR4M) + if (!CPU_ISSUN4) isconsole = node == fbnode; fhcrev = (*sc->sc_fhc >> FHC_REV_SHIFT) & diff --git a/sys/arch/sparc/dev/dma.c b/sys/arch/sparc/dev/dma.c index 191ec5f51c9..8d1fc60875f 100644 --- a/sys/arch/sparc/dev/dma.c +++ b/sys/arch/sparc/dev/dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dma.c,v 1.27 2010/06/27 05:52:01 beck Exp $ */ +/* $OpenBSD: dma.c,v 1.28 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: dma.c,v 1.46 1997/08/27 11:24:16 bouyer Exp $ */ /* @@ -111,7 +111,7 @@ dmamatch(parent, vcf, aux) if (strcmp(cf->cf_driver->cd_name, ra->ra_name) && strcmp("espdma", ra->ra_name)) return (0); -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) if (ca->ca_bustype == BUS_SBUS) { if (!sbus_testdma((struct sbus_softc *)parent, ca)) return (0); @@ -133,7 +133,7 @@ dmaattach(parent, self, aux) struct confargs *ca = aux; struct dma_softc *sc = (void *)self; int devnode; -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) int node; struct confargs oca; char *name; @@ -217,7 +217,7 @@ dmaattach(parent, self, aux) if (CPU_ISSUN4) goto espsearch; -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) /* Propagate bootpath */ if (ca->ca_ra.ra_bp != NULL && (strcmp(ca->ca_ra.ra_bp->name, "espdma") == 0 || @@ -238,7 +238,7 @@ dmaattach(parent, self, aux) oca.ca_bustype = BUS_SBUS; (void) config_found(&sc->sc_dev, (void *)&oca, dmaprint); } while ((node = nextsibling(node)) != 0); else -#endif /* SUN4C || SUN4M */ +#endif /* SUN4C || SUN4D || SUN4E || SUN4M */ if (strcmp(ca->ca_ra.ra_name, "dma") == 0) { espsearch: @@ -413,7 +413,7 @@ ledmamatch(parent, vcf, aux) if (strcmp(cf->cf_driver->cd_name, ra->ra_name)) return (0); -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) if (!sbus_testdma((struct sbus_softc *)parent, ca)) return(0); #endif diff --git a/sys/arch/sparc/dev/esp.c b/sys/arch/sparc/dev/esp.c index 85120c54f8e..d7f6960f19e 100644 --- a/sys/arch/sparc/dev/esp.c +++ b/sys/arch/sparc/dev/esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esp.c,v 1.32 2010/06/28 18:31:01 krw Exp $ */ +/* $OpenBSD: esp.c,v 1.33 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: esp.c,v 1.69 1997/08/27 11:24:18 bouyer Exp $ */ /* @@ -169,7 +169,7 @@ struct ncr53c9x_glue esp_glue = { NULL, /* gl_clear_latched_intr */ }; -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) struct ncr53c9x_glue esp_glue1 = { esp_rdreg1, esp_wrreg1, @@ -193,7 +193,7 @@ espmatch(parent, vcf, aux) register struct confargs *ca = aux; register struct romaux *ra = &ca->ca_ra; -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) if (ca->ca_bustype == BUS_SBUS) { if (strcmp("SUNW,fas", ra->ra_name) == 0 || strcmp("ptscII", ra->ra_name) == 0) @@ -203,7 +203,7 @@ espmatch(parent, vcf, aux) if (strcmp(cf->cf_driver->cd_name, ra->ra_name)) return (0); -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) if (ca->ca_bustype == BUS_SBUS) { if (!sbus_testdma((struct sbus_softc *)parent, ca)) return (0); @@ -261,7 +261,7 @@ espattach(parent, self, aux) /* gimme MHz */ sc->sc_freq /= 1000000; -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) if (ca->ca_bustype == BUS_SBUS && strcmp("SUNW,fas", ca->ca_ra.ra_name) == 0) { struct dma_softc *dsc; @@ -387,7 +387,7 @@ espattach(parent, self, aux) /* * Set up glue for MI code. */ -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) if (ca->ca_bustype == BUS_SBUS && strcmp("ptscII", ca->ca_ra.ra_name) == 0) { sc->sc_glue = &esp_glue1; @@ -539,7 +539,7 @@ esp_write_reg(sc, reg, val) esc->sc_reg[reg * 4] = v; } -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) u_char esp_rdreg1(sc, reg) struct ncr53c9x_softc *sc; diff --git a/sys/arch/sparc/dev/fb.c b/sys/arch/sparc/dev/fb.c index db0fdc52d7d..bf299342ec1 100644 --- a/sys/arch/sparc/dev/fb.c +++ b/sys/arch/sparc/dev/fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fb.c,v 1.51 2010/06/07 19:43:45 miod Exp $ */ +/* $OpenBSD: fb.c,v 1.52 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */ /* @@ -82,7 +82,7 @@ #include <machine/eeprom.h> #include <sparc/dev/pfourreg.h> #endif -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) #include <machine/bsd_openprom.h> #endif @@ -118,7 +118,7 @@ fb_unblank() #if NWSDISPLAY > 0 -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) static int a2int(char *, int); #endif int fb_get_console_metrics(int *, int *, int *, int *); @@ -272,7 +272,7 @@ obpsize: sf->sf_fbsize = sf->sf_height * sf->sf_linebytes; } -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) static int a2int(char *cp, int deflt) { @@ -313,7 +313,7 @@ fbwscons_init(struct sunfb *sf, int isconsole) { struct rasops_info *ri = &sf->sf_ro; int cols, rows; -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) int fw, fh, wt, wl; #endif @@ -326,8 +326,8 @@ fbwscons_init(struct sunfb *sf, int isconsole) ri->ri_width = sf->sf_width; ri->ri_height = sf->sf_height; -#if defined(SUN4C) || defined(SUN4M) - if (CPU_ISSUN4COR4M) { +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) + if (!CPU_ISSUN4) { rows = a2int(getpropstring(optionsnode, "screen-#rows"), 34); cols = a2int(getpropstring(optionsnode, "screen-#columns"), 80); } @@ -369,8 +369,8 @@ fbwscons_init(struct sunfb *sf, int isconsole) * this chunk. */ -#if defined(SUN4C) || defined(SUN4M) - if (CPU_ISSUN4COR4M && isconsole) { +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) + if (!CPU_ISSUN4 && isconsole) { if (fb_get_console_metrics(&fw, &fh, &wt, &wl) != 0) { /* * Assume a 12x22 prom font and a centered @@ -422,7 +422,7 @@ fbwscons_init(struct sunfb *sf, int isconsole) rasops_init(ri, rows, cols); -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) /* * If this is the console display and there is no font change, * adjust our terminal window to the position of the PROM @@ -670,7 +670,7 @@ fb_pfour_burner(void *v, u_int enable, u_int flags) #endif /* SUN4 */ -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) int fb_get_console_metrics(int *fontwidth, int *fontheight, int *wtop, int *wleft) { @@ -732,6 +732,6 @@ fb_get_console_metrics(int *fontwidth, int *fontheight, int *wtop, int *wleft) return (0); } -#endif /* SUN4C || SUN4M */ +#endif /* SUN4C || SUN4D || SUN4E || SUN4M */ #endif /* NWSDISPLAY */ diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c index c90be332be7..ed0e33b6252 100644 --- a/sys/arch/sparc/dev/fd.c +++ b/sys/arch/sparc/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.71 2010/07/02 19:57:15 tedu Exp $ */ +/* $OpenBSD: fd.c,v 1.72 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */ /*- @@ -281,9 +281,9 @@ fdcmatch(parent, match, aux) register struct romaux *ra = &ca->ca_ra; /* - * Floppy doesn't exist on sun4. + * Floppy doesn't exist on sun4 and sun4e. */ - if (CPU_ISSUN4) + if (CPU_ISSUN4OR4E) return (0); /* diff --git a/sys/arch/sparc/dev/if_le.c b/sys/arch/sparc/dev/if_le.c index 7bf1432d45b..0a8b22f562f 100644 --- a/sys/arch/sparc/dev/if_le.c +++ b/sys/arch/sparc/dev/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.30 2009/10/26 20:17:27 deraadt Exp $ */ +/* $OpenBSD: if_le.c,v 1.31 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: if_le.c,v 1.50 1997/09/09 20:54:48 pk Exp $ */ /*- @@ -407,7 +407,7 @@ lematch(parent, vcf, aux) return (ca->ca_bustype == BUS_OBIO); } #endif -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) if (ca->ca_bustype == BUS_SBUS) { if (!sbus_testdma((struct sbus_softc *)parent, ca)) return (0); @@ -428,7 +428,7 @@ leattach(parent, self, aux) struct confargs *ca = aux; int pri; struct bootpath *bp; -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) int sbuschild = strcmp(parent->dv_cfdata->cf_driver->cd_name, "sbus") == 0; int lebufchild = strcmp(parent->dv_cfdata->cf_driver->cd_name, "lebuffer") == 0; int dmachild = strcmp(parent->dv_cfdata->cf_driver->cd_name, "ledma") == 0; @@ -446,14 +446,14 @@ leattach(parent, self, aux) printf(" pri %d", pri); sc->sc_hasifmedia = 1; -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) lesc->sc_lebufchild = lebufchild; #endif lesc->sc_r1 = (struct lereg1 *) mapiodev(ca->ca_ra.ra_reg, 0, sizeof(struct lereg1)); -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) lebuf = NULL; if (lebufchild) { lebuf = (struct lebuf_softc *)parent; @@ -506,17 +506,17 @@ leattach(parent, self, aux) laddr & 0xfffe0000); } /* else */ #endif /* solbourne */ -#if defined(SUN4) || defined(SUN4C) || defined(SUN4M) -#if defined(SUN4C) || defined(SUN4M) - if (sbuschild && CPU_ISSUN4M) +#if defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) + if (sbuschild && CPU_ISSUN4DOR4M) laddr = (u_long)dvma_malloc_space(MEMSIZE, &sc->sc_mem, M_NOWAIT, M_SPACE_D24); else #endif laddr = (u_long)dvma_malloc(MEMSIZE, &sc->sc_mem, M_NOWAIT); -#endif /* SUN4 || SUN4C || SUN4M */ -#if defined (SUN4M) +#endif /* SUN4 || SUN4C || SUN4D || SUN4E || SUN4M */ +#if defined(SUN4D) || defined (SUN4M) if ((laddr & 0xffffff) >= (laddr & 0xffffff) + MEMSIZE) panic("if_le: Lance buffer crosses 16MB boundary"); #endif @@ -533,7 +533,7 @@ leattach(parent, self, aux) else #endif sc->sc_conf3 = LE_C3_BSWP | LE_C3_ACON | LE_C3_BCON; -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) if (dmachild) { lesc->sc_dma = (struct dma_softc *)parent; lesc->sc_dma->sc_le = lesc; @@ -544,7 +544,7 @@ leattach(parent, self, aux) bp = ca->ca_ra.ra_bp; switch (ca->ca_bustype) { -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) #define SAME_LANCE(bp, ca) \ ((bp->val[0] == ca->ca_slot && bp->val[1] == ca->ca_offset) || \ (bp->val[0] == -1 && bp->val[1] == sc->sc_dev.dv_unit)) @@ -554,7 +554,7 @@ leattach(parent, self, aux) SAME_LANCE(bp, ca)) bp->dev = &sc->sc_dev; break; -#endif /* SUN4C || SUN4M */ +#endif /* SUN4C || SUN4D || SUN4E || SUN4M */ default: if (bp != NULL && strcmp(bp->name, le_cd.cd_name) == 0 && @@ -581,7 +581,7 @@ leattach(parent, self, aux) sc->sc_hwreset = lehwreset; ifmedia_init(&sc->sc_ifmedia, 0, lemediachange, lemediastatus); -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) if (lebufchild) { ifmedia_add(&sc->sc_ifmedia, IFM_ETHER | IFM_10_T, 0, NULL); ifmedia_set(&sc->sc_ifmedia, IFM_ETHER | IFM_10_T); diff --git a/sys/arch/sparc/dev/lebuffer.c b/sys/arch/sparc/dev/lebuffer.c index bed9669017a..65c16196158 100644 --- a/sys/arch/sparc/dev/lebuffer.c +++ b/sys/arch/sparc/dev/lebuffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lebuffer.c,v 1.8 2010/06/26 23:24:44 guenther Exp $ */ +/* $OpenBSD: lebuffer.c,v 1.9 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: lebuffer.c,v 1.3 1997/05/24 20:16:28 pk Exp $ */ /* @@ -102,7 +102,7 @@ lebufattach(parent, self, aux) struct device *parent, *self; void *aux; { -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) register struct confargs *ca = aux; struct lebuf_softc *sc = (void *)self; int node; @@ -157,5 +157,5 @@ lebufattach(parent, self, aux) oca.ca_bustype = BUS_SBUS; (void) config_found(&sc->sc_dev, (void *)&oca, lebufprint); } -#endif /* SUN4C || SUN4M */ +#endif /* SUN4C || SUN4D || SUN4E || SUN4M */ } diff --git a/sys/arch/sparc/dev/led.c b/sys/arch/sparc/dev/led.c index 209d5e587c2..e8fdc26f66c 100644 --- a/sys/arch/sparc/dev/led.c +++ b/sys/arch/sparc/dev/led.c @@ -1,4 +1,4 @@ -/* $OpenBSD: led.c,v 1.12 2006/08/01 18:09:40 deraadt Exp $ */ +/* $OpenBSD: led.c,v 1.13 2010/07/10 19:32:24 miod Exp $ */ /* * Copyright (c) 1998 Jason L. Wright (jason@thought.net) @@ -27,7 +27,7 @@ */ /* - * Driver for leds on the 4/100, 4/200, 4/300, and 4/600. (sun4 & sun4m) + * Driver for leds on the sun4, sun4e, and 4/600 (sun4m) systems. */ #include <sys/param.h> @@ -42,8 +42,10 @@ #include <machine/autoconf.h> #include <machine/ctlreg.h> +#include <machine/vmparam.h> #include <sparc/sparc/asm.h> #include <sparc/cpu.h> +#include <sparc/sparc/auxioreg.h> #include <sparc/sparc/cpuvar.h> #include <sparc/dev/led.h> @@ -72,10 +74,10 @@ ledmatch(parent, vcf, aux) struct device *parent; void *vcf, *aux; { -#if defined(SUN4) +#if defined(SUN4) || defined(SUN4E) struct cfdata *cf = vcf; #endif -#if defined(SUN4) || defined(SUN4M) +#if defined(SUN4) || defined(SUN4E) || defined(SUN4M) struct confargs *ca = aux; register struct romaux *ra = &ca->ca_ra; @@ -87,16 +89,16 @@ ledmatch(parent, vcf, aux) } #endif /* SUN4M */ -#if defined(SUN4) +#if defined(SUN4) || defined(SUN4E) if (ca->ca_bustype == BUS_MAIN) { if (strcmp(cf->cf_driver->cd_name, ra->ra_name)) return (0); - if (CPU_ISSUN4) + if (CPU_ISSUN4OR4E) return (1); return (0); } -#endif /* SUN4 */ -#endif /* SUN4 || SUN4M */ +#endif /* SUN4 || SUN4E*/ +#endif /* SUN4 || SUN4E || SUN4M */ return (0); } @@ -139,21 +141,26 @@ led_cycle(v) if (sparc_led_blink == 0) sc->sc_index = 0; + s = splhigh(); + switch (cputyp) { + default: #if defined(SUN4M) - if (CPU_ISSUN4M) { - s = splhigh(); + case CPU_SUN4M: (*sc->sc_reg) = led_pattern[sc->sc_index] | 0xff00; - splx(s); - } + break; +#endif +#if defined(SUN4E) + case CPU_SUN4E: + *(volatile u_char *)(AUXREG_VA) = led_pattern[sc->sc_index]; + break; #endif - #if defined(SUN4) - if (CPU_ISSUN4) { - s = splhigh(); + case CPU_SUN4: stba(AC_DIAG_REG, ASI_CONTROL, led_pattern[sc->sc_index]); - splx(s); - } + break; #endif + } + splx(s); if (sparc_led_blink != 0) { s = (((averunnable.ldavg[0] + FSCALE) * hz) >> (FSHIFT + 3)); diff --git a/sys/arch/sparc/dev/sbus.c b/sys/arch/sparc/dev/sbus.c index 0357403db49..d177c8f45b7 100644 --- a/sys/arch/sparc/dev/sbus.c +++ b/sys/arch/sparc/dev/sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbus.c,v 1.16 2007/05/29 09:54:13 sobrado Exp $ */ +/* $OpenBSD: sbus.c,v 1.17 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: sbus.c,v 1.17 1997/06/01 22:10:39 pk Exp $ */ /* @@ -159,7 +159,10 @@ sbus_attach(parent, self, aux) * IS THIS THE CORRECT DEFAULT?? */ node = ra->ra_node; - sc->sc_clockfreq = getpropint(node, "clock-frequency", 25*1000*1000); + sc->sc_clockfreq = getpropint(node, "clock-frequency", -1); + if (sc->sc_clockfreq <= 0) + sc->sc_clockfreq = getpropint(findroot(), "clock-frequency", + 25 * 1000 * 1000); printf(": clock = %s MHz\n", clockfreq(sc->sc_clockfreq)); /* @@ -199,6 +202,10 @@ sbus_attach(parent, self, aux) */ for (node = firstchild(node); node; node = nextsibling(node)) { name = getpropstring(node, "name"); +#ifdef SUN4E + if (CPU_ISSUN4E && strcmp(name, "vm") == 0) + continue; +#endif if (!romprop(&oca.ca_ra, name, node)) continue; @@ -224,7 +231,7 @@ sbus_translate(dev, ca) ca->ca_slot = SBUS_ABS_TO_SLOT(base); ca->ca_offset = SBUS_ABS_TO_OFFSET(base); } else { - if (!CPU_ISSUN4C) + if (!CPU_ISSUN4C && !CPU_ISSUN4E) panic("relative sbus addressing not supported"); ca->ca_slot = slot = ca->ca_ra.ra_iospace; ca->ca_offset = base; diff --git a/sys/arch/sparc/dev/sbusreg.h b/sys/arch/sparc/dev/sbusreg.h index f6449311a5e..96d858d06d5 100644 --- a/sys/arch/sparc/dev/sbusreg.h +++ b/sys/arch/sparc/dev/sbusreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sbusreg.h,v 1.5 2007/05/29 09:54:15 sobrado Exp $ */ +/* $OpenBSD: sbusreg.h,v 1.6 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: sbusreg.h,v 1.3 1997/09/14 19:17:25 pk Exp $ */ /* @@ -51,11 +51,13 @@ * in `absolute' and `relative' address flavors, so we have to handle both. * Relative addresses do *not* include the slot number. */ -#define SBUS_BASE 0xf8000000 -#define SBUS_ADDR(slot, off) (SBUS_BASE + ((slot) << 25) + (off)) +#define SBUS_PAGE_SHIFT (13 + PAGE_SHIFT) +#define SBUS_BASE (0 - (4 << SBUS_PAGE_SHIFT)) +#define SBUS_PAGE_MASK ((1 << SBUS_PAGE_SHIFT) - 1) +#define SBUS_ADDR(slot, off) (SBUS_BASE + ((slot) << SBUS_PAGE_SHIFT) + (off)) #define SBUS_ABS(a) ((unsigned)(a) >= SBUS_BASE) -#define SBUS_ABS_TO_SLOT(a) (((a) - SBUS_BASE) >> 25) -#define SBUS_ABS_TO_OFFSET(a) (((a) - SBUS_BASE) & 0x1ffffff) +#define SBUS_ABS_TO_SLOT(a) (((a) - SBUS_BASE) >> SBUS_PAGE_SHIFT) +#define SBUS_ABS_TO_OFFSET(a) (((a) - SBUS_BASE) & SBUS_PAGE_MASK) struct sbusreg { u_int32_t sbus_afsr; /* M-to-S Asynchronous Fault Status */ diff --git a/sys/arch/sparc/dev/z8530kbd.c b/sys/arch/sparc/dev/z8530kbd.c index cad933dd4f1..08dd87c5405 100644 --- a/sys/arch/sparc/dev/z8530kbd.c +++ b/sys/arch/sparc/dev/z8530kbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: z8530kbd.c,v 1.13 2009/01/12 21:11:56 miod Exp $ */ +/* $OpenBSD: z8530kbd.c,v 1.14 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */ /*- @@ -387,7 +387,7 @@ zskbd_attach(parent, self, aux) } ss->sc_click = 0; -#if defined(SUN4C) || defined(SUN4M) +#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) if (!CPU_ISSUN4) { char *cp = getpropstring(optionsnode, "keyboard-click?"); diff --git a/sys/arch/sparc/dev/zs.c b/sys/arch/sparc/dev/zs.c index d3751bc31a3..10b9452daa8 100644 --- a/sys/arch/sparc/dev/zs.c +++ b/sys/arch/sparc/dev/zs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs.c,v 1.47 2009/04/10 20:53:51 miod Exp $ */ +/* $OpenBSD: zs.c,v 1.48 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: zs.c,v 1.50 1997/10/18 00:00:40 gwr Exp $ */ /*- @@ -96,11 +96,11 @@ int zs_major = 12; */ #define PCLK (9600 * 512) /* PCLK pin input clock rate */ -#define ZS_DELAY() (CPU_ISSUN4C ? (0) : delay(2)) +#define ZS_DELAY() ((CPU_ISSUN4C || CPU_ISSUN4E) ? (0) : delay(2)) /* The layout of this is hardware-dependent (padding, order). */ struct zschan { -#if defined(SUN4) || defined(SUN4C) || defined(SUN4M) +#if defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) volatile u_char zc_csr; /* ctrl,status, and indirect access */ u_char zc_xxx0; volatile u_char zc_data; /* data */ @@ -226,7 +226,7 @@ zs_match(parent, vcf, aux) return (ca->ca_bustype == BUS_OBIO); #endif - if ((ca->ca_bustype == BUS_MAIN && !CPU_ISSUN4) || + if ((ca->ca_bustype == BUS_MAIN && (CPU_ISSUN4C || CPU_ISSUN4E)) || (ca->ca_bustype == BUS_OBIO && CPU_ISSUN4M)) return (getpropint(ra->ra_node, "slave", -2) == cf->cf_unit); ra->ra_len = NBPG; @@ -828,7 +828,7 @@ zscnpollc(dev, on) /*****************************************************************/ -#if defined(SUN4) || defined(SUN4C) || defined(SUN4M) +#if defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) cons_decl(prom); @@ -934,7 +934,7 @@ promcnputc(dev, c) splx(s); } -#endif /* SUN4 || SUN4C || SUN4M */ +#endif /* SUN4 || SUN4C || SUN4D || SUN4E || SUN4M */ /*****************************************************************/ @@ -960,7 +960,7 @@ consinit() int channel, zs_unit; int inSource, outSink; -#if defined(SUN4) || defined(SUN4C) || defined(SUN4M) +#if defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) if (promvec->pv_romvec_vers > 2) { /* We need to probe the PROM device tree */ int node,fd; @@ -1068,7 +1068,7 @@ setup_output: inSource = *promvec->pv_stdin; outSink = *promvec->pv_stdout; } -#endif /* SUN4 || SUN4C || SUN4M */ +#endif /* SUN4 || SUN4C || SUN4D || SUN4E || SUN4M */ #ifdef solbourne if (CPU_ISKAP) { const char *dev; @@ -1093,7 +1093,7 @@ setup_output: } #endif -#if defined(SUN4) || defined(SUN4C) || defined(SUN4M) +#if defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M) setup_console: #endif diff --git a/sys/arch/sparc/dev/zs_kgdb.c b/sys/arch/sparc/dev/zs_kgdb.c index 2d14aafc542..6dc0e40183c 100644 --- a/sys/arch/sparc/dev/zs_kgdb.c +++ b/sys/arch/sparc/dev/zs_kgdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs_kgdb.c,v 1.3 2008/06/26 05:42:13 ray Exp $ */ +/* $OpenBSD: zs_kgdb.c,v 1.4 2010/07/10 19:32:24 miod Exp $ */ /* $NetBSD: zs_kgdb.c,v 1.1 1997/10/18 00:00:51 gwr Exp $ */ /*- @@ -59,7 +59,7 @@ #define PCLK (9600 * 512) /* PCLK pin input clock rate */ #define ZSHARD_PRI 6 /* Wired on the CPU board... */ -#define ZS_DELAY() (CPU_ISSUN4C ? (0) : delay(2)) +#define ZS_DELAY() ((CPU_ISSUN4C || CPU_ISSUN4E) ? (0) : delay(2)) /* The layout of this is hardware-dependent (padding, order). */ struct zschan { |