From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 28 23:45:32 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FA6C106564A; Sat, 28 Jan 2012 23:45:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67DB58FC12; Sat, 28 Jan 2012 23:45:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNjWDA005129; Sat, 28 Jan 2012 23:45:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNjWCN005121; Sat, 28 Jan 2012 23:45:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282345.q0SNjWCN005121@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230685 - in stable/8/sys: conf dev/uart sparc64/conf sparc64/pci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:45:32 -0000 Author: marius Date: Sat Jan 28 23:45:31 2012 New Revision: 230685 URL: http://svn.freebsd.org/changeset/base/230685 Log: MFC: r206451, r206453 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). Added: stable/8/sys/sparc64/pci/sbbc.c - copied, changed from r206451, head/sys/sparc64/pci/sbbc.c Modified: stable/8/sys/conf/files.sparc64 stable/8/sys/dev/uart/uart.h stable/8/sys/dev/uart/uart_cpu_sparc64.c stable/8/sys/sparc64/conf/GENERIC stable/8/sys/sparc64/conf/NOTES Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/conf/files.sparc64 ============================================================================== --- stable/8/sys/conf/files.sparc64 Sat Jan 28 23:37:05 2012 (r230684) +++ stable/8/sys/conf/files.sparc64 Sat Jan 28 23:45:31 2012 (r230685) @@ -81,6 +81,7 @@ sparc64/pci/ofw_pcib_subr.c optional pci sparc64/pci/ofw_pcibus.c optional pci sparc64/pci/ofw_pci_if.m optional pci sparc64/pci/psycho.c optional pci +sparc64/pci/sbbc.c optional uart sbbc sparc64/pci/schizo.c optional pci sparc64/sbus/dma_sbus.c optional sbus sparc64/sbus/sbus.c optional sbus Modified: stable/8/sys/dev/uart/uart.h ============================================================================== --- stable/8/sys/dev/uart/uart.h Sat Jan 28 23:37:05 2012 (r230684) +++ stable/8/sys/dev/uart/uart.h Sat Jan 28 23:45:31 2012 (r230685) @@ -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 Modified: stable/8/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- stable/8/sys/dev/uart/uart_cpu_sparc64.c Sat Jan 28 23:37:05 2012 (r230684) +++ stable/8/sys/dev/uart/uart_cpu_sparc64.c Sat Jan 28 23:45:31 2012 (r230685) @@ -133,6 +133,14 @@ uart_cpu_getdev_console(phandle_t option 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); } @@ -259,6 +267,9 @@ uart_cpu_getdev(int devtype, struct uart !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); Modified: stable/8/sys/sparc64/conf/GENERIC ============================================================================== --- stable/8/sys/sparc64/conf/GENERIC Sat Jan 28 23:37:05 2012 (r230684) +++ stable/8/sys/sparc64/conf/GENERIC Sat Jan 28 23:45:31 2012 (r230685) @@ -146,6 +146,9 @@ device mk48txx # Mostek MK48Txx clocks device rtc # rtc (really a front-end for the MC146818) device mc146818 # Motorola MC146818 and compatible clocks 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 device puc # Multi-channel uarts Modified: stable/8/sys/sparc64/conf/NOTES ============================================================================== --- stable/8/sys/sparc64/conf/NOTES Sat Jan 28 23:37:05 2012 (r230684) +++ stable/8/sys/sparc64/conf/NOTES Sat Jan 28 23:45:31 2012 (r230685) @@ -37,6 +37,7 @@ device eeprom # eeprom (really a front device mk48txx # Mostek MK48Txx clocks device rtc # rtc (really a front-end for the MC146818) device mc146818 # Motorola MC146818 and compatible clocks +device sbbc # Sun BootBus controller # # Optional devices: Copied and modified: stable/8/sys/sparc64/pci/sbbc.c (from r206451, head/sys/sparc64/pci/sbbc.c) ============================================================================== --- head/sys/sparc64/pci/sbbc.c Sat Apr 10 11:52:12 2010 (r206451, copy source) +++ stable/8/sys/sparc64/pci/sbbc.c Sat Jan 28 23:45:31 2012 (r230685) @@ -1,5 +1,5 @@ /* $OpenBSD: sbbc.c,v 1.7 2009/11/09 17:53:39 nicm Exp $ */ -/* +/*- * Copyright (c) 2008 Mark Kettenis * * Permission to use, copy, modify, and distribute this software for any