1/*- 2 * Copyright (c) 2001 by Thomas Moestl <tmm@FreeBSD.org>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/uart/uart_bus_ebus.c 127817 2004-04-03 23:02:02Z marcel $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <machine/bus.h> 35#include <sys/rman.h> 36#include <machine/resource.h> --- 19 unchanged lines hidden (view full) --- 56 uart_driver_name, 57 uart_ebus_methods, 58 sizeof(struct uart_softc), 59}; 60 61static int 62uart_ebus_probe(device_t dev) 63{ |
64 const char *nm, *cmpt; |
65 struct uart_softc *sc; 66 int error; 67 68 sc = device_get_softc(dev); 69 sc->sc_class = NULL; 70 71 nm = ebus_get_name(dev); |
72 cmpt = ebus_get_compat(dev); 73 if (!strcmp(nm, "su") || !strcmp(nm, "su_pnp") || (cmpt != NULL && 74 (!strcmp(cmpt, "su") || !strcmp(cmpt, "su16550")))) { |
75 sc->sc_class = &uart_ns8250_class; 76 return (uart_bus_probe(dev, 0, 0, 0, 0)); 77 } 78 if (!strcmp(nm, "se")) { 79 sc->sc_class = &uart_sab82532_class; 80 error = uart_bus_probe(dev, 0, 0, 0, 1); 81 return ((error) ? error : -1); 82 } 83 84 return (ENXIO); 85} 86 87DRIVER_MODULE(uart, ebus, uart_ebus_driver, uart_devclass, 0, 0); |