PERFORCE change 36459 for review

Marcel Moolenaar marcel at FreeBSD.org
Tue Aug 19 18:28:29 PDT 2003


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

Change 36459 by marcel at marcel_nfs on 2003/08/19 18:28:01

	Remove DEFAULT_RCLK and instead use zero (0) to mean
	the default rclk for a particular device. This makes
	it easier when multiple devices are supported and
	each device has a different default value (ie sparc64).
	The hardware driver is responsible to initialize
	bas->rclk if it's zero (0). This will follow in the
	next commit.

Affected files ...

.. //depot/projects/uart/dev/uart/uart_cpu_alpha.c#2 edit
.. //depot/projects/uart/dev/uart/uart_cpu_i386.c#2 edit
.. //depot/projects/uart/dev/uart/uart_cpu_ia64.c#2 edit

Differences ...

==== //depot/projects/uart/dev/uart/uart_cpu_alpha.c#2 (text+ko) ====

@@ -38,8 +38,6 @@
 #include <dev/uart/uart.h>
 #include <dev/uart/uart_cpu.h>
 
-#define	DEFAULT_RCLK	1843200
-
 int
 uart_cpu_getdev(int devtype, struct uart_devinfo *di)
 {
@@ -55,7 +53,7 @@
 		di->bas.bst = busspace_isa_io;
 		di->bas.bsh = 0x3f8;
 		di->bas.regshft = 0;
-		di->bas.rclk = DEFAULT_RCLK;
+		di->bas.rclk = 0;
 		di->baudrate = 9600;
 		di->databits = 8;
 		di->stopbits = 1;
@@ -91,7 +89,7 @@
 		di->bas.bst = busspace_isa_io;
 		di->bas.bsh = ivar;
 		di->bas.regshft = 0;
-		di->bas.rclk = DEFAULT_RCLK;
+		di->bas.rclk = 0;
 		if (resource_int_value("uart", i, "baud", &ivar) != 0)
 			ivar = 0;
 		di->baudrate = ivar;

==== //depot/projects/uart/dev/uart/uart_cpu_i386.c#2 (text+ko) ====

@@ -36,8 +36,6 @@
 #include <dev/uart/uart.h>
 #include <dev/uart/uart_cpu.h>
 
-#define	DEFAULT_RCLK	1843200
-
 int
 uart_cpu_getdev(int devtype, struct uart_devinfo *di)
 {
@@ -73,7 +71,7 @@
 		di->bas.bst = I386_BUS_SPACE_IO;
 		di->bas.bsh = ivar;
 		di->bas.regshft = 0;
-		di->bas.rclk = DEFAULT_RCLK;
+		di->bas.rclk = 0;
 		if (resource_int_value("uart", i, "baud", &ivar) != 0)
 			ivar = 0;
 		di->baudrate = ivar;

==== //depot/projects/uart/dev/uart/uart_cpu_ia64.c#2 (text+ko) ====

@@ -39,8 +39,6 @@
 #include <dev/uart/uart.h>
 #include <dev/uart/uart_cpu.h>
 
-#define	DEFAULT_RCLK	1843200
-
 static int dig64_to_uart_parity[] = {
 	UART_PARITY_NONE, UART_PARITY_NONE, UART_PARITY_EVEN,
 	UART_PARITY_ODD, UART_PARITY_MARK, UART_PARITY_SPACE
@@ -77,8 +75,7 @@
 			di->bas.bsh = (di->bas.bsh << 32) +
 			    ent->address.addr_low;
 			di->bas.regshft = 0;
-			di->bas.rclk = (ent->pclock == 0) ? DEFAULT_RCLK
-			    : ent->pclock << 4; /* rclk = 16 * pclock */
+			di->bas.rclk = ent->pclock << 4;
 			/* We don't deal with 64-bit baud rates. */
 			di->baudrate = ent->baud_low;
 			di->databits = ent->databits;
@@ -121,7 +118,7 @@
 		di->bas.bst = IA64_BUS_SPACE_IO;
 		di->bas.bsh = ivar;
 		di->bas.regshft = 0;
-		di->bas.rclk = DEFAULT_RCLK;
+		di->bas.rclk = 0;
 		if (resource_int_value("uart", i, "baud", &ivar) != 0)
 			ivar = 0;
 		di->baudrate = ivar;


More information about the p4-projects mailing list