No empty .Rs/.Re
[netbsd-mini2440.git] / sys / arch / mips / alchemy / au1550.c
blob16b639524eae4a6299efc5ffae027dfe51314f8f
1 /* $NetBSD: au1550.c,v 1.10 2007/02/21 22:59:47 thorpej Exp $ */
3 /*-
4 * Copyright (c) 2006 Itronix Inc.
5 * All rights reserved.
7 * Written by Garrett D'Amore for Itronix Inc.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. The name of Itronix Inc. may not be used to endorse
18 * or promote products derived from this software without specific
19 * prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
35 * Copyright 2001 Wasabi Systems, Inc.
36 * All rights reserved.
38 * Written by Simon Burge for Wasabi Systems, Inc.
40 * Redistribution and use in source and binary forms, with or without
41 * modification, are permitted provided that the following conditions
42 * are met:
43 * 1. Redistributions of source code must retain the above copyright
44 * notice, this list of conditions and the following disclaimer.
45 * 2. Redistributions in binary form must reproduce the above copyright
46 * notice, this list of conditions and the following disclaimer in the
47 * documentation and/or other materials provided with the distribution.
48 * 3. All advertising materials mentioning features or use of this software
49 * must display the following acknowledgement:
50 * This product includes software developed for the NetBSD Project by
51 * Wasabi Systems, Inc.
52 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
53 * or promote products derived from this software without specific prior
54 * written permission.
56 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
57 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
58 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
59 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
60 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
61 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
62 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
63 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
64 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
66 * POSSIBILITY OF SUCH DAMAGE.
70 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
72 * Redistribution and use in source and binary forms, with or without
73 * modification, are permitted provided that the following conditions
74 * are met:
75 * 1. Redistributions of source code must retain the above copyright
76 * notice, this list of conditions and the following disclaimer.
77 * 2. Redistributions in binary form must reproduce the above copyright
78 * notice, this list of conditions and the following disclaimer in the
79 * documentation and/or other materials provided with the distribution.
80 * 3. All advertising materials mentioning features or use of this software
81 * must display the following acknowledgement:
82 * This product includes software developed by Christopher G. Demetriou
83 * for the NetBSD Project.
84 * 4. The name of the author may not be used to endorse or promote products
85 * derived from this software without specific prior written permission
87 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
88 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
89 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
90 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
91 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
92 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
93 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
94 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
95 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
96 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
99 #include <sys/cdefs.h>
100 __KERNEL_RCSID(0, "$NetBSD: au1550.c,v 1.10 2007/02/21 22:59:47 thorpej Exp $");
102 #include <sys/param.h>
103 #include <machine/bus.h>
104 #include <machine/locore.h>
105 #include <mips/alchemy/include/aureg.h>
106 #include <mips/alchemy/include/auvar.h>
108 static const char *au1550_irqnames[] = {
109 "uart0",
110 "pci inta",
111 "pci intb",
112 "ddma",
113 "crypto",
114 "pci intc",
115 "pci intd",
116 "pci reset",
117 "uart1",
118 "uart3",
119 "psc0",
120 "psc1",
121 "psc2",
122 "psc3",
123 "toy tick",
124 "toy match0",
125 "toy match1",
126 "toy match2",
127 "rtc tick",
128 "rtc match0",
129 "rtc match1",
130 "rtc match2",
131 "pci error",
132 "nand",
133 "usb intr",
134 "usb suspend",
135 "usb host",
136 "mac0",
137 "mac1",
138 "irq 29",
139 "irq 30",
140 "irq 31",
141 "gpio 0",
142 "gpio 1",
143 "gpio 2",
144 "gpio 3",
145 "gpio 4",
146 "gpio 5",
147 "gpio 6",
148 "gpio 7",
149 "gpio 8",
150 "gpio 9",
151 "gpio 10",
152 "gpio 11",
153 "gpio 12",
154 "gpio 13",
155 "gpio 14",
156 "gpio 15",
157 "gpio 200",
158 "gpio 201:205",
159 "gpio 16",
160 "gpio 17",
161 "gpio 20",
162 "gpio 21",
163 "gpio 22",
164 "gpio 23",
165 "gpio 24",
166 "gpio 25",
167 "gpio 26",
168 "gpio 27",
169 "gpio 28",
170 "gpio 206",
171 "gpio 207",
172 "gpio 208:215"
175 static struct au_dev au1550_devices[] = {
176 { "com", { UART0_BASE }, { 0, -1 }},
177 { "com", { UART1_BASE }, { 8, -1 }},
178 { "com", { UART3_BASE }, { 9, -1 }},
179 { "aurtc", { -1 }, { -1, -1 }},
180 { "aumac", { MAC0_BASE, MAC0_ENABLE, MAC0_DMA_BASE }, { 27, -1 }},
181 { "aumac", { MAC1_BASE, MAC1_ENABLE, MAC1_DMA_BASE }, { 28, -1 }},
182 { "ohci", { AU1550_USBH_BASE, AU1550_USBH_ENABLE,
183 AU1550_USBH_SIZE }, { 26, -1 }},
184 { "aupci", { PCI_BASE }, { -1, -1 }},
185 { "augpio", { GPIO_BASE, 27 }, { -1, -1 }},
186 { "augpio", { GPIO2_BASE, 16 }, { -1, -1 }},
187 { "aupcmcia", { -1 }, { -1, -1 }},
188 { "aupsc", { PSC0_BASE }, { 10, -1 }},
189 { "aupsc", { PSC1_BASE }, { 11, -1 }},
190 { "aupsc", { PSC2_BASE }, { 12, -1 }},
191 { "aupsc", { PSC3_BASE }, { 13, -1 }},
192 #if 0
193 { "usbd", { USBD_BASE }, { 24, 25 }},
194 { "aucrypto", { CRYPTO_BASE }, { 4, -1 }},
195 #endif
196 { NULL }
199 static struct au_chipdep au1550_chipdep = {
200 "au1550",
201 { IC0_BASE, IC1_BASE }, /* ICUs */
202 au1550_devices,
203 au1550_irqnames,
206 bool
207 au1550_match(struct au_chipdep **cpp)
210 if (MIPS_PRID_COPTS(cpu_id) == MIPS_AU1550) {
211 *cpp = &au1550_chipdep;
212 return true;
214 return false;