Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/oea defer scribbling into video memory unti...



details:   https://anonhg.NetBSD.org/src/rev/23e41a77c228
branches:  trunk
changeset: 320835:23e41a77c228
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Mar 02 14:37:18 2018 +0000

description:
defer scribbling into video memory until after re-enabling the MMU if
we're in bridge mode.
With this NetBSD boots on PCI-X G5s

diffstat:

 sys/arch/powerpc/oea/ofw_rascons.c    |  29 +++++++++++++++++++++++------
 sys/arch/powerpc/oea/ofw_rasconsvar.h |   3 ++-
 sys/arch/powerpc/oea/ofwoea_machdep.c |  10 ++++++----
 3 files changed, 31 insertions(+), 11 deletions(-)

diffs (125 lines):

diff -r fde10ea33724 -r 23e41a77c228 sys/arch/powerpc/oea/ofw_rascons.c
--- a/sys/arch/powerpc/oea/ofw_rascons.c        Fri Mar 02 13:26:40 2018 +0000
+++ b/sys/arch/powerpc/oea/ofw_rascons.c        Fri Mar 02 14:37:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_rascons.c,v 1.10 2018/02/23 02:54:56 sevan Exp $   */
+/*     $NetBSD: ofw_rascons.c,v 1.11 2018/03/02 14:37:18 macallan Exp $        */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_rascons.c,v 1.10 2018/02/23 02:54:56 sevan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_rascons.c,v 1.11 2018/03/02 14:37:18 macallan Exp $");
 
 #include "wsdisplay.h"
 
@@ -53,6 +53,7 @@
 #include <dev/wsfont/wsfont.h>
 
 #include <powerpc/oea/bat.h>
+#include <powerpc/oea/cpufeat.h>
 #include <powerpc/oea/ofw_rasconsvar.h>
 
 /* we need a wsdisplay to do anything halfway useful */
@@ -62,6 +63,7 @@
 static struct wsdisplay_font openfirm6x11;
 static vaddr_t fbaddr;
 static int romfont_loaded = 0;
+static int needs_finalize = 0;
 
 struct vcons_screen rascons_console_screen;
 
@@ -115,10 +117,13 @@
        rascons_stdscreen.textops = &ri->ri_ops;
        rascons_stdscreen.capabilities = ri->ri_caps;
 
-       ri->ri_ops.allocattr(ri, 0, 0, 0, &defattr);
-       wsdisplay_preattach(&rascons_stdscreen, ri, 0, max(0,
-           min(crow, ri->ri_rows - 1)), defattr);
-
+       if ((oeacpufeat & OEACPU_64_BRIDGE) != 0) {
+               needs_finalize = 1;
+       } else {
+               ri->ri_ops.allocattr(ri, 0, 0, 0, &defattr);
+               wsdisplay_preattach(&rascons_stdscreen, ri, 0, max(0,
+                   min(crow, ri->ri_rows - 1)), defattr);
+       }
 #if notyet
        rascons_init_cmap(NULL);
 #endif
@@ -126,6 +131,18 @@
        return 0;
 }
 
+void
+rascons_finalize(void)
+{
+       struct rasops_info *ri = &rascons_console_screen.scr_ri;
+       long defattr;
+
+       if (needs_finalize == 0) return;
+       
+       ri->ri_ops.allocattr(ri, 0, 0, 0, &defattr);
+       wsdisplay_preattach(&rascons_stdscreen, ri, 0, 0, defattr);
+}
+
 static int
 copy_rom_font(void)
 {
diff -r fde10ea33724 -r 23e41a77c228 sys/arch/powerpc/oea/ofw_rasconsvar.h
--- a/sys/arch/powerpc/oea/ofw_rasconsvar.h     Fri Mar 02 13:26:40 2018 +0000
+++ b/sys/arch/powerpc/oea/ofw_rasconsvar.h     Fri Mar 02 14:37:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_rasconsvar.h,v 1.1 2007/11/26 19:58:31 garbled Exp $       */
+/*     $NetBSD: ofw_rasconsvar.h,v 1.2 2018/03/02 14:37:18 macallan Exp $      */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -33,5 +33,6 @@
 extern struct vcons_screen rascons_console_screen;
 extern struct wsscreen_descr rascons_stdscreen;
 int rascons_init_rasops(int, struct rasops_info *);
+void rascons_finalize(void);
 
 #endif /* _OFW_RASCONSVAR_H_ */
diff -r fde10ea33724 -r 23e41a77c228 sys/arch/powerpc/oea/ofwoea_machdep.c
--- a/sys/arch/powerpc/oea/ofwoea_machdep.c     Fri Mar 02 13:26:40 2018 +0000
+++ b/sys/arch/powerpc/oea/ofwoea_machdep.c     Fri Mar 02 14:37:18 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofwoea_machdep.c,v 1.42 2018/01/21 08:46:48 mrg Exp $ */
+/* $NetBSD: ofwoea_machdep.c,v 1.43 2018/03/02 14:37:18 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.42 2018/01/21 08:46:48 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.43 2018/03/02 14:37:18 macallan Exp $");
 
 #include "opt_ppcarch.h"
 #include "opt_compat_netbsd.h"
@@ -180,8 +180,8 @@
                model_init();
        }
 
-       if (strcmp(model_name, "PowerMac11,2") == 0 ||
-           strcmp(model_name, "PowerMac11,1") == 0)
+       if (strncmp(model_name, "PowerMac11,", 11) == 0 ||
+           strncmp(model_name, "PowerMac7,", 10) == 0) 
                OF_quiesce();
 
        /* Initialize bus_space */
@@ -293,6 +293,8 @@
 
        restore_ofmap(ofmap, ofmaplen);
 
+       rascons_finalize();
+
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        ksyms_addsyms_elf((int)((uintptr_t)endsym - (uintptr_t)startsym), startsym, endsym);
 #endif



Home | Main Index | Thread Index | Old Index