summaryrefslogtreecommitdiff
path: root/sys/arch/socppc/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-09-02 20:29:40 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-09-02 20:29:40 +0000
commit9a9c6a0e31cb1dd4854cbdf003ccb1df66262c9d (patch)
tree464f6edaecf4b4611275208289ca610e0c4e9a6d /sys/arch/socppc/dev
parent7180b922aa0c73edb7ed27f42c3510d0cc8db325 (diff)
Attach devices to mainbus(4) based on information from the flattened device
tree.
Diffstat (limited to 'sys/arch/socppc/dev')
-rw-r--r--sys/arch/socppc/dev/obio.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/arch/socppc/dev/obio.c b/sys/arch/socppc/dev/obio.c
index 1081e854ce0..78f0820e21c 100644
--- a/sys/arch/socppc/dev/obio.c
+++ b/sys/arch/socppc/dev/obio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: obio.c,v 1.3 2008/05/25 16:23:58 kettenis Exp $ */
+/* $OpenBSD: obio.c,v 1.4 2009/09/02 20:29:39 kettenis Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
@@ -22,6 +22,8 @@
#include <machine/autoconf.h>
+#include <dev/ofw/openfirm.h>
+
int obio_match(struct device *, void *, void *);
void obio_attach(struct device *, struct device *, void *);
@@ -39,7 +41,16 @@ int obio_print(void *, const char *);
int
obio_match(struct device *parent, void *cfdata, void *aux)
{
- return (1);
+ struct mainbus_attach_args *ma = aux;
+ char buf[32];
+
+ if (OF_getprop(ma->ma_node, "device_type", buf, sizeof(buf)) <= 0)
+ return (0);
+
+ if (strcmp(buf, "soc") == 0)
+ return (1);
+
+ return (0);
}
void