ar5315.c revision 1.3.8.2 1 1.3.8.2 yamt /* $NetBSD: ar5315.c,v 1.3.8.2 2006/12/30 20:46:30 yamt Exp $ */
2 1.3.8.2 yamt
3 1.3.8.2 yamt /*
4 1.3.8.2 yamt * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
5 1.3.8.2 yamt * Copyright (c) 2006 Garrett D'Amore.
6 1.3.8.2 yamt * All rights reserved.
7 1.3.8.2 yamt *
8 1.3.8.2 yamt * Portions of this code were written by Garrett D'Amore for the
9 1.3.8.2 yamt * Champaign-Urbana Community Wireless Network Project.
10 1.3.8.2 yamt *
11 1.3.8.2 yamt * Redistribution and use in source and binary forms, with or
12 1.3.8.2 yamt * without modification, are permitted provided that the following
13 1.3.8.2 yamt * conditions are met:
14 1.3.8.2 yamt * 1. Redistributions of source code must retain the above copyright
15 1.3.8.2 yamt * notice, this list of conditions and the following disclaimer.
16 1.3.8.2 yamt * 2. Redistributions in binary form must reproduce the above
17 1.3.8.2 yamt * copyright notice, this list of conditions and the following
18 1.3.8.2 yamt * disclaimer in the documentation and/or other materials provided
19 1.3.8.2 yamt * with the distribution.
20 1.3.8.2 yamt * 3. All advertising materials mentioning features or use of this
21 1.3.8.2 yamt * software must display the following acknowledgements:
22 1.3.8.2 yamt * This product includes software developed by the Urbana-Champaign
23 1.3.8.2 yamt * Independent Media Center.
24 1.3.8.2 yamt * This product includes software developed by Garrett D'Amore.
25 1.3.8.2 yamt * 4. Urbana-Champaign Independent Media Center's name and Garrett
26 1.3.8.2 yamt * D'Amore's name may not be used to endorse or promote products
27 1.3.8.2 yamt * derived from this software without specific prior written permission.
28 1.3.8.2 yamt *
29 1.3.8.2 yamt * THIS SOFTWARE IS PROVIDED BY THE URBANA-CHAMPAIGN INDEPENDENT
30 1.3.8.2 yamt * MEDIA CENTER AND GARRETT D'AMORE ``AS IS'' AND ANY EXPRESS OR
31 1.3.8.2 yamt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
32 1.3.8.2 yamt * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 1.3.8.2 yamt * ARE DISCLAIMED. IN NO EVENT SHALL THE URBANA-CHAMPAIGN INDEPENDENT
34 1.3.8.2 yamt * MEDIA CENTER OR GARRETT D'AMORE BE LIABLE FOR ANY DIRECT, INDIRECT,
35 1.3.8.2 yamt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
36 1.3.8.2 yamt * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37 1.3.8.2 yamt * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
38 1.3.8.2 yamt * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.3.8.2 yamt * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40 1.3.8.2 yamt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
41 1.3.8.2 yamt * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 1.3.8.2 yamt */
43 1.3.8.2 yamt
44 1.3.8.2 yamt
45 1.3.8.2 yamt /*
46 1.3.8.2 yamt * This file includes a bunch of implementation specific bits for
47 1.3.8.2 yamt * AR5315, which differs these from other members of the AR531X
48 1.3.8.2 yamt * family.
49 1.3.8.2 yamt */
50 1.3.8.2 yamt #include <sys/cdefs.h>
51 1.3.8.2 yamt __KERNEL_RCSID(0, "$NetBSD: ar5315.c,v 1.3.8.2 2006/12/30 20:46:30 yamt Exp $");
52 1.3.8.2 yamt
53 1.3.8.2 yamt #include "opt_ddb.h"
54 1.3.8.2 yamt #include "opt_kgdb.h"
55 1.3.8.2 yamt
56 1.3.8.2 yamt #include "opt_memsize.h"
57 1.3.8.2 yamt #include <sys/param.h>
58 1.3.8.2 yamt #include <sys/systm.h>
59 1.3.8.2 yamt #include <sys/kernel.h>
60 1.3.8.2 yamt #include <sys/buf.h>
61 1.3.8.2 yamt
62 1.3.8.2 yamt #include <mips/cache.h>
63 1.3.8.2 yamt #include <mips/locore.h>
64 1.3.8.2 yamt #include <mips/cpuregs.h>
65 1.3.8.2 yamt
66 1.3.8.2 yamt #include <net/if.h>
67 1.3.8.2 yamt #include <net/if_ether.h>
68 1.3.8.2 yamt
69 1.3.8.2 yamt #include <contrib/dev/ath/ah_soc.h> /* XXX really doesn't belong in hal */
70 1.3.8.2 yamt
71 1.3.8.2 yamt #include <mips/atheros/include/ar5315reg.h>
72 1.3.8.2 yamt #include <mips/atheros/include/ar531xvar.h>
73 1.3.8.2 yamt #include <mips/atheros/include/arbusvar.h>
74 1.3.8.2 yamt
75 1.3.8.2 yamt #include <machine/locore.h>
76 1.3.8.2 yamt
77 1.3.8.2 yamt /* helper macro for accessing system registers without bus space */
78 1.3.8.2 yamt #define REGVAL(x) *((volatile uint32_t *)(MIPS_PHYS_TO_KSEG1((x))))
79 1.3.8.2 yamt #define GETSYSREG(x) REGVAL((x) + AR5315_SYSREG_BASE)
80 1.3.8.2 yamt #define PUTSYSREG(x,v) (REGVAL((x) + AR5315_SYSREG_BASE)) = (v)
81 1.3.8.2 yamt #define GETPCIREG(x) REGVAL((x) + AR5315_PCI_BASE)
82 1.3.8.2 yamt #define PUTPCIREG(x,v) (REGVAL((x) + AR5315_PCI_BASE)) = (v)
83 1.3.8.2 yamt #define GETSDRAMREG(x) REGVAL((x) + AR5315_SDRAMCTL_BASE)
84 1.3.8.2 yamt
85 1.3.8.2 yamt uint32_t
86 1.3.8.2 yamt ar531x_memsize(void)
87 1.3.8.2 yamt {
88 1.3.8.2 yamt #ifndef MEMSIZE
89 1.3.8.2 yamt uint32_t memsize = 0;
90 1.3.8.2 yamt uint32_t memcfg, cw, rw, dw;
91 1.3.8.2 yamt
92 1.3.8.2 yamt /*
93 1.3.8.2 yamt * Determine the memory size. We query the board info.
94 1.3.8.2 yamt */
95 1.3.8.2 yamt memcfg = GETSDRAMREG(AR5315_SDRAMCTL_MEM_CFG);
96 1.3.8.2 yamt cw = (memcfg & AR5315_MEM_CFG_COL_WIDTH_MASK) >>
97 1.3.8.2 yamt AR5315_MEM_CFG_COL_WIDTH_SHIFT;
98 1.3.8.2 yamt cw += 1;
99 1.3.8.2 yamt rw = (memcfg & AR5315_MEM_CFG_ROW_WIDTH_MASK) >>
100 1.3.8.2 yamt AR5315_MEM_CFG_ROW_WIDTH_SHIFT;
101 1.3.8.2 yamt rw += 1;
102 1.3.8.2 yamt
103 1.3.8.2 yamt /* XXX: according to redboot, this could be wrong if DDR SDRAM */
104 1.3.8.2 yamt dw = (memcfg & AR5315_MEM_CFG_DATA_WIDTH_MASK) >>
105 1.3.8.2 yamt AR5315_MEM_CFG_DATA_WIDTH_SHIFT;
106 1.3.8.2 yamt dw += 1;
107 1.3.8.2 yamt dw *= 8; /* bits */
108 1.3.8.2 yamt
109 1.3.8.2 yamt /* not too sure about this math, but it _seems_ to add up */
110 1.3.8.2 yamt memsize = (1 << cw) * (1 << rw) * dw;
111 1.3.8.2 yamt #if 0
112 1.3.8.2 yamt printf("SDRAM_MEM_CFG =%x, cw=%d rw=%d dw=%d xmemsize=%d\n", memcfg,
113 1.3.8.2 yamt cw, rw, dw, memsize);
114 1.3.8.2 yamt #endif
115 1.3.8.2 yamt
116 1.3.8.2 yamt return (memsize);
117 1.3.8.2 yamt #else
118 1.3.8.2 yamt /* compile time value forced */
119 1.3.8.2 yamt return MEMSIZE;
120 1.3.8.2 yamt #endif
121 1.3.8.2 yamt }
122 1.3.8.2 yamt
123 1.3.8.2 yamt const char *
124 1.3.8.2 yamt ar531x_cpuname(void)
125 1.3.8.2 yamt {
126 1.3.8.2 yamt uint16_t rev = GETSYSREG(AR5315_SYSREG_SREV);
127 1.3.8.2 yamt switch (rev) {
128 1.3.8.2 yamt case 0x52: /* AP30 */
129 1.3.8.2 yamt case 0x57: /* AP31 */
130 1.3.8.2 yamt return "Atheros AR5312";
131 1.3.8.2 yamt case 0x58: /* AP43 */
132 1.3.8.2 yamt return "Atheros AR2313";
133 1.3.8.2 yamt case 0x86: /* AP51-Light */
134 1.3.8.2 yamt case 0x87: /* AP51-Full */
135 1.3.8.2 yamt return "Atheros AR2315";
136 1.3.8.2 yamt case 0x91: /* AP61 */
137 1.3.8.2 yamt return "Atheros AR2317";
138 1.3.8.2 yamt }
139 1.3.8.2 yamt return ("Atheros AR531X");
140 1.3.8.2 yamt }
141 1.3.8.2 yamt
142 1.3.8.2 yamt void
143 1.3.8.2 yamt ar531x_wdog(uint32_t period)
144 1.3.8.2 yamt {
145 1.3.8.2 yamt
146 1.3.8.2 yamt if (period == 0) {
147 1.3.8.2 yamt PUTSYSREG(AR5315_SYSREG_WDOG_CTL, AR5315_WDOG_CTL_IGNORE);
148 1.3.8.2 yamt PUTSYSREG(AR5315_SYSREG_WDOG_TIMER, 0);
149 1.3.8.2 yamt } else {
150 1.3.8.2 yamt PUTSYSREG(AR5315_SYSREG_WDOG_TIMER, period);
151 1.3.8.2 yamt PUTSYSREG(AR5315_SYSREG_WDOG_CTL, AR5315_WDOG_CTL_RESET);
152 1.3.8.2 yamt }
153 1.3.8.2 yamt }
154 1.3.8.2 yamt
155 1.3.8.2 yamt void
156 1.3.8.2 yamt ar531x_businit(void)
157 1.3.8.2 yamt {
158 1.3.8.2 yamt /*
159 1.3.8.2 yamt * XXX: clear COP0 config bits 0 and 1 -- Linux sets KSEG0 to either
160 1.3.8.2 yamt * 0 or 4. Why does it do this? It is implementation defined...
161 1.3.8.2 yamt */
162 1.3.8.2 yamt mips3_cp0_config_write(mips3_cp0_config_read() & ~0x3);
163 1.3.8.2 yamt
164 1.3.8.2 yamt PUTSYSREG(AR5315_SYSREG_AHB_ERR0, AR5315_AHB_ERROR_DET);
165 1.3.8.2 yamt GETSYSREG(AR5315_SYSREG_AHB_ERR1);
166 1.3.8.2 yamt }
167 1.3.8.2 yamt
168 1.3.8.2 yamt static uint32_t
169 1.3.8.2 yamt get_freq(uint32_t clkreg)
170 1.3.8.2 yamt {
171 1.3.8.2 yamt uint32_t freq = 0;
172 1.3.8.2 yamt uint32_t clkctl, pllc, pllout, refdiv, fbdiv, div2, cpudiv;
173 1.3.8.2 yamt
174 1.3.8.2 yamt static const int pll_divide_table[] = {
175 1.3.8.2 yamt 2, 3, 4, 6, 3,
176 1.3.8.2 yamt /*
177 1.3.8.2 yamt * these entries are bogus, but it avoids a possible
178 1.3.8.2 yamt * bad table dereference
179 1.3.8.2 yamt */
180 1.3.8.2 yamt 1, 1, 1
181 1.3.8.2 yamt };
182 1.3.8.2 yamt static const int pre_divide_table[] = {
183 1.3.8.2 yamt 1, 2, 4, 5
184 1.3.8.2 yamt };
185 1.3.8.2 yamt
186 1.3.8.2 yamt if (freq)
187 1.3.8.2 yamt return freq;
188 1.3.8.2 yamt
189 1.3.8.2 yamt pllc = GETSYSREG(AR5315_SYSREG_PLLC_CTL);
190 1.3.8.2 yamt clkctl = GETSYSREG(clkreg);
191 1.3.8.2 yamt
192 1.3.8.2 yamt refdiv = pre_divide_table[AR5315_PLLC_REF_DIV(pllc)];
193 1.3.8.2 yamt fbdiv = AR5315_PLLC_FB_DIV(pllc);
194 1.3.8.2 yamt div2 = (AR5315_PLLC_DIV_2(pllc) + 1) * 2; /* results in 2 or 4 */
195 1.3.8.2 yamt
196 1.3.8.2 yamt cpudiv = AR5315_CLOCKCTL_DIV(clkctl);
197 1.3.8.2 yamt cpudiv = cpudiv ? (cpudiv * 2) : 1;
198 1.3.8.2 yamt
199 1.3.8.2 yamt /* 40MHz reference clk, reference and feedback dividers */
200 1.3.8.2 yamt pllout = (40000000 / refdiv) * div2 * fbdiv;
201 1.3.8.2 yamt
202 1.3.8.2 yamt switch (AR5315_CLOCKCTL_SELECT(clkctl)) {
203 1.3.8.2 yamt case 0:
204 1.3.8.2 yamt case 1:
205 1.3.8.2 yamt /* CLKM select */
206 1.3.8.2 yamt pllout /= pll_divide_table[AR5315_PLLC_CLKM(pllc)];
207 1.3.8.2 yamt break;
208 1.3.8.2 yamt case 2:
209 1.3.8.2 yamt /* CLKC select */
210 1.3.8.2 yamt pllout /= pll_divide_table[AR5315_PLLC_CLKC(pllc)];
211 1.3.8.2 yamt break;
212 1.3.8.2 yamt default:
213 1.3.8.2 yamt /* ref_clk select */
214 1.3.8.2 yamt pllout = 40000000; /* use original reference clock */
215 1.3.8.2 yamt break;
216 1.3.8.2 yamt }
217 1.3.8.2 yamt
218 1.3.8.2 yamt freq = pllout/(cpudiv);
219 1.3.8.2 yamt
220 1.3.8.2 yamt return (freq);
221 1.3.8.2 yamt }
222 1.3.8.2 yamt
223 1.3.8.2 yamt uint32_t
224 1.3.8.2 yamt ar531x_cpu_freq(void)
225 1.3.8.2 yamt {
226 1.3.8.2 yamt static uint32_t freq = 0;
227 1.3.8.2 yamt if (freq == 0)
228 1.3.8.2 yamt freq = get_freq(AR5315_SYSREG_CPUCLK);
229 1.3.8.2 yamt return (freq);
230 1.3.8.2 yamt }
231 1.3.8.2 yamt
232 1.3.8.2 yamt uint32_t
233 1.3.8.2 yamt ar531x_bus_freq(void)
234 1.3.8.2 yamt {
235 1.3.8.2 yamt static uint32_t freq = 0;
236 1.3.8.2 yamt if (freq == 0)
237 1.3.8.2 yamt freq = get_freq(AR5315_SYSREG_AMBACLK);
238 1.3.8.2 yamt return (freq);
239 1.3.8.2 yamt }
240 1.3.8.2 yamt
241 1.3.8.2 yamt static void
242 1.3.8.2 yamt addprop_data(struct device *dev, const char *name, const uint8_t *data,
243 1.3.8.2 yamt int len)
244 1.3.8.2 yamt {
245 1.3.8.2 yamt prop_data_t pd;
246 1.3.8.2 yamt pd = prop_data_create_data(data, len);
247 1.3.8.2 yamt KASSERT(pd != NULL);
248 1.3.8.2 yamt if (prop_dictionary_set(device_properties(dev), name, pd) == FALSE) {
249 1.3.8.2 yamt printf("WARNING: unable to set %s property for %s\n",
250 1.3.8.2 yamt name, device_xname(dev));
251 1.3.8.2 yamt }
252 1.3.8.2 yamt prop_object_release(pd);
253 1.3.8.2 yamt }
254 1.3.8.2 yamt
255 1.3.8.2 yamt static void
256 1.3.8.2 yamt addprop_integer(struct device *dev, const char *name, uint32_t val)
257 1.3.8.2 yamt {
258 1.3.8.2 yamt prop_number_t pn;
259 1.3.8.2 yamt pn = prop_number_create_integer(val);
260 1.3.8.2 yamt KASSERT(pn != NULL);
261 1.3.8.2 yamt if (prop_dictionary_set(device_properties(dev), name, pn) == FALSE) {
262 1.3.8.2 yamt printf("WARNING: unable to set %s property for %s",
263 1.3.8.2 yamt name, device_xname(dev));
264 1.3.8.2 yamt }
265 1.3.8.2 yamt prop_object_release(pn);
266 1.3.8.2 yamt }
267 1.3.8.2 yamt
268 1.3.8.2 yamt void
269 1.3.8.2 yamt ar531x_device_register(struct device *dev, void *aux)
270 1.3.8.2 yamt {
271 1.3.8.2 yamt struct arbus_attach_args *aa = aux;
272 1.3.8.2 yamt const struct ar531x_boarddata *info;
273 1.3.8.2 yamt
274 1.3.8.2 yamt info = ar531x_board_info();
275 1.3.8.2 yamt if (info == NULL) {
276 1.3.8.2 yamt /* nothing known about this board! */
277 1.3.8.2 yamt return;
278 1.3.8.2 yamt }
279 1.3.8.2 yamt
280 1.3.8.2 yamt /*
281 1.3.8.2 yamt * We don't ever know the boot device. But that's because the
282 1.3.8.2 yamt * firmware only loads from the network.
283 1.3.8.2 yamt */
284 1.3.8.2 yamt
285 1.3.8.2 yamt /* Fetch the MAC addresses. */
286 1.3.8.2 yamt if (device_is_a(dev, "ae")) {
287 1.3.8.2 yamt const uint8_t *enet;
288 1.3.8.2 yamt
289 1.3.8.2 yamt if (aa->aa_addr == AR5315_ENET_BASE)
290 1.3.8.2 yamt enet = info->enet0Mac;
291 1.3.8.2 yamt else
292 1.3.8.2 yamt return;
293 1.3.8.2 yamt
294 1.3.8.2 yamt addprop_data(dev, "mac-addr", enet, ETHER_ADDR_LEN);
295 1.3.8.2 yamt }
296 1.3.8.2 yamt
297 1.3.8.2 yamt if (device_is_a(dev, "ath")) {
298 1.3.8.2 yamt const uint8_t *enet;
299 1.3.8.2 yamt
300 1.3.8.2 yamt if (aa->aa_addr == AR5315_WLAN_BASE)
301 1.3.8.2 yamt enet = info->wlan0Mac;
302 1.3.8.2 yamt else
303 1.3.8.2 yamt return;
304 1.3.8.2 yamt
305 1.3.8.2 yamt addprop_data(dev, "mac-addr", enet, ETHER_ADDR_LEN);
306 1.3.8.2 yamt
307 1.3.8.2 yamt addprop_integer(dev, "wmac-rev",
308 1.3.8.2 yamt GETSYSREG(AR5315_SYSREG_SREV));
309 1.3.8.2 yamt }
310 1.3.8.2 yamt
311 1.3.8.2 yamt if (device_is_a(dev, "com")) {
312 1.3.8.2 yamt addprop_integer(dev, "frequency", ar531x_bus_freq());
313 1.3.8.2 yamt }
314 1.3.8.2 yamt
315 1.3.8.2 yamt if (device_is_a(dev, "argpio")) {
316 1.3.8.2 yamt if (info->config & BD_RSTFACTORY) {
317 1.3.8.2 yamt addprop_integer(dev, "reset-pin",
318 1.3.8.2 yamt info->resetConfigGpio);
319 1.3.8.2 yamt }
320 1.3.8.2 yamt if (info->config & BD_SYSLED) {
321 1.3.8.2 yamt addprop_integer(dev, "sysled-pin",
322 1.3.8.2 yamt info->sysLedGpio);
323 1.3.8.2 yamt }
324 1.3.8.2 yamt }
325 1.3.8.2 yamt }
326 1.3.8.2 yamt
327 1.3.8.2 yamt const struct ar531x_device *
328 1.3.8.2 yamt ar531x_get_devices(void)
329 1.3.8.2 yamt {
330 1.3.8.2 yamt const static struct ar531x_device devices[] = {
331 1.3.8.2 yamt {
332 1.3.8.2 yamt "com",
333 1.3.8.2 yamt AR5315_UART_BASE, 0x1000,
334 1.3.8.2 yamt AR5315_CPU_IRQ_MISC, AR5315_MISC_IRQ_UART,
335 1.3.8.2 yamt 0, 0, 0
336 1.3.8.2 yamt },
337 1.3.8.2 yamt {
338 1.3.8.2 yamt "ae",
339 1.3.8.2 yamt AR5315_ENET_BASE, 0x100000,
340 1.3.8.2 yamt AR5315_CPU_IRQ_ENET, -1,
341 1.3.8.2 yamt 0, 0, 0
342 1.3.8.2 yamt },
343 1.3.8.2 yamt {
344 1.3.8.2 yamt "ath",
345 1.3.8.2 yamt AR5315_WLAN_BASE, 0x100000,
346 1.3.8.2 yamt AR5315_CPU_IRQ_WLAN, -1,
347 1.3.8.2 yamt 0, 0, 0
348 1.3.8.2 yamt },
349 1.3.8.2 yamt {
350 1.3.8.2 yamt "arspi",
351 1.3.8.2 yamt AR5315_SPI_BASE, 0x10,
352 1.3.8.2 yamt AR5315_CPU_IRQ_MISC, AR5315_MISC_IRQ_SPI,
353 1.3.8.2 yamt 0, 0, 0
354 1.3.8.2 yamt },
355 1.3.8.2 yamt { NULL }
356 1.3.8.2 yamt };
357 1.3.8.2 yamt
358 1.3.8.2 yamt return devices;
359 1.3.8.2 yamt }
360 1.3.8.2 yamt
361 1.3.8.2 yamt int
362 1.3.8.2 yamt ar531x_enable_device(const struct ar531x_device *dev)
363 1.3.8.2 yamt {
364 1.3.8.2 yamt if (dev->addr == AR5315_WLAN_BASE) {
365 1.3.8.2 yamt /* enable arbitration for wlan */
366 1.3.8.2 yamt PUTSYSREG(AR5315_SYSREG_AHB_ARB_CTL,
367 1.3.8.2 yamt GETSYSREG(AR5315_SYSREG_AHB_ARB_CTL) | AR5315_ARB_WLAN);
368 1.3.8.2 yamt
369 1.3.8.2 yamt /* set WLAN for big endian */
370 1.3.8.2 yamt PUTSYSREG(AR5315_SYSREG_ENDIAN,
371 1.3.8.2 yamt GETSYSREG(AR5315_SYSREG_ENDIAN) | AR5315_ENDIAN_WLAN);
372 1.3.8.2 yamt
373 1.3.8.2 yamt /* wake up the mac */
374 1.3.8.2 yamt PUTPCIREG(AR5315_PCI_MAC_SCR,
375 1.3.8.2 yamt (GETPCIREG(AR5315_PCI_MAC_SCR) & ~PCI_MAC_SCR_SLM_MASK) |
376 1.3.8.2 yamt PCI_MAC_SCR_SLM_FWAKE);
377 1.3.8.2 yamt
378 1.3.8.2 yamt /* wait for it to wake up */
379 1.3.8.2 yamt while (GETPCIREG(AR5315_PCI_MAC_PCICFG) &
380 1.3.8.2 yamt PCI_MAC_PCICFG_SPWR_DN);
381 1.3.8.2 yamt }
382 1.3.8.2 yamt return 0;
383 1.3.8.2 yamt }
384