Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/shark/ofw Call OF to bring up the CyberPro if it's ...



details:   https://anonhg.NetBSD.org/src/rev/f612257118c0
branches:  trunk
changeset: 350802:f612257118c0
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Jan 22 17:27:31 2017 +0000

description:
Call OF to bring up the CyberPro if it's not the console.

Avoids igsfb crash later with serial console due to
inaccessible hardware.

diffstat:

 sys/arch/shark/ofw/igsfb_ofbus.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 5763db5acd26 -r f612257118c0 sys/arch/shark/ofw/igsfb_ofbus.c
--- a/sys/arch/shark/ofw/igsfb_ofbus.c  Sun Jan 22 17:19:32 2017 +0000
+++ b/sys/arch/shark/ofw/igsfb_ofbus.c  Sun Jan 22 17:27:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: igsfb_ofbus.c,v 1.16 2015/06/30 03:52:54 macallan Exp $ */
+/*     $NetBSD: igsfb_ofbus.c,v 1.17 2017/01/22 17:27:31 jakllsch Exp $ */
 
 /*
  * Copyright (c) 2006 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.16 2015/06/30 03:52:54 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.17 2017/01/22 17:27:31 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -133,8 +133,17 @@
        stdout_ihandle = of_decode_int((void *)&stdout_ihandle);
        stdout_phandle = OF_instance_to_package(stdout_ihandle);
 
-       if (stdout_phandle != igs_node)
+       if (stdout_phandle != igs_node) {
+               /*
+                * If we aren't the boot console, the CyberPro probably
+                * hasn't been brought up yet.  Bring it up now, it's
+                * still early enough to do so.
+                */
+               const int handle = OF_open("/vlbus/display");
+               if (handle != -1)
+                       OF_close(handle);
                return ENXIO;
+       }
 
        /* ok, now setup and attach the console */
        dc = &igsfb_console_dc;



Home | Main Index | Thread Index | Old Index