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).
This commit is contained in:
Marius Strobl 2010-04-10 11:52:12 +00:00
parent 5679850859
commit d5dba21cf6
6 changed files with 1091 additions and 0 deletions

View File

@ -79,6 +79,7 @@ sparc64/pci/ofw_pcib.c optional pci
sparc64/pci/ofw_pcib_subr.c optional pci sparc64/pci/ofw_pcib_subr.c optional pci
sparc64/pci/ofw_pcibus.c optional pci sparc64/pci/ofw_pcibus.c optional pci
sparc64/pci/psycho.c optional pci sparc64/pci/psycho.c optional pci
sparc64/pci/sbbc.c optional uart sbbc
sparc64/pci/schizo.c optional pci sparc64/pci/schizo.c optional pci
sparc64/sbus/dma_sbus.c optional sbus sparc64/sbus/dma_sbus.c optional sbus
sparc64/sbus/sbus.c optional sbus sparc64/sbus/sbus.c optional sbus

View File

@ -67,6 +67,7 @@ struct uart_class;
extern struct uart_class uart_ns8250_class __attribute__((weak)); extern struct uart_class uart_ns8250_class __attribute__((weak));
extern struct uart_class uart_quicc_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_sab82532_class __attribute__((weak));
extern struct uart_class uart_sbbc_class __attribute__((weak));
extern struct uart_class uart_z8530_class __attribute__((weak)); extern struct uart_class uart_z8530_class __attribute__((weak));
#ifdef PC98 #ifdef PC98

View File

@ -133,6 +133,14 @@ uart_cpu_getdev_console(phandle_t options, char *dev, size_t devsz)
return (-1); return (-1);
if (strcmp(buf, "serial") != 0) if (strcmp(buf, "serial") != 0)
return (-1); 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); return (input);
} }
@ -258,6 +266,9 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
!strcmp(compat, "su16552")) { !strcmp(compat, "su16552")) {
class = &uart_ns8250_class; class = &uart_ns8250_class;
di->bas.chan = 0; di->bas.chan = 0;
} else if (!strcmp(compat, "sgsbbc")) {
class = &uart_sbbc_class;
di->bas.chan = 0;
} }
if (class == NULL) if (class == NULL)
return (ENXIO); return (ENXIO);

View File

@ -143,6 +143,9 @@ device mk48txx # Mostek MK48Txx clocks
device rtc # rtc (really a front-end for the MC146818) device rtc # rtc (really a front-end for the MC146818)
device mc146818 # Motorola MC146818 and compatible clocks device mc146818 # Motorola MC146818 and compatible clocks
device epic # Sun Fire V215/V245 LEDs device epic # Sun Fire V215/V245 LEDs
device sbbc # Sun BootBus controller (time-of-day clock for
# Serengeti and StarCat, console for Serengeti,
# requires device uart)
# Serial (COM) ports # Serial (COM) ports
device puc # Multi-channel uarts device puc # Multi-channel uarts

View File

@ -37,6 +37,7 @@ device eeprom # eeprom (really a front-end for the MK48Txx)
device mk48txx # Mostek MK48Txx clocks device mk48txx # Mostek MK48Txx clocks
device rtc # rtc (really a front-end for the MC146818) device rtc # rtc (really a front-end for the MC146818)
device mc146818 # Motorola MC146818 and compatible clocks device mc146818 # Motorola MC146818 and compatible clocks
device sbbc # Sun BootBus controller
# #
# Optional devices: # Optional devices:

1074
sys/sparc64/pci/sbbc.c Normal file

File diff suppressed because it is too large Load Diff