1 diff -Nur linux-2.6.15/arch/mips/aruba/flash_lock.c linux-2.6.15-openwrt/arch/mips/aruba/flash_lock.c
2 --- linux-2.6.15/arch/mips/aruba/flash_lock.c 1970-01-01 01:00:00.000000000 +0100
3 +++ linux-2.6.15-openwrt/arch/mips/aruba/flash_lock.c 2006-01-10 00:32:32.000000000 +0100
5 +#include <linux/module.h>
6 +#include <linux/types.h>
7 +#include <asm/bootinfo.h>
9 +#define AP70_PROT_ADDR 0xb8010008
10 +#define AP70_PROT_DATA 0x8
11 +#define AP60_PROT_ADDR 0xB8400000
12 +#define AP60_PROT_DATA 0x04000000
14 +void unlock_ap60_70_flash(void)
17 + switch (mips_machtype) {
18 + case MACH_ARUBA_AP70:
19 + val = *(volatile __u32 *)AP70_PROT_ADDR;
20 + val &= ~(AP70_PROT_DATA);
21 + *(volatile __u32 *)AP70_PROT_ADDR = val;
23 + case MACH_ARUBA_AP65:
24 + case MACH_ARUBA_AP60:
26 + val = *(volatile __u32 *)AP60_PROT_ADDR;
27 + val &= ~(AP60_PROT_DATA);
28 + *(volatile __u32 *)AP60_PROT_ADDR = val;
32 diff -Nur linux-2.6.15/arch/mips/aruba/idtIRQ.S linux-2.6.15-openwrt/arch/mips/aruba/idtIRQ.S
33 --- linux-2.6.15/arch/mips/aruba/idtIRQ.S 1970-01-01 01:00:00.000000000 +0100
34 +++ linux-2.6.15-openwrt/arch/mips/aruba/idtIRQ.S 2006-01-10 00:32:32.000000000 +0100
36 +/**************************************************************************
38 + * BRIEF MODULE DESCRIPTION
39 + * Intterrupt dispatcher code for IDT boards
41 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
43 + * This program is free software; you can redistribute it and/or modify it
44 + * under the terms of the GNU General Public License as published by the
45 + * Free Software Foundation; either version 2 of the License, or (at your
46 + * option) any later version.
48 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
49 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
50 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
51 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
52 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
53 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
54 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
55 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
56 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
57 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59 + * You should have received a copy of the GNU General Public License along
60 + * with this program; if not, write to the Free Software Foundation, Inc.,
61 + * 675 Mass Ave, Cambridge, MA 02139, USA.
64 + **************************************************************************
71 + **************************************************************************
76 +#include <asm/mipsregs.h>
77 +#include <asm/regdef.h>
78 +#include <asm/stackframe.h>
84 + NESTED(idtIRQ, PT_SIZE, sp)
92 + /* Get the pending interrupts */
96 + /* Isolate the allowed ones by anding the irq mask */
98 + move a1, sp /* need a nop here, hence we anticipate */
102 + /* check for r4k counter/timer IRQ. */
104 + andi t1, t0, CAUSEF_IP7
108 + jal aruba_timer_interrupt
115 + jal aruba_irqdispatch
123 diff -Nur linux-2.6.15/arch/mips/aruba/irq.c linux-2.6.15-openwrt/arch/mips/aruba/irq.c
124 --- linux-2.6.15/arch/mips/aruba/irq.c 1970-01-01 01:00:00.000000000 +0100
125 +++ linux-2.6.15-openwrt/arch/mips/aruba/irq.c 2006-01-10 00:32:32.000000000 +0100
127 +/**************************************************************************
129 + * BRIEF MODULE DESCRIPTION
130 + * Interrupt routines for IDT EB434 boards
132 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
134 + * This program is free software; you can redistribute it and/or modify it
135 + * under the terms of the GNU General Public License as published by the
136 + * Free Software Foundation; either version 2 of the License, or (at your
137 + * option) any later version.
139 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
140 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
141 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
142 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
143 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
144 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
145 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
146 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
147 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
148 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
150 + * You should have received a copy of the GNU General Public License along
151 + * with this program; if not, write to the Free Software Foundation, Inc.,
152 + * 675 Mass Ave, Cambridge, MA 02139, USA.
155 + **************************************************************************
156 + * May 2004 rkt, neb
162 + **************************************************************************
165 +#include <linux/errno.h>
166 +#include <linux/init.h>
167 +#include <linux/kernel_stat.h>
168 +#include <linux/module.h>
169 +#include <linux/signal.h>
170 +#include <linux/sched.h>
171 +#include <linux/types.h>
172 +#include <linux/interrupt.h>
173 +#include <linux/ioport.h>
174 +#include <linux/timex.h>
175 +#include <linux/slab.h>
176 +#include <linux/random.h>
177 +#include <linux/delay.h>
179 +#include <asm/bitops.h>
180 +#include <asm/bootinfo.h>
182 +#include <asm/mipsregs.h>
183 +#include <asm/system.h>
184 +#include <asm/idt-boards/rc32434/rc32434.h>
185 +#include <asm/idt-boards/rc32434/rc32434_gpio.h>
187 +#include <asm/irq.h>
191 +/* note: prints function name for you */
192 +#define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
194 +#define DPRINTK(fmt, args...)
197 +extern asmlinkage void idtIRQ(void);
198 +static unsigned int startup_irq(unsigned int irq);
199 +static void end_irq(unsigned int irq_nr);
200 +static void mask_and_ack_irq(unsigned int irq_nr);
201 +static void aruba_enable_irq(unsigned int irq_nr);
202 +static void aruba_disable_irq(unsigned int irq_nr);
204 +extern void __init init_generic_irq(void);
208 + volatile u32 *base_addr;
211 +static const intr_group_t intr_group_merlot[NUM_INTR_GROUPS] = {
212 + {0xffffffff, (u32 *) KSEG1ADDR(IC_GROUP0_PEND + 0)},
215 +#define READ_PEND_MERLOT(base) (*((volatile unsigned long *)(0xbc003010)))
216 +#define READ_MASK_MERLOT(base) (*((volatile unsigned long *)(0xbc003010 + 4)))
217 +#define WRITE_MASK_MERLOT(base, val) ((*((volatile unsigned long *)((0xbc003010) + 4))) = (val))
219 +static const intr_group_t intr_group_muscat[NUM_INTR_GROUPS] = {
220 + {0x0000efff, (u32 *) KSEG1ADDR(IC_GROUP0_PEND + 0 * IC_GROUP_OFFSET)},
221 + {0x00001fff, (u32 *) KSEG1ADDR(IC_GROUP0_PEND + 1 * IC_GROUP_OFFSET)},
222 + {0x00000007, (u32 *) KSEG1ADDR(IC_GROUP0_PEND + 2 * IC_GROUP_OFFSET)},
223 + {0x0003ffff, (u32 *) KSEG1ADDR(IC_GROUP0_PEND + 3 * IC_GROUP_OFFSET)},
224 + {0xffffffff, (u32 *) KSEG1ADDR(IC_GROUP0_PEND + 4 * IC_GROUP_OFFSET)}
227 +#define READ_PEND_MUSCAT(base) (*(base))
228 +#define READ_MASK_MUSCAT(base) (*(base + 2))
229 +#define WRITE_MASK_MUSCAT(base, val) (*(base + 2) = (val))
231 +static inline int irq_to_group(unsigned int irq_nr)
233 + switch (mips_machtype) {
234 + case MACH_ARUBA_AP70:
235 + return ((irq_nr - GROUP0_IRQ_BASE) >> 5);
236 + case MACH_ARUBA_AP65:
237 + case MACH_ARUBA_AP60:
243 +static inline int group_to_ip(unsigned int group)
245 + switch (mips_machtype) {
246 + case MACH_ARUBA_AP70:
248 + case MACH_ARUBA_AP65:
249 + case MACH_ARUBA_AP60:
255 +static inline void enable_local_irq(unsigned int ip)
257 + int ipnum = 0x100 << ip;
258 + clear_c0_cause(ipnum);
259 + set_c0_status(ipnum);
262 +static inline void disable_local_irq(unsigned int ip)
264 + int ipnum = 0x100 << ip;
265 + clear_c0_status(ipnum);
268 +static inline void ack_local_irq(unsigned int ip)
270 + int ipnum = 0x100 << ip;
271 + clear_c0_cause(ipnum);
274 +static void aruba_enable_irq(unsigned int irq_nr)
276 + int ip = irq_nr - GROUP0_IRQ_BASE;
277 + unsigned int group, intr_bit;
278 + volatile unsigned int *addr;
280 + enable_local_irq(irq_nr);
283 + switch (mips_machtype) {
284 + case MACH_ARUBA_AP70:
287 + case MACH_ARUBA_AP65:
288 + case MACH_ARUBA_AP60:
294 + // calc interrupt bit within group
295 + ip -= (group << 5);
296 + intr_bit = 1 << ip;
298 + // first enable the IP mapped to this IRQ
299 + enable_local_irq(group_to_ip(group));
301 + switch (mips_machtype) {
302 + case MACH_ARUBA_AP70:
303 + addr = intr_group_muscat[group].base_addr;
304 + // unmask intr within group
305 + WRITE_MASK_MUSCAT(addr, READ_MASK_MUSCAT(addr) & ~intr_bit);
307 + case MACH_ARUBA_AP65:
308 + case MACH_ARUBA_AP60:
310 + addr = intr_group_merlot[group].base_addr;
311 + WRITE_MASK_MERLOT(addr, (READ_MASK_MERLOT(addr) | intr_bit));
317 +static void aruba_disable_irq(unsigned int irq_nr)
319 + int ip = irq_nr - GROUP0_IRQ_BASE;
320 + unsigned int group, intr_bit, mask;
321 + volatile unsigned int *addr;
324 + switch (mips_machtype) {
325 + case MACH_ARUBA_AP70:
328 + case MACH_ARUBA_AP65:
329 + case MACH_ARUBA_AP60:
335 + // calc interrupt bit within group
337 + intr_bit = 1 << ip;
339 + switch (mips_machtype) {
340 + case MACH_ARUBA_AP70:
341 + addr = intr_group_muscat[group].base_addr;
342 + // mask intr within group
343 + mask = READ_MASK_MUSCAT(addr);
345 + WRITE_MASK_MUSCAT(addr, mask);
348 + if there are no more interrupts enabled in this
349 + group, disable corresponding IP
351 + if (mask == intr_group_muscat[group].mask)
352 + disable_local_irq(group_to_ip(group));
354 + case MACH_ARUBA_AP65:
355 + case MACH_ARUBA_AP60:
357 + addr = intr_group_merlot[group].base_addr;
358 + addr = intr_group_merlot[group].base_addr;
359 + // mask intr within group
360 + WRITE_MASK_MERLOT(addr, (READ_MASK_MERLOT(addr) & ~intr_bit));
361 + if (READ_MASK_MERLOT(addr))
362 + disable_local_irq(group_to_ip(group));
367 +static unsigned int startup_irq(unsigned int irq_nr)
369 + aruba_enable_irq(irq_nr);
373 +static void shutdown_irq(unsigned int irq_nr)
375 + aruba_disable_irq(irq_nr);
379 +static void mask_and_ack_irq(unsigned int irq_nr)
381 + aruba_disable_irq(irq_nr);
382 + ack_local_irq(group_to_ip(irq_to_group(irq_nr)));
385 +static void end_irq(unsigned int irq_nr)
388 + int ip = irq_nr - GROUP0_IRQ_BASE;
389 + unsigned int intr_bit, group;
390 + volatile unsigned int *addr;
392 + if (irq_desc[irq_nr].status & (IRQ_DISABLED | IRQ_INPROGRESS)) {
393 + printk("warning: end_irq %d did not enable (%x)\n",
394 + irq_nr, irq_desc[irq_nr].status);
397 + switch (mips_machtype) {
398 + case MACH_ARUBA_AP70:
399 + if (irq_nr == GROUP4_IRQ_BASE + 9) idt_gpio->gpioistat &= 0xfffffdff;
400 + else if (irq_nr == GROUP4_IRQ_BASE + 10) idt_gpio->gpioistat &= 0xfffffbff;
401 + else if (irq_nr == GROUP4_IRQ_BASE + 11) idt_gpio->gpioistat &= 0xfffff7ff;
402 + else if (irq_nr == GROUP4_IRQ_BASE + 12) idt_gpio->gpioistat &= 0xffffefff;
406 + // calc interrupt bit within group
407 + ip -= (group << 5);
408 + intr_bit = 1 << ip;
410 + // first enable the IP mapped to this IRQ
411 + enable_local_irq(group_to_ip(group));
413 + addr = intr_group_muscat[group].base_addr;
414 + // unmask intr within group
415 + WRITE_MASK_MUSCAT(addr, READ_MASK_MUSCAT(addr) & ~intr_bit);
417 + case MACH_ARUBA_AP65:
418 + case MACH_ARUBA_AP60:
420 + // calc interrupt bit within group
421 + intr_bit = 1 << ip;
422 + // first enable the IP mapped to this IRQ
423 + enable_local_irq(group_to_ip(group));
424 + addr = intr_group_merlot[group].base_addr;
425 + // unmask intr within group
426 + WRITE_MASK_MERLOT(addr, (READ_MASK_MERLOT(addr) | intr_bit));
431 +static struct hw_interrupt_type aruba_irq_type = {
432 + .typename = "IDT434",
433 + .startup = startup_irq,
434 + .shutdown = shutdown_irq,
435 + .enable = aruba_enable_irq,
436 + .disable = aruba_disable_irq,
437 + .ack = mask_and_ack_irq,
441 +void __init arch_init_irq(void)
444 + printk("Initializing IRQ's: %d out of %d\n", RC32434_NR_IRQS, NR_IRQS);
445 + memset(irq_desc, 0, sizeof(irq_desc));
446 + set_except_vector(0, idtIRQ);
448 + for (i = 0; i < RC32434_NR_IRQS; i++) {
449 + irq_desc[i].status = IRQ_DISABLED;
450 + irq_desc[i].action = NULL;
451 + irq_desc[i].depth = 1;
452 + irq_desc[i].handler = &aruba_irq_type;
453 + spin_lock_init(&irq_desc[i].lock);
456 + switch (mips_machtype) {
457 + case MACH_ARUBA_AP70:
459 + case MACH_ARUBA_AP65:
460 + case MACH_ARUBA_AP60:
462 + WRITE_MASK_MERLOT(intr_group_merlot[0].base_addr, 0);
463 + *((volatile unsigned long *)0xbc003014) = 0x10;
468 +/* Main Interrupt dispatcher */
469 +void aruba_irqdispatch(unsigned long cp0_cause, struct pt_regs *regs)
471 + unsigned int pend, group, ip;
472 + volatile unsigned int *addr;
473 + switch (mips_machtype) {
474 + case MACH_ARUBA_AP70:
475 + if ((ip = (cp0_cause & 0x7c00))) {
476 + group = 21 - rc32434_clz(ip);
478 + addr = intr_group_muscat[group].base_addr;
480 + pend = READ_PEND_MUSCAT(addr);
481 + pend &= ~READ_MASK_MUSCAT(addr); // only unmasked interrupts
482 + pend = 39 - rc32434_clz(pend);
483 + do_IRQ((group << 5) + pend, regs);
486 + case MACH_ARUBA_AP65:
487 + case MACH_ARUBA_AP60:
489 + #define MERLOT_WLAN1_IRQ 2 // bit 10 in CP0_status register
490 + #define MERLOT_ENET_IRQ 3 // bit 11 in CP0_status register
491 + #define MERLOT_WLAN_IRQ 5 // bit 13 in CP0_status register
492 + #define MERLOT_MISC_IRQ 6 // bit 14 in CP0_status register = GROUP 0
494 + if (cp0_cause & (1 << (8 + MERLOT_MISC_IRQ))) {
497 + addr = intr_group_merlot[group].base_addr;
498 + pend = READ_PEND_MERLOT(addr);
499 + pend &= READ_MASK_MERLOT(addr); // only unmasked interrupts
500 + /* handle one misc interrupt at a time */
502 + unsigned int intr_bit, irq_nr;
503 + intr_bit = pend ^ (pend - 1);
504 + irq_nr = ((31 - rc32434_clz(pend)) + GROUP0_IRQ_BASE);
505 + do_IRQ(irq_nr, regs);
506 + do_IRQ(irq_nr, regs);
511 + if (cp0_cause & (1 << (8 + MERLOT_WLAN_IRQ))) {
512 + do_IRQ(MERLOT_WLAN_IRQ, regs);
515 + if (cp0_cause & (1 << (8 + MERLOT_ENET_IRQ))) {
516 + do_IRQ(MERLOT_ENET_IRQ, regs);
521 diff -Nur linux-2.6.15/arch/mips/aruba/Makefile linux-2.6.15-openwrt/arch/mips/aruba/Makefile
522 --- linux-2.6.15/arch/mips/aruba/Makefile 1970-01-01 01:00:00.000000000 +0100
523 +++ linux-2.6.15-openwrt/arch/mips/aruba/Makefile 2006-01-10 00:32:32.000000000 +0100
525 +###############################################################################
527 +# BRIEF MODULE DESCRIPTION
528 +# Makefile for IDT EB434 BSP
530 +# Copyright 2004 IDT Inc. (rischelp@idt.com)
532 +# This program is free software; you can redistribute it and/or modify it
533 +# under the terms of the GNU General Public License as published by the
534 +# Free Software Foundation; either version 2 of the License, or (at your
535 +# option) any later version.
537 +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
538 +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
539 +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
540 +# NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
541 +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
542 +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
543 +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
544 +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
545 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
546 +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
548 +# You should have received a copy of the GNU General Public License along
549 +# with this program; if not, write to the Free Software Foundation, Inc.,
550 +# 675 Mass Ave, Cambridge, MA 02139, USA.
553 +###############################################################################
560 +###############################################################################
564 +# $(CPP) $(CFLAGS) $< -o $*.s
566 +# $(CC) $(CFLAGS) -c $< -o $*.o
568 +obj-y := prom.o setup.o idtIRQ.o irq.o time.o flash_lock.o wdt_merlot.o
569 +obj-$(CONFIG_SERIAL_8250) += serial.o
572 +obj-y += nvram/built-in.o
574 diff -Nur linux-2.6.15/arch/mips/aruba/nvram/Makefile linux-2.6.15-openwrt/arch/mips/aruba/nvram/Makefile
575 --- linux-2.6.15/arch/mips/aruba/nvram/Makefile 1970-01-01 01:00:00.000000000 +0100
576 +++ linux-2.6.15-openwrt/arch/mips/aruba/nvram/Makefile 2006-01-10 00:32:32.000000000 +0100
578 +###############################################################################
580 +# BRIEF MODULE DESCRIPTION
581 +# Makefile for IDT EB434 nvram access routines
583 +# Copyright 2004 IDT Inc. (rischelp@idt.com)
585 +# This program is free software; you can redistribute it and/or modify it
586 +# under the terms of the GNU General Public License as published by the
587 +# Free Software Foundation; either version 2 of the License, or (at your
588 +# option) any later version.
590 +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
591 +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
592 +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
593 +# NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
594 +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
595 +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
596 +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
597 +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
598 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
599 +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
601 +# You should have received a copy of the GNU General Public License along
602 +# with this program; if not, write to the Free Software Foundation, Inc.,
603 +# 675 Mass Ave, Cambridge, MA 02139, USA.
606 +###############################################################################
613 +###############################################################################
616 +obj-m := $(O_TARGET)
624 diff -Nur linux-2.6.15/arch/mips/aruba/nvram/nvram434.c linux-2.6.15-openwrt/arch/mips/aruba/nvram/nvram434.c
625 --- linux-2.6.15/arch/mips/aruba/nvram/nvram434.c 1970-01-01 01:00:00.000000000 +0100
626 +++ linux-2.6.15-openwrt/arch/mips/aruba/nvram/nvram434.c 2006-01-10 00:32:32.000000000 +0100
628 +/**************************************************************************
630 + * BRIEF MODULE DESCRIPTION
631 + * nvram interface routines.
633 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
635 + * This program is free software; you can redistribute it and/or modify it
636 + * under the terms of the GNU General Public License as published by the
637 + * Free Software Foundation; either version 2 of the License, or (at your
638 + * option) any later version.
640 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
641 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
642 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
643 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
644 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
645 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
646 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
647 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
648 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
649 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
651 + * You should have received a copy of the GNU General Public License along
652 + * with this program; if not, write to the Free Software Foundation, Inc.,
653 + * 675 Mass Ave, Cambridge, MA 02139, USA.
656 + **************************************************************************
657 + * May 2004 rkt, neb
663 + **************************************************************************
666 +#include <linux/ctype.h>
667 +#include <linux/string.h>
669 +//#include <asm/ds1553rtc.h>
670 +#include "nvram434.h"
671 +#define NVRAM_BASE 0xbfff8000
673 +extern void setenv (char *e, char *v, int rewrite);
674 +extern void unsetenv (char *e);
675 +extern void mapenv (int (*func)(char *, char *));
676 +extern char *getenv (char *s);
677 +extern void purgeenv(void);
679 +static void nvram_initenv(void);
681 +static unsigned char
682 +nvram_getbyte(int offs)
684 + return(*((unsigned char*)(NVRAM_BASE + offs)));
688 +nvram_setbyte(int offs, unsigned char val)
690 + unsigned char* nvramDataPointer = (unsigned char*)(NVRAM_BASE + offs);
692 + *nvramDataPointer = val;
698 +static unsigned short
699 +nvram_getshort(int offs)
701 + return((nvram_getbyte(offs) << 8) | nvram_getbyte(offs + 1));
705 +nvram_setshort(int offs, unsigned short val)
707 + nvram_setbyte(offs, (unsigned char)((val >> 8) & 0xff));
708 + nvram_setbyte(offs + 1, (unsigned char)(val & 0xff));
712 +nvram_getint(int offs)
715 + val = nvram_getbyte(offs) << 24;
716 + val |= nvram_getbyte(offs + 1) << 16;
717 + val |= nvram_getbyte(offs + 2) << 8;
718 + val |= nvram_getbyte(offs + 3);
723 +nvram_setint(int offs, unsigned int val)
725 + nvram_setbyte(offs, val >> 24);
726 + nvram_setbyte(offs + 1, val >> 16);
727 + nvram_setbyte(offs + 2, val >> 8);
728 + nvram_setbyte(offs + 3, val);
732 + * calculate NVRAM checksum
734 +static unsigned short
737 + unsigned short sum = NV_MAGIC;
740 + for (i = ENV_BASE; i < ENV_TOP; i += 2)
741 + sum += nvram_getshort(i);
746 + * update the nvram checksum
749 +nvram_updatesum (void)
751 + nvram_setshort(NVOFF_CSUM, nvram_calcsum());
755 + * test validity of nvram by checksumming it
760 + static int is_valid;
765 + if (nvram_getshort(NVOFF_MAGIC) != NV_MAGIC) {
766 + printk("nvram_isvalid FAILED\n");
773 +/* return nvram address of environment string */
775 +nvram_matchenv(char *s)
777 + int envsize, envp, n, i, varsize;
780 + envsize = nvram_getshort(NVOFF_ENVSIZE);
782 + if (envsize > ENV_AVAIL)
783 + return(0); /* sanity */
787 + if ((n = strlen (s)) > 255)
790 + while (envsize > 0) {
791 + varsize = nvram_getbyte(envp);
792 + if (varsize == 0 || (envp + varsize) > ENV_TOP)
793 + return(0); /* sanity */
794 + for (i = envp + 1, var = s; i <= envp + n; i++, var++) {
795 + char c1 = nvram_getbyte(i);
804 + if (i > envp + n) { /* match so far */
805 + if (n == varsize - 1) /* match on boolean */
807 + if (nvram_getbyte(i) == '=') /* exact match on variable */
810 + envsize -= varsize;
816 +static void nvram_initenv(void)
818 + nvram_setshort(NVOFF_MAGIC, NV_MAGIC);
819 + nvram_setshort(NVOFF_ENVSIZE, 0);
825 +nvram_delenv(char *s)
827 + int nenvp, envp, envsize, nbytes;
829 + envp = nvram_matchenv(s);
833 + nenvp = envp + nvram_getbyte(envp);
834 + envsize = nvram_getshort(NVOFF_ENVSIZE);
835 + nbytes = envsize - (nenvp - ENV_BASE);
836 + nvram_setshort(NVOFF_ENVSIZE, envsize - (nenvp - envp));
838 + nvram_setbyte(envp, nvram_getbyte(nenvp));
846 +nvram_setenv(char *s, char *v)
851 + if (!nvram_isvalid())
860 + total = ns + nv + 2;
866 + if (total > 255 || total > ENV_AVAIL - nvram_getshort(NVOFF_ENVSIZE))
869 + envp = ENV_BASE + nvram_getshort(NVOFF_ENVSIZE);
871 + nvram_setbyte(envp, (unsigned char) total);
875 + nvram_setbyte(envp, *s);
881 + nvram_setbyte(envp, '=');
884 + nvram_setbyte(envp, *v);
889 + nvram_setshort(NVOFF_ENVSIZE, envp-ENV_BASE);
895 +nvram_getenv(char *s)
897 + static char buf[256]; /* FIXME: this cannot be static */
898 + int envp, ns, nbytes, i;
900 + if (!nvram_isvalid())
901 + return "INVALID NVRAM"; //((char *)0);
903 + envp = nvram_matchenv(s);
905 + return "NOT FOUND"; //((char *)0);
907 + if (nvram_getbyte(envp) == ns + 1) /* boolean */
910 + nbytes = nvram_getbyte(envp) - (ns + 2);
912 + for (i = 0; i < nbytes; i++)
913 + buf[i] = nvram_getbyte(envp++);
920 +nvram_unsetenv(char *s)
922 + if (!nvram_isvalid())
929 + * apply func to each string in environment
932 +nvram_mapenv(int (*func)(char *, char *))
934 + int envsize, envp, n, i, seeneql;
935 + char name[256], value[256];
938 + if (!nvram_isvalid())
941 + envsize = nvram_getshort(NVOFF_ENVSIZE);
944 + while (envsize > 0) {
948 + n = nvram_getbyte(envp);
949 + for (i = envp + 1; i < envp + n; i++) {
950 + c = nvram_getbyte(i);
951 + if ((c == '=') && !seeneql) {
960 + (*func)(name, value);
969 + if ('0' <= c && c <= '9')
971 + if ('A' <= c && c <= 'Z')
972 + return (10 + c - 'A');
973 + if ('a' <= c && c <= 'z')
974 + return (10 + c - 'a');
979 + * Wrappers to allow 'special' environment variables to get processed
982 +setenv(char *e, char *v, int rewrite)
984 + if (nvram_getenv(e) && !rewrite)
987 + nvram_setenv(e, v);
993 + return(nvram_getenv(e));
1006 + unsigned char* nvramDataPointer = (unsigned char*)(NVRAM_BASE);
1008 + for (i = ENV_BASE; i < ENV_TOP; i++)
1009 + *nvramDataPointer++ = 0;
1010 + nvram_setshort(NVOFF_MAGIC, NV_MAGIC);
1011 + nvram_setshort(NVOFF_ENVSIZE, 0);
1012 + nvram_setshort(NVOFF_CSUM, NV_MAGIC);
1016 +mapenv(int (*func)(char *, char *))
1018 + nvram_mapenv(func);
1020 diff -Nur linux-2.6.15/arch/mips/aruba/nvram/nvram434.h linux-2.6.15-openwrt/arch/mips/aruba/nvram/nvram434.h
1021 --- linux-2.6.15/arch/mips/aruba/nvram/nvram434.h 1970-01-01 01:00:00.000000000 +0100
1022 +++ linux-2.6.15-openwrt/arch/mips/aruba/nvram/nvram434.h 2006-01-10 00:32:32.000000000 +0100
1024 +/**************************************************************************
1026 + * BRIEF MODULE DESCRIPTION
1027 + * nvram definitions.
1029 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1031 + * This program is free software; you can redistribute it and/or modify it
1032 + * under the terms of the GNU General Public License as published by the
1033 + * Free Software Foundation; either version 2 of the License, or (at your
1034 + * option) any later version.
1036 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1037 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1038 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1039 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1040 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1041 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1042 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1043 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1044 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1045 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1047 + * You should have received a copy of the GNU General Public License along
1048 + * with this program; if not, write to the Free Software Foundation, Inc.,
1049 + * 675 Mass Ave, Cambridge, MA 02139, USA.
1052 + **************************************************************************
1053 + * May 2004 rkt, neb
1059 + **************************************************************************
1065 +#define NVOFFSET 0 /* use all of NVRAM */
1067 +/* Offsets to reserved locations */
1068 + /* size description */
1069 +#define NVOFF_MAGIC (NVOFFSET + 0) /* 2 magic value */
1070 +#define NVOFF_CSUM (NVOFFSET + 2) /* 2 NVRAM environment checksum */
1071 +#define NVOFF_ENVSIZE (NVOFFSET + 4) /* 2 size of 'environment' */
1072 +#define NVOFF_TEST (NVOFFSET + 5) /* 1 cold start test byte */
1073 +#define NVOFF_ETHADDR (NVOFFSET + 6) /* 6 decoded ethernet address */
1074 +#define NVOFF_UNUSED (NVOFFSET + 12) /* 0 current end of table */
1076 +#define NV_MAGIC 0xdeaf /* nvram magic number */
1077 +#define NV_RESERVED 6 /* number of reserved bytes */
1079 +#undef NVOFF_ETHADDR
1080 +#define NVOFF_ETHADDR (NVOFFSET + NV_RESERVED - 6)
1082 +/* number of bytes available for environment */
1083 +#define ENV_BASE (NVOFFSET + NV_RESERVED)
1084 +#define ENV_TOP 0x2000
1085 +#define ENV_AVAIL (ENV_TOP - ENV_BASE)
1087 +#endif /* _NVRAM_ */
1090 diff -Nur linux-2.6.15/arch/mips/aruba/prom.c linux-2.6.15-openwrt/arch/mips/aruba/prom.c
1091 --- linux-2.6.15/arch/mips/aruba/prom.c 1970-01-01 01:00:00.000000000 +0100
1092 +++ linux-2.6.15-openwrt/arch/mips/aruba/prom.c 2006-01-10 00:32:32.000000000 +0100
1094 +/**************************************************************************
1096 + * BRIEF MODULE DESCRIPTION
1097 + * prom interface routines
1099 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1101 + * This program is free software; you can redistribute it and/or modify it
1102 + * under the terms of the GNU General Public License as published by the
1103 + * Free Software Foundation; either version 2 of the License, or (at your
1104 + * option) any later version.
1106 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1107 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1108 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1109 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1110 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1111 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1112 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1113 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1114 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1115 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1117 + * You should have received a copy of the GNU General Public License along
1118 + * with this program; if not, write to the Free Software Foundation, Inc.,
1119 + * 675 Mass Ave, Cambridge, MA 02139, USA.
1122 + **************************************************************************
1123 + * May 2004 rkt, neb
1129 + **************************************************************************
1132 +#include <linux/config.h>
1133 +#include <linux/init.h>
1134 +#include <linux/mm.h>
1135 +#include <linux/module.h>
1136 +#include <linux/string.h>
1137 +#include <linux/console.h>
1138 +#include <asm/bootinfo.h>
1139 +#include <linux/bootmem.h>
1140 +#include <linux/ioport.h>
1141 +#include <linux/serial.h>
1142 +#include <linux/serialP.h>
1143 +#include <asm/serial.h>
1144 +#include <linux/ioport.h>
1146 +unsigned int idt_cpu_freq;
1147 +EXPORT_SYMBOL(idt_cpu_freq);
1149 +unsigned int arch_has_pci=0;
1151 +/* Kernel Boot parameters */
1152 +static unsigned char bootparm[] = "console=ttyS0,9600 root=/dev/mtdblock1 rootfstype=jffs2";
1154 +extern unsigned long mips_machgroup;
1155 +extern unsigned long mips_machtype;
1157 +extern void setup_serial_port(void);
1158 +extern char * getenv(char *e);
1160 +/* IDT 79EB434 memory map -- we really should be auto sizing it */
1161 +#define RAM_SIZE 32*1024*1024
1163 +char *__init prom_getcmdline(void)
1165 + return &(arcs_cmdline[0]);
1168 +void __init prom_init(void)
1171 + sprintf(arcs_cmdline, "%s", bootparm);
1173 + /* set our arch type */
1174 + mips_machgroup = MACH_GROUP_ARUBA;
1175 + mips_machtype = MACH_ARUBA_UNKNOWN;
1177 + boardname=getenv("boardname");
1179 + if (!strcmp(boardname,"Muscat")) {
1180 + mips_machtype = MACH_ARUBA_AP70;
1181 + idt_cpu_freq = 133000000;
1183 + } else if (!strcmp(boardname,"Mataro")) {
1184 + mips_machtype = MACH_ARUBA_AP65;
1185 + idt_cpu_freq = 110000000;
1186 + } else if (!strcmp(boardname,"Merlot")) {
1187 + mips_machtype = MACH_ARUBA_AP60;
1188 + idt_cpu_freq = 90000000;
1191 + /* turn on the console */
1192 + setup_serial_port();
1195 + * give all RAM to boot allocator,
1196 + * except where the kernel was loaded
1198 + add_memory_region(0,RAM_SIZE,BOOT_MEM_RAM);
1201 +void prom_free_prom_memory(void)
1203 + printk("stubbed prom_free_prom_memory()\n");
1205 diff -Nur linux-2.6.15/arch/mips/aruba/serial.c linux-2.6.15-openwrt/arch/mips/aruba/serial.c
1206 --- linux-2.6.15/arch/mips/aruba/serial.c 1970-01-01 01:00:00.000000000 +0100
1207 +++ linux-2.6.15-openwrt/arch/mips/aruba/serial.c 2006-01-10 00:32:32.000000000 +0100
1209 +/**************************************************************************
1211 + * BRIEF MODULE DESCRIPTION
1212 + * Serial port initialisation.
1214 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1216 + * This program is free software; you can redistribute it and/or modify it
1217 + * under the terms of the GNU General Public License as published by the
1218 + * Free Software Foundation; either version 2 of the License, or (at your
1219 + * option) any later version.
1221 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1222 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1223 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1224 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1225 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1226 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1227 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1228 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1229 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1230 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1232 + * You should have received a copy of the GNU General Public License along
1233 + * with this program; if not, write to the Free Software Foundation, Inc.,
1234 + * 675 Mass Ave, Cambridge, MA 02139, USA.
1237 + **************************************************************************
1238 + * May 2004 rkt, neb
1244 + **************************************************************************
1248 +#include <linux/config.h>
1249 +#include <linux/init.h>
1250 +#include <linux/sched.h>
1251 +#include <linux/pci.h>
1252 +#include <linux/interrupt.h>
1253 +#include <linux/tty.h>
1254 +#include <linux/serial.h>
1255 +#include <linux/serial_core.h>
1257 +#include <asm/time.h>
1258 +#include <asm/cpu.h>
1259 +#include <asm/bootinfo.h>
1260 +#include <asm/irq.h>
1261 +#include <asm/serial.h>
1263 +#include <asm/idt-boards/rc32434/rc32434.h>
1265 +extern int __init early_serial_setup(struct uart_port *port);
1267 +#define BASE_BAUD (1843200 / 16)
1269 +extern unsigned int idt_cpu_freq;
1271 +extern int __init setup_serial_port(void)
1273 + static struct uart_port serial_req[2];
1275 + memset(serial_req, 0, sizeof(serial_req));
1276 + serial_req[0].type = PORT_16550A;
1277 + serial_req[0].line = 0;
1278 + serial_req[0].flags = STD_COM_FLAGS;
1279 + serial_req[0].iotype = SERIAL_IO_MEM;
1280 + serial_req[0].regshift = 2;
1282 + switch (mips_machtype) {
1283 + case MACH_ARUBA_AP70:
1284 + serial_req[0].irq = 104;
1285 + serial_req[0].mapbase = KSEG1ADDR(0x18058003);
1286 + serial_req[0].membase = (char *) KSEG1ADDR(0x18058003);
1287 + serial_req[0].uartclk = idt_cpu_freq;
1289 + case MACH_ARUBA_AP65:
1290 + case MACH_ARUBA_AP60:
1292 + serial_req[0].irq = 12;
1293 + serial_req[0].mapbase = KSEG1ADDR(0xbc000003);
1294 + serial_req[0].membase = (char *) KSEG1ADDR(0xbc000003);
1295 + serial_req[0].uartclk = idt_cpu_freq / 2;
1299 + early_serial_setup(&serial_req[0]);
1303 diff -Nur linux-2.6.15/arch/mips/aruba/setup.c linux-2.6.15-openwrt/arch/mips/aruba/setup.c
1304 --- linux-2.6.15/arch/mips/aruba/setup.c 1970-01-01 01:00:00.000000000 +0100
1305 +++ linux-2.6.15-openwrt/arch/mips/aruba/setup.c 2006-01-10 00:32:32.000000000 +0100
1307 +/**************************************************************************
1309 + * BRIEF MODULE DESCRIPTION
1310 + * setup routines for IDT EB434 boards
1312 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1314 + * This program is free software; you can redistribute it and/or modify it
1315 + * under the terms of the GNU General Public License as published by the
1316 + * Free Software Foundation; either version 2 of the License, or (at your
1317 + * option) any later version.
1319 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1320 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1321 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1322 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1323 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1324 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1325 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1326 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1327 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1328 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1330 + * You should have received a copy of the GNU General Public License along
1331 + * with this program; if not, write to the Free Software Foundation, Inc.,
1332 + * 675 Mass Ave, Cambridge, MA 02139, USA.
1335 + **************************************************************************
1336 + * May 2004 rkt, neb
1342 + **************************************************************************
1345 +#include <linux/init.h>
1346 +#include <linux/mm.h>
1347 +#include <linux/sched.h>
1348 +#include <linux/irq.h>
1349 +#include <asm/bootinfo.h>
1350 +#include <asm/io.h>
1351 +#include <linux/ioport.h>
1352 +#include <asm/mipsregs.h>
1353 +#include <asm/pgtable.h>
1354 +#include <asm/reboot.h>
1355 +#include <asm/addrspace.h> /* for KSEG1ADDR() */
1356 +#include <asm/idt-boards/rc32434/rc32434.h>
1358 +extern char *__init prom_getcmdline(void);
1360 +extern void (*board_time_init) (void);
1361 +extern void (*board_timer_setup) (struct irqaction * irq);
1362 +extern void aruba_time_init(void);
1363 +extern void aruba_timer_setup(struct irqaction *irq);
1364 +extern void aruba_reset(void);
1366 +#define epldMask ((volatile unsigned char *)0xB900000d)
1368 +static void aruba_machine_restart(char *command)
1370 + switch (mips_machtype) {
1371 + case MACH_ARUBA_AP70:
1372 + *(volatile u32 *)KSEG1ADDR(0x18008000) = 0x80000001;
1374 + case MACH_ARUBA_AP65:
1375 + case MACH_ARUBA_AP60:
1378 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0x00080350; // reset everything in sight
1380 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0; // reset everything in sight
1382 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0x3; // cold reset the cpu & system
1387 +static void aruba_machine_halt(void)
1389 + for (;;) continue;
1392 +extern char * getenv(char *e);
1393 +extern void unlock_ap60_70_flash(void);
1394 +extern void wdt_merlot_disable(void);
1396 +void __init plat_setup(void)
1398 + board_time_init = aruba_time_init;
1400 + board_timer_setup = aruba_timer_setup;
1402 + _machine_restart = aruba_machine_restart;
1403 + _machine_halt = aruba_machine_halt;
1404 + _machine_power_off = aruba_machine_halt;
1406 + set_io_port_base(KSEG1);
1408 + /* Enable PCI interrupts in EPLD Mask register */
1410 + *(epldMask + 1) = 0x0;
1412 + write_c0_wired(0);
1413 + unlock_ap60_70_flash();
1415 + printk("BOARD - %s\n",getenv("boardname"));
1417 + wdt_merlot_disable();
1422 +int page_is_ram(unsigned long pagenr)
1427 +const char *get_system_type(void)
1429 + return "MIPS IDT32434 - ARUBA";
1431 diff -Nur linux-2.6.15/arch/mips/aruba/time.c linux-2.6.15-openwrt/arch/mips/aruba/time.c
1432 --- linux-2.6.15/arch/mips/aruba/time.c 1970-01-01 01:00:00.000000000 +0100
1433 +++ linux-2.6.15-openwrt/arch/mips/aruba/time.c 2006-01-10 00:32:32.000000000 +0100
1435 +/**************************************************************************
1437 + * BRIEF MODULE DESCRIPTION
1438 + * timer routines for IDT EB434 boards
1440 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1442 + * This program is free software; you can redistribute it and/or modify it
1443 + * under the terms of the GNU General Public License as published by the
1444 + * Free Software Foundation; either version 2 of the License, or (at your
1445 + * option) any later version.
1447 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1448 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1449 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1450 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1451 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1452 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1453 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1454 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1455 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1456 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1458 + * You should have received a copy of the GNU General Public License along
1459 + * with this program; if not, write to the Free Software Foundation, Inc.,
1460 + * 675 Mass Ave, Cambridge, MA 02139, USA.
1463 + **************************************************************************
1464 + * May 2004 rkt, neb
1470 + **************************************************************************
1473 +#include <linux/config.h>
1474 +#include <linux/init.h>
1475 +#include <linux/kernel_stat.h>
1476 +#include <linux/sched.h>
1477 +#include <linux/spinlock.h>
1478 +#include <linux/mc146818rtc.h>
1479 +#include <linux/irq.h>
1480 +#include <linux/timex.h>
1482 +#include <linux/param.h>
1483 +#include <asm/mipsregs.h>
1484 +#include <asm/ptrace.h>
1485 +#include <asm/time.h>
1486 +#include <asm/hardirq.h>
1488 +#include <asm/mipsregs.h>
1489 +#include <asm/ptrace.h>
1490 +#include <asm/debug.h>
1491 +#include <asm/time.h>
1493 +#include <asm/idt-boards/rc32434/rc32434.h>
1495 +static unsigned long r4k_offset; /* Amount to incr compare reg each time */
1496 +static unsigned long r4k_cur; /* What counter should be at next timer irq */
1498 +extern unsigned int idt_cpu_freq;
1500 +static unsigned long __init cal_r4koff(void)
1502 + mips_hpt_frequency = idt_cpu_freq * IDT_CLOCK_MULT / 2;
1503 + return (mips_hpt_frequency / HZ);
1506 +void __init aruba_time_init(void)
1508 + unsigned int est_freq, flags;
1509 + local_irq_save(flags);
1511 + printk("calculating r4koff... ");
1512 + r4k_offset = cal_r4koff();
1513 + printk("%08lx(%d)\n", r4k_offset, (int)r4k_offset);
1515 + est_freq = 2 * r4k_offset * HZ;
1516 + est_freq += 5000; /* round */
1517 + est_freq -= est_freq % 10000;
1518 + printk("CPU frequency %d.%02d MHz\n", est_freq / 1000000,
1519 + (est_freq % 1000000) * 100 / 1000000);
1520 + local_irq_restore(flags);
1524 +void __init aruba_timer_setup(struct irqaction *irq)
1526 + /* we are using the cpu counter for timer interrupts */
1527 + setup_irq(MIPS_CPU_TIMER_IRQ, irq);
1529 + /* to generate the first timer interrupt */
1530 + r4k_cur = (read_c0_count() + r4k_offset);
1531 + write_c0_compare(r4k_cur);
1535 +asmlinkage void aruba_timer_interrupt(int irq, struct pt_regs *regs)
1538 + kstat_this_cpu.irqs[irq]++;
1540 + timer_interrupt(irq, NULL, regs);
1543 diff -Nur linux-2.6.15/arch/mips/aruba/wdt_merlot.c linux-2.6.15-openwrt/arch/mips/aruba/wdt_merlot.c
1544 --- linux-2.6.15/arch/mips/aruba/wdt_merlot.c 1970-01-01 01:00:00.000000000 +0100
1545 +++ linux-2.6.15-openwrt/arch/mips/aruba/wdt_merlot.c 2006-01-10 00:32:32.000000000 +0100
1547 +#include <linux/config.h>
1548 +#include <linux/kernel.h>
1549 +#include <asm/bootinfo.h>
1551 +void wdt_merlot_disable()
1553 + volatile __u32 *wdt_errcs;
1554 + volatile __u32 *wdt_wtc;
1555 + volatile __u32 *wdt_ctl;
1556 + volatile __u32 val;
1558 + switch (mips_machtype) {
1559 + case MACH_ARUBA_AP70:
1560 + wdt_errcs = (__u32 *) 0xb8030030;
1561 + wdt_wtc = (__u32 *) 0xb803003c;
1569 + case MACH_ARUBA_AP65:
1570 + case MACH_ARUBA_AP60:
1572 + wdt_ctl = (__u32 *) 0xbc003008;
1577 diff -Nur linux-2.6.15/arch/mips/Kconfig linux-2.6.15-openwrt/arch/mips/Kconfig
1578 --- linux-2.6.15/arch/mips/Kconfig 2006-01-03 04:21:10.000000000 +0100
1579 +++ linux-2.6.15-openwrt/arch/mips/Kconfig 2006-01-10 00:32:32.000000000 +0100
1580 @@ -227,6 +227,18 @@
1581 either a NEC Vr5432 or QED RM5231. Say Y here if you wish to build
1582 a kernel for this platform.
1585 + bool "Support for the ARUBA product line"
1586 + select DMA_NONCOHERENT
1588 + select CPU_HAS_PREFETCH
1590 + select SWAP_IO_SPACE
1591 + select SYS_SUPPORTS_32BIT_KERNEL
1592 + select SYS_HAS_CPU_MIPS32_R1
1593 + select SYS_SUPPORTS_BIG_ENDIAN
1597 bool "Support for the Jazz family of machines"
1599 diff -Nur linux-2.6.15/arch/mips/Makefile linux-2.6.15-openwrt/arch/mips/Makefile
1600 --- linux-2.6.15/arch/mips/Makefile 2006-01-03 04:21:10.000000000 +0100
1601 +++ linux-2.6.15-openwrt/arch/mips/Makefile 2006-01-10 00:32:32.000000000 +0100
1602 @@ -258,6 +258,14 @@
1609 +core-$(CONFIG_MACH_ARUBA) += arch/mips/aruba/
1610 +cflags-$(CONFIG_MACH_ARUBA) += -Iinclude/asm-mips/aruba
1611 +load-$(CONFIG_MACH_ARUBA) += 0x80100000
1614 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
1616 core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
1617 diff -Nur linux-2.6.15/arch/mips/mm/tlbex.c linux-2.6.15-openwrt/arch/mips/mm/tlbex.c
1618 --- linux-2.6.15/arch/mips/mm/tlbex.c 2006-01-03 04:21:10.000000000 +0100
1619 +++ linux-2.6.15-openwrt/arch/mips/mm/tlbex.c 2006-01-10 00:32:32.000000000 +0100
1636 diff -Nur linux-2.6.15/arch/mips/pci/fixup-aruba.c linux-2.6.15-openwrt/arch/mips/pci/fixup-aruba.c
1637 --- linux-2.6.15/arch/mips/pci/fixup-aruba.c 1970-01-01 01:00:00.000000000 +0100
1638 +++ linux-2.6.15-openwrt/arch/mips/pci/fixup-aruba.c 2006-01-10 00:34:41.000000000 +0100
1640 +/**************************************************************************
1642 + * BRIEF MODULE DESCRIPTION
1643 + * PCI fixups for IDT EB434 board
1645 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1647 + * This program is free software; you can redistribute it and/or modify it
1648 + * under the terms of the GNU General Public License as published by the
1649 + * Free Software Foundation; either version 2 of the License, or (at your
1650 + * option) any later version.
1652 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1653 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1654 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1655 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1656 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1657 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1658 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1659 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1660 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1661 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1663 + * You should have received a copy of the GNU General Public License along
1664 + * with this program; if not, write to the Free Software Foundation, Inc.,
1665 + * 675 Mass Ave, Cambridge, MA 02139, USA.
1668 + **************************************************************************
1669 + * May 2004 rkt, neb
1675 + **************************************************************************
1678 +#include <linux/config.h>
1679 +#include <linux/types.h>
1680 +#include <linux/pci.h>
1681 +#include <linux/kernel.h>
1682 +#include <linux/init.h>
1683 +#include <asm/idt-boards/rc32434/rc32434.h>
1684 +#include <asm/idt-boards/rc32434/rc32434_pci.h>
1686 +int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
1689 + if (dev->bus->number != 0) {
1693 + slot = PCI_SLOT(dev->devfn);
1696 + if (slot > 0 && slot <= 15) {
1699 + if(pin == 1) dev->irq = GROUP4_IRQ_BASE + 9; // intA
1700 + } else if(slot == 11) {
1701 + if(pin == 1) dev->irq = GROUP4_IRQ_BASE + 10; // intA
1702 + if(pin == 2) dev->irq = GROUP4_IRQ_BASE + 10; // intA
1703 + if(pin == 3) dev->irq = GROUP4_IRQ_BASE + 10; // intA
1704 + } else if(slot == 12) {
1705 + if(pin == 1) dev->irq = GROUP4_IRQ_BASE + 11; // intA
1706 + if(pin == 2) dev->irq = GROUP4_IRQ_BASE + 12; // intB
1707 + } else if (slot == 13) {
1708 + if(pin == 1) dev->irq = GROUP4_IRQ_BASE + 12; // intA
1709 + if(pin == 2) dev->irq = GROUP4_IRQ_BASE + 11; // intB
1711 + dev->irq = GROUP4_IRQ_BASE + 11;
1716 + dev->irq = GROUP4_IRQ_BASE + 11;
1718 + case 2: /* INTB */
1719 + dev->irq = GROUP4_IRQ_BASE + 11;
1721 + case 3: /* INTC */
1722 + dev->irq = GROUP4_IRQ_BASE + 11;
1724 + case 4: /* INTD */
1725 + dev->irq = GROUP4_IRQ_BASE + 11;
1733 + printk("irq fixup: slot %d, pin %d, irq %d\n",
1734 + slot, pin, dev->irq);
1736 + pci_write_config_byte(dev, PCI_INTERRUPT_LINE,dev->irq);
1738 + return (dev->irq);
1741 +struct pci_fixup pcibios_fixups[] = {
1755 diff -Nur linux-2.6.15/arch/mips/pci/Makefile linux-2.6.15-openwrt/arch/mips/pci/Makefile
1756 --- linux-2.6.15/arch/mips/pci/Makefile 2006-01-03 04:21:10.000000000 +0100
1757 +++ linux-2.6.15-openwrt/arch/mips/pci/Makefile 2006-01-10 00:32:32.000000000 +0100
1759 obj-$(CONFIG_TOSHIBA_RBTX4938) += fixup-tx4938.o ops-tx4938.o
1760 obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o
1761 obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o
1762 +obj-$(CONFIG_MACH_ARUBA) += fixup-aruba.o ops-aruba.o pci-aruba.o
1763 diff -Nur linux-2.6.15/arch/mips/pci/ops-aruba.c linux-2.6.15-openwrt/arch/mips/pci/ops-aruba.c
1764 --- linux-2.6.15/arch/mips/pci/ops-aruba.c 1970-01-01 01:00:00.000000000 +0100
1765 +++ linux-2.6.15-openwrt/arch/mips/pci/ops-aruba.c 2006-01-10 00:32:32.000000000 +0100
1767 +/**************************************************************************
1769 + * BRIEF MODULE DESCRIPTION
1770 + * pci_ops for IDT EB434 board
1772 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1774 + * This program is free software; you can redistribute it and/or modify it
1775 + * under the terms of the GNU General Public License as published by the
1776 + * Free Software Foundation; either version 2 of the License, or (at your
1777 + * option) any later version.
1779 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1780 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1781 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1782 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1783 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1784 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1785 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1786 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1787 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1788 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1790 + * You should have received a copy of the GNU General Public License along
1791 + * with this program; if not, write to the Free Software Foundation, Inc.,
1792 + * 675 Mass Ave, Cambridge, MA 02139, USA.
1795 + **************************************************************************
1796 + * May 2004 rkt, neb
1802 + **************************************************************************
1805 +#include <linux/config.h>
1806 +#include <linux/init.h>
1807 +#include <linux/pci.h>
1808 +#include <linux/types.h>
1809 +#include <linux/delay.h>
1811 +#include <asm/cpu.h>
1812 +#include <asm/io.h>
1814 +#include <asm/idt-boards/rc32434/rc32434.h>
1815 +#include <asm/idt-boards/rc32434/rc32434_pci.h>
1817 +#define PCI_ACCESS_READ 0
1818 +#define PCI_ACCESS_WRITE 1
1821 +#define PCI_CFG_SET(slot,func,off) \
1822 + (rc32434_pci->pcicfga = (0x80000000 | ((slot)<<11) | \
1823 + ((func)<<8) | (off)))
1825 +static int config_access(unsigned char access_type, struct pci_bus *bus,
1826 + unsigned int devfn, unsigned char where,
1830 + * config cycles are on 4 byte boundary only
1832 + unsigned int slot = PCI_SLOT(devfn);
1833 + u8 func = PCI_FUNC(devfn);
1835 + if (slot < 2 || slot > 15) {
1836 + *data = 0xFFFFFFFF;
1839 + /* Setup address */
1840 + PCI_CFG_SET(slot, func, where);
1843 + if (access_type == PCI_ACCESS_WRITE) {
1845 + rc32434_pci->pcicfgd = *data;
1848 + *data = rc32434_pci->pcicfgd;
1858 + * We can't address 8 and 16 bit words directly. Instead we have to
1859 + * read/write a 32bit word and mask/modify the data we actually want.
1861 +static int read_config_byte(struct pci_bus *bus, unsigned int devfn,
1862 + int where, u8 * val)
1867 + ret = config_access(PCI_ACCESS_READ, bus, devfn, where, &data);
1868 + *val = (data >> ((where & 3) << 3)) & 0xff;
1872 +static int read_config_word(struct pci_bus *bus, unsigned int devfn,
1873 + int where, u16 * val)
1878 + ret = config_access(PCI_ACCESS_READ, bus, devfn, where, &data);
1879 + *val = (data >> ((where & 3) << 3)) & 0xffff;
1883 +static int read_config_dword(struct pci_bus *bus, unsigned int devfn,
1884 + int where, u32 * val)
1888 + ret = config_access(PCI_ACCESS_READ, bus, devfn, where, val);
1893 +write_config_byte(struct pci_bus *bus, unsigned int devfn, int where,
1898 + if (config_access(PCI_ACCESS_READ, bus, devfn, where, &data))
1901 + data = (data & ~(0xff << ((where & 3) << 3))) |
1902 + (val << ((where & 3) << 3));
1904 + if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data))
1907 + return PCIBIOS_SUCCESSFUL;
1912 +write_config_word(struct pci_bus *bus, unsigned int devfn, int where,
1917 + if (config_access(PCI_ACCESS_READ, bus, devfn, where, &data))
1920 + data = (data & ~(0xffff << ((where & 3) << 3))) |
1921 + (val << ((where & 3) << 3));
1923 + if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data))
1927 + return PCIBIOS_SUCCESSFUL;
1932 +write_config_dword(struct pci_bus *bus, unsigned int devfn, int where,
1935 + if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &val))
1938 + return PCIBIOS_SUCCESSFUL;
1941 +static int pci_config_read(struct pci_bus *bus, unsigned int devfn,
1942 + int where, int size, u32 * val)
1946 + return read_config_byte(bus, devfn, where, (u8 *) val);
1948 + return read_config_word(bus, devfn, where, (u16 *) val);
1950 + return read_config_dword(bus, devfn, where, val);
1954 +static int pci_config_write(struct pci_bus *bus, unsigned int devfn,
1955 + int where, int size, u32 val)
1959 + return write_config_byte(bus, devfn, where, (u8) val);
1961 + return write_config_word(bus, devfn, where, (u16) val);
1963 + return write_config_dword(bus, devfn, where, val);
1967 +struct pci_ops rc32434_pci_ops = {
1968 + .read = pci_config_read,
1969 + .write = pci_config_write,
1971 diff -Nur linux-2.6.15/arch/mips/pci/pci-aruba.c linux-2.6.15-openwrt/arch/mips/pci/pci-aruba.c
1972 --- linux-2.6.15/arch/mips/pci/pci-aruba.c 1970-01-01 01:00:00.000000000 +0100
1973 +++ linux-2.6.15-openwrt/arch/mips/pci/pci-aruba.c 2006-01-10 00:32:32.000000000 +0100
1975 +/**************************************************************************
1977 + * BRIEF MODULE DESCRIPTION
1978 + * PCI initialization for IDT EB434 board
1980 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1982 + * This program is free software; you can redistribute it and/or modify it
1983 + * under the terms of the GNU General Public License as published by the
1984 + * Free Software Foundation; either version 2 of the License, or (at your
1985 + * option) any later version.
1987 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1988 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1989 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1990 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1991 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1992 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1993 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1994 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1995 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1996 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1998 + * You should have received a copy of the GNU General Public License along
1999 + * with this program; if not, write to the Free Software Foundation, Inc.,
2000 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2003 + **************************************************************************
2004 + * May 2004 rkt, neb
2010 + **************************************************************************
2013 +#include <linux/config.h>
2014 +#include <linux/types.h>
2015 +#include <linux/pci.h>
2016 +#include <linux/kernel.h>
2017 +#include <linux/init.h>
2018 +#include <asm/idt-boards/rc32434/rc32434.h>
2019 +#include <asm/idt-boards/rc32434/rc32434_pci.h>
2021 +#define PCI_ACCESS_READ 0
2022 +#define PCI_ACCESS_WRITE 1
2026 +#define DBG(x...) printk(x)
2030 +/* define an unsigned array for the PCI registers */
2031 +unsigned int korinaCnfgRegs[25] = {
2032 + KORINA_CNFG1, KORINA_CNFG2, KORINA_CNFG3, KORINA_CNFG4,
2033 + KORINA_CNFG5, KORINA_CNFG6, KORINA_CNFG7, KORINA_CNFG8,
2034 + KORINA_CNFG9, KORINA_CNFG10, KORINA_CNFG11, KORINA_CNFG12,
2035 + KORINA_CNFG13, KORINA_CNFG14, KORINA_CNFG15, KORINA_CNFG16,
2036 + KORINA_CNFG17, KORINA_CNFG18, KORINA_CNFG19, KORINA_CNFG20,
2037 + KORINA_CNFG21, KORINA_CNFG22, KORINA_CNFG23, KORINA_CNFG24
2040 +static struct resource rc32434_res_pci_mem2;
2042 +static struct resource rc32434_res_pci_mem1 = {
2043 + .name = "PCI MEM1",
2044 + .start = 0x50000000,
2045 + .end = 0x5FFFFFFF,
2046 + .flags = IORESOURCE_MEM,
2047 + .child = &rc32434_res_pci_mem2,
2049 +static struct resource rc32434_res_pci_mem2 = {
2050 + .name = "PCI MEM2",
2051 + .start = 0x60000000,
2052 + .end = 0x6FFFFFFF,
2053 + .flags = IORESOURCE_MEM,
2054 + .parent = &rc32434_res_pci_mem1,
2056 +static struct resource rc32434_res_pci_io1 = {
2057 + .name = "PCI I/O1",
2058 + .start = 0x18800000,
2059 + .end = 0x188FFFFF,
2060 + .flags = IORESOURCE_IO,
2063 +extern struct pci_ops rc32434_pci_ops;
2065 +struct pci_controller rc32434_controller = {
2066 + .pci_ops = &rc32434_pci_ops,
2067 + .mem_resource = &rc32434_res_pci_mem1,
2068 + .io_resource = &rc32434_res_pci_io1,
2069 + .mem_offset = 0x00000000UL,
2070 + .io_offset = 0x00000000UL,
2073 +extern unsigned int arch_has_pci;
2075 +static int __init rc32434_pcibridge_init(void)
2078 + unsigned int pciConfigAddr = 0;/*used for writing pci config values */
2079 + int loopCount=0 ;/*used for the loop */
2081 + unsigned int pcicValue, pcicData=0;
2082 + unsigned int dummyRead, pciCntlVal = 0;
2084 + if (!arch_has_pci) return 0;
2086 + printk("PCI: Initializing PCI\n");
2088 + /* Disable the IP bus error for PCI scaning */
2089 + pciCntlVal=rc32434_pci->pcic;
2090 + pciCntlVal &= 0xFFFFFF7;
2091 + rc32434_pci->pcic = pciCntlVal;
2093 + ioport_resource.start = rc32434_res_pci_io1.start;
2094 + ioport_resource.end = rc32434_res_pci_io1.end;
2096 + iomem_resource.start = rc32434_res_pci_mem1.start;
2097 + iomem_resource.end = rc32434_res_pci_mem1.end;
2100 + pcicValue = rc32434_pci->pcic;
2101 + pcicValue = (pcicValue >> PCIM_SHFT) & PCIM_BIT_LEN;
2102 + if (!((pcicValue == PCIM_H_EA) ||
2103 + (pcicValue == PCIM_H_IA_FIX) ||
2104 + (pcicValue == PCIM_H_IA_RR))) {
2105 + /* Not in Host Mode, return ERROR */
2109 + /* Enables the Idle Grant mode, Arbiter Parking */
2110 + pcicData |=(PCIC_igm_m|PCIC_eap_m|PCIC_en_m);
2111 + rc32434_pci->pcic = pcicData; /* Enable the PCI bus Interface */
2112 + /* Zero out the PCI status & PCI Status Mask */
2114 + pcicData = rc32434_pci->pcis;
2115 + if (!(pcicData & PCIS_rip_m))
2119 + rc32434_pci->pcis = 0;
2120 + rc32434_pci->pcism = 0xFFFFFFFF;
2121 + /* Zero out the PCI decoupled registers */
2122 + rc32434_pci->pcidac=0; /* disable PCI decoupled accesses at initialization */
2123 + rc32434_pci->pcidas=0; /* clear the status */
2124 + rc32434_pci->pcidasm=0x0000007F; /* Mask all the interrupts */
2125 + /* Mask PCI Messaging Interrupts */
2126 + rc32434_pci_msg->pciiic = 0;
2127 + rc32434_pci_msg->pciiim = 0xFFFFFFFF;
2128 + rc32434_pci_msg->pciioic = 0;
2129 + rc32434_pci_msg->pciioim = 0;
2131 + /* Setup PCILB0 as Memory Window */
2132 + rc32434_pci->pcilba[0].a = (unsigned int) (PCI_ADDR_START);
2134 + /* setup the PCI map address as same as the local address */
2136 + rc32434_pci->pcilba[0].m = (unsigned int) (PCI_ADDR_START);
2138 + /* Setup PCILBA1 as MEM */
2140 + rc32434_pci->pcilba[0].c = ( ((SIZE_16MB & 0x1f) << PCILBAC_size_b) | PCILBAC_sb_m);
2142 + rc32434_pci->pcilba[0].c = ( ((SIZE_16MB & 0x1f) << PCILBAC_size_b));
2144 + dummyRead = rc32434_pci->pcilba[0].c; /* flush the CPU write Buffers */
2146 + rc32434_pci->pcilba[1].a = 0x60000000;
2148 + rc32434_pci->pcilba[1].m = 0x60000000;
2149 + /* setup PCILBA2 as IO Window*/
2151 + rc32434_pci->pcilba[1].c = ( ((SIZE_256MB & 0x1f) << PCILBAC_size_b) | PCILBAC_sb_m);
2153 + rc32434_pci->pcilba[1].c = ((SIZE_256MB & 0x1f) << PCILBAC_size_b);
2155 + dummyRead = rc32434_pci->pcilba[1].c; /* flush the CPU write Buffers */
2156 + rc32434_pci->pcilba[2].a = 0x18C00000;
2158 + rc32434_pci->pcilba[2].m = 0x18FFFFFF;
2159 + /* setup PCILBA2 as IO Window*/
2161 + rc32434_pci->pcilba[2].c = ( ((SIZE_4MB & 0x1f) << PCILBAC_size_b) | PCILBAC_sb_m);
2163 + rc32434_pci->pcilba[2].c = ((SIZE_4MB & 0x1f) << PCILBAC_size_b);
2166 + dummyRead = rc32434_pci->pcilba[2].c; /* flush the CPU write Buffers */
2169 + rc32434_pci->pcilba[3].a = 0x18800000;
2171 + rc32434_pci->pcilba[3].m = 0x18800000;
2172 + /* Setup PCILBA3 as IO Window */
2175 + rc32434_pci->pcilba[3].c = ( (((SIZE_1MB & 0x1ff) << PCILBAC_size_b) | PCILBAC_msi_m) | PCILBAC_sb_m);
2177 + rc32434_pci->pcilba[3].c = (((SIZE_1MB & 0x1ff) << PCILBAC_size_b) | PCILBAC_msi_m);
2179 + dummyRead = rc32434_pci->pcilba[2].c; /* flush the CPU write Buffers */
2181 + pciConfigAddr = (unsigned int)(0x80000004);
2182 + for(loopCount = 0; loopCount < 24; loopCount++){
2183 + rc32434_pci->pcicfga = pciConfigAddr;
2184 + dummyRead = rc32434_pci->pcicfga;
2185 + rc32434_pci->pcicfgd = korinaCnfgRegs[loopCount];
2186 + dummyRead=rc32434_pci->pcicfgd;
2187 + pciConfigAddr += 4;
2189 + rc32434_pci->pcitc=(unsigned int)((PCITC_RTIMER_VAL&0xff) << PCITC_rtimer_b) |
2190 + ((PCITC_DTIMER_VAL&0xff)<<PCITC_dtimer_b);
2192 + pciCntlVal = rc32434_pci->pcic;
2193 + pciCntlVal &= ~(PCIC_tnr_m);
2194 + rc32434_pci->pcic = pciCntlVal;
2195 + pciCntlVal = rc32434_pci->pcic;
2197 + register_pci_controller(&rc32434_controller);
2203 +arch_initcall(rc32434_pcibridge_init);
2205 +/* Do platform specific device initialization at pci_enable_device() time */
2206 +int pcibios_plat_dev_init(struct pci_dev *dev)
2210 diff -Nur linux-2.6.15/drivers/mtd/chips/cfi_probe.c linux-2.6.15-openwrt/drivers/mtd/chips/cfi_probe.c
2211 --- linux-2.6.15/drivers/mtd/chips/cfi_probe.c 2006-01-03 04:21:10.000000000 +0100
2212 +++ linux-2.6.15-openwrt/drivers/mtd/chips/cfi_probe.c 2006-01-10 00:32:32.000000000 +0100
2214 static void print_cfi_ident(struct cfi_ident *);
2219 +#define AMD_AUTOSEL_OFF1 0xAAA
2220 +#define AMD_AUTOSEL_OFF2 0x555
2221 +#define AMD_MANUF_ID 0x1
2222 +#define AMD_DEVICE_ID1 0xF6 /* T */
2223 +#define AMD_DEVICE_ID2 0xF9 /* B */
2224 +/* Foll. are definitions for Macronix Flash Part */
2225 +#define MCX_MANUF_ID 0xC2
2226 +#define MCX_DEVICE_ID1 0xA7
2227 +#define MCX_DEVICE_ID2 0xA8
2228 +/* Foll. common to both AMD and Macronix */
2229 +#define FACTORY_LOCKED 0x99
2230 +#define USER_LOCKED 0x19
2232 +/* NOTE: AP-70/6x use BYTE mode flash access. Therefore the
2233 + * lowest Addr. pin in the flash is not A0 but A-1 (A minus 1).
2234 + * CPU's A0 is tied to Flash's A-1, A1 to A0 and so on. This
2235 + * gives 4MB of byte-addressable mem. In byte mode, all addr
2236 + * need to be multiplied by 2 (i.e compared to word mode).
2237 + * NOTE: AMD_AUTOSEL_OFF1 and OFF2 are already mult. by 2
2238 + * Just blindly use the addr offsets suggested in the manual
2239 + * for byte mode and you'll be OK. Offs. in Table 6 need to
2240 + * be mult by 2 (for getting autosel params)
2243 +flash_detect(struct map_info *map, __u32 base, struct cfi_private *cfi)
2246 + int osf = cfi->interleave * cfi->device_type; // =2 for AP70/6x
2247 + char *manuf, *part, *lock ;
2249 + if (osf != 1) return ;
2251 + cfi_send_gen_cmd(0xAA, AMD_AUTOSEL_OFF1, base, map, cfi, cfi->device_type, NULL);
2252 + cfi_send_gen_cmd(0x55, AMD_AUTOSEL_OFF2, base, map, cfi, cfi->device_type, NULL);
2253 + cfi_send_gen_cmd(0x90, AMD_AUTOSEL_OFF1, base, map, cfi, cfi->device_type, NULL);
2254 + val[0] = map_read(map, base) ; // manuf ID
2255 + val[1] = map_read(map, base+2) ; // device ID
2256 + val[2] = map_read(map, base+6) ; // lock indicator
2258 +printk("v1=0x%x v2=0x%x v3=0x%x\n", val[0], val[1], val[2]) ;
2260 + if (val[0].x[0] == AMD_MANUF_ID) {
2261 + manuf = "AMD Flash" ;
2262 + if (val[1].x[0] == AMD_DEVICE_ID1)
2263 + part = "AM29LV320D (Top)" ;
2264 + else if (val[1].x[0] == AMD_DEVICE_ID2)
2265 + part = "AM29LV320D (Bot)" ;
2266 + else part = "Unknown" ;
2267 + } else if (val[0].x[0] == MCX_MANUF_ID) {
2268 + manuf = "Macronix Flash" ;
2269 + if (val[1].x[0] == MCX_DEVICE_ID1)
2270 + part = "MX29LV320A (Top)" ;
2271 + else if (val[1].x[0] == MCX_DEVICE_ID2)
2272 + part = "MX29LV320A (Bot)" ;
2273 + else part = "Unknown" ;
2276 + if (val[2].x[0] == FACTORY_LOCKED)
2277 + lock = "Factory Locked" ;
2278 + else if (val[2].x[0] == USER_LOCKED)
2279 + lock = "User Locked" ;
2280 + else lock = "Unknown locking" ;
2281 + printk("%s %s (%s)\n", manuf, part, lock) ;
2285 static int cfi_probe_chip(struct map_info *map, __u32 base,
2286 unsigned long *chip_map, struct cfi_private *cfi);
2287 static int cfi_chip_setup(struct map_info *map, struct cfi_private *cfi);
2288 @@ -118,6 +186,10 @@
2293 + //cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
2294 + flash_detect(map, base, cfi) ;
2296 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
2297 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
2298 cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
2299 diff -Nur linux-2.6.15/drivers/mtd/maps/physmap.c linux-2.6.15-openwrt/drivers/mtd/maps/physmap.c
2300 --- linux-2.6.15/drivers/mtd/maps/physmap.c 2006-01-03 04:21:10.000000000 +0100
2301 +++ linux-2.6.15-openwrt/drivers/mtd/maps/physmap.c 2006-01-10 00:32:32.000000000 +0100
2303 static struct mtd_partition *mtd_parts;
2304 static int mtd_parts_nb;
2306 -static int num_physmap_partitions;
2307 -static struct mtd_partition *physmap_partitions;
2308 +static int num_physmap_partitions = 3;
2309 +static struct mtd_partition physmap_partitions[] = {
2312 + size: 0x3f0000-0x80000,
2317 + size: 0x3f0000-0x120000,
2327 static const char *part_probes[] __initdata = {"cmdlinepart", "RedBoot", NULL};
2329 void physmap_set_partitions(struct mtd_partition *parts, int num_parts)
2331 - physmap_partitions=parts;
2332 - num_physmap_partitions=num_parts;
2333 +// physmap_partitions=parts;
2334 +// num_physmap_partitions=num_parts;
2336 #endif /* CONFIG_MTD_PARTITIONS */
2338 diff -Nur linux-2.6.15/drivers/net/Kconfig linux-2.6.15-openwrt/drivers/net/Kconfig
2339 --- linux-2.6.15/drivers/net/Kconfig 2006-01-03 04:21:10.000000000 +0100
2340 +++ linux-2.6.15-openwrt/drivers/net/Kconfig 2006-01-10 00:32:32.000000000 +0100
2341 @@ -176,6 +176,13 @@
2343 source "drivers/net/arm/Kconfig"
2345 +config IDT_RC32434_ETH
2346 + tristate "IDT RC32434 Local Ethernet support"
2347 + depends on NET_ETHERNET
2349 + IDT RC32434 has one local ethernet port. Say Y here to enable it.
2350 + To compile this driver as a module, choose M here.
2353 tristate "MACE (Power Mac ethernet) support"
2354 depends on NET_ETHERNET && PPC_PMAC && PPC32
2355 diff -Nur linux-2.6.15/drivers/net/Makefile linux-2.6.15-openwrt/drivers/net/Makefile
2356 --- linux-2.6.15/drivers/net/Makefile 2006-01-03 04:21:10.000000000 +0100
2357 +++ linux-2.6.15-openwrt/drivers/net/Makefile 2006-01-10 00:32:33.000000000 +0100
2359 obj-$(CONFIG_SMC91X) += smc91x.o
2360 obj-$(CONFIG_DM9000) += dm9000.o
2361 obj-$(CONFIG_FEC_8XX) += fec_8xx/
2362 +obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
2364 obj-$(CONFIG_ARM) += arm/
2365 obj-$(CONFIG_DEV_APPLETALK) += appletalk/
2366 diff -Nur linux-2.6.15/drivers/net/rc32434_eth.c linux-2.6.15-openwrt/drivers/net/rc32434_eth.c
2367 --- linux-2.6.15/drivers/net/rc32434_eth.c 1970-01-01 01:00:00.000000000 +0100
2368 +++ linux-2.6.15-openwrt/drivers/net/rc32434_eth.c 2006-01-10 00:32:33.000000000 +0100
2370 +/**************************************************************************
2372 + * BRIEF MODULE DESCRIPTION
2373 + * Driver for the IDT RC32434 on-chip ethernet controller.
2375 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2377 + * This program is free software; you can redistribute it and/or modify it
2378 + * under the terms of the GNU General Public License as published by the
2379 + * Free Software Foundation; either version 2 of the License, or (at your
2380 + * option) any later version.
2382 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2383 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2384 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2385 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2386 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2387 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2388 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2389 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2390 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2391 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2393 + * You should have received a copy of the GNU General Public License along
2394 + * with this program; if not, write to the Free Software Foundation, Inc.,
2395 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2398 + **************************************************************************
2399 + * May 2004 rkt, neb
2401 + * Based on the driver developed by B. Maruthanayakam, H. Kou and others.
2407 + **************************************************************************
2410 +#include <linux/config.h>
2411 +#include <linux/module.h>
2412 +#include <linux/kernel.h>
2413 +#include <linux/moduleparam.h>
2414 +#include <linux/sched.h>
2415 +#include <linux/ctype.h>
2416 +#include <linux/types.h>
2417 +#include <linux/fcntl.h>
2418 +#include <linux/interrupt.h>
2419 +#include <linux/ptrace.h>
2420 +#include <linux/init.h>
2421 +#include <linux/ioport.h>
2422 +#include <linux/proc_fs.h>
2423 +#include <linux/in.h>
2424 +#include <linux/slab.h>
2425 +#include <linux/string.h>
2426 +#include <linux/delay.h>
2427 +#include <linux/netdevice.h>
2428 +#include <linux/etherdevice.h>
2429 +#include <linux/skbuff.h>
2430 +#include <linux/errno.h>
2431 +#include <asm/bootinfo.h>
2432 +#include <asm/system.h>
2433 +#include <asm/bitops.h>
2434 +#include <asm/pgtable.h>
2435 +#include <asm/segment.h>
2436 +#include <asm/io.h>
2437 +#include <asm/dma.h>
2439 +#include "rc32434_eth.h"
2441 +#define DRIVER_VERSION "(mar2904)"
2443 +#define DRIVER_NAME "rc32434 Ethernet driver. " DRIVER_VERSION
2446 +#define STATION_ADDRESS_HIGH(dev) (((dev)->dev_addr[0] << 8) | \
2447 + ((dev)->dev_addr[1]))
2448 +#define STATION_ADDRESS_LOW(dev) (((dev)->dev_addr[2] << 24) | \
2449 + ((dev)->dev_addr[3] << 16) | \
2450 + ((dev)->dev_addr[4] << 8) | \
2451 + ((dev)->dev_addr[5]))
2453 +#define MII_CLOCK 1250000 /* no more than 2.5MHz */
2454 +static char mac0[18] = "08:00:06:05:40:01";
2456 +MODULE_PARM(mac0, "c18");
2457 +MODULE_PARM_DESC(mac0, "MAC address for RC32434 ethernet0");
2459 +static struct rc32434_if_t {
2461 + struct net_device *dev;
2471 +} rc32434_iflist[] =
2474 + "rc32434_eth0", NULL, mac0,
2476 + ETH0_PhysicalAddress,
2487 +static int parse_mac_addr(struct net_device *dev, char* macstr)
2490 + unsigned char result, value;
2492 + for (i=0; i<6; i++) {
2494 + if (i != 5 && *(macstr+2) != ':') {
2495 + ERR("invalid mac address format: %d %c\n",
2499 + for (j=0; j<2; j++) {
2500 + if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
2501 + toupper(*macstr)-'A'+10) < 16) {
2502 + result = result*16 + value;
2506 + ERR("invalid mac address "
2507 + "character: %c\n", *macstr);
2513 + dev->dev_addr[i] = result;
2521 +static inline void rc32434_abort_tx(struct net_device *dev)
2523 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2524 + rc32434_abort_dma(dev, lp->tx_dma_regs);
2528 +static inline void rc32434_abort_rx(struct net_device *dev)
2530 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2531 + rc32434_abort_dma(dev, lp->rx_dma_regs);
2535 +static inline void rc32434_start_tx(struct rc32434_local *lp, volatile DMAD_t td)
2537 + rc32434_start_dma(lp->tx_dma_regs, CPHYSADDR(td));
2540 +static inline void rc32434_start_rx(struct rc32434_local *lp, volatile DMAD_t rd)
2542 + rc32434_start_dma(lp->rx_dma_regs, CPHYSADDR(rd));
2545 +static inline void rc32434_chain_tx(struct rc32434_local *lp, volatile DMAD_t td)
2547 + rc32434_chain_dma(lp->tx_dma_regs, CPHYSADDR(td));
2550 +static inline void rc32434_chain_rx(struct rc32434_local *lp, volatile DMAD_t rd)
2552 + rc32434_chain_dma(lp->rx_dma_regs, CPHYSADDR(rd));
2555 +#ifdef RC32434_PROC_DEBUG
2556 +static int rc32434_read_proc(char *buf, char **start, off_t fpos,
2557 + int length, int *eof, void *data)
2559 + struct net_device *dev = (struct net_device *)data;
2560 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2563 + /* print out header */
2564 + len += sprintf(buf + len, "\n\tRC32434 Ethernet Debug\n\n");
2565 + len += sprintf (buf + len,
2566 + "DMA halt count = %10d, DMA run count = %10d\n",
2567 + lp->dma_halt_cnt, lp->dma_run_cnt);
2569 + if (fpos >= len) {
2574 + *start = buf + fpos;
2576 + if ((len -= fpos) > length)
2587 + * Restart the RC32434 ethernet controller.
2589 +static int rc32434_restart(struct net_device *dev)
2591 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2594 + * Disable interrupts
2596 + disable_irq(lp->rx_irq);
2597 + disable_irq(lp->tx_irq);
2598 +#ifdef RC32434_REVISION
2599 + disable_irq(lp->ovr_irq);
2601 + disable_irq(lp->und_irq);
2603 + /* Mask F E bit in Tx DMA */
2604 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) | DMASM_f_m | DMASM_e_m, &lp->tx_dma_regs->dmasm);
2605 + /* Mask D H E bit in Rx DMA */
2606 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) | DMASM_d_m | DMASM_h_m | DMASM_e_m, &lp->rx_dma_regs->dmasm);
2608 + rc32434_init(dev);
2609 + rc32434_multicast_list(dev);
2611 + enable_irq(lp->und_irq);
2612 +#ifdef RC32434_REVISION
2613 + enable_irq(lp->ovr_irq);
2615 + enable_irq(lp->tx_irq);
2616 + enable_irq(lp->rx_irq);
2621 +int rc32434_init_module(void)
2623 +#ifdef CONFIG_MACH_ARUBA
2624 + if (mips_machtype != MACH_ARUBA_AP70)
2628 + printk(KERN_INFO DRIVER_NAME " \n");
2629 + return rc32434_probe(0);
2632 +static int rc32434_probe(int port_num)
2634 + struct rc32434_if_t *bif = &rc32434_iflist[port_num];
2635 + struct rc32434_local *lp = NULL;
2636 + struct net_device *dev = NULL;
2637 + int i, retval,err;
2639 + dev = alloc_etherdev(sizeof(struct rc32434_local));
2641 + ERR("rc32434_eth: alloc_etherdev failed\n");
2645 + SET_MODULE_OWNER(dev);
2648 +#ifdef CONFIG_MACH_ARUBA
2650 + extern char * getenv(char *e);
2651 + memcpy(bif->mac_str, getenv("ethaddr"), 17);
2655 + printk("mac: %s\n", bif->mac_str);
2656 + if ((retval = parse_mac_addr(dev, bif->mac_str))) {
2657 + ERR("MAC address parse failed\n");
2663 + /* Initialize the device structure. */
2664 + if (dev->priv == NULL) {
2665 + lp = (struct rc32434_local *)kmalloc(sizeof(*lp), GFP_KERNEL);
2666 + memset(lp, 0, sizeof(struct rc32434_local));
2669 + lp = (struct rc32434_local *)dev->priv;
2672 + lp->rx_irq = bif->rx_dma_irq;
2673 + lp->tx_irq = bif->tx_dma_irq;
2674 + lp->ovr_irq = bif->rx_ovr_irq;
2675 + lp->und_irq = bif->tx_und_irq;
2677 + lp->eth_regs = ioremap_nocache(bif->iobase, sizeof(*lp->eth_regs));
2679 + if (!lp->eth_regs) {
2680 + ERR("Can't remap eth registers\n");
2682 + goto probe_err_out;
2685 + lp->rx_dma_regs = ioremap_nocache(bif->rxdmabase, sizeof(struct DMA_Chan_s));
2687 + if (!lp->rx_dma_regs) {
2688 + ERR("Can't remap Rx DMA registers\n");
2690 + goto probe_err_out;
2692 + lp->tx_dma_regs = ioremap_nocache(bif->txdmabase,sizeof(struct DMA_Chan_s));
2694 + if (!lp->tx_dma_regs) {
2695 + ERR("Can't remap Tx DMA registers\n");
2697 + goto probe_err_out;
2700 +#ifdef RC32434_PROC_DEBUG
2701 + lp->ps = create_proc_read_entry (bif->name, 0, proc_net,
2702 + rc32434_read_proc, dev);
2705 + lp->td_ring = (DMAD_t)kmalloc(TD_RING_SIZE + RD_RING_SIZE, GFP_KERNEL);
2706 + if (!lp->td_ring) {
2707 + ERR("Can't allocate descriptors\n");
2709 + goto probe_err_out;
2712 + dma_cache_inv((unsigned long)(lp->td_ring), TD_RING_SIZE + RD_RING_SIZE);
2714 + /* now convert TD_RING pointer to KSEG1 */
2715 + lp->td_ring = (DMAD_t )KSEG1ADDR(lp->td_ring);
2716 + lp->rd_ring = &lp->td_ring[RC32434_NUM_TDS];
2719 + spin_lock_init(&lp->lock);
2721 + dev->base_addr = bif->iobase;
2722 + /* just use the rx dma irq */
2723 + dev->irq = bif->rx_dma_irq;
2727 + dev->open = rc32434_open;
2728 + dev->stop = rc32434_close;
2729 + dev->hard_start_xmit = rc32434_send_packet;
2730 + dev->get_stats = rc32434_get_stats;
2731 + dev->set_multicast_list = &rc32434_multicast_list;
2732 + dev->tx_timeout = rc32434_tx_timeout;
2733 + dev->watchdog_timeo = RC32434_TX_TIMEOUT;
2735 +#ifdef CONFIG_IDT_USE_NAPI
2736 + dev->poll = rc32434_poll;
2737 + dev->weight = bif->weight;
2738 + printk("Using NAPI with weight %d\n",dev->weight);
2740 + lp->rx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
2741 + tasklet_init(lp->rx_tasklet, rc32434_rx_tasklet, (unsigned long)dev);
2743 + lp->tx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
2744 + tasklet_init(lp->tx_tasklet, rc32434_tx_tasklet, (unsigned long)dev);
2746 + if ((err = register_netdev(dev))) {
2747 + printk(KERN_ERR "rc32434 ethernet. Cannot register net device %d\n", err);
2750 + goto probe_err_out;
2753 + INFO("Rx IRQ %d, Tx IRQ %d, ", bif->rx_dma_irq, bif->tx_dma_irq);
2754 + for (i = 0; i < 6; i++) {
2755 + printk("%2.2x", dev->dev_addr[i]);
2764 + rc32434_cleanup_module();
2765 + ERR(" failed. Returns %d\n", retval);
2771 +static void rc32434_cleanup_module(void)
2775 + for (i = 0; rc32434_iflist[i].iobase; i++) {
2776 + struct rc32434_if_t * bif = &rc32434_iflist[i];
2777 + if (bif->dev != NULL) {
2778 + struct rc32434_local *lp = (struct rc32434_local *)bif->dev->priv;
2781 + iounmap((void*)lp->eth_regs);
2782 + if (lp->rx_dma_regs)
2783 + iounmap((void*)lp->rx_dma_regs);
2784 + if (lp->tx_dma_regs)
2785 + iounmap((void*)lp->tx_dma_regs);
2787 + kfree((void*)KSEG0ADDR(lp->td_ring));
2789 +#ifdef RC32434_PROC_DEBUG
2791 + remove_proc_entry(bif->name, proc_net);
2797 + unregister_netdev(bif->dev);
2798 + free_netdev(bif->dev);
2806 +static int rc32434_open(struct net_device *dev)
2808 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2811 + if (rc32434_init(dev)) {
2812 + ERR("Error: cannot open the Ethernet device\n");
2816 + /* Install the interrupt handler that handles the Done Finished Ovr and Und Events */
2817 + if (request_irq(lp->rx_irq, &rc32434_rx_dma_interrupt,
2818 + SA_SHIRQ | SA_INTERRUPT,
2819 + "rc32434 ethernet Rx", dev)) {
2820 + ERR(": unable to get Rx DMA IRQ %d\n",
2824 + if (request_irq(lp->tx_irq, &rc32434_tx_dma_interrupt,
2825 + SA_SHIRQ | SA_INTERRUPT,
2826 + "rc32434 ethernet Tx", dev)) {
2827 + ERR(": unable to get Tx DMA IRQ %d\n",
2829 + free_irq(lp->rx_irq, dev);
2833 +#ifdef RC32434_REVISION
2834 + /* Install handler for overrun error. */
2835 + if (request_irq(lp->ovr_irq, &rc32434_ovr_interrupt,
2836 + SA_SHIRQ | SA_INTERRUPT,
2837 + "Ethernet Overflow", dev)) {
2838 + ERR(": unable to get OVR IRQ %d\n",
2840 + free_irq(lp->rx_irq, dev);
2841 + free_irq(lp->tx_irq, dev);
2846 + /* Install handler for underflow error. */
2847 + if (request_irq(lp->und_irq, &rc32434_und_interrupt,
2848 + SA_SHIRQ | SA_INTERRUPT,
2849 + "Ethernet Underflow", dev)) {
2850 + ERR(": unable to get UND IRQ %d\n",
2852 + free_irq(lp->rx_irq, dev);
2853 + free_irq(lp->tx_irq, dev);
2854 +#ifdef RC32434_REVISION
2855 + free_irq(lp->ovr_irq, dev);
2867 +static int rc32434_close(struct net_device *dev)
2869 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2872 + /* Disable interrupts */
2873 + disable_irq(lp->rx_irq);
2874 + disable_irq(lp->tx_irq);
2875 +#ifdef RC32434_REVISION
2876 + disable_irq(lp->ovr_irq);
2878 + disable_irq(lp->und_irq);
2880 + tmp = rc32434_readl(&lp->tx_dma_regs->dmasm);
2881 + tmp = tmp | DMASM_f_m | DMASM_e_m;
2882 + rc32434_writel(tmp, &lp->tx_dma_regs->dmasm);
2884 + tmp = rc32434_readl(&lp->rx_dma_regs->dmasm);
2885 + tmp = tmp | DMASM_d_m | DMASM_h_m | DMASM_e_m;
2886 + rc32434_writel(tmp, &lp->rx_dma_regs->dmasm);
2888 + free_irq(lp->rx_irq, dev);
2889 + free_irq(lp->tx_irq, dev);
2890 +#ifdef RC32434_REVISION
2891 + free_irq(lp->ovr_irq, dev);
2893 + free_irq(lp->und_irq, dev);
2898 +/* transmit packet */
2899 +static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev)
2901 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2902 + unsigned long flags;
2907 + spin_lock_irqsave(&lp->lock, flags);
2909 + td = &lp->td_ring[lp->tx_chain_tail];
2911 + /* stop queue when full, drop pkts if queue already full */
2912 + if(lp->tx_count >= (RC32434_NUM_TDS - 2)) {
2915 + if(lp->tx_count == (RC32434_NUM_TDS - 2)) {
2916 + netif_stop_queue(dev);
2919 + lp->stats.tx_dropped++;
2920 + dev_kfree_skb_any(skb);
2921 + spin_unlock_irqrestore(&lp->lock, flags);
2928 + lp->tx_skb[lp->tx_chain_tail] = skb;
2930 + length = skb->len;
2932 + /* Setup the transmit descriptor. */
2933 + td->ca = CPHYSADDR(skb->data);
2935 + if(rc32434_readl(&(lp->tx_dma_regs->dmandptr)) == 0) {
2936 + if( lp->tx_chain_status == empty ) {
2937 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
2938 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
2939 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR */
2940 + lp->tx_chain_head = lp->tx_chain_tail; /* Move head to tail */
2943 + td->control = DMA_COUNT(length) |DMAD_cof_m|DMAD_iof_m; /* Update tail */
2944 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &= ~(DMAD_cof_m); /* Link to prev */
2945 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link = CPHYSADDR(td); /* Link to prev */
2946 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
2947 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR */
2948 + lp->tx_chain_head = lp->tx_chain_tail; /* Move head to tail */
2949 + lp->tx_chain_status = empty;
2953 + if( lp->tx_chain_status == empty ) {
2954 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
2955 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
2956 + lp->tx_chain_status = filled;
2959 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
2960 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &= ~(DMAD_cof_m); /* Link to prev */
2961 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link = CPHYSADDR(td); /* Link to prev */
2962 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
2966 + dev->trans_start = jiffies;
2968 + spin_unlock_irqrestore(&lp->lock, flags);
2974 +/* Ethernet MII-PHY Handler */
2975 +static void rc32434_mii_handler(unsigned long data)
2977 + struct net_device *dev = (struct net_device *)data;
2978 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2979 + unsigned long flags;
2980 + unsigned long duplex_status;
2981 + int port_addr = (lp->rx_irq == 0x2c? 1:0) << 8;
2983 + spin_lock_irqsave(&lp->lock, flags);
2985 + /* Two ports are using the same MII, the difference is the PHY address */
2986 + rc32434_writel(0, &rc32434_eth0_regs->miimcfg);
2987 + rc32434_writel(0, &rc32434_eth0_regs->miimcmd);
2988 + rc32434_writel(port_addr |0x05, &rc32434_eth0_regs->miimaddr);
2989 + rc32434_writel(MIIMCMD_scn_m, &rc32434_eth0_regs->miimcmd);
2990 + while(rc32434_readl(&rc32434_eth0_regs->miimind) & MIIMIND_nv_m);
2992 + ERR("irq:%x port_addr:%x RDD:%x\n",
2993 + lp->rx_irq, port_addr, rc32434_readl(&rc32434_eth0_regs->miimrdd));
2994 + duplex_status = (rc32434_readl(&rc32434_eth0_regs->miimrdd) & 0x140)? ETHMAC2_fd_m: 0;
2995 + if(duplex_status != lp->duplex_mode) {
2996 + ERR("The MII-PHY is Auto-negotiated to %s-Duplex mode for Eth-%x\n", duplex_status? "Full":"Half", lp->rx_irq == 0x2c? 1:0);
2997 + lp->duplex_mode = duplex_status;
2998 + rc32434_restart(dev);
3001 + lp->mii_phy_timer.expires = jiffies + 10 * HZ;
3002 + add_timer(&lp->mii_phy_timer);
3004 + spin_unlock_irqrestore(&lp->lock, flags);
3008 +#ifdef RC32434_REVISION
3009 +/* Ethernet Rx Overflow interrupt */
3011 +rc32434_ovr_interrupt(int irq, void *dev_id, struct pt_regs * regs)
3013 + struct net_device *dev = (struct net_device *)dev_id;
3014 + struct rc32434_local *lp;
3016 + irqreturn_t retval = IRQ_NONE;
3018 + ASSERT(dev != NULL);
3020 + lp = (struct rc32434_local *)dev->priv;
3021 + spin_lock(&lp->lock);
3022 + ovr = rc32434_readl(&lp->eth_regs->ethintfc);
3024 + if(ovr & ETHINTFC_ovr_m) {
3025 + netif_stop_queue(dev);
3027 + /* clear OVR bit */
3028 + rc32434_writel((ovr & ~ETHINTFC_ovr_m), &lp->eth_regs->ethintfc);
3030 + /* Restart interface */
3031 + rc32434_restart(dev);
3032 + retval = IRQ_HANDLED;
3034 + spin_unlock(&lp->lock);
3042 +/* Ethernet Tx Underflow interrupt */
3044 +rc32434_und_interrupt(int irq, void *dev_id, struct pt_regs * regs)
3046 + struct net_device *dev = (struct net_device *)dev_id;
3047 + struct rc32434_local *lp;
3049 + irqreturn_t retval = IRQ_NONE;
3051 + ASSERT(dev != NULL);
3053 + lp = (struct rc32434_local *)dev->priv;
3055 + spin_lock(&lp->lock);
3057 + und = rc32434_readl(&lp->eth_regs->ethintfc);
3059 + if(und & ETHINTFC_und_m) {
3060 + netif_stop_queue(dev);
3062 + rc32434_writel((und & ~ETHINTFC_und_m), &lp->eth_regs->ethintfc);
3064 + /* Restart interface */
3065 + rc32434_restart(dev);
3066 + retval = IRQ_HANDLED;
3069 + spin_unlock(&lp->lock);
3075 +/* Ethernet Rx DMA interrupt */
3077 +rc32434_rx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs)
3079 + struct net_device *dev = (struct net_device *)dev_id;
3080 + struct rc32434_local* lp;
3081 + volatile u32 dmas,dmasm;
3082 + irqreturn_t retval;
3084 + ASSERT(dev != NULL);
3086 + lp = (struct rc32434_local *)dev->priv;
3088 + spin_lock(&lp->lock);
3089 + dmas = rc32434_readl(&lp->rx_dma_regs->dmas);
3090 + if(dmas & (DMAS_d_m|DMAS_h_m|DMAS_e_m)) {
3091 + /* Mask D H E bit in Rx DMA */
3092 + dmasm = rc32434_readl(&lp->rx_dma_regs->dmasm);
3093 + rc32434_writel(dmasm | (DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm);
3094 +#ifdef CONFIG_IDT_USE_NAPI
3095 + if(netif_rx_schedule_prep(dev))
3096 + __netif_rx_schedule(dev);
3098 + tasklet_hi_schedule(lp->rx_tasklet);
3101 + if (dmas & DMAS_e_m)
3102 + ERR(": DMA error\n");
3104 + retval = IRQ_HANDLED;
3107 + retval = IRQ_NONE;
3109 + spin_unlock(&lp->lock);
3113 +#ifdef CONFIG_IDT_USE_NAPI
3114 +static int rc32434_poll(struct net_device *rx_data_dev, int *budget)
3116 +static void rc32434_rx_tasklet(unsigned long rx_data_dev)
3119 + struct net_device *dev = (struct net_device *)rx_data_dev;
3120 + struct rc32434_local* lp = netdev_priv(dev);
3121 + volatile DMAD_t rd = &lp->rd_ring[lp->rx_next_done];
3122 + struct sk_buff *skb, *skb_new;
3124 + u32 devcs, count, pkt_len, pktuncrc_len;
3125 + volatile u32 dmas;
3126 +#ifdef CONFIG_IDT_USE_NAPI
3128 + int rx_work_limit = min(*budget,dev->quota);
3130 + unsigned long flags;
3131 + spin_lock_irqsave(&lp->lock, flags);
3134 + while ( (count = RC32434_RBSIZE - (u32)DMA_COUNT(rd->control)) != 0) {
3135 +#ifdef CONFIG_IDT_USE_NAPI
3136 + if(--rx_work_limit <0)
3141 + /* init the var. used for the later operations within the while loop */
3143 + devcs = rd->devcs;
3144 + pkt_len = RCVPKT_LENGTH(devcs);
3145 + skb = lp->rx_skb[lp->rx_next_done];
3148 + lp->stats.rx_errors++;
3149 + lp->stats.rx_dropped++;
3151 + else if ((devcs & ( ETHRX_ld_m)) != ETHRX_ld_m) {
3152 + /* check that this is a whole packet */
3153 + /* WARNING: DMA_FD bit incorrectly set in Rc32434 (errata ref #077) */
3154 + lp->stats.rx_errors++;
3155 + lp->stats.rx_dropped++;
3157 + else if ( (devcs & ETHRX_rok_m) ) {
3160 + /* must be the (first and) last descriptor then */
3161 + pkt_buf = (u8*)lp->rx_skb[lp->rx_next_done]->data;
3163 + pktuncrc_len = pkt_len - 4;
3164 + /* invalidate the cache */
3165 + dma_cache_inv((unsigned long)pkt_buf, pktuncrc_len);
3167 + /* Malloc up new buffer. */
3168 + skb_new = dev_alloc_skb(RC32434_RBSIZE + 2);
3170 + if (skb_new != NULL){
3172 + skb_put(skb, pktuncrc_len);
3174 + skb->protocol = eth_type_trans(skb, dev);
3176 + /* pass the packet to upper layers */
3177 +#ifdef CONFIG_IDT_USE_NAPI
3178 + netif_receive_skb(skb);
3183 + dev->last_rx = jiffies;
3184 + lp->stats.rx_packets++;
3185 + lp->stats.rx_bytes += pktuncrc_len;
3187 + if (IS_RCV_MP(devcs))
3188 + lp->stats.multicast++;
3190 + /* 16 bit align */
3191 + skb_reserve(skb_new, 2);
3193 + skb_new->dev = dev;
3194 + lp->rx_skb[lp->rx_next_done] = skb_new;
3197 + ERR("no memory, dropping rx packet.\n");
3198 + lp->stats.rx_errors++;
3199 + lp->stats.rx_dropped++;
3205 + /* This should only happen if we enable accepting broken packets */
3206 + lp->stats.rx_errors++;
3207 + lp->stats.rx_dropped++;
3209 + /* add statistics counters */
3210 + if (IS_RCV_CRC_ERR(devcs)) {
3211 + DBG(2, "RX CRC error\n");
3212 + lp->stats.rx_crc_errors++;
3214 + else if (IS_RCV_LOR_ERR(devcs)) {
3215 + DBG(2, "RX LOR error\n");
3216 + lp->stats.rx_length_errors++;
3218 + else if (IS_RCV_LE_ERR(devcs)) {
3219 + DBG(2, "RX LE error\n");
3220 + lp->stats.rx_length_errors++;
3222 + else if (IS_RCV_OVR_ERR(devcs)) {
3223 + lp->stats.rx_over_errors++;
3225 + else if (IS_RCV_CV_ERR(devcs)) {
3226 + /* code violation */
3227 + DBG(2, "RX CV error\n");
3228 + lp->stats.rx_frame_errors++;
3230 + else if (IS_RCV_CES_ERR(devcs)) {
3231 + DBG(2, "RX Preamble error\n");
3237 + /* restore descriptor's curr_addr */
3239 + rd->ca = CPHYSADDR(skb_new->data);
3241 + rd->ca = CPHYSADDR(skb->data);
3243 + rd->control = DMA_COUNT(RC32434_RBSIZE) |DMAD_cod_m |DMAD_iod_m;
3244 + lp->rd_ring[(lp->rx_next_done-1)& RC32434_RDS_MASK].control &= ~(DMAD_cod_m);
3246 + lp->rx_next_done = (lp->rx_next_done + 1) & RC32434_RDS_MASK;
3247 + rd = &lp->rd_ring[lp->rx_next_done];
3248 + rc32434_writel( ~DMAS_d_m, &lp->rx_dma_regs->dmas);
3250 +#ifdef CONFIG_IDT_USE_NAPI
3251 + dev->quota -= received;
3252 + *budget =- received;
3253 + if(rx_work_limit < 0)
3257 + dmas = rc32434_readl(&lp->rx_dma_regs->dmas);
3259 + if(dmas & DMAS_h_m) {
3260 + rc32434_writel( ~(DMAS_h_m | DMAS_e_m), &lp->rx_dma_regs->dmas);
3261 +#ifdef RC32434_PROC_DEBUG
3262 + lp->dma_halt_cnt++;
3265 + skb = lp->rx_skb[lp->rx_next_done];
3266 + rd->ca = CPHYSADDR(skb->data);
3267 + rc32434_chain_rx(lp,rd);
3270 +#ifdef CONFIG_IDT_USE_NAPI
3271 + netif_rx_complete(dev);
3273 + /* Enable D H E bit in Rx DMA */
3274 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m |DMASM_e_m), &lp->rx_dma_regs->dmasm);
3275 +#ifdef CONFIG_IDT_USE_NAPI
3280 + spin_unlock_irqrestore(&lp->lock, flags);
3289 +/* Ethernet Tx DMA interrupt */
3291 +rc32434_tx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs)
3293 + struct net_device *dev = (struct net_device *)dev_id;
3294 + struct rc32434_local *lp;
3295 + volatile u32 dmas,dmasm;
3296 + irqreturn_t retval;
3298 + ASSERT(dev != NULL);
3300 + lp = (struct rc32434_local *)dev->priv;
3302 + spin_lock(&lp->lock);
3304 + dmas = rc32434_readl(&lp->tx_dma_regs->dmas);
3306 + if (dmas & (DMAS_f_m | DMAS_e_m)) {
3307 + dmasm = rc32434_readl(&lp->tx_dma_regs->dmasm);
3308 + /* Mask F E bit in Tx DMA */
3309 + rc32434_writel(dmasm | (DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
3311 + tasklet_hi_schedule(lp->tx_tasklet);
3313 + if(lp->tx_chain_status == filled && (rc32434_readl(&(lp->tx_dma_regs->dmandptr)) == 0)) {
3314 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr));
3315 + lp->tx_chain_status = empty;
3316 + lp->tx_chain_head = lp->tx_chain_tail;
3317 + dev->trans_start = jiffies;
3320 + if (dmas & DMAS_e_m)
3321 + ERR(": DMA error\n");
3323 + retval = IRQ_HANDLED;
3326 + retval = IRQ_NONE;
3328 + spin_unlock(&lp->lock);
3334 +static void rc32434_tx_tasklet(unsigned long tx_data_dev)
3336 + struct net_device *dev = (struct net_device *)tx_data_dev;
3337 + struct rc32434_local* lp = (struct rc32434_local *)dev->priv;
3338 + volatile DMAD_t td = &lp->td_ring[lp->tx_next_done];
3340 + unsigned long flags;
3341 + volatile u32 dmas;
3343 + spin_lock_irqsave(&lp->lock, flags);
3345 + /* process all desc that are done */
3346 + while(IS_DMA_FINISHED(td->control)) {
3347 + if(lp->tx_full == 1) {
3348 + netif_wake_queue(dev);
3352 + devcs = lp->td_ring[lp->tx_next_done].devcs;
3353 + if ((devcs & (ETHTX_fd_m | ETHTX_ld_m)) != (ETHTX_fd_m | ETHTX_ld_m)) {
3354 + lp->stats.tx_errors++;
3355 + lp->stats.tx_dropped++;
3357 + /* should never happen */
3358 + DBG(1, __FUNCTION__ ": split tx ignored\n");
3360 + else if (IS_TX_TOK(devcs)) {
3361 + lp->stats.tx_packets++;
3364 + lp->stats.tx_errors++;
3365 + lp->stats.tx_dropped++;
3368 + if (IS_TX_UND_ERR(devcs))
3369 + lp->stats.tx_fifo_errors++;
3371 + /* oversized frame */
3372 + if (IS_TX_OF_ERR(devcs))
3373 + lp->stats.tx_aborted_errors++;
3375 + /* excessive deferrals */
3376 + if (IS_TX_ED_ERR(devcs))
3377 + lp->stats.tx_carrier_errors++;
3379 + /* collisions: medium busy */
3380 + if (IS_TX_EC_ERR(devcs))
3381 + lp->stats.collisions++;
3383 + /* late collision */
3384 + if (IS_TX_LC_ERR(devcs))
3385 + lp->stats.tx_window_errors++;
3389 + /* We must always free the original skb */
3390 + if (lp->tx_skb[lp->tx_next_done] != NULL) {
3391 + dev_kfree_skb_any(lp->tx_skb[lp->tx_next_done]);
3392 + lp->tx_skb[lp->tx_next_done] = NULL;
3395 + lp->td_ring[lp->tx_next_done].control = DMAD_iof_m;
3396 + lp->td_ring[lp->tx_next_done].devcs = ETHTX_fd_m | ETHTX_ld_m;
3397 + lp->td_ring[lp->tx_next_done].link = 0;
3398 + lp->td_ring[lp->tx_next_done].ca = 0;
3401 + /* go on to next transmission */
3402 + lp->tx_next_done = (lp->tx_next_done + 1) & RC32434_TDS_MASK;
3403 + td = &lp->td_ring[lp->tx_next_done];
3407 + dmas = rc32434_readl(&lp->tx_dma_regs->dmas);
3408 + rc32434_writel( ~dmas, &lp->tx_dma_regs->dmas);
3410 + /* Enable F E bit in Tx DMA */
3411 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
3412 + spin_unlock_irqrestore(&lp->lock, flags);
3417 +static struct net_device_stats * rc32434_get_stats(struct net_device *dev)
3419 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
3420 + return &lp->stats;
3425 + * Set or clear the multicast filter for this adaptor.
3427 +static void rc32434_multicast_list(struct net_device *dev)
3429 + /* listen to broadcasts always and to treat */
3430 + /* IFF bits independantly */
3431 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
3432 + unsigned long flags;
3433 + u32 recognise = ETHARC_ab_m; /* always accept broadcasts */
3435 + if (dev->flags & IFF_PROMISC) /* set promiscuous mode */
3436 + recognise |= ETHARC_pro_m;
3438 + if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 15))
3439 + recognise |= ETHARC_am_m; /* all multicast & bcast */
3440 + else if (dev->mc_count > 0) {
3441 + DBG(2, __FUNCTION__ ": mc_count %d\n", dev->mc_count);
3442 + recognise |= ETHARC_am_m; /* for the time being */
3445 + spin_lock_irqsave(&lp->lock, flags);
3446 + rc32434_writel(recognise, &lp->eth_regs->etharc);
3447 + spin_unlock_irqrestore(&lp->lock, flags);
3451 +static void rc32434_tx_timeout(struct net_device *dev)
3453 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
3454 + unsigned long flags;
3456 + spin_lock_irqsave(&lp->lock, flags);
3457 + rc32434_restart(dev);
3458 + spin_unlock_irqrestore(&lp->lock, flags);
3464 + * Initialize the RC32434 ethernet controller.
3466 +static int rc32434_init(struct net_device *dev)
3468 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
3472 + rc32434_abort_tx(dev);
3473 + rc32434_abort_rx(dev);
3475 + /* reset ethernet logic */
3476 + rc32434_writel(0, &lp->eth_regs->ethintfc);
3477 + while((rc32434_readl(&lp->eth_regs->ethintfc) & ETHINTFC_rip_m))
3478 + dev->trans_start = jiffies;
3480 + /* Enable Ethernet Interface */
3481 + rc32434_writel(ETHINTFC_en_m, &lp->eth_regs->ethintfc);
3483 +#ifndef CONFIG_IDT_USE_NAPI
3484 + tasklet_disable(lp->rx_tasklet);
3486 + tasklet_disable(lp->tx_tasklet);
3488 + /* Initialize the transmit Descriptors */
3489 + for (i = 0; i < RC32434_NUM_TDS; i++) {
3490 + lp->td_ring[i].control = DMAD_iof_m;
3491 + lp->td_ring[i].devcs = ETHTX_fd_m | ETHTX_ld_m;
3492 + lp->td_ring[i].ca = 0;
3493 + lp->td_ring[i].link = 0;
3494 + if (lp->tx_skb[i] != NULL) {
3495 + dev_kfree_skb_any(lp->tx_skb[i]);
3496 + lp->tx_skb[i] = NULL;
3499 + lp->tx_next_done = lp->tx_chain_head = lp->tx_chain_tail = lp->tx_full = lp->tx_count = 0;
3500 + lp-> tx_chain_status = empty;
3503 + * Initialize the receive descriptors so that they
3504 + * become a circular linked list, ie. let the last
3505 + * descriptor point to the first again.
3507 + for (i=0; i<RC32434_NUM_RDS; i++) {
3508 + struct sk_buff *skb = lp->rx_skb[i];
3510 + if (lp->rx_skb[i] == NULL) {
3511 + skb = dev_alloc_skb(RC32434_RBSIZE + 2);
3512 + if (skb == NULL) {
3513 + ERR("No memory in the system\n");
3514 + for (j = 0; j < RC32434_NUM_RDS; j ++)
3515 + if (lp->rx_skb[j] != NULL)
3516 + dev_kfree_skb_any(lp->rx_skb[j]);
3522 + skb_reserve(skb, 2);
3523 + lp->rx_skb[i] = skb;
3524 + lp->rd_ring[i].ca = CPHYSADDR(skb->data);
3528 + lp->rd_ring[i].control = DMAD_iod_m | DMA_COUNT(RC32434_RBSIZE);
3529 + lp->rd_ring[i].devcs = 0;
3530 + lp->rd_ring[i].ca = CPHYSADDR(skb->data);
3531 + lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]);
3535 + lp->rd_ring[RC32434_NUM_RDS-1].link = CPHYSADDR(&lp->rd_ring[0]);
3536 + lp->rx_next_done = 0;
3538 + lp->rd_ring[RC32434_NUM_RDS-1].control |= DMAD_cod_m;
3539 + lp->rx_chain_head = 0;
3540 + lp->rx_chain_tail = 0;
3541 + lp->rx_chain_status = empty;
3543 + rc32434_writel(0, &lp->rx_dma_regs->dmas);
3544 + /* Start Rx DMA */
3545 + rc32434_start_rx(lp, &lp->rd_ring[0]);
3547 + /* Enable F E bit in Tx DMA */
3548 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
3549 + /* Enable D H E bit in Rx DMA */
3550 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm);
3552 + /* Accept only packets destined for this Ethernet device address */
3553 + rc32434_writel(ETHARC_ab_m, &lp->eth_regs->etharc);
3555 + /* Set all Ether station address registers to their initial values */
3556 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal0);
3557 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah0);
3559 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal1);
3560 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah1);
3562 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal2);
3563 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah2);
3565 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal3);
3566 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah3);
3569 + /* Frame Length Checking, Pad Enable, CRC Enable, Full Duplex set */
3570 + rc32434_writel(ETHMAC2_pe_m | ETHMAC2_cen_m | ETHMAC2_fd_m, &lp->eth_regs->ethmac2);
3571 + //ETHMAC2_flc_m ETHMAC2_fd_m lp->duplex_mode
3573 + /* Back to back inter-packet-gap */
3574 + rc32434_writel(0x15, &lp->eth_regs->ethipgt);
3575 + /* Non - Back to back inter-packet-gap */
3576 + rc32434_writel(0x12, &lp->eth_regs->ethipgr);
3578 + /* Management Clock Prescaler Divisor */
3579 + /* Clock independent setting */
3580 + rc32434_writel(((idt_cpu_freq)/MII_CLOCK+1) & ~1,
3581 + &lp->eth_regs->ethmcp);
3583 + /* don't transmit until fifo contains 48b */
3584 + rc32434_writel(48, &lp->eth_regs->ethfifott);
3586 + rc32434_writel(ETHMAC1_re_m, &lp->eth_regs->ethmac1);
3588 +#ifndef CONFIG_IDT_USE_NAPI
3589 + tasklet_enable(lp->rx_tasklet);
3591 + tasklet_enable(lp->tx_tasklet);
3593 + netif_start_queue(dev);
3603 +static int __init rc32434_setup(char *options)
3605 + /* no options yet */
3609 +static int __init rc32434_setup_ethaddr0(char *options)
3611 + memcpy(mac0, options, 17);
3616 +__setup("rc32434eth=", rc32434_setup);
3617 +__setup("ethaddr0=", rc32434_setup_ethaddr0);
3620 +#endif /* MODULE */
3622 +module_init(rc32434_init_module);
3623 +module_exit(rc32434_cleanup_module);
3638 diff -Nur linux-2.6.15/drivers/net/rc32434_eth.h linux-2.6.15-openwrt/drivers/net/rc32434_eth.h
3639 --- linux-2.6.15/drivers/net/rc32434_eth.h 1970-01-01 01:00:00.000000000 +0100
3640 +++ linux-2.6.15-openwrt/drivers/net/rc32434_eth.h 2006-01-10 00:32:33.000000000 +0100
3642 +/**************************************************************************
3644 + * BRIEF MODULE DESCRIPTION
3645 + * Definitions for IDT RC32434 on-chip ethernet controller.
3647 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
3649 + * This program is free software; you can redistribute it and/or modify it
3650 + * under the terms of the GNU General Public License as published by the
3651 + * Free Software Foundation; either version 2 of the License, or (at your
3652 + * option) any later version.
3654 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3655 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3656 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3657 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3658 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3659 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3660 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3661 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3662 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3663 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3665 + * You should have received a copy of the GNU General Public License along
3666 + * with this program; if not, write to the Free Software Foundation, Inc.,
3667 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3670 + **************************************************************************
3671 + * May 2004 rkt, neb
3679 + **************************************************************************
3683 +#include <asm/idt-boards/rc32434/rc32434.h>
3684 +#include <asm/idt-boards/rc32434/rc32434_dma_v.h>
3685 +#include <asm/idt-boards/rc32434/rc32434_eth_v.h>
3687 +#define RC32434_DEBUG 2
3688 +//#define RC32434_PROC_DEBUG
3689 +#undef RC32434_DEBUG
3691 +#ifdef RC32434_DEBUG
3693 +/* use 0 for production, 1 for verification, >2 for debug */
3694 +static int rc32434_debug = RC32434_DEBUG;
3695 +#define ASSERT(expr) \
3697 + printk( "Assertion failed! %s,%s,%s,line=%d\n", \
3698 + #expr,__FILE__,__FUNCTION__,__LINE__); }
3699 +#define DBG(lvl, format, arg...) if (rc32434_debug > lvl) printk(KERN_INFO "%s: " format, dev->name , ## arg)
3701 +#define ASSERT(expr) do {} while (0)
3702 +#define DBG(lvl, format, arg...) do {} while (0)
3705 +#define INFO(format, arg...) printk(KERN_INFO "%s: " format, dev->name , ## arg)
3706 +#define ERR(format, arg...) printk(KERN_ERR "%s: " format, dev->name , ## arg)
3707 +#define WARN(format, arg...) printk(KERN_WARNING "%s: " format, dev->name , ## arg)
3709 +#define ETH0_DMA_RX_IRQ GROUP1_IRQ_BASE + 0
3710 +#define ETH0_DMA_TX_IRQ GROUP1_IRQ_BASE + 1
3711 +#define ETH0_RX_OVR_IRQ GROUP3_IRQ_BASE + 9
3712 +#define ETH0_TX_UND_IRQ GROUP3_IRQ_BASE + 10
3714 +#define ETH0_RX_DMA_ADDR (DMA0_PhysicalAddress + 0*DMA_CHAN_OFFSET)
3715 +#define ETH0_TX_DMA_ADDR (DMA0_PhysicalAddress + 1*DMA_CHAN_OFFSET)
3717 +/* the following must be powers of two */
3718 +#ifdef CONFIG_IDT_USE_NAPI
3719 +#define RC32434_NUM_RDS 64 /* number of receive descriptors */
3720 +#define RC32434_NUM_TDS 64 /* number of transmit descriptors */
3722 +#define RC32434_NUM_RDS 128 /* number of receive descriptors */
3723 +#define RC32434_NUM_TDS 128 /* number of transmit descriptors */
3726 +#define RC32434_RBSIZE 1536 /* size of one resource buffer = Ether MTU */
3727 +#define RC32434_RDS_MASK (RC32434_NUM_RDS-1)
3728 +#define RC32434_TDS_MASK (RC32434_NUM_TDS-1)
3729 +#define RD_RING_SIZE (RC32434_NUM_RDS * sizeof(struct DMAD_s))
3730 +#define TD_RING_SIZE (RC32434_NUM_TDS * sizeof(struct DMAD_s))
3732 +#define RC32434_TX_TIMEOUT HZ * 100
3734 +#define rc32434_eth0_regs ((ETH_t)(ETH0_VirtualAddress))
3735 +#define rc32434_eth1_regs ((ETH_t)(ETH1_VirtualAddress))
3737 +enum status { filled, empty};
3738 +#define IS_DMA_FINISHED(X) (((X) & (DMAD_f_m)) != 0)
3739 +#define IS_DMA_DONE(X) (((X) & (DMAD_d_m)) != 0)
3742 +/* Information that need to be kept for each board. */
3743 +struct rc32434_local {
3745 + DMA_Chan_t rx_dma_regs;
3746 + DMA_Chan_t tx_dma_regs;
3747 + volatile DMAD_t td_ring; /* transmit descriptor ring */
3748 + volatile DMAD_t rd_ring; /* receive descriptor ring */
3750 + struct sk_buff* tx_skb[RC32434_NUM_TDS]; /* skbuffs for pkt to trans */
3751 + struct sk_buff* rx_skb[RC32434_NUM_RDS]; /* skbuffs for pkt to trans */
3753 +#ifndef CONFIG_IDT_USE_NAPI
3754 + struct tasklet_struct * rx_tasklet;
3756 + struct tasklet_struct * tx_tasklet;
3759 + int rx_chain_head;
3760 + int rx_chain_tail;
3761 + enum status rx_chain_status;
3764 + int tx_chain_head;
3765 + int tx_chain_tail;
3766 + enum status tx_chain_status;
3770 + struct timer_list mii_phy_timer;
3771 + unsigned long duplex_mode;
3778 + struct net_device_stats stats;
3781 + /* debug /proc entry */
3782 + struct proc_dir_entry *ps;
3783 + int dma_halt_cnt; int dma_run_cnt;
3786 +extern unsigned int idt_cpu_freq;
3788 +/* Index to functions, as function prototypes. */
3789 +static int rc32434_open(struct net_device *dev);
3790 +static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev);
3791 +static void rc32434_mii_handler(unsigned long data);
3792 +static irqreturn_t rc32434_und_interrupt(int irq, void *dev_id, struct pt_regs * regs);
3793 +static irqreturn_t rc32434_rx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs);
3794 +static irqreturn_t rc32434_tx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs);
3795 +#ifdef RC32434_REVISION
3796 +static irqreturn_t rc32434_ovr_interrupt(int irq, void *dev_id, struct pt_regs * regs);
3798 +static int rc32434_close(struct net_device *dev);
3799 +static struct net_device_stats *rc32434_get_stats(struct net_device *dev);
3800 +static void rc32434_multicast_list(struct net_device *dev);
3801 +static int rc32434_init(struct net_device *dev);
3802 +static void rc32434_tx_timeout(struct net_device *dev);
3804 +static void rc32434_tx_tasklet(unsigned long tx_data_dev);
3805 +#ifdef CONFIG_IDT_USE_NAPI
3806 +static int rc32434_poll(struct net_device *rx_data_dev, int *budget);
3808 +static void rc32434_rx_tasklet(unsigned long rx_data_dev);
3810 +static void rc32434_cleanup_module(void);
3811 +static int rc32434_probe(int port_num);
3812 +int rc32434_init_module(void);
3815 +static inline void rc32434_abort_dma(struct net_device *dev, DMA_Chan_t ch)
3817 + if (rc32434_readl(&ch->dmac) & DMAC_run_m) {
3818 + rc32434_writel(0x10, &ch->dmac);
3820 + while (!(rc32434_readl(&ch->dmas) & DMAS_h_m))
3821 + dev->trans_start = jiffies;
3823 + rc32434_writel(0, &ch->dmas);
3826 + rc32434_writel(0, &ch->dmadptr);
3827 + rc32434_writel(0, &ch->dmandptr);
3829 diff -Nur linux-2.6.15/drivers/pci/access.c linux-2.6.15-openwrt/drivers/pci/access.c
3830 --- linux-2.6.15/drivers/pci/access.c 2006-01-03 04:21:10.000000000 +0100
3831 +++ linux-2.6.15-openwrt/drivers/pci/access.c 2006-01-10 00:43:10.000000000 +0100
3833 #define PCI_word_BAD (pos & 1)
3834 #define PCI_dword_BAD (pos & 3)
3837 #define PCI_OP_READ(size,type,len) \
3838 int pci_bus_read_config_##size \
3839 (struct pci_bus *bus, unsigned int devfn, int pos, type *value) \
3841 if (PCI_##size##_BAD) return PCIBIOS_BAD_REGISTER_NUMBER; \
3842 spin_lock_irqsave(&pci_lock, flags); \
3843 res = bus->ops->read(bus, devfn, pos, len, &data); \
3845 + *value = (type)((data >> 24) & 0xff); \
3846 + else if (len == 2) \
3847 + *value = (type)((data >> 16) & 0xffff); \
3849 *value = (type)data; \
3850 spin_unlock_irqrestore(&pci_lock, flags); \
3855 +#define PCI_OP_READ(size,type,len) \
3856 +int pci_bus_read_config_##size \
3857 + (struct pci_bus *bus, unsigned int devfn, int pos, type *value) \
3860 + unsigned long flags; \
3862 + if (PCI_##size##_BAD) return PCIBIOS_BAD_REGISTER_NUMBER; \
3863 + spin_lock_irqsave(&pci_lock, flags); \
3864 + res = bus->ops->read(bus, devfn, pos, len, &data); \
3865 + *value = (type)data; \
3866 + spin_unlock_irqrestore(&pci_lock, flags); \
3870 #define PCI_OP_WRITE(size,type,len) \
3871 int pci_bus_write_config_##size \
3872 (struct pci_bus *bus, unsigned int devfn, int pos, type value) \
3873 diff -Nur linux-2.6.15/include/asm-mips/bootinfo.h linux-2.6.15-openwrt/include/asm-mips/bootinfo.h
3874 --- linux-2.6.15/include/asm-mips/bootinfo.h 2006-01-03 04:21:10.000000000 +0100
3875 +++ linux-2.6.15-openwrt/include/asm-mips/bootinfo.h 2006-01-10 00:32:33.000000000 +0100
3876 @@ -218,6 +218,17 @@
3877 #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
3878 #define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
3882 + * Valid machtype for group ARUBA
3884 +#define MACH_GROUP_ARUBA 23
3885 +#define MACH_ARUBA_UNKNOWN 0
3886 +#define MACH_ARUBA_AP60 1
3887 +#define MACH_ARUBA_AP65 2
3888 +#define MACH_ARUBA_AP70 3
3889 +#define MACH_ARUBA_AP40 4
3891 #define CL_SIZE COMMAND_LINE_SIZE
3893 const char *get_system_type(void);
3894 diff -Nur linux-2.6.15/include/asm-mips/cpu.h linux-2.6.15-openwrt/include/asm-mips/cpu.h
3895 --- linux-2.6.15/include/asm-mips/cpu.h 2006-01-03 04:21:10.000000000 +0100
3896 +++ linux-2.6.15-openwrt/include/asm-mips/cpu.h 2006-01-10 00:32:33.000000000 +0100
3898 #define PRID_IMP_R12000 0x0e00
3899 #define PRID_IMP_R8000 0x1000
3900 #define PRID_IMP_PR4450 0x1200
3901 +#define PRID_IMP_RC32334 0x1800
3902 +#define PRID_IMP_RC32355 0x1900
3903 +#define PRID_IMP_RC32365 0x1900
3904 #define PRID_IMP_R4600 0x2000
3905 #define PRID_IMP_R4700 0x2100
3906 #define PRID_IMP_TX39 0x2200
3909 #define CPU_PR4450 61
3911 -#define CPU_LAST 62
3912 +#define CPU_RC32300 63
3913 +#define CPU_LAST 63
3916 * ISA Level encodings
3917 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32300.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32300.h
3918 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32300.h 1970-01-01 01:00:00.000000000 +0100
3919 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32300.h 2006-01-10 00:32:33.000000000 +0100
3921 +/**************************************************************************
3923 + * BRIEF MODULE DESCRIPTION
3924 + * RC32300 helper routines
3926 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
3928 + * This program is free software; you can redistribute it and/or modify it
3929 + * under the terms of the GNU General Public License as published by the
3930 + * Free Software Foundation; either version 2 of the License, or (at your
3931 + * option) any later version.
3933 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3934 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3935 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3936 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3937 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3938 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3939 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3940 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3941 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3942 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3944 + * You should have received a copy of the GNU General Public License along
3945 + * with this program; if not, write to the Free Software Foundation, Inc.,
3946 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3949 + **************************************************************************
3950 + * May 2004 P. Sadik.
3956 + **************************************************************************
3959 +#ifndef __IDT_RC32300_H__
3960 +#define __IDT_RC32300_H__
3962 +#include <linux/delay.h>
3963 +#include <asm/io.h>
3966 +/* cpu pipeline flush */
3967 +static inline void rc32300_sync(void)
3969 + __asm__ volatile ("sync");
3972 +static inline void rc32300_sync_udelay(int us)
3974 + __asm__ volatile ("sync");
3978 +static inline void rc32300_sync_delay(int ms)
3980 + __asm__ volatile ("sync");
3985 + * Macros to access internal RC32300 registers. No byte
3986 + * swapping should be done when accessing the internal
3990 +static inline u8 rc32300_readb(unsigned long pa)
3992 + return *((volatile u8 *)KSEG1ADDR(pa));
3994 +static inline u16 rc32300_readw(unsigned long pa)
3996 + return *((volatile u16 *)KSEG1ADDR(pa));
3998 +static inline u32 rc32300_readl(unsigned long pa)
4000 + return *((volatile u32 *)KSEG1ADDR(pa));
4002 +static inline void rc32300_writeb(u8 val, unsigned long pa)
4004 + *((volatile u8 *)KSEG1ADDR(pa)) = val;
4006 +static inline void rc32300_writew(u16 val, unsigned long pa)
4008 + *((volatile u16 *)KSEG1ADDR(pa)) = val;
4010 +static inline void rc32300_writel(u32 val, unsigned long pa)
4012 + *((volatile u32 *)KSEG1ADDR(pa)) = val;
4016 +#define local_readb __raw_readb
4017 +#define local_readw __raw_readw
4018 +#define local_readl __raw_readl
4020 +#define local_writeb __raw_writeb
4021 +#define local_writew __raw_writew
4022 +#define local_writel __raw_writel
4026 + * C access to CLZ and CLO instructions
4027 + * (count leading zeroes/ones).
4029 +static inline int rc32300_clz(unsigned long val)
4032 + __asm__ volatile (
4033 + ".set\tnoreorder\n\t"
4035 + ".set\tmips32\n\t"
4045 +static inline int rc32300_clo(unsigned long val)
4048 + __asm__ volatile (
4049 + ".set\tnoreorder\n\t"
4051 + ".set\tmips32\n\t"
4062 +#endif // __IDT_RC32300_H__
4063 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32334.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32334.h
4064 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32334.h 1970-01-01 01:00:00.000000000 +0100
4065 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32334.h 2006-01-10 00:32:33.000000000 +0100
4067 +/**************************************************************************
4069 + * BRIEF MODULE DESCRIPTION
4070 + * Definitions for IDT RC32334 CPU.
4072 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4074 + * This program is free software; you can redistribute it and/or modify it
4075 + * under the terms of the GNU General Public License as published by the
4076 + * Free Software Foundation; either version 2 of the License, or (at your
4077 + * option) any later version.
4079 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4080 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4081 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4082 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4083 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4084 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4085 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4086 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4087 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4088 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4090 + * You should have received a copy of the GNU General Public License along
4091 + * with this program; if not, write to the Free Software Foundation, Inc.,
4092 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4095 + **************************************************************************
4096 + * May 2004 P. Sadik.
4102 + **************************************************************************
4106 +#ifndef __IDT_RC32334_H__
4107 +#define __IDT_RC32334_H__
4109 +#include <linux/delay.h>
4110 +#include <asm/io.h>
4112 +/* Base address of internal registers */
4113 +#define RC32334_REG_BASE 0x18000000
4115 +/* CPU and IP Bus Control */
4116 +#define CPU_PORT_WIDTH 0xffffe200 // virtual!
4117 +#define CPU_BTA 0xffffe204 // virtual!
4118 +#define CPU_BUSERR_ADDR 0xffffe208 // virtual!
4119 +#define CPU_IP_BTA (RC32334_REG_BASE + 0x0000)
4120 +#define CPU_IP_ADDR_LATCH (RC32334_REG_BASE + 0x0004)
4121 +#define CPU_IP_ARBITRATION (RC32334_REG_BASE + 0x0008)
4122 +#define CPU_IP_BUSERR_CNTL (RC32334_REG_BASE + 0x0010)
4123 +#define CPU_IP_BUSERR_ADDR (RC32334_REG_BASE + 0x0014)
4124 +#define CPU_IP_SYSID (RC32334_REG_BASE + 0x0018)
4126 +/* Memory Controller */
4127 +#define MEM_BASE_BANK0 (RC32334_REG_BASE + 0x0080)
4128 +#define MEM_MASK_BANK0 (RC32334_REG_BASE + 0x0084)
4129 +#define MEM_CNTL_BANK0 (RC32334_REG_BASE + 0x0200)
4130 +#define MEM_BASE_BANK1 (RC32334_REG_BASE + 0x0088)
4131 +#define MEM_MASK_BANK1 (RC32334_REG_BASE + 0x008c)
4132 +#define MEM_CNTL_BANK1 (RC32334_REG_BASE + 0x0204)
4133 +#define MEM_CNTL_BANK2 (RC32334_REG_BASE + 0x0208)
4134 +#define MEM_CNTL_BANK3 (RC32334_REG_BASE + 0x020c)
4135 +#define MEM_CNTL_BANK4 (RC32334_REG_BASE + 0x0210)
4136 +#define MEM_CNTL_BANK5 (RC32334_REG_BASE + 0x0214)
4138 +/* PCI Controller */
4139 +#define PCI_INTR_PEND (RC32334_REG_BASE + 0x05b0)
4140 +#define PCI_INTR_MASK (RC32334_REG_BASE + 0x05b4)
4141 +#define PCI_INTR_CLEAR (RC32334_REG_BASE + 0x05b8)
4142 +#define CPU2PCI_INTR_PEND (RC32334_REG_BASE + 0x05c0)
4143 +#define CPU2PCI_INTR_MASK (RC32334_REG_BASE + 0x05c4)
4144 +#define CPU2PCI_INTR_CLEAR (RC32334_REG_BASE + 0x05c8)
4145 +#define PCI2CPU_INTR_PEND (RC32334_REG_BASE + 0x05d0)
4146 +#define PCI2CPU_INTR_MASK (RC32334_REG_BASE + 0x05d4)
4147 +#define PCI2CPU_INTR_CLEAR (RC32334_REG_BASE + 0x05d8)
4148 +#define PCI_MEM1_BASE (RC32334_REG_BASE + 0x20b0)
4149 +#define PCI_MEM2_BASE (RC32334_REG_BASE + 0x20b8)
4150 +#define PCI_MEM3_BASE (RC32334_REG_BASE + 0x20c0)
4151 +#define PCI_IO1_BASE (RC32334_REG_BASE + 0x20c8)
4152 +#define PCI_ARBITRATION (RC32334_REG_BASE + 0x20e0)
4153 +#define PCI_CPU_MEM1_BASE (RC32334_REG_BASE + 0x20e8)
4154 +#define PCI_CPU_IO_BASE (RC32334_REG_BASE + 0x2100)
4155 +#define PCI_CFG_CNTL (RC32334_REG_BASE + 0x2cf8)
4156 +#define PCI_CFG_DATA (RC32334_REG_BASE + 0x2cfc)
4159 +#define TIMER0_CNTL (RC32334_REG_BASE + 0x0700)
4160 +#define TIMER0_COUNT (RC32334_REG_BASE + 0x0704)
4161 +#define TIMER0_COMPARE (RC32334_REG_BASE + 0x0708)
4162 +#define TIMER_REG_OFFSET 0x10
4164 +/* Programmable I/O */
4165 +#define PIO_DATA0 (RC32334_REG_BASE + 0x0600)
4166 +#define PIO_DATA1 (RC32334_REG_BASE + 0x0610)
4171 + * NOTE: DMA_IO is a trick for non linear RC32300_IO_DMA stuff
4177 + * NB: dma number must be immediate value or variable.
4178 + * It MUST NOT be a function since it would get called twice!
4180 +#define DMA_IO(n) (((n)>1?0x500:0)+((n)&1?0x40:0))
4182 +#define RC32300_IO_DMA(n) (RC32334_REG_BASE + 0x1400 + DMA_IO(n))
4183 +#define RC32300_DMA_CONFREG(n) RC32300_IO_DMA(n)
4184 +#define RC32300_DMA_BASEREG(n) (RC32300_IO_DMA(n)+0x4)
4186 +#define RC32300_DMA_CURRREG(n) (RC32300_IO_DMA(n)+0x8)
4187 +#define RC32300_DMA_STATREG(n) (RC32300_IO_DMA(n)+0x10)
4188 +#define RC32300_DMA_SRCREG(n) (RC32300_IO_DMA(n)+0x14)
4189 +#define RC32300_DMA_DSTREG(n) (RC32300_IO_DMA(n)+0x18)
4190 +#define RC32300_DMA_NEXTREG(n) (RC32300_IO_DMA(n)+0x1c)
4192 +#define RC32300_DMA_IRQ(n) (GROUP7_IRQ_BASE+5*(n))
4194 +/* Expansion Interrupt Controller */
4195 +#define IC_GROUP0_PEND (RC32334_REG_BASE + 0x0500)
4196 +#define IC_GROUP0_MASK (RC32334_REG_BASE + 0x0504)
4197 +#define IC_GROUP0_CLEAR (RC32334_REG_BASE + 0x0508)
4198 +#define IC_GROUP_OFFSET 0x10
4200 +#define NUM_INTR_GROUPS 15
4202 + * The IRQ mapping is as follows:
4205 + * --- -------------------
4206 + * 0 SW0 (IP0) SW0 intr
4207 + * 1 SW1 (IP1) SW1 intr
4208 + * 2 Int0 (IP2) board-specific
4209 + * 3 Int1 (IP3) board-specific
4210 + * 4 Int2 (IP4) board-specific
4211 + * - Int3 (IP5) not used, mapped to IRQ's 8 and up
4212 + * 6 Int4 (IP6) board-specific
4213 + * 7 Int5 (IP7) CP0 Timer
4215 + * IRQ's 8 and up are all mapped to Int3 (IP5), which
4216 + * internally on the RC32334 is routed to the Expansion
4217 + * Interrupt Controller.
4219 +#define MIPS_CPU_TIMER_IRQ 7
4221 +#define GROUP1_IRQ_BASE 8 // bus error
4222 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 1) // PIO active low
4223 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 12) // PIO active high
4224 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 8) // Timer Rollovers
4225 +#define GROUP5_IRQ_BASE (GROUP4_IRQ_BASE + 8) // UART0
4226 +#define GROUP6_IRQ_BASE (GROUP5_IRQ_BASE + 3) // UART1
4227 +#define GROUP7_IRQ_BASE (GROUP6_IRQ_BASE + 3) // DMA Ch0
4228 +#define GROUP8_IRQ_BASE (GROUP7_IRQ_BASE + 5) // DMA Ch1
4229 +#define GROUP9_IRQ_BASE (GROUP8_IRQ_BASE + 5) // DMA Ch2
4230 +#define GROUP10_IRQ_BASE (GROUP9_IRQ_BASE + 5) // DMA Ch3
4231 +#define GROUP11_IRQ_BASE (GROUP10_IRQ_BASE + 5) // PCI Ctlr errors
4232 +#define GROUP12_IRQ_BASE (GROUP11_IRQ_BASE + 4) // PCI Satellite Mode
4233 +#define GROUP13_IRQ_BASE (GROUP12_IRQ_BASE + 16) // PCI to CPU Mailbox
4234 +#define GROUP14_IRQ_BASE (GROUP13_IRQ_BASE + 4) // SPI
4236 +#define RC32334_NR_IRQS (GROUP14_IRQ_BASE + 1)
4240 +#define RC32300_UART0_BASE (RC32334_REG_BASE + 0x0803)
4241 +#define RC32300_UART1_BASE (RC32334_REG_BASE + 0x0823)
4243 +#define RC32300_UART0_BASE (RC32334_REG_BASE + 0x0800)
4244 +#define RC32300_UART1_BASE (RC32334_REG_BASE + 0x0820)
4247 +#define RC32300_UART0_IRQ GROUP5_IRQ_BASE
4248 +#define RC32300_UART1_IRQ GROUP6_IRQ_BASE
4250 +#define IDT_CLOCK_MULT 2
4253 +#define NVRAM_BASE 0x12000000
4254 +#define NVRAM_ENVSIZE_OFF 4
4255 +#define NVRAM_ENVSTART_OFF 0x40
4257 +/* LCD 4-digit display */
4258 +#define LCD_CLEAR 0x14000400
4259 +#define LCD_DIGIT0 0x1400000f
4260 +#define LCD_DIGIT1 0x14000008
4261 +#define LCD_DIGIT2 0x14000007
4262 +#define LCD_DIGIT3 0x14000003
4264 +/* Interrupts routed on 79S334A board (see rc32334.h) */
4265 +#define RC32334_SCC8530_IRQ 2
4266 +#define RC32334_PCI_INTA_IRQ 3
4267 +#define RC32334_PCI_INTB_IRQ 4
4268 +#define RC32334_PCI_INTC_IRQ 6
4269 +#define RC32334_PCI_INTD_IRQ 7
4271 +#define RAM_SIZE (32*1024*1024)
4273 +#endif // __IDT_RC32334_H__
4274 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355_dma.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355_dma.h
4275 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355_dma.h 1970-01-01 01:00:00.000000000 +0100
4276 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355_dma.h 2006-01-10 00:32:33.000000000 +0100
4278 +/**************************************************************************
4280 + * BRIEF MODULE DESCRIPTION
4281 + * DMA controller defines on IDT RC32355
4283 + * Copyright 2004 IDT Inc.
4284 + * Author: Integrated Device Technology Inc. rischelp@idt.com
4287 + * This program is free software; you can redistribute it and/or modify it
4288 + * under the terms of the GNU General Public License as published by the
4289 + * Free Software Foundation; either version 2 of the License, or (at your
4290 + * option) any later version.
4292 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4293 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4294 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4295 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4296 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4297 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4298 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4299 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4300 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4301 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4303 + * You should have received a copy of the GNU General Public License along
4304 + * with this program; if not, write to the Free Software Foundation, Inc.,
4305 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4311 + **************************************************************************
4314 +#ifndef BANYAN_DMA_H
4315 +#define BANYAN_DMA_H
4316 +#include <asm/idt-boards/rc32300/rc32300.h>
4319 + * An image of one RC32355 dma channel registers
4327 +} rc32355_dma_ch_t;
4330 + * An image of all RC32355 dma channel registers
4333 + rc32355_dma_ch_t ch[16];
4334 +} rc32355_dma_regs_t;
4337 +#define rc32355_dma_regs ((rc32355_dma_regs_t*)KSEG1ADDR(RC32355_DMA_BASE))
4340 +/* DMAC register layout */
4342 +#define DMAC_RUN 0x1 /* Halts processing when cleared */
4343 +#define DMAC_DM 0x2 /* Done Mask, ignore DMA events */
4344 +#define DMAC_MODE_MASK 0xC /* DMA operating mode */
4346 +#define DMAC_MODE_AUTO 0x0 /* DMA Auto Request Mode */
4347 +#define DMAC_MODE_BURST 0x4 /* DMA Burst Request Mode */
4348 +#define DMAC_MODE_TFER 0x8 /* DMA Transfer Request Mode */
4350 +/* DMAS and DMASM register layout */
4352 +#define DMAS_F 0x01 /* Finished */
4353 +#define DMAS_D 0x02 /* Done */
4354 +#define DMAS_C 0x04 /* Chain */
4355 +#define DMAS_E 0x08 /* Error */
4356 +#define DMAS_H 0x10 /* Halt */
4358 +/* Polling count for DMAS_H bit in DMAS register after halting DMA */
4359 +#define DMA_HALT_TIMEOUT 500
4362 +static inline int rc32355_halt_dma(rc32355_dma_ch_t* ch)
4366 + if (local_readl(&ch->dmac) & DMAC_RUN) {
4367 + local_writel(0, &ch->dmac);
4368 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
4369 + if (local_readl(&ch->dmas) & DMAS_H) {
4370 + local_writel(0, &ch->dmas);
4376 + return timeout ? 0 : 1;
4379 +static inline void rc32355_start_dma(rc32355_dma_ch_t* ch, u32 dma_addr)
4381 + local_writel(0, &ch->dmandptr);
4382 + local_writel(dma_addr, &ch->dmadptr);
4385 +static inline void rc32355_chain_dma(rc32355_dma_ch_t* ch, u32 dma_addr)
4387 + local_writel(dma_addr, &ch->dmandptr);
4391 +/* The following can be used to describe DMA channels 0 to 15, and the */
4392 +/* sub device's needed to select them in the DMADESC_DS_MASK field */
4394 +#define DMA_CHAN_ATM01 0 /* ATM interface 0,1 chan */
4396 +#define DMA_CHAN_ATM0IN 0 /* ATM interface 0 input */
4397 +#define DMA_DEV_ATM0IN 0 /* ATM interface 0 input */
4399 +#define DMA_CHAN_ATM1IN 0 /* ATM interface 1 input */
4400 +#define DMA_DEV_ATM1IN 1 /* ATM interface 1 input */
4402 +#define DMA_CHAN_ATM0OUT 0 /* ATM interface 0 output */
4403 +#define DMA_DEV_ATM0OUT 2 /* ATM interface 0 output */
4405 +#define DMA_CHAN_ATM1OUT 0 /* ATM interface 1 output */
4406 +#define DMA_DEV_ATM1OUT 3 /* ATM interface 1 output */
4408 +/* for entry in {0,1,2,3,4,5,6,7} - note 5,6,7 share with those below */
4409 +#define DMA_CHAN_ATMVCC(entry) ((entry)+1) /* ATM VC cache entry */
4410 +#define DMA_DEV_ATMVCC(entry) 0
4412 +#define DMA_CHAN_MEMTOMEM 6 /* Memory to memory DMA */
4413 +#define DMA_DEV_MEMTOMEM 1 /* Memory to memory DMA */
4415 +#define DMA_CHAN_ATMFMB0 7 /* ATM Frame Mode Buffer 0 */
4416 +#define DMA_DEV_ATMFMB0 1 /* ATM Frame Mode Buffer 0 */
4418 +#define DMA_CHAN_ATMFMB1 8 /* ATM Frame Mode Buffer 1 */
4419 +#define DMA_DEV_ATMFMB1 1 /* ATM Frame Mode Buffer 1 */
4421 +#define DMA_CHAN_ETHERIN 9 /* Ethernet input */
4422 +#define DMA_DEV_ETHERIN 0 /* Ethernet input */
4424 +#define DMA_CHAN_ETHEROUT 10 /* Ethernet output */
4425 +#define DMA_DEV_ETHEROUT 0 /* Ethernet output */
4427 +#define DMA_CHAN_TDMIN 11 /* TDM Bus input */
4428 +#define DMA_DEV_TDMIN 0 /* TDM Bus input */
4430 +#define DMA_CHAN_TDMOUT 12 /* TDM Bus output */
4431 +#define DMA_DEV_TDMOUT 0 /* TDM Bus output */
4433 +#define DMA_CHAN_USBIN 13 /* USB input */
4434 +#define DMA_DEV_USBIN 0 /* USB input */
4436 +#define DMA_CHAN_USBOUT 14 /* USB output */
4437 +#define DMA_DEV_USBOUT 0 /* USB output */
4439 +#define DMA_CHAN_EXTERN 15 /* External DMA */
4440 +#define DMA_DEV_EXTERN 0 /* External DMA */
4443 + * An RC32355 dma descriptor in system memory
4446 + u32 cmdstat; /* control and status */
4447 + u32 curr_addr; /* current address of data */
4448 + u32 devcs; /* peripheral-specific control and status */
4449 + u32 link; /* link to next descriptor */
4450 +} rc32355_dma_desc_t;
4452 +/* Values for the descriptor cmdstat word */
4454 +#define DMADESC_F 0x80000000u /* Finished bit */
4455 +#define DMADESC_D 0x40000000u /* Done bit */
4456 +#define DMADESC_T 0x20000000u /* Terminated bit */
4457 +#define DMADESC_IOD 0x10000000u /* Interrupt On Done */
4458 +#define DMADESC_IOF 0x08000000u /* Interrupt On Finished */
4459 +#define DMADESC_COD 0x04000000u /* Chain On Done */
4460 +#define DMADESC_COF 0x02000000u /* Chain On Finished */
4462 +#define DMADESC_DEVCMD_MASK 0x01C00000u /* Device Command mask */
4463 +#define DMADESC_DEVCMD_SHIFT 22 /* Device Command shift */
4465 +#define DMADESC_DS_MASK 0x00300000u /* Device Select mask */
4466 +#define DMADESC_DS_SHIFT 20 /* Device Select shift */
4468 +#define DMADESC_COUNT_MASK 0x0003FFFFu /* Byte Count mask */
4469 +#define DMADESC_COUNT_SHIFT 0 /* Byte Count shift */
4471 +#define IS_DMA_FINISHED(X) ( ( (X) & DMADESC_F ) >> 31) /* F Bit */
4472 +#define IS_DMA_DONE(X) ( ( (X) & DMADESC_D ) >> 30) /* D Bit */
4473 +#define IS_DMA_TERMINATED(X) ( ( (X) & DMADESC_T ) >> 29) /* T Bit */
4474 +#define IS_DMA_USED(X) (((X) & (DMADESC_F | DMADESC_D | DMADESC_T)) != 0)
4476 +#define DMA_DEVCMD(devcmd) \
4477 + (((devcmd) << DMADESC_DEVCMD_SHIFT) & DMADESC_DS_MASK)
4478 +#define DMA_DS(ds) \
4479 + (((ds) << DMADESC_DS_SHIFT) & DMADESC_DS_MASK)
4480 +#define DMA_COUNT(count) \
4481 + ((count) & DMADESC_COUNT_MASK)
4483 +#endif /* RC32355_DMA_H */
4484 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355_eth.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355_eth.h
4485 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355_eth.h 1970-01-01 01:00:00.000000000 +0100
4486 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355_eth.h 2006-01-10 00:32:33.000000000 +0100
4488 +/**************************************************************************
4490 + * BRIEF MODULE DESCRIPTION
4491 + * Ethernet registers on IDT RC32355
4493 + * Copyright 2004 IDT Inc.
4494 + * Author: Integrated Device Technology Inc. rischelp@idt.com
4497 + * This program is free software; you can redistribute it and/or modify it
4498 + * under the terms of the GNU General Public License as published by the
4499 + * Free Software Foundation; either version 2 of the License, or (at your
4500 + * option) any later version.
4502 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4503 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4504 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4505 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4506 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4507 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4508 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4509 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4510 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4511 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4513 + * You should have received a copy of the GNU General Public License along
4514 + * with this program; if not, write to the Free Software Foundation, Inc.,
4515 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4521 + **************************************************************************
4525 +#ifndef RC32355_ETHER_H
4526 +#define RC32355_ETHER_H
4528 +#include <asm/idt-boards/rc32300/rc32355_dma.h>
4531 + * A partial image of the RC32355 ethernet registers
4590 +} rc32355_eth_regs_t;
4592 +#define rc32355_eth_regs ((rc32355_eth_regs_t*)KSEG1ADDR(RC32355_ETH_BASE))
4594 +#define ETH_INTFC (RC32355_ETH_BASE + 0x000) /* INTerFace Control */
4595 +#define ETH_FIFOTT (RC32355_ETH_BASE + 0x004) /* FIFO Transmit Threshold */
4596 +#define ETH_ARC (RC32355_ETH_BASE + 0x008) /* Address Recognition Ctrl */
4597 +#define ETH_HASH0 (RC32355_ETH_BASE + 0x00C) /* 32 multicast Hash bits */
4598 +#define ETH_HASH1 (RC32355_ETH_BASE + 0x010) /* another 32 Hash bits */
4599 +#define ETH_FIFOST (RC32355_ETH_BASE + 0x014) /* FIFO Status Threshold */
4600 +#define ETH_FIFOS (RC32355_ETH_BASE + 0x018) /* FIFO Status Register */
4601 +#define ETH_ODEOPS (RC32355_ETH_BASE + 0x01C) /* Out Data End-Of-Pkt Size */
4602 +#define ETH_IS (RC32355_ETH_BASE + 0x020) /* Input Status */
4603 +#define ETH_OS (RC32355_ETH_BASE + 0x024) /* Output Status */
4604 +#define ETH_MCP (RC32355_ETH_BASE + 0x028) /* Managemt Clock Prescaler */
4605 +#define ETH_ID (RC32355_ETH_BASE + 0x030) /* Input Data register */
4606 +#define ETH_OD (RC32355_ETH_BASE + 0x040) /* Output Data register */
4607 +#define ETH_ODEOP (RC32355_ETH_BASE + 0x050) /* OD End-Of-Packet Size */
4609 +/* for n in { 0, 1, 2, 3 } */
4610 +#define ETH_SAL(n) (RC32355_ETH_BASE + 0x100 + (n * 8)) /* Stn Address 2-5 */
4611 +#define ETH_SAH(n) (RC32355_ETH_BASE + 0x104 + (n * 8)) /* Stn Address 0-1 */
4613 +#define ETH_RBC (RC32355_ETH_BASE + 0x120) /* Receive Byte Count */
4614 +#define ETH_RPC (RC32355_ETH_BASE + 0x124) /* Receive Packet Count */
4615 +#define ETH_RUPC (RC32355_ETH_BASE + 0x128) /* Rx Undersized Pkt count */
4616 +#define ETH_RFC (RC32355_ETH_BASE + 0x12C) /* Receive Fragment Count */
4617 +#define ETH_TBC (RC32355_ETH_BASE + 0x130) /* Transmit Byte Count */
4618 +#define ETH_GPF (RC32355_ETH_BASE + 0x134) /* Generate Pause Frame */
4619 +#define ETH_MAC1 (RC32355_ETH_BASE + 0x200) /* Medium Access Control 1 */
4620 +#define ETH_MAC2 (RC32355_ETH_BASE + 0x204) /* Medium Access Control 2 */
4621 +#define ETH_IPGT (RC32355_ETH_BASE + 0x208) /* Back-to-back InterPkt Gap */
4622 +#define ETH_IPGR (RC32355_ETH_BASE + 0x20C) /* Non " InterPkt Gap */
4623 +#define ETH_CLRT (RC32355_ETH_BASE + 0x210) /* Collis'n Window and Retry */
4624 +#define ETH_MAXF (RC32355_ETH_BASE + 0x214) /* Maximum Frame Length */
4625 +#define ETH_MTEST (RC32355_ETH_BASE + 0x21C) /* MAC Test */
4627 +#define ETHMIIM_CFG (RC32355_ETH_BASE + 0x220) /* MII Mgmt Configuration */
4628 +#define ETHMIIM_CMD (RC32355_ETH_BASE + 0x224) /* MII Mgmt Command */
4629 +#define ETHMIIM_ADDR (RC32355_ETH_BASE + 0x228) /* MII Mgmt Address */
4630 +#define ETHMIIM_WTD (RC32355_ETH_BASE + 0x22C) /* MII Mgmt Write Data */
4631 +#define ETHMIIM_RDD (RC32355_ETH_BASE + 0x230) /* MII Mgmt Read Data */
4632 +#define ETHMIIM_IND (RC32355_ETH_BASE + 0x234) /* MII Mgmt Indicators */
4634 +/* for n in { 0, 1, 2 } */
4635 +#define ETH_CFSA(n) (RC32355_ETH_BASE + 0x240 + ((n) * 4)) /* Station Addr */
4639 + * Register Interpretations follow
4642 +/******************************************************************************
4643 + * ETHINTFC register
4644 + *****************************************************************************/
4646 +#define ETHERINTFC_EN (1<<0)
4647 +#define ETHERINTFC_ITS (1<<1)
4648 +#define ETHERINTFC_RES (1<<2)
4649 +#define ETHERINTFC_RIP (1<<2)
4650 +#define ETHERINTFC_JAM (1<<3)
4652 +/******************************************************************************
4653 + * ETHFIFOTT register
4654 + *****************************************************************************/
4656 +#define ETHERFIFOTT_TTH(v) (((v)&0x3f)<<0)
4658 +/******************************************************************************
4660 + *****************************************************************************/
4662 +#define ETHERARC_PRO (1<<0)
4663 +#define ETHERARC_AM (1<<1)
4664 +#define ETHERARC_AFM (1<<2)
4665 +#define ETHERARC_AB (1<<3)
4667 +/******************************************************************************
4668 + * ETHHASH registers
4669 + *****************************************************************************/
4671 +#define ETHERHASH0(v) (((v)&0xffff)<<0)
4672 +#define ETHERHASH1(v) (((v)&0xffff)<<0)
4674 +/******************************************************************************
4676 + *****************************************************************************/
4678 +#define ETHERSAL0(v) (((v)&0xffff)<<0)
4679 +#define ETHERSAL1(v) (((v)&0xffff)<<0)
4680 +#define ETHERSAL2(v) (((v)&0xffff)<<0)
4681 +#define ETHERSAL3(v) (((v)&0xffff)<<0)
4682 +#define ETHERSAH0(v) (((v)&0xff)<<0)
4683 +#define ETHERSAH1(v) (((v)&0xff)<<0)
4684 +#define ETHERSAH2(v) (((v)&0xff)<<0)
4685 +#define ETHERSAH3(v) (((v)&0xff)<<0)
4687 +/******************************************************************************
4688 + * ETHFIFOST register
4689 + *****************************************************************************/
4691 +#define ETHERFIFOST_IRTH(v) (((v)&0x3f)<<0)
4692 +#define ETHERFIFOST_ORTH(v) (((v)&0x3f)<<16)
4694 +/******************************************************************************
4695 + * ETHFIFOS register
4696 + *****************************************************************************/
4698 +#define ETHERFIFOS_IR (1<<0)
4699 +#define ETHERFIFOS_OR (1<<1)
4700 +#define ETHERFIFOS_OVR (1<<2)
4701 +#define ETHERFIFOS_UND (1<<3)
4703 +/******************************************************************************
4705 + *****************************************************************************/
4707 +#define ETHERID(v) (((v)&0xffff)<<0)
4708 +#define ETHEROD(v) (((v)&0xffff)<<0)
4710 +/******************************************************************************
4711 + * ETHODEOPS register
4712 + *****************************************************************************/
4714 +#define ETHERODEOPS_SIZE(v) (((v)&0x3)<<0)
4716 +/******************************************************************************
4717 + * ETHODEOP register
4718 + *****************************************************************************/
4720 +#define ETHERODEOP(v) (((v)&0xffff)<<0)
4722 +/******************************************************************************
4724 + *****************************************************************************/
4726 +#define ETHERIS_EOP (1<<0)
4727 +#define ETHERIS_ROK (1<<2)
4728 +#define ETHERIS_FM (1<<3)
4729 +#define ETHERIS_MP (1<<4)
4730 +#define ETHERIS_BP (1<<5)
4731 +#define ETHERIS_VLT (1<<6)
4732 +#define ETHERIS_CF (1<<7)
4733 +#define ETHERIS_OVR (1<<8)
4734 +#define ETHERIS_CRC (1<<9)
4735 +#define ETHERIS_CV (1<<10)
4736 +#define ETHERIS_DB (1<<11)
4737 +#define ETHERIS_LE (1<<12)
4738 +#define ETHERIS_LOR (1<<13)
4739 +#define ETHERIS_SIZE(v) (((v)&0x3)<<14)
4740 +#define ETHERIS_LENGTH(v) (((v)&0xff)<<16)
4742 +/******************************************************************************
4744 + *****************************************************************************/
4746 +#define ETHEROS_T (1<<0)
4747 +#define ETHEROS_TOK (1<<6)
4748 +#define ETHEROS_MP (1<<7)
4749 +#define ETHEROS_BP (1<<8)
4750 +#define ETHEROS_UND (1<<9)
4751 +#define ETHEROS_OF (1<<10)
4752 +#define ETHEROS_ED (1<<11)
4753 +#define ETHEROS_EC (1<<12)
4754 +#define ETHEROS_LC (1<<13)
4755 +#define ETHEROS_TD (1<<14)
4756 +#define ETHEROS_CRC (1<<15)
4757 +#define ETHEROS_LE (1<<16)
4758 +#define ETHEROS_CC(v) (((v)&0xf)<<17)
4759 +#define ETHEROS_PFD (1<<21)
4761 +/******************************************************************************
4762 + * Statistics registers
4763 + *****************************************************************************/
4765 +#define ETHERRBC(v) (((v)&0xffff)<<0)
4766 +#define ETHERRPC(v) (((v)&0xffff)<<0)
4767 +#define ETHERRUPC(v) (((v)&0xffff)<<0)
4768 +#define ETHERRFC(v) (((v)&0xffff)<<0)
4769 +#define ETHERTBC(v) (((v)&0xffff)<<0)
4771 +/******************************************************************************
4773 + *****************************************************************************/
4775 +#define ETHERGPF_PTV(v) (((v)&0xff)<<0)
4777 +/******************************************************************************
4779 + *****************************************************************************/
4781 +#define ETHERMAC1_RE (1<<0)
4782 +#define ETHERMAC1_PAF (1<<1)
4783 +#define ETHERMAC1_RFC (1<<2)
4784 +#define ETHERMAC1_TFC (1<<3)
4785 +#define ETHERMAC1_LB (1<<4)
4786 +#define ETHERMAC1_MR (1<<15)
4789 +#define ETHERMAC2_FD (1<<0)
4790 +#define ETHERMAC2_FLC (1<<1)
4791 +#define ETHERMAC2_HFE (1<<2)
4792 +#define ETHERMAC2_DC (1<<3)
4793 +#define ETHERMAC2_CEN (1<<4)
4794 +#define ETHERMAC2_PE (1<<5)
4795 +#define ETHERMAC2_VPE (1<<6)
4796 +#define ETHERMAC2_APE (1<<7)
4797 +#define ETHERMAC2_PPE (1<<8)
4798 +#define ETHERMAC2_LPE (1<<9)
4799 +#define ETHERMAC2_NB (1<<12)
4800 +#define ETHERMAC2_BP (1<<13)
4801 +#define ETHERMAC2_ED (1<<14)
4804 +#define ETHERIPGT(v) (((v)&0x3f)<<0)
4807 +#define ETHERIPGR_IPGR1(v) (((v)&0x3f)<<0)
4808 +#define ETHERIPGR_IPGR2(v) (((v)&0x3f)<<8)
4811 +#define ETHERCLRT_MAXRET(v) (((v)&0x3f)<<0)
4812 +#define ETHERCLRT_COLWIN(v) (((v)&0x3f)<<8)
4815 +#define ETHERMAXF(v) (((v)&0x3f)<<0)
4818 +#define ETHERMTEST_TB (1<<2)
4821 +#define ETHERMCP_DIV(v) (((v)&0xff)<<0)
4824 +#define ETHERMIIMCFG_CS(v) (((v)&0x3)<<2)
4825 +#define ETHERMIIMCFG_R (1<<15)
4828 +#define ETHERMIIMCMD_RD (1<<0)
4829 +#define ETHERMIIMCMD_SCN (1<<1)
4832 +#define ETHERMIIMADDR_REGADDR(v) (((v)&0x1f)<<0)
4833 +#define ETHERMIIMADDR_PHYADDR(v) (((v)&0x1f)<<8)
4836 +#define ETHERMIIMWTD(v) (((v)&0xff)<<0)
4839 +#define ETHERMIIMRDD(v) (((v)&0xff)<<0)
4842 +#define ETHERMIIMIND_BSY (1<<0)
4843 +#define ETHERMIIMIND_SCN (1<<1)
4844 +#define ETHERMIIMIND_NV (1<<2)
4847 +#define ETHERDMA_IN_LENGTH(v) (((v)&0xffff)<<16)
4848 +#define ETHERDMA_IN_CES (1<<14)
4849 +#define ETHERDMA_IN_LOR (1<<13)
4850 +#define ETHERDMA_IN_LE (1<<12)
4851 +#define ETHERDMA_IN_DB (1<<11)
4852 +#define ETHERDMA_IN_CV (1<<10)
4853 +#define ETHERDMA_IN_CRC (1<<9)
4854 +#define ETHERDMA_IN_OVR (1<<8)
4855 +#define ETHERDMA_IN_CF (1<<7)
4856 +#define ETHERDMA_IN_VLT (1<<6)
4857 +#define ETHERDMA_IN_BP (1<<5)
4858 +#define ETHERDMA_IN_MP (1<<4)
4859 +#define ETHERDMA_IN_FM (1<<3)
4860 +#define ETHERDMA_IN_ROK (1<<2)
4861 +#define ETHERDMA_IN_LD (1<<1)
4862 +#define ETHERDMA_IN_FD (1<<0)
4865 +#define ETHERDMA_OUT_CC(v) (((v)&0xf)<<17)
4866 +#define ETHERDMA_OUT_CNT 0x001e0000
4867 +#define ETHERDMA_OUT_SHFT 17
4868 +#define ETHERDMA_OUT_LE (1<<16)
4870 +#define ETHERDMA_OUT_CRC (1<<15)
4871 +#define ETHERDMA_OUT_TD (1<<14)
4872 +#define ETHERDMA_OUT_LC (1<<13)
4873 +#define ETHERDMA_OUT_EC (1<<12)
4874 +#define ETHERDMA_OUT_ED (1<<11)
4875 +#define ETHERDMA_OUT_OF (1<<10)
4876 +#define ETHERDMA_OUT_UND (1<<9)
4877 +#define ETHERDMA_OUT_BP (1<<8)
4878 +#define ETHERDMA_OUT_MP (1<<7)
4879 +#define ETHERDMA_OUT_TOK (1<<6)
4880 +#define ETHERDMA_OUT_HEN (1<<5)
4881 +#define ETHERDMA_OUT_CEN (1<<4)
4882 +#define ETHERDMA_OUT_PEN (1<<3)
4883 +#define ETHERDMA_OUT_OEN (1<<2)
4884 +#define ETHERDMA_OUT_LD (1<<1)
4885 +#define ETHERDMA_OUT_FD (1<<0)
4888 + (ETHERDMA_IN_OVR | ETHERDMA_IN_CRC | ETHERDMA_IN_CV | ETHERDMA_IN_LE)
4890 + (ETHERDMA_OUT_LC | ETHERDMA_OUT_EC | ETHERDMA_OUT_ED | \
4891 + ETHERDMA_OUT_OF | ETHERDMA_OUT_UND)
4893 +#define IS_RCV_ROK(X) (((X) & (1<<2)) >> 2) /* Receive Okay */
4894 +#define IS_RCV_FM(X) (((X) & (1<<3)) >> 3) /* Is Filter Match */
4895 +#define IS_RCV_MP(X) (((X) & (1<<4)) >> 4) /* Is it MP */
4896 +#define IS_RCV_BP(X) (((X) & (1<<5)) >> 5) /* Is it BP */
4897 +#define IS_RCV_VLT(X) (((X) & (1<<6)) >> 6) /* VLAN Tag Detect */
4898 +#define IS_RCV_CF(X) (((X) & (1<<7)) >> 7) /* Control Frame */
4899 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<8)) >> 8) /* Receive Overflow */
4900 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<9)) >> 9) /* CRC Error */
4901 +#define IS_RCV_CV_ERR(X) (((X) & (1<<10))>>10) /* Code Violation */
4902 +#define IS_RCV_DB_ERR(X) (((X) & (1<<11))>>11) /* Dribble Bits */
4903 +#define IS_RCV_LE_ERR(X) (((X) & (1<<12))>>12) /* Length error */
4904 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<13))>>13) /* Length Out of
4906 +#define IS_RCV_CES_ERR(X) (((X) & (1<<14))>>14) /* Preamble error */
4907 +#define RCVPKT_LENGTH(X) (((X) & 0xFFFF0000)>>16) /* Length of the
4908 + received packet */
4910 +#define IS_TX_TOK(X) (((X) & (1<<6) ) >> 6 ) /* Transmit Okay */
4911 +#define IS_TX_MP(X) (((X) & (1<<7) ) >> 7 ) /* Multicast */
4913 +#define IS_TX_BP(X) (((X) & (1<<8) ) >> 8 ) /* Broadcast */
4914 +#define IS_TX_UND_ERR(X) (((X) & (1<<9) ) >> 9 ) /* Transmit FIFO
4916 +#define IS_TX_OF_ERR(X) (((X) & (1<<10)) >>10 ) /* Oversized frame */
4917 +#define IS_TX_ED_ERR(X) (((X) & (1<<11)) >>11 ) /* Excessive
4919 +#define IS_TX_EC_ERR(X) (((X) & (1<<12)) >>12 ) /* Excessive
4921 +#define IS_TX_LC_ERR(X) (((X) & (1<<13)) >>13 ) /* Late Collision */
4922 +#define IS_TX_TD_ERR(X) (((X) & (1<<14)) >>14 ) /* Transmit deferred*/
4923 +#define IS_TX_CRC_ERR(X) (((X) & (1<<15)) >>15 ) /* CRC Error */
4924 +#define IS_TX_LE_ERR(X) (((X) & (1<<16)) >>16 ) /* Length Error */
4926 +#define TX_COLLISION_COUNT(X) (((X) & 0x001E0000u)>>17) /* Collision Count */
4928 +#endif /* RC32355_ETHER_H */
4930 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355.h
4931 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355.h 1970-01-01 01:00:00.000000000 +0100
4932 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355.h 2006-01-10 00:32:33.000000000 +0100
4934 +/**************************************************************************
4936 + * BRIEF MODULE DESCRIPTION
4937 + * Definitions for IDT RC32355 CPU.
4939 + * Copyright 2004 IDT Inc.
4940 + * Author: Integrated Device Technology Inc. rischelp@idt.com
4943 + * This program is free software; you can redistribute it and/or modify it
4944 + * under the terms of the GNU General Public License as published by the
4945 + * Free Software Foundation; either version 2 of the License, or (at your
4946 + * option) any later version.
4948 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4949 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4950 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4951 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4952 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4953 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4954 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4955 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4956 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4957 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4959 + * You should have received a copy of the GNU General Public License along
4960 + * with this program; if not, write to the Free Software Foundation, Inc.,
4961 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4967 + **************************************************************************
4971 +#ifndef _RC32355_H_
4972 +#define _RC32355_H_
4974 +#include <linux/delay.h>
4975 +#include <asm/io.h>
4977 +/* Base address of internal registers */
4978 +#define RC32355_REG_BASE 0x18000000
4980 +/* System ID Registers */
4981 +#define CPU_SYSID (RC32355_REG_BASE + 0x00018)
4982 +#define CPU_BTADDR (RC32355_REG_BASE + 0x0001c)
4983 +#define CPU_REV (RC32355_REG_BASE + 0x0002c)
4985 +/* Reset Controller */
4986 +#define RESET_CNTL (RC32355_REG_BASE + 0x08000)
4988 +/* Device Controller */
4989 +#define DEV0_BASE (RC32355_REG_BASE + 0x10000)
4990 +#define DEV0_MASK (RC32355_REG_BASE + 0x10004)
4991 +#define DEV0_CNTL (RC32355_REG_BASE + 0x10008)
4992 +#define DEV0_TIMING (RC32355_REG_BASE + 0x1000c)
4993 +#define DEV_REG_OFFSET 0x10
4995 +/* SDRAM Controller */
4996 +#define SDRAM0_BASE (RC32355_REG_BASE + 0x18000)
4997 +#define SDRAM0_MASK (RC32355_REG_BASE + 0x18004)
4998 +#define SDRAM1_BASE (RC32355_REG_BASE + 0x18008)
4999 +#define SDRAM1_MASK (RC32355_REG_BASE + 0x1800c)
5000 +#define SDRAM_CNTL (RC32355_REG_BASE + 0x18010)
5003 +#define BUS_ARB_CNTL0 (RC32355_REG_BASE + 0x20000)
5004 +#define BUS_ARB_CNTL1 (RC32355_REG_BASE + 0x20004)
5006 +/* Counters/Timers */
5007 +#define TIMER0_COUNT (RC32355_REG_BASE + 0x28000)
5008 +#define TIMER0_COMPARE (RC32355_REG_BASE + 0x28004)
5009 +#define TIMER0_CNTL (RC32355_REG_BASE + 0x28008)
5010 +#define TIMER_REG_OFFSET 0x0C
5012 +/* System Integrity */
5014 +/* Interrupt Controller */
5015 +#define IC_GROUP0_PEND (RC32355_REG_BASE + 0x30000)
5016 +#define IC_GROUP0_MASK (RC32355_REG_BASE + 0x30004)
5017 +#define IC_GROUP_OFFSET 0x08
5019 +#define NUM_INTR_GROUPS 5
5021 + * The IRQ mapping is as follows:
5024 + * --- -------------------
5025 + * 0 SW0 (IP0) SW0 intr
5026 + * 1 SW1 (IP1) SW1 intr
5027 + * - Int0 (IP2) mapped to GROUP0_IRQ_BASE
5028 + * - Int1 (IP3) mapped to GROUP1_IRQ_BASE
5029 + * - Int2 (IP4) mapped to GROUP2_IRQ_BASE
5030 + * - Int3 (IP5) mapped to GROUP3_IRQ_BASE
5031 + * - Int4 (IP6) mapped to GROUP4_IRQ_BASE
5032 + * 7 Int5 (IP7) CP0 Timer
5034 + * IRQ's 8 and up are all mapped to Int0-4 (IP2-IP6), which
5035 + * internally on the RC32355 is routed to the Expansion
5036 + * Interrupt Controller.
5038 +#define MIPS_CPU_TIMER_IRQ 7
5040 +#define GROUP0_IRQ_BASE 8 // Counter/Timers, UCW
5041 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) // DMA
5042 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) // ATM
5043 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) // TDM, Eth, USB, UARTs, I2C
5044 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32) // GPIO
5046 +#define RC32355_NR_IRQS (GROUP4_IRQ_BASE + 32)
5048 +/* DMA - see rc32355_dma.h for full list of registers */
5050 +#define RC32355_DMA_BASE (RC32355_REG_BASE + 0x38000)
5051 +#define DMA_CHAN_OFFSET 0x14
5053 +/* GPIO Controller */
5059 +#define RC32300_UART0_BASE (RC32355_REG_BASE + 0x50003)
5060 +#define RC32300_UART1_BASE (RC32355_REG_BASE + 0x50023)
5062 +#define RC32300_UART0_BASE (RC32355_REG_BASE + 0x50000)
5063 +#define RC32300_UART1_BASE (RC32355_REG_BASE + 0x50020)
5066 +#define RC32300_UART0_IRQ (GROUP3_IRQ_BASE + 14)
5067 +#define RC32300_UART1_IRQ (GROUP3_IRQ_BASE + 17)
5071 +/* Ethernet - see rc32355_eth.h for full list of registers */
5073 +#define RC32355_ETH_BASE (RC32355_REG_BASE + 0x60000)
5076 +#define IDT_CLOCK_MULT 2
5078 +/* Memory map of 79EB355 board */
5081 +#define RAM_BASE 0x00000000
5082 +#define RAM_SIZE (32*1024*1024)
5084 +/* SRAM (device 1) */
5085 +#define SRAM_BASE 0x02000000
5086 +#define SRAM_SIZE 0x00100000
5088 +/* FLASH (device 2) */
5089 +#define FLASH_BASE 0x0C000000
5090 +#define FLASH_SIZE 0x00C00000
5092 +/* ATM PHY (device 4) */
5093 +#define ATM_PHY_BASE 0x14000000
5095 +/* TDM switch (device 3) */
5096 +#define TDM_BASE 0x1A000000
5098 +/* LCD panel (device 3) */
5099 +#define LCD_BASE 0x1A002000
5101 +/* RTC (DS1511W) (device 3) */
5102 +#define RTC_BASE 0x1A004000
5104 +/* NVRAM (256 bytes internal to the DS1511 RTC) */
5105 +#define NVRAM_ADDR RTC_BASE + 0x10
5106 +#define NVRAM_DATA RTC_BASE + 0x13
5107 +#define NVRAM_ENVSIZE_OFF 4
5108 +#define NVRAM_ENVSTART_OFF 32
5110 +#endif /* _RC32355_H_ */
5111 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_dma.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_dma.h
5112 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_dma.h 1970-01-01 01:00:00.000000000 +0100
5113 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_dma.h 2006-01-10 00:32:33.000000000 +0100
5115 +/**************************************************************************
5117 + * BRIEF MODULE DESCRIPTION
5118 + * RC32365/336 DMA hardware abstraction.
5120 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5122 + * This program is free software; you can redistribute it and/or modify it
5123 + * under the terms of the GNU General Public License as published by the
5124 + * Free Software Foundation; either version 2 of the License, or (at your
5125 + * option) any later version.
5127 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5128 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5129 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5130 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5131 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5132 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5133 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5134 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5135 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5136 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5138 + * You should have received a copy of the GNU General Public License along
5139 + * with this program; if not, write to the Free Software Foundation, Inc.,
5140 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5143 + **************************************************************************
5144 + * May 2004 P. Sadik.
5150 + **************************************************************************
5153 +#ifndef __IDT_RC32365_DMA_H__
5154 +#define __IDT_RC32365_DMA_H__
5158 + DMA0_PhysicalAddress = 0x18038000,
5159 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
5161 + DMA0_VirtualAddress = 0xb8038000,
5162 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
5166 + * DMA descriptor (in physical memory).
5169 +typedef struct DMAD_s
5171 + u32 control ; // Control. use DMAD_*
5172 + u32 ca ; // Current Address.
5173 + u32 devcs ; // Device control and status.
5174 + u32 link ; // Next descriptor in chain.
5175 +} volatile *DMAD_t ;
5179 + DMAD_size = sizeof (struct DMAD_s),
5180 + DMAD_count_b = 0, // in DMAD_t -> control
5181 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
5182 + DMAD_ds_b = 20, // in DMAD_t -> control
5183 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
5184 + DMAD_ds_extToMem0_v = 0,
5185 + DMAD_ds_memToExt0_v = 1,
5186 + DMAD_ds_extToMem1_v = 0,
5187 + DMAD_ds_memToExt1_v = 1,
5188 + DMAD_ds_ethRcv0_v = 0,
5189 + DMAD_ds_ethXmt0_v = 0,
5190 + DMAD_ds_ethRcv1_v = 0,
5191 + DMAD_ds_ethXmt2_v = 0,
5192 + DMAD_ds_memToFifo_v = 0,
5193 + DMAD_ds_fifoToMem_v = 0,
5194 + DMAD_ds_rng_de_v = 1,//randomNumberGenerator on LC/DE
5195 + DMAD_ds_pciToMem_v = 0,
5196 + DMAD_ds_memToPci_v = 0,
5197 + DMAD_ds_securityInput_v = 0,
5198 + DMAD_ds_securityOutput_v = 0,
5199 + DMAD_ds_rng_se_v = 0,//randomNumberGenerator on SE
5201 + DMAD_devcmd_b = 22, // in DMAD_t -> control
5202 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
5203 + DMAD_devcmd_byte_v = 0, //memory-to-memory
5204 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
5205 + DMAD_devcmd_word_v = 2, //memory-to-memory
5206 + DMAD_devcmd_2words_v = 3, //memory-to-memory
5207 + DMAD_devcmd_4words_v = 4, //memory-to-memory
5208 + DMAD_devcmd_6words_v = 5, //memory-to-memory
5209 + DMAD_devcmd_8words_v = 6, //memory-to-memory
5210 + DMAD_devcmd_16words_v = 7, //memory-to-memory
5211 + DMAD_cof_b = 25, // chain on finished
5212 + DMAD_cof_m = 0x02000000, //
5213 + DMAD_cod_b = 26, // chain on done
5214 + DMAD_cod_m = 0x04000000, //
5215 + DMAD_iof_b = 27, // interrupt on finished
5216 + DMAD_iof_m = 0x08000000, //
5217 + DMAD_iod_b = 28, // interrupt on done
5218 + DMAD_iod_m = 0x10000000, //
5219 + DMAD_t_b = 29, // terminated
5220 + DMAD_t_m = 0x20000000, //
5221 + DMAD_d_b = 30, // done
5222 + DMAD_d_m = 0x40000000, //
5223 + DMAD_f_b = 31, // finished
5224 + DMAD_f_m = 0x80000000, //
5228 + * DMA register (within Internal Register Map).
5233 + u32 dmac ; // Control.
5234 + u32 dmas ; // Status.
5235 + u32 dmasm ; // Mask.
5236 + u32 dmadptr ; // Descriptor pointer.
5237 + u32 dmandptr ; // Next descriptor pointer.
5240 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
5242 +//DMA_Channels use DMACH_count instead
5246 + DMAC_run_b = 0, //
5247 + DMAC_run_m = 0x00000001, //
5248 + DMAC_dm_b = 1, // done mask
5249 + DMAC_dm_m = 0x00000002, //
5250 + DMAC_mode_b = 2, //
5251 + DMAC_mode_m = 0x0000000c, //
5252 + DMAC_mode_auto_v = 0,
5253 + DMAC_mode_burst_v = 1,
5254 + DMAC_mode_transfer_v = 2, //usually used
5255 + DMAC_mode_reserved_v = 3,
5257 + DMAC_a_m = 0x00000010, //
5259 + DMAS_f_b = 0, // finished (sticky)
5260 + DMAS_f_m = 0x00000001, //
5261 + DMAS_d_b = 1, // done (sticky)
5262 + DMAS_d_m = 0x00000002, //
5263 + DMAS_c_b = 2, // chain (sticky)
5264 + DMAS_c_m = 0x00000004, //
5265 + DMAS_e_b = 3, // error (sticky)
5266 + DMAS_e_m = 0x00000008, //
5267 + DMAS_h_b = 4, // halt (sticky)
5268 + DMAS_h_m = 0x00000010, //
5270 + DMASM_f_b = 0, // finished (1=mask)
5271 + DMASM_f_m = 0x00000001, //
5272 + DMASM_d_b = 1, // done (1=mask)
5273 + DMASM_d_m = 0x00000002, //
5274 + DMASM_c_b = 2, // chain (1=mask)
5275 + DMASM_c_m = 0x00000004, //
5276 + DMASM_e_b = 3, // error (1=mask)
5277 + DMASM_e_m = 0x00000008, //
5278 + DMASM_h_b = 4, // halt (1=mask)
5279 + DMASM_h_m = 0x00000010, //
5283 + * DMA channel definitions
5288 + DMACH_ethRcv0 = 0,
5289 + DMACH_ethXmt0 = 1,
5290 + DMACH_ethRcv1 = 2,
5291 + DMACH_ethXmt2 = 3,
5292 + DMACH_pciToMem = 4,
5293 + DMACH_memToPci = 5,
5294 + DMACH_securityInput = 6,
5295 + DMACH_securityOutput = 7,
5298 + DMACH_count //must be last
5302 +typedef struct DMAC_s
5304 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
5305 +} volatile *DMA_t ;
5309 + * External DMA parameters
5314 + DMADEVCMD_ts_b = 0, // ts field in devcmd
5315 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
5316 + DMADEVCMD_ts_byte_v = 0,
5317 + DMADEVCMD_ts_halfword_v = 1,
5318 + DMADEVCMD_ts_word_v = 2,
5319 + DMADEVCMD_ts_2word_v = 3,
5320 + DMADEVCMD_ts_4word_v = 4,
5321 + DMADEVCMD_ts_6word_v = 5,
5322 + DMADEVCMD_ts_8word_v = 6,
5323 + DMADEVCMD_ts_16word_v = 7
5327 +#if 1 // aws - Compatibility.
5328 +# define EXTDMA_ts_b DMADEVCMD_ts_b
5329 +# define EXTDMA_ts_m DMADEVCMD_ts_m
5330 +# define EXTDMA_ts_byte_v DMADEVCMD_ts_byte_v
5331 +# define EXTDMA_ts_halfword_v DMADEVCMD_ts_halfword_v
5332 +# define EXTDMA_ts_word_v DMADEVCMD_ts_word_v
5333 +# define EXTDMA_ts_2word_v DMADEVCMD_ts_2word_v
5334 +# define EXTDMA_ts_4word_v DMADEVCMD_ts_4word_v
5335 +# define EXTDMA_ts_6word_v DMADEVCMD_ts_6word_v
5336 +# define EXTDMA_ts_8word_v DMADEVCMD_ts_8word_v
5337 +# define EXTDMA_ts_16word_v DMADEVCMD_ts_16word_v
5338 +#endif // aws - Compatibility.
5340 +#endif // __IDT_RC32365_DMA_H__
5341 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h
5342 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h 1970-01-01 01:00:00.000000000 +0100
5343 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h 2006-01-10 00:32:33.000000000 +0100
5345 +/**************************************************************************
5347 + * BRIEF MODULE DESCRIPTION
5348 + * RC32365/336 DMA interface routines.
5350 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5352 + * This program is free software; you can redistribute it and/or modify it
5353 + * under the terms of the GNU General Public License as published by the
5354 + * Free Software Foundation; either version 2 of the License, or (at your
5355 + * option) any later version.
5357 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5358 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5359 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5360 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5361 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5362 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5363 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5364 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5365 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5366 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5368 + * You should have received a copy of the GNU General Public License along
5369 + * with this program; if not, write to the Free Software Foundation, Inc.,
5370 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5373 + **************************************************************************
5374 + * May 2004 P. Sadik.
5380 + **************************************************************************
5383 +#ifndef __IDT_RC32365_DMA_V_H__
5384 +#define __IDT_RC32365_DMA_V_H__
5387 +#include <asm/idt-boards/rc32300/rc32300.h>
5388 +#include <asm/idt-boards/rc32300/rc32365_dma.h>
5389 +#include <asm/idt-boards/rc32300/rc32365.h>
5391 +#define DMA_CHAN_OFFSET 0x14
5392 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
5393 +#define IS_DMA_FINISHED(X) (((X) & (DMAD_f_m)) != 0)
5394 +#define IS_DMA_DONE(X) (((X) & (DMAD_d_m)) != 0)
5396 +#define DMA_COUNT(count) \
5397 + ((count) & DMAD_count_m)
5399 +#define DMA_HALT_TIMEOUT 500
5401 +static inline int rc32365_halt_dma(DMA_Chan_t ch)
5404 + if (local_readl(&ch->dmac) & DMAC_run_m) {
5405 + local_writel(0, &ch->dmac);
5407 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
5408 + if (local_readl(&ch->dmas) & DMAS_h_m) {
5409 + local_writel(0, &ch->dmas);
5416 + return timeout ? 0 : 1;
5420 +static inline void rc32365_start_dma(DMA_Chan_t ch, u32 dma_addr)
5422 + local_writel(0, &ch->dmandptr);
5423 + local_writel(dma_addr, &ch->dmadptr);
5426 +static inline void rc32365_chain_dma(DMA_Chan_t ch, u32 dma_addr)
5428 + local_writel(dma_addr, &ch->dmandptr);
5430 +#endif //__IDT_RC32365_DMA_V_H__
5431 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_eth.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_eth.h
5432 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_eth.h 1970-01-01 01:00:00.000000000 +0100
5433 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_eth.h 2006-01-10 00:32:33.000000000 +0100
5435 +/**************************************************************************
5437 + * BRIEF MODULE DESCRIPTION
5438 + * RC32365/336 Ethernet hardware abstraction.
5440 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5442 + * This program is free software; you can redistribute it and/or modify it
5443 + * under the terms of the GNU General Public License as published by the
5444 + * Free Software Foundation; either version 2 of the License, or (at your
5445 + * option) any later version.
5447 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5448 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5449 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5450 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5451 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5452 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5453 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5454 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5455 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5456 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5458 + * You should have received a copy of the GNU General Public License along
5459 + * with this program; if not, write to the Free Software Foundation, Inc.,
5460 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5463 + **************************************************************************
5464 + * May 2004 P. Sadik.
5470 + **************************************************************************
5473 +#ifndef __IDT_RC32365_ETH_H__
5474 +#define __IDT_RC32365_ETH_H__
5478 + ETH0_PhysicalAddress = 0x18058000,
5479 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
5480 + ETH0_VirtualAddress = 0xb8058000,
5482 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
5484 + ETH1_PhysicalAddress = 0x18060000,
5485 + ETH1_VirtualAddress = 0xb8060000, // Default
5495 + u32 ethu0 [4] ; // Reserved.
5498 + u32 eth_u1 [10] ; // Reserved.
5500 + u32 eth_u2 [42] ; // Reserved.
5515 + u32 eth_u9 [50] ; // Reserved.
5522 + u32 eth_u10 ; // Reserved.
5530 + u32 eth_u11 ; // Reserved.
5531 + u32 eth_u12 ; // Reserved.
5539 + ETHINTFC_en_b = 0,
5540 + ETHINTFC_en_m = 0x00000001,
5541 + ETHINTFC_its_b = 1,
5542 + ETHINTFC_its_m = 0x00000002,
5543 + ETHINTFC_rip_b = 2,
5544 + ETHINTFC_rip_m = 0x00000004,
5545 + ETHINTFC_jam_b = 3,
5546 + ETHINTFC_jam_m = 0x00000008,
5547 + ETHINTFC_ovr_b = 4,
5548 + ETHINTFC_ovr_m = 0x00000010,
5549 + ETHINTFC_und_b = 5,
5550 + ETHINTFC_und_m = 0x00000020,
5552 + ETHFIFOTT_tth_b = 0,
5553 + ETHFIFOTT_tth_m = 0x0000007f,
5556 + ETHARC_pro_m = 0x00000001,
5558 + ETHARC_am_m = 0x00000002,
5560 + ETHARC_afm_m = 0x00000004,
5562 + ETHARC_ab_m = 0x00000008,
5564 + ETHSAL_byte5_b = 0,
5565 + ETHSAL_byte5_m = 0x000000ff,
5566 + ETHSAL_byte4_b = 8,
5567 + ETHSAL_byte4_m = 0x0000ff00,
5568 + ETHSAL_byte3_b = 16,
5569 + ETHSAL_byte3_m = 0x00ff0000,
5570 + ETHSAL_byte2_b = 24,
5571 + ETHSAL_byte2_m = 0xff000000,
5573 + ETHSAH_byte1_b = 0,
5574 + ETHSAH_byte1_m = 0x000000ff,
5575 + ETHSAH_byte0_b = 8,
5576 + ETHSAH_byte0_m = 0x0000ff00,
5579 + ETHGPF_ptv_m = 0x0000ffff,
5582 + ETHPFS_pfd_m = 0x00000001,
5584 + ETHCFSA0_cfsa4_b = 0,
5585 + ETHCFSA0_cfsa4_m = 0x000000ff,
5586 + ETHCFSA0_cfsa5_b = 8,
5587 + ETHCFSA0_cfsa5_m = 0x0000ff00,
5589 + ETHCFSA1_cfsa2_b = 0,
5590 + ETHCFSA1_cfsa2_m = 0x000000ff,
5591 + ETHCFSA1_cfsa3_b = 8,
5592 + ETHCFSA1_cfsa3_m = 0x0000ff00,
5594 + ETHCFSA2_cfsa0_b = 0,
5595 + ETHCFSA2_cfsa0_m = 0x000000ff,
5596 + ETHCFSA2_cfsa1_b = 8,
5597 + ETHCFSA2_cfsa1_m = 0x0000ff00,
5600 + ETHMAC1_re_m = 0x00000001,
5601 + ETHMAC1_paf_b = 1,
5602 + ETHMAC1_paf_m = 0x00000002,
5603 + ETHMAC1_rfc_b = 2,
5604 + ETHMAC1_rfc_m = 0x00000004,
5605 + ETHMAC1_tfc_b = 3,
5606 + ETHMAC1_tfc_m = 0x00000008,
5608 + ETHMAC1_lb_m = 0x00000010,
5609 + ETHMAC1_mr_b = 31,
5610 + ETHMAC1_mr_m = 0x80000000,
5613 + ETHMAC2_fd_m = 0x00000001,
5614 + ETHMAC2_flc_b = 1,
5615 + ETHMAC2_flc_m = 0x00000002,
5616 + ETHMAC2_hfe_b = 2,
5617 + ETHMAC2_hfe_m = 0x00000004,
5619 + ETHMAC2_dc_m = 0x00000008,
5620 + ETHMAC2_cen_b = 4,
5621 + ETHMAC2_cen_m = 0x00000010,
5623 + ETHMAC2_pe_m = 0x00000020,
5624 + ETHMAC2_vpe_b = 6,
5625 + ETHMAC2_vpe_m = 0x00000040,
5626 + ETHMAC2_ape_b = 7,
5627 + ETHMAC2_ape_m = 0x00000080,
5628 + ETHMAC2_ppe_b = 8,
5629 + ETHMAC2_ppe_m = 0x00000100,
5630 + ETHMAC2_lpe_b = 9,
5631 + ETHMAC2_lpe_m = 0x00000200,
5632 + ETHMAC2_nb_b = 12,
5633 + ETHMAC2_nb_m = 0x00001000,
5634 + ETHMAC2_bp_b = 13,
5635 + ETHMAC2_bp_m = 0x00002000,
5636 + ETHMAC2_ed_b = 14,
5637 + ETHMAC2_ed_m = 0x00004000,
5639 + ETHIPGT_ipgt_b = 0,
5640 + ETHIPGT_ipgt_m = 0x0000007f,
5642 + ETHIPGR_ipgr2_b = 0,
5643 + ETHIPGR_ipgr2_m = 0x0000007f,
5644 + ETHIPGR_ipgr1_b = 8,
5645 + ETHIPGR_ipgr1_m = 0x00007f00,
5647 + ETHCLRT_maxret_b = 0,
5648 + ETHCLRT_maxret_m = 0x0000000f,
5649 + ETHCLRT_colwin_b = 8,
5650 + ETHCLRT_colwin_m = 0x00003f00,
5652 + ETHMAXF_maxf_b = 0,
5653 + ETHMAXF_maxf_m = 0x0000ffff,
5655 + ETHMTEST_tb_b = 2,
5656 + ETHMTEST_tb_m = 0x00000004,
5659 + ETHMCP_div_m = 0x000000ff,
5661 + MIIMCFG_rsv_b = 0,
5662 + MIIMCFG_rsv_m = 0x0000000c,
5665 + MIIMCMD_rd_m = 0x00000001,
5666 + MIIMCMD_scn_b = 1,
5667 + MIIMCMD_scn_m = 0x00000002,
5669 + MIIMADDR_regaddr_b = 0,
5670 + MIIMADDR_regaddr_m = 0x0000001f,
5671 + MIIMADDR_phyaddr_b = 8,
5672 + MIIMADDR_phyaddr_m = 0x00001f00,
5674 + MIIMWTD_wdata_b = 0,
5675 + MIIMWTD_wdata_m = 0x0000ffff,
5677 + MIIMRDD_rdata_b = 0,
5678 + MIIMRDD_rdata_m = 0x0000ffff,
5680 + MIIMIND_bsy_b = 0,
5681 + MIIMIND_bsy_m = 0x00000001,
5682 + MIIMIND_scn_b = 1,
5683 + MIIMIND_scn_m = 0x00000002,
5685 + MIIMIND_nv_m = 0x00000004,
5690 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
5695 + ETHRX_fd_m = 0x00000001,
5697 + ETHRX_ld_m = 0x00000002,
5699 + ETHRX_rok_m = 0x00000004,
5701 + ETHRX_fm_m = 0x00000008,
5703 + ETHRX_mp_m = 0x00000010,
5705 + ETHRX_bp_m = 0x00000020,
5707 + ETHRX_vlt_m = 0x00000040,
5709 + ETHRX_cf_m = 0x00000080,
5711 + ETHRX_ovr_m = 0x00000100,
5713 + ETHRX_crc_m = 0x00000200,
5715 + ETHRX_cv_m = 0x00000400,
5717 + ETHRX_db_m = 0x00000800,
5719 + ETHRX_le_m = 0x00001000,
5721 + ETHRX_lor_m = 0x00002000,
5723 + ETHRX_ces_m = 0x00004000,
5724 + ETHRX_length_b = 16,
5725 + ETHRX_length_m = 0xffff0000,
5728 + ETHTX_fd_m = 0x00000001,
5730 + ETHTX_ld_m = 0x00000002,
5732 + ETHTX_oen_m = 0x00000004,
5734 + ETHTX_pen_m = 0x00000008,
5736 + ETHTX_cen_m = 0x00000010,
5738 + ETHTX_hen_m = 0x00000020,
5740 + ETHTX_tok_m = 0x00000040,
5742 + ETHTX_mp_m = 0x00000080,
5744 + ETHTX_bp_m = 0x00000100,
5746 + ETHTX_und_m = 0x00000200,
5748 + ETHTX_of_m = 0x00000400,
5750 + ETHTX_ed_m = 0x00000800,
5752 + ETHTX_ec_m = 0x00001000,
5754 + ETHTX_lc_m = 0x00002000,
5756 + ETHTX_td_m = 0x00004000,
5758 + ETHTX_crc_m = 0x00008000,
5760 + ETHTX_le_m = 0x00010000,
5762 + ETHTX_cc_m = 0x001E0000,
5767 + ETH0_IPABMC_PhysicalAddress = 0x18040010,
5768 + ETH0_IPABMC_VirtualAddress = 0xb8040000,
5769 + ETH1_IPABMC_PhysicalAddress = 0x18040018,
5770 + ETH1_IPABMC_VirtualAddress = 0xb8040018,
5777 +}volatile *IPABM_ETH_t;
5778 +#endif //__IDT_RC32365_ETH_H__
5779 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h
5780 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h 1970-01-01 01:00:00.000000000 +0100
5781 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h 2006-01-10 00:32:33.000000000 +0100
5783 +/**************************************************************************
5785 + * BRIEF MODULE DESCRIPTION
5786 + * RC32365/336 Ethernet status checking.
5788 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5790 + * This program is free software; you can redistribute it and/or modify it
5791 + * under the terms of the GNU General Public License as published by the
5792 + * Free Software Foundation; either version 2 of the License, or (at your
5793 + * option) any later version.
5795 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5796 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5797 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5798 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5799 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5800 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5801 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5802 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5803 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5804 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5806 + * You should have received a copy of the GNU General Public License along
5807 + * with this program; if not, write to the Free Software Foundation, Inc.,
5808 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5811 + **************************************************************************
5812 + * May 2004 P. Sadik.
5818 + **************************************************************************
5821 +#ifndef __IDT_RC32365_ETH_V_H__
5822 +#define __IDT_RC32365_ETH_V_H__
5823 +#include <asm/idt-boards/rc32300/rc32365_eth.h>
5825 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
5826 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
5827 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
5828 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
5829 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
5830 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
5831 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
5832 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
5833 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
5834 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
5835 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
5837 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
5839 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
5840 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
5841 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
5842 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
5843 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
5844 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
5845 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
5846 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
5847 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
5848 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
5849 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
5850 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
5851 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
5852 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
5854 +#endif //__IDT_RC32365_ETH_V_H__
5855 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h
5856 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h 1970-01-01 01:00:00.000000000 +0100
5857 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h 2006-01-10 00:32:33.000000000 +0100
5859 +/**************************************************************************
5861 + * BRIEF MODULE DESCRIPTION
5862 + * RC32365/336 GPIO hardware abstraction.
5864 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5866 + * This program is free software; you can redistribute it and/or modify it
5867 + * under the terms of the GNU General Public License as published by the
5868 + * Free Software Foundation; either version 2 of the License, or (at your
5869 + * option) any later version.
5871 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5872 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5873 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5874 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5875 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5876 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5877 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5878 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5879 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5880 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5882 + * You should have received a copy of the GNU General Public License along
5883 + * with this program; if not, write to the Free Software Foundation, Inc.,
5884 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5887 + **************************************************************************
5888 + * May 2004 P. Sadik.
5894 + **************************************************************************
5897 +#ifndef __IDT_RC32365_GPIO_H__
5898 +#define __IDT_RC32365_GPIO_H__
5902 + GPIO0_PhysicalAddress = 0x18048000,
5903 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
5905 + GPIO0_VirtualAddress = 0xb8048000,
5906 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
5911 + u32 gpiofunc; /* GPIO Function Register
5912 + * gpiofunc[x]==0 bit = gpio
5913 + * func[x]==1 bit = altfunc
5915 + u32 gpiocfg; /* GPIO Configuration Register
5916 + * gpiocfg[x]==0 bit = input
5917 + * gpiocfg[x]==1 bit = output
5919 + u32 gpiod; /* GPIO Data Register
5920 + * gpiod[x] read/write gpio pinX status
5922 + u32 gpioilevel; /* GPIO Interrupt Status Register
5923 + * interrupt level (see gpioistat)
5925 + u32 gpioistat; /* Gpio Interrupt Status Register
5926 + * istat[x] = (gpiod[x] == level[x])
5927 + * cleared in ISR (STICKY bits)
5929 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
5930 +} volatile * GPIO_t ;
5934 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
5935 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
5936 + GPIO_input_v = 0, // gpiocfg use pin as input.
5937 + GPIO_output_v = 1, // gpiocfg use pin as output.
5939 + GPIO_pin0_m = 0x00000001,
5941 + GPIO_pin1_m = 0x00000002,
5943 + GPIO_pin2_m = 0x00000004,
5945 + GPIO_pin3_m = 0x00000008,
5947 + GPIO_pin4_m = 0x00000010,
5949 + GPIO_pin5_m = 0x00000020,
5951 + GPIO_pin6_m = 0x00000040,
5953 + GPIO_pin7_m = 0x00000080,
5955 + GPIO_pin8_m = 0x00000100,
5957 + GPIO_pin9_m = 0x00000200,
5958 + GPIO_pin10_b = 10,
5959 + GPIO_pin10_m = 0x00000400,
5960 + GPIO_pin11_b = 11,
5961 + GPIO_pin11_m = 0x00000800,
5962 + GPIO_pin12_b = 12,
5963 + GPIO_pin12_m = 0x00001000,
5964 + GPIO_pin13_b = 13,
5965 + GPIO_pin13_m = 0x00002000,
5966 + GPIO_pin14_b = 14,
5967 + GPIO_pin14_m = 0x00004000,
5968 + GPIO_pin15_b = 15,
5969 + GPIO_pin15_m = 0x00008000,
5971 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
5973 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
5974 + GPIO_u0sout_m = GPIO_pin0_m,
5975 + GPIO_u0sout_cfg_v = GPIO_output_v,
5977 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
5978 + GPIO_u0sinp_m = GPIO_pin1_m,
5979 + GPIO_u0sinp_cfg_v = GPIO_input_v,
5981 + GPIO_maddr22_b = GPIO_pin2_b, // M&P bus bit 22.
5982 + GPIO_maddr22_m = GPIO_pin2_m,
5983 + GPIO_maddr22_cfg_v = GPIO_output_v,
5985 + GPIO_maddr23_b = GPIO_pin3_b, // M&P bus bit 23.
5986 + GPIO_maddr23_m = GPIO_pin3_m,
5987 + GPIO_maddr23_cfg_v = GPIO_output_v,
5989 + GPIO_maddr24_b = GPIO_pin4_b, // M&P bus bit 24.
5990 + GPIO_maddr24_m = GPIO_pin4_m,
5991 + GPIO_maddr24_cfg_v = GPIO_output_v,
5993 + GPIO_maddr25_b = GPIO_pin5_b, // M&P bus bit 25.
5994 + GPIO_maddr25_m = GPIO_pin5_m,
5995 + GPIO_maddr25_cfg_v = GPIO_output_v,
5997 + GPIO_rngclk_b = GPIO_pin6_b, // reserved.
5998 + GPIO_rngclk_m = GPIO_pin6_m,
5999 + GPIO_rngclk_cfg_v = GPIO_input_v,
6001 + GPIO_sdckenp_b = GPIO_pin7_b, // reserved.
6002 + GPIO_sdckenp_m = GPIO_pin7_m,
6003 + GPIO_sdckenp_cfg_v = GPIO_output_v,
6005 + GPIO_cen1_b = GPIO_pin8_b, // reserved.
6006 + GPIO_cen1_m = GPIO_pin8_m,
6007 + GPIO_cen1_cfg_v = GPIO_output_v,
6009 + GPIO_cen2_b = GPIO_pin9_b, // reserved.
6010 + GPIO_cen2_m = GPIO_pin9_m,
6011 + GPIO_cen2_cfg_v = GPIO_output_v,
6013 + GPIO_regn_b = GPIO_pin10_b, // reserved.
6014 + GPIO_regn_m = GPIO_pin10_m,
6015 + GPIO_regn_cfg_v = GPIO_output_v,
6017 + GPIO_iordn_b = GPIO_pin11_b, // reserved.
6018 + GPIO_iordn_m = GPIO_pin11_m,
6019 + GPIO_iordn_cfg_v = GPIO_output_v,
6021 + GPIO_iowrn_b = GPIO_pin12_b, // reserved.
6022 + GPIO_iowrn_m = GPIO_pin12_m,
6023 + GPIO_iowrn_cfg_v = GPIO_output_v,
6025 + GPIO_pcireqn2_b = GPIO_pin13_b, // PCI messaging int.
6026 + GPIO_pcireqn2_m = GPIO_pin13_m,
6027 + GPIO_pcireqn2_cfg_v = GPIO_input_v,
6029 + GPIO_pcigntn2_b = GPIO_pin14_b, // PCI messaging int.
6030 + GPIO_pcigntn2_m = GPIO_pin14_m,
6031 + GPIO_pcigntn2_cfg_v = GPIO_output_v,
6033 + GPIO_pcimuintn_b = GPIO_pin15_b, // PCI messaging int.
6034 + GPIO_pcimuintn_m = GPIO_pin15_m,
6035 + GPIO_pcimuintn_cfg_v= GPIO_output_v,
6039 +#endif //__IDT_RC32365_GPIO_H__
6040 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h
6041 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h 1970-01-01 01:00:00.000000000 +0100
6042 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h 2006-01-10 00:32:33.000000000 +0100
6044 +/**************************************************************************
6046 + * BRIEF MODULE DESCRIPTION
6047 + * Routines to set/clear/toggle GPIO on RC32365
6049 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6051 + * This program is free software; you can redistribute it and/or modify it
6052 + * under the terms of the GNU General Public License as published by the
6053 + * Free Software Foundation; either version 2 of the License, or (at your
6054 + * option) any later version.
6056 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6057 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6058 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6059 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6060 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6061 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6062 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6063 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6064 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6065 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6067 + * You should have received a copy of the GNU General Public License along
6068 + * with this program; if not, write to the Free Software Foundation, Inc.,
6069 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6072 + **************************************************************************
6073 + * May 2004 P. Sadik.
6079 + **************************************************************************
6081 +#ifndef __IDT_RC32365_GPIO_V_H__
6082 +#define __IDT_RC32365_GPIO_V_H__
6085 +#ifdef _LANGUAGE_ASSEMBLY
6086 +#define SET_GPIO(pin) \
6088 + ori t5,t5,0x8000 ; \
6093 +#define CLEAR_GPIO(pin) \
6095 + ori t5,t5,0x8000 ; \
6098 + ori t6,t6,0xFFFF; \
6099 + xori t6,t6,pin ; \
6103 +#define TOGGLE_GPIO(pin) \
6105 + ori t5,t5,0x8000 ; \
6107 + xori t4,t4,pin ; \
6110 +#else // !_LANGUAGE_ASSEMBLY
6111 +#include <asm/rc32300/types.h>
6112 +#include <asm/rc32300/rc32365_gpio.h>
6113 +#include <asm/rc32300/rc32365.h>
6115 +static inline void set_gpio(unsigned long pin)
6117 + idt_gpio->gpiod |= pin;
6120 +static inline void clear_gpio(unsigned long pin)
6122 + idt_gpio->gpiod &= ~pin;
6124 +static inline void toggle_gpio(unsigned long pin)
6126 + idt_gpio->gpiod ^= pin;
6128 +#define SET_GPIO(pin) set_gpio(pin)
6129 +#define CLEAR_GPIO(pin) clear_gpio(pin)
6130 +#define TOGGLE_GPIO(pin) toggle_gpio(pin)
6131 +#endif // _LANGUAGE_ASSEMBLY
6133 +#endif //__IDT_RC32365_GPIO_V_H__
6135 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365.h
6136 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365.h 1970-01-01 01:00:00.000000000 +0100
6137 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365.h 2006-01-10 00:32:33.000000000 +0100
6139 +/**************************************************************************
6141 + * BRIEF MODULE DESCRIPTION
6142 + * Definitions for IDT RC32365 CPU.
6144 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6146 + * This program is free software; you can redistribute it and/or modify it
6147 + * under the terms of the GNU General Public License as published by the
6148 + * Free Software Foundation; either version 2 of the License, or (at your
6149 + * option) any later version.
6151 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6152 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6153 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6154 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6155 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6156 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6157 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6158 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6159 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6160 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6162 + * You should have received a copy of the GNU General Public License along
6163 + * with this program; if not, write to the Free Software Foundation, Inc.,
6164 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6167 + **************************************************************************
6168 + * May 2004 P. Sadik.
6174 + **************************************************************************
6177 +#ifndef __IDT_RC32365_H__
6178 +#define __IDT_RC32365_H__
6180 +extern unsigned int cedar_za;
6182 +/* Base address of internal registers */
6183 +#define RC32365_REG_BASE 0x18000000
6185 +/* System ID Registers */
6186 +#define CPU_SYSID (RC32365_REG_BASE + 0x00018)
6187 +#define CPU_DEVTYPE (RC32365_REG_BASE + 0x0001c)
6189 +/* Reset Controller */
6190 +#define RESET_CNTL (RC32365_REG_BASE + 0x08000)
6191 +#define BOOT_VECTOR (RC32365_REG_BASE + 0x08004)
6193 +/* Device Controller */
6194 +#define DEV0_BASE (RC32365_REG_BASE + 0x10000)
6195 +#define DEV0_MASK (RC32365_REG_BASE + 0x10004)
6196 +#define DEV0_CNTL (RC32365_REG_BASE + 0x10008)
6197 +#define DEV0_TIMING (RC32365_REG_BASE + 0x1000c)
6198 +#define DEV_REG_OFFSET 0x10
6200 +/* SDRAM Controller */
6201 +#define SDRAM0_BASE (RC32365_REG_BASE + 0x18000)
6202 +#define SDRAM0_MASK (RC32365_REG_BASE + 0x18004)
6203 +#define SDRAM1_BASE (RC32365_REG_BASE + 0x18008)
6204 +#define SDRAM1_MASK (RC32365_REG_BASE + 0x1800c)
6205 +#define SDRAM_CNTL (RC32365_REG_BASE + 0x18010)
6207 +/* Counters/Timers */
6208 +#define TIMER0_COUNT (RC32365_REG_BASE + 0x20000)
6209 +#define TIMER0_COMPARE (RC32365_REG_BASE + 0x20004)
6210 +#define TIMER0_CNTL (RC32365_REG_BASE + 0x20008)
6211 +#define TIMER0_SELECT (RC32365_REG_BASE + 0x2000c)
6212 +#define TIMER_REG_OFFSET 0x10
6214 +/* System Integrity */
6216 +/* Interrupt Controller */
6217 +#define IC_GROUP0_PEND (RC32365_REG_BASE + 0x30000)
6218 +#define IC_GROUP0_TEST (RC32365_REG_BASE + 0x30004)
6219 +#define IC_GROUP0_MASK (RC32365_REG_BASE + 0x30008)
6220 +#define IC_GROUP_OFFSET 0x0c
6222 +#define NUM_INTR_GROUPS 5
6224 + * The IRQ mapping is as follows:
6227 + * --- -------------------
6228 + * 0 SW0 (IP0) SW0 intr
6229 + * 1 SW1 (IP1) SW1 intr
6230 + * - Int0 (IP2) mapped to GROUP0_IRQ_BASE
6231 + * - Int1 (IP3) mapped to GROUP1_IRQ_BASE
6232 + * - Int2 (IP4) mapped to GROUP2_IRQ_BASE
6233 + * - Int3 (IP5) mapped to GROUP3_IRQ_BASE
6234 + * - Int4 (IP6) mapped to GROUP4_IRQ_BASE
6235 + * 7 Int5 (IP7) CP0 Timer
6237 + * IRQ's 8 and up are all mapped to Int0-4 (IP2-IP6), which
6238 + * internally on the RC32365 is routed to the Expansion
6239 + * Interrupt Controller.
6241 +#define MIPS_CPU_TIMER_IRQ 7
6243 +#define GROUP0_IRQ_BASE 8 // Counter/Timers, UCW
6244 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) // DMA
6245 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) // RNG, SEC
6246 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) // Eth, PCI, UARTs
6247 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32) // GPIO
6249 +#define RC32365_NR_IRQS (GROUP4_IRQ_BASE + 32)
6251 +/* DMA - see rc32365_dma.h for full list of registers */
6253 +#define RC32365_DMA_BASE (RC32365_REG_BASE + 0x38000)
6254 +#define DMA_CHAN_OFFSET 0x14
6256 +/* GPIO Controller */
6257 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
6261 +#define RC32300_UART0_BASE (RC32365_REG_BASE + 0x50003)
6263 +#define RC32300_UART0_BASE (RC32365_REG_BASE + 0x50000)
6265 +#define RC32300_UART0_IRQ (GROUP3_IRQ_BASE + 0)
6267 +/* Ethernet - see rc32365_eth.h for full list of registers */
6269 +#define RC32365_ETH_BASE (RC32365_REG_BASE + 0x58000)
6271 +#define IDT_CLOCK_MULT 2
6273 +/* FLASH (device 1) */
6274 +#define FLASH_BASE 0x08000000
6275 +#define FLASH_SIZE 0x00800000
6277 +/* LCD 4-digit display (device 2) */
6278 +#define LCD_DIGIT0 0x0C000003
6279 +#define LCD_DIGIT1 0x0C000002
6280 +#define LCD_DIGIT2 0x0C000001
6281 +#define LCD_DIGIT3 0x0C000000
6283 +/* RTC (DS1553) (device 2) */
6284 +#define RTC_BASE 0x0c800000
6286 +#define NVRAM_BASE RTC_BASE
6287 +#define NVRAM_ENVSIZE_OFF 4
6288 +#define NVRAM_ENVSTART_OFF 32
6290 +/* Interrupts routed on 79EB365 board */
6291 +#define RC32365_PCI_INTA_IRQ (GROUP4_IRQ_BASE + 8)
6292 +#define RC32365_PCI_INTB_IRQ (GROUP4_IRQ_BASE + 9)
6293 +#define RC32365_PCI_INTC_IRQ (GROUP4_IRQ_BASE + 10)
6294 +#define RC32365_PCI_INTD_IRQ (GROUP4_IRQ_BASE + 11)
6296 +#define RAM_SIZE (32 * 1024 * 1024)
6298 +#endif //__IDT_RC32365_H__
6299 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_pci.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_pci.h
6300 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_pci.h 1970-01-01 01:00:00.000000000 +0100
6301 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_pci.h 2006-01-10 00:32:33.000000000 +0100
6303 +/**************************************************************************
6305 + * BRIEF MODULE DESCRIPTION
6306 + * Datatype declaration for IDT 79EB365/336 PCI
6308 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6310 + * This program is free software; you can redistribute it and/or modify it
6311 + * under the terms of the GNU General Public License as published by the
6312 + * Free Software Foundation; either version 2 of the License, or (at your
6313 + * option) any later version.
6315 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6316 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6317 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6318 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6319 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6320 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6321 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6322 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6323 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6324 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6326 + * You should have received a copy of the GNU General Public License along
6327 + * with this program; if not, write to the Free Software Foundation, Inc.,
6328 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6331 + **************************************************************************
6332 + * May 2004 P. Sadik.
6338 + **************************************************************************
6341 +#ifndef __IDT_RC32365_PCI_H__
6342 +#define __IDT_RC32365_PCI_H__
6346 + PCI0_PhysicalAddress = 0x18068000,
6347 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
6349 + PCI0_VirtualAddress = 0xb8068000,
6350 + PCI_VirtualAddress = PCI0_VirtualAddress,
6355 + PCI_LbaCount = 4, // Local base addresses.
6360 + u32 a ; // Address.
6361 + u32 c ; // Control.
6362 + u32 m ; // mapping.
6372 + PCI_Map_s pcilba [PCI_LbaCount] ;
6380 +} volatile *PCI_t ;
6382 +// PCI messaging unit.
6389 + u32 pciim [PCIM_Count] ;
6390 + u32 pciom [PCIM_Count] ;
6397 +} volatile *PCIM_t ;
6399 +/*******************************************************************************
6401 + * PCI Control Register
6403 + ******************************************************************************/
6407 + PCIC_en_m = 0x00000001,
6409 + PCIC_tnr_m = 0x00000002,
6411 + PCIC_sce_m = 0x00000004,
6413 + PCIC_ien_m = 0x00000008,
6415 + PCIC_aaa_m = 0x00000010,
6417 + PCIC_eap_m = 0x00000020,
6419 + PCIC_pcim_m = 0x000001c0,
6420 + PCIC_pcim_disabled_v = 0,
6421 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
6422 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
6423 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
6424 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
6425 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
6426 + PCIC_pcim_reserved6_v = 6,
6427 + PCIC_pcim_reserved7_v = 7,
6429 + PCIC_igm_m = 0x00000200,
6432 +/*******************************************************************************
6434 + * PCI Status Register
6436 + ******************************************************************************/
6439 + PCIS_eed_m = 0x00000001,
6441 + PCIS_wr_m = 0x00000002,
6443 + PCIS_nmi_m = 0x00000004,
6445 + PCIS_ii_m = 0x00000008,
6447 + PCIS_cwe_m = 0x00000010,
6449 + PCIS_cre_m = 0x00000020,
6451 + PCIS_mdpe_m = 0x00000040,
6453 + PCIS_sta_m = 0x00000080,
6455 + PCIS_rta_m = 0x00000100,
6457 + PCIS_rma_m = 0x00000200,
6459 + PCIS_sse_m = 0x00000400,
6461 + PCIS_ose_m = 0x00000800,
6463 + PCIS_pe_m = 0x00001000,
6465 + PCIS_tae_m = 0x00002000,
6467 + PCIS_rle_m = 0x00004000,
6469 + PCIS_bme_m = 0x00008000,
6471 + PCIS_prd_m = 0x00010000,
6473 + PCIS_rip_m = 0x00020000,
6476 +/*******************************************************************************
6478 + * PCI Status Mask Register
6480 + ******************************************************************************/
6483 + PCISM_eed_m = 0x00000001,
6485 + PCISM_wr_m = 0x00000002,
6487 + PCISM_nmi_m = 0x00000004,
6489 + PCISM_ii_m = 0x00000008,
6491 + PCISM_cwe_m = 0x00000010,
6493 + PCISM_cre_m = 0x00000020,
6495 + PCISM_mdpe_m = 0x00000040,
6497 + PCISM_sta_m = 0x00000080,
6499 + PCISM_rta_m = 0x00000100,
6501 + PCISM_rma_m = 0x00000200,
6503 + PCISM_sse_m = 0x00000400,
6505 + PCISM_ose_m = 0x00000800,
6507 + PCISM_pe_m = 0x00001000,
6509 + PCISM_tae_m = 0x00002000,
6511 + PCISM_rle_m = 0x00004000,
6513 + PCISM_bme_m = 0x00008000,
6515 + PCISM_prd_m = 0x00010000,
6517 + PCISM_rip_m = 0x00020000,
6520 +/*******************************************************************************
6522 + * PCI Configuration Address Register
6524 + ******************************************************************************/
6526 + PCICFGA_reg_b = 2,
6527 + PCICFGA_reg_m = 0x000000fc,
6528 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
6529 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
6530 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
6531 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
6532 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
6533 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
6534 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
6535 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
6536 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
6537 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
6538 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
6539 + PCICFGA_reg_pba0m_v = 0x48>>2,
6540 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
6541 + PCICFGA_reg_pba1m_v = 0x50>>2,
6542 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
6543 + PCICFGA_reg_pba2m_v = 0x58>>2,
6544 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
6545 + PCICFGA_reg_pba3m_v = 0x60>>2,
6546 + PCICFGA_reg_pmgt_v = 0x64>>2,
6547 + PCICFGA_func_b = 8,
6548 + PCICFGA_func_m = 0x00000700,
6549 + PCICFGA_dev_b = 11,
6550 + PCICFGA_dev_m = 0x0000f800,
6551 + PCICFGA_dev_internal_v = 0,
6552 + PCICFGA_bus_b = 16,
6553 + PCICFGA_bus_m = 0x00ff0000,
6554 + PCICFGA_bus_type0_v = 0, //local bus
6555 + PCICFGA_en_b = 31, // read only
6556 + PCICFGA_en_m = 0x80000000,
6560 + PCFGID_vendor_b = 0,
6561 + PCFGID_vendor_m = 0x0000ffff,
6562 + PCFGID_vendor_IDT_v = 0x111d,
6563 + PCFGID_device_b = 16,
6564 + PCFGID_device_m = 0xffff0000,
6565 + PCFGID_device_Acaciade_v = 0x0207,
6567 + PCFG04_command_ioena_b = 1,
6568 + PCFG04_command_ioena_m = 0x00000001,
6569 + PCFG04_command_memena_b = 2,
6570 + PCFG04_command_memena_m = 0x00000002,
6571 + PCFG04_command_bmena_b = 3,
6572 + PCFG04_command_bmena_m = 0x00000004,
6573 + PCFG04_command_mwinv_b = 5,
6574 + PCFG04_command_mwinv_m = 0x00000010,
6575 + PCFG04_command_parena_b = 7,
6576 + PCFG04_command_parena_m = 0x00000040,
6577 + PCFG04_command_serrena_b = 9,
6578 + PCFG04_command_serrena_m = 0x00000100,
6579 + PCFG04_command_fastbbena_b = 10,
6580 + PCFG04_command_fastbbena_m = 0x00000200,
6581 + PCFG04_status_b = 16,
6582 + PCFG04_status_m = 0xffff0000,
6583 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
6584 + PCFG04_status_66MHz_m = 0x00200000,
6585 + PCFG04_status_fbb_b = 23,
6586 + PCFG04_status_fbb_m = 0x00800000,
6587 + PCFG04_status_mdpe_b = 24,
6588 + PCFG04_status_mdpe_m = 0x01000000,
6589 + PCFG04_status_dst_b = 25,
6590 + PCFG04_status_dst_m = 0x06000000,
6591 + PCFG04_status_sta_b = 27,
6592 + PCFG04_status_sta_m = 0x08000000,
6593 + PCFG04_status_rta_b = 28,
6594 + PCFG04_status_rta_m = 0x10000000,
6595 + PCFG04_status_rma_b = 29,
6596 + PCFG04_status_rma_m = 0x20000000,
6597 + PCFG04_status_sse_b = 30,
6598 + PCFG04_status_sse_m = 0x40000000,
6599 + PCFG04_status_pe_b = 31,
6600 + PCFG04_status_pe_m = 0x40000000,
6602 + PCFG08_revId_b = 0,
6603 + PCFG08_revId_m = 0x000000ff,
6604 + PCFG08_classCode_b = 0,
6605 + PCFG08_classCode_m = 0xffffff00,
6606 + PCFG08_classCode_bridge_v = 06,
6607 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
6608 + PCFG0C_cacheline_b = 0,
6609 + PCFG0C_cacheline_m = 0x000000ff,
6610 + PCFG0C_masterLatency_b = 8,
6611 + PCFG0C_masterLatency_m = 0x0000ff00,
6612 + PCFG0C_headerType_b = 16,
6613 + PCFG0C_headerType_m = 0x00ff0000,
6614 + PCFG0C_bist_b = 24,
6615 + PCFG0C_bist_m = 0xff000000,
6618 + PCIPBA_msi_m = 0x00000001,
6620 + PCIPBA_p_m = 0x00000004,
6621 + PCIPBA_baddr_b = 8,
6622 + PCIPBA_baddr_m = 0xffffff00,
6624 + PCFGSS_vendorId_b = 0,
6625 + PCFGSS_vendorId_m = 0x0000ffff,
6627 + PCFGSS_id_m = 0xffff0000,
6629 + PCFG3C_interruptLine_b = 0,
6630 + PCFG3C_interruptLine_m = 0x000000ff,
6631 + PCFG3C_interruptPin_b = 8,
6632 + PCFG3C_interruptPin_m = 0x0000ff00,
6633 + PCFG3C_minGrant_b = 16,
6634 + PCFG3C_minGrant_m = 0x00ff0000,
6635 + PCFG3C_maxLat_b = 24,
6636 + PCFG3C_maxLat_m = 0xff000000,
6638 + PCIPBAC_msi_b = 0,
6639 + PCIPBAC_msi_m = 0x00000001,
6641 + PCIPBAC_p_m = 0x00000002,
6642 + PCIPBAC_size_b = 2,
6643 + PCIPBAC_size_m = 0x0000007c,
6645 + PCIPBAC_sb_m = 0x00000080,
6647 + PCIPBAC_pp_m = 0x00000100,
6649 + PCIPBAC_mr_m = 0x00000600,
6650 + PCIPBAC_mr_read_v =0, //no prefetching
6651 + PCIPBAC_mr_readLine_v =1,
6652 + PCIPBAC_mr_readMult_v =2,
6653 + PCIPBAC_mrl_b = 11,
6654 + PCIPBAC_mrl_m = 0x00000800,
6655 + PCIPBAC_mrm_b = 12,
6656 + PCIPBAC_mrm_m = 0x00001000,
6657 + PCIPBAC_trp_b = 13,
6658 + PCIPBAC_trp_m = 0x00002000,
6660 + PCFG40_trdyTimeout_b = 0,
6661 + PCFG40_trdyTimeout_m = 0x000000ff,
6662 + PCFG40_retryLim_b = 8,
6663 + PCFG40_retryLim_m = 0x0000ff00,
6666 +/*******************************************************************************
6668 + * PCI Local Base Address [0|1|2|3] Register
6670 + ******************************************************************************/
6672 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
6673 + PCILBA_baddr_m = 0xffffff00,
6675 +/*******************************************************************************
6677 + * PCI Local Base Address Control Register
6679 + ******************************************************************************/
6681 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
6682 + PCILBAC_msi_m = 0x00000001,
6683 + PCILBAC_msi_mem_v = 0,
6684 + PCILBAC_msi_io_v = 1,
6685 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
6686 + PCILBAC_size_m = 0x0000007c,
6687 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
6688 + PCILBAC_sb_m = 0x00000080,
6689 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
6690 + PCILBAC_rt_m = 0x00000100,
6691 + PCILBAC_rt_noprefetch_v = 0, // mem read
6692 + PCILBAC_rt_prefetch_v = 1, // mem readline
6695 +/*******************************************************************************
6697 + * PCI Local Base Address [0|1|2|3] Mapping Register
6699 + ******************************************************************************/
6701 + PCILBAM_maddr_b = 8,
6702 + PCILBAM_maddr_m = 0xffffff00,
6705 +/*******************************************************************************
6707 + * PCI Decoupled Access Control Register
6709 + ******************************************************************************/
6712 + PCIDAC_den_m = 0x00000001,
6715 +/*******************************************************************************
6717 + * PCI Decoupled Access Status Register
6719 + ******************************************************************************/
6722 + PCIDAS_d_m = 0x00000001,
6724 + PCIDAS_b_m = 0x00000002,
6726 + PCIDAS_e_m = 0x00000004,
6728 + PCIDAS_ofe_m = 0x00000008,
6730 + PCIDAS_off_m = 0x00000010,
6732 + PCIDAS_ife_m = 0x00000020,
6734 + PCIDAS_iff_m = 0x00000040,
6737 +/*******************************************************************************
6739 + * PCI DMA Channel 8 Configuration Register
6741 + ******************************************************************************/
6744 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
6745 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
6746 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
6747 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
6750 +/*******************************************************************************
6752 + * PCI DMA Channel 9 Configuration Register
6754 + ******************************************************************************/
6757 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
6758 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
6761 +/*******************************************************************************
6763 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
6765 + ******************************************************************************/
6767 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
6768 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
6769 + // These are for reads (DMA channel 8)
6770 + PCIDMAD_devcmd_mr_v = 0, //memory read
6771 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
6772 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
6773 + PCIDMAD_devcmd_ior_v = 3, //I/O read
6774 + // These are for writes (DMA channel 9)
6775 + PCIDMAD_devcmd_mw_v = 0, //memory write
6776 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
6777 + PCIDMAD_devcmd_iow_v = 3, //I/O write
6779 + // Swap byte field applies to both DMA channel 8 and 9
6780 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
6781 + PCIDMAD_sb_m = 0x01000000, // swap byte field
6785 +/*******************************************************************************
6787 + * PCI Target Control Register
6789 + ******************************************************************************/
6792 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
6793 + PCITC_rtimer_m = 0x000000ff,
6794 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
6795 + PCITC_dtimer_m = 0x0000ff00,
6796 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
6797 + PCITC_rdr_m = 0x00040000,
6798 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
6799 + PCITC_ddt_m = 0x00080000,
6801 +/*******************************************************************************
6803 + * PCI messaging unit [applies to both inbound and outbound registers ]
6805 + ******************************************************************************/
6808 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
6809 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
6810 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
6811 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
6812 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
6813 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
6817 +#endif // __IDT_RC32365_PCI_H__
6818 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h
6819 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h 1970-01-01 01:00:00.000000000 +0100
6820 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h 2006-01-10 00:32:33.000000000 +0100
6822 +/**************************************************************************
6824 + * BRIEF MODULE DESCRIPTION
6825 + * PCI header values for IDT 79EB365/336
6827 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6829 + * This program is free software; you can redistribute it and/or modify it
6830 + * under the terms of the GNU General Public License as published by the
6831 + * Free Software Foundation; either version 2 of the License, or (at your
6832 + * option) any later version.
6834 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6835 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6836 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6837 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6838 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6839 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6840 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6841 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6842 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6843 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6845 + * You should have received a copy of the GNU General Public License along
6846 + * with this program; if not, write to the Free Software Foundation, Inc.,
6847 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6850 + **************************************************************************
6851 + * May 2004 P. Sadik.
6857 + **************************************************************************
6860 +#ifndef __IDT_RC32365_PCI_V_H__
6861 +#define __IDT_RC32365_PCI_V_H__
6864 +#define PCI_MSG_VirtualAddress 0xB806C010
6865 +#define rc32365_pci ((volatile PCI_t) PCI0_VirtualAddress)
6866 +#define rc32365_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
6868 +#define PCIM_SHFT 0x6
6869 +#define PCIM_BIT_LEN 0x7
6870 +#define PCIM_H_EA 0x3
6871 +#define PCIM_H_IA_FIX 0x4
6872 +#define PCIM_H_IA_RR 0x5
6874 +#define PCI_ADDR_START 0x50000000
6876 +#define CPUTOPCI_MEM_WIN 0x02000000
6877 +#define CPUTOPCI_IO_WIN 0x00100000
6878 +#define PCILBA_SIZE_SHFT 2
6879 +#define PCILBA_SIZE_MASK 0x1F
6880 +#define SIZE_256MB 0x1C
6881 +#define SIZE_128MB 0x1B
6882 +#define SIZE_64MB 0x1A
6883 +#define SIZE_32MB 0x19
6884 +#define SIZE_16MB 0x18
6885 +#define SIZE_4MB 0x16
6886 +#define SIZE_2MB 0x15
6887 +#define SIZE_1MB 0x14
6888 +#define CEDAR_CONFIG0_ADDR 0x80000000
6889 +#define CEDAR_CONFIG1_ADDR 0x80000004
6890 +#define CEDAR_CONFIG2_ADDR 0x80000008
6891 +#define CEDAR_CONFIG3_ADDR 0x8000000C
6892 +#define CEDAR_CONFIG4_ADDR 0x80000010
6893 +#define CEDAR_CONFIG5_ADDR 0x80000014
6894 +#define CEDAR_CONFIG6_ADDR 0x80000018
6895 +#define CEDAR_CONFIG7_ADDR 0x8000001C
6896 +#define CEDAR_CONFIG8_ADDR 0x80000020
6897 +#define CEDAR_CONFIG9_ADDR 0x80000024
6898 +#define CEDAR_CONFIG10_ADDR 0x80000028
6899 +#define CEDAR_CONFIG11_ADDR 0x8000002C
6900 +#define CEDAR_CONFIG12_ADDR 0x80000030
6901 +#define CEDAR_CONFIG13_ADDR 0x80000034
6902 +#define CEDAR_CONFIG14_ADDR 0x80000038
6903 +#define CEDAR_CONFIG15_ADDR 0x8000003C
6904 +#define CEDAR_CONFIG16_ADDR 0x80000040
6905 +#define CEDAR_CONFIG17_ADDR 0x80000044
6906 +#define CEDAR_CONFIG18_ADDR 0x80000048
6907 +#define CEDAR_CONFIG19_ADDR 0x8000004C
6908 +#define CEDAR_CONFIG20_ADDR 0x80000050
6909 +#define CEDAR_CONFIG21_ADDR 0x80000054
6910 +#define CEDAR_CONFIG22_ADDR 0x80000058
6911 +#define CEDAR_CONFIG23_ADDR 0x8000005C
6912 +#define CEDAR_CONFIG24_ADDR 0x80000060
6913 +#define CEDAR_CONFIG25_ADDR 0x80000064
6914 +#define CEDAR_CMD (PCFG04_command_ioena_m | \
6915 + PCFG04_command_memena_m | \
6916 + PCFG04_command_bmena_m | \
6917 + PCFG04_command_mwinv_m | \
6918 + PCFG04_command_parena_m | \
6919 + PCFG04_command_serrena_m )
6921 +#define CEDAR_STAT (PCFG04_status_mdpe_m | \
6922 + PCFG04_status_sta_m | \
6923 + PCFG04_status_rta_m | \
6924 + PCFG04_status_rma_m | \
6925 + PCFG04_status_sse_m | \
6926 + PCFG04_status_pe_m)
6928 +#define CEDAR_CNFG1 ((CEDAR_STAT << 16) | \
6931 +#define CEDAR_REVID 0
6932 +#define CEDAR_CLASS_CODE 0
6933 +#define CEDAR_CNFG2 ((CEDAR_CLASS_CODE << 8) | \
6936 +#define CEDAR_CACHE_LINE_SIZE 4
6937 +#define CEDAR_MASTER_LAT 0x3c
6938 +#define CEDAR_HEADER_TYPE 0
6939 +#define CEDAR_BIST 0
6941 +#define CEDAR_CNFG3 ((CEDAR_BIST << 24) | \
6942 + (CEDAR_HEADER_TYPE << 16) | \
6943 + (CEDAR_MASTER_LAT << 8) | \
6944 + CEDAR_CACHE_LINE_SIZE)
6946 +#define CEDAR_BAR0 0x00000008 /* 128 MB Memory */
6947 +#define CEDAR_BAR1 0x18800001 /* 1 MB IO */
6948 +#define CEDAR_BAR2 0x18000001 /* 2 MB IO window for Cedar
6949 + internal Registers */
6950 +#define CEDAR_BAR3 0x48000008 /* Spare 128 MB Memory */
6952 +#define CEDAR_CNFG4 CEDAR_BAR0
6953 +#define CEDAR_CNFG5 CEDAR_BAR1
6954 +#define CEDAR_CNFG6 CEDAR_BAR2
6955 +#define CEDAR_CNFG7 CEDAR_BAR3
6957 +#define CEDAR_SUBSYS_VENDOR_ID 0
6958 +#define CEDAR_SUBSYSTEM_ID 0
6959 +#define CEDAR_CNFG8 0
6960 +#define CEDAR_CNFG9 0
6961 +#define CEDAR_CNFG10 0
6962 +#define CEDAR_CNFG11 ((CEDAR_SUBSYS_VENDOR_ID << 16) | \
6963 + CEDAR_SUBSYSTEM_ID)
6964 +#define CEDAR_INT_LINE 1
6965 +#define CEDAR_INT_PIN 1
6966 +#define CEDAR_MIN_GNT 8
6967 +#define CEDAR_MAX_LAT 0x38
6968 +#define CEDAR_CNFG12 0
6969 +#define CEDAR_CNFG13 0
6970 +#define CEDAR_CNFG14 0
6971 +#define CEDAR_CNFG15 ((CEDAR_MAX_LAT << 24) | \
6972 + (CEDAR_MIN_GNT << 16) | \
6973 + (CEDAR_INT_PIN << 8) | \
6975 +#define CEDAR_RETRY_LIMIT 0x80
6976 +#define CEDAR_TRDY_LIMIT 0x80
6977 +#define CEDAR_CNFG16 ((CEDAR_RETRY_LIMIT << 8) | \
6979 +#define PCI_PBAxC_R 0x0
6980 +#define PCI_PBAxC_RL 0x1
6981 +#define PCI_PBAxC_RM 0x2
6982 +#define SIZE_SHFT 2
6984 +#define CEDAR_PBA0C (((1 & 0x3) << PCIPBAC_mr_b) | \
6987 + (SIZE_128MB << SIZE_SHFT) | \
6991 +#define CEDAR_PBA0C (((1 & 0x3) << PCIPBAC_mr_b) | \
6993 + (SIZE_128MB << SIZE_SHFT) | \
6996 +#define CEDAR_CNFG17 CEDAR_PBA0C
6997 +#define CEDAR_PBA0M 0x0
6998 +#define CEDAR_CNFG18 CEDAR_PBA0M
7001 +#define CEDAR_PBA1C ((SIZE_1MB << SIZE_SHFT) | \
7005 +#define CEDAR_PBA1C ((SIZE_1MB << SIZE_SHFT) | \
7008 +#define CEDAR_CNFG19 CEDAR_PBA1C
7009 +#define CEDAR_PBA1M 0x0
7010 +#define CEDAR_CNFG20 CEDAR_PBA1M
7013 +#define CEDAR_PBA2C ((SIZE_2MB << SIZE_SHFT) | \
7017 +#define CEDAR_PBA2C ((SIZE_2MB << SIZE_SHFT) | \
7021 +#define CEDAR_CNFG21 CEDAR_PBA2C
7022 +#define CEDAR_PBA2M 0x18000000
7023 +#define CEDAR_CNFG22 CEDAR_PBA2M
7026 +#define CEDAR_PBA3C PCIPBAC_sb_m
7028 +#define CEDAR_PBA3C 0
7031 +#define CEDAR_CNFG23 CEDAR_PBA3C
7032 +#define CEDAR_PBA3M 0
7033 +#define CEDAR_CNFG24 CEDAR_PBA3M
7035 +#define PCITC_DTIMER_VAL 8
7036 +#define PCITC_RTIMER_VAL 0x10
7038 +#endif //__IDT_RC32365_PCI_V_H__
7039 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_dma.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_dma.h
7040 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_dma.h 1970-01-01 01:00:00.000000000 +0100
7041 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_dma.h 2006-01-10 00:32:33.000000000 +0100
7043 +/**************************************************************************
7045 + * BRIEF MODULE DESCRIPTION
7046 + * DMA register definition
7048 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7050 + * This program is free software; you can redistribute it and/or modify it
7051 + * under the terms of the GNU General Public License as published by the
7052 + * Free Software Foundation; either version 2 of the License, or (at your
7053 + * option) any later version.
7055 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7056 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7057 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7058 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7059 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7060 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7061 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7062 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7063 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7064 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7066 + * You should have received a copy of the GNU General Public License along
7067 + * with this program; if not, write to the Free Software Foundation, Inc.,
7068 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7071 + **************************************************************************
7072 + * May 2004 rkt, neb
7078 + **************************************************************************
7081 +#ifndef __IDT_DMA_H__
7082 +#define __IDT_DMA_H__
7086 + DMA0_PhysicalAddress = 0x18040000,
7087 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
7089 + DMA0_VirtualAddress = 0xb8040000,
7090 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
7094 + * DMA descriptor (in physical memory).
7097 +typedef struct DMAD_s
7099 + u32 control ; // Control. use DMAD_*
7100 + u32 ca ; // Current Address.
7101 + u32 devcs ; // Device control and status.
7102 + u32 link ; // Next descriptor in chain.
7103 +} volatile *DMAD_t ;
7107 + DMAD_size = sizeof (struct DMAD_s),
7108 + DMAD_count_b = 0, // in DMAD_t -> control
7109 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
7110 + DMAD_ds_b = 20, // in DMAD_t -> control
7111 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
7112 + DMAD_ds_ethRcv0_v = 0,
7113 + DMAD_ds_ethXmt0_v = 0,
7114 + DMAD_ds_memToFifo_v = 0,
7115 + DMAD_ds_fifoToMem_v = 0,
7116 + DMAD_ds_pciToMem_v = 0,
7117 + DMAD_ds_memToPci_v = 0,
7119 + DMAD_devcmd_b = 22, // in DMAD_t -> control
7120 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
7121 + DMAD_devcmd_byte_v = 0, //memory-to-memory
7122 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
7123 + DMAD_devcmd_word_v = 2, //memory-to-memory
7124 + DMAD_devcmd_2words_v = 3, //memory-to-memory
7125 + DMAD_devcmd_4words_v = 4, //memory-to-memory
7126 + DMAD_devcmd_6words_v = 5, //memory-to-memory
7127 + DMAD_devcmd_8words_v = 6, //memory-to-memory
7128 + DMAD_devcmd_16words_v = 7, //memory-to-memory
7129 + DMAD_cof_b = 25, // chain on finished
7130 + DMAD_cof_m = 0x02000000, //
7131 + DMAD_cod_b = 26, // chain on done
7132 + DMAD_cod_m = 0x04000000, //
7133 + DMAD_iof_b = 27, // interrupt on finished
7134 + DMAD_iof_m = 0x08000000, //
7135 + DMAD_iod_b = 28, // interrupt on done
7136 + DMAD_iod_m = 0x10000000, //
7137 + DMAD_t_b = 29, // terminated
7138 + DMAD_t_m = 0x20000000, //
7139 + DMAD_d_b = 30, // done
7140 + DMAD_d_m = 0x40000000, //
7141 + DMAD_f_b = 31, // finished
7142 + DMAD_f_m = 0x80000000, //
7146 + * DMA register (within Internal Register Map).
7151 + u32 dmac ; // Control.
7152 + u32 dmas ; // Status.
7153 + u32 dmasm ; // Mask.
7154 + u32 dmadptr ; // Descriptor pointer.
7155 + u32 dmandptr ; // Next descriptor pointer.
7158 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
7160 +//DMA_Channels use DMACH_count instead
7164 + DMAC_run_b = 0, //
7165 + DMAC_run_m = 0x00000001, //
7166 + DMAC_dm_b = 1, // done mask
7167 + DMAC_dm_m = 0x00000002, //
7168 + DMAC_mode_b = 2, //
7169 + DMAC_mode_m = 0x0000000c, //
7170 + DMAC_mode_auto_v = 0,
7171 + DMAC_mode_burst_v = 1,
7172 + DMAC_mode_transfer_v = 2, //usually used
7173 + DMAC_mode_reserved_v = 3,
7175 + DMAC_a_m = 0x00000010, //
7177 + DMAS_f_b = 0, // finished (sticky)
7178 + DMAS_f_m = 0x00000001, //
7179 + DMAS_d_b = 1, // done (sticky)
7180 + DMAS_d_m = 0x00000002, //
7181 + DMAS_c_b = 2, // chain (sticky)
7182 + DMAS_c_m = 0x00000004, //
7183 + DMAS_e_b = 3, // error (sticky)
7184 + DMAS_e_m = 0x00000008, //
7185 + DMAS_h_b = 4, // halt (sticky)
7186 + DMAS_h_m = 0x00000010, //
7188 + DMASM_f_b = 0, // finished (1=mask)
7189 + DMASM_f_m = 0x00000001, //
7190 + DMASM_d_b = 1, // done (1=mask)
7191 + DMASM_d_m = 0x00000002, //
7192 + DMASM_c_b = 2, // chain (1=mask)
7193 + DMASM_c_m = 0x00000004, //
7194 + DMASM_e_b = 3, // error (1=mask)
7195 + DMASM_e_m = 0x00000008, //
7196 + DMASM_h_b = 4, // halt (1=mask)
7197 + DMASM_h_m = 0x00000010, //
7201 + * DMA channel definitions
7206 + DMACH_ethRcv0 = 0,
7207 + DMACH_ethXmt0 = 1,
7208 + DMACH_memToFifo = 2,
7209 + DMACH_fifoToMem = 3,
7210 + DMACH_pciToMem = 4,
7211 + DMACH_memToPci = 5,
7213 + DMACH_count //must be last
7217 +typedef struct DMAC_s
7219 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
7220 +} volatile *DMA_t ;
7224 + * External DMA parameters
7229 + DMADEVCMD_ts_b = 0, // ts field in devcmd
7230 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
7231 + DMADEVCMD_ts_byte_v = 0,
7232 + DMADEVCMD_ts_halfword_v = 1,
7233 + DMADEVCMD_ts_word_v = 2,
7234 + DMADEVCMD_ts_2word_v = 3,
7235 + DMADEVCMD_ts_4word_v = 4,
7236 + DMADEVCMD_ts_6word_v = 5,
7237 + DMADEVCMD_ts_8word_v = 6,
7238 + DMADEVCMD_ts_16word_v = 7
7242 +#endif // __IDT_DMA_H__
7248 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h
7249 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h 1970-01-01 01:00:00.000000000 +0100
7250 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h 2006-01-10 00:32:33.000000000 +0100
7252 +/**************************************************************************
7254 + * BRIEF MODULE DESCRIPTION
7255 + * Definitions for DMA controller.
7257 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7259 + * This program is free software; you can redistribute it and/or modify it
7260 + * under the terms of the GNU General Public License as published by the
7261 + * Free Software Foundation; either version 2 of the License, or (at your
7262 + * option) any later version.
7264 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7265 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7266 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7267 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7268 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7269 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7270 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7271 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7272 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7273 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7275 + * You should have received a copy of the GNU General Public License along
7276 + * with this program; if not, write to the Free Software Foundation, Inc.,
7277 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7280 + **************************************************************************
7281 + * May 2004 rkt, neb.
7287 + **************************************************************************
7290 +#ifndef __IDT_DMA_V_H__
7291 +#define __IDT_DMA_V_H__
7293 +#include <asm/idt-boards/rc32434/rc32434_dma.h>
7294 +#include <asm/idt-boards/rc32434/rc32434.h>
7296 +#define DMA_CHAN_OFFSET 0x14
7297 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
7298 +#define DMA_COUNT(count) \
7299 + ((count) & DMAD_count_m)
7301 +#define DMA_HALT_TIMEOUT 500
7304 +static inline int rc32434_halt_dma(DMA_Chan_t ch)
7307 + if (rc32434_readl(&ch->dmac) & DMAC_run_m) {
7308 + rc32434_writel(0, &ch->dmac);
7310 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
7311 + if (rc32434_readl(&ch->dmas) & DMAS_h_m) {
7312 + rc32434_writel(0, &ch->dmas);
7319 + return timeout ? 0 : 1;
7322 +static inline void rc32434_start_dma(DMA_Chan_t ch, u32 dma_addr)
7324 + rc32434_writel(0, &ch->dmandptr);
7325 + rc32434_writel(dma_addr, &ch->dmadptr);
7328 +static inline void rc32434_chain_dma(DMA_Chan_t ch, u32 dma_addr)
7330 + rc32434_writel(dma_addr, &ch->dmandptr);
7333 +#endif // __IDT_DMA_V_H__
7341 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_eth.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_eth.h
7342 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_eth.h 1970-01-01 01:00:00.000000000 +0100
7343 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_eth.h 2006-01-10 00:32:33.000000000 +0100
7345 +/**************************************************************************
7347 + * BRIEF MODULE DESCRIPTION
7348 + * Ethernet register definition
7350 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7352 + * This program is free software; you can redistribute it and/or modify it
7353 + * under the terms of the GNU General Public License as published by the
7354 + * Free Software Foundation; either version 2 of the License, or (at your
7355 + * option) any later version.
7357 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7358 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7359 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7360 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7361 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7362 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7363 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7364 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7365 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7366 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7368 + * You should have received a copy of the GNU General Public License along
7369 + * with this program; if not, write to the Free Software Foundation, Inc.,
7370 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7373 + **************************************************************************
7374 + * May 2004 rkt, neb.
7380 + **************************************************************************
7383 +#ifndef __IDT_ETH_H__
7384 +#define __IDT_ETH_H__
7389 + ETH0_PhysicalAddress = 0x18060000,
7390 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
7392 + ETH0_VirtualAddress = 0xb8060000,
7393 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
7403 + u32 ethu0 [4] ; // Reserved.
7406 + u32 eth_u1 [10] ; // Reserved.
7408 + u32 eth_u2 [42] ; // Reserved.
7423 + u32 eth_u9 [50] ; // Reserved.
7430 + u32 eth_u10 ; // Reserved.
7438 + u32 eth_u11 ; // Reserved.
7439 + u32 eth_u12 ; // Reserved.
7447 + ETHINTFC_en_b = 0,
7448 + ETHINTFC_en_m = 0x00000001,
7449 + ETHINTFC_its_b = 1,
7450 + ETHINTFC_its_m = 0x00000002,
7451 + ETHINTFC_rip_b = 2,
7452 + ETHINTFC_rip_m = 0x00000004,
7453 + ETHINTFC_jam_b = 3,
7454 + ETHINTFC_jam_m = 0x00000008,
7455 + ETHINTFC_ovr_b = 4,
7456 + ETHINTFC_ovr_m = 0x00000010,
7457 + ETHINTFC_und_b = 5,
7458 + ETHINTFC_und_m = 0x00000020,
7460 + ETHFIFOTT_tth_b = 0,
7461 + ETHFIFOTT_tth_m = 0x0000007f,
7464 + ETHARC_pro_m = 0x00000001,
7466 + ETHARC_am_m = 0x00000002,
7468 + ETHARC_afm_m = 0x00000004,
7470 + ETHARC_ab_m = 0x00000008,
7472 + ETHSAL_byte5_b = 0,
7473 + ETHSAL_byte5_m = 0x000000ff,
7474 + ETHSAL_byte4_b = 8,
7475 + ETHSAL_byte4_m = 0x0000ff00,
7476 + ETHSAL_byte3_b = 16,
7477 + ETHSAL_byte3_m = 0x00ff0000,
7478 + ETHSAL_byte2_b = 24,
7479 + ETHSAL_byte2_m = 0xff000000,
7481 + ETHSAH_byte1_b = 0,
7482 + ETHSAH_byte1_m = 0x000000ff,
7483 + ETHSAH_byte0_b = 8,
7484 + ETHSAH_byte0_m = 0x0000ff00,
7487 + ETHGPF_ptv_m = 0x0000ffff,
7490 + ETHPFS_pfd_m = 0x00000001,
7492 + ETHCFSA0_cfsa4_b = 0,
7493 + ETHCFSA0_cfsa4_m = 0x000000ff,
7494 + ETHCFSA0_cfsa5_b = 8,
7495 + ETHCFSA0_cfsa5_m = 0x0000ff00,
7497 + ETHCFSA1_cfsa2_b = 0,
7498 + ETHCFSA1_cfsa2_m = 0x000000ff,
7499 + ETHCFSA1_cfsa3_b = 8,
7500 + ETHCFSA1_cfsa3_m = 0x0000ff00,
7502 + ETHCFSA2_cfsa0_b = 0,
7503 + ETHCFSA2_cfsa0_m = 0x000000ff,
7504 + ETHCFSA2_cfsa1_b = 8,
7505 + ETHCFSA2_cfsa1_m = 0x0000ff00,
7508 + ETHMAC1_re_m = 0x00000001,
7509 + ETHMAC1_paf_b = 1,
7510 + ETHMAC1_paf_m = 0x00000002,
7511 + ETHMAC1_rfc_b = 2,
7512 + ETHMAC1_rfc_m = 0x00000004,
7513 + ETHMAC1_tfc_b = 3,
7514 + ETHMAC1_tfc_m = 0x00000008,
7516 + ETHMAC1_lb_m = 0x00000010,
7517 + ETHMAC1_mr_b = 31,
7518 + ETHMAC1_mr_m = 0x80000000,
7521 + ETHMAC2_fd_m = 0x00000001,
7522 + ETHMAC2_flc_b = 1,
7523 + ETHMAC2_flc_m = 0x00000002,
7524 + ETHMAC2_hfe_b = 2,
7525 + ETHMAC2_hfe_m = 0x00000004,
7527 + ETHMAC2_dc_m = 0x00000008,
7528 + ETHMAC2_cen_b = 4,
7529 + ETHMAC2_cen_m = 0x00000010,
7531 + ETHMAC2_pe_m = 0x00000020,
7532 + ETHMAC2_vpe_b = 6,
7533 + ETHMAC2_vpe_m = 0x00000040,
7534 + ETHMAC2_ape_b = 7,
7535 + ETHMAC2_ape_m = 0x00000080,
7536 + ETHMAC2_ppe_b = 8,
7537 + ETHMAC2_ppe_m = 0x00000100,
7538 + ETHMAC2_lpe_b = 9,
7539 + ETHMAC2_lpe_m = 0x00000200,
7540 + ETHMAC2_nb_b = 12,
7541 + ETHMAC2_nb_m = 0x00001000,
7542 + ETHMAC2_bp_b = 13,
7543 + ETHMAC2_bp_m = 0x00002000,
7544 + ETHMAC2_ed_b = 14,
7545 + ETHMAC2_ed_m = 0x00004000,
7547 + ETHIPGT_ipgt_b = 0,
7548 + ETHIPGT_ipgt_m = 0x0000007f,
7550 + ETHIPGR_ipgr2_b = 0,
7551 + ETHIPGR_ipgr2_m = 0x0000007f,
7552 + ETHIPGR_ipgr1_b = 8,
7553 + ETHIPGR_ipgr1_m = 0x00007f00,
7555 + ETHCLRT_maxret_b = 0,
7556 + ETHCLRT_maxret_m = 0x0000000f,
7557 + ETHCLRT_colwin_b = 8,
7558 + ETHCLRT_colwin_m = 0x00003f00,
7560 + ETHMAXF_maxf_b = 0,
7561 + ETHMAXF_maxf_m = 0x0000ffff,
7563 + ETHMTEST_tb_b = 2,
7564 + ETHMTEST_tb_m = 0x00000004,
7567 + ETHMCP_div_m = 0x000000ff,
7569 + MIIMCFG_rsv_b = 0,
7570 + MIIMCFG_rsv_m = 0x0000000c,
7573 + MIIMCMD_rd_m = 0x00000001,
7574 + MIIMCMD_scn_b = 1,
7575 + MIIMCMD_scn_m = 0x00000002,
7577 + MIIMADDR_regaddr_b = 0,
7578 + MIIMADDR_regaddr_m = 0x0000001f,
7579 + MIIMADDR_phyaddr_b = 8,
7580 + MIIMADDR_phyaddr_m = 0x00001f00,
7582 + MIIMWTD_wdata_b = 0,
7583 + MIIMWTD_wdata_m = 0x0000ffff,
7585 + MIIMRDD_rdata_b = 0,
7586 + MIIMRDD_rdata_m = 0x0000ffff,
7588 + MIIMIND_bsy_b = 0,
7589 + MIIMIND_bsy_m = 0x00000001,
7590 + MIIMIND_scn_b = 1,
7591 + MIIMIND_scn_m = 0x00000002,
7593 + MIIMIND_nv_m = 0x00000004,
7598 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
7603 + ETHRX_fd_m = 0x00000001,
7605 + ETHRX_ld_m = 0x00000002,
7607 + ETHRX_rok_m = 0x00000004,
7609 + ETHRX_fm_m = 0x00000008,
7611 + ETHRX_mp_m = 0x00000010,
7613 + ETHRX_bp_m = 0x00000020,
7615 + ETHRX_vlt_m = 0x00000040,
7617 + ETHRX_cf_m = 0x00000080,
7619 + ETHRX_ovr_m = 0x00000100,
7621 + ETHRX_crc_m = 0x00000200,
7623 + ETHRX_cv_m = 0x00000400,
7625 + ETHRX_db_m = 0x00000800,
7627 + ETHRX_le_m = 0x00001000,
7629 + ETHRX_lor_m = 0x00002000,
7631 + ETHRX_ces_m = 0x00004000,
7632 + ETHRX_length_b = 16,
7633 + ETHRX_length_m = 0xffff0000,
7636 + ETHTX_fd_m = 0x00000001,
7638 + ETHTX_ld_m = 0x00000002,
7640 + ETHTX_oen_m = 0x00000004,
7642 + ETHTX_pen_m = 0x00000008,
7644 + ETHTX_cen_m = 0x00000010,
7646 + ETHTX_hen_m = 0x00000020,
7648 + ETHTX_tok_m = 0x00000040,
7650 + ETHTX_mp_m = 0x00000080,
7652 + ETHTX_bp_m = 0x00000100,
7654 + ETHTX_und_m = 0x00000200,
7656 + ETHTX_of_m = 0x00000400,
7658 + ETHTX_ed_m = 0x00000800,
7660 + ETHTX_ec_m = 0x00001000,
7662 + ETHTX_lc_m = 0x00002000,
7664 + ETHTX_td_m = 0x00004000,
7666 + ETHTX_crc_m = 0x00008000,
7668 + ETHTX_le_m = 0x00010000,
7670 + ETHTX_cc_m = 0x001E0000,
7673 +#endif // __IDT_ETH_H__
7678 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h
7679 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h 1970-01-01 01:00:00.000000000 +0100
7680 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h 2006-01-10 00:32:33.000000000 +0100
7682 +/**************************************************************************
7684 + * BRIEF MODULE DESCRIPTION
7685 + * Ethernet register definition
7687 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7689 + * This program is free software; you can redistribute it and/or modify it
7690 + * under the terms of the GNU General Public License as published by the
7691 + * Free Software Foundation; either version 2 of the License, or (at your
7692 + * option) any later version.
7694 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7695 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7696 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7697 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7698 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7699 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7700 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7701 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7702 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7703 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7705 + * You should have received a copy of the GNU General Public License along
7706 + * with this program; if not, write to the Free Software Foundation, Inc.,
7707 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7710 + **************************************************************************
7711 + * May 2004 rkt, neb.
7717 + **************************************************************************
7720 +#ifndef __IDT_ETH_V_H__
7721 +#define __IDT_ETH_V_H__
7723 +#include <asm/idt-boards/rc32434/rc32434_eth.h>
7725 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
7726 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
7727 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
7728 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
7729 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
7730 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
7731 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
7732 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
7733 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
7734 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
7735 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
7737 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
7739 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
7740 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
7741 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
7742 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
7743 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
7744 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
7745 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
7746 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
7747 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
7748 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
7749 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
7750 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
7751 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
7752 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
7753 +#endif // __IDT_ETH_V_H__
7759 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h
7760 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h 1970-01-01 01:00:00.000000000 +0100
7761 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h 2006-01-10 00:32:33.000000000 +0100
7763 +/**************************************************************************
7765 + * BRIEF MODULE DESCRIPTION
7766 + * GPIO register definition
7768 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7770 + * This program is free software; you can redistribute it and/or modify it
7771 + * under the terms of the GNU General Public License as published by the
7772 + * Free Software Foundation; either version 2 of the License, or (at your
7773 + * option) any later version.
7775 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7776 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7777 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7778 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7779 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7780 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7781 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7782 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7783 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7784 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7786 + * You should have received a copy of the GNU General Public License along
7787 + * with this program; if not, write to the Free Software Foundation, Inc.,
7788 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7791 + **************************************************************************
7792 + * May 2004 rkt, neb.
7798 + **************************************************************************
7801 +#ifndef __IDT_GPIO_H__
7802 +#define __IDT_GPIO_H__
7806 + GPIO0_PhysicalAddress = 0x18050000,
7807 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
7809 + GPIO0_VirtualAddress = 0xb8050000,
7810 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
7815 + u32 gpiofunc; /* GPIO Function Register
7816 + * gpiofunc[x]==0 bit = gpio
7817 + * func[x]==1 bit = altfunc
7819 + u32 gpiocfg; /* GPIO Configuration Register
7820 + * gpiocfg[x]==0 bit = input
7821 + * gpiocfg[x]==1 bit = output
7823 + u32 gpiod; /* GPIO Data Register
7824 + * gpiod[x] read/write gpio pinX status
7826 + u32 gpioilevel; /* GPIO Interrupt Status Register
7827 + * interrupt level (see gpioistat)
7829 + u32 gpioistat; /* Gpio Interrupt Status Register
7830 + * istat[x] = (gpiod[x] == level[x])
7831 + * cleared in ISR (STICKY bits)
7833 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
7834 +} volatile * GPIO_t ;
7838 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
7839 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
7840 + GPIO_input_v = 0, // gpiocfg use pin as input.
7841 + GPIO_output_v = 1, // gpiocfg use pin as output.
7843 + GPIO_pin0_m = 0x00000001,
7845 + GPIO_pin1_m = 0x00000002,
7847 + GPIO_pin2_m = 0x00000004,
7849 + GPIO_pin3_m = 0x00000008,
7851 + GPIO_pin4_m = 0x00000010,
7853 + GPIO_pin5_m = 0x00000020,
7855 + GPIO_pin6_m = 0x00000040,
7857 + GPIO_pin7_m = 0x00000080,
7859 + GPIO_pin8_m = 0x00000100,
7861 + GPIO_pin9_m = 0x00000200,
7862 + GPIO_pin10_b = 10,
7863 + GPIO_pin10_m = 0x00000400,
7864 + GPIO_pin11_b = 11,
7865 + GPIO_pin11_m = 0x00000800,
7866 + GPIO_pin12_b = 12,
7867 + GPIO_pin12_m = 0x00001000,
7868 + GPIO_pin13_b = 13,
7869 + GPIO_pin13_m = 0x00002000,
7871 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
7873 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
7874 + GPIO_u0sout_m = GPIO_pin0_m,
7875 + GPIO_u0sout_cfg_v = GPIO_output_v,
7876 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
7877 + GPIO_u0sinp_m = GPIO_pin1_m,
7878 + GPIO_u0sinp_cfg_v = GPIO_input_v,
7879 + GPIO_u0rtsn_b = GPIO_pin2_b, // UART 0 req. to send.
7880 + GPIO_u0rtsn_m = GPIO_pin2_m,
7881 + GPIO_u0rtsn_cfg_v = GPIO_output_v,
7882 + GPIO_u0ctsn_b = GPIO_pin3_b, // UART 0 clear to send.
7883 + GPIO_u0ctsn_m = GPIO_pin3_m,
7884 + GPIO_u0ctsn_cfg_v = GPIO_input_v,
7886 + GPIO_maddr22_b = GPIO_pin4_b, // M&P bus bit 22.
7887 + GPIO_maddr22_m = GPIO_pin4_m,
7888 + GPIO_maddr22_cfg_v = GPIO_output_v,
7890 + GPIO_maddr23_b = GPIO_pin5_b, // M&P bus bit 23.
7891 + GPIO_maddr23_m = GPIO_pin5_m,
7892 + GPIO_maddr23_cfg_v = GPIO_output_v,
7894 + GPIO_maddr24_b = GPIO_pin6_b, // M&P bus bit 24.
7895 + GPIO_maddr24_m = GPIO_pin6_m,
7896 + GPIO_maddr24_cfg_v = GPIO_output_v,
7898 + GPIO_maddr25_b = GPIO_pin7_b, // M&P bus bit 25.
7899 + GPIO_maddr25_m = GPIO_pin7_m,
7900 + GPIO_maddr25_cfg_v = GPIO_output_v,
7902 + GPIO_cpudmadebug_b = GPIO_pin8_b, // CPU or DMA debug pin
7903 + GPIO_cpudmadebug_m = GPIO_pin8_m,
7904 + GPIO_cpudmadebug_cfg_v = GPIO_output_v,
7906 + GPIO_pcireq4_b = GPIO_pin9_b, // PCI Request 4
7907 + GPIO_pcireq4_m = GPIO_pin9_m,
7908 + GPIO_pcireq4_cfg_v = GPIO_input_v,
7910 + GPIO_pcigrant4_b = GPIO_pin10_b, // PCI Grant 4
7911 + GPIO_pcigrant4_m = GPIO_pin10_m,
7912 + GPIO_pcigrant4_cfg_v = GPIO_output_v,
7914 + GPIO_pcireq5_b = GPIO_pin11_b, // PCI Request 5
7915 + GPIO_pcireq5_m = GPIO_pin11_m,
7916 + GPIO_pcireq5_cfg_v = GPIO_input_v,
7918 + GPIO_pcigrant5_b = GPIO_pin12_b, // PCI Grant 5
7919 + GPIO_pcigrant5_m = GPIO_pin12_m,
7920 + GPIO_pcigrant5_cfg_v = GPIO_output_v,
7922 + GPIO_pcimuintn_b = GPIO_pin13_b, // PCI messaging int.
7923 + GPIO_pcimuintn_m = GPIO_pin13_m,
7924 + GPIO_pcimuintn_cfg_v = GPIO_output_v,
7928 +#endif // __IDT_GPIO_H__
7930 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434.h
7931 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434.h 1970-01-01 01:00:00.000000000 +0100
7932 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434.h 2006-01-10 00:32:33.000000000 +0100
7934 + /**************************************************************************
7936 + * BRIEF MODULE DESCRIPTION
7937 + * Definitions for IDT RC32434 CPU
7939 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7941 + * This program is free software; you can redistribute it and/or modify it
7942 + * under the terms of the GNU General Public License as published by the
7943 + * Free Software Foundation; either version 2 of the License, or (at your
7944 + * option) any later version.
7946 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7947 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7948 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7949 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7950 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7951 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7952 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7953 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7954 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7955 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7957 + * You should have received a copy of the GNU General Public License along
7958 + * with this program; if not, write to the Free Software Foundation, Inc.,
7959 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7962 + **************************************************************************
7963 + * May 2004 rkt, neb.
7969 + **************************************************************************
7972 +#ifndef _RC32434_H_
7973 +#define _RC32434_H_
7975 +#include <linux/config.h>
7976 +#include <linux/delay.h>
7977 +#include <asm/io.h>
7978 +#include <asm/idt-boards/rc32434/rc32434_timer.h>
7980 +#define RC32434_REG_BASE 0x18000000
7983 +#define interrupt ((volatile INT_t ) INT0_VirtualAddress)
7984 +#define idt_timer ((volatile TIM_t) TIM0_VirtualAddress)
7985 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
7987 +#define IDT_CLOCK_MULT 2
7988 +#define MIPS_CPU_TIMER_IRQ 7
7989 +/* Interrupt Controller */
7990 +#define IC_GROUP0_PEND (RC32434_REG_BASE + 0x38000)
7991 +#define IC_GROUP0_MASK (RC32434_REG_BASE + 0x38008)
7992 +#define IC_GROUP_OFFSET 0x0C
7993 +#define RTC_BASE 0xBA001FF0
7995 +#define NUM_INTR_GROUPS 5
7998 +#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
7999 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) /* GRP3 IRQ numbers start here */
8000 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) /* GRP4 IRQ numbers start here */
8001 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) /* GRP5 IRQ numbers start here */
8002 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
8006 +#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58003)
8007 +#define EB434_UART1_BASE (0x19800003)
8011 +#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58000)
8012 +#define EB434_UART1_BASE (0x19800000)
8016 +#define RC32434_UART0_IRQ GROUP3_IRQ_BASE + 0
8017 +#define EB434_UART1_IRQ GROUP4_IRQ_BASE + 11
8019 +#define RC32434_NR_IRQS (GROUP4_IRQ_BASE + 32)
8021 +/* cpu pipeline flush */
8022 +static inline void rc32434_sync(void)
8024 + __asm__ volatile ("sync");
8027 +static inline void rc32434_sync_udelay(int us)
8029 + __asm__ volatile ("sync");
8033 +static inline void rc32434_sync_delay(int ms)
8035 + __asm__ volatile ("sync");
8042 + * Macros to access internal RC32434 registers. No byte
8043 + * swapping should be done when accessing the internal
8047 +#define rc32434_readb __raw_readb
8048 +#define rc32434_readw __raw_readw
8049 +#define rc32434_readl __raw_readl
8051 +#define rc32434_writeb __raw_writeb
8052 +#define rc32434_writew __raw_writew
8053 +#define rc32434_writel __raw_writel
8056 +static inline u8 rc32434_readb(unsigned long pa)
8058 + return *((volatile u8 *)KSEG1ADDR(pa));
8060 +static inline u16 rc32434_readw(unsigned long pa)
8062 + return *((volatile u16 *)KSEG1ADDR(pa));
8064 +static inline u32 rc32434_readl(unsigned long pa)
8066 + return *((volatile u32 *)KSEG1ADDR(pa));
8068 +static inline void rc32434_writeb(u8 val, unsigned long pa)
8070 + *((volatile u8 *)KSEG1ADDR(pa)) = val;
8072 +static inline void rc32434_writew(u16 val, unsigned long pa)
8074 + *((volatile u16 *)KSEG1ADDR(pa)) = val;
8076 +static inline void rc32434_writel(u32 val, unsigned long pa)
8078 + *((volatile u32 *)KSEG1ADDR(pa)) = val;
8085 + * C access to CLZ and CLO instructions
8086 + * (count leading zeroes/ones).
8088 +static inline int rc32434_clz(unsigned long val)
8091 + __asm__ volatile (
8092 + ".set\tnoreorder\n\t"
8094 + ".set\tmips32\n\t"
8104 +static inline int rc32434_clo(unsigned long val)
8107 + __asm__ volatile (
8108 + ".set\tnoreorder\n\t"
8110 + ".set\tmips32\n\t"
8120 +#endif /* _RC32434_H_ */
8133 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_integ.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_integ.h
8134 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_integ.h 1970-01-01 01:00:00.000000000 +0100
8135 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_integ.h 2006-01-10 00:32:33.000000000 +0100
8137 +/**************************************************************************
8139 + * BRIEF MODULE DESCRIPTION
8140 + * System Integrity register definition
8142 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8144 + * This program is free software; you can redistribute it and/or modify it
8145 + * under the terms of the GNU General Public License as published by the
8146 + * Free Software Foundation; either version 2 of the License, or (at your
8147 + * option) any later version.
8149 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8150 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8151 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8152 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8153 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8154 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8155 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8156 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8157 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8158 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8160 + * You should have received a copy of the GNU General Public License along
8161 + * with this program; if not, write to the Free Software Foundation, Inc.,
8162 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8165 + **************************************************************************
8166 + * May 2004 rkt, neb
8172 + **************************************************************************
8175 +#ifndef __IDT_INTEG_H__
8176 +#define __IDT_INTEG_H__
8180 + INTEG0_PhysicalAddress = 0x18030000,
8181 + INTEG_PhysicalAddress = INTEG0_PhysicalAddress, // Default
8183 + INTEG0_VirtualAddress = 0xB8030000,
8184 + INTEG_VirtualAddress = INTEG0_VirtualAddress, // Default
8187 +// if you are looking for CEA, try rst.h
8190 + u32 filler [0xc] ; // 0x30 bytes unused.
8191 + u32 errcs ; // sticky use ERRCS_
8192 + u32 wtcount ; // Watchdog timer count reg.
8193 + u32 wtcompare ; // Watchdog timer timeout value.
8194 + u32 wtc ; // Watchdog timer control. use WTC_
8195 +} volatile *INTEG_t ;
8199 + ERRCS_wto_b = 0, // In INTEG_t -> errcs
8200 + ERRCS_wto_m = 0x00000001,
8201 + ERRCS_wne_b = 1, // In INTEG_t -> errcs
8202 + ERRCS_wne_m = 0x00000002,
8203 + ERRCS_ucw_b = 2, // In INTEG_t -> errcs
8204 + ERRCS_ucw_m = 0x00000004,
8205 + ERRCS_ucr_b = 3, // In INTEG_t -> errcs
8206 + ERRCS_ucr_m = 0x00000008,
8207 + ERRCS_upw_b = 4, // In INTEG_t -> errcs
8208 + ERRCS_upw_m = 0x00000010,
8209 + ERRCS_upr_b = 5, // In INTEG_t -> errcs
8210 + ERRCS_upr_m = 0x00000020,
8211 + ERRCS_udw_b = 6, // In INTEG_t -> errcs
8212 + ERRCS_udw_m = 0x00000040,
8213 + ERRCS_udr_b = 7, // In INTEG_t -> errcs
8214 + ERRCS_udr_m = 0x00000080,
8215 + ERRCS_sae_b = 8, // In INTEG_t -> errcs
8216 + ERRCS_sae_m = 0x00000100,
8217 + ERRCS_wre_b = 9, // In INTEG_t -> errcs
8218 + ERRCS_wre_m = 0x00000200,
8220 + WTC_en_b = 0, // In INTEG_t -> wtc
8221 + WTC_en_m = 0x00000001,
8222 + WTC_to_b = 1, // In INTEG_t -> wtc
8223 + WTC_to_m = 0x00000002,
8226 +#endif // __IDT_INTEG_H__
8227 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_int.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_int.h
8228 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_int.h 1970-01-01 01:00:00.000000000 +0100
8229 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_int.h 2006-01-10 00:32:33.000000000 +0100
8231 +/**************************************************************************
8233 + * BRIEF MODULE DESCRIPTION
8234 + * Interrupt Controller register definition.
8236 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8238 + * This program is free software; you can redistribute it and/or modify it
8239 + * under the terms of the GNU General Public License as published by the
8240 + * Free Software Foundation; either version 2 of the License, or (at your
8241 + * option) any later version.
8243 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8244 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8245 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8246 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8247 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8248 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8249 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8250 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8251 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8252 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8254 + * You should have received a copy of the GNU General Public License along
8255 + * with this program; if not, write to the Free Software Foundation, Inc.,
8256 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8259 + **************************************************************************
8260 + * May 2004 rkt, neb.
8266 + **************************************************************************
8269 +#ifndef __IDT_INT_H__
8270 +#define __IDT_INT_H__
8274 + INT0_PhysicalAddress = 0x18038000,
8275 + INT_PhysicalAddress = INT0_PhysicalAddress, // Default
8277 + INT0_VirtualAddress = 0xB8038000,
8278 + INT_VirtualAddress = INT0_VirtualAddress, // Default
8283 + u32 ipend ; //Pending interrupts. use INT?_
8284 + u32 itest ; //Test bits. use INT?_
8285 + u32 imask ; //Interrupt disabled when set. use INT?_
8290 + IPEND2 = 0, // HW 2 interrupt to core. use INT2_
8291 + IPEND3 = 1, // HW 3 interrupt to core. use INT3_
8292 + IPEND4 = 2, // HW 4 interrupt to core. use INT4_
8293 + IPEND5 = 3, // HW 5 interrupt to core. use INT5_
8294 + IPEND6 = 4, // HW 6 interrupt to core. use INT6_
8296 + IPEND_count, // must be last (used in loops)
8297 + IPEND_min = IPEND2 // min IPEND (used in loops)
8300 +typedef struct INTC_s
8302 + struct INT_s i [IPEND_count] ;// use i[IPEND?] = INT?_
8303 + u32 nmips ; // use NMIPS_
8304 +} volatile *INT_t ;
8308 + INT2_timer0_b = 0,
8309 + INT2_timer0_m = 0x00000001,
8310 + INT2_timer1_b = 1,
8311 + INT2_timer1_m = 0x00000002,
8312 + INT2_timer2_b = 2,
8313 + INT2_timer2_m = 0x00000004,
8314 + INT2_refresh_b = 3,
8315 + INT2_refresh_m = 0x00000008,
8316 + INT2_watchdogTimeout_b = 4,
8317 + INT2_watchdogTimeout_m = 0x00000010,
8318 + INT2_undecodedCpuWrite_b = 5,
8319 + INT2_undecodedCpuWrite_m = 0x00000020,
8320 + INT2_undecodedCpuRead_b = 6,
8321 + INT2_undecodedCpuRead_m = 0x00000040,
8322 + INT2_undecodedPciWrite_b = 7,
8323 + INT2_undecodedPciWrite_m = 0x00000080,
8324 + INT2_undecodedPciRead_b = 8,
8325 + INT2_undecodedPciRead_m = 0x00000100,
8326 + INT2_undecodedDmaWrite_b = 9,
8327 + INT2_undecodedDmaWrite_m = 0x00000200,
8328 + INT2_undecodedDmaRead_b = 10,
8329 + INT2_undecodedDmaRead_m = 0x00000400,
8330 + INT2_ipBusSlaveAckError_b = 11,
8331 + INT2_ipBusSlaveAckError_m = 0x00000800,
8333 + INT3_dmaChannel0_b = 0,
8334 + INT3_dmaChannel0_m = 0x00000001,
8335 + INT3_dmaChannel1_b = 1,
8336 + INT3_dmaChannel1_m = 0x00000002,
8337 + INT3_dmaChannel2_b = 2,
8338 + INT3_dmaChannel2_m = 0x00000004,
8339 + INT3_dmaChannel3_b = 3,
8340 + INT3_dmaChannel3_m = 0x00000008,
8341 + INT3_dmaChannel4_b = 4,
8342 + INT3_dmaChannel4_m = 0x00000010,
8343 + INT3_dmaChannel5_b = 5,
8344 + INT3_dmaChannel5_m = 0x00000020,
8346 + INT5_uartGeneral0_b = 0,
8347 + INT5_uartGeneral0_m = 0x00000001,
8348 + INT5_uartTxrdy0_b = 1,
8349 + INT5_uartTxrdy0_m = 0x00000002,
8350 + INT5_uartRxrdy0_b = 2,
8351 + INT5_uartRxrdy0_m = 0x00000004,
8353 + INT5_pci_m = 0x00000008,
8354 + INT5_pciDecoupled_b = 4,
8355 + INT5_pciDecoupled_m = 0x00000010,
8357 + INT5_spi_m = 0x00000020,
8358 + INT5_deviceDecoupled_b = 6,
8359 + INT5_deviceDecoupled_m = 0x00000040,
8360 + INT5_eth0Ovr_b = 9,
8361 + INT5_eth0Ovr_m = 0x00000200,
8362 + INT5_eth0Und_b = 10,
8363 + INT5_eth0Und_m = 0x00000400,
8364 + INT5_eth0Pfd_b = 11,
8365 + INT5_eth0Pfd_m = 0x00000800,
8366 + INT5_nvram_b = 12,
8367 + INT5_nvram_m = 0x00001000,
8370 + INT6_gpio0_m = 0x00000001,
8372 + INT6_gpio1_m = 0x00000002,
8374 + INT6_gpio2_m = 0x00000004,
8376 + INT6_gpio3_m = 0x00000008,
8378 + INT6_gpio4_m = 0x00000010,
8380 + INT6_gpio5_m = 0x00000020,
8382 + INT6_gpio6_m = 0x00000040,
8384 + INT6_gpio7_m = 0x00000080,
8386 + INT6_gpio8_m = 0x00000100,
8388 + INT6_gpio9_m = 0x00000200,
8389 + INT6_gpio10_b = 10,
8390 + INT6_gpio10_m = 0x00000400,
8391 + INT6_gpio11_b = 11,
8392 + INT6_gpio11_m = 0x00000800,
8393 + INT6_gpio12_b = 12,
8394 + INT6_gpio12_m = 0x00001000,
8395 + INT6_gpio13_b = 13,
8396 + INT6_gpio13_m = 0x00002000,
8399 + NMIPS_gpio_m = 0x00000001,
8402 +#endif // __IDT_INT_H__
8405 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h
8406 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h 1970-01-01 01:00:00.000000000 +0100
8407 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h 2006-01-10 00:32:33.000000000 +0100
8409 +/**************************************************************************
8411 + * BRIEF MODULE DESCRIPTION
8412 + * IP Arbiter register definitions
8414 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8416 + * This program is free software; you can redistribute it and/or modify it
8417 + * under the terms of the GNU General Public License as published by the
8418 + * Free Software Foundation; either version 2 of the License, or (at your
8419 + * option) any later version.
8421 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8422 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8423 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8424 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8425 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8426 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8427 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8428 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8429 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8430 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8432 + * You should have received a copy of the GNU General Public License along
8433 + * with this program; if not, write to the Free Software Foundation, Inc.,
8434 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8437 + **************************************************************************
8438 + * May 2004 rkt,neb
8444 + **************************************************************************
8447 +#ifndef __IDT_IPARB_H__
8448 +#define __IDT_IPARB_H__
8452 + IPARB0_PhysicalAddress = 0x18048000,
8453 + IPARB_PhysicalAddress = IPARB0_PhysicalAddress, // Default
8455 + IPARB0_VirtualAddress = 0xB8048000,
8456 + IPARB_VirtualAddress = IPARB0_VirtualAddress, // Default
8461 + IPABMXC_ethernet0Receive = 0,
8462 + IPABMXC_ethernet0Transmit = 1,
8463 + IPABMXC_memoryToHoldFifo = 2,
8464 + IPABMXC_holdFifoToMemory = 3,
8465 + IPABMXC_pciToMemory = 4,
8466 + IPABMXC_memoryToPci = 5,
8467 + IPABMXC_pciTarget = 6,
8468 + IPABMXC_pciTargetStart = 7,
8469 + IPABMXC_cpuToIpBus = 8,
8471 + IPABMXC_Count, // Must be last in list !
8472 + IPABMXC_Min = IPABMXC_ethernet0Receive,
8474 + IPAPXC_PriorityCount = 4, // 3-highest, 0-lowest.
8479 + u32 ipapc [IPAPXC_PriorityCount] ; // ipapc[IPAPXC_] = IPAPC_
8480 + u32 ipabmc [IPABMXC_Count] ; // ipabmc[IPABMXC_] = IPABMC_
8481 + u32 ipac ; // use IPAC_
8482 + u32 ipaitcc; // use IPAITCC_
8484 +} volatile * IPARB_t ;
8489 + IPAC_dp_m = 0x00000001,
8491 + IPAC_dep_m = 0x00000002,
8493 + IPAC_drm_m = 0x00000004,
8495 + IPAC_dwm_m = 0x00000008,
8497 + IPAC_msk_m = 0x00000010,
8500 + IPAPC_ptc_m = 0x00003fff,
8502 + IPAPC_mf_m = 0x00004000,
8503 + IPAPC_cptc_b = 16,
8504 + IPAPC_cptc_m = 0x3fff0000,
8507 + IPAITCC_itcc, = 0x000001ff,
8510 + IPABMC_mtc_m = 0x00000fff,
8512 + IPABMC_p_m = 0x00003000,
8513 + IPABMC_msk_b = 14,
8514 + IPABMC_msk_m = 0x00004000,
8515 + IPABMC_cmtc_b = 16,
8516 + IPABMC_cmtc_m = 0x0fff0000,
8519 +#endif // __IDT_IPARB_H__
8520 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_pci.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_pci.h
8521 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_pci.h 1970-01-01 01:00:00.000000000 +0100
8522 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_pci.h 2006-01-10 00:32:33.000000000 +0100
8524 +/**************************************************************************
8526 + * BRIEF MODULE DESCRIPTION
8527 + * PCI register definitio
8529 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8531 + * This program is free software; you can redistribute it and/or modify it
8532 + * under the terms of the GNU General Public License as published by the
8533 + * Free Software Foundation; either version 2 of the License, or (at your
8534 + * option) any later version.
8536 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8537 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8538 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8539 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8540 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8541 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8542 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8543 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8544 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8545 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8547 + * You should have received a copy of the GNU General Public License along
8548 + * with this program; if not, write to the Free Software Foundation, Inc.,
8549 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8552 + **************************************************************************
8553 + * May 2004 rkt, neb.
8559 + **************************************************************************
8562 +#ifndef __IDT_PCI_H__
8563 +#define __IDT_PCI_H__
8567 + PCI0_PhysicalAddress = 0x18080000,
8568 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
8570 + PCI0_VirtualAddress = 0xB8080000,
8571 + PCI_VirtualAddress = PCI0_VirtualAddress,
8576 + PCI_LbaCount = 4, // Local base addresses.
8581 + u32 a ; // Address.
8582 + u32 c ; // Control.
8583 + u32 m ; // mapping.
8593 + PCI_Map_s pcilba [PCI_LbaCount] ;
8601 +} volatile *PCI_t ;
8603 +// PCI messaging unit.
8610 + u32 pciim [PCIM_Count] ;
8611 + u32 pciom [PCIM_Count] ;
8618 +} volatile *PCIM_t ;
8620 +/*******************************************************************************
8622 + * PCI Control Register
8624 + ******************************************************************************/
8628 + PCIC_en_m = 0x00000001,
8630 + PCIC_tnr_m = 0x00000002,
8632 + PCIC_sce_m = 0x00000004,
8634 + PCIC_ien_m = 0x00000008,
8636 + PCIC_aaa_m = 0x00000010,
8638 + PCIC_eap_m = 0x00000020,
8640 + PCIC_pcim_m = 0x000001c0,
8641 + PCIC_pcim_disabled_v = 0,
8642 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
8643 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
8644 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
8645 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
8646 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
8647 + PCIC_pcim_reserved6_v = 6,
8648 + PCIC_pcim_reserved7_v = 7,
8650 + PCIC_igm_m = 0x00000200,
8653 +/*******************************************************************************
8655 + * PCI Status Register
8657 + ******************************************************************************/
8660 + PCIS_eed_m = 0x00000001,
8662 + PCIS_wr_m = 0x00000002,
8664 + PCIS_nmi_m = 0x00000004,
8666 + PCIS_ii_m = 0x00000008,
8668 + PCIS_cwe_m = 0x00000010,
8670 + PCIS_cre_m = 0x00000020,
8672 + PCIS_mdpe_m = 0x00000040,
8674 + PCIS_sta_m = 0x00000080,
8676 + PCIS_rta_m = 0x00000100,
8678 + PCIS_rma_m = 0x00000200,
8680 + PCIS_sse_m = 0x00000400,
8682 + PCIS_ose_m = 0x00000800,
8684 + PCIS_pe_m = 0x00001000,
8686 + PCIS_tae_m = 0x00002000,
8688 + PCIS_rle_m = 0x00004000,
8690 + PCIS_bme_m = 0x00008000,
8692 + PCIS_prd_m = 0x00010000,
8694 + PCIS_rip_m = 0x00020000,
8697 +/*******************************************************************************
8699 + * PCI Status Mask Register
8701 + ******************************************************************************/
8704 + PCISM_eed_m = 0x00000001,
8706 + PCISM_wr_m = 0x00000002,
8708 + PCISM_nmi_m = 0x00000004,
8710 + PCISM_ii_m = 0x00000008,
8712 + PCISM_cwe_m = 0x00000010,
8714 + PCISM_cre_m = 0x00000020,
8716 + PCISM_mdpe_m = 0x00000040,
8718 + PCISM_sta_m = 0x00000080,
8720 + PCISM_rta_m = 0x00000100,
8722 + PCISM_rma_m = 0x00000200,
8724 + PCISM_sse_m = 0x00000400,
8726 + PCISM_ose_m = 0x00000800,
8728 + PCISM_pe_m = 0x00001000,
8730 + PCISM_tae_m = 0x00002000,
8732 + PCISM_rle_m = 0x00004000,
8734 + PCISM_bme_m = 0x00008000,
8736 + PCISM_prd_m = 0x00010000,
8738 + PCISM_rip_m = 0x00020000,
8741 +/*******************************************************************************
8743 + * PCI Configuration Address Register
8745 + ******************************************************************************/
8747 + PCICFGA_reg_b = 2,
8748 + PCICFGA_reg_m = 0x000000fc,
8749 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
8750 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
8751 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
8752 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
8753 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
8754 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
8755 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
8756 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
8757 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
8758 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
8759 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
8760 + PCICFGA_reg_pba0m_v = 0x48>>2,
8761 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
8762 + PCICFGA_reg_pba1m_v = 0x50>>2,
8763 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
8764 + PCICFGA_reg_pba2m_v = 0x58>>2,
8765 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
8766 + PCICFGA_reg_pba3m_v = 0x60>>2,
8767 + PCICFGA_reg_pmgt_v = 0x64>>2,
8768 + PCICFGA_func_b = 8,
8769 + PCICFGA_func_m = 0x00000700,
8770 + PCICFGA_dev_b = 11,
8771 + PCICFGA_dev_m = 0x0000f800,
8772 + PCICFGA_dev_internal_v = 0,
8773 + PCICFGA_bus_b = 16,
8774 + PCICFGA_bus_m = 0x00ff0000,
8775 + PCICFGA_bus_type0_v = 0, //local bus
8776 + PCICFGA_en_b = 31, // read only
8777 + PCICFGA_en_m = 0x80000000,
8781 + PCFGID_vendor_b = 0,
8782 + PCFGID_vendor_m = 0x0000ffff,
8783 + PCFGID_vendor_IDT_v = 0x111d,
8784 + PCFGID_device_b = 16,
8785 + PCFGID_device_m = 0xffff0000,
8786 + PCFGID_device_Korinade_v = 0x0214,
8788 + PCFG04_command_ioena_b = 1,
8789 + PCFG04_command_ioena_m = 0x00000001,
8790 + PCFG04_command_memena_b = 2,
8791 + PCFG04_command_memena_m = 0x00000002,
8792 + PCFG04_command_bmena_b = 3,
8793 + PCFG04_command_bmena_m = 0x00000004,
8794 + PCFG04_command_mwinv_b = 5,
8795 + PCFG04_command_mwinv_m = 0x00000010,
8796 + PCFG04_command_parena_b = 7,
8797 + PCFG04_command_parena_m = 0x00000040,
8798 + PCFG04_command_serrena_b = 9,
8799 + PCFG04_command_serrena_m = 0x00000100,
8800 + PCFG04_command_fastbbena_b = 10,
8801 + PCFG04_command_fastbbena_m = 0x00000200,
8802 + PCFG04_status_b = 16,
8803 + PCFG04_status_m = 0xffff0000,
8804 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
8805 + PCFG04_status_66MHz_m = 0x00200000,
8806 + PCFG04_status_fbb_b = 23,
8807 + PCFG04_status_fbb_m = 0x00800000,
8808 + PCFG04_status_mdpe_b = 24,
8809 + PCFG04_status_mdpe_m = 0x01000000,
8810 + PCFG04_status_dst_b = 25,
8811 + PCFG04_status_dst_m = 0x06000000,
8812 + PCFG04_status_sta_b = 27,
8813 + PCFG04_status_sta_m = 0x08000000,
8814 + PCFG04_status_rta_b = 28,
8815 + PCFG04_status_rta_m = 0x10000000,
8816 + PCFG04_status_rma_b = 29,
8817 + PCFG04_status_rma_m = 0x20000000,
8818 + PCFG04_status_sse_b = 30,
8819 + PCFG04_status_sse_m = 0x40000000,
8820 + PCFG04_status_pe_b = 31,
8821 + PCFG04_status_pe_m = 0x40000000,
8823 + PCFG08_revId_b = 0,
8824 + PCFG08_revId_m = 0x000000ff,
8825 + PCFG08_classCode_b = 0,
8826 + PCFG08_classCode_m = 0xffffff00,
8827 + PCFG08_classCode_bridge_v = 06,
8828 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
8829 + PCFG0C_cacheline_b = 0,
8830 + PCFG0C_cacheline_m = 0x000000ff,
8831 + PCFG0C_masterLatency_b = 8,
8832 + PCFG0C_masterLatency_m = 0x0000ff00,
8833 + PCFG0C_headerType_b = 16,
8834 + PCFG0C_headerType_m = 0x00ff0000,
8835 + PCFG0C_bist_b = 24,
8836 + PCFG0C_bist_m = 0xff000000,
8839 + PCIPBA_msi_m = 0x00000001,
8841 + PCIPBA_p_m = 0x00000004,
8842 + PCIPBA_baddr_b = 8,
8843 + PCIPBA_baddr_m = 0xffffff00,
8845 + PCFGSS_vendorId_b = 0,
8846 + PCFGSS_vendorId_m = 0x0000ffff,
8848 + PCFGSS_id_m = 0xffff0000,
8850 + PCFG3C_interruptLine_b = 0,
8851 + PCFG3C_interruptLine_m = 0x000000ff,
8852 + PCFG3C_interruptPin_b = 8,
8853 + PCFG3C_interruptPin_m = 0x0000ff00,
8854 + PCFG3C_minGrant_b = 16,
8855 + PCFG3C_minGrant_m = 0x00ff0000,
8856 + PCFG3C_maxLat_b = 24,
8857 + PCFG3C_maxLat_m = 0xff000000,
8859 + PCIPBAC_msi_b = 0,
8860 + PCIPBAC_msi_m = 0x00000001,
8862 + PCIPBAC_p_m = 0x00000002,
8863 + PCIPBAC_size_b = 2,
8864 + PCIPBAC_size_m = 0x0000007c,
8866 + PCIPBAC_sb_m = 0x00000080,
8868 + PCIPBAC_pp_m = 0x00000100,
8870 + PCIPBAC_mr_m = 0x00000600,
8871 + PCIPBAC_mr_read_v =0, //no prefetching
8872 + PCIPBAC_mr_readLine_v =1,
8873 + PCIPBAC_mr_readMult_v =2,
8874 + PCIPBAC_mrl_b = 11,
8875 + PCIPBAC_mrl_m = 0x00000800,
8876 + PCIPBAC_mrm_b = 12,
8877 + PCIPBAC_mrm_m = 0x00001000,
8878 + PCIPBAC_trp_b = 13,
8879 + PCIPBAC_trp_m = 0x00002000,
8881 + PCFG40_trdyTimeout_b = 0,
8882 + PCFG40_trdyTimeout_m = 0x000000ff,
8883 + PCFG40_retryLim_b = 8,
8884 + PCFG40_retryLim_m = 0x0000ff00,
8887 +/*******************************************************************************
8889 + * PCI Local Base Address [0|1|2|3] Register
8891 + ******************************************************************************/
8893 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
8894 + PCILBA_baddr_m = 0xffffff00,
8896 +/*******************************************************************************
8898 + * PCI Local Base Address Control Register
8900 + ******************************************************************************/
8902 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
8903 + PCILBAC_msi_m = 0x00000001,
8904 + PCILBAC_msi_mem_v = 0,
8905 + PCILBAC_msi_io_v = 1,
8906 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
8907 + PCILBAC_size_m = 0x0000007c,
8908 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
8909 + PCILBAC_sb_m = 0x00000080,
8910 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
8911 + PCILBAC_rt_m = 0x00000100,
8912 + PCILBAC_rt_noprefetch_v = 0, // mem read
8913 + PCILBAC_rt_prefetch_v = 1, // mem readline
8916 +/*******************************************************************************
8918 + * PCI Local Base Address [0|1|2|3] Mapping Register
8920 + ******************************************************************************/
8922 + PCILBAM_maddr_b = 8,
8923 + PCILBAM_maddr_m = 0xffffff00,
8926 +/*******************************************************************************
8928 + * PCI Decoupled Access Control Register
8930 + ******************************************************************************/
8933 + PCIDAC_den_m = 0x00000001,
8936 +/*******************************************************************************
8938 + * PCI Decoupled Access Status Register
8940 + ******************************************************************************/
8943 + PCIDAS_d_m = 0x00000001,
8945 + PCIDAS_b_m = 0x00000002,
8947 + PCIDAS_e_m = 0x00000004,
8949 + PCIDAS_ofe_m = 0x00000008,
8951 + PCIDAS_off_m = 0x00000010,
8953 + PCIDAS_ife_m = 0x00000020,
8955 + PCIDAS_iff_m = 0x00000040,
8958 +/*******************************************************************************
8960 + * PCI DMA Channel 8 Configuration Register
8962 + ******************************************************************************/
8965 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
8966 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
8967 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
8968 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
8971 +/*******************************************************************************
8973 + * PCI DMA Channel 9 Configuration Register
8975 + ******************************************************************************/
8978 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
8979 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
8982 +/*******************************************************************************
8984 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
8986 + ******************************************************************************/
8988 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
8989 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
8990 + // These are for reads (DMA channel 8)
8991 + PCIDMAD_devcmd_mr_v = 0, //memory read
8992 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
8993 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
8994 + PCIDMAD_devcmd_ior_v = 3, //I/O read
8995 + // These are for writes (DMA channel 9)
8996 + PCIDMAD_devcmd_mw_v = 0, //memory write
8997 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
8998 + PCIDMAD_devcmd_iow_v = 3, //I/O write
9000 + // Swap byte field applies to both DMA channel 8 and 9
9001 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
9002 + PCIDMAD_sb_m = 0x01000000, // swap byte field
9006 +/*******************************************************************************
9008 + * PCI Target Control Register
9010 + ******************************************************************************/
9013 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
9014 + PCITC_rtimer_m = 0x000000ff,
9015 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
9016 + PCITC_dtimer_m = 0x0000ff00,
9017 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
9018 + PCITC_rdr_m = 0x00040000,
9019 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
9020 + PCITC_ddt_m = 0x00080000,
9022 +/*******************************************************************************
9024 + * PCI messaging unit [applies to both inbound and outbound registers ]
9026 + ******************************************************************************/
9029 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
9030 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
9031 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
9032 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
9033 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
9034 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
9042 +#define PCI_MSG_VirtualAddress 0xB8088010
9043 +#define rc32434_pci ((volatile PCI_t) PCI0_VirtualAddress)
9044 +#define rc32434_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
9046 +#define PCIM_SHFT 0x6
9047 +#define PCIM_BIT_LEN 0x7
9048 +#define PCIM_H_EA 0x3
9049 +#define PCIM_H_IA_FIX 0x4
9050 +#define PCIM_H_IA_RR 0x5
9052 +#define PCI_ADDR_START 0x13000000
9055 +#define PCI_ADDR_START 0x50000000
9057 +#define CPUTOPCI_MEM_WIN 0x02000000
9058 +#define CPUTOPCI_IO_WIN 0x00100000
9059 +#define PCILBA_SIZE_SHFT 2
9060 +#define PCILBA_SIZE_MASK 0x1F
9061 +#define SIZE_256MB 0x1C
9062 +#define SIZE_128MB 0x1B
9063 +#define SIZE_64MB 0x1A
9064 +#define SIZE_32MB 0x19
9065 +#define SIZE_16MB 0x18
9066 +#define SIZE_4MB 0x16
9067 +#define SIZE_2MB 0x15
9068 +#define SIZE_1MB 0x14
9069 +#define KORINA_CONFIG0_ADDR 0x80000000
9070 +#define KORINA_CONFIG1_ADDR 0x80000004
9071 +#define KORINA_CONFIG2_ADDR 0x80000008
9072 +#define KORINA_CONFIG3_ADDR 0x8000000C
9073 +#define KORINA_CONFIG4_ADDR 0x80000010
9074 +#define KORINA_CONFIG5_ADDR 0x80000014
9075 +#define KORINA_CONFIG6_ADDR 0x80000018
9076 +#define KORINA_CONFIG7_ADDR 0x8000001C
9077 +#define KORINA_CONFIG8_ADDR 0x80000020
9078 +#define KORINA_CONFIG9_ADDR 0x80000024
9079 +#define KORINA_CONFIG10_ADDR 0x80000028
9080 +#define KORINA_CONFIG11_ADDR 0x8000002C
9081 +#define KORINA_CONFIG12_ADDR 0x80000030
9082 +#define KORINA_CONFIG13_ADDR 0x80000034
9083 +#define KORINA_CONFIG14_ADDR 0x80000038
9084 +#define KORINA_CONFIG15_ADDR 0x8000003C
9085 +#define KORINA_CONFIG16_ADDR 0x80000040
9086 +#define KORINA_CONFIG17_ADDR 0x80000044
9087 +#define KORINA_CONFIG18_ADDR 0x80000048
9088 +#define KORINA_CONFIG19_ADDR 0x8000004C
9089 +#define KORINA_CONFIG20_ADDR 0x80000050
9090 +#define KORINA_CONFIG21_ADDR 0x80000054
9091 +#define KORINA_CONFIG22_ADDR 0x80000058
9092 +#define KORINA_CONFIG23_ADDR 0x8000005C
9093 +#define KORINA_CONFIG24_ADDR 0x80000060
9094 +#define KORINA_CONFIG25_ADDR 0x80000064
9095 +#define KORINA_CMD (PCFG04_command_ioena_m | \
9096 + PCFG04_command_memena_m | \
9097 + PCFG04_command_bmena_m | \
9098 + PCFG04_command_mwinv_m | \
9099 + PCFG04_command_parena_m | \
9100 + PCFG04_command_serrena_m )
9102 +#define KORINA_STAT (PCFG04_status_mdpe_m | \
9103 + PCFG04_status_sta_m | \
9104 + PCFG04_status_rta_m | \
9105 + PCFG04_status_rma_m | \
9106 + PCFG04_status_sse_m | \
9107 + PCFG04_status_pe_m)
9109 +#define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
9111 +#define KORINA_REVID 0
9112 +#define KORINA_CLASS_CODE 0
9113 +#define KORINA_CNFG2 ((KORINA_CLASS_CODE<<8) | \
9116 +#define KORINA_CACHE_LINE_SIZE 4
9117 +#define KORINA_MASTER_LAT 0x3c
9118 +#define KORINA_HEADER_TYPE 0
9119 +#define KORINA_BIST 0
9121 +#define KORINA_CNFG3 ((KORINA_BIST << 24) | \
9122 + (KORINA_HEADER_TYPE<<16) | \
9123 + (KORINA_MASTER_LAT<<8) | \
9124 + KORINA_CACHE_LINE_SIZE )
9126 +#define KORINA_BAR0 0x00000008 /* 128 MB Memory */
9127 +#define KORINA_BAR1 0x18800001 /* 1 MB IO */
9128 +#define KORINA_BAR2 0x18000001 /* 2 MB IO window for Korina
9129 + internal Registers */
9130 +#define KORINA_BAR3 0x48000008 /* Spare 128 MB Memory */
9132 +#define KORINA_CNFG4 KORINA_BAR0
9133 +#define KORINA_CNFG5 KORINA_BAR1
9134 +#define KORINA_CNFG6 KORINA_BAR2
9135 +#define KORINA_CNFG7 KORINA_BAR3
9137 +#define KORINA_SUBSYS_VENDOR_ID 0x011d
9138 +#define KORINA_SUBSYSTEM_ID 0x0214
9139 +#define KORINA_CNFG8 0
9140 +#define KORINA_CNFG9 0
9141 +#define KORINA_CNFG10 0
9142 +#define KORINA_CNFG11 ((KORINA_SUBSYS_VENDOR_ID<<16) | \
9143 + KORINA_SUBSYSTEM_ID)
9144 +#define KORINA_INT_LINE 1
9145 +#define KORINA_INT_PIN 1
9146 +#define KORINA_MIN_GNT 8
9147 +#define KORINA_MAX_LAT 0x38
9148 +#define KORINA_CNFG12 0
9149 +#define KORINA_CNFG13 0
9150 +#define KORINA_CNFG14 0
9151 +#define KORINA_CNFG15 ((KORINA_MAX_LAT<<24) | \
9152 + (KORINA_MIN_GNT<<16) | \
9153 + (KORINA_INT_PIN<<8) | \
9155 +#define KORINA_RETRY_LIMIT 0x80
9156 +#define KORINA_TRDY_LIMIT 0x80
9157 +#define KORINA_CNFG16 ((KORINA_RETRY_LIMIT<<8) | \
9158 + KORINA_TRDY_LIMIT)
9159 +#define PCI_PBAxC_R 0x0
9160 +#define PCI_PBAxC_RL 0x1
9161 +#define PCI_PBAxC_RM 0x2
9162 +#define SIZE_SHFT 2
9164 +#if defined(__MIPSEB__)
9165 +#define KORINA_PBA0C ( PCIPBAC_mrl_m | PCIPBAC_sb_m | \
9166 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
9168 + (SIZE_128MB<<SIZE_SHFT) | \
9171 +#define KORINA_PBA0C ( PCIPBAC_mrl_m | \
9172 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
9174 + (SIZE_128MB<<SIZE_SHFT) | \
9177 +#define KORINA_CNFG17 KORINA_PBA0C
9178 +#define KORINA_PBA0M 0x0
9179 +#define KORINA_CNFG18 KORINA_PBA0M
9181 +#if defined(__MIPSEB__)
9182 +#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
9185 +#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | \
9188 +#define KORINA_CNFG19 KORINA_PBA1C
9189 +#define KORINA_PBA1M 0x0
9190 +#define KORINA_CNFG20 KORINA_PBA1M
9192 +#if defined(__MIPSEB__)
9193 +#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
9196 +#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | \
9199 +#define KORINA_CNFG21 KORINA_PBA2C
9200 +#define KORINA_PBA2M 0x18000000
9201 +#define KORINA_CNFG22 KORINA_PBA2M
9202 +#define KORINA_PBA3C 0
9203 +#define KORINA_CNFG23 KORINA_PBA3C
9204 +#define KORINA_PBA3M 0
9205 +#define KORINA_CNFG24 KORINA_PBA3M
9209 +#define PCITC_DTIMER_VAL 8
9210 +#define PCITC_RTIMER_VAL 0x10
9215 +#endif // __IDT_PCI_H__
9219 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_rst.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_rst.h
9220 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_rst.h 1970-01-01 01:00:00.000000000 +0100
9221 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_rst.h 2006-01-10 00:32:33.000000000 +0100
9223 +/**************************************************************************
9225 + * BRIEF MODULE DESCRIPTION
9226 + * Reset register definitions.
9228 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9230 + * This program is free software; you can redistribute it and/or modify it
9231 + * under the terms of the GNU General Public License as published by the
9232 + * Free Software Foundation; either version 2 of the License, or (at your
9233 + * option) any later version.
9235 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9236 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9237 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9238 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9239 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9240 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9241 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9242 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9243 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9244 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9246 + * You should have received a copy of the GNU General Public License along
9247 + * with this program; if not, write to the Free Software Foundation, Inc.,
9248 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9251 + **************************************************************************
9252 + * May 2004 rkt, neb.
9258 + **************************************************************************
9261 +#ifndef __IDT_RST_H__
9262 +#define __IDT_RST_H__
9266 + RST0_PhysicalAddress = 0x18000000,
9267 + RST_PhysicalAddress = RST0_PhysicalAddress, // Default
9269 + RST0_VirtualAddress = 0xb8000000,
9270 + RST_VirtualAddress = RST0_VirtualAddress, // Default
9273 +typedef struct RST_s
9275 + u32 filler [0x0006] ;
9277 + u32 filler2 [0x2000-8] ; // Pad out to offset 0x8000
9281 +} volatile * RST_t ;
9286 + SYSID_rev_m = 0x000000ff,
9288 + SYSID_imp_m = 0x000fff00,
9289 + SYSID_vendor_b = 8,
9290 + SYSID_vendor_m = 0xfff00000,
9293 + BCV_pll_m = 0x0000000f,
9294 + BCV_pll_PLLBypass_v = 0x0, // PCLK=1*CLK.
9295 + BCV_pll_Mul3_v = 0x1, // PCLK=3*CLK.
9296 + BCV_pll_Mul4_v = 0x2, // PCLK=4*CLK.
9297 + BCV_pll_SlowMul5_v = 0x3, // PCLK=5*CLK.
9298 + BCV_pll_Mul5_v = 0x4, // PCLK=5*CLK.
9299 + BCV_pll_SlowMul6_v = 0x5, // PCLK=6*CLK.
9300 + BCV_pll_Mul6_v = 0x6, // PCLK=6*CLK.
9301 + BCV_pll_Mul8_v = 0x7, // PCLK=8*CLK.
9302 + BCV_pll_Mul10_v = 0x8, // PCLK=10*CLK.
9303 + BCV_pll_Res9_v = 0x9,
9304 + BCV_pll_Res10_v = 0xa,
9305 + BCV_pll_Res11_v = 0xb,
9306 + BCV_pll_Res12_v = 0xc,
9307 + BCV_pll_Res13_v = 0xd,
9308 + BCV_pll_Res14_v = 0xe,
9309 + BCV_pll_Res15_v = 0xf,
9311 + BCV_clkDiv_m = 0x00000030,
9312 + BCV_clkDiv_Div1_v = 0x0,
9313 + BCV_clkDiv_Div2_v = 0x1,
9314 + BCV_clkDiv_Div4_v = 0x2,
9315 + BCV_clkDiv_Res3_v = 0x3,
9316 + BCV_bigEndian_b = 6,
9317 + BCV_bigEndian_m = 0x00000040,
9318 + BCV_resetFast_b = 7,
9319 + BCV_resetFast_m = 0x00000080,
9320 + BCV_pciMode_b = 8,
9321 + BCV_pciMode_m = 0x00000700,
9322 + BCV_pciMode_disabled_v = 0, // PCI is disabled.
9323 + BCV_pciMode_tnr_v = 1, // satellite Target Not Ready.
9324 + BCV_pciMode_suspended_v = 2, // satellite with suspended CPU.
9325 + BCV_pciMode_external_v = 3, // host, external arbiter.
9326 + BCV_pciMode_fixed_v = 4, // host, fixed priority arbiter.
9327 + BCV_pciMode_roundRobin_v= 5, // host, round robin arbiter.
9328 + BCV_pciMode_res6_v = 6,
9329 + BCV_pciMode_res7_v = 7,
9330 + BCV_watchDisable_b = 11,
9331 + BCV_watchDisable_m = 0x00000800,
9333 + BCV_res12_m = 0x00001000,
9335 + BCV_res13_m = 0x00002000,
9337 + BCV_res14_m = 0x00004000,
9339 + BCV_res15_m = 0x00008000,
9341 +#endif // __IDT_RST_H__
9342 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_spi.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_spi.h
9343 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_spi.h 1970-01-01 01:00:00.000000000 +0100
9344 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_spi.h 2006-01-10 00:32:33.000000000 +0100
9346 +/**************************************************************************
9348 + * BRIEF MODULE DESCRIPTION
9349 + * Serial Peripheral Interface register definitions.
9351 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9353 + * This program is free software; you can redistribute it and/or modify it
9354 + * under the terms of the GNU General Public License as published by the
9355 + * Free Software Foundation; either version 2 of the License, or (at your
9356 + * option) any later version.
9358 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9359 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9360 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9361 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9362 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9363 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9364 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9365 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9366 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9367 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9369 + * You should have received a copy of the GNU General Public License along
9370 + * with this program; if not, write to the Free Software Foundation, Inc.,
9371 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9374 + **************************************************************************
9375 + * May 2004 rkt, neb.
9381 + **************************************************************************
9384 +#ifndef __IDT_SPI_H__
9385 +#define __IDT_SPI_H__
9389 + SPI0_PhysicalAddress = 0x18070000,
9390 + SPI_PhysicalAddress = SPI0_PhysicalAddress,
9392 + SPI0_VirtualAddress = 0xB8070000,
9393 + SPI_VirtualAddress = SPI0_VirtualAddress,
9398 + u32 spcp ; // prescalar. 0=off, * spiClk = sysClk/(2*(spcp+1)*SPR)
9399 + u32 spc ; // spi control reg use SPC_
9400 + u32 sps ; // spi status reg use SPS_
9401 + u32 spd ; // spi data reg use SPD_
9402 + u32 siofunc ; // serial IO function use SIOFUNC_
9403 + u32 siocfg ; // serial IO config use SIOCFG_
9404 + u32 siod; // serial IO data use SIOD_
9405 +} volatile *SPI_t ;
9410 + SPCP_div_m = 0x000000ff,
9412 + SPC_spr_m = 0x00000003,
9413 + SPC_spr_div2_v = 0,
9414 + SPC_spr_div4_v = 1,
9415 + SPC_spr_div16_v = 2,
9416 + SPC_spr_div32_v = 3,
9418 + SPC_cpha_m = 0x00000004,
9420 + SPC_cpol_m = 0x00000008,
9422 + SPC_mstr_m = 0x00000010,
9424 + SPC_spe_m = 0x00000040,
9426 + SPC_spie_m = 0x00000080,
9429 + SPS_modf_m = 0x00000010,
9431 + SPS_wcol_m = 0x00000040,
9433 + SPS_spif_m = 0x00000070,
9436 + SPD_data_m = 0x000000ff,
9438 + SIOFUNC_sdo_b = 0,
9439 + SIOFUNC_sdo_m = 0x00000001,
9440 + SIOFUNC_sdi_b = 1,
9441 + SIOFUNC_sdi_m = 0x00000002,
9442 + SIOFUNC_sck_b = 2,
9443 + SIOFUNC_sck_m = 0x00000004,
9444 + SIOFUNC_pci_b = 3,
9445 + SIOFUNC_pci_m = 0x00000008,
9448 + SIOCFG_sdo_m = 0x00000001,
9450 + SIOCFG_sdi_m = 0x00000002,
9452 + SIOCFG_sck_m = 0x00000004,
9454 + SIOCFG_pci_m = 0x00000008,
9457 + SIOD_sdo_m = 0x00000001,
9459 + SIOD_sdi_m = 0x00000002,
9461 + SIOD_sck_m = 0x00000004,
9463 + SIOD_pci_m = 0x00000008,
9465 +#endif // __IDT_SPI_H__
9466 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_timer.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_timer.h
9467 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_timer.h 1970-01-01 01:00:00.000000000 +0100
9468 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_timer.h 2006-01-10 00:32:33.000000000 +0100
9470 +/**************************************************************************
9472 + * BRIEF MODULE DESCRIPTION
9473 + * Definitions for timer registers
9475 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9477 + * This program is free software; you can redistribute it and/or modify it
9478 + * under the terms of the GNU General Public License as published by the
9479 + * Free Software Foundation; either version 2 of the License, or (at your
9480 + * option) any later version.
9482 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9483 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9484 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9485 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9486 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9487 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9488 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9489 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9490 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9491 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9493 + * You should have received a copy of the GNU General Public License along
9494 + * with this program; if not, write to the Free Software Foundation, Inc.,
9495 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9498 + **************************************************************************
9499 + * May 2004 rkt,neb.
9505 + **************************************************************************
9508 +#ifndef __IDT_TIM_H__
9509 +#define __IDT_TIM_H__
9513 + TIM0_PhysicalAddress = 0x18028000,
9514 + TIM_PhysicalAddress = TIM0_PhysicalAddress, // Default
9516 + TIM0_VirtualAddress = 0xb8028000,
9517 + TIM_VirtualAddress = TIM0_VirtualAddress, // Default
9529 + u32 ctc ; //use CTC_
9532 +typedef struct TIM_s
9534 + struct TIM_CNTR_s tim [TIM_Count] ;
9535 + u32 rcount ; //use RCOUNT_
9536 + u32 rcompare ; //use RCOMPARE_
9537 + u32 rtc ; //use RTC_
9538 +} volatile * TIM_t ;
9543 + CTC_en_m = 0x00000001,
9545 + CTC_to_m = 0x00000002,
9547 + RCOUNT_count_b = 0,
9548 + RCOUNT_count_m = 0x0000ffff,
9549 + RCOMPARE_compare_b = 0,
9550 + RCOMPARE_compare_m = 0x0000ffff,
9552 + RTC_ce_m = 0x00000001,
9554 + RTC_to_m = 0x00000002,
9556 + RTC_rqe_m = 0x00000004,
9559 +#endif // __IDT_TIM_H__
9561 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_uart.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_uart.h
9562 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_uart.h 1970-01-01 01:00:00.000000000 +0100
9563 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_uart.h 2006-01-10 00:32:33.000000000 +0100
9565 +/**************************************************************************
9567 + * BRIEF MODULE DESCRIPTION
9568 + * UART register definitions
9570 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9572 + * This program is free software; you can redistribute it and/or modify it
9573 + * under the terms of the GNU General Public License as published by the
9574 + * Free Software Foundation; either version 2 of the License, or (at your
9575 + * option) any later version.
9577 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9578 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9579 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9580 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9581 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9582 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9583 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9584 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9585 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9586 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9588 + * You should have received a copy of the GNU General Public License along
9589 + * with this program; if not, write to the Free Software Foundation, Inc.,
9590 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9593 + **************************************************************************
9594 + * May 2004 rkt, neb.
9600 + **************************************************************************
9603 +#ifndef __IDT_UART_H__
9604 +#define __IDT_UART_H__
9608 + UART0_PhysicalAddress = 0x1c000000,
9609 + UART_PhysicalAddress = UART0_PhysicalAddress, // Default
9611 + UART0_VirtualAddress = 0xbc000000,
9612 + UART_VirtualAddress = UART0_VirtualAddress, // Default
9616 + * Register definitions are in bytes so we can handle endian problems.
9619 +typedef struct UART_s
9623 + u32 const uartrb ; // 0x00 - DLAB=0, read.
9624 + u32 uartth ; // 0x00 - DLAB=0, write.
9625 + u32 uartdll ; // 0x00 - DLAB=1, read/write.
9630 + u32 uartie ; // 0x04 - DLAB=0, read/write.
9631 + u32 uartdlh ; // 0x04 - DLAB=1, read/write.
9635 + u32 const uartii ; // 0x08 - DLAB=0, read.
9636 + u32 uartfc ; // 0x08 - DLAB=0, write.
9639 + u32 uartlc ; // 0x0c
9640 + u32 uartmc ; // 0x10
9641 + u32 uartls ; // 0x14
9642 + u32 uartms ; // 0x18
9643 + u32 uarts ; // 0x1c
9644 +} volatile *UART_t ;
9646 +// Reset registers.
9647 +typedef u32 volatile *UARTRR_t ;
9652 + UARTIE_rda_m = 0x00000001,
9654 + UARTIE_the_m = 0x00000002,
9656 + UARTIE_rls_m = 0x00000004,
9658 + UARTIE_ems_m = 0x00000008,
9661 + UARTII_pi_m = 0x00000001,
9663 + UARTII_iid_m = 0x0000000e,
9664 + UARTII_iid_ms_v = 0, // Modem stat-CTS,DSR,RI or DCD.
9665 + UARTII_iid_thre_v = 1, // Trans. Holding Reg. empty.
9666 + UARTII_iid_rda_v = 2, // Receive data available
9667 + UARTII_iid_rls_v = 3, // Overrun, parity, etc, error.
9668 + UARTII_iid_res4_v = 4, // reserved.
9669 + UARTII_iid_res5_v = 5, // reserved.
9670 + UARTII_iid_cto_v = 6, // Character timeout.
9671 + UARTII_iid_res7_v = 7, // reserved.
9674 + UARTFC_en_m = 0x00000001,
9676 + UARTFC_rr_m = 0x00000002,
9678 + UARTFC_tr_m = 0x00000004,
9680 + UARTFC_dms_m = 0x00000008,
9682 + UARTFC_rt_m = 0x000000c0,
9683 + UARTFC_rt_1Byte_v = 0,
9684 + UARTFC_rt_4Byte_v = 1,
9685 + UARTFC_rt_8Byte_v = 2,
9686 + UARTFC_rt_14Byte_v = 3,
9689 + UARTLC_wls_m = 0x00000003,
9690 + UARTLC_wls_5Bits_v = 0,
9691 + UARTLC_wls_6Bits_v = 1,
9692 + UARTLC_wls_7Bits_v = 2,
9693 + UARTLC_wls_8Bits_v = 3,
9695 + UARTLC_stb_m = 0x00000004,
9697 + UARTLC_pen_m = 0x00000008,
9699 + UARTLC_eps_m = 0x00000010,
9701 + UARTLC_sp_m = 0x00000020,
9703 + UARTLC_sb_m = 0x00000040,
9704 + UARTLC_dlab_b = 7,
9705 + UARTLC_dlab_m = 0x00000080,
9708 + UARTMC_dtr_m = 0x00000001,
9710 + UARTMC_rts_m = 0x00000002,
9712 + UARTMC_o1_m = 0x00000004,
9714 + UARTMC_o2_m = 0x00000008,
9716 + UARTMC_lp_m = 0x00000010,
9719 + UARTLS_dr_m = 0x00000001,
9721 + UARTLS_oe_m = 0x00000002,
9723 + UARTLS_pe_m = 0x00000004,
9725 + UARTLS_fe_m = 0x00000008,
9727 + UARTLS_bi_m = 0x00000010,
9729 + UARTLS_thr_m = 0x00000020,
9731 + UARTLS_te_m = 0x00000040,
9733 + UARTLS_rfe_m = 0x00000080,
9735 + UARTMS_dcts_b = 0,
9736 + UARTMS_dcts_m = 0x00000001,
9737 + UARTMS_ddsr_b = 1,
9738 + UARTMS_ddsr_m = 0x00000002,
9739 + UARTMS_teri_b = 2,
9740 + UARTMS_teri_m = 0x00000004,
9741 + UARTMS_ddcd_b = 3,
9742 + UARTMS_ddcd_m = 0x00000008,
9744 + UARTMS_cts_m = 0x00000010,
9746 + UARTMS_dsr_m = 0x00000020,
9748 + UARTMS_ri_m = 0x00000040,
9750 + UARTMS_dcd_m = 0x00000080,
9753 +#endif // __IDT_UART_H__
9754 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_dma.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_dma.h
9755 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_dma.h 1970-01-01 01:00:00.000000000 +0100
9756 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_dma.h 2006-01-10 00:32:33.000000000 +0100
9758 +/**************************************************************************
9760 + * BRIEF MODULE DESCRIPTION
9761 + * Register definitions for IDT RC32438 DMA.
9763 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9765 + * This program is free software; you can redistribute it and/or modify it
9766 + * under the terms of the GNU General Public License as published by the
9767 + * Free Software Foundation; either version 2 of the License, or (at your
9768 + * option) any later version.
9770 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9771 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9772 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9773 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9774 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9775 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9776 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9777 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9778 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9779 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9781 + * You should have received a copy of the GNU General Public License along
9782 + * with this program; if not, write to the Free Software Foundation, Inc.,
9783 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9786 + **************************************************************************
9787 + * May 2004 P. Sadik.
9793 + **************************************************************************
9795 +#ifndef __IDT_RC32438_DMA_H__
9796 +#define __IDT_RC32438_DMA_H__
9799 + DMA0_PhysicalAddress = 0x18040000,
9800 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
9802 + DMA0_VirtualAddress = 0xb8040000,
9803 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
9807 + * DMA descriptor (in physical memory).
9810 +typedef struct DMAD_s
9812 + u32 control ; // Control. use DMAD_*
9813 + u32 ca ; // Current Address.
9814 + u32 devcs ; // Device control and status.
9815 + u32 link ; // Next descriptor in chain.
9816 +} volatile *DMAD_t ;
9820 + DMAD_size = sizeof (struct DMAD_s),
9821 + DMAD_count_b = 0, // in DMAD_t -> control
9822 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
9823 + DMAD_ds_b = 20, // in DMAD_t -> control
9824 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
9825 + DMAD_ds_extToMem0_v = 0,
9826 + DMAD_ds_memToExt0_v = 1,
9827 + DMAD_ds_extToMem1_v = 0,
9828 + DMAD_ds_memToExt1_v = 1,
9829 + DMAD_ds_ethRcv0_v = 0,
9830 + DMAD_ds_ethXmt0_v = 0,
9831 + DMAD_ds_ethRcv1_v = 0,
9832 + DMAD_ds_ethXmt2_v = 0,
9833 + DMAD_ds_memToFifo_v = 0,
9834 + DMAD_ds_fifoToMem_v = 0,
9835 + DMAD_ds_rng_de_v = 1,//randomNumberGenerator on LC/DE
9836 + DMAD_ds_pciToMem_v = 0,
9837 + DMAD_ds_memToPci_v = 0,
9838 + DMAD_ds_securityInput_v = 0,
9839 + DMAD_ds_securityOutput_v = 0,
9840 + DMAD_ds_rng_se_v = 0,//randomNumberGenerator on SE
9842 + DMAD_devcmd_b = 22, // in DMAD_t -> control
9843 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
9844 + DMAD_devcmd_byte_v = 0, //memory-to-memory
9845 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
9846 + DMAD_devcmd_word_v = 2, //memory-to-memory
9847 + DMAD_devcmd_2words_v = 3, //memory-to-memory
9848 + DMAD_devcmd_4words_v = 4, //memory-to-memory
9849 + DMAD_devcmd_6words_v = 5, //memory-to-memory
9850 + DMAD_devcmd_8words_v = 6, //memory-to-memory
9851 + DMAD_devcmd_16words_v = 7, //memory-to-memory
9852 + DMAD_cof_b = 25, // chain on finished
9853 + DMAD_cof_m = 0x02000000, //
9854 + DMAD_cod_b = 26, // chain on done
9855 + DMAD_cod_m = 0x04000000, //
9856 + DMAD_iof_b = 27, // interrupt on finished
9857 + DMAD_iof_m = 0x08000000, //
9858 + DMAD_iod_b = 28, // interrupt on done
9859 + DMAD_iod_m = 0x10000000, //
9860 + DMAD_t_b = 29, // terminated
9861 + DMAD_t_m = 0x20000000, //
9862 + DMAD_d_b = 30, // done
9863 + DMAD_d_m = 0x40000000, //
9864 + DMAD_f_b = 31, // finished
9865 + DMAD_f_m = 0x80000000, //
9869 + * DMA register (within Internal Register Map).
9874 + u32 dmac ; // Control.
9875 + u32 dmas ; // Status.
9876 + u32 dmasm ; // Mask.
9877 + u32 dmadptr ; // Descriptor pointer.
9878 + u32 dmandptr ; // Next descriptor pointer.
9881 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
9883 +//DMA_Channels use DMACH_count instead
9887 + DMAC_run_b = 0, //
9888 + DMAC_run_m = 0x00000001, //
9889 + DMAC_dm_b = 1, // done mask
9890 + DMAC_dm_m = 0x00000002, //
9891 + DMAC_mode_b = 2, //
9892 + DMAC_mode_m = 0x0000000c, //
9893 + DMAC_mode_auto_v = 0,
9894 + DMAC_mode_burst_v = 1,
9895 + DMAC_mode_transfer_v = 2, //usually used
9896 + DMAC_mode_reserved_v = 3,
9898 + DMAC_a_m = 0x00000010, //
9900 + DMAS_f_b = 0, // finished (sticky)
9901 + DMAS_f_m = 0x00000001, //
9902 + DMAS_d_b = 1, // done (sticky)
9903 + DMAS_d_m = 0x00000002, //
9904 + DMAS_c_b = 2, // chain (sticky)
9905 + DMAS_c_m = 0x00000004, //
9906 + DMAS_e_b = 3, // error (sticky)
9907 + DMAS_e_m = 0x00000008, //
9908 + DMAS_h_b = 4, // halt (sticky)
9909 + DMAS_h_m = 0x00000010, //
9911 + DMASM_f_b = 0, // finished (1=mask)
9912 + DMASM_f_m = 0x00000001, //
9913 + DMASM_d_b = 1, // done (1=mask)
9914 + DMASM_d_m = 0x00000002, //
9915 + DMASM_c_b = 2, // chain (1=mask)
9916 + DMASM_c_m = 0x00000004, //
9917 + DMASM_e_b = 3, // error (1=mask)
9918 + DMASM_e_m = 0x00000008, //
9919 + DMASM_h_b = 4, // halt (1=mask)
9920 + DMASM_h_m = 0x00000010, //
9924 + * DMA channel definitions
9929 + DMACH_extToMem0 = 0,
9930 + DMACH_memToExt0 = 0,
9931 + DMACH_extToMem1 = 1,
9932 + DMACH_memToExt1 = 1,
9933 + DMACH_ethRcv0 = 2,
9934 + DMACH_ethXmt0 = 3,
9935 + DMACH_ethRcv1 = 4,
9936 + DMACH_ethXmt2 = 5,
9937 + DMACH_memToFifo = 6,
9938 + DMACH_fifoToMem = 7,
9939 + DMACH_rng_de = 7,//randomNumberGenerator on LC/DE
9940 + DMACH_pciToMem = 8,
9941 + DMACH_memToPci = 9,
9942 + DMACH_securityInput = 10,
9943 + DMACH_securityOutput = 11,
9944 + DMACH_rng_se = 12, //randomNumberGenerator on SE
9946 + DMACH_count //must be last
9950 +typedef struct DMAC_s
9952 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
9953 +} volatile *DMA_t ;
9957 + * External DMA parameters
9962 + DMADEVCMD_ts_b = 0, // ts field in devcmd
9963 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
9964 + DMADEVCMD_ts_byte_v = 0,
9965 + DMADEVCMD_ts_halfword_v = 1,
9966 + DMADEVCMD_ts_word_v = 2,
9967 + DMADEVCMD_ts_2word_v = 3,
9968 + DMADEVCMD_ts_4word_v = 4,
9969 + DMADEVCMD_ts_6word_v = 5,
9970 + DMADEVCMD_ts_8word_v = 6,
9971 + DMADEVCMD_ts_16word_v = 7
9975 +#if 1 // aws - Compatibility.
9976 +# define EXTDMA_ts_b DMADEVCMD_ts_b
9977 +# define EXTDMA_ts_m DMADEVCMD_ts_m
9978 +# define EXTDMA_ts_byte_v DMADEVCMD_ts_byte_v
9979 +# define EXTDMA_ts_halfword_v DMADEVCMD_ts_halfword_v
9980 +# define EXTDMA_ts_word_v DMADEVCMD_ts_word_v
9981 +# define EXTDMA_ts_2word_v DMADEVCMD_ts_2word_v
9982 +# define EXTDMA_ts_4word_v DMADEVCMD_ts_4word_v
9983 +# define EXTDMA_ts_6word_v DMADEVCMD_ts_6word_v
9984 +# define EXTDMA_ts_8word_v DMADEVCMD_ts_8word_v
9985 +# define EXTDMA_ts_16word_v DMADEVCMD_ts_16word_v
9986 +#endif // aws - Compatibility.
9988 +#endif //__IDT_RC32438_DMA_H__
9989 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h
9990 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h 1970-01-01 01:00:00.000000000 +0100
9991 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h 2006-01-10 00:32:33.000000000 +0100
9993 +/**************************************************************************
9995 + * BRIEF MODULE DESCRIPTION
9996 + * DMA operations for IDT RC32438.
9998 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10000 + * This program is free software; you can redistribute it and/or modify it
10001 + * under the terms of the GNU General Public License as published by the
10002 + * Free Software Foundation; either version 2 of the License, or (at your
10003 + * option) any later version.
10005 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10006 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10007 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10008 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10009 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10010 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10011 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10012 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10013 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10014 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10016 + * You should have received a copy of the GNU General Public License along
10017 + * with this program; if not, write to the Free Software Foundation, Inc.,
10018 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10021 + **************************************************************************
10022 + * May 2004 P. Sadik.
10024 + * Initial Release
10028 + **************************************************************************
10031 +#ifndef __IDT_RC32438_DMA_V_H__
10032 +#define __IDT_RC32438_DMA_V_H__
10033 +#include <asm/idt-boards/rc32438/rc32438_dma.h>
10035 +#define DMA_CHAN_OFFSET 0x14
10036 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
10037 +#define DMA_COUNT(count) \
10038 + ((count) & DMAD_count_m)
10040 +#define DMA_HALT_TIMEOUT 500
10043 +static inline int rc32438_halt_dma(DMA_Chan_t ch)
10046 + if (rc32438_readl(&ch->dmac) & DMAC_run_m) {
10047 + rc32438_writel(0, &ch->dmac);
10049 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
10050 + if (rc32438_readl(&ch->dmas) & DMAS_h_m) {
10051 + rc32438_writel(0, &ch->dmas);
10058 + return timeout ? 0 : 1;
10064 +static inline void rc32438_start_dma(DMA_Chan_t ch, u32 dma_addr)
10066 + rc32438_writel(0, &ch->dmandptr);
10067 + rc32438_writel(dma_addr, &ch->dmadptr);
10070 +static inline void rc32438_chain_dma(DMA_Chan_t ch, u32 dma_addr)
10072 + rc32438_writel(dma_addr, &ch->dmandptr);
10074 +#endif //__IDT_RC32438_DMA_V_H__
10075 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_eth.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_eth.h
10076 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_eth.h 1970-01-01 01:00:00.000000000 +0100
10077 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_eth.h 2006-01-10 00:32:33.000000000 +0100
10079 +/**************************************************************************
10081 + * BRIEF MODULE DESCRIPTION
10082 + * Definitions for IDT EB438 ethernet
10084 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10086 + * This program is free software; you can redistribute it and/or modify it
10087 + * under the terms of the GNU General Public License as published by the
10088 + * Free Software Foundation; either version 2 of the License, or (at your
10089 + * option) any later version.
10091 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10092 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10093 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10094 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10095 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10096 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10097 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10098 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10099 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10100 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10102 + * You should have received a copy of the GNU General Public License along
10103 + * with this program; if not, write to the Free Software Foundation, Inc.,
10104 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10107 + **************************************************************************
10108 + * May 2004 P. Sadik.
10110 + * Initial Release
10114 + **************************************************************************
10117 +#ifndef __IDT_RC32438_ETH_H__
10118 +#define __IDT_RC32438_ETH_H__
10121 + ETH0_PhysicalAddress = 0x18058000,
10122 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
10124 + ETH0_VirtualAddress = 0xb8058000,
10125 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
10126 + ETH1_PhysicalAddress = 0x18060000,
10127 + ETH1_VirtualAddress = 0xb8060000, // Default
10137 + u32 ethu0 [4] ; // Reserved.
10140 + u32 eth_u1 [10] ; // Reserved.
10142 + u32 eth_u2 [42] ; // Reserved.
10157 + u32 eth_u9 [50] ; // Reserved.
10164 + u32 eth_u10 ; // Reserved.
10172 + u32 eth_u11 ; // Reserved.
10173 + u32 eth_u12 ; // Reserved.
10177 +} volatile *ETH_t;
10181 + ETHINTFC_en_b = 0,
10182 + ETHINTFC_en_m = 0x00000001,
10183 + ETHINTFC_its_b = 1,
10184 + ETHINTFC_its_m = 0x00000002,
10185 + ETHINTFC_rip_b = 2,
10186 + ETHINTFC_rip_m = 0x00000004,
10187 + ETHINTFC_jam_b = 3,
10188 + ETHINTFC_jam_m = 0x00000008,
10189 + ETHINTFC_ovr_b = 4,
10190 + ETHINTFC_ovr_m = 0x00000010,
10191 + ETHINTFC_und_b = 5,
10192 + ETHINTFC_und_m = 0x00000020,
10194 + ETHFIFOTT_tth_b = 0,
10195 + ETHFIFOTT_tth_m = 0x0000007f,
10197 + ETHARC_pro_b = 0,
10198 + ETHARC_pro_m = 0x00000001,
10200 + ETHARC_am_m = 0x00000002,
10201 + ETHARC_afm_b = 2,
10202 + ETHARC_afm_m = 0x00000004,
10204 + ETHARC_ab_m = 0x00000008,
10206 + ETHSAL_byte5_b = 0,
10207 + ETHSAL_byte5_m = 0x000000ff,
10208 + ETHSAL_byte4_b = 8,
10209 + ETHSAL_byte4_m = 0x0000ff00,
10210 + ETHSAL_byte3_b = 16,
10211 + ETHSAL_byte3_m = 0x00ff0000,
10212 + ETHSAL_byte2_b = 24,
10213 + ETHSAL_byte2_m = 0xff000000,
10215 + ETHSAH_byte1_b = 0,
10216 + ETHSAH_byte1_m = 0x000000ff,
10217 + ETHSAH_byte0_b = 8,
10218 + ETHSAH_byte0_m = 0x0000ff00,
10220 + ETHGPF_ptv_b = 0,
10221 + ETHGPF_ptv_m = 0x0000ffff,
10223 + ETHPFS_pfd_b = 0,
10224 + ETHPFS_pfd_m = 0x00000001,
10226 + ETHCFSA0_cfsa4_b = 0,
10227 + ETHCFSA0_cfsa4_m = 0x000000ff,
10228 + ETHCFSA0_cfsa5_b = 8,
10229 + ETHCFSA0_cfsa5_m = 0x0000ff00,
10231 + ETHCFSA1_cfsa2_b = 0,
10232 + ETHCFSA1_cfsa2_m = 0x000000ff,
10233 + ETHCFSA1_cfsa3_b = 8,
10234 + ETHCFSA1_cfsa3_m = 0x0000ff00,
10236 + ETHCFSA2_cfsa0_b = 0,
10237 + ETHCFSA2_cfsa0_m = 0x000000ff,
10238 + ETHCFSA2_cfsa1_b = 8,
10239 + ETHCFSA2_cfsa1_m = 0x0000ff00,
10241 + ETHMAC1_re_b = 0,
10242 + ETHMAC1_re_m = 0x00000001,
10243 + ETHMAC1_paf_b = 1,
10244 + ETHMAC1_paf_m = 0x00000002,
10245 + ETHMAC1_rfc_b = 2,
10246 + ETHMAC1_rfc_m = 0x00000004,
10247 + ETHMAC1_tfc_b = 3,
10248 + ETHMAC1_tfc_m = 0x00000008,
10249 + ETHMAC1_lb_b = 4,
10250 + ETHMAC1_lb_m = 0x00000010,
10251 + ETHMAC1_mr_b = 31,
10252 + ETHMAC1_mr_m = 0x80000000,
10254 + ETHMAC2_fd_b = 0,
10255 + ETHMAC2_fd_m = 0x00000001,
10256 + ETHMAC2_flc_b = 1,
10257 + ETHMAC2_flc_m = 0x00000002,
10258 + ETHMAC2_hfe_b = 2,
10259 + ETHMAC2_hfe_m = 0x00000004,
10260 + ETHMAC2_dc_b = 3,
10261 + ETHMAC2_dc_m = 0x00000008,
10262 + ETHMAC2_cen_b = 4,
10263 + ETHMAC2_cen_m = 0x00000010,
10264 + ETHMAC2_pe_b = 5,
10265 + ETHMAC2_pe_m = 0x00000020,
10266 + ETHMAC2_vpe_b = 6,
10267 + ETHMAC2_vpe_m = 0x00000040,
10268 + ETHMAC2_ape_b = 7,
10269 + ETHMAC2_ape_m = 0x00000080,
10270 + ETHMAC2_ppe_b = 8,
10271 + ETHMAC2_ppe_m = 0x00000100,
10272 + ETHMAC2_lpe_b = 9,
10273 + ETHMAC2_lpe_m = 0x00000200,
10274 + ETHMAC2_nb_b = 12,
10275 + ETHMAC2_nb_m = 0x00001000,
10276 + ETHMAC2_bp_b = 13,
10277 + ETHMAC2_bp_m = 0x00002000,
10278 + ETHMAC2_ed_b = 14,
10279 + ETHMAC2_ed_m = 0x00004000,
10281 + ETHIPGT_ipgt_b = 0,
10282 + ETHIPGT_ipgt_m = 0x0000007f,
10284 + ETHIPGR_ipgr2_b = 0,
10285 + ETHIPGR_ipgr2_m = 0x0000007f,
10286 + ETHIPGR_ipgr1_b = 8,
10287 + ETHIPGR_ipgr1_m = 0x00007f00,
10289 + ETHCLRT_maxret_b = 0,
10290 + ETHCLRT_maxret_m = 0x0000000f,
10291 + ETHCLRT_colwin_b = 8,
10292 + ETHCLRT_colwin_m = 0x00003f00,
10294 + ETHMAXF_maxf_b = 0,
10295 + ETHMAXF_maxf_m = 0x0000ffff,
10297 + ETHMTEST_tb_b = 2,
10298 + ETHMTEST_tb_m = 0x00000004,
10300 + ETHMCP_div_b = 0,
10301 + ETHMCP_div_m = 0x000000ff,
10303 + MIIMCFG_rsv_b = 0,
10304 + MIIMCFG_rsv_m = 0x0000000c,
10306 + MIIMCMD_rd_b = 0,
10307 + MIIMCMD_rd_m = 0x00000001,
10308 + MIIMCMD_scn_b = 1,
10309 + MIIMCMD_scn_m = 0x00000002,
10311 + MIIMADDR_regaddr_b = 0,
10312 + MIIMADDR_regaddr_m = 0x0000001f,
10313 + MIIMADDR_phyaddr_b = 8,
10314 + MIIMADDR_phyaddr_m = 0x00001f00,
10316 + MIIMWTD_wdata_b = 0,
10317 + MIIMWTD_wdata_m = 0x0000ffff,
10319 + MIIMRDD_rdata_b = 0,
10320 + MIIMRDD_rdata_m = 0x0000ffff,
10322 + MIIMIND_bsy_b = 0,
10323 + MIIMIND_bsy_m = 0x00000001,
10324 + MIIMIND_scn_b = 1,
10325 + MIIMIND_scn_m = 0x00000002,
10326 + MIIMIND_nv_b = 2,
10327 + MIIMIND_nv_m = 0x00000004,
10332 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
10337 + ETHRX_fd_m = 0x00000001,
10339 + ETHRX_ld_m = 0x00000002,
10341 + ETHRX_rok_m = 0x00000004,
10343 + ETHRX_fm_m = 0x00000008,
10345 + ETHRX_mp_m = 0x00000010,
10347 + ETHRX_bp_m = 0x00000020,
10349 + ETHRX_vlt_m = 0x00000040,
10351 + ETHRX_cf_m = 0x00000080,
10353 + ETHRX_ovr_m = 0x00000100,
10355 + ETHRX_crc_m = 0x00000200,
10357 + ETHRX_cv_m = 0x00000400,
10359 + ETHRX_db_m = 0x00000800,
10361 + ETHRX_le_m = 0x00001000,
10362 + ETHRX_lor_b = 13,
10363 + ETHRX_lor_m = 0x00002000,
10364 + ETHRX_ces_b = 14,
10365 + ETHRX_ces_m = 0x00004000,
10366 + ETHRX_length_b = 16,
10367 + ETHRX_length_m = 0xffff0000,
10370 + ETHTX_fd_m = 0x00000001,
10372 + ETHTX_ld_m = 0x00000002,
10374 + ETHTX_oen_m = 0x00000004,
10376 + ETHTX_pen_m = 0x00000008,
10378 + ETHTX_cen_m = 0x00000010,
10380 + ETHTX_hen_m = 0x00000020,
10382 + ETHTX_tok_m = 0x00000040,
10384 + ETHTX_mp_m = 0x00000080,
10386 + ETHTX_bp_m = 0x00000100,
10388 + ETHTX_und_m = 0x00000200,
10390 + ETHTX_of_m = 0x00000400,
10392 + ETHTX_ed_m = 0x00000800,
10394 + ETHTX_ec_m = 0x00001000,
10396 + ETHTX_lc_m = 0x00002000,
10398 + ETHTX_td_m = 0x00004000,
10399 + ETHTX_crc_b = 15,
10400 + ETHTX_crc_m = 0x00008000,
10402 + ETHTX_le_m = 0x00010000,
10404 + ETHTX_cc_m = 0x001E0000,
10406 +#endif //__IDT_RC32438_ETH_H__
10407 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h
10408 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h 1970-01-01 01:00:00.000000000 +0100
10409 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h 2006-01-10 00:32:33.000000000 +0100
10411 +/**************************************************************************
10413 + * BRIEF MODULE DESCRIPTION
10414 + * macros for IDT EB438 ethernet
10416 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10418 + * This program is free software; you can redistribute it and/or modify it
10419 + * under the terms of the GNU General Public License as published by the
10420 + * Free Software Foundation; either version 2 of the License, or (at your
10421 + * option) any later version.
10423 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10424 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10425 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10426 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10427 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10428 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10429 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10430 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10431 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10432 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10434 + * You should have received a copy of the GNU General Public License along
10435 + * with this program; if not, write to the Free Software Foundation, Inc.,
10436 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10439 + **************************************************************************
10440 + * May 2004 P. Sadik.
10442 + * Initial Release
10446 + **************************************************************************
10449 +#ifndef __IDT_RC32438_ETH_V_H__
10450 +#define __IDT_RC32438_ETH_V_H__
10451 +#include <asm/idt-boards/rc32438/rc32438_eth.h>
10453 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
10454 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
10455 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
10456 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
10457 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
10458 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
10459 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
10460 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
10461 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
10462 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
10463 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
10465 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
10467 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
10468 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
10469 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
10470 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
10471 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
10472 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
10473 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
10474 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
10475 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
10476 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
10477 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
10478 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
10479 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
10480 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
10482 +#endif //__IDT_RC32438_ETH_V_H__
10483 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h
10484 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h 1970-01-01 01:00:00.000000000 +0100
10485 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h 2006-01-10 00:32:33.000000000 +0100
10487 +/**************************************************************************
10489 + * BRIEF MODULE DESCRIPTION
10490 + * Definitions for IDT RC32438 GPIO.
10492 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10494 + * This program is free software; you can redistribute it and/or modify it
10495 + * under the terms of the GNU General Public License as published by the
10496 + * Free Software Foundation; either version 2 of the License, or (at your
10497 + * option) any later version.
10499 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10500 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10501 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10502 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10503 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10504 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10505 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10506 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10507 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10508 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10510 + * You should have received a copy of the GNU General Public License along
10511 + * with this program; if not, write to the Free Software Foundation, Inc.,
10512 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10515 + **************************************************************************
10516 + * May 2004 P. Sadik.
10518 + * Initial Release
10522 + **************************************************************************
10524 +#ifndef __IDT_RC32438_GPIO_H__
10525 +#define __IDT_RC32438_GPIO_H__
10528 + GPIO0_PhysicalAddress = 0x18048000,
10529 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
10531 + GPIO0_VirtualAddress = 0xb8048000,
10532 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
10537 + u32 gpiofunc; /* GPIO Function Register
10538 + * gpiofunc[x]==0 bit = gpio
10539 + * func[x]==1 bit = altfunc
10541 + u32 gpiocfg; /* GPIO Configuration Register
10542 + * gpiocfg[x]==0 bit = input
10543 + * gpiocfg[x]==1 bit = output
10545 + u32 gpiod; /* GPIO Data Register
10546 + * gpiod[x] read/write gpio pinX status
10548 + u32 gpioilevel; /* GPIO Interrupt Status Register
10549 + * interrupt level (see gpioistat)
10551 + u32 gpioistat; /* Gpio Interrupt Status Register
10552 + * istat[x] = (gpiod[x] == level[x])
10553 + * cleared in ISR (STICKY bits)
10555 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
10556 +} volatile * GPIO_t ;
10560 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
10561 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
10562 + GPIO_input_v = 0, // gpiocfg use pin as input.
10563 + GPIO_output_v = 1, // gpiocfg use pin as output.
10565 + GPIO_pin0_m = 0x00000001,
10567 + GPIO_pin1_m = 0x00000002,
10569 + GPIO_pin2_m = 0x00000004,
10571 + GPIO_pin3_m = 0x00000008,
10573 + GPIO_pin4_m = 0x00000010,
10575 + GPIO_pin5_m = 0x00000020,
10577 + GPIO_pin6_m = 0x00000040,
10579 + GPIO_pin7_m = 0x00000080,
10581 + GPIO_pin8_m = 0x00000100,
10583 + GPIO_pin9_m = 0x00000200,
10584 + GPIO_pin10_b = 10,
10585 + GPIO_pin10_m = 0x00000400,
10586 + GPIO_pin11_b = 11,
10587 + GPIO_pin11_m = 0x00000800,
10588 + GPIO_pin12_b = 12,
10589 + GPIO_pin12_m = 0x00001000,
10590 + GPIO_pin13_b = 13,
10591 + GPIO_pin13_m = 0x00002000,
10592 + GPIO_pin14_b = 14,
10593 + GPIO_pin14_m = 0x00004000,
10594 + GPIO_pin15_b = 15,
10595 + GPIO_pin15_m = 0x00008000,
10596 + GPIO_pin16_b = 16,
10597 + GPIO_pin16_m = 0x00010000,
10598 + GPIO_pin17_b = 17,
10599 + GPIO_pin17_m = 0x00020000,
10600 + GPIO_pin18_b = 18,
10601 + GPIO_pin18_m = 0x00040000,
10602 + GPIO_pin19_b = 19,
10603 + GPIO_pin19_m = 0x00080000,
10604 + GPIO_pin20_b = 20,
10605 + GPIO_pin20_m = 0x00100000,
10606 + GPIO_pin21_b = 21,
10607 + GPIO_pin21_m = 0x00200000,
10608 + GPIO_pin22_b = 22,
10609 + GPIO_pin22_m = 0x00400000,
10610 + GPIO_pin23_b = 23,
10611 + GPIO_pin23_m = 0x00800000,
10612 + GPIO_pin24_b = 24,
10613 + GPIO_pin24_m = 0x01000000,
10614 + GPIO_pin25_b = 25,
10615 + GPIO_pin25_m = 0x02000000,
10616 + GPIO_pin26_b = 26,
10617 + GPIO_pin26_m = 0x04000000,
10618 + GPIO_pin27_b = 27,
10619 + GPIO_pin27_m = 0x08000000,
10620 + GPIO_pin28_b = 28,
10621 + GPIO_pin28_m = 0x10000000,
10622 + GPIO_pin29_b = 29,
10623 + GPIO_pin29_m = 0x20000000,
10624 + GPIO_pin30_b = 30,
10625 + GPIO_pin30_m = 0x40000000,
10626 + GPIO_pin31_b = 31,
10627 + GPIO_pin31_m = 0x80000000,
10629 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
10631 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
10632 + GPIO_u0sout_m = GPIO_pin0_m,
10633 + GPIO_u0sout_cfg_v = GPIO_output_v,
10634 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
10635 + GPIO_u0sinp_m = GPIO_pin1_m,
10636 + GPIO_u0sinp_cfg_v = GPIO_input_v,
10637 + GPIO_u0rin_b = GPIO_pin2_b, // UART 0 ring indic.
10638 + GPIO_u0rin_m = GPIO_pin2_m,
10639 + GPIO_u0rin_cfg_v = GPIO_input_v,
10640 + GPIO_u0dcdn_b = GPIO_pin3_b, // UART 0 data carr.det.
10641 + GPIO_u0dcdn_m = GPIO_pin3_m,
10642 + GPIO_u0dcdn_cfg_v = GPIO_input_v,
10643 + GPIO_u0dtrn_b = GPIO_pin4_b, // UART 0 data term rdy.
10644 + GPIO_u0dtrn_m = GPIO_pin4_m,
10645 + GPIO_u0dtrn_cfg_v = GPIO_output_v,
10646 + GPIO_u0dsrn_b = GPIO_pin5_b, // UART 0 data set rdy.
10647 + GPIO_u0dsrn_m = GPIO_pin5_m,
10648 + GPIO_u0dsrn_cfg_v = GPIO_input_v,
10649 + GPIO_u0rtsn_b = GPIO_pin6_b, // UART 0 req. to send.
10650 + GPIO_u0rtsn_m = GPIO_pin6_m,
10651 + GPIO_u0rtsn_cfg_v = GPIO_output_v,
10652 + GPIO_u0ctsn_b = GPIO_pin7_b, // UART 0 clear to send.
10653 + GPIO_u0ctsn_m = GPIO_pin7_m,
10654 + GPIO_u0ctsn_cfg_v = GPIO_input_v,
10656 + GPIO_u1sout_b = GPIO_pin8_b, // UART 1 serial out.
10657 + GPIO_u1sout_m = GPIO_pin8_m,
10658 + GPIO_u1sout_cfg_v = GPIO_output_v,
10659 + GPIO_u1sinp_b = GPIO_pin9_b, // UART 1 serial in.
10660 + GPIO_u1sinp_m = GPIO_pin9_m,
10661 + GPIO_u1sinp_cfg_v = GPIO_input_v,
10662 + GPIO_u1dtrn_b = GPIO_pin10_b, // UART 1 data term rdy.
10663 + GPIO_u1dtrn_m = GPIO_pin10_m,
10664 + GPIO_u1dtrn_cfg_v = GPIO_output_v,
10665 + GPIO_u1dsrn_b = GPIO_pin11_b, // UART 1 data set rdy.
10666 + GPIO_u1dsrn_m = GPIO_pin11_m,
10667 + GPIO_u1dsrn_cfg_v = GPIO_input_v,
10668 + GPIO_u1rtsn_b = GPIO_pin12_b, // UART 1 req. to send.
10669 + GPIO_u1rtsn_m = GPIO_pin12_m,
10670 + GPIO_u1rtsn_cfg_v = GPIO_output_v,
10671 + GPIO_u1ctsn_b = GPIO_pin13_b, // UART 1 clear to send.
10672 + GPIO_u1ctsn_m = GPIO_pin13_m,
10673 + GPIO_u1ctsn_cfg_v = GPIO_input_v,
10675 + GPIO_dmareqn0_b = GPIO_pin14_b, // Ext. DMA 0 request
10676 + GPIO_dmareqn0_m = GPIO_pin14_m,
10677 + GPIO_dmareqn0_cfg_v = GPIO_input_v,
10679 + GPIO_dmareqn1_b = GPIO_pin15_b, // Ext. DMA 1 request
10680 + GPIO_dmareqn1_m = GPIO_pin15_m,
10681 + GPIO_dmareqn1_cfg_v = GPIO_input_v,
10683 + GPIO_dmadonen0_b = GPIO_pin16_b, // Ext. DMA 0 done
10684 + GPIO_dmadonen0_m = GPIO_pin16_m,
10685 + GPIO_dmadonen0_cfg_v = GPIO_input_v,
10687 + GPIO_dmadonen1_b = GPIO_pin17_b, // Ext. DMA 1 done
10688 + GPIO_dmadonen1_m = GPIO_pin17_m,
10689 + GPIO_dmadonen1_cfg_v = GPIO_input_v,
10691 + GPIO_dmafinn0_b = GPIO_pin18_b, // Ext. DMA 0 finished
10692 + GPIO_dmafinn0_m = GPIO_pin18_m,
10693 + GPIO_dmafinn0_cfg_v = GPIO_output_v,
10695 + GPIO_dmafinn1_b = GPIO_pin19_b, // Ext. DMA 1 finished
10696 + GPIO_dmafinn1_m = GPIO_pin19_m,
10697 + GPIO_dmafinn1_cfg_v = GPIO_output_v,
10699 + GPIO_maddr22_b = GPIO_pin20_b, // M&P bus bit 22.
10700 + GPIO_maddr22_m = GPIO_pin20_m,
10701 + GPIO_maddr22_cfg_v = GPIO_output_v,
10703 + GPIO_maddr23_b = GPIO_pin21_b, // M&P bus bit 23.
10704 + GPIO_maddr23_m = GPIO_pin21_m,
10705 + GPIO_maddr23_cfg_v = GPIO_output_v,
10707 + GPIO_maddr24_b = GPIO_pin22_b, // M&P bus bit 24.
10708 + GPIO_maddr24_m = GPIO_pin22_m,
10709 + GPIO_maddr24_cfg_v = GPIO_output_v,
10711 + GPIO_maddr25_b = GPIO_pin23_b, // M&P bus bit 25.
10712 + GPIO_maddr25_m = GPIO_pin23_m,
10713 + GPIO_maddr25_cfg_v = GPIO_output_v,
10715 + GPIO_afspare6_b = GPIO_pin24_b, // reserved.
10716 + GPIO_afspare6_m = GPIO_pin24_m,
10717 + GPIO_afspare6_cfg_v = GPIO_input_v,
10718 + GPIO_afspare5_b = GPIO_pin25_b, // reserved.
10719 + GPIO_afspare5_m = GPIO_pin25_m,
10720 + GPIO_afspare5_cfg_v = GPIO_input_v,
10721 + GPIO_afspare4_b = GPIO_pin26_b, // reserved.
10722 + GPIO_afspare4_m = GPIO_pin26_m,
10723 + GPIO_afspare4_cfg_v = GPIO_input_v,
10724 + GPIO_afspare3_b = GPIO_pin27_b, // reserved.
10725 + GPIO_afspare3_m = GPIO_pin27_m,
10726 + GPIO_afspare3_cfg_v = GPIO_input_v,
10727 + GPIO_afspare2_b = GPIO_pin28_b, // reserved.
10728 + GPIO_afspare2_m = GPIO_pin28_m,
10729 + GPIO_afspare2_cfg_v = GPIO_input_v,
10730 + GPIO_afspare1_b = GPIO_pin29_b, // reserved.
10731 + GPIO_afspare1_m = GPIO_pin29_m,
10732 + GPIO_afspare1_cfg_v = GPIO_input_v,
10734 + GPIO_pcimuintn_b = GPIO_pin30_b, // PCI messaging int.
10735 + GPIO_pcimuintn_m = GPIO_pin30_m,
10736 + GPIO_pcimuintn_cfg_v = GPIO_output_v,
10738 + GPIO_rngclk_b = GPIO_pin31_b, // RNG external clock
10739 + GPIO_rngclk_m = GPIO_pin31_m,
10740 + GPIO_rncclk_cfg_v = GPIO_input_v,
10743 +#endif //__IDT_RC32438_GPIO_H__
10744 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438.h
10745 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438.h 1970-01-01 01:00:00.000000000 +0100
10746 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438.h 2006-01-10 00:32:33.000000000 +0100
10748 +/**************************************************************************
10750 + * BRIEF MODULE DESCRIPTION
10751 + * Definitions for IDT RC32438 CPU.
10753 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10755 + * This program is free software; you can redistribute it and/or modify it
10756 + * under the terms of the GNU General Public License as published by the
10757 + * Free Software Foundation; either version 2 of the License, or (at your
10758 + * option) any later version.
10760 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10761 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10762 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10763 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10764 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10765 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10766 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10767 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10768 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10769 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10771 + * You should have received a copy of the GNU General Public License along
10772 + * with this program; if not, write to the Free Software Foundation, Inc.,
10773 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10776 + **************************************************************************
10777 + * May 2004 P. Sadik.
10779 + * Initial Release
10783 + **************************************************************************
10786 +#ifndef __IDT_RC32438_H__
10787 +#define __IDT_RC32438_H__
10788 +#include <linux/config.h>
10789 +#include <linux/delay.h>
10790 +#include <asm/io.h>
10791 +#include <asm/idt-boards/rc32438/rc32438_timer.h>
10793 +#define RC32438_REG_BASE 0x18000000
10795 +#define interrupt ((volatile INT_t ) INT0_VirtualAddress)
10796 +#define idttimer ((volatile TIM_t) TIM0_VirtualAddress)
10797 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
10799 +#define IDT_CLOCK_MULT 2
10800 +#define MIPS_CPU_TIMER_IRQ 7
10801 +/* Interrupt Controller */
10802 +#define IC_GROUP0_PEND (RC32438_REG_BASE + 0x38000)
10803 +#define IC_GROUP0_MASK (RC32438_REG_BASE + 0x38008)
10804 +#define IC_GROUP_OFFSET 0x0C
10805 +#define RTC_BASE 0xAC0801FF0
10807 +#define NUM_INTR_GROUPS 5
10810 +#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
10811 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) /* GRP3 IRQ numbers start here */
10812 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) /* GRP4 IRQ numbers start here */
10813 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) /* GRP5 IRQ numbers start here */
10814 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
10817 +#define RC32438_UART0_BASE (RC32438_REG_BASE + 0x50003)
10818 +#define RC32438_UART1_BASE (RC32438_REG_BASE + 0x50023)
10820 +#define RC32438_UART0_BASE (RC32438_REG_BASE + 0x50000)
10821 +#define RC32438_UART1_BASE (RC32438_REG_BASE + 0x50020)
10824 +#define RC32438_UART0_IRQ GROUP3_IRQ_BASE + 0
10825 +#define RC32438_UART1_IRQ GROUP3_IRQ_BASE + 3
10827 +#define RC32438_NR_IRQS (GROUP4_IRQ_BASE + 32)
10831 +/* cpu pipeline flush */
10832 +static inline void rc32438_sync(void)
10834 + __asm__ volatile ("sync");
10837 +static inline void rc32438_sync_udelay(int us)
10839 + __asm__ volatile ("sync");
10843 +static inline void rc32438_sync_delay(int ms)
10845 + __asm__ volatile ("sync");
10850 + * Macros to access internal RC32438 registers. No byte
10851 + * swapping should be done when accessing the internal
10855 +#define rc32438_readb __raw_readb
10856 +#define rc32438_readw __raw_readw
10857 +#define rc32438_readl __raw_readl
10859 +#define rc32438_writeb __raw_writeb
10860 +#define rc32438_writew __raw_writew
10861 +#define rc32438_writel __raw_writel
10864 + * C access to CLZ and CLO instructions
10865 + * (count leading zeroes/ones).
10867 +static inline int rc32438_clz(unsigned long val)
10870 + __asm__ volatile (
10871 + ".set\tnoreorder\n\t"
10873 + ".set\tmips32\n\t"
10875 + ".set\tmips0\n\t"
10883 +static inline int rc32438_clo(unsigned long val)
10886 + __asm__ volatile (
10887 + ".set\tnoreorder\n\t"
10889 + ".set\tmips32\n\t"
10891 + ".set\tmips0\n\t"
10899 +#endif //__IDT_RC32438_H__
10900 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_pci.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_pci.h
10901 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_pci.h 1970-01-01 01:00:00.000000000 +0100
10902 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_pci.h 2006-01-10 00:32:33.000000000 +0100
10904 +/**************************************************************************
10906 + * BRIEF MODULE DESCRIPTION
10907 + * Definitions for IDT RC32438 PCI.
10909 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10911 + * This program is free software; you can redistribute it and/or modify it
10912 + * under the terms of the GNU General Public License as published by the
10913 + * Free Software Foundation; either version 2 of the License, or (at your
10914 + * option) any later version.
10916 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10917 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10918 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10919 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10920 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10921 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10922 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10923 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10924 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10925 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10927 + * You should have received a copy of the GNU General Public License along
10928 + * with this program; if not, write to the Free Software Foundation, Inc.,
10929 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10932 + **************************************************************************
10933 + * May 2004 P. Sadik
10935 + * Initial Release
10939 + **************************************************************************
10944 + PCI0_PhysicalAddress = 0x18080000,
10945 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
10947 + PCI0_VirtualAddress = 0xb8080000,
10948 + PCI_VirtualAddress = PCI0_VirtualAddress,
10953 + PCI_LbaCount = 4, // Local base addresses.
10958 + u32 a ; // Address.
10959 + u32 c ; // Control.
10960 + u32 m ; // mapping.
10970 + PCI_Map_s pcilba [PCI_LbaCount] ;
10978 +} volatile *PCI_t ;
10980 +// PCI messaging unit.
10987 + u32 pciim [PCIM_Count] ;
10988 + u32 pciom [PCIM_Count] ;
10995 +} volatile *PCIM_t ;
10997 +/*******************************************************************************
10999 + * PCI Control Register
11001 + ******************************************************************************/
11005 + PCIC_en_m = 0x00000001,
11007 + PCIC_tnr_m = 0x00000002,
11009 + PCIC_sce_m = 0x00000004,
11011 + PCIC_ien_m = 0x00000008,
11013 + PCIC_aaa_m = 0x00000010,
11015 + PCIC_eap_m = 0x00000020,
11017 + PCIC_pcim_m = 0x000001c0,
11018 + PCIC_pcim_disabled_v = 0,
11019 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
11020 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
11021 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
11022 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
11023 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
11024 + PCIC_pcim_reserved6_v = 6,
11025 + PCIC_pcim_reserved7_v = 7,
11027 + PCIC_igm_m = 0x00000200,
11030 +/*******************************************************************************
11032 + * PCI Status Register
11034 + ******************************************************************************/
11037 + PCIS_eed_m = 0x00000001,
11039 + PCIS_wr_m = 0x00000002,
11041 + PCIS_nmi_m = 0x00000004,
11043 + PCIS_ii_m = 0x00000008,
11045 + PCIS_cwe_m = 0x00000010,
11047 + PCIS_cre_m = 0x00000020,
11049 + PCIS_mdpe_m = 0x00000040,
11051 + PCIS_sta_m = 0x00000080,
11053 + PCIS_rta_m = 0x00000100,
11055 + PCIS_rma_m = 0x00000200,
11057 + PCIS_sse_m = 0x00000400,
11059 + PCIS_ose_m = 0x00000800,
11061 + PCIS_pe_m = 0x00001000,
11063 + PCIS_tae_m = 0x00002000,
11065 + PCIS_rle_m = 0x00004000,
11067 + PCIS_bme_m = 0x00008000,
11069 + PCIS_prd_m = 0x00010000,
11071 + PCIS_rip_m = 0x00020000,
11074 +/*******************************************************************************
11076 + * PCI Status Mask Register
11078 + ******************************************************************************/
11081 + PCISM_eed_m = 0x00000001,
11083 + PCISM_wr_m = 0x00000002,
11085 + PCISM_nmi_m = 0x00000004,
11087 + PCISM_ii_m = 0x00000008,
11089 + PCISM_cwe_m = 0x00000010,
11091 + PCISM_cre_m = 0x00000020,
11092 + PCISM_mdpe_b = 6,
11093 + PCISM_mdpe_m = 0x00000040,
11095 + PCISM_sta_m = 0x00000080,
11097 + PCISM_rta_m = 0x00000100,
11099 + PCISM_rma_m = 0x00000200,
11100 + PCISM_sse_b = 10,
11101 + PCISM_sse_m = 0x00000400,
11102 + PCISM_ose_b = 11,
11103 + PCISM_ose_m = 0x00000800,
11105 + PCISM_pe_m = 0x00001000,
11106 + PCISM_tae_b = 13,
11107 + PCISM_tae_m = 0x00002000,
11108 + PCISM_rle_b = 14,
11109 + PCISM_rle_m = 0x00004000,
11110 + PCISM_bme_b = 15,
11111 + PCISM_bme_m = 0x00008000,
11112 + PCISM_prd_b = 16,
11113 + PCISM_prd_m = 0x00010000,
11114 + PCISM_rip_b = 17,
11115 + PCISM_rip_m = 0x00020000,
11118 +/*******************************************************************************
11120 + * PCI Configuration Address Register
11122 + ******************************************************************************/
11124 + PCICFGA_reg_b = 2,
11125 + PCICFGA_reg_m = 0x000000fc,
11126 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
11127 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
11128 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
11129 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
11130 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
11131 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
11132 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
11133 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
11134 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
11135 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
11136 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
11137 + PCICFGA_reg_pba0m_v = 0x48>>2,
11138 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
11139 + PCICFGA_reg_pba1m_v = 0x50>>2,
11140 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
11141 + PCICFGA_reg_pba2m_v = 0x58>>2,
11142 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
11143 + PCICFGA_reg_pba3m_v = 0x60>>2,
11144 + PCICFGA_reg_pmgt_v = 0x64>>2,
11145 + PCICFGA_func_b = 8,
11146 + PCICFGA_func_m = 0x00000700,
11147 + PCICFGA_dev_b = 11,
11148 + PCICFGA_dev_m = 0x0000f800,
11149 + PCICFGA_dev_internal_v = 0,
11150 + PCICFGA_bus_b = 16,
11151 + PCICFGA_bus_m = 0x00ff0000,
11152 + PCICFGA_bus_type0_v = 0, //local bus
11153 + PCICFGA_en_b = 31, // read only
11154 + PCICFGA_en_m = 0x80000000,
11158 + PCFGID_vendor_b = 0,
11159 + PCFGID_vendor_m = 0x0000ffff,
11160 + PCFGID_vendor_IDT_v = 0x111d,
11161 + PCFGID_device_b = 16,
11162 + PCFGID_device_m = 0xffff0000,
11163 + PCFGID_device_Acaciade_v = 0x0207,
11165 + PCFG04_command_ioena_b = 1,
11166 + PCFG04_command_ioena_m = 0x00000001,
11167 + PCFG04_command_memena_b = 2,
11168 + PCFG04_command_memena_m = 0x00000002,
11169 + PCFG04_command_bmena_b = 3,
11170 + PCFG04_command_bmena_m = 0x00000004,
11171 + PCFG04_command_mwinv_b = 5,
11172 + PCFG04_command_mwinv_m = 0x00000010,
11173 + PCFG04_command_parena_b = 7,
11174 + PCFG04_command_parena_m = 0x00000040,
11175 + PCFG04_command_serrena_b = 9,
11176 + PCFG04_command_serrena_m = 0x00000100,
11177 + PCFG04_command_fastbbena_b = 10,
11178 + PCFG04_command_fastbbena_m = 0x00000200,
11179 + PCFG04_status_b = 16,
11180 + PCFG04_status_m = 0xffff0000,
11181 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
11182 + PCFG04_status_66MHz_m = 0x00200000,
11183 + PCFG04_status_fbb_b = 23,
11184 + PCFG04_status_fbb_m = 0x00800000,
11185 + PCFG04_status_mdpe_b = 24,
11186 + PCFG04_status_mdpe_m = 0x01000000,
11187 + PCFG04_status_dst_b = 25,
11188 + PCFG04_status_dst_m = 0x06000000,
11189 + PCFG04_status_sta_b = 27,
11190 + PCFG04_status_sta_m = 0x08000000,
11191 + PCFG04_status_rta_b = 28,
11192 + PCFG04_status_rta_m = 0x10000000,
11193 + PCFG04_status_rma_b = 29,
11194 + PCFG04_status_rma_m = 0x20000000,
11195 + PCFG04_status_sse_b = 30,
11196 + PCFG04_status_sse_m = 0x40000000,
11197 + PCFG04_status_pe_b = 31,
11198 + PCFG04_status_pe_m = 0x40000000,
11200 + PCFG08_revId_b = 0,
11201 + PCFG08_revId_m = 0x000000ff,
11202 + PCFG08_classCode_b = 0,
11203 + PCFG08_classCode_m = 0xffffff00,
11204 + PCFG08_classCode_bridge_v = 06,
11205 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
11206 + PCFG0C_cacheline_b = 0,
11207 + PCFG0C_cacheline_m = 0x000000ff,
11208 + PCFG0C_masterLatency_b = 8,
11209 + PCFG0C_masterLatency_m = 0x0000ff00,
11210 + PCFG0C_headerType_b = 16,
11211 + PCFG0C_headerType_m = 0x00ff0000,
11212 + PCFG0C_bist_b = 24,
11213 + PCFG0C_bist_m = 0xff000000,
11215 + PCIPBA_msi_b = 0,
11216 + PCIPBA_msi_m = 0x00000001,
11218 + PCIPBA_p_m = 0x00000004,
11219 + PCIPBA_baddr_b = 8,
11220 + PCIPBA_baddr_m = 0xffffff00,
11222 + PCFGSS_vendorId_b = 0,
11223 + PCFGSS_vendorId_m = 0x0000ffff,
11224 + PCFGSS_id_b = 16,
11225 + PCFGSS_id_m = 0xffff0000,
11227 + PCFG3C_interruptLine_b = 0,
11228 + PCFG3C_interruptLine_m = 0x000000ff,
11229 + PCFG3C_interruptPin_b = 8,
11230 + PCFG3C_interruptPin_m = 0x0000ff00,
11231 + PCFG3C_minGrant_b = 16,
11232 + PCFG3C_minGrant_m = 0x00ff0000,
11233 + PCFG3C_maxLat_b = 24,
11234 + PCFG3C_maxLat_m = 0xff000000,
11236 + PCIPBAC_msi_b = 0,
11237 + PCIPBAC_msi_m = 0x00000001,
11239 + PCIPBAC_p_m = 0x00000002,
11240 + PCIPBAC_size_b = 2,
11241 + PCIPBAC_size_m = 0x0000007c,
11242 + PCIPBAC_sb_b = 7,
11243 + PCIPBAC_sb_m = 0x00000080,
11244 + PCIPBAC_pp_b = 8,
11245 + PCIPBAC_pp_m = 0x00000100,
11246 + PCIPBAC_mr_b = 9,
11247 + PCIPBAC_mr_m = 0x00000600,
11248 + PCIPBAC_mr_read_v =0, //no prefetching
11249 + PCIPBAC_mr_readLine_v =1,
11250 + PCIPBAC_mr_readMult_v =2,
11251 + PCIPBAC_mrl_b = 11,
11252 + PCIPBAC_mrl_m = 0x00000800,
11253 + PCIPBAC_mrm_b = 12,
11254 + PCIPBAC_mrm_m = 0x00001000,
11255 + PCIPBAC_trp_b = 13,
11256 + PCIPBAC_trp_m = 0x00002000,
11258 + PCFG40_trdyTimeout_b = 0,
11259 + PCFG40_trdyTimeout_m = 0x000000ff,
11260 + PCFG40_retryLim_b = 8,
11261 + PCFG40_retryLim_m = 0x0000ff00,
11264 +/*******************************************************************************
11266 + * PCI Local Base Address [0|1|2|3] Register
11268 + ******************************************************************************/
11270 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
11271 + PCILBA_baddr_m = 0xffffff00,
11273 +/*******************************************************************************
11275 + * PCI Local Base Address Control Register
11277 + ******************************************************************************/
11279 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
11280 + PCILBAC_msi_m = 0x00000001,
11281 + PCILBAC_msi_mem_v = 0,
11282 + PCILBAC_msi_io_v = 1,
11283 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
11284 + PCILBAC_size_m = 0x0000007c,
11285 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
11286 + PCILBAC_sb_m = 0x00000080,
11287 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
11288 + PCILBAC_rt_m = 0x00000100,
11289 + PCILBAC_rt_noprefetch_v = 0, // mem read
11290 + PCILBAC_rt_prefetch_v = 1, // mem readline
11293 +/*******************************************************************************
11295 + * PCI Local Base Address [0|1|2|3] Mapping Register
11297 + ******************************************************************************/
11299 + PCILBAM_maddr_b = 8,
11300 + PCILBAM_maddr_m = 0xffffff00,
11303 +/*******************************************************************************
11305 + * PCI Decoupled Access Control Register
11307 + ******************************************************************************/
11309 + PCIDAC_den_b = 0,
11310 + PCIDAC_den_m = 0x00000001,
11313 +/*******************************************************************************
11315 + * PCI Decoupled Access Status Register
11317 + ******************************************************************************/
11320 + PCIDAS_d_m = 0x00000001,
11322 + PCIDAS_b_m = 0x00000002,
11324 + PCIDAS_e_m = 0x00000004,
11325 + PCIDAS_ofe_b = 3,
11326 + PCIDAS_ofe_m = 0x00000008,
11327 + PCIDAS_off_b = 4,
11328 + PCIDAS_off_m = 0x00000010,
11329 + PCIDAS_ife_b = 5,
11330 + PCIDAS_ife_m = 0x00000020,
11331 + PCIDAS_iff_b = 6,
11332 + PCIDAS_iff_m = 0x00000040,
11335 +/*******************************************************************************
11337 + * PCI DMA Channel 8 Configuration Register
11339 + ******************************************************************************/
11342 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
11343 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
11344 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
11345 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
11348 +/*******************************************************************************
11350 + * PCI DMA Channel 9 Configuration Register
11352 + ******************************************************************************/
11355 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
11356 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
11359 +/*******************************************************************************
11361 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
11363 + ******************************************************************************/
11365 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
11366 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
11367 + // These are for reads (DMA channel 8)
11368 + PCIDMAD_devcmd_mr_v = 0, //memory read
11369 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
11370 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
11371 + PCIDMAD_devcmd_ior_v = 3, //I/O read
11372 + // These are for writes (DMA channel 9)
11373 + PCIDMAD_devcmd_mw_v = 0, //memory write
11374 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
11375 + PCIDMAD_devcmd_iow_v = 3, //I/O write
11377 + // Swap byte field applies to both DMA channel 8 and 9
11378 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
11379 + PCIDMAD_sb_m = 0x01000000, // swap byte field
11383 +/*******************************************************************************
11385 + * PCI Target Control Register
11387 + ******************************************************************************/
11390 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
11391 + PCITC_rtimer_m = 0x000000ff,
11392 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
11393 + PCITC_dtimer_m = 0x0000ff00,
11394 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
11395 + PCITC_rdr_m = 0x00040000,
11396 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
11397 + PCITC_ddt_m = 0x00080000,
11399 +/*******************************************************************************
11401 + * PCI messaging unit [applies to both inbound and outbound registers ]
11403 + ******************************************************************************/
11406 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
11407 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
11408 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
11409 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
11410 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
11411 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
11414 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h
11415 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h 1970-01-01 01:00:00.000000000 +0100
11416 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h 2006-01-10 00:32:33.000000000 +0100
11418 +/**************************************************************************
11420 + * BRIEF MODULE DESCRIPTION
11421 + * Definitions for IDT RC32438 PCI setup.
11423 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
11425 + * This program is free software; you can redistribute it and/or modify it
11426 + * under the terms of the GNU General Public License as published by the
11427 + * Free Software Foundation; either version 2 of the License, or (at your
11428 + * option) any later version.
11430 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
11431 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
11432 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
11433 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
11434 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
11435 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
11436 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
11437 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
11438 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
11439 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11441 + * You should have received a copy of the GNU General Public License along
11442 + * with this program; if not, write to the Free Software Foundation, Inc.,
11443 + * 675 Mass Ave, Cambridge, MA 02139, USA.
11446 + **************************************************************************
11447 + * May 2004 P. Sadik
11449 + * Initial Release
11453 + **************************************************************************
11456 +#define PCI_MSG_VirtualAddress 0xB8088010
11457 +#define rc32438_pci ((volatile PCI_t) PCI0_VirtualAddress)
11458 +#define rc32438_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
11460 +#define PCIM_SHFT 0x6
11461 +#define PCIM_BIT_LEN 0x7
11462 +#define PCIM_H_EA 0x3
11463 +#define PCIM_H_IA_FIX 0x4
11464 +#define PCIM_H_IA_RR 0x5
11466 +#define PCI_ADDR_START 0x50000000
11468 +#define CPUTOPCI_MEM_WIN 0x02000000
11469 +#define CPUTOPCI_IO_WIN 0x00100000
11470 +#define PCILBA_SIZE_SHFT 2
11471 +#define PCILBA_SIZE_MASK 0x1F
11472 +#define SIZE_256MB 0x1C
11473 +#define SIZE_128MB 0x1B
11474 +#define SIZE_64MB 0x1A
11475 +#define SIZE_32MB 0x19
11476 +#define SIZE_16MB 0x18
11477 +#define SIZE_4MB 0x16
11478 +#define SIZE_2MB 0x15
11479 +#define SIZE_1MB 0x14
11480 +#define ACACIA_CONFIG0_ADDR 0x80000000
11481 +#define ACACIA_CONFIG1_ADDR 0x80000004
11482 +#define ACACIA_CONFIG2_ADDR 0x80000008
11483 +#define ACACIA_CONFIG3_ADDR 0x8000000C
11484 +#define ACACIA_CONFIG4_ADDR 0x80000010
11485 +#define ACACIA_CONFIG5_ADDR 0x80000014
11486 +#define ACACIA_CONFIG6_ADDR 0x80000018
11487 +#define ACACIA_CONFIG7_ADDR 0x8000001C
11488 +#define ACACIA_CONFIG8_ADDR 0x80000020
11489 +#define ACACIA_CONFIG9_ADDR 0x80000024
11490 +#define ACACIA_CONFIG10_ADDR 0x80000028
11491 +#define ACACIA_CONFIG11_ADDR 0x8000002C
11492 +#define ACACIA_CONFIG12_ADDR 0x80000030
11493 +#define ACACIA_CONFIG13_ADDR 0x80000034
11494 +#define ACACIA_CONFIG14_ADDR 0x80000038
11495 +#define ACACIA_CONFIG15_ADDR 0x8000003C
11496 +#define ACACIA_CONFIG16_ADDR 0x80000040
11497 +#define ACACIA_CONFIG17_ADDR 0x80000044
11498 +#define ACACIA_CONFIG18_ADDR 0x80000048
11499 +#define ACACIA_CONFIG19_ADDR 0x8000004C
11500 +#define ACACIA_CONFIG20_ADDR 0x80000050
11501 +#define ACACIA_CONFIG21_ADDR 0x80000054
11502 +#define ACACIA_CONFIG22_ADDR 0x80000058
11503 +#define ACACIA_CONFIG23_ADDR 0x8000005C
11504 +#define ACACIA_CONFIG24_ADDR 0x80000060
11505 +#define ACACIA_CONFIG25_ADDR 0x80000064
11506 +#define ACACIA_CMD (PCFG04_command_ioena_m | \
11507 + PCFG04_command_memena_m | \
11508 + PCFG04_command_bmena_m | \
11509 + PCFG04_command_mwinv_m | \
11510 + PCFG04_command_parena_m | \
11511 + PCFG04_command_serrena_m )
11513 +#define ACACIA_STAT (PCFG04_status_mdpe_m | \
11514 + PCFG04_status_sta_m | \
11515 + PCFG04_status_rta_m | \
11516 + PCFG04_status_rma_m | \
11517 + PCFG04_status_sse_m | \
11518 + PCFG04_status_pe_m)
11520 +#define ACACIA_CNFG1 ((ACACIA_STAT<<16)|ACACIA_CMD)
11522 +#define ACACIA_REVID 0
11523 +#define ACACIA_CLASS_CODE 0
11524 +#define ACACIA_CNFG2 ((ACACIA_CLASS_CODE<<8) | \
11527 +#define ACACIA_CACHE_LINE_SIZE 4
11528 +#define ACACIA_MASTER_LAT 0x3c
11529 +#define ACACIA_HEADER_TYPE 0
11530 +#define ACACIA_BIST 0
11532 +#define ACACIA_CNFG3 ((ACACIA_BIST << 24) | \
11533 + (ACACIA_HEADER_TYPE<<16) | \
11534 + (ACACIA_MASTER_LAT<<8) | \
11535 + ACACIA_CACHE_LINE_SIZE )
11537 +#define ACACIA_BAR0 0x00000008 /* 128 MB Memory */
11538 +#define ACACIA_BAR1 0x18800001 /* 1 MB IO */
11539 +#define ACACIA_BAR2 0x18000001 /* 2 MB IO window for Acacia
11540 + internal Registers */
11541 +#define ACACIA_BAR3 0x48000008 /* Spare 128 MB Memory */
11543 +#define ACACIA_CNFG4 ACACIA_BAR0
11544 +#define ACACIA_CNFG5 ACACIA_BAR1
11545 +#define ACACIA_CNFG6 ACACIA_BAR2
11546 +#define ACACIA_CNFG7 ACACIA_BAR3
11548 +#define ACACIA_SUBSYS_VENDOR_ID 0
11549 +#define ACACIA_SUBSYSTEM_ID 0
11550 +#define ACACIA_CNFG8 0
11551 +#define ACACIA_CNFG9 0
11552 +#define ACACIA_CNFG10 0
11553 +#define ACACIA_CNFG11 ((ACACIA_SUBSYS_VENDOR_ID<<16) | \
11554 + ACACIA_SUBSYSTEM_ID)
11555 +#define ACACIA_INT_LINE 1
11556 +#define ACACIA_INT_PIN 1
11557 +#define ACACIA_MIN_GNT 8
11558 +#define ACACIA_MAX_LAT 0x38
11559 +#define ACACIA_CNFG12 0
11560 +#define ACACIA_CNFG13 0
11561 +#define ACACIA_CNFG14 0
11562 +#define ACACIA_CNFG15 ((ACACIA_MAX_LAT<<24) | \
11563 + (ACACIA_MIN_GNT<<16) | \
11564 + (ACACIA_INT_PIN<<8) | \
11566 +#define ACACIA_RETRY_LIMIT 0x80
11567 +#define ACACIA_TRDY_LIMIT 0x80
11568 +#define ACACIA_CNFG16 ((ACACIA_RETRY_LIMIT<<8) | \
11569 + ACACIA_TRDY_LIMIT)
11570 +#define PCI_PBAxC_R 0x0
11571 +#define PCI_PBAxC_RL 0x1
11572 +#define PCI_PBAxC_RM 0x2
11573 +#define SIZE_SHFT 2
11575 +#define ACACIA_PBA0C ( PCIPBAC_mrl_m | PCIPBAC_sb_m | \
11576 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
11578 + (SIZE_128MB<<SIZE_SHFT) | \
11581 +#define ACACIA_CNFG17 ACACIA_PBA0C
11582 +#define ACACIA_PBA0M 0x0
11583 +#define ACACIA_CNFG18 ACACIA_PBA0M
11585 +#define ACACIA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
11588 +#define ACACIA_CNFG19 ACACIA_PBA1C
11589 +#define ACACIA_PBA1M 0x0
11590 +#define ACACIA_CNFG20 ACACIA_PBA1M
11592 +#define ACACIA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
11595 +#define ACACIA_CNFG21 ACACIA_PBA2C
11596 +#define ACACIA_PBA2M 0x18000000
11597 +#define ACACIA_CNFG22 ACACIA_PBA2M
11598 +#define ACACIA_PBA3C 0
11599 +#define ACACIA_CNFG23 ACACIA_PBA3C
11600 +#define ACACIA_PBA3M 0
11601 +#define ACACIA_CNFG24 ACACIA_PBA3M
11605 +#define PCITC_DTIMER_VAL 8
11606 +#define PCITC_RTIMER_VAL 0x10
11608 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_timer.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_timer.h
11609 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_timer.h 1970-01-01 01:00:00.000000000 +0100
11610 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_timer.h 2006-01-10 00:32:33.000000000 +0100
11612 +/**************************************************************************
11614 + * BRIEF MODULE DESCRIPTION
11615 + * Timer register definition IDT RC32438 CPU.
11617 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
11619 + * This program is free software; you can redistribute it and/or modify it
11620 + * under the terms of the GNU General Public License as published by the
11621 + * Free Software Foundation; either version 2 of the License, or (at your
11622 + * option) any later version.
11624 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
11625 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
11626 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
11627 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
11628 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
11629 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
11630 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
11631 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
11632 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
11633 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11635 + * You should have received a copy of the GNU General Public License along
11636 + * with this program; if not, write to the Free Software Foundation, Inc.,
11637 + * 675 Mass Ave, Cambridge, MA 02139, USA.
11640 + **************************************************************************
11641 + * May 2004 P. Sadik.
11643 + * Initial Release
11647 + **************************************************************************
11650 +#ifndef __IDT_RC32438_TIM_H__
11651 +#define __IDT_RC32438_TIM_H__
11655 + TIM0_PhysicalAddress = 0x18028000,
11656 + TIM_PhysicalAddress = TIM0_PhysicalAddress, // Default
11658 + TIM0_VirtualAddress = 0xb8028000,
11659 + TIM_VirtualAddress = TIM0_VirtualAddress, // Default
11671 + u32 ctc ; //use CTC_
11674 +typedef struct TIM_s
11676 + struct TIM_CNTR_s tim [TIM_Count] ;
11677 + u32 rcount ; //use RCOUNT_
11678 + u32 rcompare ; //use RCOMPARE_
11679 + u32 rtc ; //use RTC_
11680 +} volatile * TIM_t ;
11685 + CTC_en_m = 0x00000001,
11687 + CTC_to_m = 0x00000002,
11689 + RCOUNT_count_b = 0,
11690 + RCOUNT_count_m = 0x0000ffff,
11691 + RCOMPARE_compare_b = 0,
11692 + RCOMPARE_compare_m = 0x0000ffff,
11694 + RTC_ce_m = 0x00000001,
11696 + RTC_to_m = 0x00000002,
11698 + RTC_rqe_m = 0x00000004,
11701 +#endif //__IDT_RC32438_TIM_H__
11703 diff -Nur linux-2.6.15/include/asm-mips/mach-generic/irq.h linux-2.6.15-openwrt/include/asm-mips/mach-generic/irq.h
11704 --- linux-2.6.15/include/asm-mips/mach-generic/irq.h 2006-01-03 04:21:10.000000000 +0100
11705 +++ linux-2.6.15-openwrt/include/asm-mips/mach-generic/irq.h 2006-01-10 00:32:33.000000000 +0100
11707 #ifndef __ASM_MACH_GENERIC_IRQ_H
11708 #define __ASM_MACH_GENERIC_IRQ_H
11710 -#define NR_IRQS 128
11711 +#define NR_IRQS 256
11713 #endif /* __ASM_MACH_GENERIC_IRQ_H */
11714 diff -Nur linux-2.6.15/include/linux/init.h linux-2.6.15-openwrt/include/linux/init.h
11715 --- linux-2.6.15/include/linux/init.h 2006-01-03 04:21:10.000000000 +0100
11716 +++ linux-2.6.15-openwrt/include/linux/init.h 2006-01-10 00:32:33.000000000 +0100
11718 static initcall_t __initcall_##fn __attribute_used__ \
11719 __attribute__((__section__(".initcall" level ".init"))) = fn
11721 +#define early_initcall(fn) __define_initcall(".early1",fn)
11723 #define core_initcall(fn) __define_initcall("1",fn)
11724 #define postcore_initcall(fn) __define_initcall("2",fn)
11725 #define arch_initcall(fn) __define_initcall("3",fn)
11726 diff -Nur linux-2.6.15/include/linux/kernel.h linux-2.6.15-openwrt/include/linux/kernel.h
11727 --- linux-2.6.15/include/linux/kernel.h 2006-01-03 04:21:10.000000000 +0100
11728 +++ linux-2.6.15-openwrt/include/linux/kernel.h 2006-01-10 00:32:33.000000000 +0100
11729 @@ -307,6 +307,7 @@
11732 /* Force a compilation error if condition is true */
11733 +extern void BUILD_BUG(void);
11734 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
11736 #ifdef CONFIG_SYSCTL
11737 diff -Nur linux-2.6.15/Makefile linux-2.6.15-openwrt/Makefile
11738 --- linux-2.6.15/Makefile 2006-01-03 04:21:10.000000000 +0100
11739 +++ linux-2.6.15-openwrt/Makefile 2006-01-10 00:32:33.000000000 +0100
11740 @@ -166,10 +166,7 @@
11741 # then ARCH is assigned, getting whatever value it gets normally, and
11742 # SUBARCH is subsequently ignored.
11744 -SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
11745 - -e s/arm.*/arm/ -e s/sa110/arm/ \
11746 - -e s/s390x/s390/ -e s/parisc64/parisc/ \
11747 - -e s/ppc64/powerpc/ )
11750 # Cross compiling and selecting different set of gcc/bin-utils
11751 # ---------------------------------------------------------------------------
11752 diff -Nur linux-2.6.15/drivers/net/natsemi.c linux-2.6.15-openwrt/drivers/net/natsemi.c
11753 --- linux-2.6.15/drivers/net/natsemi.c 2006-01-02 19:21:10.000000000 -0800
11754 +++ linux-2.6.15-openwrt/drivers/net/natsemi.c 2006-01-10 07:29:49.581994000 -0800
11755 @@ -771,6 +771,49 @@
11756 static int netdev_get_eeprom(struct net_device *dev, u8 *buf);
11757 static struct ethtool_ops ethtool_ops;
11759 +#ifdef CONFIG_MACH_ARUBA
11761 +#include <linux/ctype.h>
11764 +#define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args)
11767 +static int parse_mac_addr(struct net_device *dev, char* macstr)
11770 + unsigned char result, value;
11772 + for (i=0; i<6; i++) {
11774 + if (i != 5 && *(macstr+2) != ':') {
11775 + ERR("invalid mac address format: %d %c\n",
11779 + for (j=0; j<2; j++) {
11780 + if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
11781 + toupper(*macstr)-'A'+10) < 16) {
11782 + result = result*16 + value;
11786 + ERR("invalid mac address "
11787 + "character: %c\n", *macstr);
11793 + dev->dev_addr[i] = result;
11796 + dev->dev_addr[5]++;
11802 static inline void __iomem *ns_ioaddr(struct net_device *dev)
11804 return (void __iomem *) dev->base_addr;
11805 @@ -859,6 +902,7 @@
11809 +#ifndef CONFIG_MACH_ARUBA
11810 /* Work around the dropped serial bit. */
11811 prev_eedata = eeprom_read(ioaddr, 6);
11812 for (i = 0; i < 3; i++) {
11813 @@ -867,6 +911,19 @@
11814 dev->dev_addr[i*2+1] = eedata >> 7;
11815 prev_eedata = eedata;
11820 + unsigned char def_mac[6] = {00, 0x0b, 0x86, 0xba, 0xdb, 0xad};
11821 + extern char *getenv(char *e);
11822 + memset(mac, 0, 32);
11823 + memcpy(mac, getenv("ethaddr"), 17);
11824 + if (parse_mac_addr(dev, mac)){
11825 + printk("%s: MAC address not found\n", __func__);
11826 + memcpy(dev->dev_addr, def_mac, 6);
11831 dev->base_addr = (unsigned long __force) ioaddr;
11833 diff -Nur linux-2.6.15/drivers/net/Makefile linux-2.6.15-openwrt/drivers/net/Makefile
11834 --- linux-2.6.15/drivers/net/Makefile 2006-01-13 09:19:55.000000000 -0800
11835 +++ linux-2.6.15-openwrt/drivers/net/Makefile 2006-01-09 20:44:10.378339000 -0800
11838 obj-$(CONFIG_OAKNET) += oaknet.o 8390.o
11840 +obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
11841 obj-$(CONFIG_DGRS) += dgrs.o
11842 obj-$(CONFIG_VORTEX) += 3c59x.o
11843 obj-$(CONFIG_TYPHOON) += typhoon.o
11844 @@ -190,7 +189,6 @@
11845 obj-$(CONFIG_SMC91X) += smc91x.o
11846 obj-$(CONFIG_DM9000) += dm9000.o
11847 obj-$(CONFIG_FEC_8XX) += fec_8xx/
11848 -obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
11850 obj-$(CONFIG_ARM) += arm/
11851 obj-$(CONFIG_DEV_APPLETALK) += appletalk/