summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ofw/ofw_console.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c
index cce7fb8..aebc109 100644
--- a/sys/dev/ofw/ofw_console.c
+++ b/sys/dev/ofw/ofw_console.c
@@ -85,11 +85,20 @@ CONS_DRIVER(ofw, ofw_cons_probe, ofw_cons_init, NULL, ofw_cons_getc,
static void
cn_drvinit(void *unused)
{
-
- make_dev(&ofw_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "ofwcons");
+ phandle_t options;
+ char output[32];
+
+ if (ofw_consdev.cn_dev != NULL) {
+ if ((options = OF_finddevice("/options")) == -1 ||
+ OF_getprop(options, "output-device", output,
+ sizeof(output)) == -1)
+ return;
+ make_dev(&ofw_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "ofwcons");
+ make_dev_alias(ofw_consdev.cn_dev, "%s", output);
+ }
}
-SYSINIT(cndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cn_drvinit,NULL)
+SYSINIT(cndev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE + CDEV_MAJOR, cn_drvinit, NULL)
static int stdin;
static int stdout;
@@ -260,16 +269,16 @@ ofw_cons_probe(struct consdev *cp)
return;
}
- cp->cn_dev = makedev(CDEV_MAJOR, 0);
+ cp->cn_dev = NULL;
cp->cn_pri = CN_INTERNAL;
- cp->cn_tp = ofw_tp;
}
static void
ofw_cons_init(struct consdev *cp)
{
- return;
+ cp->cn_dev = makedev(CDEV_MAJOR, 0);
+ cp->cn_tp = ofw_tp;
}
static int
OpenPOWER on IntegriCloud