1 diff -Nur linux-2.6.17/arch/mips/aruba/Makefile linux-2.6.17-owrt/arch/mips/aruba/Makefile
2 --- linux-2.6.17/arch/mips/aruba/Makefile 1970-01-01 01:00:00.000000000 +0100
3 +++ linux-2.6.17-owrt/arch/mips/aruba/Makefile 2006-06-18 12:44:28.000000000 +0200
5 +###############################################################################
7 +# BRIEF MODULE DESCRIPTION
8 +# Makefile for IDT EB434 BSP
10 +# Copyright 2004 IDT Inc. (rischelp@idt.com)
12 +# This program is free software; you can redistribute it and/or modify it
13 +# under the terms of the GNU General Public License as published by the
14 +# Free Software Foundation; either version 2 of the License, or (at your
15 +# option) any later version.
17 +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 +# NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 +# You should have received a copy of the GNU General Public License along
29 +# with this program; if not, write to the Free Software Foundation, Inc.,
30 +# 675 Mass Ave, Cambridge, MA 02139, USA.
33 +###############################################################################
40 +###############################################################################
44 +# $(CPP) $(CFLAGS) $< -o $*.s
46 +# $(CC) $(CFLAGS) -c $< -o $*.o
48 +obj-y := prom.o setup.o irq.o time.o flash_lock.o
49 +obj-$(CONFIG_SERIAL_8250) += serial.o
52 +obj-y += nvram/built-in.o
54 diff -Nur linux-2.6.17/arch/mips/aruba/nvram/Makefile linux-2.6.17-owrt/arch/mips/aruba/nvram/Makefile
55 --- linux-2.6.17/arch/mips/aruba/nvram/Makefile 1970-01-01 01:00:00.000000000 +0100
56 +++ linux-2.6.17-owrt/arch/mips/aruba/nvram/Makefile 2006-06-18 12:44:28.000000000 +0200
58 +###############################################################################
60 +# BRIEF MODULE DESCRIPTION
61 +# Makefile for IDT EB434 nvram access routines
63 +# Copyright 2004 IDT Inc. (rischelp@idt.com)
65 +# This program is free software; you can redistribute it and/or modify it
66 +# under the terms of the GNU General Public License as published by the
67 +# Free Software Foundation; either version 2 of the License, or (at your
68 +# option) any later version.
70 +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
71 +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
72 +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
73 +# NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
74 +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
75 +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
76 +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
77 +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
78 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
79 +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
81 +# You should have received a copy of the GNU General Public License along
82 +# with this program; if not, write to the Free Software Foundation, Inc.,
83 +# 675 Mass Ave, Cambridge, MA 02139, USA.
86 +###############################################################################
93 +###############################################################################
104 diff -Nur linux-2.6.17/arch/mips/aruba/nvram/nvram434.c linux-2.6.17-owrt/arch/mips/aruba/nvram/nvram434.c
105 --- linux-2.6.17/arch/mips/aruba/nvram/nvram434.c 1970-01-01 01:00:00.000000000 +0100
106 +++ linux-2.6.17-owrt/arch/mips/aruba/nvram/nvram434.c 2006-06-18 12:44:28.000000000 +0200
108 +/**************************************************************************
110 + * BRIEF MODULE DESCRIPTION
111 + * nvram interface routines.
113 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
115 + * This program is free software; you can redistribute it and/or modify it
116 + * under the terms of the GNU General Public License as published by the
117 + * Free Software Foundation; either version 2 of the License, or (at your
118 + * option) any later version.
120 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
121 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
122 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
123 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
124 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
125 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
126 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
127 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
128 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
129 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
131 + * You should have received a copy of the GNU General Public License along
132 + * with this program; if not, write to the Free Software Foundation, Inc.,
133 + * 675 Mass Ave, Cambridge, MA 02139, USA.
136 + **************************************************************************
137 + * May 2004 rkt, neb
143 + **************************************************************************
146 +#include <linux/ctype.h>
147 +#include <linux/string.h>
149 +//#include <asm/ds1553rtc.h>
150 +#include "nvram434.h"
151 +#define NVRAM_BASE 0xbfff8000
153 +extern void setenv (char *e, char *v, int rewrite);
154 +extern void unsetenv (char *e);
155 +extern void mapenv (int (*func)(char *, char *));
156 +extern char *getenv (char *s);
157 +extern void purgeenv(void);
159 +static void nvram_initenv(void);
161 +static unsigned char
162 +nvram_getbyte(int offs)
164 + return(*((unsigned char*)(NVRAM_BASE + offs)));
168 +nvram_setbyte(int offs, unsigned char val)
170 + unsigned char* nvramDataPointer = (unsigned char*)(NVRAM_BASE + offs);
172 + *nvramDataPointer = val;
178 +static unsigned short
179 +nvram_getshort(int offs)
181 + return((nvram_getbyte(offs) << 8) | nvram_getbyte(offs + 1));
185 +nvram_setshort(int offs, unsigned short val)
187 + nvram_setbyte(offs, (unsigned char)((val >> 8) & 0xff));
188 + nvram_setbyte(offs + 1, (unsigned char)(val & 0xff));
192 +nvram_getint(int offs)
195 + val = nvram_getbyte(offs) << 24;
196 + val |= nvram_getbyte(offs + 1) << 16;
197 + val |= nvram_getbyte(offs + 2) << 8;
198 + val |= nvram_getbyte(offs + 3);
203 +nvram_setint(int offs, unsigned int val)
205 + nvram_setbyte(offs, val >> 24);
206 + nvram_setbyte(offs + 1, val >> 16);
207 + nvram_setbyte(offs + 2, val >> 8);
208 + nvram_setbyte(offs + 3, val);
212 + * calculate NVRAM checksum
214 +static unsigned short
217 + unsigned short sum = NV_MAGIC;
220 + for (i = ENV_BASE; i < ENV_TOP; i += 2)
221 + sum += nvram_getshort(i);
226 + * update the nvram checksum
229 +nvram_updatesum (void)
231 + nvram_setshort(NVOFF_CSUM, nvram_calcsum());
235 + * test validity of nvram by checksumming it
240 + static int is_valid;
245 + if (nvram_getshort(NVOFF_MAGIC) != NV_MAGIC) {
246 + printk("nvram_isvalid FAILED\n");
253 +/* return nvram address of environment string */
255 +nvram_matchenv(char *s)
257 + int envsize, envp, n, i, varsize;
260 + envsize = nvram_getshort(NVOFF_ENVSIZE);
262 + if (envsize > ENV_AVAIL)
263 + return(0); /* sanity */
267 + if ((n = strlen (s)) > 255)
270 + while (envsize > 0) {
271 + varsize = nvram_getbyte(envp);
272 + if (varsize == 0 || (envp + varsize) > ENV_TOP)
273 + return(0); /* sanity */
274 + for (i = envp + 1, var = s; i <= envp + n; i++, var++) {
275 + char c1 = nvram_getbyte(i);
284 + if (i > envp + n) { /* match so far */
285 + if (n == varsize - 1) /* match on boolean */
287 + if (nvram_getbyte(i) == '=') /* exact match on variable */
290 + envsize -= varsize;
296 +static void nvram_initenv(void)
298 + nvram_setshort(NVOFF_MAGIC, NV_MAGIC);
299 + nvram_setshort(NVOFF_ENVSIZE, 0);
305 +nvram_delenv(char *s)
307 + int nenvp, envp, envsize, nbytes;
309 + envp = nvram_matchenv(s);
313 + nenvp = envp + nvram_getbyte(envp);
314 + envsize = nvram_getshort(NVOFF_ENVSIZE);
315 + nbytes = envsize - (nenvp - ENV_BASE);
316 + nvram_setshort(NVOFF_ENVSIZE, envsize - (nenvp - envp));
318 + nvram_setbyte(envp, nvram_getbyte(nenvp));
326 +nvram_setenv(char *s, char *v)
331 + if (!nvram_isvalid())
340 + total = ns + nv + 2;
346 + if (total > 255 || total > ENV_AVAIL - nvram_getshort(NVOFF_ENVSIZE))
349 + envp = ENV_BASE + nvram_getshort(NVOFF_ENVSIZE);
351 + nvram_setbyte(envp, (unsigned char) total);
355 + nvram_setbyte(envp, *s);
361 + nvram_setbyte(envp, '=');
364 + nvram_setbyte(envp, *v);
369 + nvram_setshort(NVOFF_ENVSIZE, envp-ENV_BASE);
375 +nvram_getenv(char *s)
377 + static char buf[256]; /* FIXME: this cannot be static */
378 + int envp, ns, nbytes, i;
380 + if (!nvram_isvalid())
381 + return "INVALID NVRAM"; //((char *)0);
383 + envp = nvram_matchenv(s);
385 + return "NOT FOUND"; //((char *)0);
387 + if (nvram_getbyte(envp) == ns + 1) /* boolean */
390 + nbytes = nvram_getbyte(envp) - (ns + 2);
392 + for (i = 0; i < nbytes; i++)
393 + buf[i] = nvram_getbyte(envp++);
400 +nvram_unsetenv(char *s)
402 + if (!nvram_isvalid())
409 + * apply func to each string in environment
412 +nvram_mapenv(int (*func)(char *, char *))
414 + int envsize, envp, n, i, seeneql;
415 + char name[256], value[256];
418 + if (!nvram_isvalid())
421 + envsize = nvram_getshort(NVOFF_ENVSIZE);
424 + while (envsize > 0) {
428 + n = nvram_getbyte(envp);
429 + for (i = envp + 1; i < envp + n; i++) {
430 + c = nvram_getbyte(i);
431 + if ((c == '=') && !seeneql) {
440 + (*func)(name, value);
449 + if ('0' <= c && c <= '9')
451 + if ('A' <= c && c <= 'Z')
452 + return (10 + c - 'A');
453 + if ('a' <= c && c <= 'z')
454 + return (10 + c - 'a');
459 + * Wrappers to allow 'special' environment variables to get processed
462 +setenv(char *e, char *v, int rewrite)
464 + if (nvram_getenv(e) && !rewrite)
467 + nvram_setenv(e, v);
473 + return(nvram_getenv(e));
486 + unsigned char* nvramDataPointer = (unsigned char*)(NVRAM_BASE);
488 + for (i = ENV_BASE; i < ENV_TOP; i++)
489 + *nvramDataPointer++ = 0;
490 + nvram_setshort(NVOFF_MAGIC, NV_MAGIC);
491 + nvram_setshort(NVOFF_ENVSIZE, 0);
492 + nvram_setshort(NVOFF_CSUM, NV_MAGIC);
496 +mapenv(int (*func)(char *, char *))
498 + nvram_mapenv(func);
500 diff -Nur linux-2.6.17/arch/mips/aruba/nvram/nvram434.h linux-2.6.17-owrt/arch/mips/aruba/nvram/nvram434.h
501 --- linux-2.6.17/arch/mips/aruba/nvram/nvram434.h 1970-01-01 01:00:00.000000000 +0100
502 +++ linux-2.6.17-owrt/arch/mips/aruba/nvram/nvram434.h 2006-06-18 12:44:28.000000000 +0200
504 +/**************************************************************************
506 + * BRIEF MODULE DESCRIPTION
507 + * nvram definitions.
509 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
511 + * This program is free software; you can redistribute it and/or modify it
512 + * under the terms of the GNU General Public License as published by the
513 + * Free Software Foundation; either version 2 of the License, or (at your
514 + * option) any later version.
516 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
517 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
518 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
519 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
520 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
521 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
522 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
523 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
524 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
525 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
527 + * You should have received a copy of the GNU General Public License along
528 + * with this program; if not, write to the Free Software Foundation, Inc.,
529 + * 675 Mass Ave, Cambridge, MA 02139, USA.
532 + **************************************************************************
533 + * May 2004 rkt, neb
539 + **************************************************************************
545 +#define NVOFFSET 0 /* use all of NVRAM */
547 +/* Offsets to reserved locations */
548 + /* size description */
549 +#define NVOFF_MAGIC (NVOFFSET + 0) /* 2 magic value */
550 +#define NVOFF_CSUM (NVOFFSET + 2) /* 2 NVRAM environment checksum */
551 +#define NVOFF_ENVSIZE (NVOFFSET + 4) /* 2 size of 'environment' */
552 +#define NVOFF_TEST (NVOFFSET + 5) /* 1 cold start test byte */
553 +#define NVOFF_ETHADDR (NVOFFSET + 6) /* 6 decoded ethernet address */
554 +#define NVOFF_UNUSED (NVOFFSET + 12) /* 0 current end of table */
556 +#define NV_MAGIC 0xdeaf /* nvram magic number */
557 +#define NV_RESERVED 6 /* number of reserved bytes */
559 +#undef NVOFF_ETHADDR
560 +#define NVOFF_ETHADDR (NVOFFSET + NV_RESERVED - 6)
562 +/* number of bytes available for environment */
563 +#define ENV_BASE (NVOFFSET + NV_RESERVED)
564 +#define ENV_TOP 0x2000
565 +#define ENV_AVAIL (ENV_TOP - ENV_BASE)
567 +#endif /* _NVRAM_ */
570 diff -Nur linux-2.6.17/arch/mips/aruba/prom.c linux-2.6.17-owrt/arch/mips/aruba/prom.c
571 --- linux-2.6.17/arch/mips/aruba/prom.c 1970-01-01 01:00:00.000000000 +0100
572 +++ linux-2.6.17-owrt/arch/mips/aruba/prom.c 2006-06-18 12:44:28.000000000 +0200
574 +/**************************************************************************
576 + * BRIEF MODULE DESCRIPTION
577 + * prom interface routines
579 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
581 + * This program is free software; you can redistribute it and/or modify it
582 + * under the terms of the GNU General Public License as published by the
583 + * Free Software Foundation; either version 2 of the License, or (at your
584 + * option) any later version.
586 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
587 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
588 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
589 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
590 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
591 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
592 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
593 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
594 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
595 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
597 + * You should have received a copy of the GNU General Public License along
598 + * with this program; if not, write to the Free Software Foundation, Inc.,
599 + * 675 Mass Ave, Cambridge, MA 02139, USA.
602 + **************************************************************************
603 + * May 2004 rkt, neb
609 + **************************************************************************
612 +#include <linux/config.h>
613 +#include <linux/init.h>
614 +#include <linux/mm.h>
615 +#include <linux/module.h>
616 +#include <linux/string.h>
617 +#include <linux/console.h>
618 +#include <asm/bootinfo.h>
619 +#include <linux/bootmem.h>
620 +#include <linux/ioport.h>
621 +#include <linux/serial.h>
622 +#include <linux/serialP.h>
623 +#include <asm/serial.h>
624 +#include <linux/ioport.h>
626 +unsigned int idt_cpu_freq;
627 +EXPORT_SYMBOL(idt_cpu_freq);
629 +unsigned int arch_has_pci=0;
631 +/* Kernel Boot parameters */
632 +static unsigned char bootparm[] = "console=ttyS0,9600 root=/dev/mtdblock1 rootfstype=jffs2";
634 +extern unsigned long mips_machgroup;
635 +extern unsigned long mips_machtype;
637 +extern void setup_serial_port(void);
638 +extern char * getenv(char *e);
640 +/* IDT 79EB434 memory map -- we really should be auto sizing it */
641 +#define RAM_SIZE 32*1024*1024
643 +char *__init prom_getcmdline(void)
645 + return &(arcs_cmdline[0]);
648 +void __init prom_init(void)
651 + sprintf(arcs_cmdline, "%s", bootparm);
653 + /* set our arch type */
654 + mips_machgroup = MACH_GROUP_ARUBA;
655 + mips_machtype = MACH_ARUBA_UNKNOWN;
657 + boardname=getenv("boardname");
659 + if (!strcmp(boardname,"Muscat")) {
660 + mips_machtype = MACH_ARUBA_AP70;
661 + idt_cpu_freq = 133000000;
663 + } else if (!strcmp(boardname,"Mataro")) {
664 + mips_machtype = MACH_ARUBA_AP65;
665 + idt_cpu_freq = 110000000;
666 + } else if (!strcmp(boardname,"Merlot")) {
667 + mips_machtype = MACH_ARUBA_AP60;
668 + idt_cpu_freq = 90000000;
671 + /* turn on the console */
672 + setup_serial_port();
675 + * give all RAM to boot allocator,
676 + * except where the kernel was loaded
678 + add_memory_region(0,RAM_SIZE,BOOT_MEM_RAM);
681 +void prom_free_prom_memory(void)
683 + printk("stubbed prom_free_prom_memory()\n");
685 diff -Nur linux-2.6.17/arch/mips/aruba/serial.c linux-2.6.17-owrt/arch/mips/aruba/serial.c
686 --- linux-2.6.17/arch/mips/aruba/serial.c 1970-01-01 01:00:00.000000000 +0100
687 +++ linux-2.6.17-owrt/arch/mips/aruba/serial.c 2006-06-18 12:44:28.000000000 +0200
689 +/**************************************************************************
691 + * BRIEF MODULE DESCRIPTION
692 + * Serial port initialisation.
694 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
696 + * This program is free software; you can redistribute it and/or modify it
697 + * under the terms of the GNU General Public License as published by the
698 + * Free Software Foundation; either version 2 of the License, or (at your
699 + * option) any later version.
701 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
702 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
703 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
704 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
705 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
706 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
707 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
708 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
709 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
710 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
712 + * You should have received a copy of the GNU General Public License along
713 + * with this program; if not, write to the Free Software Foundation, Inc.,
714 + * 675 Mass Ave, Cambridge, MA 02139, USA.
717 + **************************************************************************
718 + * May 2004 rkt, neb
724 + **************************************************************************
728 +#include <linux/config.h>
729 +#include <linux/init.h>
730 +#include <linux/sched.h>
731 +#include <linux/pci.h>
732 +#include <linux/interrupt.h>
733 +#include <linux/tty.h>
734 +#include <linux/serial.h>
735 +#include <linux/serial_core.h>
737 +#include <asm/time.h>
738 +#include <asm/cpu.h>
739 +#include <asm/bootinfo.h>
740 +#include <asm/irq.h>
741 +#include <asm/serial.h>
743 +#include <asm/idt-boards/rc32434/rc32434.h>
745 +extern int __init early_serial_setup(struct uart_port *port);
747 +#define BASE_BAUD (1843200 / 16)
749 +extern unsigned int idt_cpu_freq;
751 +extern int __init setup_serial_port(void)
753 + static struct uart_port serial_req[2];
755 + memset(serial_req, 0, sizeof(serial_req));
756 + serial_req[0].type = PORT_16550A;
757 + serial_req[0].line = 0;
758 + serial_req[0].flags = STD_COM_FLAGS;
759 + serial_req[0].iotype = SERIAL_IO_MEM;
760 + serial_req[0].regshift = 2;
762 + switch (mips_machtype) {
763 + case MACH_ARUBA_AP70:
764 + serial_req[0].irq = 104;
765 + serial_req[0].mapbase = KSEG1ADDR(0x18058003);
766 + serial_req[0].membase = (char *) KSEG1ADDR(0x18058003);
767 + serial_req[0].uartclk = idt_cpu_freq;
769 + case MACH_ARUBA_AP65:
770 + case MACH_ARUBA_AP60:
772 + serial_req[0].irq = 12;
773 + serial_req[0].mapbase = KSEG1ADDR(0xbc000003);
774 + serial_req[0].membase = (char *) KSEG1ADDR(0xbc000003);
775 + serial_req[0].uartclk = idt_cpu_freq / 2;
779 + early_serial_setup(&serial_req[0]);
783 diff -Nur linux-2.6.17/arch/mips/aruba/setup.c linux-2.6.17-owrt/arch/mips/aruba/setup.c
784 --- linux-2.6.17/arch/mips/aruba/setup.c 1970-01-01 01:00:00.000000000 +0100
785 +++ linux-2.6.17-owrt/arch/mips/aruba/setup.c 2006-06-18 12:44:28.000000000 +0200
787 +/**************************************************************************
789 + * BRIEF MODULE DESCRIPTION
790 + * setup routines for IDT EB434 boards
792 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
794 + * This program is free software; you can redistribute it and/or modify it
795 + * under the terms of the GNU General Public License as published by the
796 + * Free Software Foundation; either version 2 of the License, or (at your
797 + * option) any later version.
799 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
800 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
801 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
802 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
803 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
804 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
805 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
806 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
807 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
808 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
810 + * You should have received a copy of the GNU General Public License along
811 + * with this program; if not, write to the Free Software Foundation, Inc.,
812 + * 675 Mass Ave, Cambridge, MA 02139, USA.
815 + **************************************************************************
816 + * May 2004 rkt, neb
822 + **************************************************************************
825 +#include <linux/init.h>
826 +#include <linux/module.h>
827 +#include <linux/mm.h>
828 +#include <linux/sched.h>
829 +#include <linux/irq.h>
830 +#include <asm/bootinfo.h>
832 +#include <linux/ioport.h>
833 +#include <asm/mipsregs.h>
834 +#include <asm/pgtable.h>
835 +#include <asm/reboot.h>
836 +#include <asm/addrspace.h> /* for KSEG1ADDR() */
837 +#include <asm/idt-boards/rc32434/rc32434.h>
838 +#include <linux/pm.h>
840 +extern char *__init prom_getcmdline(void);
842 +extern void (*board_time_init) (void);
843 +extern void (*board_timer_setup) (struct irqaction * irq);
844 +extern void aruba_time_init(void);
845 +extern void aruba_timer_setup(struct irqaction *irq);
846 +extern void aruba_reset(void);
848 +#define epldMask ((volatile unsigned char *)0xB900000d)
850 +static void aruba_machine_restart(char *command)
852 + switch (mips_machtype) {
853 + case MACH_ARUBA_AP70:
854 + *(volatile u32 *)KSEG1ADDR(0x18008000) = 0x80000001;
856 + case MACH_ARUBA_AP65:
857 + case MACH_ARUBA_AP60:
860 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0x00080350; // reset everything in sight
862 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0; // reset everything in sight
864 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0x3; // cold reset the cpu & system
869 +static void aruba_machine_halt(void)
874 +extern char * getenv(char *e);
875 +extern void unlock_ap60_70_flash(void);
877 +void __init plat_setup(void)
879 + board_time_init = aruba_time_init;
881 + board_timer_setup = aruba_timer_setup;
883 + _machine_restart = aruba_machine_restart;
884 + _machine_halt = aruba_machine_halt;
885 + pm_power_off = aruba_machine_halt;
887 + set_io_port_base(KSEG1);
889 + /* Enable PCI interrupts in EPLD Mask register */
891 + *(epldMask + 1) = 0x0;
894 + unlock_ap60_70_flash();
896 + printk("BOARD - %s\n",getenv("boardname"));
901 +int page_is_ram(unsigned long pagenr)
906 +const char *get_system_type(void)
908 + switch (mips_machtype) {
909 + case MACH_ARUBA_AP70:
910 + return "Aruba AP70";
911 + case MACH_ARUBA_AP65:
912 + return "Aruba AP65";
913 + case MACH_ARUBA_AP60:
914 + return "Aruba AP60/AP61";
916 + return "Aruba UNKNOWN";
920 +EXPORT_SYMBOL(get_system_type);
921 diff -Nur linux-2.6.17/arch/mips/aruba/time.c linux-2.6.17-owrt/arch/mips/aruba/time.c
922 --- linux-2.6.17/arch/mips/aruba/time.c 1970-01-01 01:00:00.000000000 +0100
923 +++ linux-2.6.17-owrt/arch/mips/aruba/time.c 2006-06-18 12:44:28.000000000 +0200
925 +/**************************************************************************
927 + * BRIEF MODULE DESCRIPTION
928 + * timer routines for IDT EB434 boards
930 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
932 + * This program is free software; you can redistribute it and/or modify it
933 + * under the terms of the GNU General Public License as published by the
934 + * Free Software Foundation; either version 2 of the License, or (at your
935 + * option) any later version.
937 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
938 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
939 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
940 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
941 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
942 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
943 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
944 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
945 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
946 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
948 + * You should have received a copy of the GNU General Public License along
949 + * with this program; if not, write to the Free Software Foundation, Inc.,
950 + * 675 Mass Ave, Cambridge, MA 02139, USA.
953 + **************************************************************************
954 + * May 2004 rkt, neb
960 + **************************************************************************
963 +#include <linux/config.h>
964 +#include <linux/init.h>
965 +#include <linux/kernel_stat.h>
966 +#include <linux/sched.h>
967 +#include <linux/spinlock.h>
968 +#include <linux/mc146818rtc.h>
969 +#include <linux/irq.h>
970 +#include <linux/timex.h>
972 +#include <linux/param.h>
973 +#include <asm/mipsregs.h>
974 +#include <asm/ptrace.h>
975 +#include <asm/time.h>
976 +#include <asm/hardirq.h>
978 +#include <asm/mipsregs.h>
979 +#include <asm/ptrace.h>
980 +#include <asm/debug.h>
981 +#include <asm/time.h>
983 +#include <asm/idt-boards/rc32434/rc32434.h>
985 +static unsigned long r4k_offset; /* Amount to incr compare reg each time */
986 +static unsigned long r4k_cur; /* What counter should be at next timer irq */
988 +extern unsigned int idt_cpu_freq;
990 +static unsigned long __init cal_r4koff(void)
992 + mips_hpt_frequency = idt_cpu_freq * IDT_CLOCK_MULT / 2;
993 + return (mips_hpt_frequency / HZ);
996 +void __init aruba_time_init(void)
998 + unsigned int est_freq, flags;
999 + local_irq_save(flags);
1001 + printk("calculating r4koff... ");
1002 + r4k_offset = cal_r4koff();
1003 + printk("%08lx(%d)\n", r4k_offset, (int)r4k_offset);
1005 + est_freq = 2 * r4k_offset * HZ;
1006 + est_freq += 5000; /* round */
1007 + est_freq -= est_freq % 10000;
1008 + printk("CPU frequency %d.%02d MHz\n", est_freq / 1000000,
1009 + (est_freq % 1000000) * 100 / 1000000);
1010 + local_irq_restore(flags);
1014 +void __init aruba_timer_setup(struct irqaction *irq)
1016 + /* we are using the cpu counter for timer interrupts */
1017 + setup_irq(MIPS_CPU_TIMER_IRQ, irq);
1019 + /* to generate the first timer interrupt */
1020 + r4k_cur = (read_c0_count() + r4k_offset);
1021 + write_c0_compare(r4k_cur);
1025 +asmlinkage void aruba_timer_interrupt(struct pt_regs *regs)
1027 + int irq = MIPS_CPU_TIMER_IRQ;
1030 + kstat_this_cpu.irqs[irq]++;
1032 + timer_interrupt(irq, NULL, regs);
1035 diff -Nur linux-2.6.17/arch/mips/Kconfig linux-2.6.17-owrt/arch/mips/Kconfig
1036 --- linux-2.6.17/arch/mips/Kconfig 2006-06-18 03:49:35.000000000 +0200
1037 +++ linux-2.6.17-owrt/arch/mips/Kconfig 2006-06-18 12:44:28.000000000 +0200
1038 @@ -227,6 +227,17 @@
1039 either a NEC Vr5432 or QED RM5231. Say Y here if you wish to build
1040 a kernel for this platform.
1043 + bool "Support for the ARUBA product line"
1044 + select DMA_NONCOHERENT
1045 + select CPU_HAS_PREFETCH
1047 + select SWAP_IO_SPACE
1048 + select SYS_SUPPORTS_32BIT_KERNEL
1049 + select SYS_HAS_CPU_MIPS32_R1
1050 + select SYS_SUPPORTS_BIG_ENDIAN
1054 bool "Jazz family of machines"
1056 diff -Nur linux-2.6.17/arch/mips/Makefile linux-2.6.17-owrt/arch/mips/Makefile
1057 --- linux-2.6.17/arch/mips/Makefile 2006-06-18 03:49:35.000000000 +0200
1058 +++ linux-2.6.17-owrt/arch/mips/Makefile 2006-06-18 12:44:28.000000000 +0200
1059 @@ -145,6 +145,14 @@
1066 +core-$(CONFIG_MACH_ARUBA) += arch/mips/aruba/
1067 +cflags-$(CONFIG_MACH_ARUBA) += -Iinclude/asm-mips/aruba
1068 +load-$(CONFIG_MACH_ARUBA) += 0x80100000
1071 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
1073 core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
1074 diff -Nur linux-2.6.17/arch/mips/mm/tlbex.c linux-2.6.17-owrt/arch/mips/mm/tlbex.c
1075 --- linux-2.6.17/arch/mips/mm/tlbex.c 2006-06-18 03:49:35.000000000 +0200
1076 +++ linux-2.6.17-owrt/arch/mips/mm/tlbex.c 2006-06-18 12:48:27.000000000 +0200
1093 diff -Nur linux-2.6.17/drivers/net/Kconfig linux-2.6.17-owrt/drivers/net/Kconfig
1094 --- linux-2.6.17/drivers/net/Kconfig 2006-06-18 03:49:35.000000000 +0200
1095 +++ linux-2.6.17-owrt/drivers/net/Kconfig 2006-06-18 12:44:28.000000000 +0200
1096 @@ -187,6 +187,13 @@
1098 source "drivers/net/arm/Kconfig"
1100 +config IDT_RC32434_ETH
1101 + tristate "IDT RC32434 Local Ethernet support"
1102 + depends on NET_ETHERNET
1104 + IDT RC32434 has one local ethernet port. Say Y here to enable it.
1105 + To compile this driver as a module, choose M here.
1108 tristate "MACE (Power Mac ethernet) support"
1109 depends on NET_ETHERNET && PPC_PMAC && PPC32
1110 diff -Nur linux-2.6.17/drivers/net/Makefile linux-2.6.17-owrt/drivers/net/Makefile
1111 --- linux-2.6.17/drivers/net/Makefile 2006-06-18 03:49:35.000000000 +0200
1112 +++ linux-2.6.17-owrt/drivers/net/Makefile 2006-06-18 12:44:28.000000000 +0200
1115 obj-$(CONFIG_OAKNET) += oaknet.o 8390.o
1117 +obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
1118 obj-$(CONFIG_DGRS) += dgrs.o
1119 obj-$(CONFIG_VORTEX) += 3c59x.o
1120 obj-$(CONFIG_TYPHOON) += typhoon.o
1121 diff -Nur linux-2.6.17/drivers/net/natsemi.c linux-2.6.17-owrt/drivers/net/natsemi.c
1122 --- linux-2.6.17/drivers/net/natsemi.c 2006-06-18 03:49:35.000000000 +0200
1123 +++ linux-2.6.17-owrt/drivers/net/natsemi.c 2006-06-18 12:44:28.000000000 +0200
1124 @@ -771,6 +771,49 @@
1125 static int netdev_get_eeprom(struct net_device *dev, u8 *buf);
1126 static struct ethtool_ops ethtool_ops;
1128 +#ifdef CONFIG_MACH_ARUBA
1130 +#include <linux/ctype.h>
1133 +#define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args)
1136 +static int parse_mac_addr(struct net_device *dev, char* macstr)
1139 + unsigned char result, value;
1141 + for (i=0; i<6; i++) {
1143 + if (i != 5 && *(macstr+2) != ':') {
1144 + ERR("invalid mac address format: %d %c\n",
1148 + for (j=0; j<2; j++) {
1149 + if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
1150 + toupper(*macstr)-'A'+10) < 16) {
1151 + result = result*16 + value;
1155 + ERR("invalid mac address "
1156 + "character: %c\n", *macstr);
1162 + dev->dev_addr[i] = result;
1165 + dev->dev_addr[5]++;
1171 static inline void __iomem *ns_ioaddr(struct net_device *dev)
1173 return (void __iomem *) dev->base_addr;
1178 +#ifndef CONFIG_MACH_ARUBA
1179 /* Work around the dropped serial bit. */
1180 prev_eedata = eeprom_read(ioaddr, 6);
1181 for (i = 0; i < 3; i++) {
1182 @@ -879,6 +923,19 @@
1183 dev->dev_addr[i*2+1] = eedata >> 7;
1184 prev_eedata = eedata;
1189 + unsigned char def_mac[6] = {00, 0x0b, 0x86, 0xba, 0xdb, 0xad};
1190 + extern char *getenv(char *e);
1191 + memset(mac, 0, 32);
1192 + memcpy(mac, getenv("ethaddr"), 17);
1193 + if (parse_mac_addr(dev, mac)){
1194 + printk("%s: MAC address not found\n", __func__);
1195 + memcpy(dev->dev_addr, def_mac, 6);
1200 dev->base_addr = (unsigned long __force) ioaddr;
1202 diff -Nur linux-2.6.17/drivers/net/rc32434_eth.c linux-2.6.17-owrt/drivers/net/rc32434_eth.c
1203 --- linux-2.6.17/drivers/net/rc32434_eth.c 1970-01-01 01:00:00.000000000 +0100
1204 +++ linux-2.6.17-owrt/drivers/net/rc32434_eth.c 2006-06-18 12:44:28.000000000 +0200
1206 +/**************************************************************************
1208 + * BRIEF MODULE DESCRIPTION
1209 + * Driver for the IDT RC32434 on-chip ethernet controller.
1211 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1213 + * This program is free software; you can redistribute it and/or modify it
1214 + * under the terms of the GNU General Public License as published by the
1215 + * Free Software Foundation; either version 2 of the License, or (at your
1216 + * option) any later version.
1218 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1219 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1220 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1221 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1222 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1223 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1224 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1225 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1226 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1227 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1229 + * You should have received a copy of the GNU General Public License along
1230 + * with this program; if not, write to the Free Software Foundation, Inc.,
1231 + * 675 Mass Ave, Cambridge, MA 02139, USA.
1234 + **************************************************************************
1235 + * May 2004 rkt, neb
1237 + * Based on the driver developed by B. Maruthanayakam, H. Kou and others.
1243 + **************************************************************************
1246 +#include <linux/config.h>
1247 +#include <linux/version.h>
1248 +#include <linux/module.h>
1249 +#include <linux/kernel.h>
1250 +#include <linux/moduleparam.h>
1251 +#include <linux/sched.h>
1252 +#include <linux/ctype.h>
1253 +#include <linux/types.h>
1254 +#include <linux/fcntl.h>
1255 +#include <linux/interrupt.h>
1256 +#include <linux/ptrace.h>
1257 +#include <linux/init.h>
1258 +#include <linux/ioport.h>
1259 +#include <linux/proc_fs.h>
1260 +#include <linux/in.h>
1261 +#include <linux/slab.h>
1262 +#include <linux/string.h>
1263 +#include <linux/delay.h>
1264 +#include <linux/netdevice.h>
1265 +#include <linux/etherdevice.h>
1266 +#include <linux/skbuff.h>
1267 +#include <linux/errno.h>
1268 +#include <asm/bootinfo.h>
1269 +#include <asm/system.h>
1270 +#include <asm/bitops.h>
1271 +#include <asm/pgtable.h>
1272 +#include <asm/segment.h>
1273 +#include <asm/io.h>
1274 +#include <asm/dma.h>
1276 +#include "rc32434_eth.h"
1278 +#define DRIVER_VERSION "(mar2904)"
1280 +#define DRIVER_NAME "rc32434 Ethernet driver. " DRIVER_VERSION
1283 +#define STATION_ADDRESS_HIGH(dev) (((dev)->dev_addr[0] << 8) | \
1284 + ((dev)->dev_addr[1]))
1285 +#define STATION_ADDRESS_LOW(dev) (((dev)->dev_addr[2] << 24) | \
1286 + ((dev)->dev_addr[3] << 16) | \
1287 + ((dev)->dev_addr[4] << 8) | \
1288 + ((dev)->dev_addr[5]))
1290 +#define MII_CLOCK 1250000 /* no more than 2.5MHz */
1291 +static char mac0[18] = "08:00:06:05:40:01";
1293 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,52)
1294 +module_param_string(mac0, mac0, 18, 0);
1296 +MODULE_PARM(mac0, "c18");
1298 +MODULE_PARM_DESC(mac0, "MAC address for RC32434 ethernet0");
1300 +static struct rc32434_if_t {
1302 + struct net_device *dev;
1312 +} rc32434_iflist[] =
1315 + "rc32434_eth0", NULL, mac0,
1317 + ETH0_PhysicalAddress,
1328 +static int parse_mac_addr(struct net_device *dev, char* macstr)
1331 + unsigned char result, value;
1333 + for (i=0; i<6; i++) {
1335 + if (i != 5 && *(macstr+2) != ':') {
1336 + ERR("invalid mac address format: %d %c\n",
1340 + for (j=0; j<2; j++) {
1341 + if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
1342 + toupper(*macstr)-'A'+10) < 16) {
1343 + result = result*16 + value;
1347 + ERR("invalid mac address "
1348 + "character: %c\n", *macstr);
1354 + dev->dev_addr[i] = result;
1362 +static inline void rc32434_abort_tx(struct net_device *dev)
1364 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1365 + rc32434_abort_dma(dev, lp->tx_dma_regs);
1369 +static inline void rc32434_abort_rx(struct net_device *dev)
1371 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1372 + rc32434_abort_dma(dev, lp->rx_dma_regs);
1376 +static inline void rc32434_start_tx(struct rc32434_local *lp, volatile DMAD_t td)
1378 + rc32434_start_dma(lp->tx_dma_regs, CPHYSADDR(td));
1381 +static inline void rc32434_start_rx(struct rc32434_local *lp, volatile DMAD_t rd)
1383 + rc32434_start_dma(lp->rx_dma_regs, CPHYSADDR(rd));
1386 +static inline void rc32434_chain_tx(struct rc32434_local *lp, volatile DMAD_t td)
1388 + rc32434_chain_dma(lp->tx_dma_regs, CPHYSADDR(td));
1391 +static inline void rc32434_chain_rx(struct rc32434_local *lp, volatile DMAD_t rd)
1393 + rc32434_chain_dma(lp->rx_dma_regs, CPHYSADDR(rd));
1396 +#ifdef RC32434_PROC_DEBUG
1397 +static int rc32434_read_proc(char *buf, char **start, off_t fpos,
1398 + int length, int *eof, void *data)
1400 + struct net_device *dev = (struct net_device *)data;
1401 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1404 + /* print out header */
1405 + len += sprintf(buf + len, "\n\tRC32434 Ethernet Debug\n\n");
1406 + len += sprintf (buf + len,
1407 + "DMA halt count = %10d, DMA run count = %10d\n",
1408 + lp->dma_halt_cnt, lp->dma_run_cnt);
1410 + if (fpos >= len) {
1415 + *start = buf + fpos;
1417 + if ((len -= fpos) > length)
1428 + * Restart the RC32434 ethernet controller.
1430 +static int rc32434_restart(struct net_device *dev)
1432 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1435 + * Disable interrupts
1437 + disable_irq(lp->rx_irq);
1438 + disable_irq(lp->tx_irq);
1439 +#ifdef RC32434_REVISION
1440 + disable_irq(lp->ovr_irq);
1442 + disable_irq(lp->und_irq);
1444 + /* Mask F E bit in Tx DMA */
1445 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) | DMASM_f_m | DMASM_e_m, &lp->tx_dma_regs->dmasm);
1446 + /* Mask D H E bit in Rx DMA */
1447 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) | DMASM_d_m | DMASM_h_m | DMASM_e_m, &lp->rx_dma_regs->dmasm);
1449 + rc32434_init(dev);
1450 + rc32434_multicast_list(dev);
1452 + enable_irq(lp->und_irq);
1453 +#ifdef RC32434_REVISION
1454 + enable_irq(lp->ovr_irq);
1456 + enable_irq(lp->tx_irq);
1457 + enable_irq(lp->rx_irq);
1462 +int rc32434_init_module(void)
1464 +#ifdef CONFIG_MACH_ARUBA
1465 + if (mips_machtype != MACH_ARUBA_AP70)
1469 + printk(KERN_INFO DRIVER_NAME " \n");
1470 + return rc32434_probe(0);
1473 +static int rc32434_probe(int port_num)
1475 + struct rc32434_if_t *bif = &rc32434_iflist[port_num];
1476 + struct rc32434_local *lp = NULL;
1477 + struct net_device *dev = NULL;
1478 + int i, retval,err;
1480 + dev = alloc_etherdev(sizeof(struct rc32434_local));
1482 + ERR("rc32434_eth: alloc_etherdev failed\n");
1486 + SET_MODULE_OWNER(dev);
1489 +#ifdef CONFIG_MACH_ARUBA
1491 + extern char * getenv(char *e);
1492 + memcpy(bif->mac_str, getenv("ethaddr"), 17);
1496 + printk("mac: %s\n", bif->mac_str);
1497 + if ((retval = parse_mac_addr(dev, bif->mac_str))) {
1498 + ERR("MAC address parse failed\n");
1504 + /* Initialize the device structure. */
1505 + if (dev->priv == NULL) {
1506 + lp = (struct rc32434_local *)kmalloc(sizeof(*lp), GFP_KERNEL);
1507 + memset(lp, 0, sizeof(struct rc32434_local));
1510 + lp = (struct rc32434_local *)dev->priv;
1513 + lp->rx_irq = bif->rx_dma_irq;
1514 + lp->tx_irq = bif->tx_dma_irq;
1515 + lp->ovr_irq = bif->rx_ovr_irq;
1516 + lp->und_irq = bif->tx_und_irq;
1518 + lp->eth_regs = ioremap_nocache(bif->iobase, sizeof(*lp->eth_regs));
1520 + if (!lp->eth_regs) {
1521 + ERR("Can't remap eth registers\n");
1523 + goto probe_err_out;
1526 + lp->rx_dma_regs = ioremap_nocache(bif->rxdmabase, sizeof(struct DMA_Chan_s));
1528 + if (!lp->rx_dma_regs) {
1529 + ERR("Can't remap Rx DMA registers\n");
1531 + goto probe_err_out;
1533 + lp->tx_dma_regs = ioremap_nocache(bif->txdmabase,sizeof(struct DMA_Chan_s));
1535 + if (!lp->tx_dma_regs) {
1536 + ERR("Can't remap Tx DMA registers\n");
1538 + goto probe_err_out;
1541 +#ifdef RC32434_PROC_DEBUG
1542 + lp->ps = create_proc_read_entry (bif->name, 0, proc_net,
1543 + rc32434_read_proc, dev);
1546 + lp->td_ring = (DMAD_t)kmalloc(TD_RING_SIZE + RD_RING_SIZE, GFP_KERNEL);
1547 + if (!lp->td_ring) {
1548 + ERR("Can't allocate descriptors\n");
1550 + goto probe_err_out;
1553 + dma_cache_inv((unsigned long)(lp->td_ring), TD_RING_SIZE + RD_RING_SIZE);
1555 + /* now convert TD_RING pointer to KSEG1 */
1556 + lp->td_ring = (DMAD_t )KSEG1ADDR(lp->td_ring);
1557 + lp->rd_ring = &lp->td_ring[RC32434_NUM_TDS];
1560 + spin_lock_init(&lp->lock);
1562 + dev->base_addr = bif->iobase;
1563 + /* just use the rx dma irq */
1564 + dev->irq = bif->rx_dma_irq;
1568 + dev->open = rc32434_open;
1569 + dev->stop = rc32434_close;
1570 + dev->hard_start_xmit = rc32434_send_packet;
1571 + dev->get_stats = rc32434_get_stats;
1572 + dev->set_multicast_list = &rc32434_multicast_list;
1573 + dev->tx_timeout = rc32434_tx_timeout;
1574 + dev->watchdog_timeo = RC32434_TX_TIMEOUT;
1576 +#ifdef CONFIG_IDT_USE_NAPI
1577 + dev->poll = rc32434_poll;
1578 + dev->weight = bif->weight;
1579 + printk("Using NAPI with weight %d\n",dev->weight);
1581 + lp->rx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
1582 + tasklet_init(lp->rx_tasklet, rc32434_rx_tasklet, (unsigned long)dev);
1584 + lp->tx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
1585 + tasklet_init(lp->tx_tasklet, rc32434_tx_tasklet, (unsigned long)dev);
1587 + if ((err = register_netdev(dev))) {
1588 + printk(KERN_ERR "rc32434 ethernet. Cannot register net device %d\n", err);
1591 + goto probe_err_out;
1594 + INFO("Rx IRQ %d, Tx IRQ %d, ", bif->rx_dma_irq, bif->tx_dma_irq);
1595 + for (i = 0; i < 6; i++) {
1596 + printk("%2.2x", dev->dev_addr[i]);
1605 + rc32434_cleanup_module();
1606 + ERR(" failed. Returns %d\n", retval);
1612 +static void rc32434_cleanup_module(void)
1616 + for (i = 0; rc32434_iflist[i].iobase; i++) {
1617 + struct rc32434_if_t * bif = &rc32434_iflist[i];
1618 + if (bif->dev != NULL) {
1619 + struct rc32434_local *lp = (struct rc32434_local *)bif->dev->priv;
1622 + iounmap((void*)lp->eth_regs);
1623 + if (lp->rx_dma_regs)
1624 + iounmap((void*)lp->rx_dma_regs);
1625 + if (lp->tx_dma_regs)
1626 + iounmap((void*)lp->tx_dma_regs);
1628 + kfree((void*)KSEG0ADDR(lp->td_ring));
1630 +#ifdef RC32434_PROC_DEBUG
1632 + remove_proc_entry(bif->name, proc_net);
1638 + unregister_netdev(bif->dev);
1639 + free_netdev(bif->dev);
1647 +static int rc32434_open(struct net_device *dev)
1649 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1652 + if (rc32434_init(dev)) {
1653 + ERR("Error: cannot open the Ethernet device\n");
1657 + /* Install the interrupt handler that handles the Done Finished Ovr and Und Events */
1658 + if (request_irq(lp->rx_irq, &rc32434_rx_dma_interrupt,
1659 + SA_SHIRQ | SA_INTERRUPT,
1660 + "rc32434 ethernet Rx", dev)) {
1661 + ERR(": unable to get Rx DMA IRQ %d\n",
1665 + if (request_irq(lp->tx_irq, &rc32434_tx_dma_interrupt,
1666 + SA_SHIRQ | SA_INTERRUPT,
1667 + "rc32434 ethernet Tx", dev)) {
1668 + ERR(": unable to get Tx DMA IRQ %d\n",
1670 + free_irq(lp->rx_irq, dev);
1674 +#ifdef RC32434_REVISION
1675 + /* Install handler for overrun error. */
1676 + if (request_irq(lp->ovr_irq, &rc32434_ovr_interrupt,
1677 + SA_SHIRQ | SA_INTERRUPT,
1678 + "Ethernet Overflow", dev)) {
1679 + ERR(": unable to get OVR IRQ %d\n",
1681 + free_irq(lp->rx_irq, dev);
1682 + free_irq(lp->tx_irq, dev);
1687 + /* Install handler for underflow error. */
1688 + if (request_irq(lp->und_irq, &rc32434_und_interrupt,
1689 + SA_SHIRQ | SA_INTERRUPT,
1690 + "Ethernet Underflow", dev)) {
1691 + ERR(": unable to get UND IRQ %d\n",
1693 + free_irq(lp->rx_irq, dev);
1694 + free_irq(lp->tx_irq, dev);
1695 +#ifdef RC32434_REVISION
1696 + free_irq(lp->ovr_irq, dev);
1708 +static int rc32434_close(struct net_device *dev)
1710 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1713 + /* Disable interrupts */
1714 + disable_irq(lp->rx_irq);
1715 + disable_irq(lp->tx_irq);
1716 +#ifdef RC32434_REVISION
1717 + disable_irq(lp->ovr_irq);
1719 + disable_irq(lp->und_irq);
1721 + tmp = rc32434_readl(&lp->tx_dma_regs->dmasm);
1722 + tmp = tmp | DMASM_f_m | DMASM_e_m;
1723 + rc32434_writel(tmp, &lp->tx_dma_regs->dmasm);
1725 + tmp = rc32434_readl(&lp->rx_dma_regs->dmasm);
1726 + tmp = tmp | DMASM_d_m | DMASM_h_m | DMASM_e_m;
1727 + rc32434_writel(tmp, &lp->rx_dma_regs->dmasm);
1729 + free_irq(lp->rx_irq, dev);
1730 + free_irq(lp->tx_irq, dev);
1731 +#ifdef RC32434_REVISION
1732 + free_irq(lp->ovr_irq, dev);
1734 + free_irq(lp->und_irq, dev);
1739 +/* transmit packet */
1740 +static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev)
1742 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1743 + unsigned long flags;
1748 + spin_lock_irqsave(&lp->lock, flags);
1750 + td = &lp->td_ring[lp->tx_chain_tail];
1752 + /* stop queue when full, drop pkts if queue already full */
1753 + if(lp->tx_count >= (RC32434_NUM_TDS - 2)) {
1756 + if(lp->tx_count == (RC32434_NUM_TDS - 2)) {
1757 + netif_stop_queue(dev);
1760 + lp->stats.tx_dropped++;
1761 + dev_kfree_skb_any(skb);
1762 + spin_unlock_irqrestore(&lp->lock, flags);
1769 + lp->tx_skb[lp->tx_chain_tail] = skb;
1771 + length = skb->len;
1773 + /* Setup the transmit descriptor. */
1774 + td->ca = CPHYSADDR(skb->data);
1776 + if(rc32434_readl(&(lp->tx_dma_regs->dmandptr)) == 0) {
1777 + if( lp->tx_chain_status == empty ) {
1778 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1779 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1780 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR */
1781 + lp->tx_chain_head = lp->tx_chain_tail; /* Move head to tail */
1784 + td->control = DMA_COUNT(length) |DMAD_cof_m|DMAD_iof_m; /* Update tail */
1785 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &= ~(DMAD_cof_m); /* Link to prev */
1786 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link = CPHYSADDR(td); /* Link to prev */
1787 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1788 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR */
1789 + lp->tx_chain_head = lp->tx_chain_tail; /* Move head to tail */
1790 + lp->tx_chain_status = empty;
1794 + if( lp->tx_chain_status == empty ) {
1795 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1796 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1797 + lp->tx_chain_status = filled;
1800 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1801 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &= ~(DMAD_cof_m); /* Link to prev */
1802 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link = CPHYSADDR(td); /* Link to prev */
1803 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1807 + dev->trans_start = jiffies;
1809 + spin_unlock_irqrestore(&lp->lock, flags);
1815 +/* Ethernet MII-PHY Handler */
1816 +static void rc32434_mii_handler(unsigned long data)
1818 + struct net_device *dev = (struct net_device *)data;
1819 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1820 + unsigned long flags;
1821 + unsigned long duplex_status;
1822 + int port_addr = (lp->rx_irq == 0x2c? 1:0) << 8;
1824 + spin_lock_irqsave(&lp->lock, flags);
1826 + /* Two ports are using the same MII, the difference is the PHY address */
1827 + rc32434_writel(0, &rc32434_eth0_regs->miimcfg);
1828 + rc32434_writel(0, &rc32434_eth0_regs->miimcmd);
1829 + rc32434_writel(port_addr |0x05, &rc32434_eth0_regs->miimaddr);
1830 + rc32434_writel(MIIMCMD_scn_m, &rc32434_eth0_regs->miimcmd);
1831 + while(rc32434_readl(&rc32434_eth0_regs->miimind) & MIIMIND_nv_m);
1833 + ERR("irq:%x port_addr:%x RDD:%x\n",
1834 + lp->rx_irq, port_addr, rc32434_readl(&rc32434_eth0_regs->miimrdd));
1835 + duplex_status = (rc32434_readl(&rc32434_eth0_regs->miimrdd) & 0x140)? ETHMAC2_fd_m: 0;
1836 + if(duplex_status != lp->duplex_mode) {
1837 + 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);
1838 + lp->duplex_mode = duplex_status;
1839 + rc32434_restart(dev);
1842 + lp->mii_phy_timer.expires = jiffies + 10 * HZ;
1843 + add_timer(&lp->mii_phy_timer);
1845 + spin_unlock_irqrestore(&lp->lock, flags);
1849 +#ifdef RC32434_REVISION
1850 +/* Ethernet Rx Overflow interrupt */
1852 +rc32434_ovr_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1854 + struct net_device *dev = (struct net_device *)dev_id;
1855 + struct rc32434_local *lp;
1857 + irqreturn_t retval = IRQ_NONE;
1859 + ASSERT(dev != NULL);
1861 + lp = (struct rc32434_local *)dev->priv;
1862 + spin_lock(&lp->lock);
1863 + ovr = rc32434_readl(&lp->eth_regs->ethintfc);
1865 + if(ovr & ETHINTFC_ovr_m) {
1866 + netif_stop_queue(dev);
1868 + /* clear OVR bit */
1869 + rc32434_writel((ovr & ~ETHINTFC_ovr_m), &lp->eth_regs->ethintfc);
1871 + /* Restart interface */
1872 + rc32434_restart(dev);
1873 + retval = IRQ_HANDLED;
1875 + spin_unlock(&lp->lock);
1883 +/* Ethernet Tx Underflow interrupt */
1885 +rc32434_und_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1887 + struct net_device *dev = (struct net_device *)dev_id;
1888 + struct rc32434_local *lp;
1890 + irqreturn_t retval = IRQ_NONE;
1892 + ASSERT(dev != NULL);
1894 + lp = (struct rc32434_local *)dev->priv;
1896 + spin_lock(&lp->lock);
1898 + und = rc32434_readl(&lp->eth_regs->ethintfc);
1900 + if(und & ETHINTFC_und_m) {
1901 + netif_stop_queue(dev);
1903 + rc32434_writel((und & ~ETHINTFC_und_m), &lp->eth_regs->ethintfc);
1905 + /* Restart interface */
1906 + rc32434_restart(dev);
1907 + retval = IRQ_HANDLED;
1910 + spin_unlock(&lp->lock);
1916 +/* Ethernet Rx DMA interrupt */
1918 +rc32434_rx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1920 + struct net_device *dev = (struct net_device *)dev_id;
1921 + struct rc32434_local* lp;
1922 + volatile u32 dmas,dmasm;
1923 + irqreturn_t retval;
1925 + ASSERT(dev != NULL);
1927 + lp = (struct rc32434_local *)dev->priv;
1929 + spin_lock(&lp->lock);
1930 + dmas = rc32434_readl(&lp->rx_dma_regs->dmas);
1931 + if(dmas & (DMAS_d_m|DMAS_h_m|DMAS_e_m)) {
1932 + /* Mask D H E bit in Rx DMA */
1933 + dmasm = rc32434_readl(&lp->rx_dma_regs->dmasm);
1934 + rc32434_writel(dmasm | (DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm);
1935 +#ifdef CONFIG_IDT_USE_NAPI
1936 + if(netif_rx_schedule_prep(dev))
1937 + __netif_rx_schedule(dev);
1939 + tasklet_hi_schedule(lp->rx_tasklet);
1942 + if (dmas & DMAS_e_m)
1943 + ERR(": DMA error\n");
1945 + retval = IRQ_HANDLED;
1948 + retval = IRQ_NONE;
1950 + spin_unlock(&lp->lock);
1954 +#ifdef CONFIG_IDT_USE_NAPI
1955 +static int rc32434_poll(struct net_device *rx_data_dev, int *budget)
1957 +static void rc32434_rx_tasklet(unsigned long rx_data_dev)
1960 + struct net_device *dev = (struct net_device *)rx_data_dev;
1961 + struct rc32434_local* lp = netdev_priv(dev);
1962 + volatile DMAD_t rd = &lp->rd_ring[lp->rx_next_done];
1963 + struct sk_buff *skb, *skb_new;
1965 + u32 devcs, count, pkt_len, pktuncrc_len;
1966 + volatile u32 dmas;
1967 +#ifdef CONFIG_IDT_USE_NAPI
1969 + int rx_work_limit = min(*budget,dev->quota);
1971 + unsigned long flags;
1972 + spin_lock_irqsave(&lp->lock, flags);
1975 + while ( (count = RC32434_RBSIZE - (u32)DMA_COUNT(rd->control)) != 0) {
1976 +#ifdef CONFIG_IDT_USE_NAPI
1977 + if(--rx_work_limit <0)
1982 + /* init the var. used for the later operations within the while loop */
1984 + devcs = rd->devcs;
1985 + pkt_len = RCVPKT_LENGTH(devcs);
1986 + skb = lp->rx_skb[lp->rx_next_done];
1989 + lp->stats.rx_errors++;
1990 + lp->stats.rx_dropped++;
1992 + else if ((devcs & ( ETHRX_ld_m)) != ETHRX_ld_m) {
1993 + /* check that this is a whole packet */
1994 + /* WARNING: DMA_FD bit incorrectly set in Rc32434 (errata ref #077) */
1995 + lp->stats.rx_errors++;
1996 + lp->stats.rx_dropped++;
1998 + else if ( (devcs & ETHRX_rok_m) ) {
2001 + /* must be the (first and) last descriptor then */
2002 + pkt_buf = (u8*)lp->rx_skb[lp->rx_next_done]->data;
2004 + pktuncrc_len = pkt_len - 4;
2005 + /* invalidate the cache */
2006 + dma_cache_inv((unsigned long)pkt_buf, pktuncrc_len);
2008 + /* Malloc up new buffer. */
2009 + skb_new = dev_alloc_skb(RC32434_RBSIZE + 2);
2011 + if (skb_new != NULL){
2013 + skb_put(skb, pktuncrc_len);
2015 + skb->protocol = eth_type_trans(skb, dev);
2017 + /* pass the packet to upper layers */
2018 +#ifdef CONFIG_IDT_USE_NAPI
2019 + netif_receive_skb(skb);
2024 + dev->last_rx = jiffies;
2025 + lp->stats.rx_packets++;
2026 + lp->stats.rx_bytes += pktuncrc_len;
2028 + if (IS_RCV_MP(devcs))
2029 + lp->stats.multicast++;
2031 + /* 16 bit align */
2032 + skb_reserve(skb_new, 2);
2034 + skb_new->dev = dev;
2035 + lp->rx_skb[lp->rx_next_done] = skb_new;
2038 + ERR("no memory, dropping rx packet.\n");
2039 + lp->stats.rx_errors++;
2040 + lp->stats.rx_dropped++;
2046 + /* This should only happen if we enable accepting broken packets */
2047 + lp->stats.rx_errors++;
2048 + lp->stats.rx_dropped++;
2050 + /* add statistics counters */
2051 + if (IS_RCV_CRC_ERR(devcs)) {
2052 + DBG(2, "RX CRC error\n");
2053 + lp->stats.rx_crc_errors++;
2055 + else if (IS_RCV_LOR_ERR(devcs)) {
2056 + DBG(2, "RX LOR error\n");
2057 + lp->stats.rx_length_errors++;
2059 + else if (IS_RCV_LE_ERR(devcs)) {
2060 + DBG(2, "RX LE error\n");
2061 + lp->stats.rx_length_errors++;
2063 + else if (IS_RCV_OVR_ERR(devcs)) {
2064 + lp->stats.rx_over_errors++;
2066 + else if (IS_RCV_CV_ERR(devcs)) {
2067 + /* code violation */
2068 + DBG(2, "RX CV error\n");
2069 + lp->stats.rx_frame_errors++;
2071 + else if (IS_RCV_CES_ERR(devcs)) {
2072 + DBG(2, "RX Preamble error\n");
2078 + /* restore descriptor's curr_addr */
2080 + rd->ca = CPHYSADDR(skb_new->data);
2082 + rd->ca = CPHYSADDR(skb->data);
2084 + rd->control = DMA_COUNT(RC32434_RBSIZE) |DMAD_cod_m |DMAD_iod_m;
2085 + lp->rd_ring[(lp->rx_next_done-1)& RC32434_RDS_MASK].control &= ~(DMAD_cod_m);
2087 + lp->rx_next_done = (lp->rx_next_done + 1) & RC32434_RDS_MASK;
2088 + rd = &lp->rd_ring[lp->rx_next_done];
2089 + rc32434_writel( ~DMAS_d_m, &lp->rx_dma_regs->dmas);
2091 +#ifdef CONFIG_IDT_USE_NAPI
2092 + dev->quota -= received;
2093 + *budget =- received;
2094 + if(rx_work_limit < 0)
2098 + dmas = rc32434_readl(&lp->rx_dma_regs->dmas);
2100 + if(dmas & DMAS_h_m) {
2101 + rc32434_writel( ~(DMAS_h_m | DMAS_e_m), &lp->rx_dma_regs->dmas);
2102 +#ifdef RC32434_PROC_DEBUG
2103 + lp->dma_halt_cnt++;
2106 + skb = lp->rx_skb[lp->rx_next_done];
2107 + rd->ca = CPHYSADDR(skb->data);
2108 + rc32434_chain_rx(lp,rd);
2111 +#ifdef CONFIG_IDT_USE_NAPI
2112 + netif_rx_complete(dev);
2114 + /* Enable D H E bit in Rx DMA */
2115 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m |DMASM_e_m), &lp->rx_dma_regs->dmasm);
2116 +#ifdef CONFIG_IDT_USE_NAPI
2121 + spin_unlock_irqrestore(&lp->lock, flags);
2130 +/* Ethernet Tx DMA interrupt */
2132 +rc32434_tx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs)
2134 + struct net_device *dev = (struct net_device *)dev_id;
2135 + struct rc32434_local *lp;
2136 + volatile u32 dmas,dmasm;
2137 + irqreturn_t retval;
2139 + ASSERT(dev != NULL);
2141 + lp = (struct rc32434_local *)dev->priv;
2143 + spin_lock(&lp->lock);
2145 + dmas = rc32434_readl(&lp->tx_dma_regs->dmas);
2147 + if (dmas & (DMAS_f_m | DMAS_e_m)) {
2148 + dmasm = rc32434_readl(&lp->tx_dma_regs->dmasm);
2149 + /* Mask F E bit in Tx DMA */
2150 + rc32434_writel(dmasm | (DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2152 + tasklet_hi_schedule(lp->tx_tasklet);
2154 + if(lp->tx_chain_status == filled && (rc32434_readl(&(lp->tx_dma_regs->dmandptr)) == 0)) {
2155 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr));
2156 + lp->tx_chain_status = empty;
2157 + lp->tx_chain_head = lp->tx_chain_tail;
2158 + dev->trans_start = jiffies;
2161 + if (dmas & DMAS_e_m)
2162 + ERR(": DMA error\n");
2164 + retval = IRQ_HANDLED;
2167 + retval = IRQ_NONE;
2169 + spin_unlock(&lp->lock);
2175 +static void rc32434_tx_tasklet(unsigned long tx_data_dev)
2177 + struct net_device *dev = (struct net_device *)tx_data_dev;
2178 + struct rc32434_local* lp = (struct rc32434_local *)dev->priv;
2179 + volatile DMAD_t td = &lp->td_ring[lp->tx_next_done];
2181 + unsigned long flags;
2182 + volatile u32 dmas;
2184 + spin_lock_irqsave(&lp->lock, flags);
2186 + /* process all desc that are done */
2187 + while(IS_DMA_FINISHED(td->control)) {
2188 + if(lp->tx_full == 1) {
2189 + netif_wake_queue(dev);
2193 + devcs = lp->td_ring[lp->tx_next_done].devcs;
2194 + if ((devcs & (ETHTX_fd_m | ETHTX_ld_m)) != (ETHTX_fd_m | ETHTX_ld_m)) {
2195 + lp->stats.tx_errors++;
2196 + lp->stats.tx_dropped++;
2198 + /* should never happen */
2199 + DBG(1, __FUNCTION__ ": split tx ignored\n");
2201 + else if (IS_TX_TOK(devcs)) {
2202 + lp->stats.tx_packets++;
2205 + lp->stats.tx_errors++;
2206 + lp->stats.tx_dropped++;
2209 + if (IS_TX_UND_ERR(devcs))
2210 + lp->stats.tx_fifo_errors++;
2212 + /* oversized frame */
2213 + if (IS_TX_OF_ERR(devcs))
2214 + lp->stats.tx_aborted_errors++;
2216 + /* excessive deferrals */
2217 + if (IS_TX_ED_ERR(devcs))
2218 + lp->stats.tx_carrier_errors++;
2220 + /* collisions: medium busy */
2221 + if (IS_TX_EC_ERR(devcs))
2222 + lp->stats.collisions++;
2224 + /* late collision */
2225 + if (IS_TX_LC_ERR(devcs))
2226 + lp->stats.tx_window_errors++;
2230 + /* We must always free the original skb */
2231 + if (lp->tx_skb[lp->tx_next_done] != NULL) {
2232 + dev_kfree_skb_any(lp->tx_skb[lp->tx_next_done]);
2233 + lp->tx_skb[lp->tx_next_done] = NULL;
2236 + lp->td_ring[lp->tx_next_done].control = DMAD_iof_m;
2237 + lp->td_ring[lp->tx_next_done].devcs = ETHTX_fd_m | ETHTX_ld_m;
2238 + lp->td_ring[lp->tx_next_done].link = 0;
2239 + lp->td_ring[lp->tx_next_done].ca = 0;
2242 + /* go on to next transmission */
2243 + lp->tx_next_done = (lp->tx_next_done + 1) & RC32434_TDS_MASK;
2244 + td = &lp->td_ring[lp->tx_next_done];
2248 + dmas = rc32434_readl(&lp->tx_dma_regs->dmas);
2249 + rc32434_writel( ~dmas, &lp->tx_dma_regs->dmas);
2251 + /* Enable F E bit in Tx DMA */
2252 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2253 + spin_unlock_irqrestore(&lp->lock, flags);
2258 +static struct net_device_stats * rc32434_get_stats(struct net_device *dev)
2260 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2261 + return &lp->stats;
2266 + * Set or clear the multicast filter for this adaptor.
2268 +static void rc32434_multicast_list(struct net_device *dev)
2270 + /* listen to broadcasts always and to treat */
2271 + /* IFF bits independantly */
2272 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2273 + unsigned long flags;
2274 + u32 recognise = ETHARC_ab_m; /* always accept broadcasts */
2276 + if (dev->flags & IFF_PROMISC) /* set promiscuous mode */
2277 + recognise |= ETHARC_pro_m;
2279 + if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 15))
2280 + recognise |= ETHARC_am_m; /* all multicast & bcast */
2281 + else if (dev->mc_count > 0) {
2282 + DBG(2, __FUNCTION__ ": mc_count %d\n", dev->mc_count);
2283 + recognise |= ETHARC_am_m; /* for the time being */
2286 + spin_lock_irqsave(&lp->lock, flags);
2287 + rc32434_writel(recognise, &lp->eth_regs->etharc);
2288 + spin_unlock_irqrestore(&lp->lock, flags);
2292 +static void rc32434_tx_timeout(struct net_device *dev)
2294 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2295 + unsigned long flags;
2297 + spin_lock_irqsave(&lp->lock, flags);
2298 + rc32434_restart(dev);
2299 + spin_unlock_irqrestore(&lp->lock, flags);
2305 + * Initialize the RC32434 ethernet controller.
2307 +static int rc32434_init(struct net_device *dev)
2309 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2313 + rc32434_abort_tx(dev);
2314 + rc32434_abort_rx(dev);
2316 + /* reset ethernet logic */
2317 + rc32434_writel(0, &lp->eth_regs->ethintfc);
2318 + while((rc32434_readl(&lp->eth_regs->ethintfc) & ETHINTFC_rip_m))
2319 + dev->trans_start = jiffies;
2321 + /* Enable Ethernet Interface */
2322 + rc32434_writel(ETHINTFC_en_m, &lp->eth_regs->ethintfc);
2324 +#ifndef CONFIG_IDT_USE_NAPI
2325 + tasklet_disable(lp->rx_tasklet);
2327 + tasklet_disable(lp->tx_tasklet);
2329 + /* Initialize the transmit Descriptors */
2330 + for (i = 0; i < RC32434_NUM_TDS; i++) {
2331 + lp->td_ring[i].control = DMAD_iof_m;
2332 + lp->td_ring[i].devcs = ETHTX_fd_m | ETHTX_ld_m;
2333 + lp->td_ring[i].ca = 0;
2334 + lp->td_ring[i].link = 0;
2335 + if (lp->tx_skb[i] != NULL) {
2336 + dev_kfree_skb_any(lp->tx_skb[i]);
2337 + lp->tx_skb[i] = NULL;
2340 + lp->tx_next_done = lp->tx_chain_head = lp->tx_chain_tail = lp->tx_full = lp->tx_count = 0;
2341 + lp-> tx_chain_status = empty;
2344 + * Initialize the receive descriptors so that they
2345 + * become a circular linked list, ie. let the last
2346 + * descriptor point to the first again.
2348 + for (i=0; i<RC32434_NUM_RDS; i++) {
2349 + struct sk_buff *skb = lp->rx_skb[i];
2351 + if (lp->rx_skb[i] == NULL) {
2352 + skb = dev_alloc_skb(RC32434_RBSIZE + 2);
2353 + if (skb == NULL) {
2354 + ERR("No memory in the system\n");
2355 + for (j = 0; j < RC32434_NUM_RDS; j ++)
2356 + if (lp->rx_skb[j] != NULL)
2357 + dev_kfree_skb_any(lp->rx_skb[j]);
2363 + skb_reserve(skb, 2);
2364 + lp->rx_skb[i] = skb;
2365 + lp->rd_ring[i].ca = CPHYSADDR(skb->data);
2369 + lp->rd_ring[i].control = DMAD_iod_m | DMA_COUNT(RC32434_RBSIZE);
2370 + lp->rd_ring[i].devcs = 0;
2371 + lp->rd_ring[i].ca = CPHYSADDR(skb->data);
2372 + lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]);
2376 + lp->rd_ring[RC32434_NUM_RDS-1].link = CPHYSADDR(&lp->rd_ring[0]);
2377 + lp->rx_next_done = 0;
2379 + lp->rd_ring[RC32434_NUM_RDS-1].control |= DMAD_cod_m;
2380 + lp->rx_chain_head = 0;
2381 + lp->rx_chain_tail = 0;
2382 + lp->rx_chain_status = empty;
2384 + rc32434_writel(0, &lp->rx_dma_regs->dmas);
2385 + /* Start Rx DMA */
2386 + rc32434_start_rx(lp, &lp->rd_ring[0]);
2388 + /* Enable F E bit in Tx DMA */
2389 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2390 + /* Enable D H E bit in Rx DMA */
2391 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm);
2393 + /* Accept only packets destined for this Ethernet device address */
2394 + rc32434_writel(ETHARC_ab_m, &lp->eth_regs->etharc);
2396 + /* Set all Ether station address registers to their initial values */
2397 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal0);
2398 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah0);
2400 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal1);
2401 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah1);
2403 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal2);
2404 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah2);
2406 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal3);
2407 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah3);
2410 + /* Frame Length Checking, Pad Enable, CRC Enable, Full Duplex set */
2411 + rc32434_writel(ETHMAC2_pe_m | ETHMAC2_cen_m | ETHMAC2_fd_m, &lp->eth_regs->ethmac2);
2412 + //ETHMAC2_flc_m ETHMAC2_fd_m lp->duplex_mode
2414 + /* Back to back inter-packet-gap */
2415 + rc32434_writel(0x15, &lp->eth_regs->ethipgt);
2416 + /* Non - Back to back inter-packet-gap */
2417 + rc32434_writel(0x12, &lp->eth_regs->ethipgr);
2419 + /* Management Clock Prescaler Divisor */
2420 + /* Clock independent setting */
2421 + rc32434_writel(((idt_cpu_freq)/MII_CLOCK+1) & ~1,
2422 + &lp->eth_regs->ethmcp);
2424 + /* don't transmit until fifo contains 48b */
2425 + rc32434_writel(48, &lp->eth_regs->ethfifott);
2427 + rc32434_writel(ETHMAC1_re_m, &lp->eth_regs->ethmac1);
2429 +#ifndef CONFIG_IDT_USE_NAPI
2430 + tasklet_enable(lp->rx_tasklet);
2432 + tasklet_enable(lp->tx_tasklet);
2434 + netif_start_queue(dev);
2444 +static int __init rc32434_setup(char *options)
2446 + /* no options yet */
2450 +static int __init rc32434_setup_ethaddr0(char *options)
2452 + memcpy(mac0, options, 17);
2457 +__setup("rc32434eth=", rc32434_setup);
2458 +__setup("ethaddr0=", rc32434_setup_ethaddr0);
2461 +#endif /* MODULE */
2463 +module_init(rc32434_init_module);
2464 +module_exit(rc32434_cleanup_module);
2479 diff -Nur linux-2.6.17/drivers/net/rc32434_eth.h linux-2.6.17-owrt/drivers/net/rc32434_eth.h
2480 --- linux-2.6.17/drivers/net/rc32434_eth.h 1970-01-01 01:00:00.000000000 +0100
2481 +++ linux-2.6.17-owrt/drivers/net/rc32434_eth.h 2006-06-18 12:44:28.000000000 +0200
2483 +/**************************************************************************
2485 + * BRIEF MODULE DESCRIPTION
2486 + * Definitions for IDT RC32434 on-chip ethernet controller.
2488 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2490 + * This program is free software; you can redistribute it and/or modify it
2491 + * under the terms of the GNU General Public License as published by the
2492 + * Free Software Foundation; either version 2 of the License, or (at your
2493 + * option) any later version.
2495 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2496 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2497 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2498 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2499 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2500 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2501 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2502 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2503 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2504 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2506 + * You should have received a copy of the GNU General Public License along
2507 + * with this program; if not, write to the Free Software Foundation, Inc.,
2508 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2511 + **************************************************************************
2512 + * May 2004 rkt, neb
2520 + **************************************************************************
2524 +#include <asm/idt-boards/rc32434/rc32434.h>
2525 +#include <asm/idt-boards/rc32434/rc32434_dma_v.h>
2526 +#include <asm/idt-boards/rc32434/rc32434_eth_v.h>
2528 +#define RC32434_DEBUG 2
2529 +//#define RC32434_PROC_DEBUG
2530 +#undef RC32434_DEBUG
2532 +#ifdef RC32434_DEBUG
2534 +/* use 0 for production, 1 for verification, >2 for debug */
2535 +static int rc32434_debug = RC32434_DEBUG;
2536 +#define ASSERT(expr) \
2538 + printk( "Assertion failed! %s,%s,%s,line=%d\n", \
2539 + #expr,__FILE__,__FUNCTION__,__LINE__); }
2540 +#define DBG(lvl, format, arg...) if (rc32434_debug > lvl) printk(KERN_INFO "%s: " format, dev->name , ## arg)
2542 +#define ASSERT(expr) do {} while (0)
2543 +#define DBG(lvl, format, arg...) do {} while (0)
2546 +#define INFO(format, arg...) printk(KERN_INFO "%s: " format, dev->name , ## arg)
2547 +#define ERR(format, arg...) printk(KERN_ERR "%s: " format, dev->name , ## arg)
2548 +#define WARN(format, arg...) printk(KERN_WARNING "%s: " format, dev->name , ## arg)
2550 +#define ETH0_DMA_RX_IRQ GROUP1_IRQ_BASE + 0
2551 +#define ETH0_DMA_TX_IRQ GROUP1_IRQ_BASE + 1
2552 +#define ETH0_RX_OVR_IRQ GROUP3_IRQ_BASE + 9
2553 +#define ETH0_TX_UND_IRQ GROUP3_IRQ_BASE + 10
2555 +#define ETH0_RX_DMA_ADDR (DMA0_PhysicalAddress + 0*DMA_CHAN_OFFSET)
2556 +#define ETH0_TX_DMA_ADDR (DMA0_PhysicalAddress + 1*DMA_CHAN_OFFSET)
2558 +/* the following must be powers of two */
2559 +#ifdef CONFIG_IDT_USE_NAPI
2560 +#define RC32434_NUM_RDS 64 /* number of receive descriptors */
2561 +#define RC32434_NUM_TDS 64 /* number of transmit descriptors */
2563 +#define RC32434_NUM_RDS 128 /* number of receive descriptors */
2564 +#define RC32434_NUM_TDS 128 /* number of transmit descriptors */
2567 +#define RC32434_RBSIZE 1536 /* size of one resource buffer = Ether MTU */
2568 +#define RC32434_RDS_MASK (RC32434_NUM_RDS-1)
2569 +#define RC32434_TDS_MASK (RC32434_NUM_TDS-1)
2570 +#define RD_RING_SIZE (RC32434_NUM_RDS * sizeof(struct DMAD_s))
2571 +#define TD_RING_SIZE (RC32434_NUM_TDS * sizeof(struct DMAD_s))
2573 +#define RC32434_TX_TIMEOUT HZ * 100
2575 +#define rc32434_eth0_regs ((ETH_t)(ETH0_VirtualAddress))
2576 +#define rc32434_eth1_regs ((ETH_t)(ETH1_VirtualAddress))
2578 +enum status { filled, empty};
2579 +#define IS_DMA_FINISHED(X) (((X) & (DMAD_f_m)) != 0)
2580 +#define IS_DMA_DONE(X) (((X) & (DMAD_d_m)) != 0)
2583 +/* Information that need to be kept for each board. */
2584 +struct rc32434_local {
2586 + DMA_Chan_t rx_dma_regs;
2587 + DMA_Chan_t tx_dma_regs;
2588 + volatile DMAD_t td_ring; /* transmit descriptor ring */
2589 + volatile DMAD_t rd_ring; /* receive descriptor ring */
2591 + struct sk_buff* tx_skb[RC32434_NUM_TDS]; /* skbuffs for pkt to trans */
2592 + struct sk_buff* rx_skb[RC32434_NUM_RDS]; /* skbuffs for pkt to trans */
2594 +#ifndef CONFIG_IDT_USE_NAPI
2595 + struct tasklet_struct * rx_tasklet;
2597 + struct tasklet_struct * tx_tasklet;
2600 + int rx_chain_head;
2601 + int rx_chain_tail;
2602 + enum status rx_chain_status;
2605 + int tx_chain_head;
2606 + int tx_chain_tail;
2607 + enum status tx_chain_status;
2611 + struct timer_list mii_phy_timer;
2612 + unsigned long duplex_mode;
2619 + struct net_device_stats stats;
2622 + /* debug /proc entry */
2623 + struct proc_dir_entry *ps;
2624 + int dma_halt_cnt; int dma_run_cnt;
2627 +extern unsigned int idt_cpu_freq;
2629 +/* Index to functions, as function prototypes. */
2630 +static int rc32434_open(struct net_device *dev);
2631 +static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev);
2632 +static void rc32434_mii_handler(unsigned long data);
2633 +static irqreturn_t rc32434_und_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2634 +static irqreturn_t rc32434_rx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2635 +static irqreturn_t rc32434_tx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2636 +#ifdef RC32434_REVISION
2637 +static irqreturn_t rc32434_ovr_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2639 +static int rc32434_close(struct net_device *dev);
2640 +static struct net_device_stats *rc32434_get_stats(struct net_device *dev);
2641 +static void rc32434_multicast_list(struct net_device *dev);
2642 +static int rc32434_init(struct net_device *dev);
2643 +static void rc32434_tx_timeout(struct net_device *dev);
2645 +static void rc32434_tx_tasklet(unsigned long tx_data_dev);
2646 +#ifdef CONFIG_IDT_USE_NAPI
2647 +static int rc32434_poll(struct net_device *rx_data_dev, int *budget);
2649 +static void rc32434_rx_tasklet(unsigned long rx_data_dev);
2651 +static void rc32434_cleanup_module(void);
2652 +static int rc32434_probe(int port_num);
2653 +int rc32434_init_module(void);
2656 +static inline void rc32434_abort_dma(struct net_device *dev, DMA_Chan_t ch)
2658 + if (rc32434_readl(&ch->dmac) & DMAC_run_m) {
2659 + rc32434_writel(0x10, &ch->dmac);
2661 + while (!(rc32434_readl(&ch->dmas) & DMAS_h_m))
2662 + dev->trans_start = jiffies;
2664 + rc32434_writel(0, &ch->dmas);
2667 + rc32434_writel(0, &ch->dmadptr);
2668 + rc32434_writel(0, &ch->dmandptr);
2670 diff -Nur linux-2.6.17/include/asm-mips/bootinfo.h linux-2.6.17-owrt/include/asm-mips/bootinfo.h
2671 --- linux-2.6.17/include/asm-mips/bootinfo.h 2006-06-18 03:49:35.000000000 +0200
2672 +++ linux-2.6.17-owrt/include/asm-mips/bootinfo.h 2006-06-18 12:44:28.000000000 +0200
2673 @@ -218,6 +218,17 @@
2674 #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
2675 #define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
2679 + * Valid machtype for group ARUBA
2681 +#define MACH_GROUP_ARUBA 23
2682 +#define MACH_ARUBA_UNKNOWN 0
2683 +#define MACH_ARUBA_AP60 1
2684 +#define MACH_ARUBA_AP65 2
2685 +#define MACH_ARUBA_AP70 3
2686 +#define MACH_ARUBA_AP40 4
2688 #define CL_SIZE COMMAND_LINE_SIZE
2690 const char *get_system_type(void);
2691 diff -Nur linux-2.6.17/include/asm-mips/cpu.h linux-2.6.17-owrt/include/asm-mips/cpu.h
2692 --- linux-2.6.17/include/asm-mips/cpu.h 2006-06-18 03:49:35.000000000 +0200
2693 +++ linux-2.6.17-owrt/include/asm-mips/cpu.h 2006-06-18 12:45:56.000000000 +0200
2695 #define PRID_IMP_R14000 0x0f00
2696 #define PRID_IMP_R8000 0x1000
2697 #define PRID_IMP_PR4450 0x1200
2698 +#define PRID_IMP_RC32334 0x1800
2699 +#define PRID_IMP_RC32355 0x1900
2700 +#define PRID_IMP_RC32365 0x1900
2701 #define PRID_IMP_R4600 0x2000
2702 #define PRID_IMP_R4700 0x2100
2703 #define PRID_IMP_TX39 0x2200
2707 #define CPU_R14000 64
2708 -#define CPU_LAST 64
2709 +#define CPU_RC32300 65
2710 +#define CPU_LAST 65
2713 * ISA Level encodings
2714 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32300.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32300.h
2715 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32300.h 1970-01-01 01:00:00.000000000 +0100
2716 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32300.h 2006-06-18 12:44:28.000000000 +0200
2718 +/**************************************************************************
2720 + * BRIEF MODULE DESCRIPTION
2721 + * RC32300 helper routines
2723 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2725 + * This program is free software; you can redistribute it and/or modify it
2726 + * under the terms of the GNU General Public License as published by the
2727 + * Free Software Foundation; either version 2 of the License, or (at your
2728 + * option) any later version.
2730 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2731 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2732 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2733 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2734 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2735 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2736 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2737 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2738 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2739 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2741 + * You should have received a copy of the GNU General Public License along
2742 + * with this program; if not, write to the Free Software Foundation, Inc.,
2743 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2746 + **************************************************************************
2747 + * May 2004 P. Sadik.
2753 + **************************************************************************
2756 +#ifndef __IDT_RC32300_H__
2757 +#define __IDT_RC32300_H__
2759 +#include <linux/delay.h>
2760 +#include <asm/io.h>
2763 +/* cpu pipeline flush */
2764 +static inline void rc32300_sync(void)
2766 + __asm__ volatile ("sync");
2769 +static inline void rc32300_sync_udelay(int us)
2771 + __asm__ volatile ("sync");
2775 +static inline void rc32300_sync_delay(int ms)
2777 + __asm__ volatile ("sync");
2782 + * Macros to access internal RC32300 registers. No byte
2783 + * swapping should be done when accessing the internal
2787 +static inline u8 rc32300_readb(unsigned long pa)
2789 + return *((volatile u8 *)KSEG1ADDR(pa));
2791 +static inline u16 rc32300_readw(unsigned long pa)
2793 + return *((volatile u16 *)KSEG1ADDR(pa));
2795 +static inline u32 rc32300_readl(unsigned long pa)
2797 + return *((volatile u32 *)KSEG1ADDR(pa));
2799 +static inline void rc32300_writeb(u8 val, unsigned long pa)
2801 + *((volatile u8 *)KSEG1ADDR(pa)) = val;
2803 +static inline void rc32300_writew(u16 val, unsigned long pa)
2805 + *((volatile u16 *)KSEG1ADDR(pa)) = val;
2807 +static inline void rc32300_writel(u32 val, unsigned long pa)
2809 + *((volatile u32 *)KSEG1ADDR(pa)) = val;
2813 +#define local_readb __raw_readb
2814 +#define local_readw __raw_readw
2815 +#define local_readl __raw_readl
2817 +#define local_writeb __raw_writeb
2818 +#define local_writew __raw_writew
2819 +#define local_writel __raw_writel
2823 + * C access to CLZ and CLO instructions
2824 + * (count leading zeroes/ones).
2826 +static inline int rc32300_clz(unsigned long val)
2829 + __asm__ volatile (
2830 + ".set\tnoreorder\n\t"
2832 + ".set\tmips32\n\t"
2842 +static inline int rc32300_clo(unsigned long val)
2845 + __asm__ volatile (
2846 + ".set\tnoreorder\n\t"
2848 + ".set\tmips32\n\t"
2859 +#endif // __IDT_RC32300_H__
2860 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32334.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32334.h
2861 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32334.h 1970-01-01 01:00:00.000000000 +0100
2862 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32334.h 2006-06-18 12:44:28.000000000 +0200
2864 +/**************************************************************************
2866 + * BRIEF MODULE DESCRIPTION
2867 + * Definitions for IDT RC32334 CPU.
2869 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2871 + * This program is free software; you can redistribute it and/or modify it
2872 + * under the terms of the GNU General Public License as published by the
2873 + * Free Software Foundation; either version 2 of the License, or (at your
2874 + * option) any later version.
2876 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2877 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2878 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2879 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2880 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2881 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2882 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2883 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2884 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2885 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2887 + * You should have received a copy of the GNU General Public License along
2888 + * with this program; if not, write to the Free Software Foundation, Inc.,
2889 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2892 + **************************************************************************
2893 + * May 2004 P. Sadik.
2899 + **************************************************************************
2903 +#ifndef __IDT_RC32334_H__
2904 +#define __IDT_RC32334_H__
2906 +#include <linux/delay.h>
2907 +#include <asm/io.h>
2909 +/* Base address of internal registers */
2910 +#define RC32334_REG_BASE 0x18000000
2912 +/* CPU and IP Bus Control */
2913 +#define CPU_PORT_WIDTH 0xffffe200 // virtual!
2914 +#define CPU_BTA 0xffffe204 // virtual!
2915 +#define CPU_BUSERR_ADDR 0xffffe208 // virtual!
2916 +#define CPU_IP_BTA (RC32334_REG_BASE + 0x0000)
2917 +#define CPU_IP_ADDR_LATCH (RC32334_REG_BASE + 0x0004)
2918 +#define CPU_IP_ARBITRATION (RC32334_REG_BASE + 0x0008)
2919 +#define CPU_IP_BUSERR_CNTL (RC32334_REG_BASE + 0x0010)
2920 +#define CPU_IP_BUSERR_ADDR (RC32334_REG_BASE + 0x0014)
2921 +#define CPU_IP_SYSID (RC32334_REG_BASE + 0x0018)
2923 +/* Memory Controller */
2924 +#define MEM_BASE_BANK0 (RC32334_REG_BASE + 0x0080)
2925 +#define MEM_MASK_BANK0 (RC32334_REG_BASE + 0x0084)
2926 +#define MEM_CNTL_BANK0 (RC32334_REG_BASE + 0x0200)
2927 +#define MEM_BASE_BANK1 (RC32334_REG_BASE + 0x0088)
2928 +#define MEM_MASK_BANK1 (RC32334_REG_BASE + 0x008c)
2929 +#define MEM_CNTL_BANK1 (RC32334_REG_BASE + 0x0204)
2930 +#define MEM_CNTL_BANK2 (RC32334_REG_BASE + 0x0208)
2931 +#define MEM_CNTL_BANK3 (RC32334_REG_BASE + 0x020c)
2932 +#define MEM_CNTL_BANK4 (RC32334_REG_BASE + 0x0210)
2933 +#define MEM_CNTL_BANK5 (RC32334_REG_BASE + 0x0214)
2935 +/* PCI Controller */
2936 +#define PCI_INTR_PEND (RC32334_REG_BASE + 0x05b0)
2937 +#define PCI_INTR_MASK (RC32334_REG_BASE + 0x05b4)
2938 +#define PCI_INTR_CLEAR (RC32334_REG_BASE + 0x05b8)
2939 +#define CPU2PCI_INTR_PEND (RC32334_REG_BASE + 0x05c0)
2940 +#define CPU2PCI_INTR_MASK (RC32334_REG_BASE + 0x05c4)
2941 +#define CPU2PCI_INTR_CLEAR (RC32334_REG_BASE + 0x05c8)
2942 +#define PCI2CPU_INTR_PEND (RC32334_REG_BASE + 0x05d0)
2943 +#define PCI2CPU_INTR_MASK (RC32334_REG_BASE + 0x05d4)
2944 +#define PCI2CPU_INTR_CLEAR (RC32334_REG_BASE + 0x05d8)
2945 +#define PCI_MEM1_BASE (RC32334_REG_BASE + 0x20b0)
2946 +#define PCI_MEM2_BASE (RC32334_REG_BASE + 0x20b8)
2947 +#define PCI_MEM3_BASE (RC32334_REG_BASE + 0x20c0)
2948 +#define PCI_IO1_BASE (RC32334_REG_BASE + 0x20c8)
2949 +#define PCI_ARBITRATION (RC32334_REG_BASE + 0x20e0)
2950 +#define PCI_CPU_MEM1_BASE (RC32334_REG_BASE + 0x20e8)
2951 +#define PCI_CPU_IO_BASE (RC32334_REG_BASE + 0x2100)
2952 +#define PCI_CFG_CNTL (RC32334_REG_BASE + 0x2cf8)
2953 +#define PCI_CFG_DATA (RC32334_REG_BASE + 0x2cfc)
2956 +#define TIMER0_CNTL (RC32334_REG_BASE + 0x0700)
2957 +#define TIMER0_COUNT (RC32334_REG_BASE + 0x0704)
2958 +#define TIMER0_COMPARE (RC32334_REG_BASE + 0x0708)
2959 +#define TIMER_REG_OFFSET 0x10
2961 +/* Programmable I/O */
2962 +#define PIO_DATA0 (RC32334_REG_BASE + 0x0600)
2963 +#define PIO_DATA1 (RC32334_REG_BASE + 0x0610)
2968 + * NOTE: DMA_IO is a trick for non linear RC32300_IO_DMA stuff
2974 + * NB: dma number must be immediate value or variable.
2975 + * It MUST NOT be a function since it would get called twice!
2977 +#define DMA_IO(n) (((n)>1?0x500:0)+((n)&1?0x40:0))
2979 +#define RC32300_IO_DMA(n) (RC32334_REG_BASE + 0x1400 + DMA_IO(n))
2980 +#define RC32300_DMA_CONFREG(n) RC32300_IO_DMA(n)
2981 +#define RC32300_DMA_BASEREG(n) (RC32300_IO_DMA(n)+0x4)
2983 +#define RC32300_DMA_CURRREG(n) (RC32300_IO_DMA(n)+0x8)
2984 +#define RC32300_DMA_STATREG(n) (RC32300_IO_DMA(n)+0x10)
2985 +#define RC32300_DMA_SRCREG(n) (RC32300_IO_DMA(n)+0x14)
2986 +#define RC32300_DMA_DSTREG(n) (RC32300_IO_DMA(n)+0x18)
2987 +#define RC32300_DMA_NEXTREG(n) (RC32300_IO_DMA(n)+0x1c)
2989 +#define RC32300_DMA_IRQ(n) (GROUP7_IRQ_BASE+5*(n))
2991 +/* Expansion Interrupt Controller */
2992 +#define IC_GROUP0_PEND (RC32334_REG_BASE + 0x0500)
2993 +#define IC_GROUP0_MASK (RC32334_REG_BASE + 0x0504)
2994 +#define IC_GROUP0_CLEAR (RC32334_REG_BASE + 0x0508)
2995 +#define IC_GROUP_OFFSET 0x10
2997 +#define NUM_INTR_GROUPS 15
2999 + * The IRQ mapping is as follows:
3002 + * --- -------------------
3003 + * 0 SW0 (IP0) SW0 intr
3004 + * 1 SW1 (IP1) SW1 intr
3005 + * 2 Int0 (IP2) board-specific
3006 + * 3 Int1 (IP3) board-specific
3007 + * 4 Int2 (IP4) board-specific
3008 + * - Int3 (IP5) not used, mapped to IRQ's 8 and up
3009 + * 6 Int4 (IP6) board-specific
3010 + * 7 Int5 (IP7) CP0 Timer
3012 + * IRQ's 8 and up are all mapped to Int3 (IP5), which
3013 + * internally on the RC32334 is routed to the Expansion
3014 + * Interrupt Controller.
3016 +#define MIPS_CPU_TIMER_IRQ 7
3018 +#define GROUP1_IRQ_BASE 8 // bus error
3019 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 1) // PIO active low
3020 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 12) // PIO active high
3021 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 8) // Timer Rollovers
3022 +#define GROUP5_IRQ_BASE (GROUP4_IRQ_BASE + 8) // UART0
3023 +#define GROUP6_IRQ_BASE (GROUP5_IRQ_BASE + 3) // UART1
3024 +#define GROUP7_IRQ_BASE (GROUP6_IRQ_BASE + 3) // DMA Ch0
3025 +#define GROUP8_IRQ_BASE (GROUP7_IRQ_BASE + 5) // DMA Ch1
3026 +#define GROUP9_IRQ_BASE (GROUP8_IRQ_BASE + 5) // DMA Ch2
3027 +#define GROUP10_IRQ_BASE (GROUP9_IRQ_BASE + 5) // DMA Ch3
3028 +#define GROUP11_IRQ_BASE (GROUP10_IRQ_BASE + 5) // PCI Ctlr errors
3029 +#define GROUP12_IRQ_BASE (GROUP11_IRQ_BASE + 4) // PCI Satellite Mode
3030 +#define GROUP13_IRQ_BASE (GROUP12_IRQ_BASE + 16) // PCI to CPU Mailbox
3031 +#define GROUP14_IRQ_BASE (GROUP13_IRQ_BASE + 4) // SPI
3033 +#define RC32334_NR_IRQS (GROUP14_IRQ_BASE + 1)
3037 +#define RC32300_UART0_BASE (RC32334_REG_BASE + 0x0803)
3038 +#define RC32300_UART1_BASE (RC32334_REG_BASE + 0x0823)
3040 +#define RC32300_UART0_BASE (RC32334_REG_BASE + 0x0800)
3041 +#define RC32300_UART1_BASE (RC32334_REG_BASE + 0x0820)
3044 +#define RC32300_UART0_IRQ GROUP5_IRQ_BASE
3045 +#define RC32300_UART1_IRQ GROUP6_IRQ_BASE
3047 +#define IDT_CLOCK_MULT 2
3050 +#define NVRAM_BASE 0x12000000
3051 +#define NVRAM_ENVSIZE_OFF 4
3052 +#define NVRAM_ENVSTART_OFF 0x40
3054 +/* LCD 4-digit display */
3055 +#define LCD_CLEAR 0x14000400
3056 +#define LCD_DIGIT0 0x1400000f
3057 +#define LCD_DIGIT1 0x14000008
3058 +#define LCD_DIGIT2 0x14000007
3059 +#define LCD_DIGIT3 0x14000003
3061 +/* Interrupts routed on 79S334A board (see rc32334.h) */
3062 +#define RC32334_SCC8530_IRQ 2
3063 +#define RC32334_PCI_INTA_IRQ 3
3064 +#define RC32334_PCI_INTB_IRQ 4
3065 +#define RC32334_PCI_INTC_IRQ 6
3066 +#define RC32334_PCI_INTD_IRQ 7
3068 +#define RAM_SIZE (32*1024*1024)
3070 +#endif // __IDT_RC32334_H__
3071 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32355_dma.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32355_dma.h
3072 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32355_dma.h 1970-01-01 01:00:00.000000000 +0100
3073 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32355_dma.h 2006-06-18 12:44:28.000000000 +0200
3075 +/**************************************************************************
3077 + * BRIEF MODULE DESCRIPTION
3078 + * DMA controller defines on IDT RC32355
3080 + * Copyright 2004 IDT Inc.
3081 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3084 + * This program is free software; you can redistribute it and/or modify it
3085 + * under the terms of the GNU General Public License as published by the
3086 + * Free Software Foundation; either version 2 of the License, or (at your
3087 + * option) any later version.
3089 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3090 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3091 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3092 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3093 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3094 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3095 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3096 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3097 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3098 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3100 + * You should have received a copy of the GNU General Public License along
3101 + * with this program; if not, write to the Free Software Foundation, Inc.,
3102 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3108 + **************************************************************************
3111 +#ifndef BANYAN_DMA_H
3112 +#define BANYAN_DMA_H
3113 +#include <asm/idt-boards/rc32300/rc32300.h>
3116 + * An image of one RC32355 dma channel registers
3124 +} rc32355_dma_ch_t;
3127 + * An image of all RC32355 dma channel registers
3130 + rc32355_dma_ch_t ch[16];
3131 +} rc32355_dma_regs_t;
3134 +#define rc32355_dma_regs ((rc32355_dma_regs_t*)KSEG1ADDR(RC32355_DMA_BASE))
3137 +/* DMAC register layout */
3139 +#define DMAC_RUN 0x1 /* Halts processing when cleared */
3140 +#define DMAC_DM 0x2 /* Done Mask, ignore DMA events */
3141 +#define DMAC_MODE_MASK 0xC /* DMA operating mode */
3143 +#define DMAC_MODE_AUTO 0x0 /* DMA Auto Request Mode */
3144 +#define DMAC_MODE_BURST 0x4 /* DMA Burst Request Mode */
3145 +#define DMAC_MODE_TFER 0x8 /* DMA Transfer Request Mode */
3147 +/* DMAS and DMASM register layout */
3149 +#define DMAS_F 0x01 /* Finished */
3150 +#define DMAS_D 0x02 /* Done */
3151 +#define DMAS_C 0x04 /* Chain */
3152 +#define DMAS_E 0x08 /* Error */
3153 +#define DMAS_H 0x10 /* Halt */
3155 +/* Polling count for DMAS_H bit in DMAS register after halting DMA */
3156 +#define DMA_HALT_TIMEOUT 500
3159 +static inline int rc32355_halt_dma(rc32355_dma_ch_t* ch)
3163 + if (local_readl(&ch->dmac) & DMAC_RUN) {
3164 + local_writel(0, &ch->dmac);
3165 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
3166 + if (local_readl(&ch->dmas) & DMAS_H) {
3167 + local_writel(0, &ch->dmas);
3173 + return timeout ? 0 : 1;
3176 +static inline void rc32355_start_dma(rc32355_dma_ch_t* ch, u32 dma_addr)
3178 + local_writel(0, &ch->dmandptr);
3179 + local_writel(dma_addr, &ch->dmadptr);
3182 +static inline void rc32355_chain_dma(rc32355_dma_ch_t* ch, u32 dma_addr)
3184 + local_writel(dma_addr, &ch->dmandptr);
3188 +/* The following can be used to describe DMA channels 0 to 15, and the */
3189 +/* sub device's needed to select them in the DMADESC_DS_MASK field */
3191 +#define DMA_CHAN_ATM01 0 /* ATM interface 0,1 chan */
3193 +#define DMA_CHAN_ATM0IN 0 /* ATM interface 0 input */
3194 +#define DMA_DEV_ATM0IN 0 /* ATM interface 0 input */
3196 +#define DMA_CHAN_ATM1IN 0 /* ATM interface 1 input */
3197 +#define DMA_DEV_ATM1IN 1 /* ATM interface 1 input */
3199 +#define DMA_CHAN_ATM0OUT 0 /* ATM interface 0 output */
3200 +#define DMA_DEV_ATM0OUT 2 /* ATM interface 0 output */
3202 +#define DMA_CHAN_ATM1OUT 0 /* ATM interface 1 output */
3203 +#define DMA_DEV_ATM1OUT 3 /* ATM interface 1 output */
3205 +/* for entry in {0,1,2,3,4,5,6,7} - note 5,6,7 share with those below */
3206 +#define DMA_CHAN_ATMVCC(entry) ((entry)+1) /* ATM VC cache entry */
3207 +#define DMA_DEV_ATMVCC(entry) 0
3209 +#define DMA_CHAN_MEMTOMEM 6 /* Memory to memory DMA */
3210 +#define DMA_DEV_MEMTOMEM 1 /* Memory to memory DMA */
3212 +#define DMA_CHAN_ATMFMB0 7 /* ATM Frame Mode Buffer 0 */
3213 +#define DMA_DEV_ATMFMB0 1 /* ATM Frame Mode Buffer 0 */
3215 +#define DMA_CHAN_ATMFMB1 8 /* ATM Frame Mode Buffer 1 */
3216 +#define DMA_DEV_ATMFMB1 1 /* ATM Frame Mode Buffer 1 */
3218 +#define DMA_CHAN_ETHERIN 9 /* Ethernet input */
3219 +#define DMA_DEV_ETHERIN 0 /* Ethernet input */
3221 +#define DMA_CHAN_ETHEROUT 10 /* Ethernet output */
3222 +#define DMA_DEV_ETHEROUT 0 /* Ethernet output */
3224 +#define DMA_CHAN_TDMIN 11 /* TDM Bus input */
3225 +#define DMA_DEV_TDMIN 0 /* TDM Bus input */
3227 +#define DMA_CHAN_TDMOUT 12 /* TDM Bus output */
3228 +#define DMA_DEV_TDMOUT 0 /* TDM Bus output */
3230 +#define DMA_CHAN_USBIN 13 /* USB input */
3231 +#define DMA_DEV_USBIN 0 /* USB input */
3233 +#define DMA_CHAN_USBOUT 14 /* USB output */
3234 +#define DMA_DEV_USBOUT 0 /* USB output */
3236 +#define DMA_CHAN_EXTERN 15 /* External DMA */
3237 +#define DMA_DEV_EXTERN 0 /* External DMA */
3240 + * An RC32355 dma descriptor in system memory
3243 + u32 cmdstat; /* control and status */
3244 + u32 curr_addr; /* current address of data */
3245 + u32 devcs; /* peripheral-specific control and status */
3246 + u32 link; /* link to next descriptor */
3247 +} rc32355_dma_desc_t;
3249 +/* Values for the descriptor cmdstat word */
3251 +#define DMADESC_F 0x80000000u /* Finished bit */
3252 +#define DMADESC_D 0x40000000u /* Done bit */
3253 +#define DMADESC_T 0x20000000u /* Terminated bit */
3254 +#define DMADESC_IOD 0x10000000u /* Interrupt On Done */
3255 +#define DMADESC_IOF 0x08000000u /* Interrupt On Finished */
3256 +#define DMADESC_COD 0x04000000u /* Chain On Done */
3257 +#define DMADESC_COF 0x02000000u /* Chain On Finished */
3259 +#define DMADESC_DEVCMD_MASK 0x01C00000u /* Device Command mask */
3260 +#define DMADESC_DEVCMD_SHIFT 22 /* Device Command shift */
3262 +#define DMADESC_DS_MASK 0x00300000u /* Device Select mask */
3263 +#define DMADESC_DS_SHIFT 20 /* Device Select shift */
3265 +#define DMADESC_COUNT_MASK 0x0003FFFFu /* Byte Count mask */
3266 +#define DMADESC_COUNT_SHIFT 0 /* Byte Count shift */
3268 +#define IS_DMA_FINISHED(X) ( ( (X) & DMADESC_F ) >> 31) /* F Bit */
3269 +#define IS_DMA_DONE(X) ( ( (X) & DMADESC_D ) >> 30) /* D Bit */
3270 +#define IS_DMA_TERMINATED(X) ( ( (X) & DMADESC_T ) >> 29) /* T Bit */
3271 +#define IS_DMA_USED(X) (((X) & (DMADESC_F | DMADESC_D | DMADESC_T)) != 0)
3273 +#define DMA_DEVCMD(devcmd) \
3274 + (((devcmd) << DMADESC_DEVCMD_SHIFT) & DMADESC_DS_MASK)
3275 +#define DMA_DS(ds) \
3276 + (((ds) << DMADESC_DS_SHIFT) & DMADESC_DS_MASK)
3277 +#define DMA_COUNT(count) \
3278 + ((count) & DMADESC_COUNT_MASK)
3280 +#endif /* RC32355_DMA_H */
3281 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32355_eth.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32355_eth.h
3282 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32355_eth.h 1970-01-01 01:00:00.000000000 +0100
3283 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32355_eth.h 2006-06-18 12:44:28.000000000 +0200
3285 +/**************************************************************************
3287 + * BRIEF MODULE DESCRIPTION
3288 + * Ethernet registers on IDT RC32355
3290 + * Copyright 2004 IDT Inc.
3291 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3294 + * This program is free software; you can redistribute it and/or modify it
3295 + * under the terms of the GNU General Public License as published by the
3296 + * Free Software Foundation; either version 2 of the License, or (at your
3297 + * option) any later version.
3299 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3300 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3301 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3302 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3303 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3304 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3305 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3306 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3307 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3308 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3310 + * You should have received a copy of the GNU General Public License along
3311 + * with this program; if not, write to the Free Software Foundation, Inc.,
3312 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3318 + **************************************************************************
3322 +#ifndef RC32355_ETHER_H
3323 +#define RC32355_ETHER_H
3325 +#include <asm/idt-boards/rc32300/rc32355_dma.h>
3328 + * A partial image of the RC32355 ethernet registers
3387 +} rc32355_eth_regs_t;
3389 +#define rc32355_eth_regs ((rc32355_eth_regs_t*)KSEG1ADDR(RC32355_ETH_BASE))
3391 +#define ETH_INTFC (RC32355_ETH_BASE + 0x000) /* INTerFace Control */
3392 +#define ETH_FIFOTT (RC32355_ETH_BASE + 0x004) /* FIFO Transmit Threshold */
3393 +#define ETH_ARC (RC32355_ETH_BASE + 0x008) /* Address Recognition Ctrl */
3394 +#define ETH_HASH0 (RC32355_ETH_BASE + 0x00C) /* 32 multicast Hash bits */
3395 +#define ETH_HASH1 (RC32355_ETH_BASE + 0x010) /* another 32 Hash bits */
3396 +#define ETH_FIFOST (RC32355_ETH_BASE + 0x014) /* FIFO Status Threshold */
3397 +#define ETH_FIFOS (RC32355_ETH_BASE + 0x018) /* FIFO Status Register */
3398 +#define ETH_ODEOPS (RC32355_ETH_BASE + 0x01C) /* Out Data End-Of-Pkt Size */
3399 +#define ETH_IS (RC32355_ETH_BASE + 0x020) /* Input Status */
3400 +#define ETH_OS (RC32355_ETH_BASE + 0x024) /* Output Status */
3401 +#define ETH_MCP (RC32355_ETH_BASE + 0x028) /* Managemt Clock Prescaler */
3402 +#define ETH_ID (RC32355_ETH_BASE + 0x030) /* Input Data register */
3403 +#define ETH_OD (RC32355_ETH_BASE + 0x040) /* Output Data register */
3404 +#define ETH_ODEOP (RC32355_ETH_BASE + 0x050) /* OD End-Of-Packet Size */
3406 +/* for n in { 0, 1, 2, 3 } */
3407 +#define ETH_SAL(n) (RC32355_ETH_BASE + 0x100 + (n * 8)) /* Stn Address 2-5 */
3408 +#define ETH_SAH(n) (RC32355_ETH_BASE + 0x104 + (n * 8)) /* Stn Address 0-1 */
3410 +#define ETH_RBC (RC32355_ETH_BASE + 0x120) /* Receive Byte Count */
3411 +#define ETH_RPC (RC32355_ETH_BASE + 0x124) /* Receive Packet Count */
3412 +#define ETH_RUPC (RC32355_ETH_BASE + 0x128) /* Rx Undersized Pkt count */
3413 +#define ETH_RFC (RC32355_ETH_BASE + 0x12C) /* Receive Fragment Count */
3414 +#define ETH_TBC (RC32355_ETH_BASE + 0x130) /* Transmit Byte Count */
3415 +#define ETH_GPF (RC32355_ETH_BASE + 0x134) /* Generate Pause Frame */
3416 +#define ETH_MAC1 (RC32355_ETH_BASE + 0x200) /* Medium Access Control 1 */
3417 +#define ETH_MAC2 (RC32355_ETH_BASE + 0x204) /* Medium Access Control 2 */
3418 +#define ETH_IPGT (RC32355_ETH_BASE + 0x208) /* Back-to-back InterPkt Gap */
3419 +#define ETH_IPGR (RC32355_ETH_BASE + 0x20C) /* Non " InterPkt Gap */
3420 +#define ETH_CLRT (RC32355_ETH_BASE + 0x210) /* Collis'n Window and Retry */
3421 +#define ETH_MAXF (RC32355_ETH_BASE + 0x214) /* Maximum Frame Length */
3422 +#define ETH_MTEST (RC32355_ETH_BASE + 0x21C) /* MAC Test */
3424 +#define ETHMIIM_CFG (RC32355_ETH_BASE + 0x220) /* MII Mgmt Configuration */
3425 +#define ETHMIIM_CMD (RC32355_ETH_BASE + 0x224) /* MII Mgmt Command */
3426 +#define ETHMIIM_ADDR (RC32355_ETH_BASE + 0x228) /* MII Mgmt Address */
3427 +#define ETHMIIM_WTD (RC32355_ETH_BASE + 0x22C) /* MII Mgmt Write Data */
3428 +#define ETHMIIM_RDD (RC32355_ETH_BASE + 0x230) /* MII Mgmt Read Data */
3429 +#define ETHMIIM_IND (RC32355_ETH_BASE + 0x234) /* MII Mgmt Indicators */
3431 +/* for n in { 0, 1, 2 } */
3432 +#define ETH_CFSA(n) (RC32355_ETH_BASE + 0x240 + ((n) * 4)) /* Station Addr */
3436 + * Register Interpretations follow
3439 +/******************************************************************************
3440 + * ETHINTFC register
3441 + *****************************************************************************/
3443 +#define ETHERINTFC_EN (1<<0)
3444 +#define ETHERINTFC_ITS (1<<1)
3445 +#define ETHERINTFC_RES (1<<2)
3446 +#define ETHERINTFC_RIP (1<<2)
3447 +#define ETHERINTFC_JAM (1<<3)
3449 +/******************************************************************************
3450 + * ETHFIFOTT register
3451 + *****************************************************************************/
3453 +#define ETHERFIFOTT_TTH(v) (((v)&0x3f)<<0)
3455 +/******************************************************************************
3457 + *****************************************************************************/
3459 +#define ETHERARC_PRO (1<<0)
3460 +#define ETHERARC_AM (1<<1)
3461 +#define ETHERARC_AFM (1<<2)
3462 +#define ETHERARC_AB (1<<3)
3464 +/******************************************************************************
3465 + * ETHHASH registers
3466 + *****************************************************************************/
3468 +#define ETHERHASH0(v) (((v)&0xffff)<<0)
3469 +#define ETHERHASH1(v) (((v)&0xffff)<<0)
3471 +/******************************************************************************
3473 + *****************************************************************************/
3475 +#define ETHERSAL0(v) (((v)&0xffff)<<0)
3476 +#define ETHERSAL1(v) (((v)&0xffff)<<0)
3477 +#define ETHERSAL2(v) (((v)&0xffff)<<0)
3478 +#define ETHERSAL3(v) (((v)&0xffff)<<0)
3479 +#define ETHERSAH0(v) (((v)&0xff)<<0)
3480 +#define ETHERSAH1(v) (((v)&0xff)<<0)
3481 +#define ETHERSAH2(v) (((v)&0xff)<<0)
3482 +#define ETHERSAH3(v) (((v)&0xff)<<0)
3484 +/******************************************************************************
3485 + * ETHFIFOST register
3486 + *****************************************************************************/
3488 +#define ETHERFIFOST_IRTH(v) (((v)&0x3f)<<0)
3489 +#define ETHERFIFOST_ORTH(v) (((v)&0x3f)<<16)
3491 +/******************************************************************************
3492 + * ETHFIFOS register
3493 + *****************************************************************************/
3495 +#define ETHERFIFOS_IR (1<<0)
3496 +#define ETHERFIFOS_OR (1<<1)
3497 +#define ETHERFIFOS_OVR (1<<2)
3498 +#define ETHERFIFOS_UND (1<<3)
3500 +/******************************************************************************
3502 + *****************************************************************************/
3504 +#define ETHERID(v) (((v)&0xffff)<<0)
3505 +#define ETHEROD(v) (((v)&0xffff)<<0)
3507 +/******************************************************************************
3508 + * ETHODEOPS register
3509 + *****************************************************************************/
3511 +#define ETHERODEOPS_SIZE(v) (((v)&0x3)<<0)
3513 +/******************************************************************************
3514 + * ETHODEOP register
3515 + *****************************************************************************/
3517 +#define ETHERODEOP(v) (((v)&0xffff)<<0)
3519 +/******************************************************************************
3521 + *****************************************************************************/
3523 +#define ETHERIS_EOP (1<<0)
3524 +#define ETHERIS_ROK (1<<2)
3525 +#define ETHERIS_FM (1<<3)
3526 +#define ETHERIS_MP (1<<4)
3527 +#define ETHERIS_BP (1<<5)
3528 +#define ETHERIS_VLT (1<<6)
3529 +#define ETHERIS_CF (1<<7)
3530 +#define ETHERIS_OVR (1<<8)
3531 +#define ETHERIS_CRC (1<<9)
3532 +#define ETHERIS_CV (1<<10)
3533 +#define ETHERIS_DB (1<<11)
3534 +#define ETHERIS_LE (1<<12)
3535 +#define ETHERIS_LOR (1<<13)
3536 +#define ETHERIS_SIZE(v) (((v)&0x3)<<14)
3537 +#define ETHERIS_LENGTH(v) (((v)&0xff)<<16)
3539 +/******************************************************************************
3541 + *****************************************************************************/
3543 +#define ETHEROS_T (1<<0)
3544 +#define ETHEROS_TOK (1<<6)
3545 +#define ETHEROS_MP (1<<7)
3546 +#define ETHEROS_BP (1<<8)
3547 +#define ETHEROS_UND (1<<9)
3548 +#define ETHEROS_OF (1<<10)
3549 +#define ETHEROS_ED (1<<11)
3550 +#define ETHEROS_EC (1<<12)
3551 +#define ETHEROS_LC (1<<13)
3552 +#define ETHEROS_TD (1<<14)
3553 +#define ETHEROS_CRC (1<<15)
3554 +#define ETHEROS_LE (1<<16)
3555 +#define ETHEROS_CC(v) (((v)&0xf)<<17)
3556 +#define ETHEROS_PFD (1<<21)
3558 +/******************************************************************************
3559 + * Statistics registers
3560 + *****************************************************************************/
3562 +#define ETHERRBC(v) (((v)&0xffff)<<0)
3563 +#define ETHERRPC(v) (((v)&0xffff)<<0)
3564 +#define ETHERRUPC(v) (((v)&0xffff)<<0)
3565 +#define ETHERRFC(v) (((v)&0xffff)<<0)
3566 +#define ETHERTBC(v) (((v)&0xffff)<<0)
3568 +/******************************************************************************
3570 + *****************************************************************************/
3572 +#define ETHERGPF_PTV(v) (((v)&0xff)<<0)
3574 +/******************************************************************************
3576 + *****************************************************************************/
3578 +#define ETHERMAC1_RE (1<<0)
3579 +#define ETHERMAC1_PAF (1<<1)
3580 +#define ETHERMAC1_RFC (1<<2)
3581 +#define ETHERMAC1_TFC (1<<3)
3582 +#define ETHERMAC1_LB (1<<4)
3583 +#define ETHERMAC1_MR (1<<15)
3586 +#define ETHERMAC2_FD (1<<0)
3587 +#define ETHERMAC2_FLC (1<<1)
3588 +#define ETHERMAC2_HFE (1<<2)
3589 +#define ETHERMAC2_DC (1<<3)
3590 +#define ETHERMAC2_CEN (1<<4)
3591 +#define ETHERMAC2_PE (1<<5)
3592 +#define ETHERMAC2_VPE (1<<6)
3593 +#define ETHERMAC2_APE (1<<7)
3594 +#define ETHERMAC2_PPE (1<<8)
3595 +#define ETHERMAC2_LPE (1<<9)
3596 +#define ETHERMAC2_NB (1<<12)
3597 +#define ETHERMAC2_BP (1<<13)
3598 +#define ETHERMAC2_ED (1<<14)
3601 +#define ETHERIPGT(v) (((v)&0x3f)<<0)
3604 +#define ETHERIPGR_IPGR1(v) (((v)&0x3f)<<0)
3605 +#define ETHERIPGR_IPGR2(v) (((v)&0x3f)<<8)
3608 +#define ETHERCLRT_MAXRET(v) (((v)&0x3f)<<0)
3609 +#define ETHERCLRT_COLWIN(v) (((v)&0x3f)<<8)
3612 +#define ETHERMAXF(v) (((v)&0x3f)<<0)
3615 +#define ETHERMTEST_TB (1<<2)
3618 +#define ETHERMCP_DIV(v) (((v)&0xff)<<0)
3621 +#define ETHERMIIMCFG_CS(v) (((v)&0x3)<<2)
3622 +#define ETHERMIIMCFG_R (1<<15)
3625 +#define ETHERMIIMCMD_RD (1<<0)
3626 +#define ETHERMIIMCMD_SCN (1<<1)
3629 +#define ETHERMIIMADDR_REGADDR(v) (((v)&0x1f)<<0)
3630 +#define ETHERMIIMADDR_PHYADDR(v) (((v)&0x1f)<<8)
3633 +#define ETHERMIIMWTD(v) (((v)&0xff)<<0)
3636 +#define ETHERMIIMRDD(v) (((v)&0xff)<<0)
3639 +#define ETHERMIIMIND_BSY (1<<0)
3640 +#define ETHERMIIMIND_SCN (1<<1)
3641 +#define ETHERMIIMIND_NV (1<<2)
3644 +#define ETHERDMA_IN_LENGTH(v) (((v)&0xffff)<<16)
3645 +#define ETHERDMA_IN_CES (1<<14)
3646 +#define ETHERDMA_IN_LOR (1<<13)
3647 +#define ETHERDMA_IN_LE (1<<12)
3648 +#define ETHERDMA_IN_DB (1<<11)
3649 +#define ETHERDMA_IN_CV (1<<10)
3650 +#define ETHERDMA_IN_CRC (1<<9)
3651 +#define ETHERDMA_IN_OVR (1<<8)
3652 +#define ETHERDMA_IN_CF (1<<7)
3653 +#define ETHERDMA_IN_VLT (1<<6)
3654 +#define ETHERDMA_IN_BP (1<<5)
3655 +#define ETHERDMA_IN_MP (1<<4)
3656 +#define ETHERDMA_IN_FM (1<<3)
3657 +#define ETHERDMA_IN_ROK (1<<2)
3658 +#define ETHERDMA_IN_LD (1<<1)
3659 +#define ETHERDMA_IN_FD (1<<0)
3662 +#define ETHERDMA_OUT_CC(v) (((v)&0xf)<<17)
3663 +#define ETHERDMA_OUT_CNT 0x001e0000
3664 +#define ETHERDMA_OUT_SHFT 17
3665 +#define ETHERDMA_OUT_LE (1<<16)
3667 +#define ETHERDMA_OUT_CRC (1<<15)
3668 +#define ETHERDMA_OUT_TD (1<<14)
3669 +#define ETHERDMA_OUT_LC (1<<13)
3670 +#define ETHERDMA_OUT_EC (1<<12)
3671 +#define ETHERDMA_OUT_ED (1<<11)
3672 +#define ETHERDMA_OUT_OF (1<<10)
3673 +#define ETHERDMA_OUT_UND (1<<9)
3674 +#define ETHERDMA_OUT_BP (1<<8)
3675 +#define ETHERDMA_OUT_MP (1<<7)
3676 +#define ETHERDMA_OUT_TOK (1<<6)
3677 +#define ETHERDMA_OUT_HEN (1<<5)
3678 +#define ETHERDMA_OUT_CEN (1<<4)
3679 +#define ETHERDMA_OUT_PEN (1<<3)
3680 +#define ETHERDMA_OUT_OEN (1<<2)
3681 +#define ETHERDMA_OUT_LD (1<<1)
3682 +#define ETHERDMA_OUT_FD (1<<0)
3685 + (ETHERDMA_IN_OVR | ETHERDMA_IN_CRC | ETHERDMA_IN_CV | ETHERDMA_IN_LE)
3687 + (ETHERDMA_OUT_LC | ETHERDMA_OUT_EC | ETHERDMA_OUT_ED | \
3688 + ETHERDMA_OUT_OF | ETHERDMA_OUT_UND)
3690 +#define IS_RCV_ROK(X) (((X) & (1<<2)) >> 2) /* Receive Okay */
3691 +#define IS_RCV_FM(X) (((X) & (1<<3)) >> 3) /* Is Filter Match */
3692 +#define IS_RCV_MP(X) (((X) & (1<<4)) >> 4) /* Is it MP */
3693 +#define IS_RCV_BP(X) (((X) & (1<<5)) >> 5) /* Is it BP */
3694 +#define IS_RCV_VLT(X) (((X) & (1<<6)) >> 6) /* VLAN Tag Detect */
3695 +#define IS_RCV_CF(X) (((X) & (1<<7)) >> 7) /* Control Frame */
3696 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<8)) >> 8) /* Receive Overflow */
3697 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<9)) >> 9) /* CRC Error */
3698 +#define IS_RCV_CV_ERR(X) (((X) & (1<<10))>>10) /* Code Violation */
3699 +#define IS_RCV_DB_ERR(X) (((X) & (1<<11))>>11) /* Dribble Bits */
3700 +#define IS_RCV_LE_ERR(X) (((X) & (1<<12))>>12) /* Length error */
3701 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<13))>>13) /* Length Out of
3703 +#define IS_RCV_CES_ERR(X) (((X) & (1<<14))>>14) /* Preamble error */
3704 +#define RCVPKT_LENGTH(X) (((X) & 0xFFFF0000)>>16) /* Length of the
3705 + received packet */
3707 +#define IS_TX_TOK(X) (((X) & (1<<6) ) >> 6 ) /* Transmit Okay */
3708 +#define IS_TX_MP(X) (((X) & (1<<7) ) >> 7 ) /* Multicast */
3710 +#define IS_TX_BP(X) (((X) & (1<<8) ) >> 8 ) /* Broadcast */
3711 +#define IS_TX_UND_ERR(X) (((X) & (1<<9) ) >> 9 ) /* Transmit FIFO
3713 +#define IS_TX_OF_ERR(X) (((X) & (1<<10)) >>10 ) /* Oversized frame */
3714 +#define IS_TX_ED_ERR(X) (((X) & (1<<11)) >>11 ) /* Excessive
3716 +#define IS_TX_EC_ERR(X) (((X) & (1<<12)) >>12 ) /* Excessive
3718 +#define IS_TX_LC_ERR(X) (((X) & (1<<13)) >>13 ) /* Late Collision */
3719 +#define IS_TX_TD_ERR(X) (((X) & (1<<14)) >>14 ) /* Transmit deferred*/
3720 +#define IS_TX_CRC_ERR(X) (((X) & (1<<15)) >>15 ) /* CRC Error */
3721 +#define IS_TX_LE_ERR(X) (((X) & (1<<16)) >>16 ) /* Length Error */
3723 +#define TX_COLLISION_COUNT(X) (((X) & 0x001E0000u)>>17) /* Collision Count */
3725 +#endif /* RC32355_ETHER_H */
3727 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32355.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32355.h
3728 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32355.h 1970-01-01 01:00:00.000000000 +0100
3729 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32355.h 2006-06-18 12:44:28.000000000 +0200
3731 +/**************************************************************************
3733 + * BRIEF MODULE DESCRIPTION
3734 + * Definitions for IDT RC32355 CPU.
3736 + * Copyright 2004 IDT Inc.
3737 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3740 + * This program is free software; you can redistribute it and/or modify it
3741 + * under the terms of the GNU General Public License as published by the
3742 + * Free Software Foundation; either version 2 of the License, or (at your
3743 + * option) any later version.
3745 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3746 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3747 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3748 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3749 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3750 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3751 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3752 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3753 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3754 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3756 + * You should have received a copy of the GNU General Public License along
3757 + * with this program; if not, write to the Free Software Foundation, Inc.,
3758 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3764 + **************************************************************************
3768 +#ifndef _RC32355_H_
3769 +#define _RC32355_H_
3771 +#include <linux/delay.h>
3772 +#include <asm/io.h>
3774 +/* Base address of internal registers */
3775 +#define RC32355_REG_BASE 0x18000000
3777 +/* System ID Registers */
3778 +#define CPU_SYSID (RC32355_REG_BASE + 0x00018)
3779 +#define CPU_BTADDR (RC32355_REG_BASE + 0x0001c)
3780 +#define CPU_REV (RC32355_REG_BASE + 0x0002c)
3782 +/* Reset Controller */
3783 +#define RESET_CNTL (RC32355_REG_BASE + 0x08000)
3785 +/* Device Controller */
3786 +#define DEV0_BASE (RC32355_REG_BASE + 0x10000)
3787 +#define DEV0_MASK (RC32355_REG_BASE + 0x10004)
3788 +#define DEV0_CNTL (RC32355_REG_BASE + 0x10008)
3789 +#define DEV0_TIMING (RC32355_REG_BASE + 0x1000c)
3790 +#define DEV_REG_OFFSET 0x10
3792 +/* SDRAM Controller */
3793 +#define SDRAM0_BASE (RC32355_REG_BASE + 0x18000)
3794 +#define SDRAM0_MASK (RC32355_REG_BASE + 0x18004)
3795 +#define SDRAM1_BASE (RC32355_REG_BASE + 0x18008)
3796 +#define SDRAM1_MASK (RC32355_REG_BASE + 0x1800c)
3797 +#define SDRAM_CNTL (RC32355_REG_BASE + 0x18010)
3800 +#define BUS_ARB_CNTL0 (RC32355_REG_BASE + 0x20000)
3801 +#define BUS_ARB_CNTL1 (RC32355_REG_BASE + 0x20004)
3803 +/* Counters/Timers */
3804 +#define TIMER0_COUNT (RC32355_REG_BASE + 0x28000)
3805 +#define TIMER0_COMPARE (RC32355_REG_BASE + 0x28004)
3806 +#define TIMER0_CNTL (RC32355_REG_BASE + 0x28008)
3807 +#define TIMER_REG_OFFSET 0x0C
3809 +/* System Integrity */
3811 +/* Interrupt Controller */
3812 +#define IC_GROUP0_PEND (RC32355_REG_BASE + 0x30000)
3813 +#define IC_GROUP0_MASK (RC32355_REG_BASE + 0x30004)
3814 +#define IC_GROUP_OFFSET 0x08
3816 +#define NUM_INTR_GROUPS 5
3818 + * The IRQ mapping is as follows:
3821 + * --- -------------------
3822 + * 0 SW0 (IP0) SW0 intr
3823 + * 1 SW1 (IP1) SW1 intr
3824 + * - Int0 (IP2) mapped to GROUP0_IRQ_BASE
3825 + * - Int1 (IP3) mapped to GROUP1_IRQ_BASE
3826 + * - Int2 (IP4) mapped to GROUP2_IRQ_BASE
3827 + * - Int3 (IP5) mapped to GROUP3_IRQ_BASE
3828 + * - Int4 (IP6) mapped to GROUP4_IRQ_BASE
3829 + * 7 Int5 (IP7) CP0 Timer
3831 + * IRQ's 8 and up are all mapped to Int0-4 (IP2-IP6), which
3832 + * internally on the RC32355 is routed to the Expansion
3833 + * Interrupt Controller.
3835 +#define MIPS_CPU_TIMER_IRQ 7
3837 +#define GROUP0_IRQ_BASE 8 // Counter/Timers, UCW
3838 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) // DMA
3839 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) // ATM
3840 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) // TDM, Eth, USB, UARTs, I2C
3841 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32) // GPIO
3843 +#define RC32355_NR_IRQS (GROUP4_IRQ_BASE + 32)
3845 +/* DMA - see rc32355_dma.h for full list of registers */
3847 +#define RC32355_DMA_BASE (RC32355_REG_BASE + 0x38000)
3848 +#define DMA_CHAN_OFFSET 0x14
3850 +/* GPIO Controller */
3856 +#define RC32300_UART0_BASE (RC32355_REG_BASE + 0x50003)
3857 +#define RC32300_UART1_BASE (RC32355_REG_BASE + 0x50023)
3859 +#define RC32300_UART0_BASE (RC32355_REG_BASE + 0x50000)
3860 +#define RC32300_UART1_BASE (RC32355_REG_BASE + 0x50020)
3863 +#define RC32300_UART0_IRQ (GROUP3_IRQ_BASE + 14)
3864 +#define RC32300_UART1_IRQ (GROUP3_IRQ_BASE + 17)
3868 +/* Ethernet - see rc32355_eth.h for full list of registers */
3870 +#define RC32355_ETH_BASE (RC32355_REG_BASE + 0x60000)
3873 +#define IDT_CLOCK_MULT 2
3875 +/* Memory map of 79EB355 board */
3878 +#define RAM_BASE 0x00000000
3879 +#define RAM_SIZE (32*1024*1024)
3881 +/* SRAM (device 1) */
3882 +#define SRAM_BASE 0x02000000
3883 +#define SRAM_SIZE 0x00100000
3885 +/* FLASH (device 2) */
3886 +#define FLASH_BASE 0x0C000000
3887 +#define FLASH_SIZE 0x00C00000
3889 +/* ATM PHY (device 4) */
3890 +#define ATM_PHY_BASE 0x14000000
3892 +/* TDM switch (device 3) */
3893 +#define TDM_BASE 0x1A000000
3895 +/* LCD panel (device 3) */
3896 +#define LCD_BASE 0x1A002000
3898 +/* RTC (DS1511W) (device 3) */
3899 +#define RTC_BASE 0x1A004000
3901 +/* NVRAM (256 bytes internal to the DS1511 RTC) */
3902 +#define NVRAM_ADDR RTC_BASE + 0x10
3903 +#define NVRAM_DATA RTC_BASE + 0x13
3904 +#define NVRAM_ENVSIZE_OFF 4
3905 +#define NVRAM_ENVSTART_OFF 32
3907 +#endif /* _RC32355_H_ */
3908 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_dma.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_dma.h
3909 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_dma.h 1970-01-01 01:00:00.000000000 +0100
3910 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_dma.h 2006-06-18 12:44:28.000000000 +0200
3912 +/**************************************************************************
3914 + * BRIEF MODULE DESCRIPTION
3915 + * RC32365/336 DMA hardware abstraction.
3917 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
3919 + * This program is free software; you can redistribute it and/or modify it
3920 + * under the terms of the GNU General Public License as published by the
3921 + * Free Software Foundation; either version 2 of the License, or (at your
3922 + * option) any later version.
3924 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3925 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3926 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3927 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3928 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3929 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3930 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3931 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3932 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3933 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3935 + * You should have received a copy of the GNU General Public License along
3936 + * with this program; if not, write to the Free Software Foundation, Inc.,
3937 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3940 + **************************************************************************
3941 + * May 2004 P. Sadik.
3947 + **************************************************************************
3950 +#ifndef __IDT_RC32365_DMA_H__
3951 +#define __IDT_RC32365_DMA_H__
3955 + DMA0_PhysicalAddress = 0x18038000,
3956 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
3958 + DMA0_VirtualAddress = 0xb8038000,
3959 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
3963 + * DMA descriptor (in physical memory).
3966 +typedef struct DMAD_s
3968 + u32 control ; // Control. use DMAD_*
3969 + u32 ca ; // Current Address.
3970 + u32 devcs ; // Device control and status.
3971 + u32 link ; // Next descriptor in chain.
3972 +} volatile *DMAD_t ;
3976 + DMAD_size = sizeof (struct DMAD_s),
3977 + DMAD_count_b = 0, // in DMAD_t -> control
3978 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
3979 + DMAD_ds_b = 20, // in DMAD_t -> control
3980 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
3981 + DMAD_ds_extToMem0_v = 0,
3982 + DMAD_ds_memToExt0_v = 1,
3983 + DMAD_ds_extToMem1_v = 0,
3984 + DMAD_ds_memToExt1_v = 1,
3985 + DMAD_ds_ethRcv0_v = 0,
3986 + DMAD_ds_ethXmt0_v = 0,
3987 + DMAD_ds_ethRcv1_v = 0,
3988 + DMAD_ds_ethXmt2_v = 0,
3989 + DMAD_ds_memToFifo_v = 0,
3990 + DMAD_ds_fifoToMem_v = 0,
3991 + DMAD_ds_rng_de_v = 1,//randomNumberGenerator on LC/DE
3992 + DMAD_ds_pciToMem_v = 0,
3993 + DMAD_ds_memToPci_v = 0,
3994 + DMAD_ds_securityInput_v = 0,
3995 + DMAD_ds_securityOutput_v = 0,
3996 + DMAD_ds_rng_se_v = 0,//randomNumberGenerator on SE
3998 + DMAD_devcmd_b = 22, // in DMAD_t -> control
3999 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
4000 + DMAD_devcmd_byte_v = 0, //memory-to-memory
4001 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
4002 + DMAD_devcmd_word_v = 2, //memory-to-memory
4003 + DMAD_devcmd_2words_v = 3, //memory-to-memory
4004 + DMAD_devcmd_4words_v = 4, //memory-to-memory
4005 + DMAD_devcmd_6words_v = 5, //memory-to-memory
4006 + DMAD_devcmd_8words_v = 6, //memory-to-memory
4007 + DMAD_devcmd_16words_v = 7, //memory-to-memory
4008 + DMAD_cof_b = 25, // chain on finished
4009 + DMAD_cof_m = 0x02000000, //
4010 + DMAD_cod_b = 26, // chain on done
4011 + DMAD_cod_m = 0x04000000, //
4012 + DMAD_iof_b = 27, // interrupt on finished
4013 + DMAD_iof_m = 0x08000000, //
4014 + DMAD_iod_b = 28, // interrupt on done
4015 + DMAD_iod_m = 0x10000000, //
4016 + DMAD_t_b = 29, // terminated
4017 + DMAD_t_m = 0x20000000, //
4018 + DMAD_d_b = 30, // done
4019 + DMAD_d_m = 0x40000000, //
4020 + DMAD_f_b = 31, // finished
4021 + DMAD_f_m = 0x80000000, //
4025 + * DMA register (within Internal Register Map).
4030 + u32 dmac ; // Control.
4031 + u32 dmas ; // Status.
4032 + u32 dmasm ; // Mask.
4033 + u32 dmadptr ; // Descriptor pointer.
4034 + u32 dmandptr ; // Next descriptor pointer.
4037 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
4039 +//DMA_Channels use DMACH_count instead
4043 + DMAC_run_b = 0, //
4044 + DMAC_run_m = 0x00000001, //
4045 + DMAC_dm_b = 1, // done mask
4046 + DMAC_dm_m = 0x00000002, //
4047 + DMAC_mode_b = 2, //
4048 + DMAC_mode_m = 0x0000000c, //
4049 + DMAC_mode_auto_v = 0,
4050 + DMAC_mode_burst_v = 1,
4051 + DMAC_mode_transfer_v = 2, //usually used
4052 + DMAC_mode_reserved_v = 3,
4054 + DMAC_a_m = 0x00000010, //
4056 + DMAS_f_b = 0, // finished (sticky)
4057 + DMAS_f_m = 0x00000001, //
4058 + DMAS_d_b = 1, // done (sticky)
4059 + DMAS_d_m = 0x00000002, //
4060 + DMAS_c_b = 2, // chain (sticky)
4061 + DMAS_c_m = 0x00000004, //
4062 + DMAS_e_b = 3, // error (sticky)
4063 + DMAS_e_m = 0x00000008, //
4064 + DMAS_h_b = 4, // halt (sticky)
4065 + DMAS_h_m = 0x00000010, //
4067 + DMASM_f_b = 0, // finished (1=mask)
4068 + DMASM_f_m = 0x00000001, //
4069 + DMASM_d_b = 1, // done (1=mask)
4070 + DMASM_d_m = 0x00000002, //
4071 + DMASM_c_b = 2, // chain (1=mask)
4072 + DMASM_c_m = 0x00000004, //
4073 + DMASM_e_b = 3, // error (1=mask)
4074 + DMASM_e_m = 0x00000008, //
4075 + DMASM_h_b = 4, // halt (1=mask)
4076 + DMASM_h_m = 0x00000010, //
4080 + * DMA channel definitions
4085 + DMACH_ethRcv0 = 0,
4086 + DMACH_ethXmt0 = 1,
4087 + DMACH_ethRcv1 = 2,
4088 + DMACH_ethXmt2 = 3,
4089 + DMACH_pciToMem = 4,
4090 + DMACH_memToPci = 5,
4091 + DMACH_securityInput = 6,
4092 + DMACH_securityOutput = 7,
4095 + DMACH_count //must be last
4099 +typedef struct DMAC_s
4101 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
4102 +} volatile *DMA_t ;
4106 + * External DMA parameters
4111 + DMADEVCMD_ts_b = 0, // ts field in devcmd
4112 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
4113 + DMADEVCMD_ts_byte_v = 0,
4114 + DMADEVCMD_ts_halfword_v = 1,
4115 + DMADEVCMD_ts_word_v = 2,
4116 + DMADEVCMD_ts_2word_v = 3,
4117 + DMADEVCMD_ts_4word_v = 4,
4118 + DMADEVCMD_ts_6word_v = 5,
4119 + DMADEVCMD_ts_8word_v = 6,
4120 + DMADEVCMD_ts_16word_v = 7
4124 +#if 1 // aws - Compatibility.
4125 +# define EXTDMA_ts_b DMADEVCMD_ts_b
4126 +# define EXTDMA_ts_m DMADEVCMD_ts_m
4127 +# define EXTDMA_ts_byte_v DMADEVCMD_ts_byte_v
4128 +# define EXTDMA_ts_halfword_v DMADEVCMD_ts_halfword_v
4129 +# define EXTDMA_ts_word_v DMADEVCMD_ts_word_v
4130 +# define EXTDMA_ts_2word_v DMADEVCMD_ts_2word_v
4131 +# define EXTDMA_ts_4word_v DMADEVCMD_ts_4word_v
4132 +# define EXTDMA_ts_6word_v DMADEVCMD_ts_6word_v
4133 +# define EXTDMA_ts_8word_v DMADEVCMD_ts_8word_v
4134 +# define EXTDMA_ts_16word_v DMADEVCMD_ts_16word_v
4135 +#endif // aws - Compatibility.
4137 +#endif // __IDT_RC32365_DMA_H__
4138 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h
4139 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h 1970-01-01 01:00:00.000000000 +0100
4140 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h 2006-06-18 12:44:28.000000000 +0200
4142 +/**************************************************************************
4144 + * BRIEF MODULE DESCRIPTION
4145 + * RC32365/336 DMA interface routines.
4147 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4149 + * This program is free software; you can redistribute it and/or modify it
4150 + * under the terms of the GNU General Public License as published by the
4151 + * Free Software Foundation; either version 2 of the License, or (at your
4152 + * option) any later version.
4154 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4155 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4156 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4157 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4158 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4159 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4160 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4161 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4162 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4163 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4165 + * You should have received a copy of the GNU General Public License along
4166 + * with this program; if not, write to the Free Software Foundation, Inc.,
4167 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4170 + **************************************************************************
4171 + * May 2004 P. Sadik.
4177 + **************************************************************************
4180 +#ifndef __IDT_RC32365_DMA_V_H__
4181 +#define __IDT_RC32365_DMA_V_H__
4184 +#include <asm/idt-boards/rc32300/rc32300.h>
4185 +#include <asm/idt-boards/rc32300/rc32365_dma.h>
4186 +#include <asm/idt-boards/rc32300/rc32365.h>
4188 +#define DMA_CHAN_OFFSET 0x14
4189 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
4190 +#define IS_DMA_FINISHED(X) (((X) & (DMAD_f_m)) != 0)
4191 +#define IS_DMA_DONE(X) (((X) & (DMAD_d_m)) != 0)
4193 +#define DMA_COUNT(count) \
4194 + ((count) & DMAD_count_m)
4196 +#define DMA_HALT_TIMEOUT 500
4198 +static inline int rc32365_halt_dma(DMA_Chan_t ch)
4201 + if (local_readl(&ch->dmac) & DMAC_run_m) {
4202 + local_writel(0, &ch->dmac);
4204 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
4205 + if (local_readl(&ch->dmas) & DMAS_h_m) {
4206 + local_writel(0, &ch->dmas);
4213 + return timeout ? 0 : 1;
4217 +static inline void rc32365_start_dma(DMA_Chan_t ch, u32 dma_addr)
4219 + local_writel(0, &ch->dmandptr);
4220 + local_writel(dma_addr, &ch->dmadptr);
4223 +static inline void rc32365_chain_dma(DMA_Chan_t ch, u32 dma_addr)
4225 + local_writel(dma_addr, &ch->dmandptr);
4227 +#endif //__IDT_RC32365_DMA_V_H__
4228 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_eth.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_eth.h
4229 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_eth.h 1970-01-01 01:00:00.000000000 +0100
4230 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_eth.h 2006-06-18 12:44:28.000000000 +0200
4232 +/**************************************************************************
4234 + * BRIEF MODULE DESCRIPTION
4235 + * RC32365/336 Ethernet hardware abstraction.
4237 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4239 + * This program is free software; you can redistribute it and/or modify it
4240 + * under the terms of the GNU General Public License as published by the
4241 + * Free Software Foundation; either version 2 of the License, or (at your
4242 + * option) any later version.
4244 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4245 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4246 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4247 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4248 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4249 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4250 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4251 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4252 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4253 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4255 + * You should have received a copy of the GNU General Public License along
4256 + * with this program; if not, write to the Free Software Foundation, Inc.,
4257 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4260 + **************************************************************************
4261 + * May 2004 P. Sadik.
4267 + **************************************************************************
4270 +#ifndef __IDT_RC32365_ETH_H__
4271 +#define __IDT_RC32365_ETH_H__
4275 + ETH0_PhysicalAddress = 0x18058000,
4276 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
4277 + ETH0_VirtualAddress = 0xb8058000,
4279 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
4281 + ETH1_PhysicalAddress = 0x18060000,
4282 + ETH1_VirtualAddress = 0xb8060000, // Default
4292 + u32 ethu0 [4] ; // Reserved.
4295 + u32 eth_u1 [10] ; // Reserved.
4297 + u32 eth_u2 [42] ; // Reserved.
4312 + u32 eth_u9 [50] ; // Reserved.
4319 + u32 eth_u10 ; // Reserved.
4327 + u32 eth_u11 ; // Reserved.
4328 + u32 eth_u12 ; // Reserved.
4336 + ETHINTFC_en_b = 0,
4337 + ETHINTFC_en_m = 0x00000001,
4338 + ETHINTFC_its_b = 1,
4339 + ETHINTFC_its_m = 0x00000002,
4340 + ETHINTFC_rip_b = 2,
4341 + ETHINTFC_rip_m = 0x00000004,
4342 + ETHINTFC_jam_b = 3,
4343 + ETHINTFC_jam_m = 0x00000008,
4344 + ETHINTFC_ovr_b = 4,
4345 + ETHINTFC_ovr_m = 0x00000010,
4346 + ETHINTFC_und_b = 5,
4347 + ETHINTFC_und_m = 0x00000020,
4349 + ETHFIFOTT_tth_b = 0,
4350 + ETHFIFOTT_tth_m = 0x0000007f,
4353 + ETHARC_pro_m = 0x00000001,
4355 + ETHARC_am_m = 0x00000002,
4357 + ETHARC_afm_m = 0x00000004,
4359 + ETHARC_ab_m = 0x00000008,
4361 + ETHSAL_byte5_b = 0,
4362 + ETHSAL_byte5_m = 0x000000ff,
4363 + ETHSAL_byte4_b = 8,
4364 + ETHSAL_byte4_m = 0x0000ff00,
4365 + ETHSAL_byte3_b = 16,
4366 + ETHSAL_byte3_m = 0x00ff0000,
4367 + ETHSAL_byte2_b = 24,
4368 + ETHSAL_byte2_m = 0xff000000,
4370 + ETHSAH_byte1_b = 0,
4371 + ETHSAH_byte1_m = 0x000000ff,
4372 + ETHSAH_byte0_b = 8,
4373 + ETHSAH_byte0_m = 0x0000ff00,
4376 + ETHGPF_ptv_m = 0x0000ffff,
4379 + ETHPFS_pfd_m = 0x00000001,
4381 + ETHCFSA0_cfsa4_b = 0,
4382 + ETHCFSA0_cfsa4_m = 0x000000ff,
4383 + ETHCFSA0_cfsa5_b = 8,
4384 + ETHCFSA0_cfsa5_m = 0x0000ff00,
4386 + ETHCFSA1_cfsa2_b = 0,
4387 + ETHCFSA1_cfsa2_m = 0x000000ff,
4388 + ETHCFSA1_cfsa3_b = 8,
4389 + ETHCFSA1_cfsa3_m = 0x0000ff00,
4391 + ETHCFSA2_cfsa0_b = 0,
4392 + ETHCFSA2_cfsa0_m = 0x000000ff,
4393 + ETHCFSA2_cfsa1_b = 8,
4394 + ETHCFSA2_cfsa1_m = 0x0000ff00,
4397 + ETHMAC1_re_m = 0x00000001,
4398 + ETHMAC1_paf_b = 1,
4399 + ETHMAC1_paf_m = 0x00000002,
4400 + ETHMAC1_rfc_b = 2,
4401 + ETHMAC1_rfc_m = 0x00000004,
4402 + ETHMAC1_tfc_b = 3,
4403 + ETHMAC1_tfc_m = 0x00000008,
4405 + ETHMAC1_lb_m = 0x00000010,
4406 + ETHMAC1_mr_b = 31,
4407 + ETHMAC1_mr_m = 0x80000000,
4410 + ETHMAC2_fd_m = 0x00000001,
4411 + ETHMAC2_flc_b = 1,
4412 + ETHMAC2_flc_m = 0x00000002,
4413 + ETHMAC2_hfe_b = 2,
4414 + ETHMAC2_hfe_m = 0x00000004,
4416 + ETHMAC2_dc_m = 0x00000008,
4417 + ETHMAC2_cen_b = 4,
4418 + ETHMAC2_cen_m = 0x00000010,
4420 + ETHMAC2_pe_m = 0x00000020,
4421 + ETHMAC2_vpe_b = 6,
4422 + ETHMAC2_vpe_m = 0x00000040,
4423 + ETHMAC2_ape_b = 7,
4424 + ETHMAC2_ape_m = 0x00000080,
4425 + ETHMAC2_ppe_b = 8,
4426 + ETHMAC2_ppe_m = 0x00000100,
4427 + ETHMAC2_lpe_b = 9,
4428 + ETHMAC2_lpe_m = 0x00000200,
4429 + ETHMAC2_nb_b = 12,
4430 + ETHMAC2_nb_m = 0x00001000,
4431 + ETHMAC2_bp_b = 13,
4432 + ETHMAC2_bp_m = 0x00002000,
4433 + ETHMAC2_ed_b = 14,
4434 + ETHMAC2_ed_m = 0x00004000,
4436 + ETHIPGT_ipgt_b = 0,
4437 + ETHIPGT_ipgt_m = 0x0000007f,
4439 + ETHIPGR_ipgr2_b = 0,
4440 + ETHIPGR_ipgr2_m = 0x0000007f,
4441 + ETHIPGR_ipgr1_b = 8,
4442 + ETHIPGR_ipgr1_m = 0x00007f00,
4444 + ETHCLRT_maxret_b = 0,
4445 + ETHCLRT_maxret_m = 0x0000000f,
4446 + ETHCLRT_colwin_b = 8,
4447 + ETHCLRT_colwin_m = 0x00003f00,
4449 + ETHMAXF_maxf_b = 0,
4450 + ETHMAXF_maxf_m = 0x0000ffff,
4452 + ETHMTEST_tb_b = 2,
4453 + ETHMTEST_tb_m = 0x00000004,
4456 + ETHMCP_div_m = 0x000000ff,
4458 + MIIMCFG_rsv_b = 0,
4459 + MIIMCFG_rsv_m = 0x0000000c,
4462 + MIIMCMD_rd_m = 0x00000001,
4463 + MIIMCMD_scn_b = 1,
4464 + MIIMCMD_scn_m = 0x00000002,
4466 + MIIMADDR_regaddr_b = 0,
4467 + MIIMADDR_regaddr_m = 0x0000001f,
4468 + MIIMADDR_phyaddr_b = 8,
4469 + MIIMADDR_phyaddr_m = 0x00001f00,
4471 + MIIMWTD_wdata_b = 0,
4472 + MIIMWTD_wdata_m = 0x0000ffff,
4474 + MIIMRDD_rdata_b = 0,
4475 + MIIMRDD_rdata_m = 0x0000ffff,
4477 + MIIMIND_bsy_b = 0,
4478 + MIIMIND_bsy_m = 0x00000001,
4479 + MIIMIND_scn_b = 1,
4480 + MIIMIND_scn_m = 0x00000002,
4482 + MIIMIND_nv_m = 0x00000004,
4487 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
4492 + ETHRX_fd_m = 0x00000001,
4494 + ETHRX_ld_m = 0x00000002,
4496 + ETHRX_rok_m = 0x00000004,
4498 + ETHRX_fm_m = 0x00000008,
4500 + ETHRX_mp_m = 0x00000010,
4502 + ETHRX_bp_m = 0x00000020,
4504 + ETHRX_vlt_m = 0x00000040,
4506 + ETHRX_cf_m = 0x00000080,
4508 + ETHRX_ovr_m = 0x00000100,
4510 + ETHRX_crc_m = 0x00000200,
4512 + ETHRX_cv_m = 0x00000400,
4514 + ETHRX_db_m = 0x00000800,
4516 + ETHRX_le_m = 0x00001000,
4518 + ETHRX_lor_m = 0x00002000,
4520 + ETHRX_ces_m = 0x00004000,
4521 + ETHRX_length_b = 16,
4522 + ETHRX_length_m = 0xffff0000,
4525 + ETHTX_fd_m = 0x00000001,
4527 + ETHTX_ld_m = 0x00000002,
4529 + ETHTX_oen_m = 0x00000004,
4531 + ETHTX_pen_m = 0x00000008,
4533 + ETHTX_cen_m = 0x00000010,
4535 + ETHTX_hen_m = 0x00000020,
4537 + ETHTX_tok_m = 0x00000040,
4539 + ETHTX_mp_m = 0x00000080,
4541 + ETHTX_bp_m = 0x00000100,
4543 + ETHTX_und_m = 0x00000200,
4545 + ETHTX_of_m = 0x00000400,
4547 + ETHTX_ed_m = 0x00000800,
4549 + ETHTX_ec_m = 0x00001000,
4551 + ETHTX_lc_m = 0x00002000,
4553 + ETHTX_td_m = 0x00004000,
4555 + ETHTX_crc_m = 0x00008000,
4557 + ETHTX_le_m = 0x00010000,
4559 + ETHTX_cc_m = 0x001E0000,
4564 + ETH0_IPABMC_PhysicalAddress = 0x18040010,
4565 + ETH0_IPABMC_VirtualAddress = 0xb8040000,
4566 + ETH1_IPABMC_PhysicalAddress = 0x18040018,
4567 + ETH1_IPABMC_VirtualAddress = 0xb8040018,
4574 +}volatile *IPABM_ETH_t;
4575 +#endif //__IDT_RC32365_ETH_H__
4576 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h
4577 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h 1970-01-01 01:00:00.000000000 +0100
4578 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h 2006-06-18 12:44:28.000000000 +0200
4580 +/**************************************************************************
4582 + * BRIEF MODULE DESCRIPTION
4583 + * RC32365/336 Ethernet status checking.
4585 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4587 + * This program is free software; you can redistribute it and/or modify it
4588 + * under the terms of the GNU General Public License as published by the
4589 + * Free Software Foundation; either version 2 of the License, or (at your
4590 + * option) any later version.
4592 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4593 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4594 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4595 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4596 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4597 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4598 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4599 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4600 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4601 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4603 + * You should have received a copy of the GNU General Public License along
4604 + * with this program; if not, write to the Free Software Foundation, Inc.,
4605 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4608 + **************************************************************************
4609 + * May 2004 P. Sadik.
4615 + **************************************************************************
4618 +#ifndef __IDT_RC32365_ETH_V_H__
4619 +#define __IDT_RC32365_ETH_V_H__
4620 +#include <asm/idt-boards/rc32300/rc32365_eth.h>
4622 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
4623 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
4624 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
4625 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
4626 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
4627 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
4628 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
4629 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
4630 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
4631 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
4632 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
4634 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
4636 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
4637 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
4638 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
4639 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
4640 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
4641 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
4642 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
4643 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
4644 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
4645 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
4646 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
4647 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
4648 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
4649 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
4651 +#endif //__IDT_RC32365_ETH_V_H__
4652 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h
4653 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h 1970-01-01 01:00:00.000000000 +0100
4654 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h 2006-06-18 12:44:28.000000000 +0200
4656 +/**************************************************************************
4658 + * BRIEF MODULE DESCRIPTION
4659 + * RC32365/336 GPIO hardware abstraction.
4661 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4663 + * This program is free software; you can redistribute it and/or modify it
4664 + * under the terms of the GNU General Public License as published by the
4665 + * Free Software Foundation; either version 2 of the License, or (at your
4666 + * option) any later version.
4668 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4669 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4670 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4671 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4672 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4673 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4674 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4675 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4676 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4677 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4679 + * You should have received a copy of the GNU General Public License along
4680 + * with this program; if not, write to the Free Software Foundation, Inc.,
4681 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4684 + **************************************************************************
4685 + * May 2004 P. Sadik.
4691 + **************************************************************************
4694 +#ifndef __IDT_RC32365_GPIO_H__
4695 +#define __IDT_RC32365_GPIO_H__
4699 + GPIO0_PhysicalAddress = 0x18048000,
4700 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
4702 + GPIO0_VirtualAddress = 0xb8048000,
4703 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
4708 + u32 gpiofunc; /* GPIO Function Register
4709 + * gpiofunc[x]==0 bit = gpio
4710 + * func[x]==1 bit = altfunc
4712 + u32 gpiocfg; /* GPIO Configuration Register
4713 + * gpiocfg[x]==0 bit = input
4714 + * gpiocfg[x]==1 bit = output
4716 + u32 gpiod; /* GPIO Data Register
4717 + * gpiod[x] read/write gpio pinX status
4719 + u32 gpioilevel; /* GPIO Interrupt Status Register
4720 + * interrupt level (see gpioistat)
4722 + u32 gpioistat; /* Gpio Interrupt Status Register
4723 + * istat[x] = (gpiod[x] == level[x])
4724 + * cleared in ISR (STICKY bits)
4726 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
4727 +} volatile * GPIO_t ;
4731 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
4732 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
4733 + GPIO_input_v = 0, // gpiocfg use pin as input.
4734 + GPIO_output_v = 1, // gpiocfg use pin as output.
4736 + GPIO_pin0_m = 0x00000001,
4738 + GPIO_pin1_m = 0x00000002,
4740 + GPIO_pin2_m = 0x00000004,
4742 + GPIO_pin3_m = 0x00000008,
4744 + GPIO_pin4_m = 0x00000010,
4746 + GPIO_pin5_m = 0x00000020,
4748 + GPIO_pin6_m = 0x00000040,
4750 + GPIO_pin7_m = 0x00000080,
4752 + GPIO_pin8_m = 0x00000100,
4754 + GPIO_pin9_m = 0x00000200,
4755 + GPIO_pin10_b = 10,
4756 + GPIO_pin10_m = 0x00000400,
4757 + GPIO_pin11_b = 11,
4758 + GPIO_pin11_m = 0x00000800,
4759 + GPIO_pin12_b = 12,
4760 + GPIO_pin12_m = 0x00001000,
4761 + GPIO_pin13_b = 13,
4762 + GPIO_pin13_m = 0x00002000,
4763 + GPIO_pin14_b = 14,
4764 + GPIO_pin14_m = 0x00004000,
4765 + GPIO_pin15_b = 15,
4766 + GPIO_pin15_m = 0x00008000,
4768 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
4770 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
4771 + GPIO_u0sout_m = GPIO_pin0_m,
4772 + GPIO_u0sout_cfg_v = GPIO_output_v,
4774 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
4775 + GPIO_u0sinp_m = GPIO_pin1_m,
4776 + GPIO_u0sinp_cfg_v = GPIO_input_v,
4778 + GPIO_maddr22_b = GPIO_pin2_b, // M&P bus bit 22.
4779 + GPIO_maddr22_m = GPIO_pin2_m,
4780 + GPIO_maddr22_cfg_v = GPIO_output_v,
4782 + GPIO_maddr23_b = GPIO_pin3_b, // M&P bus bit 23.
4783 + GPIO_maddr23_m = GPIO_pin3_m,
4784 + GPIO_maddr23_cfg_v = GPIO_output_v,
4786 + GPIO_maddr24_b = GPIO_pin4_b, // M&P bus bit 24.
4787 + GPIO_maddr24_m = GPIO_pin4_m,
4788 + GPIO_maddr24_cfg_v = GPIO_output_v,
4790 + GPIO_maddr25_b = GPIO_pin5_b, // M&P bus bit 25.
4791 + GPIO_maddr25_m = GPIO_pin5_m,
4792 + GPIO_maddr25_cfg_v = GPIO_output_v,
4794 + GPIO_rngclk_b = GPIO_pin6_b, // reserved.
4795 + GPIO_rngclk_m = GPIO_pin6_m,
4796 + GPIO_rngclk_cfg_v = GPIO_input_v,
4798 + GPIO_sdckenp_b = GPIO_pin7_b, // reserved.
4799 + GPIO_sdckenp_m = GPIO_pin7_m,
4800 + GPIO_sdckenp_cfg_v = GPIO_output_v,
4802 + GPIO_cen1_b = GPIO_pin8_b, // reserved.
4803 + GPIO_cen1_m = GPIO_pin8_m,
4804 + GPIO_cen1_cfg_v = GPIO_output_v,
4806 + GPIO_cen2_b = GPIO_pin9_b, // reserved.
4807 + GPIO_cen2_m = GPIO_pin9_m,
4808 + GPIO_cen2_cfg_v = GPIO_output_v,
4810 + GPIO_regn_b = GPIO_pin10_b, // reserved.
4811 + GPIO_regn_m = GPIO_pin10_m,
4812 + GPIO_regn_cfg_v = GPIO_output_v,
4814 + GPIO_iordn_b = GPIO_pin11_b, // reserved.
4815 + GPIO_iordn_m = GPIO_pin11_m,
4816 + GPIO_iordn_cfg_v = GPIO_output_v,
4818 + GPIO_iowrn_b = GPIO_pin12_b, // reserved.
4819 + GPIO_iowrn_m = GPIO_pin12_m,
4820 + GPIO_iowrn_cfg_v = GPIO_output_v,
4822 + GPIO_pcireqn2_b = GPIO_pin13_b, // PCI messaging int.
4823 + GPIO_pcireqn2_m = GPIO_pin13_m,
4824 + GPIO_pcireqn2_cfg_v = GPIO_input_v,
4826 + GPIO_pcigntn2_b = GPIO_pin14_b, // PCI messaging int.
4827 + GPIO_pcigntn2_m = GPIO_pin14_m,
4828 + GPIO_pcigntn2_cfg_v = GPIO_output_v,
4830 + GPIO_pcimuintn_b = GPIO_pin15_b, // PCI messaging int.
4831 + GPIO_pcimuintn_m = GPIO_pin15_m,
4832 + GPIO_pcimuintn_cfg_v= GPIO_output_v,
4836 +#endif //__IDT_RC32365_GPIO_H__
4837 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h
4838 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h 1970-01-01 01:00:00.000000000 +0100
4839 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h 2006-06-18 12:44:28.000000000 +0200
4841 +/**************************************************************************
4843 + * BRIEF MODULE DESCRIPTION
4844 + * Routines to set/clear/toggle GPIO on RC32365
4846 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4848 + * This program is free software; you can redistribute it and/or modify it
4849 + * under the terms of the GNU General Public License as published by the
4850 + * Free Software Foundation; either version 2 of the License, or (at your
4851 + * option) any later version.
4853 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4854 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4855 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4856 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4857 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4858 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4859 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4860 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4861 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4862 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4864 + * You should have received a copy of the GNU General Public License along
4865 + * with this program; if not, write to the Free Software Foundation, Inc.,
4866 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4869 + **************************************************************************
4870 + * May 2004 P. Sadik.
4876 + **************************************************************************
4878 +#ifndef __IDT_RC32365_GPIO_V_H__
4879 +#define __IDT_RC32365_GPIO_V_H__
4882 +#ifdef _LANGUAGE_ASSEMBLY
4883 +#define SET_GPIO(pin) \
4885 + ori t5,t5,0x8000 ; \
4890 +#define CLEAR_GPIO(pin) \
4892 + ori t5,t5,0x8000 ; \
4895 + ori t6,t6,0xFFFF; \
4896 + xori t6,t6,pin ; \
4900 +#define TOGGLE_GPIO(pin) \
4902 + ori t5,t5,0x8000 ; \
4904 + xori t4,t4,pin ; \
4907 +#else // !_LANGUAGE_ASSEMBLY
4908 +#include <asm/rc32300/types.h>
4909 +#include <asm/rc32300/rc32365_gpio.h>
4910 +#include <asm/rc32300/rc32365.h>
4912 +static inline void set_gpio(unsigned long pin)
4914 + idt_gpio->gpiod |= pin;
4917 +static inline void clear_gpio(unsigned long pin)
4919 + idt_gpio->gpiod &= ~pin;
4921 +static inline void toggle_gpio(unsigned long pin)
4923 + idt_gpio->gpiod ^= pin;
4925 +#define SET_GPIO(pin) set_gpio(pin)
4926 +#define CLEAR_GPIO(pin) clear_gpio(pin)
4927 +#define TOGGLE_GPIO(pin) toggle_gpio(pin)
4928 +#endif // _LANGUAGE_ASSEMBLY
4930 +#endif //__IDT_RC32365_GPIO_V_H__
4932 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365.h
4933 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365.h 1970-01-01 01:00:00.000000000 +0100
4934 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365.h 2006-06-18 12:44:28.000000000 +0200
4936 +/**************************************************************************
4938 + * BRIEF MODULE DESCRIPTION
4939 + * Definitions for IDT RC32365 CPU.
4941 + * Copyright 2004 IDT 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.
4964 + **************************************************************************
4965 + * May 2004 P. Sadik.
4971 + **************************************************************************
4974 +#ifndef __IDT_RC32365_H__
4975 +#define __IDT_RC32365_H__
4977 +extern unsigned int cedar_za;
4979 +/* Base address of internal registers */
4980 +#define RC32365_REG_BASE 0x18000000
4982 +/* System ID Registers */
4983 +#define CPU_SYSID (RC32365_REG_BASE + 0x00018)
4984 +#define CPU_DEVTYPE (RC32365_REG_BASE + 0x0001c)
4986 +/* Reset Controller */
4987 +#define RESET_CNTL (RC32365_REG_BASE + 0x08000)
4988 +#define BOOT_VECTOR (RC32365_REG_BASE + 0x08004)
4990 +/* Device Controller */
4991 +#define DEV0_BASE (RC32365_REG_BASE + 0x10000)
4992 +#define DEV0_MASK (RC32365_REG_BASE + 0x10004)
4993 +#define DEV0_CNTL (RC32365_REG_BASE + 0x10008)
4994 +#define DEV0_TIMING (RC32365_REG_BASE + 0x1000c)
4995 +#define DEV_REG_OFFSET 0x10
4997 +/* SDRAM Controller */
4998 +#define SDRAM0_BASE (RC32365_REG_BASE + 0x18000)
4999 +#define SDRAM0_MASK (RC32365_REG_BASE + 0x18004)
5000 +#define SDRAM1_BASE (RC32365_REG_BASE + 0x18008)
5001 +#define SDRAM1_MASK (RC32365_REG_BASE + 0x1800c)
5002 +#define SDRAM_CNTL (RC32365_REG_BASE + 0x18010)
5004 +/* Counters/Timers */
5005 +#define TIMER0_COUNT (RC32365_REG_BASE + 0x20000)
5006 +#define TIMER0_COMPARE (RC32365_REG_BASE + 0x20004)
5007 +#define TIMER0_CNTL (RC32365_REG_BASE + 0x20008)
5008 +#define TIMER0_SELECT (RC32365_REG_BASE + 0x2000c)
5009 +#define TIMER_REG_OFFSET 0x10
5011 +/* System Integrity */
5013 +/* Interrupt Controller */
5014 +#define IC_GROUP0_PEND (RC32365_REG_BASE + 0x30000)
5015 +#define IC_GROUP0_TEST (RC32365_REG_BASE + 0x30004)
5016 +#define IC_GROUP0_MASK (RC32365_REG_BASE + 0x30008)
5017 +#define IC_GROUP_OFFSET 0x0c
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 RC32365 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) // RNG, SEC
5043 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) // Eth, PCI, UARTs
5044 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32) // GPIO
5046 +#define RC32365_NR_IRQS (GROUP4_IRQ_BASE + 32)
5048 +/* DMA - see rc32365_dma.h for full list of registers */
5050 +#define RC32365_DMA_BASE (RC32365_REG_BASE + 0x38000)
5051 +#define DMA_CHAN_OFFSET 0x14
5053 +/* GPIO Controller */
5054 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
5058 +#define RC32300_UART0_BASE (RC32365_REG_BASE + 0x50003)
5060 +#define RC32300_UART0_BASE (RC32365_REG_BASE + 0x50000)
5062 +#define RC32300_UART0_IRQ (GROUP3_IRQ_BASE + 0)
5064 +/* Ethernet - see rc32365_eth.h for full list of registers */
5066 +#define RC32365_ETH_BASE (RC32365_REG_BASE + 0x58000)
5068 +#define IDT_CLOCK_MULT 2
5070 +/* FLASH (device 1) */
5071 +#define FLASH_BASE 0x08000000
5072 +#define FLASH_SIZE 0x00800000
5074 +/* LCD 4-digit display (device 2) */
5075 +#define LCD_DIGIT0 0x0C000003
5076 +#define LCD_DIGIT1 0x0C000002
5077 +#define LCD_DIGIT2 0x0C000001
5078 +#define LCD_DIGIT3 0x0C000000
5080 +/* RTC (DS1553) (device 2) */
5081 +#define RTC_BASE 0x0c800000
5083 +#define NVRAM_BASE RTC_BASE
5084 +#define NVRAM_ENVSIZE_OFF 4
5085 +#define NVRAM_ENVSTART_OFF 32
5087 +/* Interrupts routed on 79EB365 board */
5088 +#define RC32365_PCI_INTA_IRQ (GROUP4_IRQ_BASE + 8)
5089 +#define RC32365_PCI_INTB_IRQ (GROUP4_IRQ_BASE + 9)
5090 +#define RC32365_PCI_INTC_IRQ (GROUP4_IRQ_BASE + 10)
5091 +#define RC32365_PCI_INTD_IRQ (GROUP4_IRQ_BASE + 11)
5093 +#define RAM_SIZE (32 * 1024 * 1024)
5095 +#endif //__IDT_RC32365_H__
5096 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_pci.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_pci.h
5097 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_pci.h 1970-01-01 01:00:00.000000000 +0100
5098 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_pci.h 2006-06-18 12:44:28.000000000 +0200
5100 +/**************************************************************************
5102 + * BRIEF MODULE DESCRIPTION
5103 + * Datatype declaration for IDT 79EB365/336 PCI
5105 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5107 + * This program is free software; you can redistribute it and/or modify it
5108 + * under the terms of the GNU General Public License as published by the
5109 + * Free Software Foundation; either version 2 of the License, or (at your
5110 + * option) any later version.
5112 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5113 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5114 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5115 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5116 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5117 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5118 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5119 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5120 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5121 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5123 + * You should have received a copy of the GNU General Public License along
5124 + * with this program; if not, write to the Free Software Foundation, Inc.,
5125 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5128 + **************************************************************************
5129 + * May 2004 P. Sadik.
5135 + **************************************************************************
5138 +#ifndef __IDT_RC32365_PCI_H__
5139 +#define __IDT_RC32365_PCI_H__
5143 + PCI0_PhysicalAddress = 0x18068000,
5144 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
5146 + PCI0_VirtualAddress = 0xb8068000,
5147 + PCI_VirtualAddress = PCI0_VirtualAddress,
5152 + PCI_LbaCount = 4, // Local base addresses.
5157 + u32 a ; // Address.
5158 + u32 c ; // Control.
5159 + u32 m ; // mapping.
5169 + PCI_Map_s pcilba [PCI_LbaCount] ;
5177 +} volatile *PCI_t ;
5179 +// PCI messaging unit.
5186 + u32 pciim [PCIM_Count] ;
5187 + u32 pciom [PCIM_Count] ;
5194 +} volatile *PCIM_t ;
5196 +/*******************************************************************************
5198 + * PCI Control Register
5200 + ******************************************************************************/
5204 + PCIC_en_m = 0x00000001,
5206 + PCIC_tnr_m = 0x00000002,
5208 + PCIC_sce_m = 0x00000004,
5210 + PCIC_ien_m = 0x00000008,
5212 + PCIC_aaa_m = 0x00000010,
5214 + PCIC_eap_m = 0x00000020,
5216 + PCIC_pcim_m = 0x000001c0,
5217 + PCIC_pcim_disabled_v = 0,
5218 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
5219 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
5220 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
5221 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
5222 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
5223 + PCIC_pcim_reserved6_v = 6,
5224 + PCIC_pcim_reserved7_v = 7,
5226 + PCIC_igm_m = 0x00000200,
5229 +/*******************************************************************************
5231 + * PCI Status Register
5233 + ******************************************************************************/
5236 + PCIS_eed_m = 0x00000001,
5238 + PCIS_wr_m = 0x00000002,
5240 + PCIS_nmi_m = 0x00000004,
5242 + PCIS_ii_m = 0x00000008,
5244 + PCIS_cwe_m = 0x00000010,
5246 + PCIS_cre_m = 0x00000020,
5248 + PCIS_mdpe_m = 0x00000040,
5250 + PCIS_sta_m = 0x00000080,
5252 + PCIS_rta_m = 0x00000100,
5254 + PCIS_rma_m = 0x00000200,
5256 + PCIS_sse_m = 0x00000400,
5258 + PCIS_ose_m = 0x00000800,
5260 + PCIS_pe_m = 0x00001000,
5262 + PCIS_tae_m = 0x00002000,
5264 + PCIS_rle_m = 0x00004000,
5266 + PCIS_bme_m = 0x00008000,
5268 + PCIS_prd_m = 0x00010000,
5270 + PCIS_rip_m = 0x00020000,
5273 +/*******************************************************************************
5275 + * PCI Status Mask Register
5277 + ******************************************************************************/
5280 + PCISM_eed_m = 0x00000001,
5282 + PCISM_wr_m = 0x00000002,
5284 + PCISM_nmi_m = 0x00000004,
5286 + PCISM_ii_m = 0x00000008,
5288 + PCISM_cwe_m = 0x00000010,
5290 + PCISM_cre_m = 0x00000020,
5292 + PCISM_mdpe_m = 0x00000040,
5294 + PCISM_sta_m = 0x00000080,
5296 + PCISM_rta_m = 0x00000100,
5298 + PCISM_rma_m = 0x00000200,
5300 + PCISM_sse_m = 0x00000400,
5302 + PCISM_ose_m = 0x00000800,
5304 + PCISM_pe_m = 0x00001000,
5306 + PCISM_tae_m = 0x00002000,
5308 + PCISM_rle_m = 0x00004000,
5310 + PCISM_bme_m = 0x00008000,
5312 + PCISM_prd_m = 0x00010000,
5314 + PCISM_rip_m = 0x00020000,
5317 +/*******************************************************************************
5319 + * PCI Configuration Address Register
5321 + ******************************************************************************/
5323 + PCICFGA_reg_b = 2,
5324 + PCICFGA_reg_m = 0x000000fc,
5325 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
5326 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
5327 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
5328 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
5329 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
5330 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
5331 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
5332 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
5333 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
5334 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
5335 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
5336 + PCICFGA_reg_pba0m_v = 0x48>>2,
5337 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
5338 + PCICFGA_reg_pba1m_v = 0x50>>2,
5339 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
5340 + PCICFGA_reg_pba2m_v = 0x58>>2,
5341 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
5342 + PCICFGA_reg_pba3m_v = 0x60>>2,
5343 + PCICFGA_reg_pmgt_v = 0x64>>2,
5344 + PCICFGA_func_b = 8,
5345 + PCICFGA_func_m = 0x00000700,
5346 + PCICFGA_dev_b = 11,
5347 + PCICFGA_dev_m = 0x0000f800,
5348 + PCICFGA_dev_internal_v = 0,
5349 + PCICFGA_bus_b = 16,
5350 + PCICFGA_bus_m = 0x00ff0000,
5351 + PCICFGA_bus_type0_v = 0, //local bus
5352 + PCICFGA_en_b = 31, // read only
5353 + PCICFGA_en_m = 0x80000000,
5357 + PCFGID_vendor_b = 0,
5358 + PCFGID_vendor_m = 0x0000ffff,
5359 + PCFGID_vendor_IDT_v = 0x111d,
5360 + PCFGID_device_b = 16,
5361 + PCFGID_device_m = 0xffff0000,
5362 + PCFGID_device_Acaciade_v = 0x0207,
5364 + PCFG04_command_ioena_b = 1,
5365 + PCFG04_command_ioena_m = 0x00000001,
5366 + PCFG04_command_memena_b = 2,
5367 + PCFG04_command_memena_m = 0x00000002,
5368 + PCFG04_command_bmena_b = 3,
5369 + PCFG04_command_bmena_m = 0x00000004,
5370 + PCFG04_command_mwinv_b = 5,
5371 + PCFG04_command_mwinv_m = 0x00000010,
5372 + PCFG04_command_parena_b = 7,
5373 + PCFG04_command_parena_m = 0x00000040,
5374 + PCFG04_command_serrena_b = 9,
5375 + PCFG04_command_serrena_m = 0x00000100,
5376 + PCFG04_command_fastbbena_b = 10,
5377 + PCFG04_command_fastbbena_m = 0x00000200,
5378 + PCFG04_status_b = 16,
5379 + PCFG04_status_m = 0xffff0000,
5380 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
5381 + PCFG04_status_66MHz_m = 0x00200000,
5382 + PCFG04_status_fbb_b = 23,
5383 + PCFG04_status_fbb_m = 0x00800000,
5384 + PCFG04_status_mdpe_b = 24,
5385 + PCFG04_status_mdpe_m = 0x01000000,
5386 + PCFG04_status_dst_b = 25,
5387 + PCFG04_status_dst_m = 0x06000000,
5388 + PCFG04_status_sta_b = 27,
5389 + PCFG04_status_sta_m = 0x08000000,
5390 + PCFG04_status_rta_b = 28,
5391 + PCFG04_status_rta_m = 0x10000000,
5392 + PCFG04_status_rma_b = 29,
5393 + PCFG04_status_rma_m = 0x20000000,
5394 + PCFG04_status_sse_b = 30,
5395 + PCFG04_status_sse_m = 0x40000000,
5396 + PCFG04_status_pe_b = 31,
5397 + PCFG04_status_pe_m = 0x40000000,
5399 + PCFG08_revId_b = 0,
5400 + PCFG08_revId_m = 0x000000ff,
5401 + PCFG08_classCode_b = 0,
5402 + PCFG08_classCode_m = 0xffffff00,
5403 + PCFG08_classCode_bridge_v = 06,
5404 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
5405 + PCFG0C_cacheline_b = 0,
5406 + PCFG0C_cacheline_m = 0x000000ff,
5407 + PCFG0C_masterLatency_b = 8,
5408 + PCFG0C_masterLatency_m = 0x0000ff00,
5409 + PCFG0C_headerType_b = 16,
5410 + PCFG0C_headerType_m = 0x00ff0000,
5411 + PCFG0C_bist_b = 24,
5412 + PCFG0C_bist_m = 0xff000000,
5415 + PCIPBA_msi_m = 0x00000001,
5417 + PCIPBA_p_m = 0x00000004,
5418 + PCIPBA_baddr_b = 8,
5419 + PCIPBA_baddr_m = 0xffffff00,
5421 + PCFGSS_vendorId_b = 0,
5422 + PCFGSS_vendorId_m = 0x0000ffff,
5424 + PCFGSS_id_m = 0xffff0000,
5426 + PCFG3C_interruptLine_b = 0,
5427 + PCFG3C_interruptLine_m = 0x000000ff,
5428 + PCFG3C_interruptPin_b = 8,
5429 + PCFG3C_interruptPin_m = 0x0000ff00,
5430 + PCFG3C_minGrant_b = 16,
5431 + PCFG3C_minGrant_m = 0x00ff0000,
5432 + PCFG3C_maxLat_b = 24,
5433 + PCFG3C_maxLat_m = 0xff000000,
5435 + PCIPBAC_msi_b = 0,
5436 + PCIPBAC_msi_m = 0x00000001,
5438 + PCIPBAC_p_m = 0x00000002,
5439 + PCIPBAC_size_b = 2,
5440 + PCIPBAC_size_m = 0x0000007c,
5442 + PCIPBAC_sb_m = 0x00000080,
5444 + PCIPBAC_pp_m = 0x00000100,
5446 + PCIPBAC_mr_m = 0x00000600,
5447 + PCIPBAC_mr_read_v =0, //no prefetching
5448 + PCIPBAC_mr_readLine_v =1,
5449 + PCIPBAC_mr_readMult_v =2,
5450 + PCIPBAC_mrl_b = 11,
5451 + PCIPBAC_mrl_m = 0x00000800,
5452 + PCIPBAC_mrm_b = 12,
5453 + PCIPBAC_mrm_m = 0x00001000,
5454 + PCIPBAC_trp_b = 13,
5455 + PCIPBAC_trp_m = 0x00002000,
5457 + PCFG40_trdyTimeout_b = 0,
5458 + PCFG40_trdyTimeout_m = 0x000000ff,
5459 + PCFG40_retryLim_b = 8,
5460 + PCFG40_retryLim_m = 0x0000ff00,
5463 +/*******************************************************************************
5465 + * PCI Local Base Address [0|1|2|3] Register
5467 + ******************************************************************************/
5469 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
5470 + PCILBA_baddr_m = 0xffffff00,
5472 +/*******************************************************************************
5474 + * PCI Local Base Address Control Register
5476 + ******************************************************************************/
5478 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
5479 + PCILBAC_msi_m = 0x00000001,
5480 + PCILBAC_msi_mem_v = 0,
5481 + PCILBAC_msi_io_v = 1,
5482 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
5483 + PCILBAC_size_m = 0x0000007c,
5484 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
5485 + PCILBAC_sb_m = 0x00000080,
5486 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
5487 + PCILBAC_rt_m = 0x00000100,
5488 + PCILBAC_rt_noprefetch_v = 0, // mem read
5489 + PCILBAC_rt_prefetch_v = 1, // mem readline
5492 +/*******************************************************************************
5494 + * PCI Local Base Address [0|1|2|3] Mapping Register
5496 + ******************************************************************************/
5498 + PCILBAM_maddr_b = 8,
5499 + PCILBAM_maddr_m = 0xffffff00,
5502 +/*******************************************************************************
5504 + * PCI Decoupled Access Control Register
5506 + ******************************************************************************/
5509 + PCIDAC_den_m = 0x00000001,
5512 +/*******************************************************************************
5514 + * PCI Decoupled Access Status Register
5516 + ******************************************************************************/
5519 + PCIDAS_d_m = 0x00000001,
5521 + PCIDAS_b_m = 0x00000002,
5523 + PCIDAS_e_m = 0x00000004,
5525 + PCIDAS_ofe_m = 0x00000008,
5527 + PCIDAS_off_m = 0x00000010,
5529 + PCIDAS_ife_m = 0x00000020,
5531 + PCIDAS_iff_m = 0x00000040,
5534 +/*******************************************************************************
5536 + * PCI DMA Channel 8 Configuration Register
5538 + ******************************************************************************/
5541 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
5542 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
5543 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
5544 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
5547 +/*******************************************************************************
5549 + * PCI DMA Channel 9 Configuration Register
5551 + ******************************************************************************/
5554 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
5555 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
5558 +/*******************************************************************************
5560 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
5562 + ******************************************************************************/
5564 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
5565 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
5566 + // These are for reads (DMA channel 8)
5567 + PCIDMAD_devcmd_mr_v = 0, //memory read
5568 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
5569 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
5570 + PCIDMAD_devcmd_ior_v = 3, //I/O read
5571 + // These are for writes (DMA channel 9)
5572 + PCIDMAD_devcmd_mw_v = 0, //memory write
5573 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
5574 + PCIDMAD_devcmd_iow_v = 3, //I/O write
5576 + // Swap byte field applies to both DMA channel 8 and 9
5577 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
5578 + PCIDMAD_sb_m = 0x01000000, // swap byte field
5582 +/*******************************************************************************
5584 + * PCI Target Control Register
5586 + ******************************************************************************/
5589 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
5590 + PCITC_rtimer_m = 0x000000ff,
5591 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
5592 + PCITC_dtimer_m = 0x0000ff00,
5593 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
5594 + PCITC_rdr_m = 0x00040000,
5595 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
5596 + PCITC_ddt_m = 0x00080000,
5598 +/*******************************************************************************
5600 + * PCI messaging unit [applies to both inbound and outbound registers ]
5602 + ******************************************************************************/
5605 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5606 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
5607 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5608 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
5609 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5610 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
5614 +#endif // __IDT_RC32365_PCI_H__
5615 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h
5616 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h 1970-01-01 01:00:00.000000000 +0100
5617 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h 2006-06-18 12:44:28.000000000 +0200
5619 +/**************************************************************************
5621 + * BRIEF MODULE DESCRIPTION
5622 + * PCI header values for IDT 79EB365/336
5624 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5626 + * This program is free software; you can redistribute it and/or modify it
5627 + * under the terms of the GNU General Public License as published by the
5628 + * Free Software Foundation; either version 2 of the License, or (at your
5629 + * option) any later version.
5631 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5632 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5633 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5634 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5635 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5636 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5637 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5638 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5639 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5640 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5642 + * You should have received a copy of the GNU General Public License along
5643 + * with this program; if not, write to the Free Software Foundation, Inc.,
5644 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5647 + **************************************************************************
5648 + * May 2004 P. Sadik.
5654 + **************************************************************************
5657 +#ifndef __IDT_RC32365_PCI_V_H__
5658 +#define __IDT_RC32365_PCI_V_H__
5661 +#define PCI_MSG_VirtualAddress 0xB806C010
5662 +#define rc32365_pci ((volatile PCI_t) PCI0_VirtualAddress)
5663 +#define rc32365_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
5665 +#define PCIM_SHFT 0x6
5666 +#define PCIM_BIT_LEN 0x7
5667 +#define PCIM_H_EA 0x3
5668 +#define PCIM_H_IA_FIX 0x4
5669 +#define PCIM_H_IA_RR 0x5
5671 +#define PCI_ADDR_START 0x50000000
5673 +#define CPUTOPCI_MEM_WIN 0x02000000
5674 +#define CPUTOPCI_IO_WIN 0x00100000
5675 +#define PCILBA_SIZE_SHFT 2
5676 +#define PCILBA_SIZE_MASK 0x1F
5677 +#define SIZE_256MB 0x1C
5678 +#define SIZE_128MB 0x1B
5679 +#define SIZE_64MB 0x1A
5680 +#define SIZE_32MB 0x19
5681 +#define SIZE_16MB 0x18
5682 +#define SIZE_4MB 0x16
5683 +#define SIZE_2MB 0x15
5684 +#define SIZE_1MB 0x14
5685 +#define CEDAR_CONFIG0_ADDR 0x80000000
5686 +#define CEDAR_CONFIG1_ADDR 0x80000004
5687 +#define CEDAR_CONFIG2_ADDR 0x80000008
5688 +#define CEDAR_CONFIG3_ADDR 0x8000000C
5689 +#define CEDAR_CONFIG4_ADDR 0x80000010
5690 +#define CEDAR_CONFIG5_ADDR 0x80000014
5691 +#define CEDAR_CONFIG6_ADDR 0x80000018
5692 +#define CEDAR_CONFIG7_ADDR 0x8000001C
5693 +#define CEDAR_CONFIG8_ADDR 0x80000020
5694 +#define CEDAR_CONFIG9_ADDR 0x80000024
5695 +#define CEDAR_CONFIG10_ADDR 0x80000028
5696 +#define CEDAR_CONFIG11_ADDR 0x8000002C
5697 +#define CEDAR_CONFIG12_ADDR 0x80000030
5698 +#define CEDAR_CONFIG13_ADDR 0x80000034
5699 +#define CEDAR_CONFIG14_ADDR 0x80000038
5700 +#define CEDAR_CONFIG15_ADDR 0x8000003C
5701 +#define CEDAR_CONFIG16_ADDR 0x80000040
5702 +#define CEDAR_CONFIG17_ADDR 0x80000044
5703 +#define CEDAR_CONFIG18_ADDR 0x80000048
5704 +#define CEDAR_CONFIG19_ADDR 0x8000004C
5705 +#define CEDAR_CONFIG20_ADDR 0x80000050
5706 +#define CEDAR_CONFIG21_ADDR 0x80000054
5707 +#define CEDAR_CONFIG22_ADDR 0x80000058
5708 +#define CEDAR_CONFIG23_ADDR 0x8000005C
5709 +#define CEDAR_CONFIG24_ADDR 0x80000060
5710 +#define CEDAR_CONFIG25_ADDR 0x80000064
5711 +#define CEDAR_CMD (PCFG04_command_ioena_m | \
5712 + PCFG04_command_memena_m | \
5713 + PCFG04_command_bmena_m | \
5714 + PCFG04_command_mwinv_m | \
5715 + PCFG04_command_parena_m | \
5716 + PCFG04_command_serrena_m )
5718 +#define CEDAR_STAT (PCFG04_status_mdpe_m | \
5719 + PCFG04_status_sta_m | \
5720 + PCFG04_status_rta_m | \
5721 + PCFG04_status_rma_m | \
5722 + PCFG04_status_sse_m | \
5723 + PCFG04_status_pe_m)
5725 +#define CEDAR_CNFG1 ((CEDAR_STAT << 16) | \
5728 +#define CEDAR_REVID 0
5729 +#define CEDAR_CLASS_CODE 0
5730 +#define CEDAR_CNFG2 ((CEDAR_CLASS_CODE << 8) | \
5733 +#define CEDAR_CACHE_LINE_SIZE 4
5734 +#define CEDAR_MASTER_LAT 0x3c
5735 +#define CEDAR_HEADER_TYPE 0
5736 +#define CEDAR_BIST 0
5738 +#define CEDAR_CNFG3 ((CEDAR_BIST << 24) | \
5739 + (CEDAR_HEADER_TYPE << 16) | \
5740 + (CEDAR_MASTER_LAT << 8) | \
5741 + CEDAR_CACHE_LINE_SIZE)
5743 +#define CEDAR_BAR0 0x00000008 /* 128 MB Memory */
5744 +#define CEDAR_BAR1 0x18800001 /* 1 MB IO */
5745 +#define CEDAR_BAR2 0x18000001 /* 2 MB IO window for Cedar
5746 + internal Registers */
5747 +#define CEDAR_BAR3 0x48000008 /* Spare 128 MB Memory */
5749 +#define CEDAR_CNFG4 CEDAR_BAR0
5750 +#define CEDAR_CNFG5 CEDAR_BAR1
5751 +#define CEDAR_CNFG6 CEDAR_BAR2
5752 +#define CEDAR_CNFG7 CEDAR_BAR3
5754 +#define CEDAR_SUBSYS_VENDOR_ID 0
5755 +#define CEDAR_SUBSYSTEM_ID 0
5756 +#define CEDAR_CNFG8 0
5757 +#define CEDAR_CNFG9 0
5758 +#define CEDAR_CNFG10 0
5759 +#define CEDAR_CNFG11 ((CEDAR_SUBSYS_VENDOR_ID << 16) | \
5760 + CEDAR_SUBSYSTEM_ID)
5761 +#define CEDAR_INT_LINE 1
5762 +#define CEDAR_INT_PIN 1
5763 +#define CEDAR_MIN_GNT 8
5764 +#define CEDAR_MAX_LAT 0x38
5765 +#define CEDAR_CNFG12 0
5766 +#define CEDAR_CNFG13 0
5767 +#define CEDAR_CNFG14 0
5768 +#define CEDAR_CNFG15 ((CEDAR_MAX_LAT << 24) | \
5769 + (CEDAR_MIN_GNT << 16) | \
5770 + (CEDAR_INT_PIN << 8) | \
5772 +#define CEDAR_RETRY_LIMIT 0x80
5773 +#define CEDAR_TRDY_LIMIT 0x80
5774 +#define CEDAR_CNFG16 ((CEDAR_RETRY_LIMIT << 8) | \
5776 +#define PCI_PBAxC_R 0x0
5777 +#define PCI_PBAxC_RL 0x1
5778 +#define PCI_PBAxC_RM 0x2
5779 +#define SIZE_SHFT 2
5781 +#define CEDAR_PBA0C (((1 & 0x3) << PCIPBAC_mr_b) | \
5784 + (SIZE_128MB << SIZE_SHFT) | \
5788 +#define CEDAR_PBA0C (((1 & 0x3) << PCIPBAC_mr_b) | \
5790 + (SIZE_128MB << SIZE_SHFT) | \
5793 +#define CEDAR_CNFG17 CEDAR_PBA0C
5794 +#define CEDAR_PBA0M 0x0
5795 +#define CEDAR_CNFG18 CEDAR_PBA0M
5798 +#define CEDAR_PBA1C ((SIZE_1MB << SIZE_SHFT) | \
5802 +#define CEDAR_PBA1C ((SIZE_1MB << SIZE_SHFT) | \
5805 +#define CEDAR_CNFG19 CEDAR_PBA1C
5806 +#define CEDAR_PBA1M 0x0
5807 +#define CEDAR_CNFG20 CEDAR_PBA1M
5810 +#define CEDAR_PBA2C ((SIZE_2MB << SIZE_SHFT) | \
5814 +#define CEDAR_PBA2C ((SIZE_2MB << SIZE_SHFT) | \
5818 +#define CEDAR_CNFG21 CEDAR_PBA2C
5819 +#define CEDAR_PBA2M 0x18000000
5820 +#define CEDAR_CNFG22 CEDAR_PBA2M
5823 +#define CEDAR_PBA3C PCIPBAC_sb_m
5825 +#define CEDAR_PBA3C 0
5828 +#define CEDAR_CNFG23 CEDAR_PBA3C
5829 +#define CEDAR_PBA3M 0
5830 +#define CEDAR_CNFG24 CEDAR_PBA3M
5832 +#define PCITC_DTIMER_VAL 8
5833 +#define PCITC_RTIMER_VAL 0x10
5835 +#endif //__IDT_RC32365_PCI_V_H__
5836 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_dma.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_dma.h
5837 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_dma.h 1970-01-01 01:00:00.000000000 +0100
5838 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_dma.h 2006-06-18 12:44:28.000000000 +0200
5840 +/**************************************************************************
5842 + * BRIEF MODULE DESCRIPTION
5843 + * DMA register definition
5845 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5847 + * This program is free software; you can redistribute it and/or modify it
5848 + * under the terms of the GNU General Public License as published by the
5849 + * Free Software Foundation; either version 2 of the License, or (at your
5850 + * option) any later version.
5852 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5853 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5854 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5855 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5856 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5857 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5858 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5859 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5860 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5861 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5863 + * You should have received a copy of the GNU General Public License along
5864 + * with this program; if not, write to the Free Software Foundation, Inc.,
5865 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5868 + **************************************************************************
5869 + * May 2004 rkt, neb
5875 + **************************************************************************
5878 +#ifndef __IDT_DMA_H__
5879 +#define __IDT_DMA_H__
5883 + DMA0_PhysicalAddress = 0x18040000,
5884 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
5886 + DMA0_VirtualAddress = 0xb8040000,
5887 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
5891 + * DMA descriptor (in physical memory).
5894 +typedef struct DMAD_s
5896 + u32 control ; // Control. use DMAD_*
5897 + u32 ca ; // Current Address.
5898 + u32 devcs ; // Device control and status.
5899 + u32 link ; // Next descriptor in chain.
5900 +} volatile *DMAD_t ;
5904 + DMAD_size = sizeof (struct DMAD_s),
5905 + DMAD_count_b = 0, // in DMAD_t -> control
5906 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
5907 + DMAD_ds_b = 20, // in DMAD_t -> control
5908 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
5909 + DMAD_ds_ethRcv0_v = 0,
5910 + DMAD_ds_ethXmt0_v = 0,
5911 + DMAD_ds_memToFifo_v = 0,
5912 + DMAD_ds_fifoToMem_v = 0,
5913 + DMAD_ds_pciToMem_v = 0,
5914 + DMAD_ds_memToPci_v = 0,
5916 + DMAD_devcmd_b = 22, // in DMAD_t -> control
5917 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
5918 + DMAD_devcmd_byte_v = 0, //memory-to-memory
5919 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
5920 + DMAD_devcmd_word_v = 2, //memory-to-memory
5921 + DMAD_devcmd_2words_v = 3, //memory-to-memory
5922 + DMAD_devcmd_4words_v = 4, //memory-to-memory
5923 + DMAD_devcmd_6words_v = 5, //memory-to-memory
5924 + DMAD_devcmd_8words_v = 6, //memory-to-memory
5925 + DMAD_devcmd_16words_v = 7, //memory-to-memory
5926 + DMAD_cof_b = 25, // chain on finished
5927 + DMAD_cof_m = 0x02000000, //
5928 + DMAD_cod_b = 26, // chain on done
5929 + DMAD_cod_m = 0x04000000, //
5930 + DMAD_iof_b = 27, // interrupt on finished
5931 + DMAD_iof_m = 0x08000000, //
5932 + DMAD_iod_b = 28, // interrupt on done
5933 + DMAD_iod_m = 0x10000000, //
5934 + DMAD_t_b = 29, // terminated
5935 + DMAD_t_m = 0x20000000, //
5936 + DMAD_d_b = 30, // done
5937 + DMAD_d_m = 0x40000000, //
5938 + DMAD_f_b = 31, // finished
5939 + DMAD_f_m = 0x80000000, //
5943 + * DMA register (within Internal Register Map).
5948 + u32 dmac ; // Control.
5949 + u32 dmas ; // Status.
5950 + u32 dmasm ; // Mask.
5951 + u32 dmadptr ; // Descriptor pointer.
5952 + u32 dmandptr ; // Next descriptor pointer.
5955 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
5957 +//DMA_Channels use DMACH_count instead
5961 + DMAC_run_b = 0, //
5962 + DMAC_run_m = 0x00000001, //
5963 + DMAC_dm_b = 1, // done mask
5964 + DMAC_dm_m = 0x00000002, //
5965 + DMAC_mode_b = 2, //
5966 + DMAC_mode_m = 0x0000000c, //
5967 + DMAC_mode_auto_v = 0,
5968 + DMAC_mode_burst_v = 1,
5969 + DMAC_mode_transfer_v = 2, //usually used
5970 + DMAC_mode_reserved_v = 3,
5972 + DMAC_a_m = 0x00000010, //
5974 + DMAS_f_b = 0, // finished (sticky)
5975 + DMAS_f_m = 0x00000001, //
5976 + DMAS_d_b = 1, // done (sticky)
5977 + DMAS_d_m = 0x00000002, //
5978 + DMAS_c_b = 2, // chain (sticky)
5979 + DMAS_c_m = 0x00000004, //
5980 + DMAS_e_b = 3, // error (sticky)
5981 + DMAS_e_m = 0x00000008, //
5982 + DMAS_h_b = 4, // halt (sticky)
5983 + DMAS_h_m = 0x00000010, //
5985 + DMASM_f_b = 0, // finished (1=mask)
5986 + DMASM_f_m = 0x00000001, //
5987 + DMASM_d_b = 1, // done (1=mask)
5988 + DMASM_d_m = 0x00000002, //
5989 + DMASM_c_b = 2, // chain (1=mask)
5990 + DMASM_c_m = 0x00000004, //
5991 + DMASM_e_b = 3, // error (1=mask)
5992 + DMASM_e_m = 0x00000008, //
5993 + DMASM_h_b = 4, // halt (1=mask)
5994 + DMASM_h_m = 0x00000010, //
5998 + * DMA channel definitions
6003 + DMACH_ethRcv0 = 0,
6004 + DMACH_ethXmt0 = 1,
6005 + DMACH_memToFifo = 2,
6006 + DMACH_fifoToMem = 3,
6007 + DMACH_pciToMem = 4,
6008 + DMACH_memToPci = 5,
6010 + DMACH_count //must be last
6014 +typedef struct DMAC_s
6016 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
6017 +} volatile *DMA_t ;
6021 + * External DMA parameters
6026 + DMADEVCMD_ts_b = 0, // ts field in devcmd
6027 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
6028 + DMADEVCMD_ts_byte_v = 0,
6029 + DMADEVCMD_ts_halfword_v = 1,
6030 + DMADEVCMD_ts_word_v = 2,
6031 + DMADEVCMD_ts_2word_v = 3,
6032 + DMADEVCMD_ts_4word_v = 4,
6033 + DMADEVCMD_ts_6word_v = 5,
6034 + DMADEVCMD_ts_8word_v = 6,
6035 + DMADEVCMD_ts_16word_v = 7
6039 +#endif // __IDT_DMA_H__
6045 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h
6046 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h 1970-01-01 01:00:00.000000000 +0100
6047 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h 2006-06-18 12:44:28.000000000 +0200
6049 +/**************************************************************************
6051 + * BRIEF MODULE DESCRIPTION
6052 + * Definitions for DMA controller.
6054 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6056 + * This program is free software; you can redistribute it and/or modify it
6057 + * under the terms of the GNU General Public License as published by the
6058 + * Free Software Foundation; either version 2 of the License, or (at your
6059 + * option) any later version.
6061 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6062 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6063 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6064 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6065 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6066 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6067 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6068 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6069 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6070 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6072 + * You should have received a copy of the GNU General Public License along
6073 + * with this program; if not, write to the Free Software Foundation, Inc.,
6074 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6077 + **************************************************************************
6078 + * May 2004 rkt, neb.
6084 + **************************************************************************
6087 +#ifndef __IDT_DMA_V_H__
6088 +#define __IDT_DMA_V_H__
6090 +#include <asm/idt-boards/rc32434/rc32434_dma.h>
6091 +#include <asm/idt-boards/rc32434/rc32434.h>
6093 +#define DMA_CHAN_OFFSET 0x14
6094 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
6095 +#define DMA_COUNT(count) \
6096 + ((count) & DMAD_count_m)
6098 +#define DMA_HALT_TIMEOUT 500
6101 +static inline int rc32434_halt_dma(DMA_Chan_t ch)
6104 + if (rc32434_readl(&ch->dmac) & DMAC_run_m) {
6105 + rc32434_writel(0, &ch->dmac);
6107 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
6108 + if (rc32434_readl(&ch->dmas) & DMAS_h_m) {
6109 + rc32434_writel(0, &ch->dmas);
6116 + return timeout ? 0 : 1;
6119 +static inline void rc32434_start_dma(DMA_Chan_t ch, u32 dma_addr)
6121 + rc32434_writel(0, &ch->dmandptr);
6122 + rc32434_writel(dma_addr, &ch->dmadptr);
6125 +static inline void rc32434_chain_dma(DMA_Chan_t ch, u32 dma_addr)
6127 + rc32434_writel(dma_addr, &ch->dmandptr);
6130 +#endif // __IDT_DMA_V_H__
6138 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_eth.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_eth.h
6139 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_eth.h 1970-01-01 01:00:00.000000000 +0100
6140 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_eth.h 2006-06-18 12:44:28.000000000 +0200
6142 +/**************************************************************************
6144 + * BRIEF MODULE DESCRIPTION
6145 + * Ethernet register definition
6147 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6149 + * This program is free software; you can redistribute it and/or modify it
6150 + * under the terms of the GNU General Public License as published by the
6151 + * Free Software Foundation; either version 2 of the License, or (at your
6152 + * option) any later version.
6154 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6155 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6156 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6157 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6158 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6159 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6160 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6161 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6162 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6163 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6165 + * You should have received a copy of the GNU General Public License along
6166 + * with this program; if not, write to the Free Software Foundation, Inc.,
6167 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6170 + **************************************************************************
6171 + * May 2004 rkt, neb.
6177 + **************************************************************************
6180 +#ifndef __IDT_ETH_H__
6181 +#define __IDT_ETH_H__
6186 + ETH0_PhysicalAddress = 0x18060000,
6187 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
6189 + ETH0_VirtualAddress = 0xb8060000,
6190 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
6200 + u32 ethu0 [4] ; // Reserved.
6203 + u32 eth_u1 [10] ; // Reserved.
6205 + u32 eth_u2 [42] ; // Reserved.
6220 + u32 eth_u9 [50] ; // Reserved.
6227 + u32 eth_u10 ; // Reserved.
6235 + u32 eth_u11 ; // Reserved.
6236 + u32 eth_u12 ; // Reserved.
6244 + ETHINTFC_en_b = 0,
6245 + ETHINTFC_en_m = 0x00000001,
6246 + ETHINTFC_its_b = 1,
6247 + ETHINTFC_its_m = 0x00000002,
6248 + ETHINTFC_rip_b = 2,
6249 + ETHINTFC_rip_m = 0x00000004,
6250 + ETHINTFC_jam_b = 3,
6251 + ETHINTFC_jam_m = 0x00000008,
6252 + ETHINTFC_ovr_b = 4,
6253 + ETHINTFC_ovr_m = 0x00000010,
6254 + ETHINTFC_und_b = 5,
6255 + ETHINTFC_und_m = 0x00000020,
6257 + ETHFIFOTT_tth_b = 0,
6258 + ETHFIFOTT_tth_m = 0x0000007f,
6261 + ETHARC_pro_m = 0x00000001,
6263 + ETHARC_am_m = 0x00000002,
6265 + ETHARC_afm_m = 0x00000004,
6267 + ETHARC_ab_m = 0x00000008,
6269 + ETHSAL_byte5_b = 0,
6270 + ETHSAL_byte5_m = 0x000000ff,
6271 + ETHSAL_byte4_b = 8,
6272 + ETHSAL_byte4_m = 0x0000ff00,
6273 + ETHSAL_byte3_b = 16,
6274 + ETHSAL_byte3_m = 0x00ff0000,
6275 + ETHSAL_byte2_b = 24,
6276 + ETHSAL_byte2_m = 0xff000000,
6278 + ETHSAH_byte1_b = 0,
6279 + ETHSAH_byte1_m = 0x000000ff,
6280 + ETHSAH_byte0_b = 8,
6281 + ETHSAH_byte0_m = 0x0000ff00,
6284 + ETHGPF_ptv_m = 0x0000ffff,
6287 + ETHPFS_pfd_m = 0x00000001,
6289 + ETHCFSA0_cfsa4_b = 0,
6290 + ETHCFSA0_cfsa4_m = 0x000000ff,
6291 + ETHCFSA0_cfsa5_b = 8,
6292 + ETHCFSA0_cfsa5_m = 0x0000ff00,
6294 + ETHCFSA1_cfsa2_b = 0,
6295 + ETHCFSA1_cfsa2_m = 0x000000ff,
6296 + ETHCFSA1_cfsa3_b = 8,
6297 + ETHCFSA1_cfsa3_m = 0x0000ff00,
6299 + ETHCFSA2_cfsa0_b = 0,
6300 + ETHCFSA2_cfsa0_m = 0x000000ff,
6301 + ETHCFSA2_cfsa1_b = 8,
6302 + ETHCFSA2_cfsa1_m = 0x0000ff00,
6305 + ETHMAC1_re_m = 0x00000001,
6306 + ETHMAC1_paf_b = 1,
6307 + ETHMAC1_paf_m = 0x00000002,
6308 + ETHMAC1_rfc_b = 2,
6309 + ETHMAC1_rfc_m = 0x00000004,
6310 + ETHMAC1_tfc_b = 3,
6311 + ETHMAC1_tfc_m = 0x00000008,
6313 + ETHMAC1_lb_m = 0x00000010,
6314 + ETHMAC1_mr_b = 31,
6315 + ETHMAC1_mr_m = 0x80000000,
6318 + ETHMAC2_fd_m = 0x00000001,
6319 + ETHMAC2_flc_b = 1,
6320 + ETHMAC2_flc_m = 0x00000002,
6321 + ETHMAC2_hfe_b = 2,
6322 + ETHMAC2_hfe_m = 0x00000004,
6324 + ETHMAC2_dc_m = 0x00000008,
6325 + ETHMAC2_cen_b = 4,
6326 + ETHMAC2_cen_m = 0x00000010,
6328 + ETHMAC2_pe_m = 0x00000020,
6329 + ETHMAC2_vpe_b = 6,
6330 + ETHMAC2_vpe_m = 0x00000040,
6331 + ETHMAC2_ape_b = 7,
6332 + ETHMAC2_ape_m = 0x00000080,
6333 + ETHMAC2_ppe_b = 8,
6334 + ETHMAC2_ppe_m = 0x00000100,
6335 + ETHMAC2_lpe_b = 9,
6336 + ETHMAC2_lpe_m = 0x00000200,
6337 + ETHMAC2_nb_b = 12,
6338 + ETHMAC2_nb_m = 0x00001000,
6339 + ETHMAC2_bp_b = 13,
6340 + ETHMAC2_bp_m = 0x00002000,
6341 + ETHMAC2_ed_b = 14,
6342 + ETHMAC2_ed_m = 0x00004000,
6344 + ETHIPGT_ipgt_b = 0,
6345 + ETHIPGT_ipgt_m = 0x0000007f,
6347 + ETHIPGR_ipgr2_b = 0,
6348 + ETHIPGR_ipgr2_m = 0x0000007f,
6349 + ETHIPGR_ipgr1_b = 8,
6350 + ETHIPGR_ipgr1_m = 0x00007f00,
6352 + ETHCLRT_maxret_b = 0,
6353 + ETHCLRT_maxret_m = 0x0000000f,
6354 + ETHCLRT_colwin_b = 8,
6355 + ETHCLRT_colwin_m = 0x00003f00,
6357 + ETHMAXF_maxf_b = 0,
6358 + ETHMAXF_maxf_m = 0x0000ffff,
6360 + ETHMTEST_tb_b = 2,
6361 + ETHMTEST_tb_m = 0x00000004,
6364 + ETHMCP_div_m = 0x000000ff,
6366 + MIIMCFG_rsv_b = 0,
6367 + MIIMCFG_rsv_m = 0x0000000c,
6370 + MIIMCMD_rd_m = 0x00000001,
6371 + MIIMCMD_scn_b = 1,
6372 + MIIMCMD_scn_m = 0x00000002,
6374 + MIIMADDR_regaddr_b = 0,
6375 + MIIMADDR_regaddr_m = 0x0000001f,
6376 + MIIMADDR_phyaddr_b = 8,
6377 + MIIMADDR_phyaddr_m = 0x00001f00,
6379 + MIIMWTD_wdata_b = 0,
6380 + MIIMWTD_wdata_m = 0x0000ffff,
6382 + MIIMRDD_rdata_b = 0,
6383 + MIIMRDD_rdata_m = 0x0000ffff,
6385 + MIIMIND_bsy_b = 0,
6386 + MIIMIND_bsy_m = 0x00000001,
6387 + MIIMIND_scn_b = 1,
6388 + MIIMIND_scn_m = 0x00000002,
6390 + MIIMIND_nv_m = 0x00000004,
6395 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
6400 + ETHRX_fd_m = 0x00000001,
6402 + ETHRX_ld_m = 0x00000002,
6404 + ETHRX_rok_m = 0x00000004,
6406 + ETHRX_fm_m = 0x00000008,
6408 + ETHRX_mp_m = 0x00000010,
6410 + ETHRX_bp_m = 0x00000020,
6412 + ETHRX_vlt_m = 0x00000040,
6414 + ETHRX_cf_m = 0x00000080,
6416 + ETHRX_ovr_m = 0x00000100,
6418 + ETHRX_crc_m = 0x00000200,
6420 + ETHRX_cv_m = 0x00000400,
6422 + ETHRX_db_m = 0x00000800,
6424 + ETHRX_le_m = 0x00001000,
6426 + ETHRX_lor_m = 0x00002000,
6428 + ETHRX_ces_m = 0x00004000,
6429 + ETHRX_length_b = 16,
6430 + ETHRX_length_m = 0xffff0000,
6433 + ETHTX_fd_m = 0x00000001,
6435 + ETHTX_ld_m = 0x00000002,
6437 + ETHTX_oen_m = 0x00000004,
6439 + ETHTX_pen_m = 0x00000008,
6441 + ETHTX_cen_m = 0x00000010,
6443 + ETHTX_hen_m = 0x00000020,
6445 + ETHTX_tok_m = 0x00000040,
6447 + ETHTX_mp_m = 0x00000080,
6449 + ETHTX_bp_m = 0x00000100,
6451 + ETHTX_und_m = 0x00000200,
6453 + ETHTX_of_m = 0x00000400,
6455 + ETHTX_ed_m = 0x00000800,
6457 + ETHTX_ec_m = 0x00001000,
6459 + ETHTX_lc_m = 0x00002000,
6461 + ETHTX_td_m = 0x00004000,
6463 + ETHTX_crc_m = 0x00008000,
6465 + ETHTX_le_m = 0x00010000,
6467 + ETHTX_cc_m = 0x001E0000,
6470 +#endif // __IDT_ETH_H__
6475 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h
6476 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h 1970-01-01 01:00:00.000000000 +0100
6477 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h 2006-06-18 12:44:28.000000000 +0200
6479 +/**************************************************************************
6481 + * BRIEF MODULE DESCRIPTION
6482 + * Ethernet register definition
6484 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6486 + * This program is free software; you can redistribute it and/or modify it
6487 + * under the terms of the GNU General Public License as published by the
6488 + * Free Software Foundation; either version 2 of the License, or (at your
6489 + * option) any later version.
6491 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6492 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6493 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6494 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6495 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6496 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6497 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6498 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6499 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6500 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6502 + * You should have received a copy of the GNU General Public License along
6503 + * with this program; if not, write to the Free Software Foundation, Inc.,
6504 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6507 + **************************************************************************
6508 + * May 2004 rkt, neb.
6514 + **************************************************************************
6517 +#ifndef __IDT_ETH_V_H__
6518 +#define __IDT_ETH_V_H__
6520 +#include <asm/idt-boards/rc32434/rc32434_eth.h>
6522 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
6523 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
6524 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
6525 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
6526 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
6527 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
6528 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
6529 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
6530 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
6531 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
6532 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
6534 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
6536 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
6537 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
6538 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
6539 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
6540 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
6541 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
6542 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
6543 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
6544 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
6545 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
6546 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
6547 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
6548 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
6549 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
6550 +#endif // __IDT_ETH_V_H__
6556 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h
6557 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h 1970-01-01 01:00:00.000000000 +0100
6558 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h 2006-06-18 12:44:28.000000000 +0200
6560 +/**************************************************************************
6562 + * BRIEF MODULE DESCRIPTION
6563 + * GPIO register definition
6565 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6567 + * This program is free software; you can redistribute it and/or modify it
6568 + * under the terms of the GNU General Public License as published by the
6569 + * Free Software Foundation; either version 2 of the License, or (at your
6570 + * option) any later version.
6572 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6573 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6574 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6575 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6576 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6577 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6578 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6579 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6580 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6581 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6583 + * You should have received a copy of the GNU General Public License along
6584 + * with this program; if not, write to the Free Software Foundation, Inc.,
6585 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6588 + **************************************************************************
6589 + * May 2004 rkt, neb.
6595 + **************************************************************************
6598 +#ifndef __IDT_GPIO_H__
6599 +#define __IDT_GPIO_H__
6603 + GPIO0_PhysicalAddress = 0x18050000,
6604 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
6606 + GPIO0_VirtualAddress = 0xb8050000,
6607 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
6612 + u32 gpiofunc; /* GPIO Function Register
6613 + * gpiofunc[x]==0 bit = gpio
6614 + * func[x]==1 bit = altfunc
6616 + u32 gpiocfg; /* GPIO Configuration Register
6617 + * gpiocfg[x]==0 bit = input
6618 + * gpiocfg[x]==1 bit = output
6620 + u32 gpiod; /* GPIO Data Register
6621 + * gpiod[x] read/write gpio pinX status
6623 + u32 gpioilevel; /* GPIO Interrupt Status Register
6624 + * interrupt level (see gpioistat)
6626 + u32 gpioistat; /* Gpio Interrupt Status Register
6627 + * istat[x] = (gpiod[x] == level[x])
6628 + * cleared in ISR (STICKY bits)
6630 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
6631 +} volatile * GPIO_t ;
6635 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
6636 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
6637 + GPIO_input_v = 0, // gpiocfg use pin as input.
6638 + GPIO_output_v = 1, // gpiocfg use pin as output.
6640 + GPIO_pin0_m = 0x00000001,
6642 + GPIO_pin1_m = 0x00000002,
6644 + GPIO_pin2_m = 0x00000004,
6646 + GPIO_pin3_m = 0x00000008,
6648 + GPIO_pin4_m = 0x00000010,
6650 + GPIO_pin5_m = 0x00000020,
6652 + GPIO_pin6_m = 0x00000040,
6654 + GPIO_pin7_m = 0x00000080,
6656 + GPIO_pin8_m = 0x00000100,
6658 + GPIO_pin9_m = 0x00000200,
6659 + GPIO_pin10_b = 10,
6660 + GPIO_pin10_m = 0x00000400,
6661 + GPIO_pin11_b = 11,
6662 + GPIO_pin11_m = 0x00000800,
6663 + GPIO_pin12_b = 12,
6664 + GPIO_pin12_m = 0x00001000,
6665 + GPIO_pin13_b = 13,
6666 + GPIO_pin13_m = 0x00002000,
6668 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
6670 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
6671 + GPIO_u0sout_m = GPIO_pin0_m,
6672 + GPIO_u0sout_cfg_v = GPIO_output_v,
6673 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
6674 + GPIO_u0sinp_m = GPIO_pin1_m,
6675 + GPIO_u0sinp_cfg_v = GPIO_input_v,
6676 + GPIO_u0rtsn_b = GPIO_pin2_b, // UART 0 req. to send.
6677 + GPIO_u0rtsn_m = GPIO_pin2_m,
6678 + GPIO_u0rtsn_cfg_v = GPIO_output_v,
6679 + GPIO_u0ctsn_b = GPIO_pin3_b, // UART 0 clear to send.
6680 + GPIO_u0ctsn_m = GPIO_pin3_m,
6681 + GPIO_u0ctsn_cfg_v = GPIO_input_v,
6683 + GPIO_maddr22_b = GPIO_pin4_b, // M&P bus bit 22.
6684 + GPIO_maddr22_m = GPIO_pin4_m,
6685 + GPIO_maddr22_cfg_v = GPIO_output_v,
6687 + GPIO_maddr23_b = GPIO_pin5_b, // M&P bus bit 23.
6688 + GPIO_maddr23_m = GPIO_pin5_m,
6689 + GPIO_maddr23_cfg_v = GPIO_output_v,
6691 + GPIO_maddr24_b = GPIO_pin6_b, // M&P bus bit 24.
6692 + GPIO_maddr24_m = GPIO_pin6_m,
6693 + GPIO_maddr24_cfg_v = GPIO_output_v,
6695 + GPIO_maddr25_b = GPIO_pin7_b, // M&P bus bit 25.
6696 + GPIO_maddr25_m = GPIO_pin7_m,
6697 + GPIO_maddr25_cfg_v = GPIO_output_v,
6699 + GPIO_cpudmadebug_b = GPIO_pin8_b, // CPU or DMA debug pin
6700 + GPIO_cpudmadebug_m = GPIO_pin8_m,
6701 + GPIO_cpudmadebug_cfg_v = GPIO_output_v,
6703 + GPIO_pcireq4_b = GPIO_pin9_b, // PCI Request 4
6704 + GPIO_pcireq4_m = GPIO_pin9_m,
6705 + GPIO_pcireq4_cfg_v = GPIO_input_v,
6707 + GPIO_pcigrant4_b = GPIO_pin10_b, // PCI Grant 4
6708 + GPIO_pcigrant4_m = GPIO_pin10_m,
6709 + GPIO_pcigrant4_cfg_v = GPIO_output_v,
6711 + GPIO_pcireq5_b = GPIO_pin11_b, // PCI Request 5
6712 + GPIO_pcireq5_m = GPIO_pin11_m,
6713 + GPIO_pcireq5_cfg_v = GPIO_input_v,
6715 + GPIO_pcigrant5_b = GPIO_pin12_b, // PCI Grant 5
6716 + GPIO_pcigrant5_m = GPIO_pin12_m,
6717 + GPIO_pcigrant5_cfg_v = GPIO_output_v,
6719 + GPIO_pcimuintn_b = GPIO_pin13_b, // PCI messaging int.
6720 + GPIO_pcimuintn_m = GPIO_pin13_m,
6721 + GPIO_pcimuintn_cfg_v = GPIO_output_v,
6725 +#endif // __IDT_GPIO_H__
6727 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434.h
6728 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434.h 1970-01-01 01:00:00.000000000 +0100
6729 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434.h 2006-06-18 12:44:28.000000000 +0200
6731 + /**************************************************************************
6733 + * BRIEF MODULE DESCRIPTION
6734 + * Definitions for IDT RC32434 CPU
6736 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6738 + * This program is free software; you can redistribute it and/or modify it
6739 + * under the terms of the GNU General Public License as published by the
6740 + * Free Software Foundation; either version 2 of the License, or (at your
6741 + * option) any later version.
6743 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6744 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6745 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6746 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6747 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6748 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6749 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6750 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6751 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6752 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6754 + * You should have received a copy of the GNU General Public License along
6755 + * with this program; if not, write to the Free Software Foundation, Inc.,
6756 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6759 + **************************************************************************
6760 + * May 2004 rkt, neb.
6766 + **************************************************************************
6769 +#ifndef _RC32434_H_
6770 +#define _RC32434_H_
6772 +#include <linux/config.h>
6773 +#include <linux/delay.h>
6774 +#include <asm/io.h>
6775 +#include <asm/idt-boards/rc32434/rc32434_timer.h>
6777 +#define RC32434_REG_BASE 0x18000000
6780 +#define interrupt ((volatile INT_t ) INT0_VirtualAddress)
6781 +#define idt_timer ((volatile TIM_t) TIM0_VirtualAddress)
6782 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
6784 +#define IDT_CLOCK_MULT 2
6785 +#define MIPS_CPU_TIMER_IRQ 7
6786 +/* Interrupt Controller */
6787 +#define IC_GROUP0_PEND (RC32434_REG_BASE + 0x38000)
6788 +#define IC_GROUP0_MASK (RC32434_REG_BASE + 0x38008)
6789 +#define IC_GROUP_OFFSET 0x0C
6790 +#define RTC_BASE 0xBA001FF0
6792 +#define NUM_INTR_GROUPS 5
6795 +#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
6796 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) /* GRP3 IRQ numbers start here */
6797 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) /* GRP4 IRQ numbers start here */
6798 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) /* GRP5 IRQ numbers start here */
6799 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
6803 +#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58003)
6804 +#define EB434_UART1_BASE (0x19800003)
6808 +#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58000)
6809 +#define EB434_UART1_BASE (0x19800000)
6813 +#define RC32434_UART0_IRQ GROUP3_IRQ_BASE + 0
6814 +#define EB434_UART1_IRQ GROUP4_IRQ_BASE + 11
6816 +#define RC32434_NR_IRQS (GROUP4_IRQ_BASE + 32)
6818 +/* cpu pipeline flush */
6819 +static inline void rc32434_sync(void)
6821 + __asm__ volatile ("sync");
6824 +static inline void rc32434_sync_udelay(int us)
6826 + __asm__ volatile ("sync");
6830 +static inline void rc32434_sync_delay(int ms)
6832 + __asm__ volatile ("sync");
6839 + * Macros to access internal RC32434 registers. No byte
6840 + * swapping should be done when accessing the internal
6844 +#define rc32434_readb __raw_readb
6845 +#define rc32434_readw __raw_readw
6846 +#define rc32434_readl __raw_readl
6848 +#define rc32434_writeb __raw_writeb
6849 +#define rc32434_writew __raw_writew
6850 +#define rc32434_writel __raw_writel
6853 +static inline u8 rc32434_readb(unsigned long pa)
6855 + return *((volatile u8 *)KSEG1ADDR(pa));
6857 +static inline u16 rc32434_readw(unsigned long pa)
6859 + return *((volatile u16 *)KSEG1ADDR(pa));
6861 +static inline u32 rc32434_readl(unsigned long pa)
6863 + return *((volatile u32 *)KSEG1ADDR(pa));
6865 +static inline void rc32434_writeb(u8 val, unsigned long pa)
6867 + *((volatile u8 *)KSEG1ADDR(pa)) = val;
6869 +static inline void rc32434_writew(u16 val, unsigned long pa)
6871 + *((volatile u16 *)KSEG1ADDR(pa)) = val;
6873 +static inline void rc32434_writel(u32 val, unsigned long pa)
6875 + *((volatile u32 *)KSEG1ADDR(pa)) = val;
6882 + * C access to CLZ and CLO instructions
6883 + * (count leading zeroes/ones).
6885 +static inline int rc32434_clz(unsigned long val)
6888 + __asm__ volatile (
6889 + ".set\tnoreorder\n\t"
6891 + ".set\tmips32\n\t"
6901 +static inline int rc32434_clo(unsigned long val)
6904 + __asm__ volatile (
6905 + ".set\tnoreorder\n\t"
6907 + ".set\tmips32\n\t"
6917 +#endif /* _RC32434_H_ */
6930 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_integ.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_integ.h
6931 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_integ.h 1970-01-01 01:00:00.000000000 +0100
6932 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_integ.h 2006-06-18 12:44:28.000000000 +0200
6934 +/**************************************************************************
6936 + * BRIEF MODULE DESCRIPTION
6937 + * System Integrity register definition
6939 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6941 + * This program is free software; you can redistribute it and/or modify it
6942 + * under the terms of the GNU General Public License as published by the
6943 + * Free Software Foundation; either version 2 of the License, or (at your
6944 + * option) any later version.
6946 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6947 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6948 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6949 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6950 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6951 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6952 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6953 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6954 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6955 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6957 + * You should have received a copy of the GNU General Public License along
6958 + * with this program; if not, write to the Free Software Foundation, Inc.,
6959 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6962 + **************************************************************************
6963 + * May 2004 rkt, neb
6969 + **************************************************************************
6972 +#ifndef __IDT_INTEG_H__
6973 +#define __IDT_INTEG_H__
6977 + INTEG0_PhysicalAddress = 0x18030000,
6978 + INTEG_PhysicalAddress = INTEG0_PhysicalAddress, // Default
6980 + INTEG0_VirtualAddress = 0xB8030000,
6981 + INTEG_VirtualAddress = INTEG0_VirtualAddress, // Default
6984 +// if you are looking for CEA, try rst.h
6987 + u32 filler [0xc] ; // 0x30 bytes unused.
6988 + u32 errcs ; // sticky use ERRCS_
6989 + u32 wtcount ; // Watchdog timer count reg.
6990 + u32 wtcompare ; // Watchdog timer timeout value.
6991 + u32 wtc ; // Watchdog timer control. use WTC_
6992 +} volatile *INTEG_t ;
6996 + ERRCS_wto_b = 0, // In INTEG_t -> errcs
6997 + ERRCS_wto_m = 0x00000001,
6998 + ERRCS_wne_b = 1, // In INTEG_t -> errcs
6999 + ERRCS_wne_m = 0x00000002,
7000 + ERRCS_ucw_b = 2, // In INTEG_t -> errcs
7001 + ERRCS_ucw_m = 0x00000004,
7002 + ERRCS_ucr_b = 3, // In INTEG_t -> errcs
7003 + ERRCS_ucr_m = 0x00000008,
7004 + ERRCS_upw_b = 4, // In INTEG_t -> errcs
7005 + ERRCS_upw_m = 0x00000010,
7006 + ERRCS_upr_b = 5, // In INTEG_t -> errcs
7007 + ERRCS_upr_m = 0x00000020,
7008 + ERRCS_udw_b = 6, // In INTEG_t -> errcs
7009 + ERRCS_udw_m = 0x00000040,
7010 + ERRCS_udr_b = 7, // In INTEG_t -> errcs
7011 + ERRCS_udr_m = 0x00000080,
7012 + ERRCS_sae_b = 8, // In INTEG_t -> errcs
7013 + ERRCS_sae_m = 0x00000100,
7014 + ERRCS_wre_b = 9, // In INTEG_t -> errcs
7015 + ERRCS_wre_m = 0x00000200,
7017 + WTC_en_b = 0, // In INTEG_t -> wtc
7018 + WTC_en_m = 0x00000001,
7019 + WTC_to_b = 1, // In INTEG_t -> wtc
7020 + WTC_to_m = 0x00000002,
7023 +#endif // __IDT_INTEG_H__
7024 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_int.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_int.h
7025 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_int.h 1970-01-01 01:00:00.000000000 +0100
7026 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_int.h 2006-06-18 12:44:28.000000000 +0200
7028 +/**************************************************************************
7030 + * BRIEF MODULE DESCRIPTION
7031 + * Interrupt Controller register definition.
7033 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7035 + * This program is free software; you can redistribute it and/or modify it
7036 + * under the terms of the GNU General Public License as published by the
7037 + * Free Software Foundation; either version 2 of the License, or (at your
7038 + * option) any later version.
7040 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7041 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7042 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7043 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7044 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7045 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7046 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7047 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7048 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7049 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7051 + * You should have received a copy of the GNU General Public License along
7052 + * with this program; if not, write to the Free Software Foundation, Inc.,
7053 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7056 + **************************************************************************
7057 + * May 2004 rkt, neb.
7063 + **************************************************************************
7066 +#ifndef __IDT_INT_H__
7067 +#define __IDT_INT_H__
7071 + INT0_PhysicalAddress = 0x18038000,
7072 + INT_PhysicalAddress = INT0_PhysicalAddress, // Default
7074 + INT0_VirtualAddress = 0xB8038000,
7075 + INT_VirtualAddress = INT0_VirtualAddress, // Default
7080 + u32 ipend ; //Pending interrupts. use INT?_
7081 + u32 itest ; //Test bits. use INT?_
7082 + u32 imask ; //Interrupt disabled when set. use INT?_
7087 + IPEND2 = 0, // HW 2 interrupt to core. use INT2_
7088 + IPEND3 = 1, // HW 3 interrupt to core. use INT3_
7089 + IPEND4 = 2, // HW 4 interrupt to core. use INT4_
7090 + IPEND5 = 3, // HW 5 interrupt to core. use INT5_
7091 + IPEND6 = 4, // HW 6 interrupt to core. use INT6_
7093 + IPEND_count, // must be last (used in loops)
7094 + IPEND_min = IPEND2 // min IPEND (used in loops)
7097 +typedef struct INTC_s
7099 + struct INT_s i [IPEND_count] ;// use i[IPEND?] = INT?_
7100 + u32 nmips ; // use NMIPS_
7101 +} volatile *INT_t ;
7105 + INT2_timer0_b = 0,
7106 + INT2_timer0_m = 0x00000001,
7107 + INT2_timer1_b = 1,
7108 + INT2_timer1_m = 0x00000002,
7109 + INT2_timer2_b = 2,
7110 + INT2_timer2_m = 0x00000004,
7111 + INT2_refresh_b = 3,
7112 + INT2_refresh_m = 0x00000008,
7113 + INT2_watchdogTimeout_b = 4,
7114 + INT2_watchdogTimeout_m = 0x00000010,
7115 + INT2_undecodedCpuWrite_b = 5,
7116 + INT2_undecodedCpuWrite_m = 0x00000020,
7117 + INT2_undecodedCpuRead_b = 6,
7118 + INT2_undecodedCpuRead_m = 0x00000040,
7119 + INT2_undecodedPciWrite_b = 7,
7120 + INT2_undecodedPciWrite_m = 0x00000080,
7121 + INT2_undecodedPciRead_b = 8,
7122 + INT2_undecodedPciRead_m = 0x00000100,
7123 + INT2_undecodedDmaWrite_b = 9,
7124 + INT2_undecodedDmaWrite_m = 0x00000200,
7125 + INT2_undecodedDmaRead_b = 10,
7126 + INT2_undecodedDmaRead_m = 0x00000400,
7127 + INT2_ipBusSlaveAckError_b = 11,
7128 + INT2_ipBusSlaveAckError_m = 0x00000800,
7130 + INT3_dmaChannel0_b = 0,
7131 + INT3_dmaChannel0_m = 0x00000001,
7132 + INT3_dmaChannel1_b = 1,
7133 + INT3_dmaChannel1_m = 0x00000002,
7134 + INT3_dmaChannel2_b = 2,
7135 + INT3_dmaChannel2_m = 0x00000004,
7136 + INT3_dmaChannel3_b = 3,
7137 + INT3_dmaChannel3_m = 0x00000008,
7138 + INT3_dmaChannel4_b = 4,
7139 + INT3_dmaChannel4_m = 0x00000010,
7140 + INT3_dmaChannel5_b = 5,
7141 + INT3_dmaChannel5_m = 0x00000020,
7143 + INT5_uartGeneral0_b = 0,
7144 + INT5_uartGeneral0_m = 0x00000001,
7145 + INT5_uartTxrdy0_b = 1,
7146 + INT5_uartTxrdy0_m = 0x00000002,
7147 + INT5_uartRxrdy0_b = 2,
7148 + INT5_uartRxrdy0_m = 0x00000004,
7150 + INT5_pci_m = 0x00000008,
7151 + INT5_pciDecoupled_b = 4,
7152 + INT5_pciDecoupled_m = 0x00000010,
7154 + INT5_spi_m = 0x00000020,
7155 + INT5_deviceDecoupled_b = 6,
7156 + INT5_deviceDecoupled_m = 0x00000040,
7157 + INT5_eth0Ovr_b = 9,
7158 + INT5_eth0Ovr_m = 0x00000200,
7159 + INT5_eth0Und_b = 10,
7160 + INT5_eth0Und_m = 0x00000400,
7161 + INT5_eth0Pfd_b = 11,
7162 + INT5_eth0Pfd_m = 0x00000800,
7163 + INT5_nvram_b = 12,
7164 + INT5_nvram_m = 0x00001000,
7167 + INT6_gpio0_m = 0x00000001,
7169 + INT6_gpio1_m = 0x00000002,
7171 + INT6_gpio2_m = 0x00000004,
7173 + INT6_gpio3_m = 0x00000008,
7175 + INT6_gpio4_m = 0x00000010,
7177 + INT6_gpio5_m = 0x00000020,
7179 + INT6_gpio6_m = 0x00000040,
7181 + INT6_gpio7_m = 0x00000080,
7183 + INT6_gpio8_m = 0x00000100,
7185 + INT6_gpio9_m = 0x00000200,
7186 + INT6_gpio10_b = 10,
7187 + INT6_gpio10_m = 0x00000400,
7188 + INT6_gpio11_b = 11,
7189 + INT6_gpio11_m = 0x00000800,
7190 + INT6_gpio12_b = 12,
7191 + INT6_gpio12_m = 0x00001000,
7192 + INT6_gpio13_b = 13,
7193 + INT6_gpio13_m = 0x00002000,
7196 + NMIPS_gpio_m = 0x00000001,
7199 +#endif // __IDT_INT_H__
7202 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h
7203 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h 1970-01-01 01:00:00.000000000 +0100
7204 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h 2006-06-18 12:44:28.000000000 +0200
7206 +/**************************************************************************
7208 + * BRIEF MODULE DESCRIPTION
7209 + * IP Arbiter register definitions
7211 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7213 + * This program is free software; you can redistribute it and/or modify it
7214 + * under the terms of the GNU General Public License as published by the
7215 + * Free Software Foundation; either version 2 of the License, or (at your
7216 + * option) any later version.
7218 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7219 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7220 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7221 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7222 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7223 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7224 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7225 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7226 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7227 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7229 + * You should have received a copy of the GNU General Public License along
7230 + * with this program; if not, write to the Free Software Foundation, Inc.,
7231 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7234 + **************************************************************************
7235 + * May 2004 rkt,neb
7241 + **************************************************************************
7244 +#ifndef __IDT_IPARB_H__
7245 +#define __IDT_IPARB_H__
7249 + IPARB0_PhysicalAddress = 0x18048000,
7250 + IPARB_PhysicalAddress = IPARB0_PhysicalAddress, // Default
7252 + IPARB0_VirtualAddress = 0xB8048000,
7253 + IPARB_VirtualAddress = IPARB0_VirtualAddress, // Default
7258 + IPABMXC_ethernet0Receive = 0,
7259 + IPABMXC_ethernet0Transmit = 1,
7260 + IPABMXC_memoryToHoldFifo = 2,
7261 + IPABMXC_holdFifoToMemory = 3,
7262 + IPABMXC_pciToMemory = 4,
7263 + IPABMXC_memoryToPci = 5,
7264 + IPABMXC_pciTarget = 6,
7265 + IPABMXC_pciTargetStart = 7,
7266 + IPABMXC_cpuToIpBus = 8,
7268 + IPABMXC_Count, // Must be last in list !
7269 + IPABMXC_Min = IPABMXC_ethernet0Receive,
7271 + IPAPXC_PriorityCount = 4, // 3-highest, 0-lowest.
7276 + u32 ipapc [IPAPXC_PriorityCount] ; // ipapc[IPAPXC_] = IPAPC_
7277 + u32 ipabmc [IPABMXC_Count] ; // ipabmc[IPABMXC_] = IPABMC_
7278 + u32 ipac ; // use IPAC_
7279 + u32 ipaitcc; // use IPAITCC_
7281 +} volatile * IPARB_t ;
7286 + IPAC_dp_m = 0x00000001,
7288 + IPAC_dep_m = 0x00000002,
7290 + IPAC_drm_m = 0x00000004,
7292 + IPAC_dwm_m = 0x00000008,
7294 + IPAC_msk_m = 0x00000010,
7297 + IPAPC_ptc_m = 0x00003fff,
7299 + IPAPC_mf_m = 0x00004000,
7300 + IPAPC_cptc_b = 16,
7301 + IPAPC_cptc_m = 0x3fff0000,
7304 + IPAITCC_itcc, = 0x000001ff,
7307 + IPABMC_mtc_m = 0x00000fff,
7309 + IPABMC_p_m = 0x00003000,
7310 + IPABMC_msk_b = 14,
7311 + IPABMC_msk_m = 0x00004000,
7312 + IPABMC_cmtc_b = 16,
7313 + IPABMC_cmtc_m = 0x0fff0000,
7316 +#endif // __IDT_IPARB_H__
7317 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_pci.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_pci.h
7318 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_pci.h 1970-01-01 01:00:00.000000000 +0100
7319 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_pci.h 2006-06-18 12:44:28.000000000 +0200
7321 +/**************************************************************************
7323 + * BRIEF MODULE DESCRIPTION
7324 + * PCI register definitio
7326 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7328 + * This program is free software; you can redistribute it and/or modify it
7329 + * under the terms of the GNU General Public License as published by the
7330 + * Free Software Foundation; either version 2 of the License, or (at your
7331 + * option) any later version.
7333 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7334 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7335 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7336 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7337 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7338 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7339 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7340 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7341 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7342 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7344 + * You should have received a copy of the GNU General Public License along
7345 + * with this program; if not, write to the Free Software Foundation, Inc.,
7346 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7349 + **************************************************************************
7350 + * May 2004 rkt, neb.
7356 + **************************************************************************
7359 +#ifndef __IDT_PCI_H__
7360 +#define __IDT_PCI_H__
7364 + PCI0_PhysicalAddress = 0x18080000,
7365 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
7367 + PCI0_VirtualAddress = 0xB8080000,
7368 + PCI_VirtualAddress = PCI0_VirtualAddress,
7373 + PCI_LbaCount = 4, // Local base addresses.
7378 + u32 a ; // Address.
7379 + u32 c ; // Control.
7380 + u32 m ; // mapping.
7390 + PCI_Map_s pcilba [PCI_LbaCount] ;
7398 +} volatile *PCI_t ;
7400 +// PCI messaging unit.
7407 + u32 pciim [PCIM_Count] ;
7408 + u32 pciom [PCIM_Count] ;
7415 +} volatile *PCIM_t ;
7417 +/*******************************************************************************
7419 + * PCI Control Register
7421 + ******************************************************************************/
7425 + PCIC_en_m = 0x00000001,
7427 + PCIC_tnr_m = 0x00000002,
7429 + PCIC_sce_m = 0x00000004,
7431 + PCIC_ien_m = 0x00000008,
7433 + PCIC_aaa_m = 0x00000010,
7435 + PCIC_eap_m = 0x00000020,
7437 + PCIC_pcim_m = 0x000001c0,
7438 + PCIC_pcim_disabled_v = 0,
7439 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
7440 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
7441 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
7442 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
7443 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
7444 + PCIC_pcim_reserved6_v = 6,
7445 + PCIC_pcim_reserved7_v = 7,
7447 + PCIC_igm_m = 0x00000200,
7450 +/*******************************************************************************
7452 + * PCI Status Register
7454 + ******************************************************************************/
7457 + PCIS_eed_m = 0x00000001,
7459 + PCIS_wr_m = 0x00000002,
7461 + PCIS_nmi_m = 0x00000004,
7463 + PCIS_ii_m = 0x00000008,
7465 + PCIS_cwe_m = 0x00000010,
7467 + PCIS_cre_m = 0x00000020,
7469 + PCIS_mdpe_m = 0x00000040,
7471 + PCIS_sta_m = 0x00000080,
7473 + PCIS_rta_m = 0x00000100,
7475 + PCIS_rma_m = 0x00000200,
7477 + PCIS_sse_m = 0x00000400,
7479 + PCIS_ose_m = 0x00000800,
7481 + PCIS_pe_m = 0x00001000,
7483 + PCIS_tae_m = 0x00002000,
7485 + PCIS_rle_m = 0x00004000,
7487 + PCIS_bme_m = 0x00008000,
7489 + PCIS_prd_m = 0x00010000,
7491 + PCIS_rip_m = 0x00020000,
7494 +/*******************************************************************************
7496 + * PCI Status Mask Register
7498 + ******************************************************************************/
7501 + PCISM_eed_m = 0x00000001,
7503 + PCISM_wr_m = 0x00000002,
7505 + PCISM_nmi_m = 0x00000004,
7507 + PCISM_ii_m = 0x00000008,
7509 + PCISM_cwe_m = 0x00000010,
7511 + PCISM_cre_m = 0x00000020,
7513 + PCISM_mdpe_m = 0x00000040,
7515 + PCISM_sta_m = 0x00000080,
7517 + PCISM_rta_m = 0x00000100,
7519 + PCISM_rma_m = 0x00000200,
7521 + PCISM_sse_m = 0x00000400,
7523 + PCISM_ose_m = 0x00000800,
7525 + PCISM_pe_m = 0x00001000,
7527 + PCISM_tae_m = 0x00002000,
7529 + PCISM_rle_m = 0x00004000,
7531 + PCISM_bme_m = 0x00008000,
7533 + PCISM_prd_m = 0x00010000,
7535 + PCISM_rip_m = 0x00020000,
7538 +/*******************************************************************************
7540 + * PCI Configuration Address Register
7542 + ******************************************************************************/
7544 + PCICFGA_reg_b = 2,
7545 + PCICFGA_reg_m = 0x000000fc,
7546 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
7547 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
7548 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
7549 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
7550 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
7551 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
7552 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
7553 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
7554 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
7555 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
7556 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
7557 + PCICFGA_reg_pba0m_v = 0x48>>2,
7558 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
7559 + PCICFGA_reg_pba1m_v = 0x50>>2,
7560 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
7561 + PCICFGA_reg_pba2m_v = 0x58>>2,
7562 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
7563 + PCICFGA_reg_pba3m_v = 0x60>>2,
7564 + PCICFGA_reg_pmgt_v = 0x64>>2,
7565 + PCICFGA_func_b = 8,
7566 + PCICFGA_func_m = 0x00000700,
7567 + PCICFGA_dev_b = 11,
7568 + PCICFGA_dev_m = 0x0000f800,
7569 + PCICFGA_dev_internal_v = 0,
7570 + PCICFGA_bus_b = 16,
7571 + PCICFGA_bus_m = 0x00ff0000,
7572 + PCICFGA_bus_type0_v = 0, //local bus
7573 + PCICFGA_en_b = 31, // read only
7574 + PCICFGA_en_m = 0x80000000,
7578 + PCFGID_vendor_b = 0,
7579 + PCFGID_vendor_m = 0x0000ffff,
7580 + PCFGID_vendor_IDT_v = 0x111d,
7581 + PCFGID_device_b = 16,
7582 + PCFGID_device_m = 0xffff0000,
7583 + PCFGID_device_Korinade_v = 0x0214,
7585 + PCFG04_command_ioena_b = 1,
7586 + PCFG04_command_ioena_m = 0x00000001,
7587 + PCFG04_command_memena_b = 2,
7588 + PCFG04_command_memena_m = 0x00000002,
7589 + PCFG04_command_bmena_b = 3,
7590 + PCFG04_command_bmena_m = 0x00000004,
7591 + PCFG04_command_mwinv_b = 5,
7592 + PCFG04_command_mwinv_m = 0x00000010,
7593 + PCFG04_command_parena_b = 7,
7594 + PCFG04_command_parena_m = 0x00000040,
7595 + PCFG04_command_serrena_b = 9,
7596 + PCFG04_command_serrena_m = 0x00000100,
7597 + PCFG04_command_fastbbena_b = 10,
7598 + PCFG04_command_fastbbena_m = 0x00000200,
7599 + PCFG04_status_b = 16,
7600 + PCFG04_status_m = 0xffff0000,
7601 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
7602 + PCFG04_status_66MHz_m = 0x00200000,
7603 + PCFG04_status_fbb_b = 23,
7604 + PCFG04_status_fbb_m = 0x00800000,
7605 + PCFG04_status_mdpe_b = 24,
7606 + PCFG04_status_mdpe_m = 0x01000000,
7607 + PCFG04_status_dst_b = 25,
7608 + PCFG04_status_dst_m = 0x06000000,
7609 + PCFG04_status_sta_b = 27,
7610 + PCFG04_status_sta_m = 0x08000000,
7611 + PCFG04_status_rta_b = 28,
7612 + PCFG04_status_rta_m = 0x10000000,
7613 + PCFG04_status_rma_b = 29,
7614 + PCFG04_status_rma_m = 0x20000000,
7615 + PCFG04_status_sse_b = 30,
7616 + PCFG04_status_sse_m = 0x40000000,
7617 + PCFG04_status_pe_b = 31,
7618 + PCFG04_status_pe_m = 0x40000000,
7620 + PCFG08_revId_b = 0,
7621 + PCFG08_revId_m = 0x000000ff,
7622 + PCFG08_classCode_b = 0,
7623 + PCFG08_classCode_m = 0xffffff00,
7624 + PCFG08_classCode_bridge_v = 06,
7625 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
7626 + PCFG0C_cacheline_b = 0,
7627 + PCFG0C_cacheline_m = 0x000000ff,
7628 + PCFG0C_masterLatency_b = 8,
7629 + PCFG0C_masterLatency_m = 0x0000ff00,
7630 + PCFG0C_headerType_b = 16,
7631 + PCFG0C_headerType_m = 0x00ff0000,
7632 + PCFG0C_bist_b = 24,
7633 + PCFG0C_bist_m = 0xff000000,
7636 + PCIPBA_msi_m = 0x00000001,
7638 + PCIPBA_p_m = 0x00000004,
7639 + PCIPBA_baddr_b = 8,
7640 + PCIPBA_baddr_m = 0xffffff00,
7642 + PCFGSS_vendorId_b = 0,
7643 + PCFGSS_vendorId_m = 0x0000ffff,
7645 + PCFGSS_id_m = 0xffff0000,
7647 + PCFG3C_interruptLine_b = 0,
7648 + PCFG3C_interruptLine_m = 0x000000ff,
7649 + PCFG3C_interruptPin_b = 8,
7650 + PCFG3C_interruptPin_m = 0x0000ff00,
7651 + PCFG3C_minGrant_b = 16,
7652 + PCFG3C_minGrant_m = 0x00ff0000,
7653 + PCFG3C_maxLat_b = 24,
7654 + PCFG3C_maxLat_m = 0xff000000,
7656 + PCIPBAC_msi_b = 0,
7657 + PCIPBAC_msi_m = 0x00000001,
7659 + PCIPBAC_p_m = 0x00000002,
7660 + PCIPBAC_size_b = 2,
7661 + PCIPBAC_size_m = 0x0000007c,
7663 + PCIPBAC_sb_m = 0x00000080,
7665 + PCIPBAC_pp_m = 0x00000100,
7667 + PCIPBAC_mr_m = 0x00000600,
7668 + PCIPBAC_mr_read_v =0, //no prefetching
7669 + PCIPBAC_mr_readLine_v =1,
7670 + PCIPBAC_mr_readMult_v =2,
7671 + PCIPBAC_mrl_b = 11,
7672 + PCIPBAC_mrl_m = 0x00000800,
7673 + PCIPBAC_mrm_b = 12,
7674 + PCIPBAC_mrm_m = 0x00001000,
7675 + PCIPBAC_trp_b = 13,
7676 + PCIPBAC_trp_m = 0x00002000,
7678 + PCFG40_trdyTimeout_b = 0,
7679 + PCFG40_trdyTimeout_m = 0x000000ff,
7680 + PCFG40_retryLim_b = 8,
7681 + PCFG40_retryLim_m = 0x0000ff00,
7684 +/*******************************************************************************
7686 + * PCI Local Base Address [0|1|2|3] Register
7688 + ******************************************************************************/
7690 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
7691 + PCILBA_baddr_m = 0xffffff00,
7693 +/*******************************************************************************
7695 + * PCI Local Base Address Control Register
7697 + ******************************************************************************/
7699 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
7700 + PCILBAC_msi_m = 0x00000001,
7701 + PCILBAC_msi_mem_v = 0,
7702 + PCILBAC_msi_io_v = 1,
7703 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
7704 + PCILBAC_size_m = 0x0000007c,
7705 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
7706 + PCILBAC_sb_m = 0x00000080,
7707 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
7708 + PCILBAC_rt_m = 0x00000100,
7709 + PCILBAC_rt_noprefetch_v = 0, // mem read
7710 + PCILBAC_rt_prefetch_v = 1, // mem readline
7713 +/*******************************************************************************
7715 + * PCI Local Base Address [0|1|2|3] Mapping Register
7717 + ******************************************************************************/
7719 + PCILBAM_maddr_b = 8,
7720 + PCILBAM_maddr_m = 0xffffff00,
7723 +/*******************************************************************************
7725 + * PCI Decoupled Access Control Register
7727 + ******************************************************************************/
7730 + PCIDAC_den_m = 0x00000001,
7733 +/*******************************************************************************
7735 + * PCI Decoupled Access Status Register
7737 + ******************************************************************************/
7740 + PCIDAS_d_m = 0x00000001,
7742 + PCIDAS_b_m = 0x00000002,
7744 + PCIDAS_e_m = 0x00000004,
7746 + PCIDAS_ofe_m = 0x00000008,
7748 + PCIDAS_off_m = 0x00000010,
7750 + PCIDAS_ife_m = 0x00000020,
7752 + PCIDAS_iff_m = 0x00000040,
7755 +/*******************************************************************************
7757 + * PCI DMA Channel 8 Configuration Register
7759 + ******************************************************************************/
7762 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
7763 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
7764 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
7765 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
7768 +/*******************************************************************************
7770 + * PCI DMA Channel 9 Configuration Register
7772 + ******************************************************************************/
7775 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
7776 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
7779 +/*******************************************************************************
7781 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
7783 + ******************************************************************************/
7785 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
7786 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
7787 + // These are for reads (DMA channel 8)
7788 + PCIDMAD_devcmd_mr_v = 0, //memory read
7789 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
7790 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
7791 + PCIDMAD_devcmd_ior_v = 3, //I/O read
7792 + // These are for writes (DMA channel 9)
7793 + PCIDMAD_devcmd_mw_v = 0, //memory write
7794 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
7795 + PCIDMAD_devcmd_iow_v = 3, //I/O write
7797 + // Swap byte field applies to both DMA channel 8 and 9
7798 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
7799 + PCIDMAD_sb_m = 0x01000000, // swap byte field
7803 +/*******************************************************************************
7805 + * PCI Target Control Register
7807 + ******************************************************************************/
7810 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
7811 + PCITC_rtimer_m = 0x000000ff,
7812 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
7813 + PCITC_dtimer_m = 0x0000ff00,
7814 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
7815 + PCITC_rdr_m = 0x00040000,
7816 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
7817 + PCITC_ddt_m = 0x00080000,
7819 +/*******************************************************************************
7821 + * PCI messaging unit [applies to both inbound and outbound registers ]
7823 + ******************************************************************************/
7826 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7827 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
7828 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7829 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
7830 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7831 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
7839 +#define PCI_MSG_VirtualAddress 0xB8088010
7840 +#define rc32434_pci ((volatile PCI_t) PCI0_VirtualAddress)
7841 +#define rc32434_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
7843 +#define PCIM_SHFT 0x6
7844 +#define PCIM_BIT_LEN 0x7
7845 +#define PCIM_H_EA 0x3
7846 +#define PCIM_H_IA_FIX 0x4
7847 +#define PCIM_H_IA_RR 0x5
7849 +#define PCI_ADDR_START 0x13000000
7852 +#define PCI_ADDR_START 0x50000000
7854 +#define CPUTOPCI_MEM_WIN 0x02000000
7855 +#define CPUTOPCI_IO_WIN 0x00100000
7856 +#define PCILBA_SIZE_SHFT 2
7857 +#define PCILBA_SIZE_MASK 0x1F
7858 +#define SIZE_256MB 0x1C
7859 +#define SIZE_128MB 0x1B
7860 +#define SIZE_64MB 0x1A
7861 +#define SIZE_32MB 0x19
7862 +#define SIZE_16MB 0x18
7863 +#define SIZE_4MB 0x16
7864 +#define SIZE_2MB 0x15
7865 +#define SIZE_1MB 0x14
7866 +#define KORINA_CONFIG0_ADDR 0x80000000
7867 +#define KORINA_CONFIG1_ADDR 0x80000004
7868 +#define KORINA_CONFIG2_ADDR 0x80000008
7869 +#define KORINA_CONFIG3_ADDR 0x8000000C
7870 +#define KORINA_CONFIG4_ADDR 0x80000010
7871 +#define KORINA_CONFIG5_ADDR 0x80000014
7872 +#define KORINA_CONFIG6_ADDR 0x80000018
7873 +#define KORINA_CONFIG7_ADDR 0x8000001C
7874 +#define KORINA_CONFIG8_ADDR 0x80000020
7875 +#define KORINA_CONFIG9_ADDR 0x80000024
7876 +#define KORINA_CONFIG10_ADDR 0x80000028
7877 +#define KORINA_CONFIG11_ADDR 0x8000002C
7878 +#define KORINA_CONFIG12_ADDR 0x80000030
7879 +#define KORINA_CONFIG13_ADDR 0x80000034
7880 +#define KORINA_CONFIG14_ADDR 0x80000038
7881 +#define KORINA_CONFIG15_ADDR 0x8000003C
7882 +#define KORINA_CONFIG16_ADDR 0x80000040
7883 +#define KORINA_CONFIG17_ADDR 0x80000044
7884 +#define KORINA_CONFIG18_ADDR 0x80000048
7885 +#define KORINA_CONFIG19_ADDR 0x8000004C
7886 +#define KORINA_CONFIG20_ADDR 0x80000050
7887 +#define KORINA_CONFIG21_ADDR 0x80000054
7888 +#define KORINA_CONFIG22_ADDR 0x80000058
7889 +#define KORINA_CONFIG23_ADDR 0x8000005C
7890 +#define KORINA_CONFIG24_ADDR 0x80000060
7891 +#define KORINA_CONFIG25_ADDR 0x80000064
7892 +#define KORINA_CMD (PCFG04_command_ioena_m | \
7893 + PCFG04_command_memena_m | \
7894 + PCFG04_command_bmena_m | \
7895 + PCFG04_command_mwinv_m | \
7896 + PCFG04_command_parena_m | \
7897 + PCFG04_command_serrena_m )
7899 +#define KORINA_STAT (PCFG04_status_mdpe_m | \
7900 + PCFG04_status_sta_m | \
7901 + PCFG04_status_rta_m | \
7902 + PCFG04_status_rma_m | \
7903 + PCFG04_status_sse_m | \
7904 + PCFG04_status_pe_m)
7906 +#define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
7908 +#define KORINA_REVID 0
7909 +#define KORINA_CLASS_CODE 0
7910 +#define KORINA_CNFG2 ((KORINA_CLASS_CODE<<8) | \
7913 +#define KORINA_CACHE_LINE_SIZE 4
7914 +#define KORINA_MASTER_LAT 0x3c
7915 +#define KORINA_HEADER_TYPE 0
7916 +#define KORINA_BIST 0
7918 +#define KORINA_CNFG3 ((KORINA_BIST << 24) | \
7919 + (KORINA_HEADER_TYPE<<16) | \
7920 + (KORINA_MASTER_LAT<<8) | \
7921 + KORINA_CACHE_LINE_SIZE )
7923 +#define KORINA_BAR0 0x00000008 /* 128 MB Memory */
7924 +#define KORINA_BAR1 0x18800001 /* 1 MB IO */
7925 +#define KORINA_BAR2 0x18000001 /* 2 MB IO window for Korina
7926 + internal Registers */
7927 +#define KORINA_BAR3 0x48000008 /* Spare 128 MB Memory */
7929 +#define KORINA_CNFG4 KORINA_BAR0
7930 +#define KORINA_CNFG5 KORINA_BAR1
7931 +#define KORINA_CNFG6 KORINA_BAR2
7932 +#define KORINA_CNFG7 KORINA_BAR3
7934 +#define KORINA_SUBSYS_VENDOR_ID 0x011d
7935 +#define KORINA_SUBSYSTEM_ID 0x0214
7936 +#define KORINA_CNFG8 0
7937 +#define KORINA_CNFG9 0
7938 +#define KORINA_CNFG10 0
7939 +#define KORINA_CNFG11 ((KORINA_SUBSYS_VENDOR_ID<<16) | \
7940 + KORINA_SUBSYSTEM_ID)
7941 +#define KORINA_INT_LINE 1
7942 +#define KORINA_INT_PIN 1
7943 +#define KORINA_MIN_GNT 8
7944 +#define KORINA_MAX_LAT 0x38
7945 +#define KORINA_CNFG12 0
7946 +#define KORINA_CNFG13 0
7947 +#define KORINA_CNFG14 0
7948 +#define KORINA_CNFG15 ((KORINA_MAX_LAT<<24) | \
7949 + (KORINA_MIN_GNT<<16) | \
7950 + (KORINA_INT_PIN<<8) | \
7952 +#define KORINA_RETRY_LIMIT 0x80
7953 +#define KORINA_TRDY_LIMIT 0x80
7954 +#define KORINA_CNFG16 ((KORINA_RETRY_LIMIT<<8) | \
7955 + KORINA_TRDY_LIMIT)
7956 +#define PCI_PBAxC_R 0x0
7957 +#define PCI_PBAxC_RL 0x1
7958 +#define PCI_PBAxC_RM 0x2
7959 +#define SIZE_SHFT 2
7961 +#if defined(__MIPSEB__)
7962 +#define KORINA_PBA0C ( PCIPBAC_mrl_m | PCIPBAC_sb_m | \
7963 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
7965 + (SIZE_128MB<<SIZE_SHFT) | \
7968 +#define KORINA_PBA0C ( PCIPBAC_mrl_m | \
7969 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
7971 + (SIZE_128MB<<SIZE_SHFT) | \
7974 +#define KORINA_CNFG17 KORINA_PBA0C
7975 +#define KORINA_PBA0M 0x0
7976 +#define KORINA_CNFG18 KORINA_PBA0M
7978 +#if defined(__MIPSEB__)
7979 +#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
7982 +#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | \
7985 +#define KORINA_CNFG19 KORINA_PBA1C
7986 +#define KORINA_PBA1M 0x0
7987 +#define KORINA_CNFG20 KORINA_PBA1M
7989 +#if defined(__MIPSEB__)
7990 +#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
7993 +#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | \
7996 +#define KORINA_CNFG21 KORINA_PBA2C
7997 +#define KORINA_PBA2M 0x18000000
7998 +#define KORINA_CNFG22 KORINA_PBA2M
7999 +#define KORINA_PBA3C 0
8000 +#define KORINA_CNFG23 KORINA_PBA3C
8001 +#define KORINA_PBA3M 0
8002 +#define KORINA_CNFG24 KORINA_PBA3M
8006 +#define PCITC_DTIMER_VAL 8
8007 +#define PCITC_RTIMER_VAL 0x10
8012 +#endif // __IDT_PCI_H__
8016 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_rst.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_rst.h
8017 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_rst.h 1970-01-01 01:00:00.000000000 +0100
8018 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_rst.h 2006-06-18 12:44:28.000000000 +0200
8020 +/**************************************************************************
8022 + * BRIEF MODULE DESCRIPTION
8023 + * Reset register definitions.
8025 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8027 + * This program is free software; you can redistribute it and/or modify it
8028 + * under the terms of the GNU General Public License as published by the
8029 + * Free Software Foundation; either version 2 of the License, or (at your
8030 + * option) any later version.
8032 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8033 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8034 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8035 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8036 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8037 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8038 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8039 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8040 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8041 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8043 + * You should have received a copy of the GNU General Public License along
8044 + * with this program; if not, write to the Free Software Foundation, Inc.,
8045 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8048 + **************************************************************************
8049 + * May 2004 rkt, neb.
8055 + **************************************************************************
8058 +#ifndef __IDT_RST_H__
8059 +#define __IDT_RST_H__
8063 + RST0_PhysicalAddress = 0x18000000,
8064 + RST_PhysicalAddress = RST0_PhysicalAddress, // Default
8066 + RST0_VirtualAddress = 0xb8000000,
8067 + RST_VirtualAddress = RST0_VirtualAddress, // Default
8070 +typedef struct RST_s
8072 + u32 filler [0x0006] ;
8074 + u32 filler2 [0x2000-8] ; // Pad out to offset 0x8000
8078 +} volatile * RST_t ;
8083 + SYSID_rev_m = 0x000000ff,
8085 + SYSID_imp_m = 0x000fff00,
8086 + SYSID_vendor_b = 8,
8087 + SYSID_vendor_m = 0xfff00000,
8090 + BCV_pll_m = 0x0000000f,
8091 + BCV_pll_PLLBypass_v = 0x0, // PCLK=1*CLK.
8092 + BCV_pll_Mul3_v = 0x1, // PCLK=3*CLK.
8093 + BCV_pll_Mul4_v = 0x2, // PCLK=4*CLK.
8094 + BCV_pll_SlowMul5_v = 0x3, // PCLK=5*CLK.
8095 + BCV_pll_Mul5_v = 0x4, // PCLK=5*CLK.
8096 + BCV_pll_SlowMul6_v = 0x5, // PCLK=6*CLK.
8097 + BCV_pll_Mul6_v = 0x6, // PCLK=6*CLK.
8098 + BCV_pll_Mul8_v = 0x7, // PCLK=8*CLK.
8099 + BCV_pll_Mul10_v = 0x8, // PCLK=10*CLK.
8100 + BCV_pll_Res9_v = 0x9,
8101 + BCV_pll_Res10_v = 0xa,
8102 + BCV_pll_Res11_v = 0xb,
8103 + BCV_pll_Res12_v = 0xc,
8104 + BCV_pll_Res13_v = 0xd,
8105 + BCV_pll_Res14_v = 0xe,
8106 + BCV_pll_Res15_v = 0xf,
8108 + BCV_clkDiv_m = 0x00000030,
8109 + BCV_clkDiv_Div1_v = 0x0,
8110 + BCV_clkDiv_Div2_v = 0x1,
8111 + BCV_clkDiv_Div4_v = 0x2,
8112 + BCV_clkDiv_Res3_v = 0x3,
8113 + BCV_bigEndian_b = 6,
8114 + BCV_bigEndian_m = 0x00000040,
8115 + BCV_resetFast_b = 7,
8116 + BCV_resetFast_m = 0x00000080,
8117 + BCV_pciMode_b = 8,
8118 + BCV_pciMode_m = 0x00000700,
8119 + BCV_pciMode_disabled_v = 0, // PCI is disabled.
8120 + BCV_pciMode_tnr_v = 1, // satellite Target Not Ready.
8121 + BCV_pciMode_suspended_v = 2, // satellite with suspended CPU.
8122 + BCV_pciMode_external_v = 3, // host, external arbiter.
8123 + BCV_pciMode_fixed_v = 4, // host, fixed priority arbiter.
8124 + BCV_pciMode_roundRobin_v= 5, // host, round robin arbiter.
8125 + BCV_pciMode_res6_v = 6,
8126 + BCV_pciMode_res7_v = 7,
8127 + BCV_watchDisable_b = 11,
8128 + BCV_watchDisable_m = 0x00000800,
8130 + BCV_res12_m = 0x00001000,
8132 + BCV_res13_m = 0x00002000,
8134 + BCV_res14_m = 0x00004000,
8136 + BCV_res15_m = 0x00008000,
8138 +#endif // __IDT_RST_H__
8139 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_spi.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_spi.h
8140 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_spi.h 1970-01-01 01:00:00.000000000 +0100
8141 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_spi.h 2006-06-18 12:44:28.000000000 +0200
8143 +/**************************************************************************
8145 + * BRIEF MODULE DESCRIPTION
8146 + * Serial Peripheral Interface register definitions.
8148 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8150 + * This program is free software; you can redistribute it and/or modify it
8151 + * under the terms of the GNU General Public License as published by the
8152 + * Free Software Foundation; either version 2 of the License, or (at your
8153 + * option) any later version.
8155 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8156 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8157 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8158 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8159 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8160 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8161 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8162 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8163 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8164 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8166 + * You should have received a copy of the GNU General Public License along
8167 + * with this program; if not, write to the Free Software Foundation, Inc.,
8168 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8171 + **************************************************************************
8172 + * May 2004 rkt, neb.
8178 + **************************************************************************
8181 +#ifndef __IDT_SPI_H__
8182 +#define __IDT_SPI_H__
8186 + SPI0_PhysicalAddress = 0x18070000,
8187 + SPI_PhysicalAddress = SPI0_PhysicalAddress,
8189 + SPI0_VirtualAddress = 0xB8070000,
8190 + SPI_VirtualAddress = SPI0_VirtualAddress,
8195 + u32 spcp ; // prescalar. 0=off, * spiClk = sysClk/(2*(spcp+1)*SPR)
8196 + u32 spc ; // spi control reg use SPC_
8197 + u32 sps ; // spi status reg use SPS_
8198 + u32 spd ; // spi data reg use SPD_
8199 + u32 siofunc ; // serial IO function use SIOFUNC_
8200 + u32 siocfg ; // serial IO config use SIOCFG_
8201 + u32 siod; // serial IO data use SIOD_
8202 +} volatile *SPI_t ;
8207 + SPCP_div_m = 0x000000ff,
8209 + SPC_spr_m = 0x00000003,
8210 + SPC_spr_div2_v = 0,
8211 + SPC_spr_div4_v = 1,
8212 + SPC_spr_div16_v = 2,
8213 + SPC_spr_div32_v = 3,
8215 + SPC_cpha_m = 0x00000004,
8217 + SPC_cpol_m = 0x00000008,
8219 + SPC_mstr_m = 0x00000010,
8221 + SPC_spe_m = 0x00000040,
8223 + SPC_spie_m = 0x00000080,
8226 + SPS_modf_m = 0x00000010,
8228 + SPS_wcol_m = 0x00000040,
8230 + SPS_spif_m = 0x00000070,
8233 + SPD_data_m = 0x000000ff,
8235 + SIOFUNC_sdo_b = 0,
8236 + SIOFUNC_sdo_m = 0x00000001,
8237 + SIOFUNC_sdi_b = 1,
8238 + SIOFUNC_sdi_m = 0x00000002,
8239 + SIOFUNC_sck_b = 2,
8240 + SIOFUNC_sck_m = 0x00000004,
8241 + SIOFUNC_pci_b = 3,
8242 + SIOFUNC_pci_m = 0x00000008,
8245 + SIOCFG_sdo_m = 0x00000001,
8247 + SIOCFG_sdi_m = 0x00000002,
8249 + SIOCFG_sck_m = 0x00000004,
8251 + SIOCFG_pci_m = 0x00000008,
8254 + SIOD_sdo_m = 0x00000001,
8256 + SIOD_sdi_m = 0x00000002,
8258 + SIOD_sck_m = 0x00000004,
8260 + SIOD_pci_m = 0x00000008,
8262 +#endif // __IDT_SPI_H__
8263 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_timer.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_timer.h
8264 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_timer.h 1970-01-01 01:00:00.000000000 +0100
8265 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_timer.h 2006-06-18 12:44:28.000000000 +0200
8267 +/**************************************************************************
8269 + * BRIEF MODULE DESCRIPTION
8270 + * Definitions for timer registers
8272 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8274 + * This program is free software; you can redistribute it and/or modify it
8275 + * under the terms of the GNU General Public License as published by the
8276 + * Free Software Foundation; either version 2 of the License, or (at your
8277 + * option) any later version.
8279 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8280 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8281 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8282 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8283 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8284 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8285 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8286 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8287 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8288 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8290 + * You should have received a copy of the GNU General Public License along
8291 + * with this program; if not, write to the Free Software Foundation, Inc.,
8292 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8295 + **************************************************************************
8296 + * May 2004 rkt,neb.
8302 + **************************************************************************
8305 +#ifndef __IDT_TIM_H__
8306 +#define __IDT_TIM_H__
8310 + TIM0_PhysicalAddress = 0x18028000,
8311 + TIM_PhysicalAddress = TIM0_PhysicalAddress, // Default
8313 + TIM0_VirtualAddress = 0xb8028000,
8314 + TIM_VirtualAddress = TIM0_VirtualAddress, // Default
8326 + u32 ctc ; //use CTC_
8329 +typedef struct TIM_s
8331 + struct TIM_CNTR_s tim [TIM_Count] ;
8332 + u32 rcount ; //use RCOUNT_
8333 + u32 rcompare ; //use RCOMPARE_
8334 + u32 rtc ; //use RTC_
8335 +} volatile * TIM_t ;
8340 + CTC_en_m = 0x00000001,
8342 + CTC_to_m = 0x00000002,
8344 + RCOUNT_count_b = 0,
8345 + RCOUNT_count_m = 0x0000ffff,
8346 + RCOMPARE_compare_b = 0,
8347 + RCOMPARE_compare_m = 0x0000ffff,
8349 + RTC_ce_m = 0x00000001,
8351 + RTC_to_m = 0x00000002,
8353 + RTC_rqe_m = 0x00000004,
8356 +#endif // __IDT_TIM_H__
8358 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_uart.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_uart.h
8359 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_uart.h 1970-01-01 01:00:00.000000000 +0100
8360 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_uart.h 2006-06-18 12:44:28.000000000 +0200
8362 +/**************************************************************************
8364 + * BRIEF MODULE DESCRIPTION
8365 + * UART register definitions
8367 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8369 + * This program is free software; you can redistribute it and/or modify it
8370 + * under the terms of the GNU General Public License as published by the
8371 + * Free Software Foundation; either version 2 of the License, or (at your
8372 + * option) any later version.
8374 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8375 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8376 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8377 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8378 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8379 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8380 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8381 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8382 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8383 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8385 + * You should have received a copy of the GNU General Public License along
8386 + * with this program; if not, write to the Free Software Foundation, Inc.,
8387 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8390 + **************************************************************************
8391 + * May 2004 rkt, neb.
8397 + **************************************************************************
8400 +#ifndef __IDT_UART_H__
8401 +#define __IDT_UART_H__
8405 + UART0_PhysicalAddress = 0x1c000000,
8406 + UART_PhysicalAddress = UART0_PhysicalAddress, // Default
8408 + UART0_VirtualAddress = 0xbc000000,
8409 + UART_VirtualAddress = UART0_VirtualAddress, // Default
8413 + * Register definitions are in bytes so we can handle endian problems.
8416 +typedef struct UART_s
8420 + u32 const uartrb ; // 0x00 - DLAB=0, read.
8421 + u32 uartth ; // 0x00 - DLAB=0, write.
8422 + u32 uartdll ; // 0x00 - DLAB=1, read/write.
8427 + u32 uartie ; // 0x04 - DLAB=0, read/write.
8428 + u32 uartdlh ; // 0x04 - DLAB=1, read/write.
8432 + u32 const uartii ; // 0x08 - DLAB=0, read.
8433 + u32 uartfc ; // 0x08 - DLAB=0, write.
8436 + u32 uartlc ; // 0x0c
8437 + u32 uartmc ; // 0x10
8438 + u32 uartls ; // 0x14
8439 + u32 uartms ; // 0x18
8440 + u32 uarts ; // 0x1c
8441 +} volatile *UART_t ;
8443 +// Reset registers.
8444 +typedef u32 volatile *UARTRR_t ;
8449 + UARTIE_rda_m = 0x00000001,
8451 + UARTIE_the_m = 0x00000002,
8453 + UARTIE_rls_m = 0x00000004,
8455 + UARTIE_ems_m = 0x00000008,
8458 + UARTII_pi_m = 0x00000001,
8460 + UARTII_iid_m = 0x0000000e,
8461 + UARTII_iid_ms_v = 0, // Modem stat-CTS,DSR,RI or DCD.
8462 + UARTII_iid_thre_v = 1, // Trans. Holding Reg. empty.
8463 + UARTII_iid_rda_v = 2, // Receive data available
8464 + UARTII_iid_rls_v = 3, // Overrun, parity, etc, error.
8465 + UARTII_iid_res4_v = 4, // reserved.
8466 + UARTII_iid_res5_v = 5, // reserved.
8467 + UARTII_iid_cto_v = 6, // Character timeout.
8468 + UARTII_iid_res7_v = 7, // reserved.
8471 + UARTFC_en_m = 0x00000001,
8473 + UARTFC_rr_m = 0x00000002,
8475 + UARTFC_tr_m = 0x00000004,
8477 + UARTFC_dms_m = 0x00000008,
8479 + UARTFC_rt_m = 0x000000c0,
8480 + UARTFC_rt_1Byte_v = 0,
8481 + UARTFC_rt_4Byte_v = 1,
8482 + UARTFC_rt_8Byte_v = 2,
8483 + UARTFC_rt_14Byte_v = 3,
8486 + UARTLC_wls_m = 0x00000003,
8487 + UARTLC_wls_5Bits_v = 0,
8488 + UARTLC_wls_6Bits_v = 1,
8489 + UARTLC_wls_7Bits_v = 2,
8490 + UARTLC_wls_8Bits_v = 3,
8492 + UARTLC_stb_m = 0x00000004,
8494 + UARTLC_pen_m = 0x00000008,
8496 + UARTLC_eps_m = 0x00000010,
8498 + UARTLC_sp_m = 0x00000020,
8500 + UARTLC_sb_m = 0x00000040,
8501 + UARTLC_dlab_b = 7,
8502 + UARTLC_dlab_m = 0x00000080,
8505 + UARTMC_dtr_m = 0x00000001,
8507 + UARTMC_rts_m = 0x00000002,
8509 + UARTMC_o1_m = 0x00000004,
8511 + UARTMC_o2_m = 0x00000008,
8513 + UARTMC_lp_m = 0x00000010,
8516 + UARTLS_dr_m = 0x00000001,
8518 + UARTLS_oe_m = 0x00000002,
8520 + UARTLS_pe_m = 0x00000004,
8522 + UARTLS_fe_m = 0x00000008,
8524 + UARTLS_bi_m = 0x00000010,
8526 + UARTLS_thr_m = 0x00000020,
8528 + UARTLS_te_m = 0x00000040,
8530 + UARTLS_rfe_m = 0x00000080,
8532 + UARTMS_dcts_b = 0,
8533 + UARTMS_dcts_m = 0x00000001,
8534 + UARTMS_ddsr_b = 1,
8535 + UARTMS_ddsr_m = 0x00000002,
8536 + UARTMS_teri_b = 2,
8537 + UARTMS_teri_m = 0x00000004,
8538 + UARTMS_ddcd_b = 3,
8539 + UARTMS_ddcd_m = 0x00000008,
8541 + UARTMS_cts_m = 0x00000010,
8543 + UARTMS_dsr_m = 0x00000020,
8545 + UARTMS_ri_m = 0x00000040,
8547 + UARTMS_dcd_m = 0x00000080,
8550 +#endif // __IDT_UART_H__
8551 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_dma.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_dma.h
8552 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_dma.h 1970-01-01 01:00:00.000000000 +0100
8553 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_dma.h 2006-06-18 12:44:28.000000000 +0200
8555 +/**************************************************************************
8557 + * BRIEF MODULE DESCRIPTION
8558 + * Register definitions for IDT RC32438 DMA.
8560 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8562 + * This program is free software; you can redistribute it and/or modify it
8563 + * under the terms of the GNU General Public License as published by the
8564 + * Free Software Foundation; either version 2 of the License, or (at your
8565 + * option) any later version.
8567 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8568 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8569 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8570 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8571 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8572 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8573 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8574 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8575 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8576 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8578 + * You should have received a copy of the GNU General Public License along
8579 + * with this program; if not, write to the Free Software Foundation, Inc.,
8580 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8583 + **************************************************************************
8584 + * May 2004 P. Sadik.
8590 + **************************************************************************
8592 +#ifndef __IDT_RC32438_DMA_H__
8593 +#define __IDT_RC32438_DMA_H__
8596 + DMA0_PhysicalAddress = 0x18040000,
8597 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
8599 + DMA0_VirtualAddress = 0xb8040000,
8600 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
8604 + * DMA descriptor (in physical memory).
8607 +typedef struct DMAD_s
8609 + u32 control ; // Control. use DMAD_*
8610 + u32 ca ; // Current Address.
8611 + u32 devcs ; // Device control and status.
8612 + u32 link ; // Next descriptor in chain.
8613 +} volatile *DMAD_t ;
8617 + DMAD_size = sizeof (struct DMAD_s),
8618 + DMAD_count_b = 0, // in DMAD_t -> control
8619 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
8620 + DMAD_ds_b = 20, // in DMAD_t -> control
8621 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
8622 + DMAD_ds_extToMem0_v = 0,
8623 + DMAD_ds_memToExt0_v = 1,
8624 + DMAD_ds_extToMem1_v = 0,
8625 + DMAD_ds_memToExt1_v = 1,
8626 + DMAD_ds_ethRcv0_v = 0,
8627 + DMAD_ds_ethXmt0_v = 0,
8628 + DMAD_ds_ethRcv1_v = 0,
8629 + DMAD_ds_ethXmt2_v = 0,
8630 + DMAD_ds_memToFifo_v = 0,
8631 + DMAD_ds_fifoToMem_v = 0,
8632 + DMAD_ds_rng_de_v = 1,//randomNumberGenerator on LC/DE
8633 + DMAD_ds_pciToMem_v = 0,
8634 + DMAD_ds_memToPci_v = 0,
8635 + DMAD_ds_securityInput_v = 0,
8636 + DMAD_ds_securityOutput_v = 0,
8637 + DMAD_ds_rng_se_v = 0,//randomNumberGenerator on SE
8639 + DMAD_devcmd_b = 22, // in DMAD_t -> control
8640 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
8641 + DMAD_devcmd_byte_v = 0, //memory-to-memory
8642 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
8643 + DMAD_devcmd_word_v = 2, //memory-to-memory
8644 + DMAD_devcmd_2words_v = 3, //memory-to-memory
8645 + DMAD_devcmd_4words_v = 4, //memory-to-memory
8646 + DMAD_devcmd_6words_v = 5, //memory-to-memory
8647 + DMAD_devcmd_8words_v = 6, //memory-to-memory
8648 + DMAD_devcmd_16words_v = 7, //memory-to-memory
8649 + DMAD_cof_b = 25, // chain on finished
8650 + DMAD_cof_m = 0x02000000, //
8651 + DMAD_cod_b = 26, // chain on done
8652 + DMAD_cod_m = 0x04000000, //
8653 + DMAD_iof_b = 27, // interrupt on finished
8654 + DMAD_iof_m = 0x08000000, //
8655 + DMAD_iod_b = 28, // interrupt on done
8656 + DMAD_iod_m = 0x10000000, //
8657 + DMAD_t_b = 29, // terminated
8658 + DMAD_t_m = 0x20000000, //
8659 + DMAD_d_b = 30, // done
8660 + DMAD_d_m = 0x40000000, //
8661 + DMAD_f_b = 31, // finished
8662 + DMAD_f_m = 0x80000000, //
8666 + * DMA register (within Internal Register Map).
8671 + u32 dmac ; // Control.
8672 + u32 dmas ; // Status.
8673 + u32 dmasm ; // Mask.
8674 + u32 dmadptr ; // Descriptor pointer.
8675 + u32 dmandptr ; // Next descriptor pointer.
8678 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
8680 +//DMA_Channels use DMACH_count instead
8684 + DMAC_run_b = 0, //
8685 + DMAC_run_m = 0x00000001, //
8686 + DMAC_dm_b = 1, // done mask
8687 + DMAC_dm_m = 0x00000002, //
8688 + DMAC_mode_b = 2, //
8689 + DMAC_mode_m = 0x0000000c, //
8690 + DMAC_mode_auto_v = 0,
8691 + DMAC_mode_burst_v = 1,
8692 + DMAC_mode_transfer_v = 2, //usually used
8693 + DMAC_mode_reserved_v = 3,
8695 + DMAC_a_m = 0x00000010, //
8697 + DMAS_f_b = 0, // finished (sticky)
8698 + DMAS_f_m = 0x00000001, //
8699 + DMAS_d_b = 1, // done (sticky)
8700 + DMAS_d_m = 0x00000002, //
8701 + DMAS_c_b = 2, // chain (sticky)
8702 + DMAS_c_m = 0x00000004, //
8703 + DMAS_e_b = 3, // error (sticky)
8704 + DMAS_e_m = 0x00000008, //
8705 + DMAS_h_b = 4, // halt (sticky)
8706 + DMAS_h_m = 0x00000010, //
8708 + DMASM_f_b = 0, // finished (1=mask)
8709 + DMASM_f_m = 0x00000001, //
8710 + DMASM_d_b = 1, // done (1=mask)
8711 + DMASM_d_m = 0x00000002, //
8712 + DMASM_c_b = 2, // chain (1=mask)
8713 + DMASM_c_m = 0x00000004, //
8714 + DMASM_e_b = 3, // error (1=mask)
8715 + DMASM_e_m = 0x00000008, //
8716 + DMASM_h_b = 4, // halt (1=mask)
8717 + DMASM_h_m = 0x00000010, //
8721 + * DMA channel definitions
8726 + DMACH_extToMem0 = 0,
8727 + DMACH_memToExt0 = 0,
8728 + DMACH_extToMem1 = 1,
8729 + DMACH_memToExt1 = 1,
8730 + DMACH_ethRcv0 = 2,
8731 + DMACH_ethXmt0 = 3,
8732 + DMACH_ethRcv1 = 4,
8733 + DMACH_ethXmt2 = 5,
8734 + DMACH_memToFifo = 6,
8735 + DMACH_fifoToMem = 7,
8736 + DMACH_rng_de = 7,//randomNumberGenerator on LC/DE
8737 + DMACH_pciToMem = 8,
8738 + DMACH_memToPci = 9,
8739 + DMACH_securityInput = 10,
8740 + DMACH_securityOutput = 11,
8741 + DMACH_rng_se = 12, //randomNumberGenerator on SE
8743 + DMACH_count //must be last
8747 +typedef struct DMAC_s
8749 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
8750 +} volatile *DMA_t ;
8754 + * External DMA parameters
8759 + DMADEVCMD_ts_b = 0, // ts field in devcmd
8760 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
8761 + DMADEVCMD_ts_byte_v = 0,
8762 + DMADEVCMD_ts_halfword_v = 1,
8763 + DMADEVCMD_ts_word_v = 2,
8764 + DMADEVCMD_ts_2word_v = 3,
8765 + DMADEVCMD_ts_4word_v = 4,
8766 + DMADEVCMD_ts_6word_v = 5,
8767 + DMADEVCMD_ts_8word_v = 6,
8768 + DMADEVCMD_ts_16word_v = 7
8772 +#if 1 // aws - Compatibility.
8773 +# define EXTDMA_ts_b DMADEVCMD_ts_b
8774 +# define EXTDMA_ts_m DMADEVCMD_ts_m
8775 +# define EXTDMA_ts_byte_v DMADEVCMD_ts_byte_v
8776 +# define EXTDMA_ts_halfword_v DMADEVCMD_ts_halfword_v
8777 +# define EXTDMA_ts_word_v DMADEVCMD_ts_word_v
8778 +# define EXTDMA_ts_2word_v DMADEVCMD_ts_2word_v
8779 +# define EXTDMA_ts_4word_v DMADEVCMD_ts_4word_v
8780 +# define EXTDMA_ts_6word_v DMADEVCMD_ts_6word_v
8781 +# define EXTDMA_ts_8word_v DMADEVCMD_ts_8word_v
8782 +# define EXTDMA_ts_16word_v DMADEVCMD_ts_16word_v
8783 +#endif // aws - Compatibility.
8785 +#endif //__IDT_RC32438_DMA_H__
8786 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h
8787 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h 1970-01-01 01:00:00.000000000 +0100
8788 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h 2006-06-18 12:44:28.000000000 +0200
8790 +/**************************************************************************
8792 + * BRIEF MODULE DESCRIPTION
8793 + * DMA operations for IDT RC32438.
8795 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8797 + * This program is free software; you can redistribute it and/or modify it
8798 + * under the terms of the GNU General Public License as published by the
8799 + * Free Software Foundation; either version 2 of the License, or (at your
8800 + * option) any later version.
8802 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8803 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8804 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8805 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8806 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8807 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8808 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8809 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8810 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8811 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8813 + * You should have received a copy of the GNU General Public License along
8814 + * with this program; if not, write to the Free Software Foundation, Inc.,
8815 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8818 + **************************************************************************
8819 + * May 2004 P. Sadik.
8825 + **************************************************************************
8828 +#ifndef __IDT_RC32438_DMA_V_H__
8829 +#define __IDT_RC32438_DMA_V_H__
8830 +#include <asm/idt-boards/rc32438/rc32438_dma.h>
8832 +#define DMA_CHAN_OFFSET 0x14
8833 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
8834 +#define DMA_COUNT(count) \
8835 + ((count) & DMAD_count_m)
8837 +#define DMA_HALT_TIMEOUT 500
8840 +static inline int rc32438_halt_dma(DMA_Chan_t ch)
8843 + if (rc32438_readl(&ch->dmac) & DMAC_run_m) {
8844 + rc32438_writel(0, &ch->dmac);
8846 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
8847 + if (rc32438_readl(&ch->dmas) & DMAS_h_m) {
8848 + rc32438_writel(0, &ch->dmas);
8855 + return timeout ? 0 : 1;
8861 +static inline void rc32438_start_dma(DMA_Chan_t ch, u32 dma_addr)
8863 + rc32438_writel(0, &ch->dmandptr);
8864 + rc32438_writel(dma_addr, &ch->dmadptr);
8867 +static inline void rc32438_chain_dma(DMA_Chan_t ch, u32 dma_addr)
8869 + rc32438_writel(dma_addr, &ch->dmandptr);
8871 +#endif //__IDT_RC32438_DMA_V_H__
8872 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_eth.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_eth.h
8873 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_eth.h 1970-01-01 01:00:00.000000000 +0100
8874 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_eth.h 2006-06-18 12:44:28.000000000 +0200
8876 +/**************************************************************************
8878 + * BRIEF MODULE DESCRIPTION
8879 + * Definitions for IDT EB438 ethernet
8881 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8883 + * This program is free software; you can redistribute it and/or modify it
8884 + * under the terms of the GNU General Public License as published by the
8885 + * Free Software Foundation; either version 2 of the License, or (at your
8886 + * option) any later version.
8888 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8889 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8890 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8891 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8892 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8893 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8894 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8895 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8896 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8897 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8899 + * You should have received a copy of the GNU General Public License along
8900 + * with this program; if not, write to the Free Software Foundation, Inc.,
8901 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8904 + **************************************************************************
8905 + * May 2004 P. Sadik.
8911 + **************************************************************************
8914 +#ifndef __IDT_RC32438_ETH_H__
8915 +#define __IDT_RC32438_ETH_H__
8918 + ETH0_PhysicalAddress = 0x18058000,
8919 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
8921 + ETH0_VirtualAddress = 0xb8058000,
8922 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
8923 + ETH1_PhysicalAddress = 0x18060000,
8924 + ETH1_VirtualAddress = 0xb8060000, // Default
8934 + u32 ethu0 [4] ; // Reserved.
8937 + u32 eth_u1 [10] ; // Reserved.
8939 + u32 eth_u2 [42] ; // Reserved.
8954 + u32 eth_u9 [50] ; // Reserved.
8961 + u32 eth_u10 ; // Reserved.
8969 + u32 eth_u11 ; // Reserved.
8970 + u32 eth_u12 ; // Reserved.
8978 + ETHINTFC_en_b = 0,
8979 + ETHINTFC_en_m = 0x00000001,
8980 + ETHINTFC_its_b = 1,
8981 + ETHINTFC_its_m = 0x00000002,
8982 + ETHINTFC_rip_b = 2,
8983 + ETHINTFC_rip_m = 0x00000004,
8984 + ETHINTFC_jam_b = 3,
8985 + ETHINTFC_jam_m = 0x00000008,
8986 + ETHINTFC_ovr_b = 4,
8987 + ETHINTFC_ovr_m = 0x00000010,
8988 + ETHINTFC_und_b = 5,
8989 + ETHINTFC_und_m = 0x00000020,
8991 + ETHFIFOTT_tth_b = 0,
8992 + ETHFIFOTT_tth_m = 0x0000007f,
8995 + ETHARC_pro_m = 0x00000001,
8997 + ETHARC_am_m = 0x00000002,
8999 + ETHARC_afm_m = 0x00000004,
9001 + ETHARC_ab_m = 0x00000008,
9003 + ETHSAL_byte5_b = 0,
9004 + ETHSAL_byte5_m = 0x000000ff,
9005 + ETHSAL_byte4_b = 8,
9006 + ETHSAL_byte4_m = 0x0000ff00,
9007 + ETHSAL_byte3_b = 16,
9008 + ETHSAL_byte3_m = 0x00ff0000,
9009 + ETHSAL_byte2_b = 24,
9010 + ETHSAL_byte2_m = 0xff000000,
9012 + ETHSAH_byte1_b = 0,
9013 + ETHSAH_byte1_m = 0x000000ff,
9014 + ETHSAH_byte0_b = 8,
9015 + ETHSAH_byte0_m = 0x0000ff00,
9018 + ETHGPF_ptv_m = 0x0000ffff,
9021 + ETHPFS_pfd_m = 0x00000001,
9023 + ETHCFSA0_cfsa4_b = 0,
9024 + ETHCFSA0_cfsa4_m = 0x000000ff,
9025 + ETHCFSA0_cfsa5_b = 8,
9026 + ETHCFSA0_cfsa5_m = 0x0000ff00,
9028 + ETHCFSA1_cfsa2_b = 0,
9029 + ETHCFSA1_cfsa2_m = 0x000000ff,
9030 + ETHCFSA1_cfsa3_b = 8,
9031 + ETHCFSA1_cfsa3_m = 0x0000ff00,
9033 + ETHCFSA2_cfsa0_b = 0,
9034 + ETHCFSA2_cfsa0_m = 0x000000ff,
9035 + ETHCFSA2_cfsa1_b = 8,
9036 + ETHCFSA2_cfsa1_m = 0x0000ff00,
9039 + ETHMAC1_re_m = 0x00000001,
9040 + ETHMAC1_paf_b = 1,
9041 + ETHMAC1_paf_m = 0x00000002,
9042 + ETHMAC1_rfc_b = 2,
9043 + ETHMAC1_rfc_m = 0x00000004,
9044 + ETHMAC1_tfc_b = 3,
9045 + ETHMAC1_tfc_m = 0x00000008,
9047 + ETHMAC1_lb_m = 0x00000010,
9048 + ETHMAC1_mr_b = 31,
9049 + ETHMAC1_mr_m = 0x80000000,
9052 + ETHMAC2_fd_m = 0x00000001,
9053 + ETHMAC2_flc_b = 1,
9054 + ETHMAC2_flc_m = 0x00000002,
9055 + ETHMAC2_hfe_b = 2,
9056 + ETHMAC2_hfe_m = 0x00000004,
9058 + ETHMAC2_dc_m = 0x00000008,
9059 + ETHMAC2_cen_b = 4,
9060 + ETHMAC2_cen_m = 0x00000010,
9062 + ETHMAC2_pe_m = 0x00000020,
9063 + ETHMAC2_vpe_b = 6,
9064 + ETHMAC2_vpe_m = 0x00000040,
9065 + ETHMAC2_ape_b = 7,
9066 + ETHMAC2_ape_m = 0x00000080,
9067 + ETHMAC2_ppe_b = 8,
9068 + ETHMAC2_ppe_m = 0x00000100,
9069 + ETHMAC2_lpe_b = 9,
9070 + ETHMAC2_lpe_m = 0x00000200,
9071 + ETHMAC2_nb_b = 12,
9072 + ETHMAC2_nb_m = 0x00001000,
9073 + ETHMAC2_bp_b = 13,
9074 + ETHMAC2_bp_m = 0x00002000,
9075 + ETHMAC2_ed_b = 14,
9076 + ETHMAC2_ed_m = 0x00004000,
9078 + ETHIPGT_ipgt_b = 0,
9079 + ETHIPGT_ipgt_m = 0x0000007f,
9081 + ETHIPGR_ipgr2_b = 0,
9082 + ETHIPGR_ipgr2_m = 0x0000007f,
9083 + ETHIPGR_ipgr1_b = 8,
9084 + ETHIPGR_ipgr1_m = 0x00007f00,
9086 + ETHCLRT_maxret_b = 0,
9087 + ETHCLRT_maxret_m = 0x0000000f,
9088 + ETHCLRT_colwin_b = 8,
9089 + ETHCLRT_colwin_m = 0x00003f00,
9091 + ETHMAXF_maxf_b = 0,
9092 + ETHMAXF_maxf_m = 0x0000ffff,
9094 + ETHMTEST_tb_b = 2,
9095 + ETHMTEST_tb_m = 0x00000004,
9098 + ETHMCP_div_m = 0x000000ff,
9100 + MIIMCFG_rsv_b = 0,
9101 + MIIMCFG_rsv_m = 0x0000000c,
9104 + MIIMCMD_rd_m = 0x00000001,
9105 + MIIMCMD_scn_b = 1,
9106 + MIIMCMD_scn_m = 0x00000002,
9108 + MIIMADDR_regaddr_b = 0,
9109 + MIIMADDR_regaddr_m = 0x0000001f,
9110 + MIIMADDR_phyaddr_b = 8,
9111 + MIIMADDR_phyaddr_m = 0x00001f00,
9113 + MIIMWTD_wdata_b = 0,
9114 + MIIMWTD_wdata_m = 0x0000ffff,
9116 + MIIMRDD_rdata_b = 0,
9117 + MIIMRDD_rdata_m = 0x0000ffff,
9119 + MIIMIND_bsy_b = 0,
9120 + MIIMIND_bsy_m = 0x00000001,
9121 + MIIMIND_scn_b = 1,
9122 + MIIMIND_scn_m = 0x00000002,
9124 + MIIMIND_nv_m = 0x00000004,
9129 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
9134 + ETHRX_fd_m = 0x00000001,
9136 + ETHRX_ld_m = 0x00000002,
9138 + ETHRX_rok_m = 0x00000004,
9140 + ETHRX_fm_m = 0x00000008,
9142 + ETHRX_mp_m = 0x00000010,
9144 + ETHRX_bp_m = 0x00000020,
9146 + ETHRX_vlt_m = 0x00000040,
9148 + ETHRX_cf_m = 0x00000080,
9150 + ETHRX_ovr_m = 0x00000100,
9152 + ETHRX_crc_m = 0x00000200,
9154 + ETHRX_cv_m = 0x00000400,
9156 + ETHRX_db_m = 0x00000800,
9158 + ETHRX_le_m = 0x00001000,
9160 + ETHRX_lor_m = 0x00002000,
9162 + ETHRX_ces_m = 0x00004000,
9163 + ETHRX_length_b = 16,
9164 + ETHRX_length_m = 0xffff0000,
9167 + ETHTX_fd_m = 0x00000001,
9169 + ETHTX_ld_m = 0x00000002,
9171 + ETHTX_oen_m = 0x00000004,
9173 + ETHTX_pen_m = 0x00000008,
9175 + ETHTX_cen_m = 0x00000010,
9177 + ETHTX_hen_m = 0x00000020,
9179 + ETHTX_tok_m = 0x00000040,
9181 + ETHTX_mp_m = 0x00000080,
9183 + ETHTX_bp_m = 0x00000100,
9185 + ETHTX_und_m = 0x00000200,
9187 + ETHTX_of_m = 0x00000400,
9189 + ETHTX_ed_m = 0x00000800,
9191 + ETHTX_ec_m = 0x00001000,
9193 + ETHTX_lc_m = 0x00002000,
9195 + ETHTX_td_m = 0x00004000,
9197 + ETHTX_crc_m = 0x00008000,
9199 + ETHTX_le_m = 0x00010000,
9201 + ETHTX_cc_m = 0x001E0000,
9203 +#endif //__IDT_RC32438_ETH_H__
9204 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h
9205 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h 1970-01-01 01:00:00.000000000 +0100
9206 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h 2006-06-18 12:44:28.000000000 +0200
9208 +/**************************************************************************
9210 + * BRIEF MODULE DESCRIPTION
9211 + * macros for IDT EB438 ethernet
9213 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9215 + * This program is free software; you can redistribute it and/or modify it
9216 + * under the terms of the GNU General Public License as published by the
9217 + * Free Software Foundation; either version 2 of the License, or (at your
9218 + * option) any later version.
9220 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9221 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9222 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9223 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9224 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9225 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9226 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9227 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9228 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9229 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9231 + * You should have received a copy of the GNU General Public License along
9232 + * with this program; if not, write to the Free Software Foundation, Inc.,
9233 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9236 + **************************************************************************
9237 + * May 2004 P. Sadik.
9243 + **************************************************************************
9246 +#ifndef __IDT_RC32438_ETH_V_H__
9247 +#define __IDT_RC32438_ETH_V_H__
9248 +#include <asm/idt-boards/rc32438/rc32438_eth.h>
9250 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
9251 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
9252 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
9253 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
9254 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
9255 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
9256 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
9257 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
9258 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
9259 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
9260 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
9262 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
9264 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
9265 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
9266 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
9267 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
9268 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
9269 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
9270 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
9271 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
9272 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
9273 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
9274 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
9275 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
9276 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
9277 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
9279 +#endif //__IDT_RC32438_ETH_V_H__
9280 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h
9281 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h 1970-01-01 01:00:00.000000000 +0100
9282 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h 2006-06-18 12:44:28.000000000 +0200
9284 +/**************************************************************************
9286 + * BRIEF MODULE DESCRIPTION
9287 + * Definitions for IDT RC32438 GPIO.
9289 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9291 + * This program is free software; you can redistribute it and/or modify it
9292 + * under the terms of the GNU General Public License as published by the
9293 + * Free Software Foundation; either version 2 of the License, or (at your
9294 + * option) any later version.
9296 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9297 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9298 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9299 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9300 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9301 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9302 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9303 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9304 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9305 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9307 + * You should have received a copy of the GNU General Public License along
9308 + * with this program; if not, write to the Free Software Foundation, Inc.,
9309 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9312 + **************************************************************************
9313 + * May 2004 P. Sadik.
9319 + **************************************************************************
9321 +#ifndef __IDT_RC32438_GPIO_H__
9322 +#define __IDT_RC32438_GPIO_H__
9325 + GPIO0_PhysicalAddress = 0x18048000,
9326 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
9328 + GPIO0_VirtualAddress = 0xb8048000,
9329 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
9334 + u32 gpiofunc; /* GPIO Function Register
9335 + * gpiofunc[x]==0 bit = gpio
9336 + * func[x]==1 bit = altfunc
9338 + u32 gpiocfg; /* GPIO Configuration Register
9339 + * gpiocfg[x]==0 bit = input
9340 + * gpiocfg[x]==1 bit = output
9342 + u32 gpiod; /* GPIO Data Register
9343 + * gpiod[x] read/write gpio pinX status
9345 + u32 gpioilevel; /* GPIO Interrupt Status Register
9346 + * interrupt level (see gpioistat)
9348 + u32 gpioistat; /* Gpio Interrupt Status Register
9349 + * istat[x] = (gpiod[x] == level[x])
9350 + * cleared in ISR (STICKY bits)
9352 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
9353 +} volatile * GPIO_t ;
9357 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
9358 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
9359 + GPIO_input_v = 0, // gpiocfg use pin as input.
9360 + GPIO_output_v = 1, // gpiocfg use pin as output.
9362 + GPIO_pin0_m = 0x00000001,
9364 + GPIO_pin1_m = 0x00000002,
9366 + GPIO_pin2_m = 0x00000004,
9368 + GPIO_pin3_m = 0x00000008,
9370 + GPIO_pin4_m = 0x00000010,
9372 + GPIO_pin5_m = 0x00000020,
9374 + GPIO_pin6_m = 0x00000040,
9376 + GPIO_pin7_m = 0x00000080,
9378 + GPIO_pin8_m = 0x00000100,
9380 + GPIO_pin9_m = 0x00000200,
9381 + GPIO_pin10_b = 10,
9382 + GPIO_pin10_m = 0x00000400,
9383 + GPIO_pin11_b = 11,
9384 + GPIO_pin11_m = 0x00000800,
9385 + GPIO_pin12_b = 12,
9386 + GPIO_pin12_m = 0x00001000,
9387 + GPIO_pin13_b = 13,
9388 + GPIO_pin13_m = 0x00002000,
9389 + GPIO_pin14_b = 14,
9390 + GPIO_pin14_m = 0x00004000,
9391 + GPIO_pin15_b = 15,
9392 + GPIO_pin15_m = 0x00008000,
9393 + GPIO_pin16_b = 16,
9394 + GPIO_pin16_m = 0x00010000,
9395 + GPIO_pin17_b = 17,
9396 + GPIO_pin17_m = 0x00020000,
9397 + GPIO_pin18_b = 18,
9398 + GPIO_pin18_m = 0x00040000,
9399 + GPIO_pin19_b = 19,
9400 + GPIO_pin19_m = 0x00080000,
9401 + GPIO_pin20_b = 20,
9402 + GPIO_pin20_m = 0x00100000,
9403 + GPIO_pin21_b = 21,
9404 + GPIO_pin21_m = 0x00200000,
9405 + GPIO_pin22_b = 22,
9406 + GPIO_pin22_m = 0x00400000,
9407 + GPIO_pin23_b = 23,
9408 + GPIO_pin23_m = 0x00800000,
9409 + GPIO_pin24_b = 24,
9410 + GPIO_pin24_m = 0x01000000,
9411 + GPIO_pin25_b = 25,
9412 + GPIO_pin25_m = 0x02000000,
9413 + GPIO_pin26_b = 26,
9414 + GPIO_pin26_m = 0x04000000,
9415 + GPIO_pin27_b = 27,
9416 + GPIO_pin27_m = 0x08000000,
9417 + GPIO_pin28_b = 28,
9418 + GPIO_pin28_m = 0x10000000,
9419 + GPIO_pin29_b = 29,
9420 + GPIO_pin29_m = 0x20000000,
9421 + GPIO_pin30_b = 30,
9422 + GPIO_pin30_m = 0x40000000,
9423 + GPIO_pin31_b = 31,
9424 + GPIO_pin31_m = 0x80000000,
9426 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
9428 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
9429 + GPIO_u0sout_m = GPIO_pin0_m,
9430 + GPIO_u0sout_cfg_v = GPIO_output_v,
9431 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
9432 + GPIO_u0sinp_m = GPIO_pin1_m,
9433 + GPIO_u0sinp_cfg_v = GPIO_input_v,
9434 + GPIO_u0rin_b = GPIO_pin2_b, // UART 0 ring indic.
9435 + GPIO_u0rin_m = GPIO_pin2_m,
9436 + GPIO_u0rin_cfg_v = GPIO_input_v,
9437 + GPIO_u0dcdn_b = GPIO_pin3_b, // UART 0 data carr.det.
9438 + GPIO_u0dcdn_m = GPIO_pin3_m,
9439 + GPIO_u0dcdn_cfg_v = GPIO_input_v,
9440 + GPIO_u0dtrn_b = GPIO_pin4_b, // UART 0 data term rdy.
9441 + GPIO_u0dtrn_m = GPIO_pin4_m,
9442 + GPIO_u0dtrn_cfg_v = GPIO_output_v,
9443 + GPIO_u0dsrn_b = GPIO_pin5_b, // UART 0 data set rdy.
9444 + GPIO_u0dsrn_m = GPIO_pin5_m,
9445 + GPIO_u0dsrn_cfg_v = GPIO_input_v,
9446 + GPIO_u0rtsn_b = GPIO_pin6_b, // UART 0 req. to send.
9447 + GPIO_u0rtsn_m = GPIO_pin6_m,
9448 + GPIO_u0rtsn_cfg_v = GPIO_output_v,
9449 + GPIO_u0ctsn_b = GPIO_pin7_b, // UART 0 clear to send.
9450 + GPIO_u0ctsn_m = GPIO_pin7_m,
9451 + GPIO_u0ctsn_cfg_v = GPIO_input_v,
9453 + GPIO_u1sout_b = GPIO_pin8_b, // UART 1 serial out.
9454 + GPIO_u1sout_m = GPIO_pin8_m,
9455 + GPIO_u1sout_cfg_v = GPIO_output_v,
9456 + GPIO_u1sinp_b = GPIO_pin9_b, // UART 1 serial in.
9457 + GPIO_u1sinp_m = GPIO_pin9_m,
9458 + GPIO_u1sinp_cfg_v = GPIO_input_v,
9459 + GPIO_u1dtrn_b = GPIO_pin10_b, // UART 1 data term rdy.
9460 + GPIO_u1dtrn_m = GPIO_pin10_m,
9461 + GPIO_u1dtrn_cfg_v = GPIO_output_v,
9462 + GPIO_u1dsrn_b = GPIO_pin11_b, // UART 1 data set rdy.
9463 + GPIO_u1dsrn_m = GPIO_pin11_m,
9464 + GPIO_u1dsrn_cfg_v = GPIO_input_v,
9465 + GPIO_u1rtsn_b = GPIO_pin12_b, // UART 1 req. to send.
9466 + GPIO_u1rtsn_m = GPIO_pin12_m,
9467 + GPIO_u1rtsn_cfg_v = GPIO_output_v,
9468 + GPIO_u1ctsn_b = GPIO_pin13_b, // UART 1 clear to send.
9469 + GPIO_u1ctsn_m = GPIO_pin13_m,
9470 + GPIO_u1ctsn_cfg_v = GPIO_input_v,
9472 + GPIO_dmareqn0_b = GPIO_pin14_b, // Ext. DMA 0 request
9473 + GPIO_dmareqn0_m = GPIO_pin14_m,
9474 + GPIO_dmareqn0_cfg_v = GPIO_input_v,
9476 + GPIO_dmareqn1_b = GPIO_pin15_b, // Ext. DMA 1 request
9477 + GPIO_dmareqn1_m = GPIO_pin15_m,
9478 + GPIO_dmareqn1_cfg_v = GPIO_input_v,
9480 + GPIO_dmadonen0_b = GPIO_pin16_b, // Ext. DMA 0 done
9481 + GPIO_dmadonen0_m = GPIO_pin16_m,
9482 + GPIO_dmadonen0_cfg_v = GPIO_input_v,
9484 + GPIO_dmadonen1_b = GPIO_pin17_b, // Ext. DMA 1 done
9485 + GPIO_dmadonen1_m = GPIO_pin17_m,
9486 + GPIO_dmadonen1_cfg_v = GPIO_input_v,
9488 + GPIO_dmafinn0_b = GPIO_pin18_b, // Ext. DMA 0 finished
9489 + GPIO_dmafinn0_m = GPIO_pin18_m,
9490 + GPIO_dmafinn0_cfg_v = GPIO_output_v,
9492 + GPIO_dmafinn1_b = GPIO_pin19_b, // Ext. DMA 1 finished
9493 + GPIO_dmafinn1_m = GPIO_pin19_m,
9494 + GPIO_dmafinn1_cfg_v = GPIO_output_v,
9496 + GPIO_maddr22_b = GPIO_pin20_b, // M&P bus bit 22.
9497 + GPIO_maddr22_m = GPIO_pin20_m,
9498 + GPIO_maddr22_cfg_v = GPIO_output_v,
9500 + GPIO_maddr23_b = GPIO_pin21_b, // M&P bus bit 23.
9501 + GPIO_maddr23_m = GPIO_pin21_m,
9502 + GPIO_maddr23_cfg_v = GPIO_output_v,
9504 + GPIO_maddr24_b = GPIO_pin22_b, // M&P bus bit 24.
9505 + GPIO_maddr24_m = GPIO_pin22_m,
9506 + GPIO_maddr24_cfg_v = GPIO_output_v,
9508 + GPIO_maddr25_b = GPIO_pin23_b, // M&P bus bit 25.
9509 + GPIO_maddr25_m = GPIO_pin23_m,
9510 + GPIO_maddr25_cfg_v = GPIO_output_v,
9512 + GPIO_afspare6_b = GPIO_pin24_b, // reserved.
9513 + GPIO_afspare6_m = GPIO_pin24_m,
9514 + GPIO_afspare6_cfg_v = GPIO_input_v,
9515 + GPIO_afspare5_b = GPIO_pin25_b, // reserved.
9516 + GPIO_afspare5_m = GPIO_pin25_m,
9517 + GPIO_afspare5_cfg_v = GPIO_input_v,
9518 + GPIO_afspare4_b = GPIO_pin26_b, // reserved.
9519 + GPIO_afspare4_m = GPIO_pin26_m,
9520 + GPIO_afspare4_cfg_v = GPIO_input_v,
9521 + GPIO_afspare3_b = GPIO_pin27_b, // reserved.
9522 + GPIO_afspare3_m = GPIO_pin27_m,
9523 + GPIO_afspare3_cfg_v = GPIO_input_v,
9524 + GPIO_afspare2_b = GPIO_pin28_b, // reserved.
9525 + GPIO_afspare2_m = GPIO_pin28_m,
9526 + GPIO_afspare2_cfg_v = GPIO_input_v,
9527 + GPIO_afspare1_b = GPIO_pin29_b, // reserved.
9528 + GPIO_afspare1_m = GPIO_pin29_m,
9529 + GPIO_afspare1_cfg_v = GPIO_input_v,
9531 + GPIO_pcimuintn_b = GPIO_pin30_b, // PCI messaging int.
9532 + GPIO_pcimuintn_m = GPIO_pin30_m,
9533 + GPIO_pcimuintn_cfg_v = GPIO_output_v,
9535 + GPIO_rngclk_b = GPIO_pin31_b, // RNG external clock
9536 + GPIO_rngclk_m = GPIO_pin31_m,
9537 + GPIO_rncclk_cfg_v = GPIO_input_v,
9540 +#endif //__IDT_RC32438_GPIO_H__
9541 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438.h
9542 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438.h 1970-01-01 01:00:00.000000000 +0100
9543 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438.h 2006-06-18 12:44:28.000000000 +0200
9545 +/**************************************************************************
9547 + * BRIEF MODULE DESCRIPTION
9548 + * Definitions for IDT RC32438 CPU.
9550 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9552 + * This program is free software; you can redistribute it and/or modify it
9553 + * under the terms of the GNU General Public License as published by the
9554 + * Free Software Foundation; either version 2 of the License, or (at your
9555 + * option) any later version.
9557 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9558 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9559 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9560 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9561 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9562 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9563 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9564 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9565 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9566 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9568 + * You should have received a copy of the GNU General Public License along
9569 + * with this program; if not, write to the Free Software Foundation, Inc.,
9570 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9573 + **************************************************************************
9574 + * May 2004 P. Sadik.
9580 + **************************************************************************
9583 +#ifndef __IDT_RC32438_H__
9584 +#define __IDT_RC32438_H__
9585 +#include <linux/config.h>
9586 +#include <linux/delay.h>
9587 +#include <asm/io.h>
9588 +#include <asm/idt-boards/rc32438/rc32438_timer.h>
9590 +#define RC32438_REG_BASE 0x18000000
9592 +#define interrupt ((volatile INT_t ) INT0_VirtualAddress)
9593 +#define idttimer ((volatile TIM_t) TIM0_VirtualAddress)
9594 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
9596 +#define IDT_CLOCK_MULT 2
9597 +#define MIPS_CPU_TIMER_IRQ 7
9598 +/* Interrupt Controller */
9599 +#define IC_GROUP0_PEND (RC32438_REG_BASE + 0x38000)
9600 +#define IC_GROUP0_MASK (RC32438_REG_BASE + 0x38008)
9601 +#define IC_GROUP_OFFSET 0x0C
9602 +#define RTC_BASE 0xAC0801FF0
9604 +#define NUM_INTR_GROUPS 5
9607 +#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
9608 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) /* GRP3 IRQ numbers start here */
9609 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) /* GRP4 IRQ numbers start here */
9610 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) /* GRP5 IRQ numbers start here */
9611 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
9614 +#define RC32438_UART0_BASE (RC32438_REG_BASE + 0x50003)
9615 +#define RC32438_UART1_BASE (RC32438_REG_BASE + 0x50023)
9617 +#define RC32438_UART0_BASE (RC32438_REG_BASE + 0x50000)
9618 +#define RC32438_UART1_BASE (RC32438_REG_BASE + 0x50020)
9621 +#define RC32438_UART0_IRQ GROUP3_IRQ_BASE + 0
9622 +#define RC32438_UART1_IRQ GROUP3_IRQ_BASE + 3
9624 +#define RC32438_NR_IRQS (GROUP4_IRQ_BASE + 32)
9628 +/* cpu pipeline flush */
9629 +static inline void rc32438_sync(void)
9631 + __asm__ volatile ("sync");
9634 +static inline void rc32438_sync_udelay(int us)
9636 + __asm__ volatile ("sync");
9640 +static inline void rc32438_sync_delay(int ms)
9642 + __asm__ volatile ("sync");
9647 + * Macros to access internal RC32438 registers. No byte
9648 + * swapping should be done when accessing the internal
9652 +#define rc32438_readb __raw_readb
9653 +#define rc32438_readw __raw_readw
9654 +#define rc32438_readl __raw_readl
9656 +#define rc32438_writeb __raw_writeb
9657 +#define rc32438_writew __raw_writew
9658 +#define rc32438_writel __raw_writel
9661 + * C access to CLZ and CLO instructions
9662 + * (count leading zeroes/ones).
9664 +static inline int rc32438_clz(unsigned long val)
9667 + __asm__ volatile (
9668 + ".set\tnoreorder\n\t"
9670 + ".set\tmips32\n\t"
9680 +static inline int rc32438_clo(unsigned long val)
9683 + __asm__ volatile (
9684 + ".set\tnoreorder\n\t"
9686 + ".set\tmips32\n\t"
9696 +#endif //__IDT_RC32438_H__
9697 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_pci.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_pci.h
9698 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_pci.h 1970-01-01 01:00:00.000000000 +0100
9699 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_pci.h 2006-06-18 12:44:28.000000000 +0200
9701 +/**************************************************************************
9703 + * BRIEF MODULE DESCRIPTION
9704 + * Definitions for IDT RC32438 PCI.
9706 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9708 + * This program is free software; you can redistribute it and/or modify it
9709 + * under the terms of the GNU General Public License as published by the
9710 + * Free Software Foundation; either version 2 of the License, or (at your
9711 + * option) any later version.
9713 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9714 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9715 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9716 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9717 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9718 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9719 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9720 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9721 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9722 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9724 + * You should have received a copy of the GNU General Public License along
9725 + * with this program; if not, write to the Free Software Foundation, Inc.,
9726 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9729 + **************************************************************************
9730 + * May 2004 P. Sadik
9736 + **************************************************************************
9741 + PCI0_PhysicalAddress = 0x18080000,
9742 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
9744 + PCI0_VirtualAddress = 0xb8080000,
9745 + PCI_VirtualAddress = PCI0_VirtualAddress,
9750 + PCI_LbaCount = 4, // Local base addresses.
9755 + u32 a ; // Address.
9756 + u32 c ; // Control.
9757 + u32 m ; // mapping.
9767 + PCI_Map_s pcilba [PCI_LbaCount] ;
9775 +} volatile *PCI_t ;
9777 +// PCI messaging unit.
9784 + u32 pciim [PCIM_Count] ;
9785 + u32 pciom [PCIM_Count] ;
9792 +} volatile *PCIM_t ;
9794 +/*******************************************************************************
9796 + * PCI Control Register
9798 + ******************************************************************************/
9802 + PCIC_en_m = 0x00000001,
9804 + PCIC_tnr_m = 0x00000002,
9806 + PCIC_sce_m = 0x00000004,
9808 + PCIC_ien_m = 0x00000008,
9810 + PCIC_aaa_m = 0x00000010,
9812 + PCIC_eap_m = 0x00000020,
9814 + PCIC_pcim_m = 0x000001c0,
9815 + PCIC_pcim_disabled_v = 0,
9816 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
9817 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
9818 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
9819 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
9820 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
9821 + PCIC_pcim_reserved6_v = 6,
9822 + PCIC_pcim_reserved7_v = 7,
9824 + PCIC_igm_m = 0x00000200,
9827 +/*******************************************************************************
9829 + * PCI Status Register
9831 + ******************************************************************************/
9834 + PCIS_eed_m = 0x00000001,
9836 + PCIS_wr_m = 0x00000002,
9838 + PCIS_nmi_m = 0x00000004,
9840 + PCIS_ii_m = 0x00000008,
9842 + PCIS_cwe_m = 0x00000010,
9844 + PCIS_cre_m = 0x00000020,
9846 + PCIS_mdpe_m = 0x00000040,
9848 + PCIS_sta_m = 0x00000080,
9850 + PCIS_rta_m = 0x00000100,
9852 + PCIS_rma_m = 0x00000200,
9854 + PCIS_sse_m = 0x00000400,
9856 + PCIS_ose_m = 0x00000800,
9858 + PCIS_pe_m = 0x00001000,
9860 + PCIS_tae_m = 0x00002000,
9862 + PCIS_rle_m = 0x00004000,
9864 + PCIS_bme_m = 0x00008000,
9866 + PCIS_prd_m = 0x00010000,
9868 + PCIS_rip_m = 0x00020000,
9871 +/*******************************************************************************
9873 + * PCI Status Mask Register
9875 + ******************************************************************************/
9878 + PCISM_eed_m = 0x00000001,
9880 + PCISM_wr_m = 0x00000002,
9882 + PCISM_nmi_m = 0x00000004,
9884 + PCISM_ii_m = 0x00000008,
9886 + PCISM_cwe_m = 0x00000010,
9888 + PCISM_cre_m = 0x00000020,
9890 + PCISM_mdpe_m = 0x00000040,
9892 + PCISM_sta_m = 0x00000080,
9894 + PCISM_rta_m = 0x00000100,
9896 + PCISM_rma_m = 0x00000200,
9898 + PCISM_sse_m = 0x00000400,
9900 + PCISM_ose_m = 0x00000800,
9902 + PCISM_pe_m = 0x00001000,
9904 + PCISM_tae_m = 0x00002000,
9906 + PCISM_rle_m = 0x00004000,
9908 + PCISM_bme_m = 0x00008000,
9910 + PCISM_prd_m = 0x00010000,
9912 + PCISM_rip_m = 0x00020000,
9915 +/*******************************************************************************
9917 + * PCI Configuration Address Register
9919 + ******************************************************************************/
9921 + PCICFGA_reg_b = 2,
9922 + PCICFGA_reg_m = 0x000000fc,
9923 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
9924 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
9925 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
9926 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
9927 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
9928 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
9929 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
9930 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
9931 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
9932 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
9933 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
9934 + PCICFGA_reg_pba0m_v = 0x48>>2,
9935 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
9936 + PCICFGA_reg_pba1m_v = 0x50>>2,
9937 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
9938 + PCICFGA_reg_pba2m_v = 0x58>>2,
9939 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
9940 + PCICFGA_reg_pba3m_v = 0x60>>2,
9941 + PCICFGA_reg_pmgt_v = 0x64>>2,
9942 + PCICFGA_func_b = 8,
9943 + PCICFGA_func_m = 0x00000700,
9944 + PCICFGA_dev_b = 11,
9945 + PCICFGA_dev_m = 0x0000f800,
9946 + PCICFGA_dev_internal_v = 0,
9947 + PCICFGA_bus_b = 16,
9948 + PCICFGA_bus_m = 0x00ff0000,
9949 + PCICFGA_bus_type0_v = 0, //local bus
9950 + PCICFGA_en_b = 31, // read only
9951 + PCICFGA_en_m = 0x80000000,
9955 + PCFGID_vendor_b = 0,
9956 + PCFGID_vendor_m = 0x0000ffff,
9957 + PCFGID_vendor_IDT_v = 0x111d,
9958 + PCFGID_device_b = 16,
9959 + PCFGID_device_m = 0xffff0000,
9960 + PCFGID_device_Acaciade_v = 0x0207,
9962 + PCFG04_command_ioena_b = 1,
9963 + PCFG04_command_ioena_m = 0x00000001,
9964 + PCFG04_command_memena_b = 2,
9965 + PCFG04_command_memena_m = 0x00000002,
9966 + PCFG04_command_bmena_b = 3,
9967 + PCFG04_command_bmena_m = 0x00000004,
9968 + PCFG04_command_mwinv_b = 5,
9969 + PCFG04_command_mwinv_m = 0x00000010,
9970 + PCFG04_command_parena_b = 7,
9971 + PCFG04_command_parena_m = 0x00000040,
9972 + PCFG04_command_serrena_b = 9,
9973 + PCFG04_command_serrena_m = 0x00000100,
9974 + PCFG04_command_fastbbena_b = 10,
9975 + PCFG04_command_fastbbena_m = 0x00000200,
9976 + PCFG04_status_b = 16,
9977 + PCFG04_status_m = 0xffff0000,
9978 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
9979 + PCFG04_status_66MHz_m = 0x00200000,
9980 + PCFG04_status_fbb_b = 23,
9981 + PCFG04_status_fbb_m = 0x00800000,
9982 + PCFG04_status_mdpe_b = 24,
9983 + PCFG04_status_mdpe_m = 0x01000000,
9984 + PCFG04_status_dst_b = 25,
9985 + PCFG04_status_dst_m = 0x06000000,
9986 + PCFG04_status_sta_b = 27,
9987 + PCFG04_status_sta_m = 0x08000000,
9988 + PCFG04_status_rta_b = 28,
9989 + PCFG04_status_rta_m = 0x10000000,
9990 + PCFG04_status_rma_b = 29,
9991 + PCFG04_status_rma_m = 0x20000000,
9992 + PCFG04_status_sse_b = 30,
9993 + PCFG04_status_sse_m = 0x40000000,
9994 + PCFG04_status_pe_b = 31,
9995 + PCFG04_status_pe_m = 0x40000000,
9997 + PCFG08_revId_b = 0,
9998 + PCFG08_revId_m = 0x000000ff,
9999 + PCFG08_classCode_b = 0,
10000 + PCFG08_classCode_m = 0xffffff00,
10001 + PCFG08_classCode_bridge_v = 06,
10002 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
10003 + PCFG0C_cacheline_b = 0,
10004 + PCFG0C_cacheline_m = 0x000000ff,
10005 + PCFG0C_masterLatency_b = 8,
10006 + PCFG0C_masterLatency_m = 0x0000ff00,
10007 + PCFG0C_headerType_b = 16,
10008 + PCFG0C_headerType_m = 0x00ff0000,
10009 + PCFG0C_bist_b = 24,
10010 + PCFG0C_bist_m = 0xff000000,
10012 + PCIPBA_msi_b = 0,
10013 + PCIPBA_msi_m = 0x00000001,
10015 + PCIPBA_p_m = 0x00000004,
10016 + PCIPBA_baddr_b = 8,
10017 + PCIPBA_baddr_m = 0xffffff00,
10019 + PCFGSS_vendorId_b = 0,
10020 + PCFGSS_vendorId_m = 0x0000ffff,
10021 + PCFGSS_id_b = 16,
10022 + PCFGSS_id_m = 0xffff0000,
10024 + PCFG3C_interruptLine_b = 0,
10025 + PCFG3C_interruptLine_m = 0x000000ff,
10026 + PCFG3C_interruptPin_b = 8,
10027 + PCFG3C_interruptPin_m = 0x0000ff00,
10028 + PCFG3C_minGrant_b = 16,
10029 + PCFG3C_minGrant_m = 0x00ff0000,
10030 + PCFG3C_maxLat_b = 24,
10031 + PCFG3C_maxLat_m = 0xff000000,
10033 + PCIPBAC_msi_b = 0,
10034 + PCIPBAC_msi_m = 0x00000001,
10036 + PCIPBAC_p_m = 0x00000002,
10037 + PCIPBAC_size_b = 2,
10038 + PCIPBAC_size_m = 0x0000007c,
10039 + PCIPBAC_sb_b = 7,
10040 + PCIPBAC_sb_m = 0x00000080,
10041 + PCIPBAC_pp_b = 8,
10042 + PCIPBAC_pp_m = 0x00000100,
10043 + PCIPBAC_mr_b = 9,
10044 + PCIPBAC_mr_m = 0x00000600,
10045 + PCIPBAC_mr_read_v =0, //no prefetching
10046 + PCIPBAC_mr_readLine_v =1,
10047 + PCIPBAC_mr_readMult_v =2,
10048 + PCIPBAC_mrl_b = 11,
10049 + PCIPBAC_mrl_m = 0x00000800,
10050 + PCIPBAC_mrm_b = 12,
10051 + PCIPBAC_mrm_m = 0x00001000,
10052 + PCIPBAC_trp_b = 13,
10053 + PCIPBAC_trp_m = 0x00002000,
10055 + PCFG40_trdyTimeout_b = 0,
10056 + PCFG40_trdyTimeout_m = 0x000000ff,
10057 + PCFG40_retryLim_b = 8,
10058 + PCFG40_retryLim_m = 0x0000ff00,
10061 +/*******************************************************************************
10063 + * PCI Local Base Address [0|1|2|3] Register
10065 + ******************************************************************************/
10067 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
10068 + PCILBA_baddr_m = 0xffffff00,
10070 +/*******************************************************************************
10072 + * PCI Local Base Address Control Register
10074 + ******************************************************************************/
10076 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
10077 + PCILBAC_msi_m = 0x00000001,
10078 + PCILBAC_msi_mem_v = 0,
10079 + PCILBAC_msi_io_v = 1,
10080 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
10081 + PCILBAC_size_m = 0x0000007c,
10082 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
10083 + PCILBAC_sb_m = 0x00000080,
10084 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
10085 + PCILBAC_rt_m = 0x00000100,
10086 + PCILBAC_rt_noprefetch_v = 0, // mem read
10087 + PCILBAC_rt_prefetch_v = 1, // mem readline
10090 +/*******************************************************************************
10092 + * PCI Local Base Address [0|1|2|3] Mapping Register
10094 + ******************************************************************************/
10096 + PCILBAM_maddr_b = 8,
10097 + PCILBAM_maddr_m = 0xffffff00,
10100 +/*******************************************************************************
10102 + * PCI Decoupled Access Control Register
10104 + ******************************************************************************/
10106 + PCIDAC_den_b = 0,
10107 + PCIDAC_den_m = 0x00000001,
10110 +/*******************************************************************************
10112 + * PCI Decoupled Access Status Register
10114 + ******************************************************************************/
10117 + PCIDAS_d_m = 0x00000001,
10119 + PCIDAS_b_m = 0x00000002,
10121 + PCIDAS_e_m = 0x00000004,
10122 + PCIDAS_ofe_b = 3,
10123 + PCIDAS_ofe_m = 0x00000008,
10124 + PCIDAS_off_b = 4,
10125 + PCIDAS_off_m = 0x00000010,
10126 + PCIDAS_ife_b = 5,
10127 + PCIDAS_ife_m = 0x00000020,
10128 + PCIDAS_iff_b = 6,
10129 + PCIDAS_iff_m = 0x00000040,
10132 +/*******************************************************************************
10134 + * PCI DMA Channel 8 Configuration Register
10136 + ******************************************************************************/
10139 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
10140 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
10141 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
10142 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
10145 +/*******************************************************************************
10147 + * PCI DMA Channel 9 Configuration Register
10149 + ******************************************************************************/
10152 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
10153 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
10156 +/*******************************************************************************
10158 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
10160 + ******************************************************************************/
10162 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
10163 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
10164 + // These are for reads (DMA channel 8)
10165 + PCIDMAD_devcmd_mr_v = 0, //memory read
10166 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
10167 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
10168 + PCIDMAD_devcmd_ior_v = 3, //I/O read
10169 + // These are for writes (DMA channel 9)
10170 + PCIDMAD_devcmd_mw_v = 0, //memory write
10171 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
10172 + PCIDMAD_devcmd_iow_v = 3, //I/O write
10174 + // Swap byte field applies to both DMA channel 8 and 9
10175 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
10176 + PCIDMAD_sb_m = 0x01000000, // swap byte field
10180 +/*******************************************************************************
10182 + * PCI Target Control Register
10184 + ******************************************************************************/
10187 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
10188 + PCITC_rtimer_m = 0x000000ff,
10189 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
10190 + PCITC_dtimer_m = 0x0000ff00,
10191 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
10192 + PCITC_rdr_m = 0x00040000,
10193 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
10194 + PCITC_ddt_m = 0x00080000,
10196 +/*******************************************************************************
10198 + * PCI messaging unit [applies to both inbound and outbound registers ]
10200 + ******************************************************************************/
10203 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10204 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
10205 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10206 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
10207 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10208 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
10211 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h
10212 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h 1970-01-01 01:00:00.000000000 +0100
10213 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h 2006-06-18 12:44:28.000000000 +0200
10215 +/**************************************************************************
10217 + * BRIEF MODULE DESCRIPTION
10218 + * Definitions for IDT RC32438 PCI setup.
10220 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10222 + * This program is free software; you can redistribute it and/or modify it
10223 + * under the terms of the GNU General Public License as published by the
10224 + * Free Software Foundation; either version 2 of the License, or (at your
10225 + * option) any later version.
10227 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10228 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10229 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10230 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10231 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10232 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10233 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10234 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10235 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10236 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10238 + * You should have received a copy of the GNU General Public License along
10239 + * with this program; if not, write to the Free Software Foundation, Inc.,
10240 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10243 + **************************************************************************
10244 + * May 2004 P. Sadik
10246 + * Initial Release
10250 + **************************************************************************
10253 +#define PCI_MSG_VirtualAddress 0xB8088010
10254 +#define rc32438_pci ((volatile PCI_t) PCI0_VirtualAddress)
10255 +#define rc32438_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
10257 +#define PCIM_SHFT 0x6
10258 +#define PCIM_BIT_LEN 0x7
10259 +#define PCIM_H_EA 0x3
10260 +#define PCIM_H_IA_FIX 0x4
10261 +#define PCIM_H_IA_RR 0x5
10263 +#define PCI_ADDR_START 0x50000000
10265 +#define CPUTOPCI_MEM_WIN 0x02000000
10266 +#define CPUTOPCI_IO_WIN 0x00100000
10267 +#define PCILBA_SIZE_SHFT 2
10268 +#define PCILBA_SIZE_MASK 0x1F
10269 +#define SIZE_256MB 0x1C
10270 +#define SIZE_128MB 0x1B
10271 +#define SIZE_64MB 0x1A
10272 +#define SIZE_32MB 0x19
10273 +#define SIZE_16MB 0x18
10274 +#define SIZE_4MB 0x16
10275 +#define SIZE_2MB 0x15
10276 +#define SIZE_1MB 0x14
10277 +#define ACACIA_CONFIG0_ADDR 0x80000000
10278 +#define ACACIA_CONFIG1_ADDR 0x80000004
10279 +#define ACACIA_CONFIG2_ADDR 0x80000008
10280 +#define ACACIA_CONFIG3_ADDR 0x8000000C
10281 +#define ACACIA_CONFIG4_ADDR 0x80000010
10282 +#define ACACIA_CONFIG5_ADDR 0x80000014
10283 +#define ACACIA_CONFIG6_ADDR 0x80000018
10284 +#define ACACIA_CONFIG7_ADDR 0x8000001C
10285 +#define ACACIA_CONFIG8_ADDR 0x80000020
10286 +#define ACACIA_CONFIG9_ADDR 0x80000024
10287 +#define ACACIA_CONFIG10_ADDR 0x80000028
10288 +#define ACACIA_CONFIG11_ADDR 0x8000002C
10289 +#define ACACIA_CONFIG12_ADDR 0x80000030
10290 +#define ACACIA_CONFIG13_ADDR 0x80000034
10291 +#define ACACIA_CONFIG14_ADDR 0x80000038
10292 +#define ACACIA_CONFIG15_ADDR 0x8000003C
10293 +#define ACACIA_CONFIG16_ADDR 0x80000040
10294 +#define ACACIA_CONFIG17_ADDR 0x80000044
10295 +#define ACACIA_CONFIG18_ADDR 0x80000048
10296 +#define ACACIA_CONFIG19_ADDR 0x8000004C
10297 +#define ACACIA_CONFIG20_ADDR 0x80000050
10298 +#define ACACIA_CONFIG21_ADDR 0x80000054
10299 +#define ACACIA_CONFIG22_ADDR 0x80000058
10300 +#define ACACIA_CONFIG23_ADDR 0x8000005C
10301 +#define ACACIA_CONFIG24_ADDR 0x80000060
10302 +#define ACACIA_CONFIG25_ADDR 0x80000064
10303 +#define ACACIA_CMD (PCFG04_command_ioena_m | \
10304 + PCFG04_command_memena_m | \
10305 + PCFG04_command_bmena_m | \
10306 + PCFG04_command_mwinv_m | \
10307 + PCFG04_command_parena_m | \
10308 + PCFG04_command_serrena_m )
10310 +#define ACACIA_STAT (PCFG04_status_mdpe_m | \
10311 + PCFG04_status_sta_m | \
10312 + PCFG04_status_rta_m | \
10313 + PCFG04_status_rma_m | \
10314 + PCFG04_status_sse_m | \
10315 + PCFG04_status_pe_m)
10317 +#define ACACIA_CNFG1 ((ACACIA_STAT<<16)|ACACIA_CMD)
10319 +#define ACACIA_REVID 0
10320 +#define ACACIA_CLASS_CODE 0
10321 +#define ACACIA_CNFG2 ((ACACIA_CLASS_CODE<<8) | \
10324 +#define ACACIA_CACHE_LINE_SIZE 4
10325 +#define ACACIA_MASTER_LAT 0x3c
10326 +#define ACACIA_HEADER_TYPE 0
10327 +#define ACACIA_BIST 0
10329 +#define ACACIA_CNFG3 ((ACACIA_BIST << 24) | \
10330 + (ACACIA_HEADER_TYPE<<16) | \
10331 + (ACACIA_MASTER_LAT<<8) | \
10332 + ACACIA_CACHE_LINE_SIZE )
10334 +#define ACACIA_BAR0 0x00000008 /* 128 MB Memory */
10335 +#define ACACIA_BAR1 0x18800001 /* 1 MB IO */
10336 +#define ACACIA_BAR2 0x18000001 /* 2 MB IO window for Acacia
10337 + internal Registers */
10338 +#define ACACIA_BAR3 0x48000008 /* Spare 128 MB Memory */
10340 +#define ACACIA_CNFG4 ACACIA_BAR0
10341 +#define ACACIA_CNFG5 ACACIA_BAR1
10342 +#define ACACIA_CNFG6 ACACIA_BAR2
10343 +#define ACACIA_CNFG7 ACACIA_BAR3
10345 +#define ACACIA_SUBSYS_VENDOR_ID 0
10346 +#define ACACIA_SUBSYSTEM_ID 0
10347 +#define ACACIA_CNFG8 0
10348 +#define ACACIA_CNFG9 0
10349 +#define ACACIA_CNFG10 0
10350 +#define ACACIA_CNFG11 ((ACACIA_SUBSYS_VENDOR_ID<<16) | \
10351 + ACACIA_SUBSYSTEM_ID)
10352 +#define ACACIA_INT_LINE 1
10353 +#define ACACIA_INT_PIN 1
10354 +#define ACACIA_MIN_GNT 8
10355 +#define ACACIA_MAX_LAT 0x38
10356 +#define ACACIA_CNFG12 0
10357 +#define ACACIA_CNFG13 0
10358 +#define ACACIA_CNFG14 0
10359 +#define ACACIA_CNFG15 ((ACACIA_MAX_LAT<<24) | \
10360 + (ACACIA_MIN_GNT<<16) | \
10361 + (ACACIA_INT_PIN<<8) | \
10363 +#define ACACIA_RETRY_LIMIT 0x80
10364 +#define ACACIA_TRDY_LIMIT 0x80
10365 +#define ACACIA_CNFG16 ((ACACIA_RETRY_LIMIT<<8) | \
10366 + ACACIA_TRDY_LIMIT)
10367 +#define PCI_PBAxC_R 0x0
10368 +#define PCI_PBAxC_RL 0x1
10369 +#define PCI_PBAxC_RM 0x2
10370 +#define SIZE_SHFT 2
10372 +#define ACACIA_PBA0C ( PCIPBAC_mrl_m | PCIPBAC_sb_m | \
10373 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
10375 + (SIZE_128MB<<SIZE_SHFT) | \
10378 +#define ACACIA_CNFG17 ACACIA_PBA0C
10379 +#define ACACIA_PBA0M 0x0
10380 +#define ACACIA_CNFG18 ACACIA_PBA0M
10382 +#define ACACIA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
10385 +#define ACACIA_CNFG19 ACACIA_PBA1C
10386 +#define ACACIA_PBA1M 0x0
10387 +#define ACACIA_CNFG20 ACACIA_PBA1M
10389 +#define ACACIA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
10392 +#define ACACIA_CNFG21 ACACIA_PBA2C
10393 +#define ACACIA_PBA2M 0x18000000
10394 +#define ACACIA_CNFG22 ACACIA_PBA2M
10395 +#define ACACIA_PBA3C 0
10396 +#define ACACIA_CNFG23 ACACIA_PBA3C
10397 +#define ACACIA_PBA3M 0
10398 +#define ACACIA_CNFG24 ACACIA_PBA3M
10402 +#define PCITC_DTIMER_VAL 8
10403 +#define PCITC_RTIMER_VAL 0x10
10405 diff -Nur linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_timer.h linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_timer.h
10406 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_timer.h 1970-01-01 01:00:00.000000000 +0100
10407 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_timer.h 2006-06-18 12:44:28.000000000 +0200
10409 +/**************************************************************************
10411 + * BRIEF MODULE DESCRIPTION
10412 + * Timer register definition IDT RC32438 CPU.
10414 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10416 + * This program is free software; you can redistribute it and/or modify it
10417 + * under the terms of the GNU General Public License as published by the
10418 + * Free Software Foundation; either version 2 of the License, or (at your
10419 + * option) any later version.
10421 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10422 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10423 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10424 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10425 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10426 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10427 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10428 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10429 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10430 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10432 + * You should have received a copy of the GNU General Public License along
10433 + * with this program; if not, write to the Free Software Foundation, Inc.,
10434 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10437 + **************************************************************************
10438 + * May 2004 P. Sadik.
10440 + * Initial Release
10444 + **************************************************************************
10447 +#ifndef __IDT_RC32438_TIM_H__
10448 +#define __IDT_RC32438_TIM_H__
10452 + TIM0_PhysicalAddress = 0x18028000,
10453 + TIM_PhysicalAddress = TIM0_PhysicalAddress, // Default
10455 + TIM0_VirtualAddress = 0xb8028000,
10456 + TIM_VirtualAddress = TIM0_VirtualAddress, // Default
10468 + u32 ctc ; //use CTC_
10471 +typedef struct TIM_s
10473 + struct TIM_CNTR_s tim [TIM_Count] ;
10474 + u32 rcount ; //use RCOUNT_
10475 + u32 rcompare ; //use RCOMPARE_
10476 + u32 rtc ; //use RTC_
10477 +} volatile * TIM_t ;
10482 + CTC_en_m = 0x00000001,
10484 + CTC_to_m = 0x00000002,
10486 + RCOUNT_count_b = 0,
10487 + RCOUNT_count_m = 0x0000ffff,
10488 + RCOMPARE_compare_b = 0,
10489 + RCOMPARE_compare_m = 0x0000ffff,
10491 + RTC_ce_m = 0x00000001,
10493 + RTC_to_m = 0x00000002,
10495 + RTC_rqe_m = 0x00000004,
10498 +#endif //__IDT_RC32438_TIM_H__
10500 diff -Nur linux-2.6.17/include/asm-mips/mach-generic/irq.h linux-2.6.17-owrt/include/asm-mips/mach-generic/irq.h
10501 --- linux-2.6.17/include/asm-mips/mach-generic/irq.h 2006-06-18 03:49:35.000000000 +0200
10502 +++ linux-2.6.17-owrt/include/asm-mips/mach-generic/irq.h 2006-06-18 12:44:28.000000000 +0200
10504 #ifndef __ASM_MACH_GENERIC_IRQ_H
10505 #define __ASM_MACH_GENERIC_IRQ_H
10507 -#define NR_IRQS 128
10508 +#define NR_IRQS 256
10510 #endif /* __ASM_MACH_GENERIC_IRQ_H */
10511 diff -Nur linux-2.6.17/include/linux/kernel.h linux-2.6.17-owrt/include/linux/kernel.h
10512 --- linux-2.6.17/include/linux/kernel.h 2006-06-18 03:49:35.000000000 +0200
10513 +++ linux-2.6.17-owrt/include/linux/kernel.h 2006-06-18 12:44:28.000000000 +0200
10514 @@ -329,6 +329,7 @@
10517 /* Force a compilation error if condition is true */
10518 +extern void BUILD_BUG(void);
10519 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
10521 /* Trap pasters of __FUNCTION__ at compile-time */