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