The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/mips/nlm/uart_pci_xlp.c

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 2011 Netlogic Microsystems Inc.
    3  *
    4  * (based on dev/uart/uart_bus_pci.c)
    5  * Copyright (c) 2006 Marcel Moolenaar
    6  * Copyright (c) 2001 M. Warner Losh
    7  * All rights reserved.
    8  *
    9  * Redistribution and use in source and binary forms, with or without
   10  * modification, are permitted provided that the following conditions
   11  * are met:
   12  * 1. Redistributions of source code must retain the above copyright
   13  *    notice, this list of conditions and the following disclaimer.
   14  * 2. Redistributions in binary form must reproduce the above copyright
   15  *    notice, this list of conditions and the following disclaimer in the
   16  *    documentation and/or other materials provided with the distribution.
   17  *
   18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   20  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   21  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   23  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   24  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   25  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   27  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   28  */
   29 
   30 #include <sys/cdefs.h>
   31 __FBSDID("$FreeBSD: stable/9/sys/mips/nlm/uart_pci_xlp.c 225394 2011-09-05 10:45:29Z jchandra $");
   32 
   33 #include <sys/param.h>
   34 #include <sys/systm.h>
   35 #include <sys/bus.h>
   36 #include <sys/conf.h>
   37 #include <sys/kernel.h>
   38 #include <sys/module.h>
   39 #include <machine/bus.h>
   40 #include <sys/rman.h>
   41 #include <machine/resource.h>
   42 
   43 #include <dev/pci/pcivar.h>
   44 
   45 #include <mips/nlm/hal/haldefs.h>
   46 #include <mips/nlm/hal/iomap.h>
   47 #include <mips/nlm/hal/uart.h>
   48 
   49 #include <dev/uart/uart.h>
   50 #include <dev/uart/uart_bus.h>
   51 
   52 static int uart_soc_probe(device_t dev);
   53 
   54 static device_method_t uart_soc_methods[] = {
   55         /* Device interface */
   56         DEVMETHOD(device_probe,         uart_soc_probe),
   57         DEVMETHOD(device_attach,        uart_bus_attach),
   58         DEVMETHOD(device_detach,        uart_bus_detach),
   59         { 0, 0 }
   60 };
   61 
   62 static driver_t uart_soc_driver = {
   63         uart_driver_name,
   64         uart_soc_methods,
   65         sizeof(struct uart_softc),
   66 };
   67 
   68 static int
   69 uart_soc_probe(device_t dev)
   70 {
   71         struct uart_softc *sc;
   72         uint64_t ubase;
   73 
   74         if (pci_get_vendor(dev) != PCI_VENDOR_NETLOGIC ||
   75             pci_get_device(dev) != PCI_DEVICE_ID_NLM_UART)
   76                 return (ENXIO);
   77 
   78         ubase = nlm_get_uart_regbase(0, 0);
   79         sc = device_get_softc(dev);
   80         sc->sc_class = &uart_ns8250_class;
   81         device_set_desc(dev, "Netlogic SoC UART");
   82         return (uart_bus_probe(dev, 2, 133000000, 0, 0));
   83 }
   84 
   85 DRIVER_MODULE(uart_soc, pci, uart_soc_driver, uart_devclass, 0, 0);

Cache object: ce42b1653f8fdde29db27e1fbfc2dddc


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.