summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2020-04-21 16:54:51 +0000
committermartin <martin@NetBSD.org>2020-04-21 16:54:51 +0000
commit487a94f7da554ba4717883efac416db1e2ab2cb1 (patch)
tree4e96891a816f1a4f160b0d0e5d02f40af6bb6b54 /sys
parenta076c60656b1a549a5446635c6efc6f5273ee353 (diff)
Pull up following revision(s) (requested by rin in ticket #837):
sys/arch/macppc/stand/ofwboot/Locore.c: revision 1.34 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
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/macppc/stand/ofwboot/Locore.c7
-rw-r--r--sys/arch/powerpc/oea/ofw_consinit.c8
2 files changed, 12 insertions, 3 deletions
diff --git a/sys/arch/macppc/stand/ofwboot/Locore.c b/sys/arch/macppc/stand/ofwboot/Locore.c
index 4b1536a4bf5..4a7f3f5e677 100644
--- a/sys/arch/macppc/stand/ofwboot/Locore.c
+++ b/sys/arch/macppc/stand/ofwboot/Locore.c
@@ -1,4 +1,4 @@
-/* $NetBSD: Locore.c,v 1.33 2018/11/12 20:00:46 scole Exp $ */
+/* $NetBSD: Locore.c,v 1.33.4.1 2020/04/21 16:54:51 martin Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -680,6 +680,11 @@ setup(void)
sizeof(stdout))
OF_exit();
+ if (stdout == 0) {
+ /* screen should be console, but it is not open */
+ stdout = OF_open("screen");
+ }
+
#ifdef HEAP_VARIABLE
uint32_t pvr, vers, hsize = HEAP_SIZE;
diff --git a/sys/arch/powerpc/oea/ofw_consinit.c b/sys/arch/powerpc/oea/ofw_consinit.c
index 6a199e22df4..9fffe365ef9 100644
--- a/sys/arch/powerpc/oea/ofw_consinit.c
+++ b/sys/arch/powerpc/oea/ofw_consinit.c
@@ -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.22.1 2020/04/21 16:54:52 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.22.1 2020/04/21 16:54:52 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;