diff options
author | Henric Jungheim <henric@cvs.openbsd.org> | 2003-05-18 15:32:11 +0000 |
---|---|---|
committer | Henric Jungheim <henric@cvs.openbsd.org> | 2003-05-18 15:32:11 +0000 |
commit | 2445b5bb89a257c9aec8e304a44845476b289008 (patch) | |
tree | 6ccb2cc92535a5d7d9db7fff052156f571178742 | |
parent | 65e3b1f91d4b31944e8579d38ccab9f7456a07ce (diff) |
The attach routine works better when it doesn't try to write to a
write-protected page.
ok jason@
-rw-r--r-- | sys/arch/sparc64/sparc64/clock.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/arch/sparc64/sparc64/clock.c b/sys/arch/sparc64/sparc64/clock.c index a63440229bd..9ba4fe2f29b 100644 --- a/sys/arch/sparc64/sparc64/clock.c +++ b/sys/arch/sparc64/sparc64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.17 2003/02/28 21:30:30 jason Exp $ */ +/* $OpenBSD: clock.c,v 1.18 2003/05/18 15:32:10 henric Exp $ */ /* $NetBSD: clock.c,v 1.41 2001/07/24 19:29:25 eeh Exp $ */ /* @@ -481,13 +481,6 @@ clockattach_rtc(parent, self, aux) #endif printf(": %s\n", model); - /* - * Turn interrupts off, just in case. (Although they shouldn't - * be wired to an interrupt controller on sparcs). - */ - rtc_write_reg(bt, cwi.cwi_bh, - MC_REGB, MC_REGB_BINARY | MC_REGB_24HR); - /* Setup our todr_handle */ sz = ALIGN(sizeof(struct todr_chip_handle)) + sizeof(struct rtc_info); handle = malloc(sz, M_DEVBUF, M_NOWAIT); @@ -510,6 +503,16 @@ clockattach_rtc(parent, self, aux) handle->todr_setwen = (ea->ea_memtag == bt) ? clock_bus_wenable : NULL; todr_handle = handle; + + /* + * Turn interrupts off, just in case. (Although they shouldn't + * be wired to an interrupt controller on sparcs). + */ + todr_wenable(handle, 1); + rtc_write_reg(bt, cwi.cwi_bh, + MC_REGB, MC_REGB_BINARY | MC_REGB_24HR); + todr_wenable(handle, 0); + } /* |