summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2006-01-13 21:02:01 +0000
committermiod <miod@openbsd.org>2006-01-13 21:02:01 +0000
commitd3df7ceb9821b082381e99701125a8f61a89723d (patch)
tree36d6d790c2049e36cbcd08e9f295b6b6b2fa4686
parentRemove unused bad{,b,w,l}addr. (diff)
downloadwireguard-openbsd-d3df7ceb9821b082381e99701125a8f61a89723d.tar.xz
wireguard-openbsd-d3df7ceb9821b082381e99701125a8f61a89723d.zip
Sync OSS code with NetBSD; supports poweroff now.
-rw-r--r--sys/arch/mac68k/include/viareg.h7
-rw-r--r--sys/arch/mac68k/mac68k/via.c14
2 files changed, 16 insertions, 5 deletions
diff --git a/sys/arch/mac68k/include/viareg.h b/sys/arch/mac68k/include/viareg.h
index 899e11619e8..960b1597f1b 100644
--- a/sys/arch/mac68k/include/viareg.h
+++ b/sys/arch/mac68k/include/viareg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: viareg.h,v 1.17 2006/01/01 13:16:01 miod Exp $ */
+/* $OpenBSD: viareg.h,v 1.18 2006/01/13 21:02:01 miod Exp $ */
/* $NetBSD: viareg.h,v 1.6 1997/02/28 07:41:41 scottr Exp $ */
/*-
@@ -143,8 +143,9 @@
extern volatile unsigned char *Via1Base;
extern volatile unsigned char *Via2Base; /* init in VIA_Initialize */
#define VIA1_addr Via1Base /* at PA 0x50f00000 */
-#define VIA2OFF 1 /* VIA2 addr = VIA1_addr * 0x2000 */
-#define RBVOFF 0x13 /* RBV addr = VIA1_addr * 0x13000 */
+
+#define VIA2OFF 1 /* VIA2 addr = VIA1_addr + 0x2000 */
+#define RBVOFF 0x13 /* RBV addr = VIA1_addr + 0x26000 */
#define OSSOFF 0xd /* OSS addr = VIA1_addr + 0x1A000 */
#define VIA1 0
diff --git a/sys/arch/mac68k/mac68k/via.c b/sys/arch/mac68k/mac68k/via.c
index 7cb8044a93d..74f702015f7 100644
--- a/sys/arch/mac68k/mac68k/via.c
+++ b/sys/arch/mac68k/mac68k/via.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: via.c,v 1.25 2006/01/13 19:36:47 miod Exp $ */
+/* $OpenBSD: via.c,v 1.26 2006/01/13 21:02:04 miod Exp $ */
/* $NetBSD: via.c,v 1.62 1997/09/10 04:38:48 scottr Exp $ */
/*-
@@ -156,6 +156,9 @@ via_init()
intr_establish(via2_intr, NULL, mac68k_machine.via2_ipl,
"via2");
} else if (current_mac_model->class == MACH_CLASSIIfx) { /* OSS */
+ volatile u_char *ossintr;
+ ossintr = (volatile u_char *)IOBase + 0x1a006;
+ *ossintr = 0;
intr_establish(oss_intr, NULL, mac68k_machine.via2_ipl,
"via2");
} else { /* RBV */
@@ -455,8 +458,15 @@ via_powerdown()
if (VIA2 == VIA2OFF) {
via2_reg(vDirB) |= 0x04; /* Set write for bit 2 */
via2_reg(vBufB) &= ~0x04; /* Shut down */
- } else if (VIA2 == RBVOFF)
+ } else if (VIA2 == RBVOFF) {
via2_reg(rBufB) &= ~0x04;
+ } else if (VIA2 == OSSOFF) {
+ /*
+ * Thanks to Brad Boyer <flar@cegt201.bradley.edu> for the
+ * Linux/mac68k code that I derived this from.
+ */
+ via2_reg(OSS_oRCR) |= OSS_POWEROFF;
+ }
}
void