sbbc.c (227843) | sbbc.c (247574) |
---|---|
1/* $OpenBSD: sbbc.c,v 1.7 2009/11/09 17:53:39 nicm Exp $ */ 2/*- 3 * Copyright (c) 2008 Mark Kettenis 4 * 5 * Permission to use, copy, modify, and distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * --- 27 unchanged lines hidden (view full) --- 36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 40 * SUCH DAMAGE. 41 */ 42 43#include <sys/cdefs.h> | 1/* $OpenBSD: sbbc.c,v 1.7 2009/11/09 17:53:39 nicm Exp $ */ 2/*- 3 * Copyright (c) 2008 Mark Kettenis 4 * 5 * Permission to use, copy, modify, and distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * --- 27 unchanged lines hidden (view full) --- 36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 40 * SUCH DAMAGE. 41 */ 42 43#include <sys/cdefs.h> |
44__FBSDID("$FreeBSD: head/sys/sparc64/pci/sbbc.c 227843 2011-11-22 21:28:20Z marius $"); | 44__FBSDID("$FreeBSD: head/sys/sparc64/pci/sbbc.c 247574 2013-03-01 20:36:59Z marius $"); |
45 46#include <sys/param.h> 47#include <sys/systm.h> 48#include <sys/bus.h> 49#include <sys/clock.h> 50#include <sys/endian.h> 51#include <sys/kernel.h> 52#include <sys/lock.h> --- 241 unchanged lines hidden (view full) --- 294 DEVMETHOD(clock_settime, sbbc_tod_settime), 295 296 DEVMETHOD_END 297}; 298 299static devclass_t sbbc_devclass; 300 301DEFINE_CLASS_0(sbbc, sbbc_driver, sbbc_pci_methods, sizeof(struct sbbc_softc)); | 45 46#include <sys/param.h> 47#include <sys/systm.h> 48#include <sys/bus.h> 49#include <sys/clock.h> 50#include <sys/endian.h> 51#include <sys/kernel.h> 52#include <sys/lock.h> --- 241 unchanged lines hidden (view full) --- 294 DEVMETHOD(clock_settime, sbbc_tod_settime), 295 296 DEVMETHOD_END 297}; 298 299static devclass_t sbbc_devclass; 300 301DEFINE_CLASS_0(sbbc, sbbc_driver, sbbc_pci_methods, sizeof(struct sbbc_softc)); |
302DRIVER_MODULE(sbbc, pci, sbbc_driver, sbbc_devclass, 0, 0); | 302DRIVER_MODULE(sbbc, pci, sbbc_driver, sbbc_devclass, NULL, NULL); |
303 304static int 305sbbc_pci_probe(device_t dev) 306{ 307 308 if (pci_get_vendor(dev) == SBBC_PCI_VENDOR && 309 pci_get_device(dev) == SBBC_PCI_PRODUCT) { 310 device_set_desc(dev, "Sun BootBus controller"); --- 42 unchanged lines hidden (view full) --- 353 pci_set_intpin(dev, 1); 354 child = device_add_child(dev, NULL, -1); 355 if (child == NULL) 356 device_printf(dev, "failed to add UART device\n"); 357 error = bus_generic_attach(dev); 358 if (error != 0) 359 device_printf(dev, "failed to attach UART device\n"); 360 } else { | 303 304static int 305sbbc_pci_probe(device_t dev) 306{ 307 308 if (pci_get_vendor(dev) == SBBC_PCI_VENDOR && 309 pci_get_device(dev) == SBBC_PCI_PRODUCT) { 310 device_set_desc(dev, "Sun BootBus controller"); --- 42 unchanged lines hidden (view full) --- 353 pci_set_intpin(dev, 1); 354 child = device_add_child(dev, NULL, -1); 355 if (child == NULL) 356 device_printf(dev, "failed to add UART device\n"); 357 error = bus_generic_attach(dev); 358 if (error != 0) 359 device_printf(dev, "failed to attach UART device\n"); 360 } else { |
361 error = sbbc_parse_toc(rman_get_bustag(sc->sc_res), 362 rman_get_bushandle(sc->sc_res)); | 361 error = sbbc_parse_toc(bst, bsh); |
363 if (error != 0) { 364 device_printf(dev, "failed to parse TOC\n"); 365 if (sbbc_console != 0) { 366 bus_release_resource(dev, SYS_RES_MEMORY, rid, 367 sc->sc_res); 368 return (error); 369 } 370 } --- 233 unchanged lines hidden (view full) --- 604 DEVMETHOD(device_attach, uart_bus_attach), 605 DEVMETHOD(device_detach, uart_bus_detach), 606 607 DEVMETHOD_END 608}; 609 610DEFINE_CLASS_0(uart, sbbc_uart_driver, sbbc_uart_sbbc_methods, 611 sizeof(struct uart_softc)); | 362 if (error != 0) { 363 device_printf(dev, "failed to parse TOC\n"); 364 if (sbbc_console != 0) { 365 bus_release_resource(dev, SYS_RES_MEMORY, rid, 366 sc->sc_res); 367 return (error); 368 } 369 } --- 233 unchanged lines hidden (view full) --- 603 DEVMETHOD(device_attach, uart_bus_attach), 604 DEVMETHOD(device_detach, uart_bus_detach), 605 606 DEVMETHOD_END 607}; 608 609DEFINE_CLASS_0(uart, sbbc_uart_driver, sbbc_uart_sbbc_methods, 610 sizeof(struct uart_softc)); |
612DRIVER_MODULE(uart, sbbc, sbbc_uart_driver, uart_devclass, 0, 0); | 611DRIVER_MODULE(uart, sbbc, sbbc_uart_driver, uart_devclass, NULL, NULL); |
613 614static int 615sbbc_uart_sbbc_probe(device_t dev) 616{ 617 struct uart_softc *sc; 618 619 sc = device_get_softc(dev); 620 sc->sc_class = &uart_sbbc_class; --- 485 unchanged lines hidden --- | 612 613static int 614sbbc_uart_sbbc_probe(device_t dev) 615{ 616 struct uart_softc *sc; 617 618 sc = device_get_softc(dev); 619 sc->sc_class = &uart_sbbc_class; --- 485 unchanged lines hidden --- |