Deleted Added
full compact
uart_bus_fdt.c (254589) uart_bus_fdt.c (254598)
1/*-
2 * Copyright (c) 2009-2010 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Semihalf under sponsorship from
6 * the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2009-2010 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Semihalf under sponsorship from
6 * the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/uart/uart_bus_fdt.c 254589 2013-08-21 04:05:06Z ian $");
31__FBSDID("$FreeBSD: head/sys/dev/uart/uart_bus_fdt.c 254598 2013-08-21 14:33:02Z ian $");
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/kernel.h>
36#include <sys/module.h>
37
38#include <machine/bus.h>
39#include <machine/fdt.h>

--- 66 unchanged lines hidden (view full) ---

106 else if (ofw_bus_is_compatible(dev, "fsl,imx-uart"))
107 sc->sc_class = &uart_imx_class;
108 else if (ofw_bus_is_compatible(dev, "arm,pl011"))
109 sc->sc_class = &uart_pl011_class;
110 else if (ofw_bus_is_compatible(dev, "exynos"))
111 sc->sc_class = &uart_s3c2410_class;
112 else if (ofw_bus_is_compatible(dev, "cadence,uart"))
113 sc->sc_class = &uart_cdnc_class;
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/kernel.h>
36#include <sys/module.h>
37
38#include <machine/bus.h>
39#include <machine/fdt.h>

--- 66 unchanged lines hidden (view full) ---

106 else if (ofw_bus_is_compatible(dev, "fsl,imx-uart"))
107 sc->sc_class = &uart_imx_class;
108 else if (ofw_bus_is_compatible(dev, "arm,pl011"))
109 sc->sc_class = &uart_pl011_class;
110 else if (ofw_bus_is_compatible(dev, "exynos"))
111 sc->sc_class = &uart_s3c2410_class;
112 else if (ofw_bus_is_compatible(dev, "cadence,uart"))
113 sc->sc_class = &uart_cdnc_class;
114 else if (ofw_bus_is_compatible(dev, "ti,ns16550"))
115 sc->sc_class = &uart_ti8250_class;
114 else if (ofw_bus_is_compatible(dev, "ns16550"))
115 sc->sc_class = &uart_ns8250_class;
116 else
117 return (ENXIO);
118
119 node = ofw_bus_get_node(dev);
120
121 if ((err = uart_fdt_get_clock(node, &clock)) != 0)
122 return (err);
123 uart_fdt_get_shift(node, &shift);
124
125 return (uart_bus_probe(dev, (int)shift, (int)clock, 0, 0));
126}
127
128DRIVER_MODULE(uart, simplebus, uart_fdt_driver, uart_devclass, 0, 0);
116 else if (ofw_bus_is_compatible(dev, "ns16550"))
117 sc->sc_class = &uart_ns8250_class;
118 else
119 return (ENXIO);
120
121 node = ofw_bus_get_node(dev);
122
123 if ((err = uart_fdt_get_clock(node, &clock)) != 0)
124 return (err);
125 uart_fdt_get_shift(node, &shift);
126
127 return (uart_bus_probe(dev, (int)shift, (int)clock, 0, 0));
128}
129
130DRIVER_MODULE(uart, simplebus, uart_fdt_driver, uart_devclass, 0, 0);