Module Name:    src
Committed By:   martin
Date:           Tue Apr 21 16:58:57 UTC 2020

Modified Files:
        src/sys/arch/macppc/stand/ofwboot [netbsd-8]: Locore.c
        src/sys/arch/powerpc/oea [netbsd-8]: ofw_consinit.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #1533):

        sys/arch/macppc/stand/ofwboot/Locore.c: revision 1.34 (via patch)
        sys/arch/powerpc/oea/ofw_consinit.c: revision 1.18

When boot up with auto-boot? == true, some systems do not provide stdout
if the normal output is screen.

Open screen explicitly as stdout in this case, both for ofwboot and kernel,
which fixes problems with auto-boot? == true for Mac mini G4:
- messages from ofwboot do not appear
- kernel freeze during early boot stage

Taken from OpenBSD:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/macppc/macppc/ofw_machdep.c#rev1.3
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/macppc/stand/Locore.c#rev1.3

XXX
pullup to netbsd-9 and -8


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.29.10.1 src/sys/arch/macppc/stand/ofwboot/Locore.c
cvs rdiff -u -r1.17 -r1.17.10.1 src/sys/arch/powerpc/oea/ofw_consinit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/macppc/stand/ofwboot/Locore.c
diff -u src/sys/arch/macppc/stand/ofwboot/Locore.c:1.29 src/sys/arch/macppc/stand/ofwboot/Locore.c:1.29.10.1
--- src/sys/arch/macppc/stand/ofwboot/Locore.c:1.29	Fri Apr 22 18:25:41 2016
+++ src/sys/arch/macppc/stand/ofwboot/Locore.c	Tue Apr 21 16:58:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: Locore.c,v 1.29 2016/04/22 18:25:41 christos Exp $	*/
+/*	$NetBSD: Locore.c,v 1.29.10.1 2020/04/21 16:58:56 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -621,6 +621,11 @@ setup(void)
 	    OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) !=
 	    sizeof(stdout))
 		OF_exit();
+
+	if (stdout == 0) {
+		/* screen should be console, but it is not open */
+		stdout = OF_open("screen");
+	}
 }
 
 void

Index: src/sys/arch/powerpc/oea/ofw_consinit.c
diff -u src/sys/arch/powerpc/oea/ofw_consinit.c:1.17 src/sys/arch/powerpc/oea/ofw_consinit.c:1.17.10.1
--- src/sys/arch/powerpc/oea/ofw_consinit.c:1.17	Sun Feb 14 18:12:30 2016
+++ src/sys/arch/powerpc/oea/ofw_consinit.c	Tue Apr 21 16:58:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_consinit.c,v 1.17 2016/02/14 18:12:30 dholland Exp $ */
+/* $NetBSD: ofw_consinit.c,v 1.17.10.1 2020/04/21 16:58:57 martin Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.17 2016/02/14 18:12:30 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.17.10.1 2020/04/21 16:58:57 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -458,6 +458,10 @@ ofwoea_bootstrap_console(void)
 	if (OF_getprop(chosen, "stdin", &stdin,
 	    sizeof(stdin)) != sizeof(stdin))
 		goto nocons;
+	if (stdout == 0) {
+		 /* screen should be console, but it is not open */
+		 stdout = OF_open("screen");
+	}
 	node = OF_instance_to_package(stdout);
 	console_node = node;
 	console_instance = stdout;

Reply via email to