summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2017-08-23 12:58:01 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2017-08-23 12:58:01 +0000
commita5986de543f58e3362f525851a8410c91bd86a15 (patch)
treef0a966b544a20f9b67d92994f3ea1b2b7735ce0f /sys/arch
parentebb17b4dc87761f311c4b31f00b7180d3dde3fab (diff)
Add code to attach framebuffers found under /chosen. Taken from armv7.
ok patrick@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm64/dev/mainbus.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/arch/arm64/dev/mainbus.c b/sys/arch/arm64/dev/mainbus.c
index 465bfe85352..780c7ed2aff 100644
--- a/sys/arch/arm64/dev/mainbus.c
+++ b/sys/arch/arm64/dev/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.6 2017/05/02 15:13:20 kettenis Exp $ */
+/* $OpenBSD: mainbus.c,v 1.7 2017/08/23 12:58:00 kettenis Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org>
@@ -37,6 +37,7 @@ int mainbus_match_status(struct device *, void *, void *);
void mainbus_attach_cpus(struct device *, cfmatch_t);
int mainbus_match_primary(struct device *, void *, void *);
int mainbus_match_secondary(struct device *, void *, void *);
+void mainbus_attach_framebuffer(struct device *);
struct mainbus_softc {
struct device sc_dev;
@@ -135,6 +136,8 @@ mainbus_attach(struct device *parent, struct device *self, void *aux)
for (node = OF_child(sc->sc_node); node != 0; node = OF_peer(node))
mainbus_attach_node(self, node, NULL);
+ mainbus_attach_framebuffer(self);
+
/* Attach secondary CPUs. */
mainbus_attach_cpus(self, mainbus_match_secondary);
}
@@ -268,3 +271,15 @@ mainbus_match_secondary(struct device *parent, void *match, void *aux)
return (*cf->cf_attach->ca_match)(parent, match, aux);
}
+
+void
+mainbus_attach_framebuffer(struct device *self)
+{
+ int node = OF_finddevice("/chosen");
+
+ if (node == 0)
+ return;
+
+ for (node = OF_child(node); node != 0; node = OF_peer(node))
+ mainbus_attach_node(self, node, NULL);
+}