summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_cpu_pc98.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-03-20 02:14:02 +0000
committermarcel <marcel@FreeBSD.org>2004-03-20 02:14:02 +0000
commit8b346dc49ea2de292b4c92340b643ff85cdde814 (patch)
tree9e02dba730975e7ccd557721e204684be9bfd5aa /sys/dev/uart/uart_cpu_pc98.c
parente4be5cf79f568644ff6f93179c7ec0efffbcd1ac (diff)
downloadFreeBSD-src-8b346dc49ea2de292b4c92340b643ff85cdde814.zip
FreeBSD-src-8b346dc49ea2de292b4c92340b643ff85cdde814.tar.gz
Introduce the hw.uart.console and hw.uart.dbgport environment variables
to select a serial console and debug port (resp). On ia64 these replace the use of hints completely and take precedence over hints on alpha, amd64 and i386. On sparc64 these variables are not yet recognised. The reasons for introducing these variables are: 1. Hints have side-effects. They reserve the unit number for use by isa or acpi devices and therefore cannot be used to select a pci device. Also, the use of a unit number to select a device prior to bus enumeration is nonsense. The new variables have no side- effects and are not based on unit numbers. 2. Hints don't have the expression power to allow the sysadmin to select UARTs that are not legacy PC devices and need the support of compile-time constants to give the sysadmin some level of flexibility. The hw.uart.console and hw.uart.dbgport variables specify a list of attributes. An attribute is a tag-value pair, seperated by a colon. Attributes are seperated by a comma. Where possible, tags are the same as those in /etc/remote (only br and pa in practice). Details can be found in the manpage (not part of this commit). Not tested on: amd64, pc98
Diffstat (limited to 'sys/dev/uart/uart_cpu_pc98.c')
-rw-r--r--sys/dev/uart/uart_cpu_pc98.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/uart/uart_cpu_pc98.c b/sys/dev/uart/uart_cpu_pc98.c
index 4005a90..2446c4f 100644
--- a/sys/dev/uart/uart_cpu_pc98.c
+++ b/sys/dev/uart/uart_cpu_pc98.c
@@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$");
#include <dev/uart/uart.h>
#include <dev/uart/uart_cpu.h>
+bus_space_tag_t uart_bus_space_io;
+bus_space_tag_t uart_bus_space_mem;
+
int
uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2)
{
@@ -48,6 +51,10 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
{
unsigned int i, ivar, flags;
+ /* Check the environment. */
+ if (uart_getenv(devtype, di) == 0)
+ return (0);
+
/*
* There are 2 built-in serial ports on pc98 hardware. The
* first one is 8251 and the second one is I think an enhance
@@ -81,7 +88,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
else
di->ops = uart_i8251_ops;
di->bas.chan = 0;
- di->bas.bst = I386_BUS_SPACE_IO;
+ di->bas.bst = uart_bus_space_io;
if (bus_space_map(di->bas.bst, ivar, 8, 0, &di->bas.bsh) != 0)
continue;
di->bas.regshft = 0;
OpenPOWER on IntegriCloud