diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-06-11 04:44:20 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-06-11 04:44:20 +0000 |
commit | 756bea63ce1503e31fa7dd33982153bc7c867b83 (patch) | |
tree | 37d7af87e092bd5ad03d4c51a2a6fab84b6c7d34 /sys | |
parent | ea0a3f5477f27e6ff2103fcceb0ae5f3921b9951 (diff) |
Use the prom address to map clock(4) at ebus(4) if available.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc64/sparc64/clock.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/arch/sparc64/sparc64/clock.c b/sys/arch/sparc64/sparc64/clock.c index 3117d5e11f2..be2b1904b6d 100644 --- a/sys/arch/sparc64/sparc64/clock.c +++ b/sys/arch/sparc64/sparc64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.42 2008/05/22 21:39:04 kettenis Exp $ */ +/* $OpenBSD: clock.c,v 1.43 2008/06/11 04:44:19 kettenis Exp $ */ /* $NetBSD: clock.c,v 1.41 2001/07/24 19:29:25 eeh Exp $ */ /* @@ -324,7 +324,14 @@ clockattach_ebus(parent, self, aux) /* hard code to 8K? */ sz = ea->ea_regs[0].size; - if (ebus_bus_map(ea->ea_iotag, 0, + if (ea->ea_nvaddrs) { + if (bus_space_map(ea->ea_memtag, ea->ea_vaddrs[0], 0, + BUS_SPACE_MAP_PROMADDRESS, &cwi.cwi_bh) != 0) { + printf("%s: can't map register\n", self->dv_xname); + return; + } + bt = ea->ea_memtag; + } else if (ebus_bus_map(ea->ea_iotag, 0, EBUS_PADDR_FROM_REG(&ea->ea_regs[0]), sz, 0, 0, &cwi.cwi_bh) == 0) { bt = ea->ea_iotag; } else if (ebus_bus_map(ea->ea_memtag, 0, |