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/led.c | |
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/led.c')
-rw-r--r-- | sys/arch/sparc/dev/led.c | 41 |
1 files changed, 24 insertions, 17 deletions
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)); |