summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2010-04-10 11:52:12 +0000
committermarius <marius@FreeBSD.org>2010-04-10 11:52:12 +0000
commitaf63aa47ca8e507ea249380e9c4c7659a303ee6f (patch)
treef1b6758ebc22a7a36a90c075e73c4c3ebfa7a633 /sys/dev/uart
parentc48055dea1028997c98d1f43c73db7cb0d62ccf1 (diff)
downloadFreeBSD-src-af63aa47ca8e507ea249380e9c4c7659a303ee6f.zip
FreeBSD-src-af63aa47ca8e507ea249380e9c4c7659a303ee6f.tar.gz
Add sbbc(4), a driver for the BootBus controller found in Serengeti and
StarCat systems which provides time-of-day services for both as well as console service for Serengeti, i.e. Sun Fire V1280. While the latter is described with a device type of serial in the OFW device tree, it isn't actually an UART. Nevertheless the console service is handled by uart(4) as this allowed to re-use quite a bit of MD and MI code. Actually, this idea is stolen from Linux which interfaces the sun4v hypervisor console with the Linux counterpart of uart(4).
Diffstat (limited to 'sys/dev/uart')
-rw-r--r--sys/dev/uart/uart.h1
-rw-r--r--sys/dev/uart/uart_cpu_sparc64.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/uart/uart.h b/sys/dev/uart/uart.h
index eb66da0..bd7861d 100644
--- a/sys/dev/uart/uart.h
+++ b/sys/dev/uart/uart.h
@@ -67,6 +67,7 @@ struct uart_class;
extern struct uart_class uart_ns8250_class __attribute__((weak));
extern struct uart_class uart_quicc_class __attribute__((weak));
extern struct uart_class uart_sab82532_class __attribute__((weak));
+extern struct uart_class uart_sbbc_class __attribute__((weak));
extern struct uart_class uart_z8530_class __attribute__((weak));
#ifdef PC98
diff --git a/sys/dev/uart/uart_cpu_sparc64.c b/sys/dev/uart/uart_cpu_sparc64.c
index 0f40cb7..c89b39f 100644
--- a/sys/dev/uart/uart_cpu_sparc64.c
+++ b/sys/dev/uart/uart_cpu_sparc64.c
@@ -133,6 +133,14 @@ uart_cpu_getdev_console(phandle_t options, char *dev, size_t devsz)
return (-1);
if (strcmp(buf, "serial") != 0)
return (-1);
+ /* For a Serengeti console device point to the bootbus controller. */
+ if (OF_getprop(input, "name", buf, sizeof(buf)) > 0 &&
+ !strcmp(buf, "sgcn")) {
+ if ((chosen = OF_finddevice("/chosen")) == -1)
+ return (-1);
+ if (OF_getprop(chosen, "iosram", &input, sizeof(input)) == -1)
+ return (-1);
+ }
return (input);
}
@@ -258,6 +266,9 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
!strcmp(compat, "su16552")) {
class = &uart_ns8250_class;
di->bas.chan = 0;
+ } else if (!strcmp(compat, "sgsbbc")) {
+ class = &uart_sbbc_class;
+ di->bas.chan = 0;
}
if (class == NULL)
return (ENXIO);
OpenPOWER on IntegriCloud