summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-10-30 13:11:11 +0000
committerkettenis <kettenis@openbsd.org>2020-10-30 13:11:11 +0000
commite6f8608cd5901b2fb72d4bb5eaa5c3e0af5fa11a (patch)
treef6aad0b02f971523164e419fe9ef15b6964f3383
parentAdd code to determine the console devie node. (diff)
downloadwireguard-openbsd-e6f8608cd5901b2fb72d4bb5eaa5c3e0af5fa11a.tar.xz
wireguard-openbsd-e6f8608cd5901b2fb72d4bb5eaa5c3e0af5fa11a.zip
Allow astfb(4) to become the console. At this point this is a "late" switch
and early kernel boot messages will appear on opalcons(4) until astfb(4) attaches.
-rw-r--r--sys/arch/powerpc64/dev/astfb.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/arch/powerpc64/dev/astfb.c b/sys/arch/powerpc64/dev/astfb.c
index 32a9d3d0fc1..98846ab2548 100644
--- a/sys/arch/powerpc64/dev/astfb.c
+++ b/sys/arch/powerpc64/dev/astfb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: astfb.c,v 1.1 2020/10/01 17:28:14 kettenis Exp $ */
+/* $OpenBSD: astfb.c,v 1.2 2020/10/30 13:11:11 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis.
@@ -21,6 +21,7 @@
#include <sys/systm.h>
#include <machine/bus.h>
+#include <machine/fdt.h>
#include <dev/ofw/openfirm.h>
@@ -99,6 +100,8 @@ astfb_attach(struct device *parent, struct device *self, void *aux)
struct wsemuldisplaydev_attach_args waa;
int node = PCITAG_NODE(pa->pa_tag);
uint32_t addr[5];
+ int console = 0;
+ uint32_t defattr;
if (OF_getpropintarray(node, "assigned-addresses", addr,
sizeof(addr)) < sizeof(addr)) {
@@ -106,6 +109,9 @@ astfb_attach(struct device *parent, struct device *self, void *aux)
return;
}
+ if (node == stdout_node)
+ console = 1;
+
sc->sc_fbaddr = (bus_addr_t)addr[1] << 32 | addr[2];
sc->sc_fbsize = (bus_size_t)addr[3] << 32 | addr[4];
@@ -118,6 +124,9 @@ astfb_attach(struct device *parent, struct device *self, void *aux)
printf("\n");
+ if (console)
+ printf("%s: console\n", sc->sc_dev.dv_xname);
+
ri->ri_bits = bus_space_vaddr(sc->sc_iot, sc->sc_ioh);
ri->ri_hw = sc;
@@ -164,11 +173,17 @@ astfb_attach(struct device *parent, struct device *self, void *aux)
sc->sc_wsl.nscreens = 1;
sc->sc_wsl.screens = (const struct wsscreen_descr **)sc->sc_scrlist;
+ if (console) {
+ ri->ri_ops.pack_attr(ri->ri_active, 0, 0, 0, &defattr);
+ wsdisplay_cnattach(&sc->sc_wsd, ri->ri_active,
+ 0, 0, defattr);
+ }
+
memset(&waa, 0, sizeof(waa));
waa.scrdata = &sc->sc_wsl;
waa.accessops = &astfb_accessops;
waa.accesscookie = ri;
- waa.console = 0;
+ waa.console = console;
config_found_sm(self, &waa, wsemuldisplaydevprint,
wsemuldisplaydevsubmatch);