summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_cpu_alpha.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_alpha.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_alpha.c')
-rw-r--r--sys/dev/uart/uart_cpu_alpha.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/uart/uart_cpu_alpha.c b/sys/dev/uart/uart_cpu_alpha.c
index 1d78d6a..a3a132f 100644
--- a/sys/dev/uart/uart_cpu_alpha.c
+++ b/sys/dev/uart/uart_cpu_alpha.c
@@ -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
@@ -39,6 +39,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)
{
@@ -52,6 +55,9 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
struct ctb *ctb;
unsigned int i, ivar;
+ uart_bus_space_io = busspace_isa_io;
+ uart_bus_space_mem = busspace_isa_mem;
+
if (devtype == UART_DEV_CONSOLE) {
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
if (ctb->ctb_term_type != CTB_PRINTERPORT)
@@ -59,7 +65,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
boothowto |= RB_SERIAL;
di->ops = uart_ns8250_ops;
di->bas.chan = 0;
- di->bas.bst = busspace_isa_io;
+ di->bas.bst = uart_bus_space_io;
if (bus_space_map(di->bas.bst, 0x3f8, 8, 0, &di->bas.bsh) != 0)
return (ENXIO);
di->bas.regshft = 0;
@@ -71,6 +77,10 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
return (0);
}
+ /* Check the environment. */
+ if (uart_getenv(devtype, di) == 0)
+ return (0);
+
/*
* Scan the hints. We only try units 0 to 3 (inclusive). This
* covers the ISA legacy where 4 UARTs had their resources
@@ -97,7 +107,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
*/
di->ops = uart_ns8250_ops;
di->bas.chan = 0;
- di->bas.bst = busspace_isa_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