]> git.enpas.org Git - openwrt.git/blob - openwrt/target/linux/linux-2.4/patches/ar531x/000-atheros-support.patch
1ec012f63082fdf3b58cfdc72559dedebaa11e03
[openwrt.git] / openwrt / target / linux / linux-2.4 / patches / ar531x / 000-atheros-support.patch
1 diff -urN linux-2.4.32/arch/mips/ar531x/ar531xdbg_io.c linux-2.4.32.new/arch/mips/ar531x/ar531xdbg_io.c\r
2 --- linux-2.4.32/arch/mips/ar531x/ar531xdbg_io.c        1970-01-01 01:00:00.000000000 +0100\r
3 +++ linux-2.4.32.new/arch/mips/ar531x/ar531xdbg_io.c    2005-12-24 20:29:42.102311328 +0000\r
4 @@ -0,0 +1,217 @@\r
5 +/*\r
6 + * This file is subject to the terms and conditions of the GNU General Public\r
7 + * License.  See the file "COPYING" in the main directory of this archive\r
8 + * for more details.\r
9 + *\r
10 + * Copyright MontaVista Software Inc\r
11 + * Copyright © 2003 Atheros Communications, Inc.,  All Rights Reserved.\r
12 + */\r
13 +\r
14 +/*\r
15 + * Basic support for polled character input/output\r
16 + * using the AR531X's serial port.\r
17 + */\r
18 +\r
19 +#include <linux/config.h>\r
20 +#include <linux/init.h>\r
21 +#include <linux/delay.h>\r
22 +#include <linux/irq.h>\r
23 +#include <linux/interrupt.h>\r
24 +#include <linux/serial.h>\r
25 +#include <linux/types.h>\r
26 +#include <linux/string.h>\r
27 +\r
28 +#include <asm/reboot.h>\r
29 +#include <asm/io.h>\r
30 +#include <asm/time.h>\r
31 +#include <asm/pgtable.h>\r
32 +#include <asm/processor.h>\r
33 +#include <asm/reboot.h>\r
34 +#include <asm/system.h>\r
35 +#include <asm/serial.h>\r
36 +#include <asm/gdb-stub.h>\r
37 +\r
38 +#include "ar531xlnx.h"\r
39 +\r
40 +#if CONFIG_EARLY_PRINTK_HACK || CONFIG_KGDB\r
41 +/* base addr of uart and clock timing */\r
42 +#define         BASE                    0xbc000003\r
43 +\r
44 +/* distance in bytes between two serial registers */\r
45 +#define         REG_OFFSET              4\r
46 +\r
47 +/*\r
48 + * 0 - we need to do serial init\r
49 + * 1 - skip serial init\r
50 + */\r
51 +static int serialPortInitialized = 0;\r
52 +\r
53 +/*\r
54 + *  * the default baud rate *if* we do serial init\r
55 + *   */\r
56 +#define         BAUD_DEFAULT            UART16550_BAUD_9600\r
57 +\r
58 +/* === END OF CONFIG === */\r
59 +\r
60 +#define         UART16550_BAUD_2400             2400\r
61 +#define         UART16550_BAUD_4800             4800\r
62 +#define         UART16550_BAUD_9600             9600\r
63 +#define         UART16550_BAUD_19200            19200\r
64 +#define         UART16550_BAUD_38400            38400\r
65 +#define         UART16550_BAUD_57600            57600\r
66 +#define         UART16550_BAUD_115200           115200\r
67 +\r
68 +#define         UART16550_PARITY_NONE           0\r
69 +#define         UART16550_PARITY_ODD            0x08\r
70 +#define         UART16550_PARITY_EVEN           0x18\r
71 +#define         UART16550_PARITY_MARK           0x28\r
72 +#define         UART16550_PARITY_SPACE          0x38\r
73 +\r
74 +#define         UART16550_DATA_5BIT             0x0\r
75 +#define         UART16550_DATA_6BIT             0x1\r
76 +#define         UART16550_DATA_7BIT             0x2\r
77 +#define         UART16550_DATA_8BIT             0x3\r
78 +\r
79 +#define         UART16550_STOP_1BIT             0x0\r
80 +#define         UART16550_STOP_2BIT             0x4\r
81 +\r
82 +/* register offset */\r
83 +#define         OFS_RCV_BUFFER          (0*REG_OFFSET)\r
84 +#define         OFS_TRANS_HOLD          (0*REG_OFFSET)\r
85 +#define         OFS_SEND_BUFFER         (0*REG_OFFSET)\r
86 +#define         OFS_INTR_ENABLE         (1*REG_OFFSET)\r
87 +#define         OFS_INTR_ID             (2*REG_OFFSET)\r
88 +#define         OFS_DATA_FORMAT         (3*REG_OFFSET)\r
89 +#define         OFS_LINE_CONTROL        (3*REG_OFFSET)\r
90 +#define         OFS_MODEM_CONTROL       (4*REG_OFFSET)\r
91 +#define         OFS_RS232_OUTPUT        (4*REG_OFFSET)\r
92 +#define         OFS_LINE_STATUS         (5*REG_OFFSET)\r
93 +#define         OFS_MODEM_STATUS        (6*REG_OFFSET)\r
94 +#define         OFS_RS232_INPUT         (6*REG_OFFSET)\r
95 +#define         OFS_SCRATCH_PAD         (7*REG_OFFSET)\r
96 +\r
97 +#define         OFS_DIVISOR_LSB         (0*REG_OFFSET)\r
98 +#define         OFS_DIVISOR_MSB         (1*REG_OFFSET)\r
99 +\r
100 +\r
101 +/* memory-mapped read/write of the port */\r
102 +#define         UART16550_READ(y)    (*((volatile u8*)(BASE + y)))\r
103 +#define         UART16550_WRITE(y, z)  ((*((volatile u8*)(BASE + y))) = z)\r
104 +\r
105 +void\r
106 +debugPortInit(u32 baud, u8 data, u8 parity, u8 stop)\r
107 +{\r
108 +       /* Pull UART out of reset */\r
109 +       sysRegWrite(AR531X_RESET,\r
110 +               sysRegRead(AR531X_RESET) & ~(AR531X_RESET_UART0));\r
111 +\r
112 +       /* disable interrupts */\r
113 +        UART16550_WRITE(OFS_LINE_CONTROL, 0x0);\r
114 +       UART16550_WRITE(OFS_INTR_ENABLE, 0);\r
115 +\r
116 +       /* set up buad rate */\r
117 +       { \r
118 +               u32 divisor;\r
119 +               u32 uart_clock_rate = ar531x_cpu_frequency() / 4;\r
120 +               u32 base_baud = uart_clock_rate / 16;\r
121 +       \r
122 +               /* set DIAB bit */\r
123 +               UART16550_WRITE(OFS_LINE_CONTROL, 0x80);\r
124 +        \r
125 +               /* set divisor */\r
126 +               divisor = base_baud / baud;\r
127 +               UART16550_WRITE(OFS_DIVISOR_LSB, divisor & 0xff);\r
128 +               UART16550_WRITE(OFS_DIVISOR_MSB, (divisor & 0xff00)>>8);\r
129 +\r
130 +               /* clear DIAB bit */\r
131 +               UART16550_WRITE(OFS_LINE_CONTROL, 0x0);\r
132 +       }\r
133 +\r
134 +       /* set data format */\r
135 +       UART16550_WRITE(OFS_DATA_FORMAT, data | parity | stop);\r
136 +}\r
137 +\r
138 +u8\r
139 +getDebugChar(void)\r
140 +{\r
141 +        if (!serialPortInitialized) {\r
142 +                serialPortInitialized = 1;\r
143 +                debugPortInit(BAUD_DEFAULT,\r
144 +                              UART16550_DATA_8BIT,\r
145 +                              UART16550_PARITY_NONE, UART16550_STOP_1BIT);\r
146 +        }\r
147 +\r
148 +       while((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0);\r
149 +       return UART16550_READ(OFS_RCV_BUFFER);\r
150 +}\r
151 +\r
152 +#if CONFIG_KGDB\r
153 +/*\r
154 + * Peek at the most recently received character.\r
155 + * Don't wait for a new character to be received.\r
156 + */\r
157 +u8\r
158 +peekDebugChar(void)\r
159 +{\r
160 +       return UART16550_READ(OFS_RCV_BUFFER);\r
161 +}\r
162 +\r
163 +static int kgdbInitialized = 0;\r
164 +\r
165 +void\r
166 +kgdbInit(void)\r
167 +{\r
168 +    sysRegWrite(AR531X_WD_CTRL, AR531X_WD_CTRL_IGNORE_EXPIRATION);\r
169 +\r
170 +    if (!kgdbInitialized) {\r
171 +        printk("Setting debug traps - please connect the remote debugger.\n");\r
172 +        set_debug_traps();\r
173 +        kgdbInitialized = 1;\r
174 +    }\r
175 +    breakpoint();\r
176 +}\r
177 +\r
178 +int\r
179 +kgdbEnabled(void)\r
180 +{\r
181 +    return kgdbInitialized;\r
182 +}\r
183 +\r
184 +#define DEBUG_CHAR '\001';\r
185 +\r
186 +int\r
187 +kgdbInterrupt(void)\r
188 +{\r
189 +    if (!kgdbInitialized) {\r
190 +        return 0;\r
191 +    }\r
192 +\r
193 +    /* \r
194 +     * Try to avoid swallowing too much input: Only consume\r
195 +     * a character if nothing new has arrived.  Yes, there's\r
196 +     * still a small hole here, and we may lose an input\r
197 +     * character now and then.\r
198 +     */\r
199 +    if (UART16550_READ(OFS_LINE_STATUS) & 1) {\r
200 +        return 0;\r
201 +    } else {\r
202 +        return UART16550_READ(OFS_RCV_BUFFER) == DEBUG_CHAR;\r
203 +    }\r
204 +}\r
205 +#endif\r
206 +\r
207 +\r
208 +void\r
209 +putDebugChar(char byte)\r
210 +{\r
211 +        if (!serialPortInitialized) {\r
212 +                serialPortInitialized = 1;\r
213 +                debugPortInit(BAUD_DEFAULT,\r
214 +                              UART16550_DATA_8BIT,\r
215 +                              UART16550_PARITY_NONE, UART16550_STOP_1BIT);\r
216 +        }\r
217 +\r
218 +       while ((UART16550_READ(OFS_LINE_STATUS) &0x20) == 0);\r
219 +       UART16550_WRITE(OFS_SEND_BUFFER, byte);\r
220 + }\r
221 +#endif /* CONFIG_EARLY_PRINTK_HACK || CONFIG_KGDB */\r
222 diff -urN linux-2.4.32/arch/mips/ar531x/ar531xgpio.c linux-2.4.32.new/arch/mips/ar531x/ar531xgpio.c\r
223 --- linux-2.4.32/arch/mips/ar531x/ar531xgpio.c  1970-01-01 01:00:00.000000000 +0100\r
224 +++ linux-2.4.32.new/arch/mips/ar531x/ar531xgpio.c      2005-12-24 20:29:42.102311328 +0000\r
225 @@ -0,0 +1,141 @@\r
226 +/*\r
227 + * This file is subject to the terms and conditions of the GNU General Public\r
228 + * License.  See the file "COPYING" in the main directory of this archive\r
229 + * for more details.\r
230 + *\r
231 + * Copyright © 2003 Atheros Communications, Inc.,  All Rights Reserved.\r
232 + */\r
233 +\r
234 +/*\r
235 + * Support for GPIO -- General Purpose Input/Output Pins\r
236 + */\r
237 +\r
238 +#include <linux/config.h>\r
239 +#include <linux/kernel.h>\r
240 +#include <linux/signal.h>\r
241 +#include <linux/interrupt.h>\r
242 +#include <linux/irq.h>\r
243 +\r
244 +#include "ar531xlnx.h"\r
245 +\r
246 +/* GPIO Interrupt Support */\r
247 +\r
248 +/* Turn on the specified AR531X_GPIO_IRQ interrupt */\r
249 +static unsigned int\r
250 +ar531x_gpio_intr_startup(unsigned int irq)\r
251 +{\r
252 +       ar531x_gpio_intr_enable(irq);\r
253 +       return 0;\r
254 +}\r
255 +\r
256 +/* Turn off the specified AR531X_GPIO_IRQ interrupt */\r
257 +static void\r
258 +ar531x_gpio_intr_shutdown(unsigned int irq)\r
259 +{\r
260 +       ar531x_gpio_intr_disable(irq);\r
261 +}\r
262 +\r
263 +u32 gpioIntMask = 0;\r
264 +\r
265 +/* Enable the specified AR531X_GPIO_IRQ interrupt */\r
266 +void\r
267 +ar531x_gpio_intr_enable(unsigned int irq)\r
268 +{\r
269 +    u32 reg;\r
270 +    int gpio;\r
271 +\r
272 +    gpio = irq - AR531X_GPIO_IRQ_BASE;\r
273 +    gpioIntMask |= gpio;\r
274 +\r
275 +    reg = sysRegRead(AR531X_GPIO_CR);\r
276 +    reg &= ~(GPIO_CR_M(gpio) | GPIO_CR_UART(gpio) | GPIO_CR_INT(gpio));\r
277 +    reg |= GPIO_CR_I(gpio);\r
278 +    reg |= GPIO_CR_INT(gpio);\r
279 +\r
280 +    sysRegWrite(AR531X_GPIO_CR, reg);\r
281 +    (void)sysRegRead(AR531X_GPIO_CR); /* flush to hardware */\r
282 +}\r
283 +\r
284 +/* Disable the specified AR531X_GPIO_IRQ interrupt */\r
285 +void\r
286 +ar531x_gpio_intr_disable(unsigned int irq)\r
287 +{\r
288 +    u32 reg;\r
289 +    int gpio;\r
290 +\r
291 +    gpio = irq - AR531X_GPIO_IRQ_BASE;\r
292 +\r
293 +    reg = sysRegRead(AR531X_GPIO_CR);\r
294 +    reg &= ~(GPIO_CR_M(gpio) | GPIO_CR_UART(gpio) | GPIO_CR_INT(gpio));\r
295 +    reg |= GPIO_CR_I(gpio);\r
296 +    /* No GPIO_CR_INT bit */\r
297 +\r
298 +    sysRegWrite(AR531X_GPIO_CR, reg);\r
299 +    (void)sysRegRead(AR531X_GPIO_CR); /* flush to hardware */\r
300 +\r
301 +    gpioIntMask &= ~gpio;\r
302 +}\r
303 +\r
304 +static void\r
305 +ar531x_gpio_intr_ack(unsigned int irq)\r
306 +{\r
307 +       ar531x_gpio_intr_disable(irq);\r
308 +}\r
309 +\r
310 +static void\r
311 +ar531x_gpio_intr_end(unsigned int irq)\r
312 +{\r
313 +       if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))\r
314 +               ar531x_gpio_intr_enable(irq);\r
315 +}\r
316 +\r
317 +static void\r
318 +ar531x_gpio_intr_set_affinity(unsigned int irq, unsigned long mask)\r
319 +{\r
320 +       /* Only 1 CPU; ignore affinity request */\r
321 +}\r
322 +\r
323 +int ar531x_gpio_irq_base;\r
324 +\r
325 +struct hw_interrupt_type ar531x_gpio_intr_controller = {\r
326 +       "AR531X GPIO",\r
327 +       ar531x_gpio_intr_startup,\r
328 +       ar531x_gpio_intr_shutdown,\r
329 +       ar531x_gpio_intr_enable,\r
330 +       ar531x_gpio_intr_disable,\r
331 +       ar531x_gpio_intr_ack,\r
332 +       ar531x_gpio_intr_end,\r
333 +       ar531x_gpio_intr_set_affinity,\r
334 +};\r
335 +\r
336 +void\r
337 +ar531x_gpio_intr_init(int irq_base)\r
338 +{\r
339 +       int i;\r
340 +\r
341 +       for (i = irq_base; i < irq_base + AR531X_GPIO_IRQ_COUNT; i++) {\r
342 +               irq_desc[i].status = IRQ_DISABLED;\r
343 +               irq_desc[i].action = NULL;\r
344 +               irq_desc[i].depth = 1;\r
345 +               irq_desc[i].handler = &ar531x_gpio_intr_controller;\r
346 +       }\r
347 +\r
348 +       ar531x_gpio_irq_base = irq_base;\r
349 +}\r
350 +\r
351 +/* ARGSUSED */\r
352 +void\r
353 +spurious_gpio_handler(int cpl, void *dev_id, struct pt_regs *regs)\r
354 +{\r
355 +    u32 gpioDataIn;\r
356 +\r
357 +    gpioDataIn = sysRegRead(AR531X_GPIO_DI) & gpioIntMask;\r
358 +\r
359 +    printk("spurious_gpio_handler: 0x%x di=0x%8.8x gpioIntMask=0x%8.8x\n",\r
360 +           cpl, gpioDataIn, gpioIntMask);\r
361 +}\r
362 +\r
363 +struct irqaction spurious_gpio =\r
364 +       {spurious_gpio_handler, SA_INTERRUPT, 0, "spurious_gpio",\r
365 +            NULL, NULL};\r
366 +\r
367 diff -urN linux-2.4.32/arch/mips/ar531x/ar531x.h linux-2.4.32.new/arch/mips/ar531x/ar531x.h\r
368 --- linux-2.4.32/arch/mips/ar531x/ar531x.h      1970-01-01 01:00:00.000000000 +0100\r
369 +++ linux-2.4.32.new/arch/mips/ar531x/ar531x.h  2005-12-24 20:29:42.102311328 +0000\r
370 @@ -0,0 +1,280 @@\r
371 +/*\r
372 + * This file is subject to the terms and conditions of the GNU General Public\r
373 + * License.  See the file "COPYING" in the main directory of this archive\r
374 + * for more details.\r
375 + *\r
376 + * Copyright © 2003 Atheros Communications, Inc.,  All Rights Reserved.\r
377 + */\r
378 +\r
379 +#ifndef AR531X_H\r
380 +#define AR531X_H 1\r
381 +\r
382 +#include <asm/addrspace.h>\r
383 +\r
384 +/* Address Map */\r
385 +#define AR531X_WLAN0            0x18000000\r
386 +#define AR531X_WLAN1            0x18500000\r
387 +#define AR531X_ENET0            0x18100000\r
388 +#define AR531X_ENET1            0x18200000\r
389 +#define AR531X_SDRAMCTL         0x18300000\r
390 +#define AR531X_FLASHCTL         0x18400000\r
391 +#define AR531X_APBBASE         0x1c000000\r
392 +#define AR531X_FLASH            0x1e000000\r
393 +\r
394 +/*\r
395 + * AR531X_NUM_ENET_MAC defines the number of ethernet MACs that\r
396 + * should be considered available.  The AR5312 supports 2 enet MACS,\r
397 + * even though many reference boards only actually use 1 of them\r
398 + * (i.e. Only MAC 0 is actually connected to an enet PHY or PHY switch.\r
399 + * The AR2312 supports 1 enet MAC.\r
400 + */\r
401 +#define AR531X_NUM_ENET_MAC             2\r
402 +\r
403 +/*\r
404 + * Need these defines to determine true number of ethernet MACs\r
405 + */\r
406 +#define AR5212_AR5312_REV2      0x0052          /* AR5312 WMAC (AP31) */\r
407 +#define AR5212_AR5312_REV7      0x0057          /* AR5312 WMAC (AP30-040) */\r
408 +#define AR5212_AR2313_REV8      0x0058          /* AR2313 WMAC (AP43-030) */\r
409 +#define AR531X_RADIO_MASK_OFF  0xc8\r
410 +#define AR531X_RADIO0_MASK     0x0003\r
411 +#define AR531X_RADIO1_MASK     0x000c\r
412 +#define AR531X_RADIO1_S        2 \r
413 +\r
414 +/*\r
415 + * AR531X_NUM_WMAC defines the number of Wireless MACs that\\r
416 + * should be considered available.\r
417 + */\r
418 +#define AR531X_NUM_WMAC                 2\r
419 +\r
420 +/* Reset/Timer Block Address Map */\r
421 +#define AR531X_RESETTMR                (AR531X_APBBASE  + 0x3000)\r
422 +#define AR531X_TIMER           (AR531X_RESETTMR + 0x0000) /* countdown timer */\r
423 +#define AR531X_WD_CTRL          (AR531X_RESETTMR + 0x0008) /* watchdog cntrl */\r
424 +#define AR531X_WD_TIMER         (AR531X_RESETTMR + 0x000c) /* watchdog timer */\r
425 +#define AR531X_ISR             (AR531X_RESETTMR + 0x0010) /* Intr Status Reg */\r
426 +#define AR531X_IMR             (AR531X_RESETTMR + 0x0014) /* Intr Mask Reg */\r
427 +#define AR531X_RESET           (AR531X_RESETTMR + 0x0020)\r
428 +#define AR5312_CLOCKCTL1       (AR531X_RESETTMR + 0x0064)\r
429 +#define AR5312_SCRATCH         (AR531X_RESETTMR + 0x006c)\r
430 +#define AR531X_PROCADDR                (AR531X_RESETTMR + 0x0070)\r
431 +#define AR531X_PROC1           (AR531X_RESETTMR + 0x0074)\r
432 +#define AR531X_DMAADDR         (AR531X_RESETTMR + 0x0078)\r
433 +#define AR531X_DMA1            (AR531X_RESETTMR + 0x007c)\r
434 +#define AR531X_ENABLE           (AR531X_RESETTMR + 0x0080) /* interface enb */\r
435 +#define AR531X_REV             (AR531X_RESETTMR + 0x0090) /* revision */\r
436 +\r
437 +/* AR531X_WD_CTRL register bit field definitions */\r
438 +#define AR531X_WD_CTRL_IGNORE_EXPIRATION 0x0000\r
439 +#define AR531X_WD_CTRL_NMI               0x0001\r
440 +#define AR531X_WD_CTRL_RESET             0x0002\r
441 +\r
442 +/* AR531X_ISR register bit field definitions */\r
443 +#define AR531X_ISR_NONE                0x0000\r
444 +#define AR531X_ISR_TIMER       0x0001\r
445 +#define AR531X_ISR_AHBPROC     0x0002\r
446 +#define AR531X_ISR_AHBDMA      0x0004\r
447 +#define AR531X_ISR_GPIO                0x0008\r
448 +#define AR531X_ISR_UART0       0x0010\r
449 +#define AR531X_ISR_UART0DMA    0x0020\r
450 +#define AR531X_ISR_WD          0x0040\r
451 +#define AR531X_ISR_LOCAL       0x0080\r
452 +\r
453 +/* AR531X_RESET register bit field definitions */\r
454 +#define AR531X_RESET_SYSTEM     0x00000001  /* cold reset full system */\r
455 +#define AR531X_RESET_PROC       0x00000002  /* cold reset MIPS core */\r
456 +#define AR531X_RESET_WLAN0      0x00000004  /* cold reset WLAN MAC and BB */\r
457 +#define AR531X_RESET_EPHY0      0x00000008  /* cold reset ENET0 phy */\r
458 +#define AR531X_RESET_EPHY1      0x00000010  /* cold reset ENET1 phy */\r
459 +#define AR531X_RESET_ENET0      0x00000020  /* cold reset ENET0 mac */\r
460 +#define AR531X_RESET_ENET1      0x00000040  /* cold reset ENET1 mac */\r
461 +#define AR531X_RESET_UART0      0x00000100  /* cold reset UART0 (high speed) */\r
462 +#define AR531X_RESET_WLAN1      0x00000200  /* cold reset WLAN MAC/BB */\r
463 +#define AR531X_RESET_APB        0x00000400  /* cold reset APB (ar5312) */\r
464 +#define AR531X_RESET_WARM_PROC  0x00001000  /* warm reset MIPS core */\r
465 +#define AR531X_RESET_WARM_WLAN0_MAC 0x00002000  /* warm reset WLAN0 MAC */\r
466 +#define AR531X_RESET_WARM_WLAN0_BB  0x00004000  /* warm reset WLAN0 BaseBand */\r
467 +#define AR531X_RESET_NMI        0x00010000  /* send an NMI to the processor */\r
468 +#define AR531X_RESET_WARM_WLAN1_MAC 0x00020000  /* warm reset WLAN1 mac */\r
469 +#define AR531X_RESET_WARM_WLAN1_BB  0x00040000  /* warm reset WLAN1 baseband */\r
470 +#define AR531X_RESET_LOCAL_BUS  0x00080000  /* reset local bus */\r
471 +#define AR531X_RESET_WDOG       0x00100000  /* last reset was a watchdog */\r
472 +\r
473 +#define AR531X_RESET_WMAC0_BITS \\r
474 +        AR531X_RESET_WLAN0 |\\r
475 +        AR531X_RESET_WARM_WLAN0_MAC |\\r
476 +        AR531X_RESET_WARM_WLAN0_BB\r
477 +\r
478 +#define AR531X_RESERT_WMAC1_BITS \\r
479 +        AR531X_RESET_WLAN1 |\\r
480 +        AR531X_RESET_WARM_WLAN1_MAC |\\r
481 +        AR531X_RESET_WARM_WLAN1_BB\r
482 +\r
483 +/* AR5312_CLOCKCTL1 register bit field definitions */\r
484 +#define AR5312_CLOCKCTL1_PREDIVIDE_MASK    0x00000030\r
485 +#define AR5312_CLOCKCTL1_PREDIVIDE_SHIFT            4\r
486 +#define AR5312_CLOCKCTL1_MULTIPLIER_MASK   0x00001f00\r
487 +#define AR5312_CLOCKCTL1_MULTIPLIER_SHIFT           8\r
488 +#define AR5312_CLOCKCTL1_DOUBLER_MASK      0x00010000\r
489 +\r
490 +/* Valid for AR5312 and AR2312 */\r
491 +#define AR5312_CLOCKCTL1_PREDIVIDE_MASK    0x00000030\r
492 +#define AR5312_CLOCKCTL1_PREDIVIDE_SHIFT            4\r
493 +#define AR5312_CLOCKCTL1_MULTIPLIER_MASK   0x00001f00\r
494 +#define AR5312_CLOCKCTL1_MULTIPLIER_SHIFT           8\r
495 +#define AR5312_CLOCKCTL1_DOUBLER_MASK      0x00010000\r
496 +\r
497 +/* Valid for AR2313 */\r
498 +#define AR2313_CLOCKCTL1_PREDIVIDE_MASK    0x00003000\r
499 +#define AR2313_CLOCKCTL1_PREDIVIDE_SHIFT           12\r
500 +#define AR2313_CLOCKCTL1_MULTIPLIER_MASK   0x001f0000\r
501 +#define AR2313_CLOCKCTL1_MULTIPLIER_SHIFT          16\r
502 +#define AR2313_CLOCKCTL1_DOUBLER_MASK      0x00000000\r
503 +\r
504 +\r
505 +/* AR531X_ENABLE register bit field definitions */\r
506 +#define AR531X_ENABLE_WLAN0              0x0001\r
507 +#define AR531X_ENABLE_ENET0              0x0002\r
508 +#define AR531X_ENABLE_ENET1              0x0004\r
509 +#define AR531X_ENABLE_UART_AND_WLAN1_PIO 0x0008   /* UART, and WLAN1 PIOs */\r
510 +#define AR531X_ENABLE_WLAN1_DMA          0x0010   /* WLAN1 DMAs */\r
511 +#define AR531X_ENABLE_WLAN1 \\r
512 +            (AR531X_ENABLE_UART_AND_WLAN1_PIO | AR531X_ENABLE_WLAN1_DMA)\r
513 +\r
514 +/* AR531X_REV register bit field definitions */\r
515 +#define AR531X_REV_WMAC_MAJ    0xf000\r
516 +#define AR531X_REV_WMAC_MAJ_S  12\r
517 +#define AR531X_REV_WMAC_MIN    0x0f00\r
518 +#define AR531X_REV_WMAC_MIN_S  8\r
519 +#define AR531X_REV_MAJ         0x00f0\r
520 +#define AR531X_REV_MAJ_S       4\r
521 +#define AR531X_REV_MIN         0x000f\r
522 +#define AR531X_REV_MIN_S       0\r
523 +#define AR531X_REV_CHIP        (REV_MAJ|REV_MIN)\r
524 +\r
525 +/* Major revision numbers, bits 7..4 of Revision ID register */\r
526 +#define AR531X_REV_MAJ_AR5312          0x4\r
527 +#define AR531X_REV_MAJ_AR2313          0x5\r
528 +\r
529 +/* Minor revision numbers, bits 3..0 of Revision ID register */\r
530 +#define AR5312_REV_MIN_DUAL     0x0     /* Dual WLAN version */\r
531 +#define AR5312_REV_MIN_SINGLE   0x1     /* Single WLAN version */\r
532 +\r
533 +/* AR531X_FLASHCTL register bit field definitions */\r
534 +#define FLASHCTL_IDCY   0x0000000f      /* Idle cycle turn around time */\r
535 +#define FLASHCTL_IDCY_S 0\r
536 +#define FLASHCTL_WST1   0x000003e0      /* Wait state 1 */\r
537 +#define FLASHCTL_WST1_S 5\r
538 +#define FLASHCTL_RBLE   0x00000400      /* Read byte lane enable */\r
539 +#define FLASHCTL_WST2   0x0000f800      /* Wait state 2 */\r
540 +#define FLASHCTL_WST2_S 11\r
541 +#define FLASHCTL_AC     0x00070000      /* Flash address check (added) */\r
542 +#define FLASHCTL_AC_S   16\r
543 +#define FLASHCTL_AC_128K 0x00000000\r
544 +#define FLASHCTL_AC_256K 0x00010000\r
545 +#define FLASHCTL_AC_512K 0x00020000\r
546 +#define FLASHCTL_AC_1M   0x00030000\r
547 +#define FLASHCTL_AC_2M   0x00040000\r
548 +#define FLASHCTL_AC_4M   0x00050000\r
549 +#define FLASHCTL_AC_8M   0x00060000\r
550 +#define FLASHCTL_AC_RES  0x00070000     /* 16MB is not supported */\r
551 +#define FLASHCTL_E      0x00080000      /* Flash bank enable (added) */\r
552 +#define FLASHCTL_BUSERR 0x01000000      /* Bus transfer error status flag */\r
553 +#define FLASHCTL_WPERR  0x02000000      /* Write protect error status flag */\r
554 +#define FLASHCTL_WP     0x04000000      /* Write protect */\r
555 +#define FLASHCTL_BM     0x08000000      /* Burst mode */\r
556 +#define FLASHCTL_MW     0x30000000      /* Memory width */\r
557 +#define FLASHCTL_MWx8   0x00000000      /* Memory width x8 */\r
558 +#define FLASHCTL_MWx16  0x10000000      /* Memory width x16 */\r
559 +#define FLASHCTL_MWx32  0x20000000      /* Memory width x32 (not supported) */\r
560 +#define FLASHCTL_ATNR   0x00000000      /* Access type == no retry */\r
561 +#define FLASHCTL_ATR    0x80000000      /* Access type == retry every */\r
562 +#define FLASHCTL_ATR4   0xc0000000      /* Access type == retry every 4 */\r
563 +\r
564 +/* ARM Flash Controller -- 3 flash banks with either x8 or x16 devices.  */\r
565 +#define AR531X_FLASHCTL0        (AR531X_FLASHCTL + 0x00)\r
566 +#define AR531X_FLASHCTL1        (AR531X_FLASHCTL + 0x04)\r
567 +#define AR531X_FLASHCTL2        (AR531X_FLASHCTL + 0x08)\r
568 +\r
569 +/* ARM SDRAM Controller -- just enough to determine memory size */\r
570 +#define AR531X_MEM_CFG1 (AR531X_SDRAMCTL + 0x04)\r
571 +#define MEM_CFG1_AC0    0x00000700      /* bank 0: SDRAM addr check (added) */\r
572 +#define MEM_CFG1_AC0_S  8\r
573 +#define MEM_CFG1_AC1    0x00007000      /* bank 1: SDRAM addr check (added) */\r
574 +#define MEM_CFG1_AC1_S  12\r
575 +\r
576 +/* GPIO Address Map */\r
577 +#define AR531X_GPIO         (AR531X_APBBASE  + 0x2000)\r
578 +#define AR531X_GPIO_DO      (AR531X_GPIO + 0x00)        /* output register */\r
579 +#define AR531X_GPIO_DI      (AR531X_GPIO + 0x04)        /* intput register */\r
580 +#define AR531X_GPIO_CR      (AR531X_GPIO + 0x08)        /* control register */\r
581 +\r
582 +/* GPIO Control Register bit field definitions */\r
583 +#define GPIO_CR_M(x)    (1 << (x))                      /* mask for i/o */\r
584 +#define GPIO_CR_O(x)    (0 << (x))                      /* mask for output */\r
585 +#define GPIO_CR_I(x)    (1 << (x))                      /* mask for input */\r
586 +#define GPIO_CR_INT(x)  (1 << ((x)+8))                  /* mask for interrupt */\r
587 +#define GPIO_CR_UART(x) (1 << ((x)+16))                 /* uart multiplex */\r
588 +\r
589 +\r
590 +typedef unsigned int AR531X_REG;\r
591 +\r
592 +#define sysRegRead(phys)       \\r
593 +       (*(volatile AR531X_REG *)PHYS_TO_K1(phys))\r
594 +\r
595 +#define sysRegWrite(phys, val) \\r
596 +       ((*(volatile AR531X_REG *)PHYS_TO_K1(phys)) = (val))\r
597 +\r
598 +\r
599 +/*\r
600 + * This is board-specific data that is stored in a "fixed" location in flash.\r
601 + * It is shared across operating systems, so it should not be changed lightly.\r
602 + * The main reason we need it is in order to extract the ethernet MAC\r
603 + * address(es).\r
604 + */\r
605 +struct ar531x_boarddata {\r
606 +    u32 magic;                       /* board data is valid */\r
607 +#define AR531X_BD_MAGIC 0x35333131   /* "5311", for all 531x platforms */\r
608 +    u16 cksum;                       /* checksum (starting with BD_REV 2) */\r
609 +    u16 rev;                         /* revision of this struct */\r
610 +#define BD_REV  4\r
611 +    char   boardName[64];            /* Name of board */\r
612 +    u16 major;                       /* Board major number */\r
613 +    u16 minor;                       /* Board minor number */\r
614 +    u32 config;                      /* Board configuration */\r
615 +#define BD_ENET0        0x00000001   /* ENET0 is stuffed */\r
616 +#define BD_ENET1        0x00000002   /* ENET1 is stuffed */\r
617 +#define BD_UART1        0x00000004   /* UART1 is stuffed */\r
618 +#define BD_UART0        0x00000008   /* UART0 is stuffed (dma) */\r
619 +#define BD_RSTFACTORY   0x00000010   /* Reset factory defaults stuffed */\r
620 +#define BD_SYSLED       0x00000020   /* System LED stuffed */\r
621 +#define BD_EXTUARTCLK   0x00000040   /* External UART clock */\r
622 +#define BD_CPUFREQ      0x00000080   /* cpu freq is valid in nvram */\r
623 +#define BD_SYSFREQ      0x00000100   /* sys freq is set in nvram */\r
624 +#define BD_WLAN0        0x00000200   /* Enable WLAN0 */\r
625 +#define BD_MEMCAP       0x00000400   /* CAP SDRAM @ memCap for testing */\r
626 +#define BD_DISWATCHDOG  0x00000800   /* disable system watchdog */\r
627 +#define BD_WLAN1        0x00001000   /* Enable WLAN1 (ar5212) */\r
628 +#define BD_ISCASPER     0x00002000   /* FLAG for AR2312 */\r
629 +#define BD_WLAN0_2G_EN  0x00004000   /* FLAG for radio0_2G */\r
630 +#define BD_WLAN0_5G_EN  0x00008000   /* FLAG for radio0_2G */\r
631 +#define BD_WLAN1_2G_EN  0x00020000   /* FLAG for radio0_2G */\r
632 +#define BD_WLAN1_5G_EN  0x00040000   /* FLAG for radio0_2G */\r
633 +    u16 resetConfigGpio;             /* Reset factory GPIO pin */\r
634 +    u16 sysLedGpio;                  /* System LED GPIO pin */\r
635 +\r
636 +    u32 cpuFreq;                     /* CPU core frequency in Hz */\r
637 +    u32 sysFreq;                     /* System frequency in Hz */\r
638 +    u32 cntFreq;                     /* Calculated C0_COUNT frequency */\r
639 +\r
640 +    u8  wlan0Mac[6];\r
641 +    u8  enet0Mac[6];\r
642 +    u8  enet1Mac[6];\r
643 +\r
644 +    u16 pciId;                       /* Pseudo PCIID for common code */\r
645 +    u16 memCap;                      /* cap bank1 in MB */\r
646 +\r
647 +    /* version 3 */\r
648 +    u8  wlan1Mac[6];                 /* (ar5212) */\r
649 +};\r
650 +#endif /* AR531X_H */\r
651 diff -urN linux-2.4.32/arch/mips/ar531x/ar531xintr.S linux-2.4.32.new/arch/mips/ar531x/ar531xintr.S\r
652 --- linux-2.4.32/arch/mips/ar531x/ar531xintr.S  1970-01-01 01:00:00.000000000 +0100\r
653 +++ linux-2.4.32.new/arch/mips/ar531x/ar531xintr.S      2005-12-24 20:29:42.103311176 +0000\r
654 @@ -0,0 +1,30 @@\r
655 +/*\r
656 + * This file is subject to the terms and conditions of the GNU General Public\r
657 + * License.  See the file "COPYING" in the main directory of this archive\r
658 + * for more details.\r
659 + *\r
660 + * Copyright © 2003 Atheros Communications, Inc.,  All Rights Reserved.\r
661 + */\r
662 +\r
663 +#include <asm/asm.h>\r
664 +#include <asm/mipsregs.h>\r
665 +#include <asm/regdef.h>\r
666 +#include <asm/stackframe.h>\r
667 +\r
668 +/*\r
669 + * Glue code to save registers and get us to the interrupt dispatcher\r
670 + */\r
671 +       .text\r
672 +       .set    noat\r
673 +       .align  5\r
674 +NESTED(ar531x_interrupt_receive, PT_SIZE, sp)\r
675 +       SAVE_ALL\r
676 +       CLI\r
677 +       .set    at\r
678 +\r
679 +       move    a0, sp\r
680 +       jal     ar531x_irq_dispatch\r
681 +\r
682 +       j       ret_from_irq\r
683 +\r
684 +       END(ar531x_interrupt_receive)\r
685 diff -urN linux-2.4.32/arch/mips/ar531x/ar531xirq.c linux-2.4.32.new/arch/mips/ar531x/ar531xirq.c\r
686 --- linux-2.4.32/arch/mips/ar531x/ar531xirq.c   1970-01-01 01:00:00.000000000 +0100\r
687 +++ linux-2.4.32.new/arch/mips/ar531x/ar531xirq.c       2005-12-24 20:29:42.132306768 +0000\r
688 @@ -0,0 +1,292 @@\r
689 +/*\r
690 + * This file is subject to the terms and conditions of the GNU General Public\r
691 + * License.  See the file "COPYING" in the main directory of this archive\r
692 + * for more details.\r
693 + *\r
694 + * Copyright © 2003 Atheros Communications, Inc.,  All Rights Reserved.\r
695 + */\r
696 +\r
697 +/*\r
698 + * Interrupt support for AR531X WiSOC.\r
699 + */\r
700 +\r
701 +#include <linux/config.h>\r
702 +#include <linux/init.h>\r
703 +#include <linux/kernel_stat.h>\r
704 +#include <linux/signal.h>\r
705 +#include <linux/sched.h>\r
706 +#include <linux/interrupt.h>\r
707 +#include <linux/slab.h>\r
708 +#include <linux/random.h>\r
709 +#include <linux/pm.h>\r
710 +#include <linux/delay.h>\r
711 +#include <linux/reboot.h>\r
712 +\r
713 +#include <asm/irq.h>\r
714 +#include <asm/mipsregs.h>\r
715 +#include <asm/gdb-stub.h>\r
716 +\r
717 +#include "ar531xlnx.h"\r
718 +#include <asm/irq_cpu.h>\r
719 +\r
720 +extern int setup_irq(unsigned int irq, struct irqaction *irqaction);\r
721 +\r
722 +static void ar531x_misc_intr_enable(unsigned int irq);\r
723 +static void ar531x_misc_intr_disable(unsigned int irq);\r
724 +\r
725 +/* Turn on the specified AR531X_MISC_IRQ interrupt */\r
726 +static unsigned int\r
727 +ar531x_misc_intr_startup(unsigned int irq)\r
728 +{\r
729 +       ar531x_misc_intr_enable(irq);\r
730 +       return 0;\r
731 +}\r
732 +\r
733 +/* Turn off the specified AR531X_MISC_IRQ interrupt */\r
734 +static void\r
735 +ar531x_misc_intr_shutdown(unsigned int irq)\r
736 +{\r
737 +       ar531x_misc_intr_disable(irq);\r
738 +}\r
739 +\r
740 +/* Enable the specified AR531X_MISC_IRQ interrupt */\r
741 +static void\r
742 +ar531x_misc_intr_enable(unsigned int irq)\r
743 +{\r
744 +       unsigned int imr;\r
745 +\r
746 +       imr = sysRegRead(AR531X_IMR);\r
747 +       imr |= (1 << (irq - AR531X_MISC_IRQ_BASE - 1));\r
748 +       sysRegWrite(AR531X_IMR, imr);\r
749 +       sysRegRead(AR531X_IMR); /* flush write buffer */\r
750 +}\r
751 +\r
752 +/* Disable the specified AR531X_MISC_IRQ interrupt */\r
753 +static void\r
754 +ar531x_misc_intr_disable(unsigned int irq)\r
755 +{\r
756 +       unsigned int imr;\r
757 +\r
758 +       imr = sysRegRead(AR531X_IMR);\r
759 +       imr &= ~(1 << (irq - AR531X_MISC_IRQ_BASE - 1));\r
760 +       sysRegWrite(AR531X_IMR, imr);\r
761 +       sysRegRead(AR531X_IMR); /* flush write buffer */\r
762 +}\r
763 +\r
764 +static void\r
765 +ar531x_misc_intr_ack(unsigned int irq)\r
766 +{\r
767 +       ar531x_misc_intr_disable(irq);\r
768 +}\r
769 +\r
770 +static void\r
771 +ar531x_misc_intr_end(unsigned int irq)\r
772 +{\r
773 +       if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))\r
774 +               ar531x_misc_intr_enable(irq);\r
775 +}\r
776 +\r
777 +static void\r
778 +ar531x_misc_intr_set_affinity(unsigned int irq, unsigned long mask)\r
779 +{\r
780 +       /* Only 1 CPU; ignore affinity request */\r
781 +}\r
782 +\r
783 +struct hw_interrupt_type ar531x_misc_intr_controller = {\r
784 +       "AR531X MISC",\r
785 +       ar531x_misc_intr_startup,\r
786 +       ar531x_misc_intr_shutdown,\r
787 +       ar531x_misc_intr_enable,\r
788 +       ar531x_misc_intr_disable,\r
789 +       ar531x_misc_intr_ack,\r
790 +       ar531x_misc_intr_end,\r
791 +       ar531x_misc_intr_set_affinity,\r
792 +};\r
793 +\r
794 +int ar531x_misc_irq_base;\r
795 +\r
796 +/*\r
797 + * Determine interrupt source among interrupts that use IP6\r
798 + */\r
799 +void\r
800 +ar531x_misc_intr_init(int irq_base)\r
801 +{\r
802 +       int i;\r
803 +\r
804 +       for (i = irq_base; i < irq_base + AR531X_MISC_IRQ_COUNT; i++) {\r
805 +               irq_desc[i].status = IRQ_DISABLED;\r
806 +               irq_desc[i].action = NULL;\r
807 +               irq_desc[i].depth = 1;\r
808 +               irq_desc[i].handler = &ar531x_misc_intr_controller;\r
809 +       }\r
810 +\r
811 +       ar531x_misc_irq_base = irq_base;\r
812 +}\r
813 +\r
814 +/* ARGSUSED */\r
815 +void\r
816 +spurious_irq_handler(int cpl, void *dev_id, struct pt_regs *regs)\r
817 +{\r
818 +    /* \r
819 +    printk("spurious_irq_handler: %d  cause=0x%8.8x  status=0x%8.8x\n",\r
820 +           cpl, cause_intrs, status_intrs); \r
821 +    */\r
822 +}\r
823 +\r
824 +/* ARGSUSED */\r
825 +void\r
826 +spurious_misc_handler(int cpl, void *dev_id, struct pt_regs *regs)\r
827 +{\r
828 +    /*\r
829 +    printk("spurious_misc_handler: 0x%x isr=0x%8.8x imr=0x%8.8x\n",\r
830 +           cpl, ar531x_isr, ar531x_imr);\r
831 +    */\r
832 +}\r
833 +\r
834 +void\r
835 +ar531x_timer_handler(int cpl, void *dev_id, struct pt_regs *regs)\r
836 +{\r
837 +       (void)sysRegRead(AR531X_TIMER); /* clear interrupt */\r
838 +}\r
839 +\r
840 +void\r
841 +ar531x_ahb_proc_handler(int cpl, void *dev_id, struct pt_regs *regs)\r
842 +{\r
843 +    u32 procAddr;\r
844 +    u32 proc1;\r
845 +    u32 dmaAddr;\r
846 +    u32 dma1;\r
847 +\r
848 +    proc1 = sysRegRead(AR531X_PROC1);\r
849 +    procAddr = sysRegRead(AR531X_PROCADDR); /* clears error state */\r
850 +    dma1 = sysRegRead(AR531X_DMA1);\r
851 +    dmaAddr = sysRegRead(AR531X_DMAADDR);   /* clears error state */\r
852 +\r
853 +    printk("AHB interrupt: PROCADDR=0x%8.8x  PROC1=0x%8.8x  DMAADDR=0x%8.8x  DMA1=0x%8.8x\n",\r
854 +        procAddr, proc1, dmaAddr, dma1);\r
855 +        \r
856 +    machine_restart("AHB error"); /* Catastrophic failure */\r
857 +}\r
858 +\r
859 +static struct irqaction cascade  =\r
860 +       {no_action, SA_INTERRUPT, 0, "cascade",\r
861 +            NULL, NULL};\r
862 +\r
863 +static struct irqaction spurious_irq =\r
864 +       {spurious_irq_handler, SA_INTERRUPT, 0, "spurious_irq",\r
865 +            NULL, NULL};\r
866 +\r
867 +static struct irqaction spurious_misc =\r
868 +       {spurious_misc_handler, SA_INTERRUPT, 0, "spurious_misc",\r
869 +            NULL, NULL};\r
870 +\r
871 +static struct irqaction ar531x_timer_interrupt =\r
872 +       {ar531x_timer_handler, SA_INTERRUPT, 0, "ar531x_timer_interrupt",\r
873 +            NULL, NULL};\r
874 +\r
875 +static struct irqaction ar531x_ahb_proc_interrupt =\r
876 +       {ar531x_ahb_proc_handler, SA_INTERRUPT, 0, "ar531x_ahb_proc_interrupt",\r
877 +            NULL, NULL};\r
878 +\r
879 +extern asmlinkage void ar531x_interrupt_receive(void);\r
880 +\r
881 +/*\r
882 + * Called when an interrupt is received, this function\r
883 + * determines exactly which interrupt it was, and it\r
884 + * invokes the appropriate handler.\r
885 + *\r
886 + * Implicitly, we also define interrupt priority by\r
887 + * choosing which to dispatch first.\r
888 + */\r
889 +void\r
890 +ar531x_irq_dispatch(struct pt_regs *regs)\r
891 +{\r
892 +       int cause_intrs = regs->cp0_cause;\r
893 +       int status_intrs = regs->cp0_status;\r
894 +       int pending = cause_intrs & status_intrs;\r
895 +\r
896 +       if (pending & CAUSEF_IP2) {\r
897 +               do_IRQ(AR531X_IRQ_WLAN0_INTRS, regs);\r
898 +       }               \r
899 +       else if (pending & CAUSEF_IP3) {\r
900 +               do_IRQ(AR531X_IRQ_ENET0_INTRS, regs);\r
901 +       }\r
902 +       else if (pending & CAUSEF_IP4) {\r
903 +               do_IRQ(AR531X_IRQ_ENET1_INTRS, regs);\r
904 +       }\r
905 +       else if (pending & CAUSEF_IP5) {\r
906 +               do_IRQ(AR531X_IRQ_WLAN1_INTRS, regs);\r
907 +       }\r
908 +       else if (pending & CAUSEF_IP6) {\r
909 +               AR531X_REG ar531x_isr = sysRegRead(AR531X_ISR);\r
910 +               AR531X_REG ar531x_imr = sysRegRead(AR531X_IMR);\r
911 +               unsigned int ar531x_misc_intrs = ar531x_isr & ar531x_imr;\r
912 +\r
913 +               if (ar531x_misc_intrs & AR531X_ISR_TIMER)\r
914 +                       do_IRQ(AR531X_MISC_IRQ_TIMER, regs);\r
915 +               else if (ar531x_misc_intrs & AR531X_ISR_AHBPROC)\r
916 +                       do_IRQ(AR531X_MISC_IRQ_AHB_PROC, regs);\r
917 +               else if (ar531x_misc_intrs & AR531X_ISR_AHBDMA)\r
918 +                       do_IRQ(AR531X_MISC_IRQ_AHB_DMA, regs);\r
919 +               else if (ar531x_misc_intrs & AR531X_ISR_GPIO)\r
920 +                {\r
921 +                    int i;\r
922 +                    u32 gpioIntPending;\r
923 +\r
924 +                    gpioIntPending = sysRegRead(AR531X_GPIO_DI) & gpioIntMask;\r
925 +                    for (i=0; i<AR531X_GPIO_IRQ_COUNT; i++) {\r
926 +                        if (gpioIntPending & (1 << i))\r
927 +                            do_IRQ(AR531X_GPIO_IRQ(i), regs);\r
928 +                    }\r
929 +                }\r
930 +               else if ((ar531x_misc_intrs & AR531X_ISR_UART0) ||\r
931 +                        (ar531x_misc_intrs & AR531X_ISR_UART0DMA)) {\r
932 +                       do_IRQ(AR531X_MISC_IRQ_UART0, regs);\r
933 +#if CONFIG_KGDB\r
934 +                        if (kgdbInterrupt()) {\r
935 +                                if (!user_mode(regs))\r
936 +                                   set_async_breakpoint((unsigned long *)&regs->cp0_epc);\r
937 +                        }\r
938 +#endif         /* CONFIG_KGDB */\r
939 +                }\r
940 +               else if (ar531x_misc_intrs & AR531X_ISR_WD)\r
941 +                       do_IRQ(AR531X_MISC_IRQ_WATCHDOG, regs);\r
942 +               else if (ar531x_misc_intrs & AR531X_ISR_LOCAL)\r
943 +                       do_IRQ(AR531X_MISC_IRQ_LOCAL, regs);\r
944 +               else\r
945 +                       do_IRQ(AR531X_MISC_IRQ_NONE, regs);\r
946 +       } else if (pending & CAUSEF_IP7)\r
947 +               do_IRQ(AR531X_IRQ_CPU_CLOCK, regs);\r
948 +       else\r
949 +               do_IRQ(AR531X_IRQ_NONE, regs);\r
950 +}\r
951 +\r
952 +void __init init_IRQ(void)\r
953 +{\r
954 +       init_generic_irq();\r
955 +       set_except_vector(0, ar531x_interrupt_receive);\r
956 +\r
957 +       /* Initialize interrupt controllers */\r
958 +       mips_cpu_irq_init(MIPS_CPU_IRQ_BASE);\r
959 +       ar531x_misc_intr_init(AR531X_MISC_IRQ_BASE);\r
960 +        ar531x_gpio_intr_init(AR531X_GPIO_IRQ_BASE);\r
961 +       setup_irq(AR531X_IRQ_MISC_INTRS, &cascade);\r
962 +       /*\r
963 +         * AR531X_IRQ_CPU_CLOCK is setup by ar531x_timer_setup.\r
964 +         */\r
965 +\r
966 +       /* Default "spurious interrupt" handlers */\r
967 +       setup_irq(AR531X_IRQ_NONE, &spurious_irq);\r
968 +       setup_irq(AR531X_MISC_IRQ_NONE, &spurious_misc);\r
969 +       setup_irq(AR531X_GPIO_IRQ_NONE, &spurious_gpio);\r
970 +\r
971 +       setup_irq(AR531X_MISC_IRQ_TIMER, &ar531x_timer_interrupt);\r
972 +       setup_irq(AR531X_MISC_IRQ_AHB_PROC, &ar531x_ahb_proc_interrupt);\r
973 +        setup_irq(AR531X_MISC_IRQ_GPIO, &cascade);\r
974 +\r
975 +#ifdef CONFIG_KGDB\r
976 +#if CONFIG_EARLY_STOP\r
977 +        kgdbInit();\r
978 +#endif\r
979 +#endif\r
980 +}\r
981 diff -urN linux-2.4.32/arch/mips/ar531x/ar531xksyms.c linux-2.4.32.new/arch/mips/ar531x/ar531xksyms.c\r
982 --- linux-2.4.32/arch/mips/ar531x/ar531xksyms.c 1970-01-01 01:00:00.000000000 +0100\r
983 +++ linux-2.4.32.new/arch/mips/ar531x/ar531xksyms.c     2005-12-24 20:29:42.132306768 +0000\r
984 @@ -0,0 +1,16 @@\r
985 +/*\r
986 + * This file is subject to the terms and conditions of the GNU General Public\r
987 + * License.  See the file "COPYING" in the main directory of this archive\r
988 + * for more details.\r
989 + *\r
990 + * Copyright © 2003 Atheros Communications, Inc.,  All Rights Reserved.\r
991 + */\r
992 +\r
993 +#include <linux/module.h>\r
994 +#include "asm/atheros/ar531xbsp.h"\r
995 +\r
996 +#if CONFIG_KGDB\r
997 +EXPORT_SYMBOL(kgdbInit);\r
998 +EXPORT_SYMBOL(kgdbEnabled);\r
999 +#endif\r
1000 +EXPORT_SYMBOL(ar531x_sys_frequency);\r
1001 diff -urN linux-2.4.32/arch/mips/ar531x/ar531xlnx.h linux-2.4.32.new/arch/mips/ar531x/ar531xlnx.h\r
1002 --- linux-2.4.32/arch/mips/ar531x/ar531xlnx.h   1970-01-01 01:00:00.000000000 +0100\r
1003 +++ linux-2.4.32.new/arch/mips/ar531x/ar531xlnx.h       2005-12-24 20:29:42.133306616 +0000\r
1004 @@ -0,0 +1,122 @@\r
1005 +/*\r
1006 + * This file is subject to the terms and conditions of the GNU General Public\r
1007 + * License.  See the file "COPYING" in the main directory of this archive\r
1008 + * for more details.\r
1009 + *\r
1010 + * Copyright © 2003 Atheros Communications, Inc.,  All Rights Reserved.\r
1011 + */\r
1012 +\r
1013 +/*\r
1014 + * This file contains definitions needed in order to compile\r
1015 + * AR531X products for linux.  Definitions that are largely\r
1016 + * AR531X-specific and independent of operating system belong\r
1017 + * in ar531x.h rather than this file.\r
1018 + */\r
1019 +#include "ar531x.h"\r
1020 +\r
1021 +#define MIPS_CPU_IRQ_BASE              0x00\r
1022 +#define AR531X_HIGH_PRIO                0x10\r
1023 +#define AR531X_MISC_IRQ_BASE           0x20\r
1024 +#define AR531X_GPIO_IRQ_BASE            0x30\r
1025 +\r
1026 +/* Software's idea of interrupts handled by "CPU Interrupt Controller" */\r
1027 +#define AR531X_IRQ_NONE                MIPS_CPU_IRQ_BASE+0\r
1028 +#define AR531X_IRQ_WLAN0_INTRS MIPS_CPU_IRQ_BASE+2 /* C0_CAUSE: 0x0400 */\r
1029 +#define AR531X_IRQ_ENET0_INTRS MIPS_CPU_IRQ_BASE+3 /* C0_CAUSE: 0x0800 */\r
1030 +#define AR531X_IRQ_ENET1_INTRS MIPS_CPU_IRQ_BASE+4 /* C0_CAUSE: 0x1000 */\r
1031 +#define AR531X_IRQ_WLAN1_INTRS MIPS_CPU_IRQ_BASE+5 /* C0_CAUSE: 0x2000 */\r
1032 +#define AR531X_IRQ_MISC_INTRS  MIPS_CPU_IRQ_BASE+6 /* C0_CAUSE: 0x4000 */\r
1033 +#define AR531X_IRQ_CPU_CLOCK   MIPS_CPU_IRQ_BASE+7 /* C0_CAUSE: 0x8000 */\r
1034 +\r
1035 +/* Miscellaneous interrupts, which share IP6 */\r
1036 +#define AR531X_MISC_IRQ_NONE           AR531X_MISC_IRQ_BASE+0\r
1037 +#define AR531X_MISC_IRQ_TIMER          AR531X_MISC_IRQ_BASE+1\r
1038 +#define AR531X_MISC_IRQ_AHB_PROC       AR531X_MISC_IRQ_BASE+2\r
1039 +#define AR531X_MISC_IRQ_AHB_DMA                AR531X_MISC_IRQ_BASE+3\r
1040 +#define AR531X_MISC_IRQ_GPIO           AR531X_MISC_IRQ_BASE+4\r
1041 +#define AR531X_MISC_IRQ_UART0          AR531X_MISC_IRQ_BASE+5\r
1042 +#define AR531X_MISC_IRQ_UART0_DMA      AR531X_MISC_IRQ_BASE+6\r
1043 +#define AR531X_MISC_IRQ_WATCHDOG       AR531X_MISC_IRQ_BASE+7\r
1044 +#define AR531X_MISC_IRQ_LOCAL          AR531X_MISC_IRQ_BASE+8\r
1045 +#define AR531X_MISC_IRQ_COUNT          9\r
1046 +\r
1047 +/* GPIO Interrupts [0..7], share AR531X_MISC_IRQ_GPIO */\r
1048 +#define AR531X_GPIO_IRQ_NONE            AR531X_MISC_IRQ_BASE+0\r
1049 +#define AR531X_GPIO_IRQ(n)              AR531X_MISC_IRQ_BASE+(n)+1\r
1050 +#define AR531X_GPIO_IRQ_COUNT           9\r
1051 +\r
1052 +#define PHYS_TO_K1(physaddr) KSEG1ADDR(physaddr)\r
1053 +#define PHYS_TO_K0(physaddr) KSEG0ADDR(physaddr)\r
1054 +#define UNMAPPED_TO_PHYS(vaddr)  PHYSADDR(vaddr)\r
1055 +#define IS_UNMAPPED_VADDR(vaddr) \\r
1056 +    ((KSEGX(vaddr) == KSEG0) || (KSEGX(vaddr) == KSEG1))\r
1057 +\r
1058 +/* IOCTL commands for /proc/ar531x */\r
1059 +#define AR531X_CTRL_DO_BREAKPOINT       1\r
1060 +#define AR531X_CTRL_DO_MADWIFI          2\r
1061 +\r
1062 +/*\r
1063 + * Definitions for operating system portability.\r
1064 + * These are vxWorks-->Linux translations.\r
1065 + */\r
1066 +#define LOCAL static\r
1067 +#define BOOL int\r
1068 +#define TRUE 1\r
1069 +#define FALSE 0\r
1070 +#define UINT8 u8\r
1071 +#define UINT16 u16\r
1072 +#define UINT32 u32\r
1073 +#define PRINTF printk\r
1074 +#if /* DEBUG */ 1\r
1075 +#define DEBUG_PRINTF printk\r
1076 +#define INLINE\r
1077 +#else\r
1078 +DEBUG_PRINTF while (0) printk\r
1079 +#define INLINE inline\r
1080 +#endif\r
1081 +#define sysUDelay(usecs) udelay(usecs)\r
1082 +#define sysMsDelay(msecs) mdelay(msecs)\r
1083 +typedef volatile UINT8 *VIRT_ADDR;\r
1084 +#define MALLOC(sz) kmalloc(sz, GFP_KERNEL)\r
1085 +#define MALLOC_NOSLEEP(sz) kmalloc(sz, GFP_ATOMIC)\r
1086 +#define FREE(ptr) kfree((void *)ptr)\r
1087 +#define BSP_BUG() do { printk("kernel BSP BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0)\r
1088 +#define BSP_BUG_ON(condition) do { if (unlikely((condition)!=0)) BSP_BUG(); } while(0)\r
1089 +#define ASSERT(x) BSP_BUG_ON(!(x))\r
1090 +\r
1091 +extern struct ar531x_boarddata *ar531x_board_configuration;\r
1092 +extern char *ar531x_radio_configuration;\r
1093 +extern char *enet_mac_address_get(int MACUnit);\r
1094 +\r
1095 +extern void kgdbInit(void);\r
1096 +extern int kgdbEnabled(void);\r
1097 +extern void breakpoint(void);\r
1098 +extern int kgdbInterrupt(void);\r
1099 +extern unsigned int ar531x_cpu_frequency(void);\r
1100 +extern unsigned int ar531x_sys_frequency(void);\r
1101 +\r
1102 +/* GPIO support */\r
1103 +extern struct irqaction spurious_gpio;\r
1104 +extern unsigned int gpioIntMask;\r
1105 +extern void ar531x_gpio_intr_init(int irq_base);\r
1106 +extern void ar531x_gpio_ctrl_output(int gpio);\r
1107 +extern void ar531x_gpio_ctrl_input(int gpio);\r
1108 +extern void ar531x_gpio_set(int gpio, int val);\r
1109 +extern int  ar531x_gpio_get(int gpio);\r
1110 +extern void ar531x_gpio_intr_enable(unsigned int irq);\r
1111 +extern void ar531x_gpio_intr_disable(unsigned int irq);\r
1112 +\r
1113 +/* Watchdog Timer support */\r
1114 +extern int watchdog_start(unsigned int milliseconds);\r
1115 +extern int watchdog_stop(void);\r
1116 +extern int watchdog_is_enabled(void);\r
1117 +extern unsigned int watchdog_min_timer_reached(void);\r
1118 +extern void watchdog_notify_alive(void);\r
1119 +\r
1120 +#define A_DATA_CACHE_INVAL(start, length) \\r
1121 +        dma_cache_inv((UINT32)(start),(length))\r
1122 +\r
1123 +#define sysWbFlush() mb()\r
1124 +\r
1125 +#define intDisable(x) cli()\r
1126 +#define intEnable(x) sti()\r
1127 diff -urN linux-2.4.32/arch/mips/ar531x/ar531xprom.c linux-2.4.32.new/arch/mips/ar531x/ar531xprom.c\r
1128 --- linux-2.4.32/arch/mips/ar531x/ar531xprom.c  1970-01-01 01:00:00.000000000 +0100\r
1129 +++ linux-2.4.32.new/arch/mips/ar531x/ar531xprom.c      2005-12-24 20:29:42.133306616 +0000\r
1130 @@ -0,0 +1,84 @@\r
1131 +/*\r
1132 + * This file is subject to the terms and conditions of the GNU General Public\r
1133 + * License.  See the file "COPYING" in the main directory of this archive\r
1134 + * for more details.\r
1135 + *\r
1136 + * Copyright MontaVista Software Inc\r
1137 + * Copyright © 2003 Atheros Communications, Inc.,  All Rights Reserved.\r
1138 + */\r
1139 +\r
1140 +/*\r
1141 + * Prom setup file for ar531x\r
1142 + */\r
1143 +\r
1144 +#include <linux/init.h>\r
1145 +#include <linux/config.h>\r
1146 +#include <linux/kernel.h>\r
1147 +#include <linux/string.h>\r
1148 +#include <linux/mm.h>\r
1149 +#include <linux/bootmem.h>\r
1150 +\r
1151 +#include <asm/bootinfo.h>\r
1152 +#include <asm/addrspace.h>\r
1153 +\r
1154 +#include "ar531xlnx.h"\r
1155 +\r
1156 +#define COMMAND_LINE_SIZE 512\r
1157 +\r
1158 +char arcs_cmdline[COMMAND_LINE_SIZE];\r
1159 +\r
1160 +void __init prom_init(int argc, char *argv[])\r
1161 +{\r
1162 +    int i;\r
1163 +    unsigned int memcfg1;\r
1164 +    int bank0AC, bank1AC;\r
1165 +    int memsz_in_mb;\r
1166 +\r
1167 +    strcpy(arcs_cmdline, "console=ttyS0,9600");\r
1168 +    for (i=0; i<argc; i++) {\r
1169 +        strcat(arcs_cmdline, " ");\r
1170 +        strcat(arcs_cmdline, argv[i]);\r
1171 +    }\r
1172 +\r
1173 +    mips_machgroup = MACH_GROUP_AR531X;\r
1174 +#ifdef CONFIG_APUNUSED\r
1175 +    mips_machtype = MACH_ATHEROS_UNUSED;\r
1176 +#endif\r
1177 +#ifdef CONFIG_AP30\r
1178 +    mips_machtype = MACH_ATHEROS_AP30;\r
1179 +#endif\r
1180 +#ifdef CONFIG_AP33\r
1181 +    mips_machtype = MACH_ATHEROS_AP33;\r
1182 +#endif\r
1183 +#ifdef CONFIG_AP38\r
1184 +    mips_machtype = MACH_ATHEROS_AP38;\r
1185 +#endif\r
1186 +#ifdef CONFIG_AP43\r
1187 +    mips_machtype = MACH_ATHEROS_AP43;\r
1188 +#endif\r
1189 +#ifdef CONFIG_AP48\r
1190 +    mips_machtype = MACH_ATHEROS_AP48;\r
1191 +#endif\r
1192 +#ifdef CONFIG_PB32\r
1193 +    mips_machtype = MACH_ATHEROS_PB32;\r
1194 +#endif\r
1195 +\r
1196 +\r
1197 +    /* Determine SDRAM size based on Address Checks done at startup */\r
1198 +    memcfg1 = sysRegRead(AR531X_MEM_CFG1);\r
1199 +    bank0AC = (memcfg1 & MEM_CFG1_AC0) >> MEM_CFG1_AC0_S;\r
1200 +    bank1AC = (memcfg1 & MEM_CFG1_AC1) >> MEM_CFG1_AC1_S;\r
1201 +    memsz_in_mb = (bank0AC ? (1 << (bank0AC+1)) : 0)\r
1202 +                + (bank1AC ? (1 << (bank1AC+1)) : 0);\r
1203 +\r
1204 +    /*\r
1205 +     * By default, use all available memory.  You can override this\r
1206 +     * to use, say, 8MB by specifying "mem=8M" as an argument on the\r
1207 +     * linux bootup command line.\r
1208 +     */\r
1209 +    add_memory_region(0, memsz_in_mb << 20, BOOT_MEM_RAM);\r
1210 +}\r
1211 +\r
1212 +void __init prom_free_prom_memory(void)\r
1213 +{\r
1214 +}\r
1215 diff -urN linux-2.4.32/arch/mips/ar531x/ar531xsetup.c linux-2.4.32.new/arch/mips/ar531x/ar531xsetup.c\r
1216 --- linux-2.4.32/arch/mips/ar531x/ar531xsetup.c 1970-01-01 01:00:00.000000000 +0100\r
1217 +++ linux-2.4.32.new/arch/mips/ar531x/ar531xsetup.c     2005-12-24 20:29:42.133306616 +0000\r
1218 @@ -0,0 +1,240 @@\r
1219 +/*\r
1220 + * This file is subject to the terms and conditions of the GNU General Public\r
1221 + * License.  See the file "COPYING" in the main directory of this archive\r
1222 + * for more details.\r
1223 + *\r
1224 + * Copyright © 2003 Atheros Communications, Inc.,  All Rights Reserved.\r
1225 + */\r
1226 +\r
1227 +/*\r
1228 + * Initialization for ar531x SOC.\r
1229 + */\r
1230 +\r
1231 +#include <linux/config.h>\r
1232 +#include <linux/init.h>\r
1233 +#include <linux/delay.h>\r
1234 +#include <linux/irq.h>\r
1235 +#include <linux/interrupt.h>\r
1236 +#include <linux/serial.h>\r
1237 +#include <linux/types.h>\r
1238 +#include <linux/string.h>\r
1239 +\r
1240 +#include <asm/reboot.h>\r
1241 +#include <asm/io.h>\r
1242 +#include <asm/time.h>\r
1243 +#include <asm/pgtable.h>\r
1244 +#include <asm/processor.h>\r
1245 +#include <asm/reboot.h>\r
1246 +#include <asm/system.h>\r
1247 +#include <asm/serial.h>\r
1248 +\r
1249 +#include "ar531xlnx.h"\r
1250 +\r
1251 +void\r
1252 +ar531x_restart(char *command)\r
1253 +{\r
1254 +    for(;;) {\r
1255 +        sysRegWrite(AR531X_RESET, AR531X_RESET_SYSTEM);\r
1256 +    }\r
1257 +}\r
1258 +\r
1259 +void\r
1260 +ar531x_halt(void)\r
1261 +{\r
1262 +        printk(KERN_NOTICE "\n** You can safely turn off the power\n");\r
1263 +        while (1);\r
1264 +}\r
1265 +\r
1266 +void\r
1267 +ar531x_power_off(void)\r
1268 +{\r
1269 +        ar531x_halt();\r
1270 +}\r
1271 +\r
1272 +const char *\r
1273 +get_system_type(void)\r
1274 +{\r
1275 +       return "Atheros AR531X";\r
1276 +}\r
1277 +\r
1278 +/*\r
1279 + * This table is indexed by bits 5..4 of the CLOCKCTL1 register\r
1280 + * to determine the predevisor value.\r
1281 + */\r
1282 +static int CLOCKCTL1_PREDIVIDE_TABLE[4] = {\r
1283 +    1,\r
1284 +    2,\r
1285 +    4,\r
1286 +    5\r
1287 +};\r
1288 +\r
1289 +unsigned int\r
1290 +ar531x_cpu_frequency(void)\r
1291 +{\r
1292 +       static unsigned int ar531x_calculated_cpu_freq;\r
1293 +        unsigned int clockctl1_predivide_mask;\r
1294 +        unsigned int clockctl1_predivide_shift;\r
1295 +        unsigned int clockctl1_multiplier_mask;\r
1296 +        unsigned int clockctl1_multiplier_shift;\r
1297 +        unsigned int clockctl1_doubler_mask;\r
1298 +        int wisoc_revision;\r
1299 +\r
1300 +        /*\r
1301 +         * Trust the bootrom's idea of cpu frequency.\r
1302 +         */\r
1303 +        ar531x_calculated_cpu_freq = sysRegRead(AR5312_SCRATCH);\r
1304 +        if (ar531x_calculated_cpu_freq)\r
1305 +           return ar531x_calculated_cpu_freq;\r
1306 +\r
1307 +        wisoc_revision = (sysRegRead(AR531X_REV) & AR531X_REV_MAJ) >> AR531X_REV_MAJ_S;\r
1308 +        if (wisoc_revision == AR531X_REV_MAJ_AR2313) {\r
1309 +            clockctl1_predivide_mask = AR2313_CLOCKCTL1_PREDIVIDE_MASK;\r
1310 +            clockctl1_predivide_shift = AR2313_CLOCKCTL1_PREDIVIDE_SHIFT;\r
1311 +            clockctl1_multiplier_mask = AR2313_CLOCKCTL1_MULTIPLIER_MASK;\r
1312 +            clockctl1_multiplier_shift = AR2313_CLOCKCTL1_MULTIPLIER_SHIFT;\r
1313 +            clockctl1_doubler_mask = AR2313_CLOCKCTL1_DOUBLER_MASK;\r
1314 +        } else { /* AR5312 and AR2312 */\r
1315 +            clockctl1_predivide_mask = AR5312_CLOCKCTL1_PREDIVIDE_MASK;\r
1316 +            clockctl1_predivide_shift = AR5312_CLOCKCTL1_PREDIVIDE_SHIFT;\r
1317 +            clockctl1_multiplier_mask = AR5312_CLOCKCTL1_MULTIPLIER_MASK;\r
1318 +            clockctl1_multiplier_shift = AR5312_CLOCKCTL1_MULTIPLIER_SHIFT;\r
1319 +            clockctl1_doubler_mask = AR5312_CLOCKCTL1_DOUBLER_MASK;\r
1320 +        }\r
1321 +\r
1322 +        /*\r
1323 +         * Clocking is derived from a fixed 40MHz input clock.\r
1324 +         *  cpuFreq = InputClock * MULT (where MULT is PLL multiplier)\r
1325 +         *\r
1326 +         *  sysFreq = cpuFreq / 4       (used for APB clock, serial,\r
1327 +         *                               flash, Timer, Watchdog Timer)\r
1328 +         *\r
1329 +         *  cntFreq = cpuFreq / 2       (use for CPU count/compare)\r
1330 +         *\r
1331 +         * So, for example, with a PLL multiplier of 5, we have\r
1332 +         *  cpuFrez = 200MHz\r
1333 +         *  sysFreq = 50MHz\r
1334 +         *  cntFreq = 100MHz\r
1335 +         *\r
1336 +         * We compute the CPU frequency, based on PLL settings.\r
1337 +         */\r
1338 +       if (ar531x_calculated_cpu_freq == 0) {\r
1339 +            unsigned int clockCtl1 = sysRegRead(AR5312_CLOCKCTL1);\r
1340 +\r
1341 +            int preDivideSelect = (clockCtl1 & clockctl1_predivide_mask) >>\r
1342 +                                   clockctl1_predivide_shift;\r
1343 +\r
1344 +            int preDivisor = CLOCKCTL1_PREDIVIDE_TABLE[preDivideSelect];\r
1345 +\r
1346 +            int multiplier = (clockCtl1 & clockctl1_multiplier_mask) >>\r
1347 +                              clockctl1_multiplier_shift;\r
1348 +\r
1349 +            if (clockCtl1 & clockctl1_doubler_mask) {\r
1350 +                multiplier = multiplier << 1;\r
1351 +            }\r
1352 +\r
1353 +            ar531x_calculated_cpu_freq = (40000000 / preDivisor) * multiplier;\r
1354 +        }\r
1355 +\r
1356 +       return ar531x_calculated_cpu_freq;\r
1357 +}\r
1358 +\r
1359 +unsigned int\r
1360 +ar531x_sys_frequency(void)\r
1361 +{\r
1362 +       static unsigned int ar531x_calculated_sys_freq = 0;\r
1363 +\r
1364 +       if (ar531x_calculated_sys_freq == 0) {\r
1365 +               ar531x_calculated_sys_freq = ar531x_cpu_frequency() / 4;\r
1366 +       }\r
1367 +\r
1368 +       return ar531x_calculated_sys_freq;\r
1369 +}\r
1370 +\r
1371 +static void __init\r
1372 +flash_setup(void)\r
1373 +{\r
1374 +    UINT32 flash_ctl;\r
1375 +\r
1376 +    /* Configure flash bank 0 */\r
1377 +    flash_ctl = FLASHCTL_E |\r
1378 +                FLASHCTL_AC_8M |\r
1379 +                FLASHCTL_RBLE |\r
1380 +                (0x01 << FLASHCTL_IDCY_S) |\r
1381 +                (0x07 << FLASHCTL_WST1_S) |\r
1382 +                (0x07 << FLASHCTL_WST2_S) |\r
1383 +                (sysRegRead(AR531X_FLASHCTL0) & FLASHCTL_MW);\r
1384 +\r
1385 +    sysRegWrite(AR531X_FLASHCTL0, flash_ctl);\r
1386 +\r
1387 +    /* Disable other flash banks */\r
1388 +    sysRegWrite(AR531X_FLASHCTL1,\r
1389 +                sysRegRead(AR531X_FLASHCTL1) & ~(FLASHCTL_E | FLASHCTL_AC));\r
1390 +\r
1391 +    sysRegWrite(AR531X_FLASHCTL2,\r
1392 +                sysRegRead(AR531X_FLASHCTL2) & ~(FLASHCTL_E | FLASHCTL_AC));\r
1393 +}\r
1394 +\r
1395 +\r
1396 +\r
1397 +void __init\r
1398 +serial_setup(void)\r
1399 +{\r
1400 +       struct serial_struct s;\r
1401 +\r
1402 +       memset(&s, 0, sizeof(s));\r
1403 +\r
1404 +       s.flags = STD_COM_FLAGS;\r
1405 +       s.io_type = SERIAL_IO_MEM;\r
1406 +       s.baud_base = ar531x_sys_frequency()/16;\r
1407 +       s.irq = AR531X_MISC_IRQ_UART0;\r
1408 +       s.iomem_reg_shift = 2;\r
1409 +       s.iomem_base = (u8 *)0xbc000003;\r
1410 +\r
1411 +       if (early_serial_setup(&s) != 0)\r
1412 +               printk(KERN_ERR "early_serial_setup failed\n");\r
1413 +}\r
1414 +\r
1415 +extern int setup_irq(unsigned int irq, struct irqaction *irqaction);\r
1416 +static void __init\r
1417 +ar531x_timer_setup(struct irqaction *irq)\r
1418 +{\r
1419 +        unsigned int count;\r
1420 +\r
1421 +       /* Usually irq is timer_irqaction (timer_interrupt) */\r
1422 +       setup_irq(AR531X_IRQ_CPU_CLOCK, irq);\r
1423 +\r
1424 +        /* to generate the first CPU timer interrupt */\r
1425 +        count = read_c0_count();\r
1426 +        write_c0_compare(count + 1000);\r
1427 +}\r
1428 +\r
1429 +extern void (*board_time_init)(void);\r
1430 +\r
1431 +static void __init\r
1432 +ar531x_time_init(void)\r
1433 +{\r
1434 +       mips_hpt_frequency = ar531x_cpu_frequency() / 2;\r
1435 +}\r
1436 +\r
1437 +void __init\r
1438 +ar531x_setup(void)\r
1439 +{\r
1440 +       /* Clear any lingering AHB errors */\r
1441 +       sysRegRead(AR531X_PROCADDR);\r
1442 +       sysRegRead(AR531X_DMAADDR);\r
1443 +\r
1444 +       sysRegWrite(AR531X_WD_CTRL, AR531X_WD_CTRL_IGNORE_EXPIRATION);\r
1445 +\r
1446 +        /* Disable data watchpoints */\r
1447 +        write_c0_watchlo0(0);\r
1448 +\r
1449 +       board_time_init = ar531x_time_init;\r
1450 +        board_timer_setup = ar531x_timer_setup;\r
1451 +\r
1452 +        _machine_restart = ar531x_restart;\r
1453 +        _machine_halt = ar531x_halt;\r
1454 +        _machine_power_off = ar531x_power_off;\r
1455 +\r
1456 +        flash_setup();\r
1457 +        serial_setup();\r
1458 +}\r
1459 diff -urN linux-2.4.32/arch/mips/ar531x/Makefile linux-2.4.32.new/arch/mips/ar531x/Makefile\r
1460 --- linux-2.4.32/arch/mips/ar531x/Makefile      1970-01-01 01:00:00.000000000 +0100\r
1461 +++ linux-2.4.32.new/arch/mips/ar531x/Makefile  2005-12-24 20:29:42.010325312 +0000\r
1462 @@ -0,0 +1,33 @@\r
1463 +#\r
1464 +# This file is subject to the terms and conditions of the GNU General Public\r
1465 +# License.  See the file "COPYING" in the main directory of this archive\r
1466 +# for more details.\r
1467 +#\r
1468 +# Copyright © 2003 Atheros Communications, Inc.,  All Rights Reserved.\r
1469 +#\r
1470 +\r
1471 +# Makefile for Atheros ar531x boards\r
1472 +#\r
1473 +# Note! Dependencies are done automagically by 'make dep', which also\r
1474 +# removes any old dependencies. DON'T put your own dependencies here\r
1475 +# unless it's something special (ie not a .c file).\r
1476 +#\r
1477 +\r
1478 +.S.s:\r
1479 +       $(CPP) $(CFLAGS) $< -o $*.s\r
1480 +.S.o:\r
1481 +       $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $*.o\r
1482 +\r
1483 +O_TARGET:= ar531x.o\r
1484 +\r
1485 +export-objs = ar531xksyms.o\r
1486 +\r
1487 +obj-y    := ar531xdbg_io.o     \\r
1488 +       ar531xsetup.o   \\r
1489 +       ar531xprom.o    \\r
1490 +       ar531xirq.o     \\r
1491 +       ar531xintr.o    \\r
1492 +       ar531xgpio.o    \\r
1493 +       ar531xksyms.o\r
1494 +\r
1495 +include $(TOPDIR)/Rules.make\r
1496 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/backup-busybox.links linux-2.4.32.new/arch/mips/ar531x/RAMDISK/backup-busybox.links\r
1497 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/backup-busybox.links  1970-01-01 01:00:00.000000000 +0100\r
1498 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/backup-busybox.links      2005-12-24 20:29:42.011325160 +0000\r
1499 @@ -0,0 +1,33 @@\r
1500 +/usr/bin/[\r
1501 +/sbin/brctl\r
1502 +/bin/cat\r
1503 +/bin/chmod\r
1504 +/bin/cp\r
1505 +/bin/df\r
1506 +/bin/echo\r
1507 +/bin/false\r
1508 +/sbin/ifconfig\r
1509 +/sbin/init\r
1510 +/sbin/insmod\r
1511 +/bin/kill\r
1512 +/bin/ls\r
1513 +/sbin/lsmod\r
1514 +/bin/mkdir\r
1515 +/sbin/modprobe\r
1516 +/bin/mount\r
1517 +/bin/msh\r
1518 +/bin/mv\r
1519 +/bin/ping\r
1520 +/bin/ps\r
1521 +/bin/pwd\r
1522 +/sbin/reboot\r
1523 +/bin/rm\r
1524 +/bin/rmdir\r
1525 +/sbin/rmmod\r
1526 +/sbin/route\r
1527 +/bin/sh\r
1528 +/usr/bin/test\r
1529 +/usr/bin/top\r
1530 +/bin/true\r
1531 +/bin/umount\r
1532 +/usr/bin/wget\r
1533 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/busybox.links linux-2.4.32.new/arch/mips/ar531x/RAMDISK/busybox.links\r
1534 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/busybox.links 1970-01-01 01:00:00.000000000 +0100\r
1535 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/busybox.links     2005-12-24 20:29:42.011325160 +0000\r
1536 @@ -0,0 +1,33 @@\r
1537 +/usr/bin/[\r
1538 +/sbin/brctl\r
1539 +/bin/cat\r
1540 +/bin/chmod\r
1541 +/bin/cp\r
1542 +/bin/df\r
1543 +/bin/echo\r
1544 +/bin/false\r
1545 +/sbin/ifconfig\r
1546 +/sbin/init\r
1547 +/sbin/insmod\r
1548 +/bin/kill\r
1549 +/bin/ls\r
1550 +/sbin/lsmod\r
1551 +/bin/mkdir\r
1552 +/sbin/modprobe\r
1553 +/bin/mount\r
1554 +/bin/msh\r
1555 +/bin/mv\r
1556 +/bin/ping\r
1557 +/bin/ps\r
1558 +/bin/pwd\r
1559 +/sbin/reboot\r
1560 +/bin/rm\r
1561 +/bin/rmdir\r
1562 +/sbin/rmmod\r
1563 +/sbin/route\r
1564 +/bin/sh\r
1565 +/usr/bin/test\r
1566 +/bin/true\r
1567 +/bin/umount\r
1568 +/bin/uname\r
1569 +/usr/bin/wget\r
1570 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/Makefile linux-2.4.32.new/arch/mips/ar531x/RAMDISK/Makefile\r
1571 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/Makefile      1970-01-01 01:00:00.000000000 +0100\r
1572 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/Makefile  2005-12-24 20:29:42.011325160 +0000\r
1573 @@ -0,0 +1,53 @@\r
1574 +KERNEL_SOURCE=../../../..\r
1575 +\r
1576 +# The value for INITRDSIZE is extracted from linux/.config,\r
1577 +# if it exists; otherwise, a default value is used.\r
1578 +\r
1579 +CONFIG_FILE = $(KERNEL_SOURCE)/.config\r
1580 +\r
1581 +ifeq ($(CONFIG_FILE),$(wildcard $(CONFIG_FILE)))\r
1582 +\r
1583 +include $(CONFIG_FILE)\r
1584 +ifdef CONFIG_BLK_DEV_RAM_SIZE\r
1585 +INITRDSIZE  := $(shell echo $(CONFIG_BLK_DEV_RAM_SIZE))\r
1586 +else\r
1587 +INITRDSIZE := 8192\r
1588 +endif\r
1589 +\r
1590 +else\r
1591 +INITRDSIZE := 8192\r
1592 +endif\r
1593 +\r
1594 +MOUNTPT = /mnt/xtmp\r
1595 +\r
1596 +ramdisk.gz: ramdisk\r
1597 +       gzip -f ramdisk\r
1598 +\r
1599 +ramdisk:\r
1600 +       ./makelinks  \r
1601 +       @echo "CREATING RAMDISK OF SIZE $(INITRDSIZE) on $@"\r
1602 +       dd if=/dev/zero of=$@ bs=1k count=$(INITRDSIZE)\r
1603 +       /sbin/mke2fs -vFm0 $@ $(INITRDSIZE)\r
1604 +       if [ \! -e $(MOUNTPT) ]; then mkdir -p $(MOUNTPT) ; fi\r
1605 +       mount -o loop $@ $(MOUNTPT)\r
1606 +       @df $(MOUNTPT)\r
1607 +       (cd rootdir; tar cf - . ) | (cd $(MOUNTPT) && tar xf - )\r
1608 +       (cd $(MOUNTPT) ; chown -R root.root . )\r
1609 +       @df $(MOUNTPT)\r
1610 +       umount $(MOUNTPT)\r
1611 +\r
1612 +install:\r
1613 +       @(if [ -d $(KERNEL_SOURCE)/arch/mips/ramdisk ]; \\r
1614 +       then \\r
1615 +               if [ -f ramdisk.gz ]; \\r
1616 +               then \\r
1617 +                       cp ramdisk.gz $(KERNEL_SOURCE)/arch/mips/ramdisk/; \\r
1618 +               else \\r
1619 +                       echo "No ramdisk.gz image"; \\r
1620 +               fi; \\r
1621 +       else \\r
1622 +               echo "No ramdisk directory.  Check KERNEL_SOURCE variable."; \\r
1623 +       fi)\r
1624 +\r
1625 +clean: \r
1626 +       rm -f ramdisk.gz ramdisk\r
1627 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/makelinks linux-2.4.32.new/arch/mips/ar531x/RAMDISK/makelinks\r
1628 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/makelinks     1970-01-01 01:00:00.000000000 +0100\r
1629 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/makelinks 2005-12-24 20:29:42.012325008 +0000\r
1630 @@ -0,0 +1,65 @@\r
1631 +#!/bin/sh\r
1632 +\r
1633 +if [ -f busybox.links ]\r
1634 +then\r
1635 +    cat busybox.links | sed 's/\//ln -s -f \/bin\/busybox rootdir\//' | /bin/sh\r
1636 +fi\r
1637 +\r
1638 +cons="  root tty    622"\r
1639 +disk="  root disk   660"\r
1640 +mtd="  root root   640"\r
1641 +makedev () {    # usage: makedev name [bcu] major minor owner group mode\r
1642 +        if [ "$opt_v" ]\r
1643 +        then    if [ "$opt_d" ]\r
1644 +                then    echo "rm -f $1"\r
1645 +                else    echo "$1        = $2 $3 $4 $5:$6 $7"\r
1646 +                fi\r
1647 +        fi\r
1648 +        [ ! "$opt_n" ] && rm -f $1 &&\r
1649 +        [ ! "$opt_d" ] && mknod $1 $2 $3 $4 &&\r
1650 +                chown $5:$6 $1 &&\r
1651 +                chmod $7 $1\r
1652 +}  \r
1653 +\r
1654 +makedev rootdir/dev/console c 5 1 $cons\r
1655 +makedev rootdir/dev/ram  b 1 1 $disk \r
1656 +makedev rootdir/dev/ram0 b 1 0 $disk\r
1657 +makedev rootdir/dev/ram1 b 1 1 $disk \r
1658 +makedev rootdir/dev/ram2 b 1 2 $disk\r
1659 +makedev rootdir/dev/ram3 b 1 3 $disk\r
1660 +makedev rootdir/dev/ram4 b 1 4 $disk\r
1661 +makedev rootdir/dev/ram5 b 1 5 $disk\r
1662 +makedev rootdir/dev/ram6 b 1 6 $disk\r
1663 +makedev rootdir/dev/ram7 b 1 7 $disk\r
1664 +makedev rootdir/dev/ram8 b 1 8 $disk\r
1665 +makedev rootdir/dev/ram9 b 1 9 $disk\r
1666 +makedev rootdir/dev/ram10 b 1 10 $disk\r
1667 +makedev rootdir/dev/ram11 b 1 11 $disk\r
1668 +makedev rootdir/dev/ram12 b 1 12 $disk\r
1669 +makedev rootdir/dev/ram13 b 1 13 $disk\r
1670 +makedev rootdir/dev/ram14 b 1 14 $disk\r
1671 +makedev rootdir/dev/ram15 b 1 15 $disk\r
1672 +\r
1673 +makedev rootdir/dev/mtd0 c 90 0 $mtd\r
1674 +makedev rootdir/dev/mtd1 c 90 2 $mtd\r
1675 +makedev rootdir/dev/mtd2 c 90 4 $mtd\r
1676 +makedev rootdir/dev/mtd3 c 90 6 $mtd\r
1677 +makedev rootdir/dev/mtd4 c 90 8 $mtd\r
1678 +makedev rootdir/dev/mtd5 c 90 10 $mtd\r
1679 +makedev rootdir/dev/mtd6 c 90 12 $mtd\r
1680 +makedev rootdir/dev/mtdblock0 b 31 0 $mtd\r
1681 +makedev rootdir/dev/mtdblock1 b 31 1 $mtd\r
1682 +makedev rootdir/dev/mtdblock2 b 31 2 $mtd\r
1683 +makedev rootdir/dev/mtdblock3 b 31 3 $mtd\r
1684 +makedev rootdir/dev/mtdblock4 b 31 4 $mtd\r
1685 +makedev rootdir/dev/mtdblock5 b 31 5 $mtd\r
1686 +makedev rootdir/dev/mtdblock6 b 31 6 $mtd\r
1687 +makedev rootdir/dev/mtdr0 c 90 1 $mtd\r
1688 +makedev rootdir/dev/mtdr1 c 90 3 $mtd\r
1689 +makedev rootdir/dev/mtdr2 c 90 5 $mtd\r
1690 +makedev rootdir/dev/mtdr3 c 90 7 $mtd\r
1691 +makedev rootdir/dev/mtdr4 c 90 9 $mtd\r
1692 +makedev rootdir/dev/mtdr5 c 90 11 $mtd\r
1693 +makedev rootdir/dev/mtdr6 c 90 13 $mtd\r
1694 +\r
1695 +cd rootdir/dev;ln -sf ram1 ram\r
1696 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/README linux-2.4.32.new/arch/mips/ar531x/RAMDISK/README\r
1697 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/README        1970-01-01 01:00:00.000000000 +0100\r
1698 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/README    2005-12-24 20:29:42.011325160 +0000\r
1699 @@ -0,0 +1,40 @@\r
1700 +How to build a ramdisk image for use as a root filesystem with AR531X\r
1701 +\r
1702 +Overview:\r
1703 +In order to boot from a ramdisk root file system image, you will\r
1704 +first create a root directory structure in the "rootdir" directory.\r
1705 +Then run "make" to create a compressed root file system image in\r
1706 +ramdisk.gz.  Finally, copy this image into your kernel source tree\r
1707 +and remake the kernel.  The ramdisk image is then built into the\r
1708 +kernel.  When the kernel starts, it is uncompressed into RAM, and\r
1709 +used as a root file system.\r
1710 +\r
1711 +If you'd like to use a pre-built ramdisk.gz rather than build\r
1712 +one yourself:\r
1713 +  cp arch/mips/ar531x/RAMDISK/ramdisk.gz arch/mips/ramdisk/ramdisk.gz\r
1714 +\r
1715 +Here are the detailed steps to build your own:\r
1716 +\r
1717 +1) Modify Makefile to point KERNEL_SOURCE at your linux source tree.\r
1718 +\r
1719 +2) Copy whatever additional files/directories/links you'd like to\r
1720 +   under rootdir.  Note that you're limited to CONFIG_BLK_DEV_RAM_SIZE\r
1721 +   1KB blocks, as specified in your linux/.config file.\r
1722 +   Examples:\r
1723 +       Copy busybox to rootdir/bin/\r
1724 +        [NOTE: Copy busybox.links to this directory to\r
1725 +        cause the makelinks script to automatically\r
1726 +        set up all of the necessary busybox command links\r
1727 +        in the rootdir/bin directory].\r
1728 +\r
1729 +       Copy any wireless driver modules into rootdir tree\r
1730 +\r
1731 +   You might want to make a copy of the rootdir directory\r
1732 +   before you modify it, just in case you want to get back\r
1733 +   to the original.\r
1734 +\r
1735 +3) LOGIN AS ROOT (e.g. "su") and type "make"\r
1736 +\r
1737 +4) Copy the resulting ramdisk.gz to your linux source tree under\r
1738 +       arch/mips/ramdisk/ramdisk.gz\r
1739 +   (or "make install" will do this step for you)\r
1740 Binary files linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/bin/busybox and linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/bin/busybox differ\r
1741 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/fstab linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/fstab\r
1742 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/fstab     1970-01-01 01:00:00.000000000 +0100\r
1743 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/fstab 2005-12-24 20:29:42.063317256 +0000\r
1744 @@ -0,0 +1 @@\r
1745 +/proc /proc proc defaults 0 0\r
1746 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/group linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/group\r
1747 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/group     1970-01-01 01:00:00.000000000 +0100\r
1748 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/group 2005-12-24 20:29:42.064317104 +0000\r
1749 @@ -0,0 +1,18 @@\r
1750 +root:x:0:\r
1751 +wheel:x:10:\r
1752 +bin:x:1:bin,daemon\r
1753 +daemon:x:2:bin,daemon\r
1754 +sys:x:3:bin,adm\r
1755 +adm:x:4:adm,daemon\r
1756 +tty:x:5:\r
1757 +disk:x:6:\r
1758 +lp:x:7:daemon,lp\r
1759 +mem:x:8:\r
1760 +kmem:x:9:\r
1761 +operator:x:11:\r
1762 +uucp:x:14:uucp\r
1763 +dip:x:40:\r
1764 +utmp:x:45:\r
1765 +www:x:63:\r
1766 +nobody:x:65534:\r
1767 +users:x:100:\r
1768 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/host.conf linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/host.conf\r
1769 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/host.conf 1970-01-01 01:00:00.000000000 +0100\r
1770 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/host.conf     2005-12-24 20:29:42.064317104 +0000\r
1771 @@ -0,0 +1,2 @@\r
1772 +order hosts,bind\r
1773 +multi on\r
1774 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/inittab linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/inittab\r
1775 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/inittab   1970-01-01 01:00:00.000000000 +0100\r
1776 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/inittab       2005-12-24 20:29:42.064317104 +0000\r
1777 @@ -0,0 +1,2 @@\r
1778 +::sysinit:/etc/rc.d/rcS\r
1779 +::respawn:/bin/sh\r
1780 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/nsswitch.conf linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/nsswitch.conf\r
1781 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/nsswitch.conf     1970-01-01 01:00:00.000000000 +0100\r
1782 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/nsswitch.conf 2005-12-24 20:29:42.065316952 +0000\r
1783 @@ -0,0 +1,16 @@\r
1784 +# /etc/nsswitch.conf\r
1785 +#\r
1786 +# Name Service Switch configuration file.\r
1787 +#\r
1788 +\r
1789 +passwd:                compat\r
1790 +shadow:                compat\r
1791 +group:         compat\r
1792 +\r
1793 +hosts:         files dns\r
1794 +networks:      files dns\r
1795 +\r
1796 +ethers:                files\r
1797 +protocols:     files\r
1798 +rpc:           files\r
1799 +services:      files\r
1800 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/passwd linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/passwd\r
1801 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/passwd    1970-01-01 01:00:00.000000000 +0100\r
1802 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/passwd        2005-12-24 20:29:42.065316952 +0000\r
1803 @@ -0,0 +1,11 @@\r
1804 +root:x:0:0:root:/root:/bin/ash\r
1805 +bin:x:1:1:bin:/bin:/bin/sh\r
1806 +daemon:x:2:2:daemon:/usr/sbin:/bin/sh\r
1807 +adm:x:3:4:adm:/adm:/bin/sh\r
1808 +lp:x:4:7:lp:/var/spool/lpd:/bin/sh\r
1809 +sync:x:5:0:sync:/bin:/bin/sync\r
1810 +shutdown:x:6:11:shutdown:/sbin:/sbin/shutdown\r
1811 +halt:x:7:0:halt:/sbin:/sbin/halt\r
1812 +uucp:x:10:14:uucp:/var/spool/uucp:/bin/sh\r
1813 +operator:x:11:0:Operator:/var:/bin/sh\r
1814 +nobody:x:65534:65534:nobody:/home:/bin/sh\r
1815 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/rc.d/rcS linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/rc.d/rcS\r
1816 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/rc.d/rcS  1970-01-01 01:00:00.000000000 +0100\r
1817 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/rc.d/rcS      2005-12-24 20:29:42.066316800 +0000\r
1818 @@ -0,0 +1,17 @@\r
1819 +#!/bin/sh\r
1820 +\r
1821 +mount -a\r
1822 +mount -t jffs2 -o remount +w /\r
1823 +# mount -t ramfs /dev/ram /ramdisk\r
1824 +\r
1825 +echo Load MADWiFi wlan module\r
1826 +insmod ../../lib/modules/2.4.25/net/wlan.o\r
1827 +\r
1828 +echo Load MADWiFi Atheros HAL module\r
1829 +insmod ../../lib/modules/2.4.25/net/ath_hal.o\r
1830 +\r
1831 +echo Load MADWiFi Atheros Driver module\r
1832 +insmod ../../lib/modules/2.4.25/net/ath_lbus.o\r
1833 +\r
1834 +exit\r
1835 +\r
1836 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/resolv.conf linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/resolv.conf\r
1837 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/resolv.conf       1970-01-01 01:00:00.000000000 +0100\r
1838 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/resolv.conf   2005-12-24 20:29:42.066316800 +0000\r
1839 @@ -0,0 +1,18 @@\r
1840 +# /etc/resolv.conf - DNS setup file\r
1841 +#\r
1842 +# possible entries are:\r
1843 +#\r
1844 +#       domain <domain>                 Local domain name. If not present, the\r
1845 +#                                       gethostbyname syscall is used to\r
1846 +#                                       determine the local domain name.\r
1847 +#\r
1848 +#       search <list_of_domains>        Search list for hostname lookup.\r
1849 +#                                       The search list is normally determined\r
1850 +#                                       from the local domain name but it\r
1851 +#                                       can be set to a list of domains.\r
1852 +#\r
1853 +#       nameserver <ip_addr>            Define which server to contact\r
1854 +#                                       for DNS lookups. If there are\r
1855 +#                                       multiple nameserver lines (Max=3),\r
1856 +#                                       they are queried in the listed order.\r
1857 +#\r
1858 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/securetty linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/securetty\r
1859 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/securetty 1970-01-01 01:00:00.000000000 +0100\r
1860 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/securetty     2005-12-24 20:29:42.066316800 +0000\r
1861 @@ -0,0 +1,12 @@\r
1862 +tty1\r
1863 +tty2\r
1864 +tty3\r
1865 +tty4\r
1866 +tty5\r
1867 +tty6\r
1868 +tty7\r
1869 +tty8\r
1870 +ttyS0\r
1871 +ttyS1\r
1872 +ttyS2\r
1873 +ttyS3\r
1874 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/services linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/services\r
1875 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/services  1970-01-01 01:00:00.000000000 +0100\r
1876 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/services      2005-12-24 20:29:42.066316800 +0000\r
1877 @@ -0,0 +1,193 @@\r
1878 +#      $NetBSD: services,v 1.18 1996/03/26 00:07:58 mrg Exp $\r
1879 +#\r
1880 +# Network services, Internet style\r
1881 +#\r
1882 +# Note that it is presently the policy of IANA to assign a single well-known\r
1883 +# port number for both TCP and UDP; hence, most entries here have two entries\r
1884 +# even if the protocol doesn't support UDP operations.\r
1885 +# Updated from RFC 1340, ``Assigned Numbers'' (July 1992).  Not all ports\r
1886 +# are included, only the more common ones.\r
1887 +#\r
1888 +#      from: @(#)services      5.8 (Berkeley) 5/9/91\r
1889 +#\r
1890 +tcpmux         1/tcp           # TCP port service multiplexer\r
1891 +echo           7/tcp\r
1892 +echo           7/udp\r
1893 +discard                9/tcp           sink null\r
1894 +discard                9/udp           sink null\r
1895 +systat         11/tcp          users\r
1896 +daytime                13/tcp\r
1897 +daytime                13/udp\r
1898 +netstat                15/tcp\r
1899 +qotd           17/tcp          quote\r
1900 +msp            18/tcp          # message send protocol\r
1901 +msp            18/udp          # message send protocol\r
1902 +chargen                19/tcp          ttytst source\r
1903 +chargen                19/udp          ttytst source\r
1904 +ftp-data       20/tcp          # default ftp data port\r
1905 +ftp            21/tcp\r
1906 +ssh            22/tcp\r
1907 +ssh            22/udp\r
1908 +telnet         23/tcp\r
1909 +# 24 - private\r
1910 +smtp           25/tcp          mail\r
1911 +# 26 - unassigned\r
1912 +time           37/tcp          timserver\r
1913 +time           37/udp          timserver\r
1914 +rlp            39/udp          resource        # resource location\r
1915 +nameserver     42/tcp          name            # IEN 116\r
1916 +whois          43/tcp          nicname\r
1917 +domain         53/tcp          nameserver      # name-domain server\r
1918 +domain         53/udp          nameserver\r
1919 +mtp            57/tcp                          # deprecated\r
1920 +bootps         67/tcp          # BOOTP server\r
1921 +bootps         67/udp\r
1922 +bootpc         68/tcp          # BOOTP client\r
1923 +bootpc         68/udp\r
1924 +tftp           69/udp\r
1925 +gopher         70/tcp          # Internet Gopher\r
1926 +gopher         70/udp\r
1927 +rje            77/tcp          netrjs\r
1928 +finger         79/tcp\r
1929 +www            80/tcp          http    # WorldWideWeb HTTP\r
1930 +www            80/udp                  # HyperText Transfer Protocol\r
1931 +link           87/tcp          ttylink\r
1932 +kerberos       88/tcp          krb5    # Kerberos v5\r
1933 +kerberos       88/udp\r
1934 +supdup         95/tcp\r
1935 +# 100 - reserved\r
1936 +hostnames      101/tcp         hostname        # usually from sri-nic\r
1937 +iso-tsap       102/tcp         tsap            # part of ISODE.\r
1938 +csnet-ns       105/tcp         cso-ns  # also used by CSO name server\r
1939 +csnet-ns       105/udp         cso-ns\r
1940 +rtelnet                107/tcp         # Remote Telnet\r
1941 +rtelnet                107/udp\r
1942 +pop2           109/tcp         pop-2 postoffice        # POP version 2\r
1943 +pop2           109/udp\r
1944 +pop3           110/tcp         pop-3 # POP version 3\r
1945 +pop3           110/udp\r
1946 +sunrpc         111/tcp\r
1947 +sunrpc         111/udp\r
1948 +auth           113/tcp         authentication tap ident\r
1949 +sftp           115/tcp\r
1950 +uucp-path      117/tcp\r
1951 +nntp           119/tcp         readnews untp   # USENET News Transfer Protocol\r
1952 +ntp            123/tcp\r
1953 +ntp            123/udp                         # Network Time Protocol\r
1954 +netbios-ns     137/tcp                         # NETBIOS Name Service\r
1955 +netbios-ns     137/udp\r
1956 +netbios-dgm    138/tcp                         # NETBIOS Datagram Service\r
1957 +netbios-dgm    138/udp\r
1958 +netbios-ssn    139/tcp                         # NETBIOS session service\r
1959 +netbios-ssn    139/udp\r
1960 +imap2          143/tcp         imap            # Interim Mail Access Proto v2\r
1961 +imap2          143/udp\r
1962 +snmp           161/udp                         # Simple Net Mgmt Proto\r
1963 +snmp-trap      162/udp         snmptrap        # Traps for SNMP\r
1964 +cmip-man       163/tcp                         # ISO mgmt over IP (CMOT)\r
1965 +cmip-man       163/udp\r
1966 +cmip-agent     164/tcp\r
1967 +cmip-agent     164/udp\r
1968 +xdmcp          177/tcp                         # X Display Mgr. Control Proto\r
1969 +xdmcp          177/udp\r
1970 +nextstep       178/tcp         NeXTStep NextStep       # NeXTStep window\r
1971 +nextstep       178/udp         NeXTStep NextStep       # server\r
1972 +bgp            179/tcp                         # Border Gateway Proto.\r
1973 +bgp            179/udp\r
1974 +prospero       191/tcp                         # Cliff Neuman's Prospero\r
1975 +prospero       191/udp\r
1976 +irc            194/tcp                         # Internet Relay Chat\r
1977 +irc            194/udp\r
1978 +smux           199/tcp                         # SNMP Unix Multiplexer\r
1979 +smux           199/udp\r
1980 +at-rtmp                201/tcp                         # AppleTalk routing\r
1981 +at-rtmp                201/udp\r
1982 +at-nbp         202/tcp                         # AppleTalk name binding\r
1983 +at-nbp         202/udp\r
1984 +at-echo                204/tcp                         # AppleTalk echo\r
1985 +at-echo                204/udp\r
1986 +at-zis         206/tcp                         # AppleTalk zone information\r
1987 +at-zis         206/udp\r
1988 +z3950          210/tcp         wais            # NISO Z39.50 database\r
1989 +z3950          210/udp         wais\r
1990 +ipx            213/tcp                         # IPX\r
1991 +ipx            213/udp\r
1992 +imap3          220/tcp                         # Interactive Mail Access\r
1993 +imap3          220/udp                         # Protocol v3\r
1994 +ulistserv      372/tcp                         # UNIX Listserv\r
1995 +ulistserv      372/udp\r
1996 +#\r
1997 +# UNIX specific services\r
1998 +#\r
1999 +exec           512/tcp\r
2000 +biff           512/udp         comsat\r
2001 +login          513/tcp\r
2002 +who            513/udp         whod\r
2003 +shell          514/tcp         cmd             # no passwords used\r
2004 +syslog         514/udp\r
2005 +printer                515/tcp         spooler         # line printer spooler\r
2006 +talk           517/udp\r
2007 +ntalk          518/udp\r
2008 +route          520/udp         router routed   # RIP\r
2009 +timed          525/udp         timeserver\r
2010 +tempo          526/tcp         newdate\r
2011 +courier                530/tcp         rpc\r
2012 +conference     531/tcp         chat\r
2013 +netnews                532/tcp         readnews\r
2014 +netwall                533/udp                         # -for emergency broadcasts\r
2015 +uucp           540/tcp         uucpd           # uucp daemon\r
2016 +remotefs       556/tcp         rfs_server rfs  # Brunhoff remote filesystem\r
2017 +#\r
2018 +webster                765/tcp                         # Network dictionary\r
2019 +webster                765/udp\r
2020 +# temporary entry (not officially registered by the Samba Team!)\r
2021 +swat           901/tcp         # Samba Web Administration Tool\r
2022 +#\r
2023 +# From ``Assigned Numbers'':\r
2024 +#\r
2025 +#> The Registered Ports are not controlled by the IANA and on most systems\r
2026 +#> can be used by ordinary user processes or programs executed by ordinary\r
2027 +#> users.\r
2028 +#\r
2029 +#> Ports are used in the TCP [45,106] to name the ends of logical\r
2030 +#> connections which carry long term conversations.  For the purpose of\r
2031 +#> providing services to unknown callers, a service contact port is\r
2032 +#> defined.  This list specifies the port used by the server process as its\r
2033 +#> contact port.  While the IANA can not control uses of these ports it\r
2034 +#> does register or list uses of these ports as a convienence to the\r
2035 +#> community.\r
2036 +#\r
2037 +ingreslock     1524/tcp\r
2038 +ingreslock     1524/udp\r
2039 +prospero-np    1525/tcp                # Prospero non-privileged\r
2040 +prospero-np    1525/udp\r
2041 +rfe            5002/tcp                # Radio Free Ethernet\r
2042 +rfe            5002/udp                # Actually uses UDP only\r
2043 +#\r
2044 +#\r
2045 +# Kerberos (Project Athena/MIT) services\r
2046 +# Note that these are for Kerberos v4, and are unofficial.\r
2047 +#\r
2048 +klogin         543/tcp                 # Kerberos `rlogin'\r
2049 +kshell         544/tcp         krcmd   # Kerberos `rsh'\r
2050 +kerberos-adm   749/tcp                 # Kerberos `kadmin' (v5)\r
2051 +kerberos4      750/udp         kdc     # Kerberos (server) udp\r
2052 +kerberos4      750/tcp         kdc     # Kerberos (server) tcp\r
2053 +kerberos-master        751/udp                 # Kerberos admin server udp\r
2054 +kerberos-master        751/tcp                 # Kerberos admin server tcp\r
2055 +krbupdate      760/tcp         kreg    # BSD Kerberos registration\r
2056 +kpasswd                761/tcp         kpwd    # BSD Kerberos `passwd'\r
2057 +eklogin                2105/tcp                # Kerberos encrypted `rlogin'\r
2058 +#\r
2059 +# Unofficial but necessary (for NetBSD) services\r
2060 +#\r
2061 +supfilesrv     871/tcp                 # SUP server\r
2062 +supfiledbg     1127/tcp                # SUP debugging\r
2063 +#\r
2064 +# AppleTalk DDP entries (DDP: Datagram Delivery Protocol)\r
2065 +#\r
2066 +rtmp           1/ddp                   # Routing Table Maintenance Protocol\r
2067 +nbp            2/ddp                   # Name Binding Protocol\r
2068 +echo           4/ddp                   # AppleTalk Echo Protocol\r
2069 +zip            6/ddp                   # Zone Information Protocol\r
2070 +\r
2071 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/shadow linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/shadow\r
2072 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/etc/shadow    1970-01-01 01:00:00.000000000 +0100\r
2073 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/etc/shadow        2005-12-24 20:29:42.067316648 +0000\r
2074 @@ -0,0 +1,11 @@\r
2075 +root::10933:0:99999:7:::\r
2076 +bin:*:10933:0:99999:7:::\r
2077 +daemon:*:10933:0:99999:7:::\r
2078 +adm:*:10933:0:99999:7:::\r
2079 +lp:*:10933:0:99999:7:::\r
2080 +sync:*:10933:0:99999:7:::\r
2081 +shutdown:*:10933:0:99999:7:::\r
2082 +halt:*:10933:0:99999:7:::\r
2083 +uucp:*:10933:0:99999:7:::\r
2084 +operator:*:10933:0:99999:7:::\r
2085 +nobody:*:10933:0:99999:7:::\r
2086 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.generic_string linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.generic_string\r
2087 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.generic_string     1970-01-01 01:00:00.000000000 +0100\r
2088 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.generic_string 2005-12-24 20:29:42.071316040 +0000\r
2089 @@ -0,0 +1 @@\r
2090 +# module             id=string\r
2091 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.ieee1394map linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.ieee1394map\r
2092 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.ieee1394map        1970-01-01 01:00:00.000000000 +0100\r
2093 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.ieee1394map    2005-12-24 20:29:42.071316040 +0000\r
2094 @@ -0,0 +1 @@\r
2095 +# ieee1394 module    match_flags vendor_id model_id specifier_id version\r
2096 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.isapnpmap linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.isapnpmap\r
2097 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.isapnpmap  1970-01-01 01:00:00.000000000 +0100\r
2098 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.isapnpmap      2005-12-24 20:29:42.079314824 +0000\r
2099 @@ -0,0 +1 @@\r
2100 +# isapnp module      cardvendor carddevice driver_data vendor     function   ...\r
2101 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.parportmap linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.parportmap\r
2102 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.parportmap 1970-01-01 01:00:00.000000000 +0100\r
2103 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.parportmap     2005-12-24 20:29:42.079314824 +0000\r
2104 @@ -0,0 +1 @@\r
2105 +# module             pattern\r
2106 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.pcimap linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.pcimap\r
2107 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.pcimap     1970-01-01 01:00:00.000000000 +0100\r
2108 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.pcimap 2005-12-24 20:29:42.080314672 +0000\r
2109 @@ -0,0 +1 @@\r
2110 +# pci module         vendor     device     subvendor  subdevice  class      class_mask driver_data\r
2111 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.pnpbiosmap linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.pnpbiosmap\r
2112 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.pnpbiosmap 1970-01-01 01:00:00.000000000 +0100\r
2113 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.pnpbiosmap     2005-12-24 20:29:42.080314672 +0000\r
2114 @@ -0,0 +1 @@\r
2115 +# module             id\r
2116 diff -urN linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.usbmap linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.usbmap\r
2117 --- linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.usbmap     1970-01-01 01:00:00.000000000 +0100\r
2118 +++ linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/2.4.25/modules.usbmap 2005-12-24 20:29:42.080314672 +0000\r
2119 @@ -0,0 +1 @@\r
2120 +# usb module         match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info\r
2121 Binary files linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/sbin/iwconfig and linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/sbin/iwconfig differ\r
2122 Binary files linux-2.4.32/arch/mips/ar531x/RAMDISK/rootdir/sbin/iwpriv and linux-2.4.32.new/arch/mips/ar531x/RAMDISK/rootdir/sbin/iwpriv differ\r
2123 diff -urN linux-2.4.32/arch/mips/ar531x/README linux-2.4.32.new/arch/mips/ar531x/README\r
2124 --- linux-2.4.32/arch/mips/ar531x/README        1970-01-01 01:00:00.000000000 +0100\r
2125 +++ linux-2.4.32.new/arch/mips/ar531x/README    2005-12-24 20:29:42.101311480 +0000\r
2126 @@ -0,0 +1,68 @@\r
2127 +Basic information for the AR531X Board Support Package\r
2128 +\r
2129 +This directory contains the "LBSP" -- Linux Board Support Package --\r
2130 +for Linux on the Atheros AR531X Wireless System-On-a-Chip.  It is intended\r
2131 +primarily as a building block for wireless products.  At this time, the\r
2132 +AR531X Linux BSP is experimental code, and is actively UNDER CONSTRUCTION.\r
2133 +\r
2134 +Some components that are supported by this LBSP along with a standard 2.4\r
2135 +Linux MIPS kernel include\r
2136 +  R4Kc CPU\r
2137 +  instruction and data caches\r
2138 +  SDRAM\r
2139 +  flash (Macronix, AMD, STS, etc.)\r
2140 +  16550 serial port\r
2141 +  ethernet MACs\r
2142 +  ethernet PHY or PHY Switch (RealTek, Kendin, Marvell)\r
2143 +  General-Purpose I/O pins\r
2144 +  kernel debugging with kgdb\r
2145 +\r
2146 +This LBSP code does NOT include drivers for the wireless components of the\r
2147 +chip/boards!  Drivers for those components may be distributed separately.\r
2148 +In particular, the MADWiFi project under SourceForge supports (not yet!)\r
2149 +wireless functions on the AR531X chipset.  See\r
2150 +   http://www.sourceforge.net/projects/madwifi\r
2151 +\r
2152 +Files included in this BSP:\r
2153 +ae531xlnx.c      - Linux-specific portions of the ethernet driver\r
2154 +ae531xmac.c      - OS-independent AR531X ethernet MAC code\r
2155 +ae531xmac.h      - OS-independent AR531X ethernet MAC software definitions\r
2156 +ae531xreg.h      - OS-independent AR531X ethernet MAC hardware definitions\r
2157 +ar531x.h         - OS-independent AR531X system hardware definitions\r
2158 +ar531xlnx.h      - Linux-specific AR531X system definitions and externs\r
2159 +defconfig-ar531x - Default Linux configuration file\r
2160 +intr_recv.S      - Linux interrupt "glue" code\r
2161 +ar531xirq.c      - Linux Interrupt Request management\r
2162 +Makefile         - Linux makefile\r
2163 +mvPhy.c          - OS-independent ethernet PHY code for Marvell Switch\r
2164 +mvPhy.h          - OS-independent ethernet PHY definitions for Marvell Switch\r
2165 +ar531xprom.c     - Linux prom "glue" code\r
2166 +ar531xsetup.c    - Linux startup code\r
2167 +ar531xdbg_io.c   - Support for kgdb-based debugging and for EARLY_PRINTK_HACK\r
2168 +ar531xproc.c     - Pseudo-device driver for /proc/ar531x device\r
2169 +ar531xgpio.c     - Support for General Purpose I/O pins\r
2170 +ar531xwmacsl.c   - Wireless MAC Support Layer\r
2171 +\r
2172 +Additional files, distributed with the BSP:\r
2173 +README           - This file\r
2174 +README.BUILD     - Instructions for building a linux kernel from source\r
2175 +README.EXECUTE   - Instructions for testing your linux kernel\r
2176 +README.RAMDISK   - Instructions for building a root ramdisk image\r
2177 +\r
2178 +ramdisk.gz       - A binary ramdisk image, suitable for use with AR531X.\r
2179 +DIFFS            - Directory that contains "patch" files (See README.BUILD)\r
2180 +\r
2181 +\r
2182 +There are several ways to boot a vmlinux image on an AR531X board:\r
2183 +  -You can boot in over ethernet from the vxWorks bootrom, which is preloaded\r
2184 +   on all Atheros boards\r
2185 +  -You can use an ICE (e.g. VisionICE) to load the vmlinux image.  You will\r
2186 +   need appropriate register initialization (e.g. AP30.ini file)\r
2187 +  -You can use the eCos RedBoot bootrom loader.  This is a full-featured\r
2188 +   bootrom which as been ported to AR531x.  It can boot vmlinux over ethernet\r
2189 +   or from flash.  Source code is available from Atheros.\r
2190 +\r
2191 +Please send comments, corrections, complaints, criticisms, suggestions,\r
2192 +enhancements, requests, or any other reasonable communications regarding\r
2193 +this effort, to "linux@atheros.com".  Your email will be received by a\r
2194 +couple of engineers, and redirected as appropriate.\r
2195 diff -urN linux-2.4.32/arch/mips/ar531x/README.BUILD linux-2.4.32.new/arch/mips/ar531x/README.BUILD\r
2196 --- linux-2.4.32/arch/mips/ar531x/README.BUILD  1970-01-01 01:00:00.000000000 +0100\r
2197 +++ linux-2.4.32.new/arch/mips/ar531x/README.BUILD      2005-12-24 20:29:42.101311480 +0000\r
2198 @@ -0,0 +1,47 @@\r
2199 +       How to BUILD a linux kernel for an AR531X system\r
2200 +\r
2201 +It is expected that you will build Linux on an existing Linux system, which \r
2202 +has all of the standard Linux tools.\r
2203 +\r
2204 +01) Obtain a MIPS BigEndian ELF gcc-compatible toolchain.  For example,\r
2205 +    if you're cross-compiling on a x86 Linux system, you could use:\r
2206 +    ftp://ftp.mips.com/pub/tools/software/sde-for-linux/sdelinux-5.01-4eb.i386.rpm\r
2207 +\r
2208 +02) Obtain the latest working MIPS Linux kernel\r
2209 +    cvs -d :pserver:cvs@ftp.linux-mips.org:/home/cvs login    (password "cvs")\r
2210 +    cvs -d :pserver:cvs@ftp.linux-mips.org:/home/cvs co -r linux_2_4 linux\r
2211 +\r
2212 +    Now "cd linux".  The remainder of these instructions assume\r
2213 +    that you are in the linux directory.\r
2214 +\r
2215 +03) Place the contents of this directory at arch/mips/ar531x.\r
2216 +\r
2217 +04) Use the patch command to patch generic linux files according\r
2218 +    to the DIFFS directory\r
2219 +    for i in arch/mips/ar531x/DIFFS/*.diff\r
2220 +    do\r
2221 +       patch -p1 < $i\r
2222 +    done\r
2223 +    NOTE: This version of the AR531X Linux BSP was tested with\r
2224 +    MIPS Linux 2.4.22 as of 11/14/03.  If you use a different\r
2225 +    (e.g. more recent) version of Linux source, you may need to\r
2226 +    resolve some minor patch and compilation issues.\r
2227 +\r
2228 +05) Set up a RAMDISK image.\r
2229 +    See the instructions in README.RAMDISK.\r
2230 +\r
2231 +06) Set up a linux configuration using ar531x/defconfig-ar531x.\r
2232 +    cp arch/mips/ar531x/defconfig-ar531x .config\r
2233 +    make oldconfig       (answer all questions that are asked)\r
2234 +    NOTE: For development/debug purposes, you may want to\r
2235 +    enable CONFIG_RUNTIME_DEBUG and CONFIG_KGDB.\r
2236 +\r
2237 +07) Make dependencies.\r
2238 +    make dep\r
2239 +\r
2240 +08) Build the linux kernel\r
2241 +    make\r
2242 +\r
2243 +09) The linux image you just built is in vmlinux.\r
2244 +    See instructions in README.EXECUTE to run your vmlinux\r
2245 +    image on an AP531X-based board.\r
2246 diff -urN linux-2.4.32/arch/mips/ar531x/README.EXECUTE linux-2.4.32.new/arch/mips/ar531x/README.EXECUTE\r
2247 --- linux-2.4.32/arch/mips/ar531x/README.EXECUTE        1970-01-01 01:00:00.000000000 +0100\r
2248 +++ linux-2.4.32.new/arch/mips/ar531x/README.EXECUTE    2005-12-24 20:29:42.101311480 +0000\r
2249 @@ -0,0 +1,23 @@\r
2250 +      How to EXECUTE a linux image on an AR531X system\r
2251 +\r
2252 +There are currently three ways to run you vmlinux image:\r
2253 +  1) Load it using the vxWorks bootrom that is supplied with the board.\r
2254 +     You can load it over ethernet or from the TFFS file system, if you\r
2255 +     have sufficient flash to store the image.\r
2256 +  2) Load it using an ICE (e.g. VisionICE).\r
2257 +  3) Use a bootrom loader, such as eCos RedBoot.\r
2258 +\r
2259 +After you have booted linux:\r
2260 +  By default, the root filesystem on ramdisk is read-only.\r
2261 +  To make it writable, use "mount -o remount w /".\r
2262 +\r
2263 +  The user-level commands are slightly non-standard, as they\r
2264 +  are based on "busybox".\r
2265 +\r
2266 +  The "wget" command is included.  You can use wget to fetch\r
2267 +  files from any ftp server.  So, for instance, you can fetch\r
2268 +  a kernel module and then "insmod" it.\r
2269 +\r
2270 +Note that the standard source-level kernel debugger, kgdb, works well\r
2271 +over the serial line with this port.  We use kgdb and the kgdb_demux perl\r
2272 +script -- available over the www -- for debugging.\r
2273 diff -urN linux-2.4.32/arch/mips/ar531x/README.VERSION linux-2.4.32.new/arch/mips/ar531x/README.VERSION\r
2274 --- linux-2.4.32/arch/mips/ar531x/README.VERSION        1970-01-01 01:00:00.000000000 +0100\r
2275 +++ linux-2.4.32.new/arch/mips/ar531x/README.VERSION    2005-12-24 20:29:42.101311480 +0000\r
2276 @@ -0,0 +1 @@\r
2277 +Source release last modified: 12/16/03\r
2278 diff -urN linux-2.4.32/arch/mips/config-shared.in linux-2.4.32.new/arch/mips/config-shared.in\r
2279 --- linux-2.4.32/arch/mips/config-shared.in     2005-12-24 16:11:21.000000000 +0000\r
2280 +++ linux-2.4.32.new/arch/mips/config-shared.in 2005-12-24 21:33:42.804435856 +0000\r
2281 @@ -31,6 +31,7 @@\r
2282  dep_bool 'Support for Alchemy PB1000 board' CONFIG_MIPS_PB1000 $CONFIG_MIPS32\r
2283  dep_bool 'Support for Alchemy PB1100 board' CONFIG_MIPS_PB1100 $CONFIG_MIPS32\r
2284  dep_bool 'Support for Alchemy PB1500 board' CONFIG_MIPS_PB1500 $CONFIG_MIPS32\r
2285 +dep_bool 'Support for Atheros AR5312/AR2312 WiSoC (EXPERIMENTAL)' CONFIG_AR531X $CONFIG_AR531X $CONFIG_EXPERIMENTAL\r
2286  dep_bool 'Support for Alchemy PB1550 board' CONFIG_MIPS_PB1550 $CONFIG_MIPS32\r
2287  dep_bool 'Support for Alchemy PB1200 board' CONFIG_MIPS_PB1200 $CONFIG_MIPS32\r
2288  dep_bool 'Support for Alchemy Hydrogen3 board' CONFIG_MIPS_HYDROGEN3 $CONFIG_MIPS32\r
2289 @@ -196,7 +197,7 @@\r
2290     bool '   Support for ZBbus profiling' CONFIG_SIBYTE_TBPROF\r
2291  \r
2292     if [ "$CONFIG_SIBYTE_SWARM" = "y" -o \\r
2293 -        "$CONFIG_SIBYTE_LITTLESUR" = "y" -o \\r
2294 +O5B        "$CONFIG_SIBYTE_LITTLESUR" = "y" -o \\r
2295          "$CONFIG_SIBYTE_PTSWARM" = "y" -o \\r
2296          "$CONFIG_SIBYTE_CARMEL" = "y" ]; then\r
2297        define_bool CONFIG_SIBYTE_GENBUS_IDE y\r
2298 @@ -239,6 +240,43 @@\r
2299     define_bool CONFIG_NONCOHERENT_IO y\r
2300     define_bool CONFIG_PC_KEYB y\r
2301  fi\r
2302 +if [ "$CONFIG_AR531X" = "y" ]; then\r
2303 +   define_bool CONFIG_IRQ_CPU y\r
2304 +   define_bool CONFIG_CPU_VR4100 y\r
2305 +   define_bool CONFIG_SERIAL y\r
2306 +   define_bool CONFIG_NEW_IRQ y\r
2307 +   define_bool CONFIG_NEW_TIME_C y\r
2308 +   define_bool CONFIG_AR5312\r
2309 +   define_bool CONFIG_NONCOHERENT_IO y\r
2310 +   bool 'Enable early printk hack' CONFIG_EARLY_PRINTK_HACK\r
2311 +   define_bool CONFIG_SCSI n\r
2312 +   mainmenu_option next_comment\r
2313 +   comment 'Board selection'\r
2314 +      choice 'Board type' \\r
2315 +         "UNKNOWN CONFIG_APUNKNOWN \\r
2316 +         AP30 CONFIG_AP30 \\r
2317 +          AP31 CONFIG_AP31 \\r
2318 +         AP33 CONFIG_AP33 \\r
2319 +         AP38 CONFIG_AP38 \\r
2320 +         AP43 CONFIG_AP43 \\r
2321 +         AP48 CONFIG_AP48" AP30\r
2322 +   if [ "$CONFIG_AP30" = "y" ]; then\r
2323 +       define_int CONFIG_MTD_PHYSMAP_BUSWIDTH 2\r
2324 +   fi\r
2325 +   if [ "$CONFIG_AP33" = "y" ]; then\r
2326 +       define_int CONFIG_MTD_PHYSMAP_BUSWIDTH 1\r
2327 +   fi\r
2328 +   if [ "$CONFIG_AP38" = "y" ]; then\r
2329 +       define_int CONFIG_MTD_PHYSMAP_BUSWIDTH 1\r
2330 +   fi\r
2331 +   if [ "$CONFIG_AP43" = "y" ]; then\r
2332 +       define_int CONFIG_MTD_PHYSMAP_BUSWIDTH 1\r
2333 +   fi\r
2334 +   if [ "$CONFIG_AP48" = "y" ]; then\r
2335 +       define_int CONFIG_MTD_PHYSMAP_BUSWIDTH 1\r
2336 +   fi\r
2337 +   endmenu\r
2338 +fi\r
2339  if [ "$CONFIG_CASIO_E55" = "y" ]; then\r
2340     define_bool CONFIG_IRQ_CPU y\r
2341     define_bool CONFIG_NONCOHERENT_IO y\r
2342 diff -urN linux-2.4.32/arch/mips/kernel/setup.c linux-2.4.32.new/arch/mips/kernel/setup.c\r
2343 --- linux-2.4.32/arch/mips/kernel/setup.c       2005-12-24 16:08:53.000000000 +0000\r
2344 +++ linux-2.4.32.new/arch/mips/kernel/setup.c   2005-12-24 21:28:51.779678344 +0000\r
2345 @@ -494,6 +494,7 @@\r
2346         void hp_setup(void);\r
2347         void au1x00_setup(void);\r
2348         void frame_info_init(void);\r
2349 +       void ar531x_setup(void);\r
2350  \r
2351         frame_info_init();\r
2352  #if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_FD_MODULE)\r
2353 @@ -691,6 +692,12 @@\r
2354                  pmc_yosemite_setup();\r
2355                  break;\r
2356  #endif\r
2357 +\r
2358 +#ifdef CONFIG_AR531X\r
2359 +       case MACH_GROUP_AR531X:\r
2360 +               ar531x_setup();\r
2361 +               break;\r
2362 +#endif\r
2363         default:\r
2364                 panic("Unsupported architecture");\r
2365         }\r
2366 diff -urN linux-2.4.32/arch/mips/Makefile linux-2.4.32.new/arch/mips/Makefile\r
2367 --- linux-2.4.32/arch/mips/Makefile     2005-12-24 16:09:51.000000000 +0000\r
2368 +++ linux-2.4.32.new/arch/mips/Makefile 2005-12-24 21:28:51.780678192 +0000\r
2369 @@ -725,6 +725,12 @@\r
2370  LOADADDR      += 0x80020000\r
2371  endif\r
2372  \r
2373 +ifdef CONFIG_AR531X\r
2374 +SUBDIRS       += arch/mips/ar531x\r
2375 +LIBS          += arch/mips/ar531x/ar531x.o\r
2376 +LOADADDR      += 0x80002000\r
2377 +endif\r
2378 +\r
2379  #\r
2380  # Choosing incompatible machines durings configuration will result in\r
2381  # error messages during linking.  Select a default linkscript if\r
2382 diff -urN linux-2.4.32/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.4.32.new/drivers/mtd/chips/cfi_cmdset_0002.c\r
2383 --- linux-2.4.32/drivers/mtd/chips/cfi_cmdset_0002.c    2004-11-17 11:54:21.000000000 +0000\r
2384 +++ linux-2.4.32.new/drivers/mtd/chips/cfi_cmdset_0002.c        2005-12-24 21:28:51.795675912 +0000\r
2385 @@ -510,7 +510,7 @@\r
2386            or tells us why it failed. */        \r
2387         dq6 = CMD(1<<6);\r
2388         dq5 = CMD(1<<5);\r
2389 -       timeo = jiffies + (HZ/1000); /* setting timeout to 1ms for now */\r
2390 +       timeo = jiffies + (HZ/1000) + 1; /* setting timeout to 1ms for now */\r
2391                 \r
2392         oldstatus = cfi_read(map, adr);\r
2393         status = cfi_read(map, adr);\r
2394 @@ -535,12 +535,14 @@\r
2395                 if( (status & dq5) == dq5 ) {\r
2396                         /* When DQ5 raises, we must check once again\r
2397                            if DQ6 is toggling.  If not, the erase has been\r
2398 -                          completed OK.  If not, reset chip. */\r
2399 +                          completed OK.  But if so, reset chip. */\r
2400                         oldstatus = cfi_read(map, adr);\r
2401                         status = cfi_read(map, adr);\r
2402                     \r
2403                         if ( (oldstatus & 0x00FF) == (status & 0x00FF) ) {\r
2404 +#if 0\r
2405                                 printk(KERN_WARNING "Warning: DQ5 raised while program operation was in progress, however operation completed OK\n" );\r
2406 +#endif\r
2407                         } else { \r
2408                                 /* DQ5 is active so we can do a reset and stop the erase */\r
2409                                 cfi_write(map, CMD(0xF0), chip->start);\r
2410 diff -urN linux-2.4.32/drivers/mtd/chips/jedec_probe.c linux-2.4.32.new/drivers/mtd/chips/jedec_probe.c\r
2411 --- linux-2.4.32/drivers/mtd/chips/jedec_probe.c        2003-06-13 15:51:34.000000000 +0100\r
2412 +++ linux-2.4.32.new/drivers/mtd/chips/jedec_probe.c    2005-12-24 21:28:51.797675608 +0000\r
2413 @@ -900,7 +900,16 @@\r
2414                 NumEraseRegions: 1,\r
2415                 regions: {ERASEINFO(0x01000,256),\r
2416                 }\r
2417 -       } \r
2418 +       }, {\r
2419 +               mfr_id: MANUFACTURER_SST,\r
2420 +               dev_id: SST39LF160,\r
2421 +               name: "SST 39LF160",\r
2422 +               DevSize: SIZE_2MiB,\r
2423 +               CmdSet: P_ID_AMD_STD,\r
2424 +               NumEraseRegions: 1,\r
2425 +               regions: {ERASEINFO(0x01000,512),\r
2426 +               }\r
2427 +        }\r
2428  };\r
2429  \r
2430  \r
2431 diff -urN linux-2.4.32/drivers/mtd/Config.in linux-2.4.32.new/drivers/mtd/Config.in\r
2432 --- linux-2.4.32/drivers/mtd/Config.in  2003-06-13 15:51:34.000000000 +0100\r
2433 +++ linux-2.4.32.new/drivers/mtd/Config.in      2005-12-24 21:28:51.803674696 +0000\r
2434 @@ -14,6 +14,9 @@\r
2435     dep_tristate '  MTD partitioning support' CONFIG_MTD_PARTITIONS $CONFIG_MTD\r
2436     dep_tristate '  MTD concatenating support' CONFIG_MTD_CONCAT $CONFIG_MTD\r
2437     dep_tristate '  RedBoot partition table parsing' CONFIG_MTD_REDBOOT_PARTS $CONFIG_MTD_PARTITIONS\r
2438 +   if [ "$CONFIG_MTD_END_RESERVED" != "" ]; then\r
2439 +      define_int CONFIG_MTD_END_RESERVED $CONFIG_MTD_END_RESERVED\r
2440 +   fi\r
2441     dep_tristate '  Command line partition table parsing' CONFIG_MTD_CMDLINE_PARTS $CONFIG_MTD_PARTITIONS\r
2442     if [ "$CONFIG_ARM" = "y" ]; then\r
2443        dep_tristate '  ARM Firmware Suite partition parsing' CONFIG_MTD_AFS_PARTS $CONFIG_MTD_PARTITIONS\r
2444 diff -urN linux-2.4.32/drivers/mtd/maps/physmap.c linux-2.4.32.new/drivers/mtd/maps/physmap.c\r
2445 --- linux-2.4.32/drivers/mtd/maps/physmap.c     2003-06-13 15:51:34.000000000 +0100\r
2446 +++ linux-2.4.32.new/drivers/mtd/maps/physmap.c 2005-12-24 21:28:51.811673480 +0000\r
2447 @@ -80,12 +80,18 @@\r
2448  };\r
2449  \r
2450  #ifdef CONFIG_MTD_PARTITIONS\r
2451 -#ifdef CONFIG_MTD_CMDLINE_PARTS\r
2452 +#if defined(CONFIG_MTD_CMDLINE_PARTS) || defined(CONFIG_MTD_REDBOOT_PARTS)\r
2453  static struct mtd_partition *mtd_parts = 0;\r
2454  static int                   mtd_parts_nb = 0;\r
2455  #else\r
2456  static struct mtd_partition physmap_partitions[] = {\r
2457  /* Put your own partition definitions here */\r
2458 +    {\r
2459 +        name:   "rootfs",\r
2460 +        size:   0x000e0000,\r
2461 +        offset: 0x000f0000,\r
2462 +        /* Allow file system to be mounted for writing */\r
2463 +    }\r
2464  #if 0\r
2465         {\r
2466                 name:           "bootROM",\r
2467 @@ -138,6 +144,22 @@\r
2468  \r
2469                 add_mtd_device(mymtd);\r
2470  #ifdef CONFIG_MTD_PARTITIONS\r
2471 +#ifdef CONFIG_MTD_REDBOOT_PARTS\r
2472 +                {\r
2473 +                    extern int parse_redboot_partitions(struct mtd_info *master,\r
2474 +                                        struct mtd_partition **pparts);\r
2475 +\r
2476 +                    struct mtd_partition *rb_parts = 0;\r
2477 +                    int rb_parts_nb = 0;\r
2478 +\r
2479 +                   rb_parts_nb = parse_redboot_partitions(mymtd, &rb_parts);\r
2480 +                   if (rb_parts_nb > 0) {\r
2481 +                        printk(KERN_NOTICE\r
2482 +                               "Using redboot flash partitioning");\r
2483 +                       add_mtd_partitions (mymtd, rb_parts, rb_parts_nb);\r
2484 +                   }\r
2485 +                }\r
2486 +#endif\r
2487  #ifdef CONFIG_MTD_CMDLINE_PARTS\r
2488                 mtd_parts_nb = parse_cmdline_partitions(mymtd, &mtd_parts, \r
2489                                                         "phys");\r
2490 @@ -147,7 +169,8 @@\r
2491                                "Using command line partition definition\n");\r
2492                         add_mtd_partitions (mymtd, mtd_parts, mtd_parts_nb);\r
2493                 }\r
2494 -#else\r
2495 +#endif\r
2496 +#if !defined(CONFIG_MTD_CMDLINE_PARTS) && !defined(CONFIG_MTD_REDBOOT_PARTS)\r
2497                 if (NUM_PARTITIONS != 0) \r
2498                 {\r
2499                         printk(KERN_NOTICE \r
2500 diff -urN linux-2.4.32/drivers/mtd/redboot.c linux-2.4.32.new/drivers/mtd/redboot.c\r
2501 --- linux-2.4.32/drivers/mtd/redboot.c  2001-11-09 22:01:22.000000000 +0000\r
2502 +++ linux-2.4.32.new/drivers/mtd/redboot.c      2005-12-24 21:28:51.821671960 +0000\r
2503 @@ -51,8 +51,14 @@\r
2504                 return -ENOMEM;\r
2505  \r
2506         /* Read the start of the last erase block */\r
2507 -       ret = master->read(master, master->size - master->erasesize,\r
2508 +        {\r
2509 +        u_int32_t part_table_start = master->size - master->erasesize;\r
2510 +#if defined(CONFIG_MTD_END_RESERVED)\r
2511 +        part_table_start -= CONFIG_MTD_END_RESERVED;\r
2512 +#endif\r
2513 +       ret = master->read(master, part_table_start,\r
2514                            PAGE_SIZE, &retlen, (void *)buf);\r
2515 +        }\r
2516  \r
2517         if (ret)\r
2518                 goto out;\r
2519 diff -urN linux-2.4.32/drivers/net/Config.in linux-2.4.32.new/drivers/net/Config.in\r
2520 --- linux-2.4.32/drivers/net/Config.in  2005-12-24 16:16:53.000000000 +0000\r
2521 +++ linux-2.4.32.new/drivers/net/Config.in      2005-12-24 21:28:51.856666640 +0000\r
2522 @@ -30,6 +30,8 @@\r
2523  comment 'Ethernet (10 or 100Mbit)'\r
2524  bool 'Ethernet (10 or 100Mbit)' CONFIG_NET_ETHERNET\r
2525  if [ "$CONFIG_NET_ETHERNET" = "y" ]; then\r
2526 +   define_bool CONFIG_VENETDEV n\r
2527 +   define_bool CONFIG_MARVELL_ENET_PHY y\r
2528     if [ "$CONFIG_ARM" = "y" ]; then  \r
2529        dep_bool '  ARM EBSA110 AM79C961A support' CONFIG_ARM_AM79C961A $CONFIG_ARCH_EBSA110\r
2530        tristate '  Cirrus Logic CS8900A support' CONFIG_ARM_CIRRUS\r
2531 diff -urN linux-2.4.32/drivers/net/wireless/Config.in linux-2.4.32.new/drivers/net/wireless/Config.in\r
2532 --- linux-2.4.32/drivers/net/wireless/Config.in 2004-11-17 11:54:21.000000000 +0000\r
2533 +++ linux-2.4.32.new/drivers/net/wireless/Config.in     2005-12-24 21:28:51.898660256 +0000\r
2534 @@ -38,7 +38,8 @@\r
2535  \r
2536  # yes, this works even when no drivers are selected\r
2537  if [ "$CONFIG_ISA" = "y" -o "$CONFIG_PCI" = "y" -o \\r
2538 -     "$CONFIG_ALL_PPC" = "y" -o "$CONFIG_PCMCIA" != "n" ]; then\r
2539 +     "$CONFIG_ALL_PPC" = "y" -o "$CONFIG_PCMCIA" != "n" -o \\r
2540 +     "$CONFIG_NET_WIRELESS" = "y" ]; then\r
2541     define_bool CONFIG_NET_WIRELESS y\r
2542  else\r
2543     define_bool CONFIG_NET_WIRELESS n\r
2544 diff -urN linux-2.4.32/include/asm-mips/atheros/ar531xbsp.h linux-2.4.32.new/include/asm-mips/atheros/ar531xbsp.h\r
2545 --- linux-2.4.32/include/asm-mips/atheros/ar531xbsp.h   1970-01-01 01:00:00.000000000 +0100\r
2546 +++ linux-2.4.32.new/include/asm-mips/atheros/ar531xbsp.h       2005-12-24 20:29:06.898663096 +0000\r
2547 @@ -0,0 +1,16 @@\r
2548 +#ifndef __ASM_ATHEROS_BSP_SUPPORT_H\r
2549 +#define __ASM_ATHEROS_BSP_SUPPORT_H\r
2550 +/*\r
2551 + * These are definitions and functions provided by the bsp to support the\r
2552 + * AR5312 WiSoC running LSDK.  For different BSP implementations, different\r
2553 + * BSP functions will be needed.\r
2554 + */\r
2555 +\r
2556 +extern unsigned int ar531x_sys_frequency(void);\r
2557 +\r
2558 +#ifdef CONFIG_KGDB\r
2559 +extern  void kgdbInit(void);\r
2560 +extern int kgdbEnabled(void);\r
2561 +#endif\r
2562 +\r
2563 +#endif /* __ASM_ATHEROS_BSP_SUPPORT_H */\r
2564 diff -urN linux-2.4.32/include/asm-mips/bootinfo.h linux-2.4.32.new/include/asm-mips/bootinfo.h\r
2565 --- linux-2.4.32/include/asm-mips/bootinfo.h    2005-12-24 16:08:53.000000000 +0000\r
2566 +++ linux-2.4.32.new/include/asm-mips/bootinfo.h        2005-12-24 21:28:51.899660104 +0000\r
2567 @@ -37,6 +37,7 @@\r
2568  #define MACH_GROUP_HP_LJ       20 /* Hewlett Packard LaserJet               */\r
2569  #define MACH_GROUP_LASAT       21\r
2570  #define MACH_GROUP_TITAN       22 /* PMC-Sierra Titan                      */\r
2571 +#define MACH_GROUP_AR531X      23 /* Atheros AR531X                         */\r
2572  \r
2573  /*\r
2574   * Valid machtype values for group unknown (low order halfword of mips_machtype)\r
2575 @@ -201,6 +202,17 @@\r
2576   */\r
2577  #define        MACH_TITAN_YOSEMITE     1       /* PMC-Sierra Yosemite */\r
2578  \r
2579 +/*\r
2580 + * Valid machtype for group MACH_GROUP_AR5312\r
2581 + */\r
2582 +#define MACH_ATHEROS_UNUSED     0\r
2583 +#define MACH_ATHEROS_AP30       1       /* AP30 */\r
2584 +#define MACH_ATHEROS_AP33      2       /* AP33 */\r
2585 +#define MACH_ATHEROS_AP38       3       /* AP38 */\r
2586 +#define MACH_ATHEROS_AP43       4       /* AP43 */\r
2587 +#define MACH_ATHEROS_AP48       5       /* AP48 */\r
2588 +#define MACH_ATHEROS_PB32       6       /* PB32 */\r
2589 +\r
2590  #define CL_SIZE                        (256)\r
2591  \r
2592  const char *get_system_type(void);\r
2593 diff -urN linux-2.4.32/include/asm-mips/serial.h linux-2.4.32.new/include/asm-mips/serial.h\r
2594 --- linux-2.4.32/include/asm-mips/serial.h      2005-01-19 14:10:12.000000000 +0000\r
2595 +++ linux-2.4.32.new/include/asm-mips/serial.h  2005-12-24 21:28:51.901659800 +0000\r
2596 @@ -467,6 +467,11 @@\r
2597  #define DDB5477_SERIAL_PORT_DEFNS\r
2598  #endif\r
2599  \r
2600 +#if defined(CONFIG_AR531X)\r
2601 +#undef RS_TABLE_SIZE\r
2602 +#define RS_TABLE_SIZE 1\r
2603 +#endif\r
2604 +\r
2605  #define SERIAL_PORT_DFNS                       \\r
2606         ATLAS_SERIAL_PORT_DEFNS                 \\r
2607         AU1000_SERIAL_PORT_DEFNS                \\r
2608 diff -urN linux-2.4.32/kernel/printk.c linux-2.4.32.new/kernel/printk.c\r
2609 --- linux-2.4.32/kernel/printk.c        2004-11-17 11:54:22.000000000 +0000\r
2610 +++ linux-2.4.32.new/kernel/printk.c    2005-12-24 21:28:51.929655544 +0000\r
2611 @@ -384,6 +384,18 @@\r
2612         _call_console_drivers(start_print, end, msg_level);\r
2613  }\r
2614  \r
2615 +#if CONFIG_EARLY_PRINTK_HACK\r
2616 +void putDebugChar(char byte);\r
2617 +static void emit_log_char(char c)\r
2618 +{\r
2619 +       if (c == '\n') {\r
2620 +               putDebugChar('\r');\r
2621 +               putDebugChar('\n');\r
2622 +       } else {\r
2623 +               putDebugChar(c);\r
2624 +       }\r
2625 +}\r
2626 +#else\r
2627  static void emit_log_char(char c)\r
2628  {\r
2629         LOG_BUF(log_end) = c;\r
2630 @@ -395,6 +407,7 @@\r
2631         if (logged_chars < LOG_BUF_LEN)\r
2632                 logged_chars++;\r
2633  }\r
2634 +#endif\r
2635  \r
2636  /*\r
2637   * This is printk.  It can be called from any context.  We want it to work.\r
2638 @@ -700,3 +713,4 @@\r
2639                 tty->driver.write(tty, 0, msg, strlen(msg));\r
2640         return;\r
2641  }\r
2642 +\r