Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Mar 2004 19:11:11 -0800 (PST)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 49336 for review
Message-ID:  <200403200311.i2K3BBOA063930@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=49336

Change 49336 by marcel@marcel_nfs on 2004/03/19 19:10:45

	IFC @49328

Affected files ...

.. //depot/projects/gdb/sys/dev/uart/uart_cpu_ia64.c#2 edit

Differences ...

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

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 Marcel Moolenaar
+ * Copyright (c) 2003, 2004 Marcel Moolenaar
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/uart/uart_cpu_ia64.c,v 1.6 2003/09/26 05:14:56 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_cpu_ia64.c,v 1.7 2004/03/20 02:14:02 marcel Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -39,6 +39,9 @@
 #include <dev/uart/uart.h>
 #include <dev/uart/uart_cpu.h>
 
+bus_space_tag_t uart_bus_space_io = IA64_BUS_SPACE_IO;
+bus_space_tag_t uart_bus_space_mem = IA64_BUS_SPACE_MEM;
+
 static int dig64_to_uart_parity[] = {
 	UART_PARITY_NONE, UART_PARITY_NONE, UART_PARITY_EVEN,
 	UART_PARITY_ODD, UART_PARITY_MARK, UART_PARITY_SPACE
@@ -57,7 +60,7 @@
 	struct dig64_hcdp_table *tbl;
 	struct dig64_hcdp_entry *ent;
 	bus_addr_t addr;
-	unsigned int i, ivar;
+	unsigned int i;
 
 	/*
 	 * Use the DIG64 HCDP table if present.
@@ -80,7 +83,7 @@
 			di->ops = uart_ns8250_ops;
 			di->bas.chan = 0;
 			di->bas.bst = (ent->address.addr_space == 0)
-			    ? IA64_BUS_SPACE_MEM : IA64_BUS_SPACE_IO;
+			    ? uart_bus_space_mem : uart_bus_space_io;
 			if (bus_space_map(di->bas.bst, addr, 8, 0,
 			    &di->bas.bsh) != 0)
 				continue;
@@ -98,47 +101,6 @@
 		/* FALLTHROUGH */
 	}
 
-	/*
-	 * Scan the hints for backward compatibility. We only try units
-	 * 0 to 3 (inclusive). This covers the ISA legacy where 4 UARTs
-	 * had their resources predefined.
-	 */
-	for (i = 0; i < 4; i++) {
-		if (resource_int_value("uart", i, "flags", &ivar))
-			continue;
-		if (devtype == UART_DEV_CONSOLE && !UART_FLAGS_CONSOLE(ivar))
-			continue;
-		if (devtype == UART_DEV_DBGPORT && !UART_FLAGS_DBGPORT(ivar))
-			continue;
-		/*
-		 * We have a possible device. Make sure it's enabled and
-		 * that we have an I/O port.
-		 */
-		if (resource_int_value("uart", i, "disabled", &ivar) == 0 &&
-		    ivar != 0)
-			continue;
-		if (resource_int_value("uart", i, "port", &ivar) != 0 ||
-		    ivar == 0)
-			continue;
-		/*
-		 * Got it. Fill in the instance and return it. We only have
-		 * ns8250 and successors on i386.
-		 */
-		di->ops = uart_ns8250_ops;
-		di->bas.chan = 0;
-		di->bas.bst = IA64_BUS_SPACE_IO;
-		if (bus_space_map(di->bas.bst, ivar, 8, 0, &di->bas.bsh) != 0)
-			continue;
-		di->bas.regshft = 0;
-		di->bas.rclk = 0;
-		if (resource_int_value("uart", i, "baud", &ivar) != 0)
-			ivar = 0;
-		di->baudrate = ivar;
-		di->databits = 8;
-		di->stopbits = 1;
-		di->parity = UART_PARITY_NONE;
-		return (0);
-	}
-
-	return (ENXIO);
+	/* Check the environment. */
+	return (uart_getenv(devtype, di));
 }



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