imx51_uart.c revision 1.1.2.2 1 1.1.2.2 uebayasi /*
2 1.1.2.2 uebayasi * Copyright (c) 2009, 2010 Genetec Corporation. All rights reserved.
3 1.1.2.2 uebayasi * Written by Hiroyuki Bessho for Genetec Corporation.
4 1.1.2.2 uebayasi *
5 1.1.2.2 uebayasi * Redistribution and use in source and binary forms, with or without
6 1.1.2.2 uebayasi * modification, are permitted provided that the following conditions
7 1.1.2.2 uebayasi * are met:
8 1.1.2.2 uebayasi * 1. Redistributions of source code must retain the above copyright
9 1.1.2.2 uebayasi * notice, this list of conditions and the following disclaimer.
10 1.1.2.2 uebayasi * 2. Redistributions in binary form must reproduce the above copyright
11 1.1.2.2 uebayasi * notice, this list of conditions and the following disclaimer in the
12 1.1.2.2 uebayasi * documentation and/or other materials provided with the distribution.
13 1.1.2.2 uebayasi *
14 1.1.2.2 uebayasi * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
15 1.1.2.2 uebayasi * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
16 1.1.2.2 uebayasi * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 1.1.2.2 uebayasi * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
18 1.1.2.2 uebayasi * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 1.1.2.2 uebayasi * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 1.1.2.2 uebayasi * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 1.1.2.2 uebayasi * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 1.1.2.2 uebayasi * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 1.1.2.2 uebayasi * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 1.1.2.2 uebayasi * POSSIBILITY OF SUCH DAMAGE.
25 1.1.2.2 uebayasi *
26 1.1.2.2 uebayasi */
27 1.1.2.2 uebayasi
28 1.1.2.2 uebayasi #include "opt_imxuart.h"
29 1.1.2.2 uebayasi #include <sys/param.h>
30 1.1.2.2 uebayasi #include <sys/bus.h>
31 1.1.2.2 uebayasi #include <sys/device.h>
32 1.1.2.2 uebayasi #include <arm/imx/imx51reg.h>
33 1.1.2.2 uebayasi #include <arm/imx/imx51var.h>
34 1.1.2.2 uebayasi #include <arm/imx/imxuartreg.h>
35 1.1.2.2 uebayasi #include <arm/imx/imxuartvar.h>
36 1.1.2.2 uebayasi
37 1.1.2.2 uebayasi
38 1.1.2.2 uebayasi int
39 1.1.2.2 uebayasi imxuart_match(struct device *parent, struct cfdata *cf, void *aux)
40 1.1.2.2 uebayasi {
41 1.1.2.2 uebayasi struct axi_attach_args * const aa = aux;
42 1.1.2.2 uebayasi
43 1.1.2.2 uebayasi switch (aa->aa_addr) {
44 1.1.2.2 uebayasi case UART1_BASE:
45 1.1.2.2 uebayasi case UART2_BASE:
46 1.1.2.2 uebayasi case UART3_BASE:
47 1.1.2.2 uebayasi return 1;
48 1.1.2.2 uebayasi }
49 1.1.2.2 uebayasi
50 1.1.2.2 uebayasi return 0;
51 1.1.2.2 uebayasi }
52 1.1.2.2 uebayasi
53 1.1.2.2 uebayasi void
54 1.1.2.2 uebayasi imxuart_attach(struct device *parent, struct device *self, void *aux)
55 1.1.2.2 uebayasi {
56 1.1.2.2 uebayasi struct axi_attach_args * aa = aux;
57 1.1.2.2 uebayasi
58 1.1.2.2 uebayasi imxuart_attach_common(parent, self,
59 1.1.2.2 uebayasi aa->aa_iot, aa->aa_addr, aa->aa_size, aa->aa_irq, 0);
60 1.1.2.2 uebayasi }
61 1.1.2.2 uebayasi
62