Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jan 2012 19:37:40 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r230468 - user/ed/newcons/sys/sparc64/sparc64
Message-ID:  <201201221937.q0MJbeVv089803@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sun Jan 22 19:37:40 2012
New Revision: 230468
URL: http://svn.freebsd.org/changeset/base/230468

Log:
  Make vt(4) work on sparc64, at least on systems with CHRP-compliant
  framebuffer devices like the Ultra 5. Because vt(4) depends on mutexes
  and at least one other problematic kernel subsystem I can't identify,
  and these things become available much later on sparc64 that on other
  architectures, it only works if console init is moved much later in the
  boot process. Moving it may not be the best solution here, but does work.
  
  Note than newcons as a whole doesn't quite work on the Ultra 5 yet, at
  least with a regular sun keyboard: the sunkbd driver seems not to attach
  without syscons for reasons that are obscure to me.

Modified:
  user/ed/newcons/sys/sparc64/sparc64/machdep.c

Modified: user/ed/newcons/sys/sparc64/sparc64/machdep.c
==============================================================================
--- user/ed/newcons/sys/sparc64/sparc64/machdep.c	Sun Jan 22 18:29:58 2012	(r230467)
+++ user/ed/newcons/sys/sparc64/sparc64/machdep.c	Sun Jan 22 19:37:40 2012	(r230468)
@@ -436,21 +436,14 @@ sparc64_init(caddr_t mdp, u_long o1, u_l
 	delay_func = delay_boot;
 
 	/*
-	 * Initialize the console before printing anything.
-	 * NB: the low-level console drivers require a working DELAY() at
-	 * this point.
-	 */
-	cninit();
-
-	/*
 	 * Panic if there is no metadata.  Most likely the kernel was booted
 	 * directly, instead of through loader(8).
 	 */
 	if (mdp == NULL || kmdp == NULL || end == 0 ||
 	    kernel_tlb_slots == 0 || kernel_tlbs == NULL) {
-		printf("sparc64_init: missing loader metadata.\n"
+		OF_printf("sparc64_init: missing loader metadata.\n"
 		    "This probably means you are not using loader(8).\n");
-		panic("sparc64_init");
+		OF_exit();
 	}
 
 	/*
@@ -478,11 +471,15 @@ sparc64_init(caddr_t mdp, u_long o1, u_l
 	 * to the t16s.
 	 */
 	if (OF_getprop(pc->pc_node, "#dtlb-entries", &dtlb_slots,
-	    sizeof(dtlb_slots)) == -1)
-		panic("sparc64_init: cannot determine number of dTLB slots");
+	    sizeof(dtlb_slots)) == -1) {
+		OF_printf("sparc64_init: cannot determine number of dTLB slots");
+		OF_exit();
+	}
 	if (OF_getprop(pc->pc_node, "#itlb-entries", &itlb_slots,
-	    sizeof(itlb_slots)) == -1)
-		panic("sparc64_init: cannot determine number of iTLB slots");
+	    sizeof(itlb_slots)) == -1) {
+		OF_printf("sparc64_init: cannot determine number of iTLB slots");
+		OF_exit();
+	}
 
 	/*
 	 * Initialize and enable the caches.  Note that his may include
@@ -590,6 +587,12 @@ sparc64_init(caddr_t mdp, u_long o1, u_l
 	mutex_init();
 
 	/*
+	 * Initialize console now that we have a reasonable set of system
+	 * services.
+	 */
+	cninit();
+
+	/*
 	 * Finish the interrupt initialization now that mutexes work and
 	 * enable them.
 	 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201221937.q0MJbeVv089803>