summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_cpu_alpha.c
diff options
context:
space:
mode:
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