PERFORCE change 151659 for review

Nathan Whitehorn nwhitehorn at FreeBSD.org
Tue Oct 21 14:17:54 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=151659

Change 151659 by nwhitehorn at nwhitehorn_trantor on 2008/10/21 14:16:58

	Make the Mambo serial console do nifty things like actually print when
	it is the console and figure out what baud rate it is running at. This
	should also make the serial console work on Apple G5s.

Affected files ...

.. //depot/projects/ppc-g5/sys/dev/uart/uart_cpu_powerpc.c#3 edit

Differences ...

==== //depot/projects/ppc-g5/sys/dev/uart/uart_cpu_powerpc.c#3 (text) ====

@@ -31,6 +31,8 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <vm/vm.h>
+#include <vm/pmap.h>
 
 #include <machine/bus.h>
 
@@ -53,8 +55,7 @@
 int
 uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2)
 {
-
-	return ((b1->bsh == b2->bsh) ? 1 : 0);
+	return ((pmap_kextract(b1->bsh) == pmap_kextract(b2->bsh)) ? 1 : 0);
 }
 
 #ifdef MPC85XX
@@ -120,9 +121,11 @@
 	if (strcmp(buf, "ch-a") == 0) {
 		class = &uart_z8530_class;
 		di->bas.regshft = 4;
+		di->bas.chan = 1;
 	} else if (strcmp(buf,"serial") == 0) {
 		class = &uart_ns8250_class;
 		di->bas.regshft = 0;
+		di->bas.chan = 0;
 	} else
 		return (ENXIO);
 
@@ -132,12 +135,13 @@
 
 	di->ops = uart_getops(class);
 
-	if (OF_getprop(input, "current-speed", &di->bas.rclk, 
+	if (OF_getprop(input, "clock-frequency", &di->bas.rclk, 
 	    sizeof(di->bas.rclk)) == -1)
 		di->bas.rclk = 230400;
-	di->bas.chan = 1;
+	if (OF_getprop(input, "current-speed", &di->baudrate, 
+	    sizeof(di->baudrate)) == -1)
+		di->baudrate = 0;
 
-	di->baudrate = 0;
 	di->databits = 8;
 	di->stopbits = 1;
 	di->parity = UART_PARITY_NONE;


More information about the p4-projects mailing list