8 #include <sys/kernel.h>
9 #include <sys/module.h>
10 #include <machine/bus.h>
12 #include <machine/resource.h>
14 #include <dev/uart/uart.h>
15 #include <dev/uart/uart_bus.h>
16 #include <dev/uart/uart_cpu.h>
18 #include <arm/samsung/s3c2xx0/s3c24x0reg.h>
22 extern struct uart_class uart_s3c2410_class;
24 static int uart_s3c2410_probe(device_t dev);
26 static device_method_t uart_s3c2410_methods[] = {
27 /* Device interface */
28 DEVMETHOD(device_probe, uart_s3c2410_probe),
29 DEVMETHOD(device_attach, uart_bus_attach),
30 DEVMETHOD(device_detach, uart_bus_detach),
34 static driver_t uart_s3c2410_driver = {
37 sizeof(struct uart_softc),
40 extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
42 uart_s3c2410_probe(device_t dev)
44 struct uart_devinfo *sysdev;
45 struct uart_softc *sc;
48 sc = device_get_softc(dev);
49 sc->sc_class = &uart_s3c2410_class;
51 unit = device_get_unit(dev);
52 sysdev = SLIST_FIRST(&uart_sysdevs);
53 if (S3C24X0_UART_BASE(unit) == sysdev->bas.bsh) {
54 sc->sc_sysdev = sysdev;
55 bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas));
57 return(uart_bus_probe(dev, 0, 0, 0, unit));
60 DRIVER_MODULE(uart, s3c24x0, uart_s3c2410_driver, uart_devclass, 0, 0);