diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-08-26 17:38:07 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-08-26 17:38:07 +0000 |
commit | 800db41782a1933541d230b06e0144f88ad58d3b (patch) | |
tree | d207f2fdc48959b9568aa61be12d226ae7e99240 /sys/arch | |
parent | 202aa5db1c78622a17a6b0be9a45fb2748247111 (diff) |
Override comconsfreq and comconsaddr with values from the FTD if provided.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/socppc/socppc/machdep.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/arch/socppc/socppc/machdep.c b/sys/arch/socppc/socppc/machdep.c index dc4c103a0f7..80788f106e4 100644 --- a/sys/arch/socppc/socppc/machdep.c +++ b/sys/arch/socppc/socppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.19 2009/08/25 21:18:20 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.20 2009/08/26 17:38:06 kettenis Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -175,6 +175,7 @@ initppc(u_int startkernel, u_int endkernel, char *args) #endif extern void *msgbuf_addr; int exc, scratch; + void *node; extern char __bss_start[], __end[]; bzero(__bss_start, __end - __bss_start); @@ -421,6 +422,24 @@ initppc(u_int startkernel, u_int endkernel, char *args) comconsrate = 115200; comconsaddr = 0x00004500; comconsiot = &mainbus_bus_space; + + node = fdt_find_node("/chosen"); + if (node) { + char *console; + + fdt_node_property(node, "linux,stdout-path", &console); + node = fdt_find_node(console); + if (node) { + char *freq; + char *reg; + + if (fdt_node_property(node, "clock-frequency", &freq)) + comconsfreq = *(u_int32_t *)freq; + if (fdt_node_property(node, "reg", ®)) + comconsaddr = *(u_int32_t *)reg; + } + } + consinit(); #ifdef DDB |