1205354Simp#include <sys/cdefs.h> 2205354Simp__FBSDID("$FreeBSD$"); 3205354Simp 4205354Simp#include <sys/param.h> 5205354Simp#include <sys/systm.h> 6205354Simp#include <sys/bus.h> 7205354Simp#include <sys/conf.h> 8205354Simp#include <sys/kernel.h> 9205354Simp#include <sys/module.h> 10205354Simp#include <machine/bus.h> 11205354Simp#include <sys/rman.h> 12205354Simp#include <machine/resource.h> 13205354Simp 14205354Simp#include <dev/uart/uart.h> 15205354Simp#include <dev/uart/uart_bus.h> 16205354Simp#include <dev/uart/uart_cpu.h> 17205354Simp 18272103Sgavin#include <arm/samsung/s3c2xx0/s3c24x0reg.h> 19205354Simp 20205354Simp#include "uart_if.h" 21205354Simp 22283327Sianextern struct uart_class uart_s3c2410_class; 23283327Sian 24205354Simpstatic int uart_s3c2410_probe(device_t dev); 25205354Simp 26205354Simpstatic device_method_t uart_s3c2410_methods[] = { 27205354Simp /* Device interface */ 28205354Simp DEVMETHOD(device_probe, uart_s3c2410_probe), 29205354Simp DEVMETHOD(device_attach, uart_bus_attach), 30205354Simp DEVMETHOD(device_detach, uart_bus_detach), 31205354Simp { 0, 0 } 32205354Simp}; 33205354Simp 34205354Simpstatic driver_t uart_s3c2410_driver = { 35205354Simp uart_driver_name, 36205354Simp uart_s3c2410_methods, 37205354Simp sizeof(struct uart_softc), 38205354Simp}; 39205354Simp 40205354Simpextern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; 41205354Simpstatic int 42205354Simpuart_s3c2410_probe(device_t dev) 43205354Simp{ 44205354Simp struct uart_devinfo *sysdev; 45205354Simp struct uart_softc *sc; 46205354Simp int unit; 47205354Simp 48205354Simp sc = device_get_softc(dev); 49205354Simp sc->sc_class = &uart_s3c2410_class; 50205354Simp 51205354Simp unit = device_get_unit(dev); 52205354Simp sysdev = SLIST_FIRST(&uart_sysdevs); 53205354Simp if (S3C24X0_UART_BASE(unit) == sysdev->bas.bsh) { 54205354Simp sc->sc_sysdev = sysdev; 55205354Simp bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); 56205354Simp } 57205354Simp return(uart_bus_probe(dev, 0, 0, 0, unit)); 58205354Simp} 59205354Simp 60205354SimpDRIVER_MODULE(uart, s3c24x0, uart_s3c2410_driver, uart_devclass, 0, 0); 61