Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ofw attach display devices first so we see more kern...
details: https://anonhg.NetBSD.org/src/rev/7692834a5bef
branches: trunk
changeset: 822254:7692834a5bef
user: macallan <macallan%NetBSD.org@localhost>
date: Fri Mar 10 00:26:43 2017 +0000
description:
attach display devices first so we see more kernel output on shark
diffstat:
sys/dev/ofw/ofbus.c | 38 +++++++++++++++++++++++++++++++++++---
1 files changed, 35 insertions(+), 3 deletions(-)
diffs (74 lines):
diff -r 677e2146e585 -r 7692834a5bef sys/dev/ofw/ofbus.c
--- a/sys/dev/ofw/ofbus.c Fri Mar 10 00:22:01 2017 +0000
+++ b/sys/dev/ofw/ofbus.c Fri Mar 10 00:26:43 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofbus.c,v 1.25 2011/06/03 07:39:30 matt Exp $ */
+/* $NetBSD: ofbus.c,v 1.26 2017/03/10 00:26:43 macallan Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofbus.c,v 1.25 2011/06/03 07:39:30 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofbus.c,v 1.26 2017/03/10 00:26:43 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -76,7 +76,7 @@
{
struct ofbus_attach_args *oba = aux;
struct ofbus_attach_args oba2;
- char name[64];
+ char name[64], type[64];
int child, units;
printf("\n");
@@ -95,9 +95,15 @@
units = 2;
}
+ /* attach displays first */
for (child = OF_child(oba->oba_phandle); child != 0;
child = OF_peer(child)) {
oba2.oba_busname = "ofw";
+ type[0] = 0;
+ if (OF_getprop(child, "device_type", type, sizeof(type)) <= 0)
+ continue;
+ if (strncmp(type, "display", sizeof(type)) != 0)
+ continue;
of_packagename(child, name, sizeof name);
oba2.oba_phandle = child;
for (oba2.oba_unit = 0; oba2.oba_unit < units;
@@ -113,4 +119,30 @@
config_found(dev, &oba2, ofbus_print);
}
}
+
+ /* now the rest */
+ for (child = OF_child(oba->oba_phandle); child != 0;
+ child = OF_peer(child)) {
+ oba2.oba_busname = "ofw";
+ type[0] = 0;
+ if (OF_getprop(child, "device_type", type, sizeof(type)) > 0) {
+ if (strncmp(type, "display", sizeof(type)) == 0)
+ continue;
+ }
+ of_packagename(child, name, sizeof name);
+ oba2.oba_phandle = child;
+ for (oba2.oba_unit = 0; oba2.oba_unit < units;
+ oba2.oba_unit++) {
+ if (units > 1) {
+ snprintf(oba2.oba_ofname,
+ sizeof(oba2.oba_ofname), "%s@%d", name,
+ oba2.oba_unit);
+ } else {
+ strlcpy(oba2.oba_ofname, name,
+ sizeof(oba2.oba_ofname));
+ }
+ config_found(dev, &oba2, ofbus_print);
+ }
+ }
+
}
Home |
Main Index |
Thread Index |
Old Index