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/autoconf.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[] =
633 + "mtdparts=physmap-flash.0:3520k@0x080000(zImage),2880k@0x120000(JFFS2),8k@0x3f8000(NVRAM) "
634 + "console=ttyS0,9600 root=/dev/mtdblock1 rootfstype=jffs2 ";
637 +extern unsigned long mips_machgroup;
638 +extern unsigned long mips_machtype;
640 +extern void setup_serial_port(void);
641 +extern char * getenv(char *e);
643 +/* IDT 79EB434 memory map -- we really should be auto sizing it */
644 +#define RAM_SIZE 32*1024*1024
646 +char *__init prom_getcmdline(void)
648 + return &(arcs_cmdline[0]);
651 +void __init prom_init(void)
654 + sprintf(arcs_cmdline, "%s", bootparm);
656 + /* set our arch type */
657 + mips_machgroup = MACH_GROUP_ARUBA;
658 + mips_machtype = MACH_ARUBA_UNKNOWN;
660 + boardname=getenv("boardname");
662 + if (!strcmp(boardname,"Muscat")) {
663 + mips_machtype = MACH_ARUBA_AP70;
664 + idt_cpu_freq = 133000000;
666 + } else if (!strcmp(boardname,"Mataro")) {
667 + mips_machtype = MACH_ARUBA_AP65;
668 + idt_cpu_freq = 110000000;
669 + } else if (!strcmp(boardname,"Merlot")) {
670 + mips_machtype = MACH_ARUBA_AP60;
671 + idt_cpu_freq = 90000000;
674 + /* turn on the console */
675 + setup_serial_port();
678 + * give all RAM to boot allocator,
679 + * except where the kernel was loaded
681 + add_memory_region(0,RAM_SIZE,BOOT_MEM_RAM);
684 +void prom_free_prom_memory(void)
686 + printk("stubbed prom_free_prom_memory()\n");
688 diff -Nur linux-2.6.17/arch/mips/aruba/serial.c linux-2.6.17-owrt/arch/mips/aruba/serial.c
689 --- linux-2.6.17/arch/mips/aruba/serial.c 1970-01-01 01:00:00.000000000 +0100
690 +++ linux-2.6.17-owrt/arch/mips/aruba/serial.c 2006-06-18 12:44:28.000000000 +0200
692 +/**************************************************************************
694 + * BRIEF MODULE DESCRIPTION
695 + * Serial port initialisation.
697 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
699 + * This program is free software; you can redistribute it and/or modify it
700 + * under the terms of the GNU General Public License as published by the
701 + * Free Software Foundation; either version 2 of the License, or (at your
702 + * option) any later version.
704 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
705 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
706 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
707 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
708 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
709 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
710 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
711 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
712 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
713 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
715 + * You should have received a copy of the GNU General Public License along
716 + * with this program; if not, write to the Free Software Foundation, Inc.,
717 + * 675 Mass Ave, Cambridge, MA 02139, USA.
720 + **************************************************************************
721 + * May 2004 rkt, neb
727 + **************************************************************************
731 +#include <linux/autoconf.h>
732 +#include <linux/init.h>
733 +#include <linux/sched.h>
734 +#include <linux/pci.h>
735 +#include <linux/interrupt.h>
736 +#include <linux/tty.h>
737 +#include <linux/serial.h>
738 +#include <linux/serial_core.h>
740 +#include <asm/time.h>
741 +#include <asm/cpu.h>
742 +#include <asm/bootinfo.h>
743 +#include <asm/irq.h>
744 +#include <asm/serial.h>
746 +#include <asm/idt-boards/rc32434/rc32434.h>
748 +extern int __init early_serial_setup(struct uart_port *port);
750 +#define BASE_BAUD (1843200 / 16)
752 +extern unsigned int idt_cpu_freq;
754 +extern int __init setup_serial_port(void)
756 + static struct uart_port serial_req[2];
758 + memset(serial_req, 0, sizeof(serial_req));
759 + serial_req[0].type = PORT_16550A;
760 + serial_req[0].line = 0;
761 + serial_req[0].flags = STD_COM_FLAGS;
762 + serial_req[0].iotype = SERIAL_IO_MEM;
763 + serial_req[0].regshift = 2;
765 + switch (mips_machtype) {
766 + case MACH_ARUBA_AP70:
767 + serial_req[0].irq = 104;
768 + serial_req[0].mapbase = KSEG1ADDR(0x18058003);
769 + serial_req[0].membase = (char *) KSEG1ADDR(0x18058003);
770 + serial_req[0].uartclk = idt_cpu_freq;
772 + case MACH_ARUBA_AP65:
773 + case MACH_ARUBA_AP60:
775 + serial_req[0].irq = 12;
776 + serial_req[0].mapbase = KSEG1ADDR(0xbc000003);
777 + serial_req[0].membase = (char *) KSEG1ADDR(0xbc000003);
778 + serial_req[0].uartclk = idt_cpu_freq / 2;
782 + early_serial_setup(&serial_req[0]);
786 diff -Nur linux-2.6.17/arch/mips/aruba/setup.c linux-2.6.17-owrt/arch/mips/aruba/setup.c
787 --- linux-2.6.17/arch/mips/aruba/setup.c 1970-01-01 01:00:00.000000000 +0100
788 +++ linux-2.6.17-owrt/arch/mips/aruba/setup.c 2006-06-18 12:44:28.000000000 +0200
790 +/**************************************************************************
792 + * BRIEF MODULE DESCRIPTION
793 + * setup routines for IDT EB434 boards
795 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
797 + * This program is free software; you can redistribute it and/or modify it
798 + * under the terms of the GNU General Public License as published by the
799 + * Free Software Foundation; either version 2 of the License, or (at your
800 + * option) any later version.
802 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
803 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
804 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
805 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
806 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
807 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
808 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
809 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
810 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
811 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
813 + * You should have received a copy of the GNU General Public License along
814 + * with this program; if not, write to the Free Software Foundation, Inc.,
815 + * 675 Mass Ave, Cambridge, MA 02139, USA.
818 + **************************************************************************
819 + * May 2004 rkt, neb
825 + **************************************************************************
828 +#include <linux/init.h>
829 +#include <linux/module.h>
830 +#include <linux/mm.h>
831 +#include <linux/sched.h>
832 +#include <linux/irq.h>
833 +#include <asm/bootinfo.h>
835 +#include <linux/ioport.h>
836 +#include <asm/mipsregs.h>
837 +#include <asm/pgtable.h>
838 +#include <asm/reboot.h>
839 +#include <asm/addrspace.h> /* for KSEG1ADDR() */
840 +#include <asm/idt-boards/rc32434/rc32434.h>
841 +#include <linux/pm.h>
843 +extern char *__init prom_getcmdline(void);
845 +extern void (*board_time_init) (void);
846 +extern void aruba_time_init(void);
847 +extern void aruba_reset(void);
849 +#define epldMask ((volatile unsigned char *)0xB900000d)
851 +static void aruba_machine_restart(char *command)
853 + switch (mips_machtype) {
854 + case MACH_ARUBA_AP70:
855 + *(volatile u32 *)KSEG1ADDR(0x18008000) = 0x80000001;
857 + case MACH_ARUBA_AP65:
858 + case MACH_ARUBA_AP60:
861 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0x00080350; // reset everything in sight
863 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0; // reset everything in sight
865 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0x3; // cold reset the cpu & system
870 +static void aruba_machine_halt(void)
875 +extern char * getenv(char *e);
876 +extern void unlock_ap60_70_flash(void);
878 +void __init plat_mem_setup(void)
880 + board_time_init = aruba_time_init;
882 + _machine_restart = aruba_machine_restart;
883 + _machine_halt = aruba_machine_halt;
884 + pm_power_off = aruba_machine_halt;
886 + set_io_port_base(KSEG1);
888 + /* Enable PCI interrupts in EPLD Mask register */
890 + *(epldMask + 1) = 0x0;
893 + unlock_ap60_70_flash();
895 + printk("BOARD - %s\n",getenv("boardname"));
898 +int page_is_ram(unsigned long pagenr)
903 +const char *get_system_type(void)
905 + switch (mips_machtype) {
906 + case MACH_ARUBA_AP70:
907 + return "Aruba AP70";
908 + case MACH_ARUBA_AP65:
909 + return "Aruba AP65";
910 + case MACH_ARUBA_AP60:
911 + return "Aruba AP60/AP61";
913 + return "Aruba UNKNOWN";
917 +EXPORT_SYMBOL(get_system_type);
918 diff -Nur linux-2.6.17/arch/mips/aruba/time.c linux-2.6.17-owrt/arch/mips/aruba/time.c
919 --- linux-2.6.17/arch/mips/aruba/time.c 1970-01-01 01:00:00.000000000 +0100
920 +++ linux-2.6.17-owrt/arch/mips/aruba/time.c 2006-06-18 12:44:28.000000000 +0200
922 +/**************************************************************************
924 + * BRIEF MODULE DESCRIPTION
925 + * timer routines for IDT EB434 boards
927 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
929 + * This program is free software; you can redistribute it and/or modify it
930 + * under the terms of the GNU General Public License as published by the
931 + * Free Software Foundation; either version 2 of the License, or (at your
932 + * option) any later version.
934 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
935 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
936 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
937 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
938 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
939 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
940 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
941 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
942 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
943 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
945 + * You should have received a copy of the GNU General Public License along
946 + * with this program; if not, write to the Free Software Foundation, Inc.,
947 + * 675 Mass Ave, Cambridge, MA 02139, USA.
950 + **************************************************************************
951 + * May 2004 rkt, neb
957 + **************************************************************************
960 +#include <linux/autoconf.h>
961 +#include <linux/init.h>
962 +#include <linux/kernel_stat.h>
963 +#include <linux/sched.h>
964 +#include <linux/spinlock.h>
965 +#include <linux/mc146818rtc.h>
966 +#include <linux/irq.h>
967 +#include <linux/timex.h>
969 +#include <linux/param.h>
970 +#include <asm/mipsregs.h>
971 +#include <asm/ptrace.h>
972 +#include <asm/time.h>
973 +#include <asm/hardirq.h>
975 +#include <asm/mipsregs.h>
976 +#include <asm/ptrace.h>
977 +#include <asm/debug.h>
978 +#include <asm/time.h>
980 +#include <asm/idt-boards/rc32434/rc32434.h>
982 +static unsigned long r4k_offset; /* Amount to incr compare reg each time */
983 +static unsigned long r4k_cur; /* What counter should be at next timer irq */
985 +extern unsigned int idt_cpu_freq;
987 +static unsigned long __init cal_r4koff(void)
989 + mips_hpt_frequency = idt_cpu_freq * IDT_CLOCK_MULT / 2;
990 + return (mips_hpt_frequency / HZ);
993 +void __init aruba_time_init(void)
995 + unsigned int est_freq, flags;
996 + local_irq_save(flags);
998 + printk("calculating r4koff... ");
999 + r4k_offset = cal_r4koff();
1000 + printk("%08lx(%d)\n", r4k_offset, (int)r4k_offset);
1002 + est_freq = 2 * r4k_offset * HZ;
1003 + est_freq += 5000; /* round */
1004 + est_freq -= est_freq % 10000;
1005 + printk("CPU frequency %d.%02d MHz\n", est_freq / 1000000,
1006 + (est_freq % 1000000) * 100 / 1000000);
1007 + local_irq_restore(flags);
1011 +void __init plat_timer_setup(struct irqaction *irq)
1013 + /* we are using the cpu counter for timer interrupts */
1014 + setup_irq(MIPS_CPU_TIMER_IRQ, irq);
1016 + /* to generate the first timer interrupt */
1017 + r4k_cur = (read_c0_count() + r4k_offset);
1018 + write_c0_compare(r4k_cur);
1022 +asmlinkage void aruba_timer_interrupt(struct pt_regs *regs)
1024 + int irq = MIPS_CPU_TIMER_IRQ;
1027 + kstat_this_cpu.irqs[irq]++;
1029 + timer_interrupt(irq, NULL);
1032 diff -Nur linux-2.6.17/arch/mips/Kconfig linux-2.6.17-owrt/arch/mips/Kconfig
1033 --- linux-2.6.17/arch/mips/Kconfig 2006-06-18 03:49:35.000000000 +0200
1034 +++ linux-2.6.17-owrt/arch/mips/Kconfig 2006-06-18 12:44:28.000000000 +0200
1035 @@ -227,6 +227,17 @@
1036 either a NEC Vr5432 or QED RM5231. Say Y here if you wish to build
1037 a kernel for this platform.
1040 + bool "Support for the ARUBA product line"
1041 + select DMA_NONCOHERENT
1042 + select CPU_HAS_PREFETCH
1044 + select SWAP_IO_SPACE
1045 + select SYS_SUPPORTS_32BIT_KERNEL
1046 + select SYS_HAS_CPU_MIPS32_R1
1047 + select SYS_SUPPORTS_BIG_ENDIAN
1051 bool "Jazz family of machines"
1053 diff -Nur linux-2.6.17/arch/mips/Makefile linux-2.6.17-owrt/arch/mips/Makefile
1054 --- linux-2.6.17/arch/mips/Makefile 2006-06-18 03:49:35.000000000 +0200
1055 +++ linux-2.6.17-owrt/arch/mips/Makefile 2006-06-18 12:44:28.000000000 +0200
1056 @@ -145,6 +145,14 @@
1063 +core-$(CONFIG_MACH_ARUBA) += arch/mips/aruba/
1064 +cflags-$(CONFIG_MACH_ARUBA) += -Iinclude/asm-mips/aruba
1065 +load-$(CONFIG_MACH_ARUBA) += 0x80100000
1068 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
1070 core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
1071 diff -Nur linux-2.6.17/arch/mips/mm/tlbex.c linux-2.6.17-owrt/arch/mips/mm/tlbex.c
1072 --- linux-2.6.17/arch/mips/mm/tlbex.c 2006-06-18 03:49:35.000000000 +0200
1073 +++ linux-2.6.17-owrt/arch/mips/mm/tlbex.c 2006-06-18 12:48:27.000000000 +0200
1090 diff -Nur linux-2.6.17/drivers/net/Kconfig linux-2.6.17-owrt/drivers/net/Kconfig
1091 --- linux-2.6.17/drivers/net/Kconfig 2006-06-18 03:49:35.000000000 +0200
1092 +++ linux-2.6.17-owrt/drivers/net/Kconfig 2006-06-18 12:44:28.000000000 +0200
1093 @@ -187,6 +187,13 @@
1095 source "drivers/net/arm/Kconfig"
1097 +config IDT_RC32434_ETH
1098 + tristate "IDT RC32434 Local Ethernet support"
1099 + depends on NET_ETHERNET
1101 + IDT RC32434 has one local ethernet port. Say Y here to enable it.
1102 + To compile this driver as a module, choose M here.
1105 tristate "MACE (Power Mac ethernet) support"
1106 depends on NET_ETHERNET && PPC_PMAC && PPC32
1107 diff -Nur linux-2.6.17/drivers/net/Makefile linux-2.6.17-owrt/drivers/net/Makefile
1108 --- linux-2.6.17/drivers/net/Makefile 2006-06-18 03:49:35.000000000 +0200
1109 +++ linux-2.6.17-owrt/drivers/net/Makefile 2006-06-18 12:44:28.000000000 +0200
1112 obj-$(CONFIG_OAKNET) += oaknet.o 8390.o
1114 +obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
1115 obj-$(CONFIG_DGRS) += dgrs.o
1116 obj-$(CONFIG_VORTEX) += 3c59x.o
1117 obj-$(CONFIG_TYPHOON) += typhoon.o
1118 diff -Nur linux-2.6.17/drivers/net/natsemi.c linux-2.6.17-owrt/drivers/net/natsemi.c
1119 --- linux-2.6.17/drivers/net/natsemi.c 2006-06-18 03:49:35.000000000 +0200
1120 +++ linux-2.6.17-owrt/drivers/net/natsemi.c 2006-06-18 12:44:28.000000000 +0200
1121 @@ -771,6 +771,49 @@
1122 static int netdev_get_eeprom(struct net_device *dev, u8 *buf);
1123 static struct ethtool_ops ethtool_ops;
1125 +#ifdef CONFIG_MACH_ARUBA
1127 +#include <linux/ctype.h>
1130 +#define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args)
1133 +static int parse_mac_addr(struct net_device *dev, char* macstr)
1136 + unsigned char result, value;
1138 + for (i=0; i<6; i++) {
1140 + if (i != 5 && *(macstr+2) != ':') {
1141 + ERR("invalid mac address format: %d %c\n",
1145 + for (j=0; j<2; j++) {
1146 + if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
1147 + toupper(*macstr)-'A'+10) < 16) {
1148 + result = result*16 + value;
1152 + ERR("invalid mac address "
1153 + "character: %c\n", *macstr);
1159 + dev->dev_addr[i] = result;
1162 + dev->dev_addr[5]++;
1168 static inline void __iomem *ns_ioaddr(struct net_device *dev)
1170 return (void __iomem *) dev->base_addr;
1175 +#ifndef CONFIG_MACH_ARUBA
1176 /* Work around the dropped serial bit. */
1177 prev_eedata = eeprom_read(ioaddr, 6);
1178 for (i = 0; i < 3; i++) {
1179 @@ -879,6 +923,19 @@
1180 dev->dev_addr[i*2+1] = eedata >> 7;
1181 prev_eedata = eedata;
1186 + unsigned char def_mac[6] = {00, 0x0b, 0x86, 0xba, 0xdb, 0xad};
1187 + extern char *getenv(char *e);
1188 + memset(mac, 0, 32);
1189 + memcpy(mac, getenv("ethaddr"), 17);
1190 + if (parse_mac_addr(dev, mac)){
1191 + printk("%s: MAC address not found\n", __func__);
1192 + memcpy(dev->dev_addr, def_mac, 6);
1197 dev->base_addr = (unsigned long __force) ioaddr;
1199 diff -Nur linux-2.6.17/drivers/net/rc32434_eth.c linux-2.6.17-owrt/drivers/net/rc32434_eth.c
1200 --- linux-2.6.17/drivers/net/rc32434_eth.c 1970-01-01 01:00:00.000000000 +0100
1201 +++ linux-2.6.17-owrt/drivers/net/rc32434_eth.c 2006-06-18 12:44:28.000000000 +0200
1203 +/**************************************************************************
1205 + * BRIEF MODULE DESCRIPTION
1206 + * Driver for the IDT RC32434 on-chip ethernet controller.
1208 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1210 + * This program is free software; you can redistribute it and/or modify it
1211 + * under the terms of the GNU General Public License as published by the
1212 + * Free Software Foundation; either version 2 of the License, or (at your
1213 + * option) any later version.
1215 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1216 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1217 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1218 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1219 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1220 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1221 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1222 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1223 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1224 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1226 + * You should have received a copy of the GNU General Public License along
1227 + * with this program; if not, write to the Free Software Foundation, Inc.,
1228 + * 675 Mass Ave, Cambridge, MA 02139, USA.
1231 + **************************************************************************
1232 + * May 2004 rkt, neb
1234 + * Based on the driver developed by B. Maruthanayakam, H. Kou and others.
1240 + **************************************************************************
1243 +#include <linux/autoconf.h>
1244 +#include <linux/version.h>
1245 +#include <linux/module.h>
1246 +#include <linux/kernel.h>
1247 +#include <linux/moduleparam.h>
1248 +#include <linux/sched.h>
1249 +#include <linux/ctype.h>
1250 +#include <linux/types.h>
1251 +#include <linux/fcntl.h>
1252 +#include <linux/interrupt.h>
1253 +#include <linux/ptrace.h>
1254 +#include <linux/init.h>
1255 +#include <linux/ioport.h>
1256 +#include <linux/proc_fs.h>
1257 +#include <linux/in.h>
1258 +#include <linux/slab.h>
1259 +#include <linux/string.h>
1260 +#include <linux/delay.h>
1261 +#include <linux/netdevice.h>
1262 +#include <linux/etherdevice.h>
1263 +#include <linux/skbuff.h>
1264 +#include <linux/errno.h>
1265 +#include <asm/bootinfo.h>
1266 +#include <asm/system.h>
1267 +#include <asm/bitops.h>
1268 +#include <asm/pgtable.h>
1269 +#include <asm/segment.h>
1270 +#include <asm/io.h>
1271 +#include <asm/dma.h>
1273 +#include "rc32434_eth.h"
1275 +#define DRIVER_VERSION "(mar2904)"
1277 +#define DRIVER_NAME "rc32434 Ethernet driver. " DRIVER_VERSION
1280 +#define STATION_ADDRESS_HIGH(dev) (((dev)->dev_addr[0] << 8) | \
1281 + ((dev)->dev_addr[1]))
1282 +#define STATION_ADDRESS_LOW(dev) (((dev)->dev_addr[2] << 24) | \
1283 + ((dev)->dev_addr[3] << 16) | \
1284 + ((dev)->dev_addr[4] << 8) | \
1285 + ((dev)->dev_addr[5]))
1287 +#define MII_CLOCK 1250000 /* no more than 2.5MHz */
1288 +static char mac0[18] = "08:00:06:05:40:01";
1290 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,52)
1291 +module_param_string(mac0, mac0, 18, 0);
1293 +MODULE_PARM(mac0, "c18");
1295 +MODULE_PARM_DESC(mac0, "MAC address for RC32434 ethernet0");
1297 +static struct rc32434_if_t {
1299 + struct net_device *dev;
1309 +} rc32434_iflist[] =
1312 + "rc32434_eth0", NULL, mac0,
1314 + ETH0_PhysicalAddress,
1325 +static int parse_mac_addr(struct net_device *dev, char* macstr)
1328 + unsigned char result, value;
1330 + for (i=0; i<6; i++) {
1332 + if (i != 5 && *(macstr+2) != ':') {
1333 + ERR("invalid mac address format: %d %c\n",
1337 + for (j=0; j<2; j++) {
1338 + if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
1339 + toupper(*macstr)-'A'+10) < 16) {
1340 + result = result*16 + value;
1344 + ERR("invalid mac address "
1345 + "character: %c\n", *macstr);
1351 + dev->dev_addr[i] = result;
1359 +static inline void rc32434_abort_tx(struct net_device *dev)
1361 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1362 + rc32434_abort_dma(dev, lp->tx_dma_regs);
1366 +static inline void rc32434_abort_rx(struct net_device *dev)
1368 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1369 + rc32434_abort_dma(dev, lp->rx_dma_regs);
1373 +static inline void rc32434_start_tx(struct rc32434_local *lp, volatile DMAD_t td)
1375 + rc32434_start_dma(lp->tx_dma_regs, CPHYSADDR(td));
1378 +static inline void rc32434_start_rx(struct rc32434_local *lp, volatile DMAD_t rd)
1380 + rc32434_start_dma(lp->rx_dma_regs, CPHYSADDR(rd));
1383 +static inline void rc32434_chain_tx(struct rc32434_local *lp, volatile DMAD_t td)
1385 + rc32434_chain_dma(lp->tx_dma_regs, CPHYSADDR(td));
1388 +static inline void rc32434_chain_rx(struct rc32434_local *lp, volatile DMAD_t rd)
1390 + rc32434_chain_dma(lp->rx_dma_regs, CPHYSADDR(rd));
1393 +#ifdef RC32434_PROC_DEBUG
1394 +static int rc32434_read_proc(char *buf, char **start, off_t fpos,
1395 + int length, int *eof, void *data)
1397 + struct net_device *dev = (struct net_device *)data;
1398 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1401 + /* print out header */
1402 + len += sprintf(buf + len, "\n\tRC32434 Ethernet Debug\n\n");
1403 + len += sprintf (buf + len,
1404 + "DMA halt count = %10d, DMA run count = %10d\n",
1405 + lp->dma_halt_cnt, lp->dma_run_cnt);
1407 + if (fpos >= len) {
1412 + *start = buf + fpos;
1414 + if ((len -= fpos) > length)
1425 + * Restart the RC32434 ethernet controller.
1427 +static int rc32434_restart(struct net_device *dev)
1429 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1432 + * Disable interrupts
1434 + disable_irq(lp->rx_irq);
1435 + disable_irq(lp->tx_irq);
1436 +#ifdef RC32434_REVISION
1437 + disable_irq(lp->ovr_irq);
1439 + disable_irq(lp->und_irq);
1441 + /* Mask F E bit in Tx DMA */
1442 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) | DMASM_f_m | DMASM_e_m, &lp->tx_dma_regs->dmasm);
1443 + /* Mask D H E bit in Rx DMA */
1444 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) | DMASM_d_m | DMASM_h_m | DMASM_e_m, &lp->rx_dma_regs->dmasm);
1446 + rc32434_init(dev);
1447 + rc32434_multicast_list(dev);
1449 + enable_irq(lp->und_irq);
1450 +#ifdef RC32434_REVISION
1451 + enable_irq(lp->ovr_irq);
1453 + enable_irq(lp->tx_irq);
1454 + enable_irq(lp->rx_irq);
1459 +int rc32434_init_module(void)
1461 +#ifdef CONFIG_MACH_ARUBA
1462 + if (mips_machtype != MACH_ARUBA_AP70)
1466 + printk(KERN_INFO DRIVER_NAME " \n");
1467 + return rc32434_probe(0);
1470 +static int rc32434_probe(int port_num)
1472 + struct rc32434_if_t *bif = &rc32434_iflist[port_num];
1473 + struct rc32434_local *lp = NULL;
1474 + struct net_device *dev = NULL;
1475 + int i, retval,err;
1477 + dev = alloc_etherdev(sizeof(struct rc32434_local));
1479 + ERR("rc32434_eth: alloc_etherdev failed\n");
1483 + SET_MODULE_OWNER(dev);
1486 +#ifdef CONFIG_MACH_ARUBA
1488 + extern char * getenv(char *e);
1489 + memcpy(bif->mac_str, getenv("ethaddr"), 17);
1493 + printk("mac: %s\n", bif->mac_str);
1494 + if ((retval = parse_mac_addr(dev, bif->mac_str))) {
1495 + ERR("MAC address parse failed\n");
1501 + /* Initialize the device structure. */
1502 + if (dev->priv == NULL) {
1503 + lp = (struct rc32434_local *)kmalloc(sizeof(*lp), GFP_KERNEL);
1504 + memset(lp, 0, sizeof(struct rc32434_local));
1507 + lp = (struct rc32434_local *)dev->priv;
1510 + lp->rx_irq = bif->rx_dma_irq;
1511 + lp->tx_irq = bif->tx_dma_irq;
1512 + lp->ovr_irq = bif->rx_ovr_irq;
1513 + lp->und_irq = bif->tx_und_irq;
1515 + lp->eth_regs = ioremap_nocache(bif->iobase, sizeof(*lp->eth_regs));
1517 + if (!lp->eth_regs) {
1518 + ERR("Can't remap eth registers\n");
1520 + goto probe_err_out;
1523 + lp->rx_dma_regs = ioremap_nocache(bif->rxdmabase, sizeof(struct DMA_Chan_s));
1525 + if (!lp->rx_dma_regs) {
1526 + ERR("Can't remap Rx DMA registers\n");
1528 + goto probe_err_out;
1530 + lp->tx_dma_regs = ioremap_nocache(bif->txdmabase,sizeof(struct DMA_Chan_s));
1532 + if (!lp->tx_dma_regs) {
1533 + ERR("Can't remap Tx DMA registers\n");
1535 + goto probe_err_out;
1538 +#ifdef RC32434_PROC_DEBUG
1539 + lp->ps = create_proc_read_entry (bif->name, 0, proc_net,
1540 + rc32434_read_proc, dev);
1543 + lp->td_ring = (DMAD_t)kmalloc(TD_RING_SIZE + RD_RING_SIZE, GFP_KERNEL);
1544 + if (!lp->td_ring) {
1545 + ERR("Can't allocate descriptors\n");
1547 + goto probe_err_out;
1550 + dma_cache_inv((unsigned long)(lp->td_ring), TD_RING_SIZE + RD_RING_SIZE);
1552 + /* now convert TD_RING pointer to KSEG1 */
1553 + lp->td_ring = (DMAD_t )KSEG1ADDR(lp->td_ring);
1554 + lp->rd_ring = &lp->td_ring[RC32434_NUM_TDS];
1557 + spin_lock_init(&lp->lock);
1559 + dev->base_addr = bif->iobase;
1560 + /* just use the rx dma irq */
1561 + dev->irq = bif->rx_dma_irq;
1565 + dev->open = rc32434_open;
1566 + dev->stop = rc32434_close;
1567 + dev->hard_start_xmit = rc32434_send_packet;
1568 + dev->get_stats = rc32434_get_stats;
1569 + dev->set_multicast_list = &rc32434_multicast_list;
1570 + dev->tx_timeout = rc32434_tx_timeout;
1571 + dev->watchdog_timeo = RC32434_TX_TIMEOUT;
1573 +#ifdef CONFIG_IDT_USE_NAPI
1574 + dev->poll = rc32434_poll;
1575 + dev->weight = bif->weight;
1576 + printk("Using NAPI with weight %d\n",dev->weight);
1578 + lp->rx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
1579 + tasklet_init(lp->rx_tasklet, rc32434_rx_tasklet, (unsigned long)dev);
1581 + lp->tx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
1582 + tasklet_init(lp->tx_tasklet, rc32434_tx_tasklet, (unsigned long)dev);
1584 + if ((err = register_netdev(dev))) {
1585 + printk(KERN_ERR "rc32434 ethernet. Cannot register net device %d\n", err);
1588 + goto probe_err_out;
1591 + INFO("Rx IRQ %d, Tx IRQ %d, ", bif->rx_dma_irq, bif->tx_dma_irq);
1592 + for (i = 0; i < 6; i++) {
1593 + printk("%2.2x", dev->dev_addr[i]);
1602 + rc32434_cleanup_module();
1603 + ERR(" failed. Returns %d\n", retval);
1609 +static void rc32434_cleanup_module(void)
1613 + for (i = 0; rc32434_iflist[i].iobase; i++) {
1614 + struct rc32434_if_t * bif = &rc32434_iflist[i];
1615 + if (bif->dev != NULL) {
1616 + struct rc32434_local *lp = (struct rc32434_local *)bif->dev->priv;
1619 + iounmap((void*)lp->eth_regs);
1620 + if (lp->rx_dma_regs)
1621 + iounmap((void*)lp->rx_dma_regs);
1622 + if (lp->tx_dma_regs)
1623 + iounmap((void*)lp->tx_dma_regs);
1625 + kfree((void*)KSEG0ADDR(lp->td_ring));
1627 +#ifdef RC32434_PROC_DEBUG
1629 + remove_proc_entry(bif->name, proc_net);
1635 + unregister_netdev(bif->dev);
1636 + free_netdev(bif->dev);
1644 +static int rc32434_open(struct net_device *dev)
1646 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1649 + if (rc32434_init(dev)) {
1650 + ERR("Error: cannot open the Ethernet device\n");
1654 + /* Install the interrupt handler that handles the Done Finished Ovr and Und Events */
1655 + if (request_irq(lp->rx_irq, &rc32434_rx_dma_interrupt,
1656 + SA_SHIRQ | SA_INTERRUPT,
1657 + "rc32434 ethernet Rx", dev)) {
1658 + ERR(": unable to get Rx DMA IRQ %d\n",
1662 + if (request_irq(lp->tx_irq, &rc32434_tx_dma_interrupt,
1663 + SA_SHIRQ | SA_INTERRUPT,
1664 + "rc32434 ethernet Tx", dev)) {
1665 + ERR(": unable to get Tx DMA IRQ %d\n",
1667 + free_irq(lp->rx_irq, dev);
1671 +#ifdef RC32434_REVISION
1672 + /* Install handler for overrun error. */
1673 + if (request_irq(lp->ovr_irq, &rc32434_ovr_interrupt,
1674 + SA_SHIRQ | SA_INTERRUPT,
1675 + "Ethernet Overflow", dev)) {
1676 + ERR(": unable to get OVR IRQ %d\n",
1678 + free_irq(lp->rx_irq, dev);
1679 + free_irq(lp->tx_irq, dev);
1684 + /* Install handler for underflow error. */
1685 + if (request_irq(lp->und_irq, &rc32434_und_interrupt,
1686 + SA_SHIRQ | SA_INTERRUPT,
1687 + "Ethernet Underflow", dev)) {
1688 + ERR(": unable to get UND IRQ %d\n",
1690 + free_irq(lp->rx_irq, dev);
1691 + free_irq(lp->tx_irq, dev);
1692 +#ifdef RC32434_REVISION
1693 + free_irq(lp->ovr_irq, dev);
1705 +static int rc32434_close(struct net_device *dev)
1707 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1710 + /* Disable interrupts */
1711 + disable_irq(lp->rx_irq);
1712 + disable_irq(lp->tx_irq);
1713 +#ifdef RC32434_REVISION
1714 + disable_irq(lp->ovr_irq);
1716 + disable_irq(lp->und_irq);
1718 + tmp = rc32434_readl(&lp->tx_dma_regs->dmasm);
1719 + tmp = tmp | DMASM_f_m | DMASM_e_m;
1720 + rc32434_writel(tmp, &lp->tx_dma_regs->dmasm);
1722 + tmp = rc32434_readl(&lp->rx_dma_regs->dmasm);
1723 + tmp = tmp | DMASM_d_m | DMASM_h_m | DMASM_e_m;
1724 + rc32434_writel(tmp, &lp->rx_dma_regs->dmasm);
1726 + free_irq(lp->rx_irq, dev);
1727 + free_irq(lp->tx_irq, dev);
1728 +#ifdef RC32434_REVISION
1729 + free_irq(lp->ovr_irq, dev);
1731 + free_irq(lp->und_irq, dev);
1736 +/* transmit packet */
1737 +static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev)
1739 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1740 + unsigned long flags;
1745 + spin_lock_irqsave(&lp->lock, flags);
1747 + td = &lp->td_ring[lp->tx_chain_tail];
1749 + /* stop queue when full, drop pkts if queue already full */
1750 + if(lp->tx_count >= (RC32434_NUM_TDS - 2)) {
1753 + if(lp->tx_count == (RC32434_NUM_TDS - 2)) {
1754 + netif_stop_queue(dev);
1757 + lp->stats.tx_dropped++;
1758 + dev_kfree_skb_any(skb);
1759 + spin_unlock_irqrestore(&lp->lock, flags);
1766 + lp->tx_skb[lp->tx_chain_tail] = skb;
1768 + length = skb->len;
1770 + /* Setup the transmit descriptor. */
1771 + td->ca = CPHYSADDR(skb->data);
1773 + if(rc32434_readl(&(lp->tx_dma_regs->dmandptr)) == 0) {
1774 + if( lp->tx_chain_status == empty ) {
1775 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1776 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1777 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR */
1778 + lp->tx_chain_head = lp->tx_chain_tail; /* Move head to tail */
1781 + td->control = DMA_COUNT(length) |DMAD_cof_m|DMAD_iof_m; /* Update tail */
1782 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &= ~(DMAD_cof_m); /* Link to prev */
1783 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link = CPHYSADDR(td); /* Link to prev */
1784 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1785 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR */
1786 + lp->tx_chain_head = lp->tx_chain_tail; /* Move head to tail */
1787 + lp->tx_chain_status = empty;
1791 + if( lp->tx_chain_status == empty ) {
1792 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1793 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1794 + lp->tx_chain_status = filled;
1797 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1798 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &= ~(DMAD_cof_m); /* Link to prev */
1799 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link = CPHYSADDR(td); /* Link to prev */
1800 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1804 + dev->trans_start = jiffies;
1806 + spin_unlock_irqrestore(&lp->lock, flags);
1812 +/* Ethernet MII-PHY Handler */
1813 +static void rc32434_mii_handler(unsigned long data)
1815 + struct net_device *dev = (struct net_device *)data;
1816 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1817 + unsigned long flags;
1818 + unsigned long duplex_status;
1819 + int port_addr = (lp->rx_irq == 0x2c? 1:0) << 8;
1821 + spin_lock_irqsave(&lp->lock, flags);
1823 + /* Two ports are using the same MII, the difference is the PHY address */
1824 + rc32434_writel(0, &rc32434_eth0_regs->miimcfg);
1825 + rc32434_writel(0, &rc32434_eth0_regs->miimcmd);
1826 + rc32434_writel(port_addr |0x05, &rc32434_eth0_regs->miimaddr);
1827 + rc32434_writel(MIIMCMD_scn_m, &rc32434_eth0_regs->miimcmd);
1828 + while(rc32434_readl(&rc32434_eth0_regs->miimind) & MIIMIND_nv_m);
1830 + ERR("irq:%x port_addr:%x RDD:%x\n",
1831 + lp->rx_irq, port_addr, rc32434_readl(&rc32434_eth0_regs->miimrdd));
1832 + duplex_status = (rc32434_readl(&rc32434_eth0_regs->miimrdd) & 0x140)? ETHMAC2_fd_m: 0;
1833 + if(duplex_status != lp->duplex_mode) {
1834 + 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);
1835 + lp->duplex_mode = duplex_status;
1836 + rc32434_restart(dev);
1839 + lp->mii_phy_timer.expires = jiffies + 10 * HZ;
1840 + add_timer(&lp->mii_phy_timer);
1842 + spin_unlock_irqrestore(&lp->lock, flags);
1846 +#ifdef RC32434_REVISION
1847 +/* Ethernet Rx Overflow interrupt */
1849 +rc32434_ovr_interrupt(int irq, void *dev_id)
1851 + struct net_device *dev = (struct net_device *)dev_id;
1852 + struct rc32434_local *lp;
1854 + irqreturn_t retval = IRQ_NONE;
1856 + ASSERT(dev != NULL);
1858 + lp = (struct rc32434_local *)dev->priv;
1859 + spin_lock(&lp->lock);
1860 + ovr = rc32434_readl(&lp->eth_regs->ethintfc);
1862 + if(ovr & ETHINTFC_ovr_m) {
1863 + netif_stop_queue(dev);
1865 + /* clear OVR bit */
1866 + rc32434_writel((ovr & ~ETHINTFC_ovr_m), &lp->eth_regs->ethintfc);
1868 + /* Restart interface */
1869 + rc32434_restart(dev);
1870 + retval = IRQ_HANDLED;
1872 + spin_unlock(&lp->lock);
1880 +/* Ethernet Tx Underflow interrupt */
1882 +rc32434_und_interrupt(int irq, void *dev_id)
1884 + struct net_device *dev = (struct net_device *)dev_id;
1885 + struct rc32434_local *lp;
1887 + irqreturn_t retval = IRQ_NONE;
1889 + ASSERT(dev != NULL);
1891 + lp = (struct rc32434_local *)dev->priv;
1893 + spin_lock(&lp->lock);
1895 + und = rc32434_readl(&lp->eth_regs->ethintfc);
1897 + if(und & ETHINTFC_und_m) {
1898 + netif_stop_queue(dev);
1900 + rc32434_writel((und & ~ETHINTFC_und_m), &lp->eth_regs->ethintfc);
1902 + /* Restart interface */
1903 + rc32434_restart(dev);
1904 + retval = IRQ_HANDLED;
1907 + spin_unlock(&lp->lock);
1913 +/* Ethernet Rx DMA interrupt */
1915 +rc32434_rx_dma_interrupt(int irq, void *dev_id)
1917 + struct net_device *dev = (struct net_device *)dev_id;
1918 + struct rc32434_local* lp;
1919 + volatile u32 dmas,dmasm;
1920 + irqreturn_t retval;
1922 + ASSERT(dev != NULL);
1924 + lp = (struct rc32434_local *)dev->priv;
1926 + spin_lock(&lp->lock);
1927 + dmas = rc32434_readl(&lp->rx_dma_regs->dmas);
1928 + if(dmas & (DMAS_d_m|DMAS_h_m|DMAS_e_m)) {
1929 + /* Mask D H E bit in Rx DMA */
1930 + dmasm = rc32434_readl(&lp->rx_dma_regs->dmasm);
1931 + rc32434_writel(dmasm | (DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm);
1932 +#ifdef CONFIG_IDT_USE_NAPI
1933 + if(netif_rx_schedule_prep(dev))
1934 + __netif_rx_schedule(dev);
1936 + tasklet_hi_schedule(lp->rx_tasklet);
1939 + if (dmas & DMAS_e_m)
1940 + ERR(": DMA error\n");
1942 + retval = IRQ_HANDLED;
1945 + retval = IRQ_NONE;
1947 + spin_unlock(&lp->lock);
1951 +#ifdef CONFIG_IDT_USE_NAPI
1952 +static int rc32434_poll(struct net_device *rx_data_dev, int *budget)
1954 +static void rc32434_rx_tasklet(unsigned long rx_data_dev)
1957 + struct net_device *dev = (struct net_device *)rx_data_dev;
1958 + struct rc32434_local* lp = netdev_priv(dev);
1959 + volatile DMAD_t rd = &lp->rd_ring[lp->rx_next_done];
1960 + struct sk_buff *skb, *skb_new;
1962 + u32 devcs, count, pkt_len, pktuncrc_len;
1963 + volatile u32 dmas;
1964 +#ifdef CONFIG_IDT_USE_NAPI
1966 + int rx_work_limit = min(*budget,dev->quota);
1968 + unsigned long flags;
1969 + spin_lock_irqsave(&lp->lock, flags);
1972 + while ( (count = RC32434_RBSIZE - (u32)DMA_COUNT(rd->control)) != 0) {
1973 +#ifdef CONFIG_IDT_USE_NAPI
1974 + if(--rx_work_limit <0)
1979 + /* init the var. used for the later operations within the while loop */
1981 + devcs = rd->devcs;
1982 + pkt_len = RCVPKT_LENGTH(devcs);
1983 + skb = lp->rx_skb[lp->rx_next_done];
1986 + lp->stats.rx_errors++;
1987 + lp->stats.rx_dropped++;
1989 + else if ((devcs & ( ETHRX_ld_m)) != ETHRX_ld_m) {
1990 + /* check that this is a whole packet */
1991 + /* WARNING: DMA_FD bit incorrectly set in Rc32434 (errata ref #077) */
1992 + lp->stats.rx_errors++;
1993 + lp->stats.rx_dropped++;
1995 + else if ( (devcs & ETHRX_rok_m) ) {
1998 + /* must be the (first and) last descriptor then */
1999 + pkt_buf = (u8*)lp->rx_skb[lp->rx_next_done]->data;
2001 + pktuncrc_len = pkt_len - 4;
2002 + /* invalidate the cache */
2003 + dma_cache_inv((unsigned long)pkt_buf, pktuncrc_len);
2005 + /* Malloc up new buffer. */
2006 + skb_new = dev_alloc_skb(RC32434_RBSIZE + 2);
2008 + if (skb_new != NULL){
2010 + skb_put(skb, pktuncrc_len);
2012 + skb->protocol = eth_type_trans(skb, dev);
2014 + /* pass the packet to upper layers */
2015 +#ifdef CONFIG_IDT_USE_NAPI
2016 + netif_receive_skb(skb);
2021 + dev->last_rx = jiffies;
2022 + lp->stats.rx_packets++;
2023 + lp->stats.rx_bytes += pktuncrc_len;
2025 + if (IS_RCV_MP(devcs))
2026 + lp->stats.multicast++;
2028 + /* 16 bit align */
2029 + skb_reserve(skb_new, 2);
2031 + skb_new->dev = dev;
2032 + lp->rx_skb[lp->rx_next_done] = skb_new;
2035 + ERR("no memory, dropping rx packet.\n");
2036 + lp->stats.rx_errors++;
2037 + lp->stats.rx_dropped++;
2043 + /* This should only happen if we enable accepting broken packets */
2044 + lp->stats.rx_errors++;
2045 + lp->stats.rx_dropped++;
2047 + /* add statistics counters */
2048 + if (IS_RCV_CRC_ERR(devcs)) {
2049 + DBG(2, "RX CRC error\n");
2050 + lp->stats.rx_crc_errors++;
2052 + else if (IS_RCV_LOR_ERR(devcs)) {
2053 + DBG(2, "RX LOR error\n");
2054 + lp->stats.rx_length_errors++;
2056 + else if (IS_RCV_LE_ERR(devcs)) {
2057 + DBG(2, "RX LE error\n");
2058 + lp->stats.rx_length_errors++;
2060 + else if (IS_RCV_OVR_ERR(devcs)) {
2061 + lp->stats.rx_over_errors++;
2063 + else if (IS_RCV_CV_ERR(devcs)) {
2064 + /* code violation */
2065 + DBG(2, "RX CV error\n");
2066 + lp->stats.rx_frame_errors++;
2068 + else if (IS_RCV_CES_ERR(devcs)) {
2069 + DBG(2, "RX Preamble error\n");
2075 + /* restore descriptor's curr_addr */
2077 + rd->ca = CPHYSADDR(skb_new->data);
2079 + rd->ca = CPHYSADDR(skb->data);
2081 + rd->control = DMA_COUNT(RC32434_RBSIZE) |DMAD_cod_m |DMAD_iod_m;
2082 + lp->rd_ring[(lp->rx_next_done-1)& RC32434_RDS_MASK].control &= ~(DMAD_cod_m);
2084 + lp->rx_next_done = (lp->rx_next_done + 1) & RC32434_RDS_MASK;
2085 + rd = &lp->rd_ring[lp->rx_next_done];
2086 + rc32434_writel( ~DMAS_d_m, &lp->rx_dma_regs->dmas);
2088 +#ifdef CONFIG_IDT_USE_NAPI
2089 + dev->quota -= received;
2090 + *budget =- received;
2091 + if(rx_work_limit < 0)
2095 + dmas = rc32434_readl(&lp->rx_dma_regs->dmas);
2097 + if(dmas & DMAS_h_m) {
2098 + rc32434_writel( ~(DMAS_h_m | DMAS_e_m), &lp->rx_dma_regs->dmas);
2099 +#ifdef RC32434_PROC_DEBUG
2100 + lp->dma_halt_cnt++;
2103 + skb = lp->rx_skb[lp->rx_next_done];
2104 + rd->ca = CPHYSADDR(skb->data);
2105 + rc32434_chain_rx(lp,rd);
2108 +#ifdef CONFIG_IDT_USE_NAPI
2109 + netif_rx_complete(dev);
2111 + /* Enable D H E bit in Rx DMA */
2112 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m |DMASM_e_m), &lp->rx_dma_regs->dmasm);
2113 +#ifdef CONFIG_IDT_USE_NAPI
2118 + spin_unlock_irqrestore(&lp->lock, flags);
2127 +/* Ethernet Tx DMA interrupt */
2129 +rc32434_tx_dma_interrupt(int irq, void *dev_id)
2131 + struct net_device *dev = (struct net_device *)dev_id;
2132 + struct rc32434_local *lp;
2133 + volatile u32 dmas,dmasm;
2134 + irqreturn_t retval;
2136 + ASSERT(dev != NULL);
2138 + lp = (struct rc32434_local *)dev->priv;
2140 + spin_lock(&lp->lock);
2142 + dmas = rc32434_readl(&lp->tx_dma_regs->dmas);
2144 + if (dmas & (DMAS_f_m | DMAS_e_m)) {
2145 + dmasm = rc32434_readl(&lp->tx_dma_regs->dmasm);
2146 + /* Mask F E bit in Tx DMA */
2147 + rc32434_writel(dmasm | (DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2149 + tasklet_hi_schedule(lp->tx_tasklet);
2151 + if(lp->tx_chain_status == filled && (rc32434_readl(&(lp->tx_dma_regs->dmandptr)) == 0)) {
2152 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr));
2153 + lp->tx_chain_status = empty;
2154 + lp->tx_chain_head = lp->tx_chain_tail;
2155 + dev->trans_start = jiffies;
2158 + if (dmas & DMAS_e_m)
2159 + ERR(": DMA error\n");
2161 + retval = IRQ_HANDLED;
2164 + retval = IRQ_NONE;
2166 + spin_unlock(&lp->lock);
2172 +static void rc32434_tx_tasklet(unsigned long tx_data_dev)
2174 + struct net_device *dev = (struct net_device *)tx_data_dev;
2175 + struct rc32434_local* lp = (struct rc32434_local *)dev->priv;
2176 + volatile DMAD_t td = &lp->td_ring[lp->tx_next_done];
2178 + unsigned long flags;
2179 + volatile u32 dmas;
2181 + spin_lock_irqsave(&lp->lock, flags);
2183 + /* process all desc that are done */
2184 + while(IS_DMA_FINISHED(td->control)) {
2185 + if(lp->tx_full == 1) {
2186 + netif_wake_queue(dev);
2190 + devcs = lp->td_ring[lp->tx_next_done].devcs;
2191 + if ((devcs & (ETHTX_fd_m | ETHTX_ld_m)) != (ETHTX_fd_m | ETHTX_ld_m)) {
2192 + lp->stats.tx_errors++;
2193 + lp->stats.tx_dropped++;
2195 + /* should never happen */
2196 + DBG(1, __FUNCTION__ ": split tx ignored\n");
2198 + else if (IS_TX_TOK(devcs)) {
2199 + lp->stats.tx_packets++;
2202 + lp->stats.tx_errors++;
2203 + lp->stats.tx_dropped++;
2206 + if (IS_TX_UND_ERR(devcs))
2207 + lp->stats.tx_fifo_errors++;
2209 + /* oversized frame */
2210 + if (IS_TX_OF_ERR(devcs))
2211 + lp->stats.tx_aborted_errors++;
2213 + /* excessive deferrals */
2214 + if (IS_TX_ED_ERR(devcs))
2215 + lp->stats.tx_carrier_errors++;
2217 + /* collisions: medium busy */
2218 + if (IS_TX_EC_ERR(devcs))
2219 + lp->stats.collisions++;
2221 + /* late collision */
2222 + if (IS_TX_LC_ERR(devcs))
2223 + lp->stats.tx_window_errors++;
2227 + /* We must always free the original skb */
2228 + if (lp->tx_skb[lp->tx_next_done] != NULL) {
2229 + dev_kfree_skb_any(lp->tx_skb[lp->tx_next_done]);
2230 + lp->tx_skb[lp->tx_next_done] = NULL;
2233 + lp->td_ring[lp->tx_next_done].control = DMAD_iof_m;
2234 + lp->td_ring[lp->tx_next_done].devcs = ETHTX_fd_m | ETHTX_ld_m;
2235 + lp->td_ring[lp->tx_next_done].link = 0;
2236 + lp->td_ring[lp->tx_next_done].ca = 0;
2239 + /* go on to next transmission */
2240 + lp->tx_next_done = (lp->tx_next_done + 1) & RC32434_TDS_MASK;
2241 + td = &lp->td_ring[lp->tx_next_done];
2245 + dmas = rc32434_readl(&lp->tx_dma_regs->dmas);
2246 + rc32434_writel( ~dmas, &lp->tx_dma_regs->dmas);
2248 + /* Enable F E bit in Tx DMA */
2249 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2250 + spin_unlock_irqrestore(&lp->lock, flags);
2255 +static struct net_device_stats * rc32434_get_stats(struct net_device *dev)
2257 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2258 + return &lp->stats;
2263 + * Set or clear the multicast filter for this adaptor.
2265 +static void rc32434_multicast_list(struct net_device *dev)
2267 + /* listen to broadcasts always and to treat */
2268 + /* IFF bits independantly */
2269 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2270 + unsigned long flags;
2271 + u32 recognise = ETHARC_ab_m; /* always accept broadcasts */
2273 + if (dev->flags & IFF_PROMISC) /* set promiscuous mode */
2274 + recognise |= ETHARC_pro_m;
2276 + if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 15))
2277 + recognise |= ETHARC_am_m; /* all multicast & bcast */
2278 + else if (dev->mc_count > 0) {
2279 + DBG(2, __FUNCTION__ ": mc_count %d\n", dev->mc_count);
2280 + recognise |= ETHARC_am_m; /* for the time being */
2283 + spin_lock_irqsave(&lp->lock, flags);
2284 + rc32434_writel(recognise, &lp->eth_regs->etharc);
2285 + spin_unlock_irqrestore(&lp->lock, flags);
2289 +static void rc32434_tx_timeout(struct net_device *dev)
2291 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2292 + unsigned long flags;
2294 + spin_lock_irqsave(&lp->lock, flags);
2295 + rc32434_restart(dev);
2296 + spin_unlock_irqrestore(&lp->lock, flags);
2302 + * Initialize the RC32434 ethernet controller.
2304 +static int rc32434_init(struct net_device *dev)
2306 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2310 + rc32434_abort_tx(dev);
2311 + rc32434_abort_rx(dev);
2313 + /* reset ethernet logic */
2314 + rc32434_writel(0, &lp->eth_regs->ethintfc);
2315 + while((rc32434_readl(&lp->eth_regs->ethintfc) & ETHINTFC_rip_m))
2316 + dev->trans_start = jiffies;
2318 + /* Enable Ethernet Interface */
2319 + rc32434_writel(ETHINTFC_en_m, &lp->eth_regs->ethintfc);
2321 +#ifndef CONFIG_IDT_USE_NAPI
2322 + tasklet_disable(lp->rx_tasklet);
2324 + tasklet_disable(lp->tx_tasklet);
2326 + /* Initialize the transmit Descriptors */
2327 + for (i = 0; i < RC32434_NUM_TDS; i++) {
2328 + lp->td_ring[i].control = DMAD_iof_m;
2329 + lp->td_ring[i].devcs = ETHTX_fd_m | ETHTX_ld_m;
2330 + lp->td_ring[i].ca = 0;
2331 + lp->td_ring[i].link = 0;
2332 + if (lp->tx_skb[i] != NULL) {
2333 + dev_kfree_skb_any(lp->tx_skb[i]);
2334 + lp->tx_skb[i] = NULL;
2337 + lp->tx_next_done = lp->tx_chain_head = lp->tx_chain_tail = lp->tx_full = lp->tx_count = 0;
2338 + lp-> tx_chain_status = empty;
2341 + * Initialize the receive descriptors so that they
2342 + * become a circular linked list, ie. let the last
2343 + * descriptor point to the first again.
2345 + for (i=0; i<RC32434_NUM_RDS; i++) {
2346 + struct sk_buff *skb = lp->rx_skb[i];
2348 + if (lp->rx_skb[i] == NULL) {
2349 + skb = dev_alloc_skb(RC32434_RBSIZE + 2);
2350 + if (skb == NULL) {
2351 + ERR("No memory in the system\n");
2352 + for (j = 0; j < RC32434_NUM_RDS; j ++)
2353 + if (lp->rx_skb[j] != NULL)
2354 + dev_kfree_skb_any(lp->rx_skb[j]);
2360 + skb_reserve(skb, 2);
2361 + lp->rx_skb[i] = skb;
2362 + lp->rd_ring[i].ca = CPHYSADDR(skb->data);
2366 + lp->rd_ring[i].control = DMAD_iod_m | DMA_COUNT(RC32434_RBSIZE);
2367 + lp->rd_ring[i].devcs = 0;
2368 + lp->rd_ring[i].ca = CPHYSADDR(skb->data);
2369 + lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]);
2373 + lp->rd_ring[RC32434_NUM_RDS-1].link = CPHYSADDR(&lp->rd_ring[0]);
2374 + lp->rx_next_done = 0;
2376 + lp->rd_ring[RC32434_NUM_RDS-1].control |= DMAD_cod_m;
2377 + lp->rx_chain_head = 0;
2378 + lp->rx_chain_tail = 0;
2379 + lp->rx_chain_status = empty;
2381 + rc32434_writel(0, &lp->rx_dma_regs->dmas);
2382 + /* Start Rx DMA */
2383 + rc32434_start_rx(lp, &lp->rd_ring[0]);
2385 + /* Enable F E bit in Tx DMA */
2386 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2387 + /* Enable D H E bit in Rx DMA */
2388 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm);
2390 + /* Accept only packets destined for this Ethernet device address */
2391 + rc32434_writel(ETHARC_ab_m, &lp->eth_regs->etharc);
2393 + /* Set all Ether station address registers to their initial values */
2394 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal0);
2395 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah0);
2397 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal1);
2398 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah1);
2400 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal2);
2401 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah2);
2403 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal3);
2404 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah3);
2407 + /* Frame Length Checking, Pad Enable, CRC Enable, Full Duplex set */
2408 + rc32434_writel(ETHMAC2_pe_m | ETHMAC2_cen_m | ETHMAC2_fd_m, &lp->eth_regs->ethmac2);
2409 + //ETHMAC2_flc_m ETHMAC2_fd_m lp->duplex_mode
2411 + /* Back to back inter-packet-gap */
2412 + rc32434_writel(0x15, &lp->eth_regs->ethipgt);
2413 + /* Non - Back to back inter-packet-gap */
2414 + rc32434_writel(0x12, &lp->eth_regs->ethipgr);
2416 + /* Management Clock Prescaler Divisor */
2417 + /* Clock independent setting */
2418 + rc32434_writel(((idt_cpu_freq)/MII_CLOCK+1) & ~1,
2419 + &lp->eth_regs->ethmcp);
2421 + /* don't transmit until fifo contains 48b */
2422 + rc32434_writel(48, &lp->eth_regs->ethfifott);
2424 + rc32434_writel(ETHMAC1_re_m, &lp->eth_regs->ethmac1);
2426 +#ifndef CONFIG_IDT_USE_NAPI
2427 + tasklet_enable(lp->rx_tasklet);
2429 + tasklet_enable(lp->tx_tasklet);
2431 + netif_start_queue(dev);
2441 +static int __init rc32434_setup(char *options)
2443 + /* no options yet */
2447 +static int __init rc32434_setup_ethaddr0(char *options)
2449 + memcpy(mac0, options, 17);
2454 +__setup("rc32434eth=", rc32434_setup);
2455 +__setup("ethaddr0=", rc32434_setup_ethaddr0);
2458 +#endif /* MODULE */
2460 +module_init(rc32434_init_module);
2461 +module_exit(rc32434_cleanup_module);
2476 diff -Nur linux-2.6.17/drivers/net/rc32434_eth.h linux-2.6.17-owrt/drivers/net/rc32434_eth.h
2477 --- linux-2.6.17/drivers/net/rc32434_eth.h 1970-01-01 01:00:00.000000000 +0100
2478 +++ linux-2.6.17-owrt/drivers/net/rc32434_eth.h 2006-06-18 12:44:28.000000000 +0200
2480 +/**************************************************************************
2482 + * BRIEF MODULE DESCRIPTION
2483 + * Definitions for IDT RC32434 on-chip ethernet controller.
2485 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2487 + * This program is free software; you can redistribute it and/or modify it
2488 + * under the terms of the GNU General Public License as published by the
2489 + * Free Software Foundation; either version 2 of the License, or (at your
2490 + * option) any later version.
2492 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2493 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2494 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2495 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2496 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2497 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2498 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2499 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2500 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2501 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2503 + * You should have received a copy of the GNU General Public License along
2504 + * with this program; if not, write to the Free Software Foundation, Inc.,
2505 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2508 + **************************************************************************
2509 + * May 2004 rkt, neb
2517 + **************************************************************************
2521 +#include <asm/idt-boards/rc32434/rc32434.h>
2522 +#include <asm/idt-boards/rc32434/rc32434_dma_v.h>
2523 +#include <asm/idt-boards/rc32434/rc32434_eth_v.h>
2525 +#define RC32434_DEBUG 2
2526 +//#define RC32434_PROC_DEBUG
2527 +#undef RC32434_DEBUG
2529 +#ifdef RC32434_DEBUG
2531 +/* use 0 for production, 1 for verification, >2 for debug */
2532 +static int rc32434_debug = RC32434_DEBUG;
2533 +#define ASSERT(expr) \
2535 + printk( "Assertion failed! %s,%s,%s,line=%d\n", \
2536 + #expr,__FILE__,__FUNCTION__,__LINE__); }
2537 +#define DBG(lvl, format, arg...) if (rc32434_debug > lvl) printk(KERN_INFO "%s: " format, dev->name , ## arg)
2539 +#define ASSERT(expr) do {} while (0)
2540 +#define DBG(lvl, format, arg...) do {} while (0)
2543 +#define INFO(format, arg...) printk(KERN_INFO "%s: " format, dev->name , ## arg)
2544 +#define ERR(format, arg...) printk(KERN_ERR "%s: " format, dev->name , ## arg)
2545 +#define WARN(format, arg...) printk(KERN_WARNING "%s: " format, dev->name , ## arg)
2547 +#define ETH0_DMA_RX_IRQ GROUP1_IRQ_BASE + 0
2548 +#define ETH0_DMA_TX_IRQ GROUP1_IRQ_BASE + 1
2549 +#define ETH0_RX_OVR_IRQ GROUP3_IRQ_BASE + 9
2550 +#define ETH0_TX_UND_IRQ GROUP3_IRQ_BASE + 10
2552 +#define ETH0_RX_DMA_ADDR (DMA0_PhysicalAddress + 0*DMA_CHAN_OFFSET)
2553 +#define ETH0_TX_DMA_ADDR (DMA0_PhysicalAddress + 1*DMA_CHAN_OFFSET)
2555 +/* the following must be powers of two */
2556 +#ifdef CONFIG_IDT_USE_NAPI
2557 +#define RC32434_NUM_RDS 64 /* number of receive descriptors */
2558 +#define RC32434_NUM_TDS 64 /* number of transmit descriptors */
2560 +#define RC32434_NUM_RDS 128 /* number of receive descriptors */
2561 +#define RC32434_NUM_TDS 128 /* number of transmit descriptors */
2564 +#define RC32434_RBSIZE 1536 /* size of one resource buffer = Ether MTU */
2565 +#define RC32434_RDS_MASK (RC32434_NUM_RDS-1)
2566 +#define RC32434_TDS_MASK (RC32434_NUM_TDS-1)
2567 +#define RD_RING_SIZE (RC32434_NUM_RDS * sizeof(struct DMAD_s))
2568 +#define TD_RING_SIZE (RC32434_NUM_TDS * sizeof(struct DMAD_s))
2570 +#define RC32434_TX_TIMEOUT HZ * 100
2572 +#define rc32434_eth0_regs ((ETH_t)(ETH0_VirtualAddress))
2573 +#define rc32434_eth1_regs ((ETH_t)(ETH1_VirtualAddress))
2575 +enum status { filled, empty};
2576 +#define IS_DMA_FINISHED(X) (((X) & (DMAD_f_m)) != 0)
2577 +#define IS_DMA_DONE(X) (((X) & (DMAD_d_m)) != 0)
2580 +/* Information that need to be kept for each board. */
2581 +struct rc32434_local {
2583 + DMA_Chan_t rx_dma_regs;
2584 + DMA_Chan_t tx_dma_regs;
2585 + volatile DMAD_t td_ring; /* transmit descriptor ring */
2586 + volatile DMAD_t rd_ring; /* receive descriptor ring */
2588 + struct sk_buff* tx_skb[RC32434_NUM_TDS]; /* skbuffs for pkt to trans */
2589 + struct sk_buff* rx_skb[RC32434_NUM_RDS]; /* skbuffs for pkt to trans */
2591 +#ifndef CONFIG_IDT_USE_NAPI
2592 + struct tasklet_struct * rx_tasklet;
2594 + struct tasklet_struct * tx_tasklet;
2597 + int rx_chain_head;
2598 + int rx_chain_tail;
2599 + enum status rx_chain_status;
2602 + int tx_chain_head;
2603 + int tx_chain_tail;
2604 + enum status tx_chain_status;
2608 + struct timer_list mii_phy_timer;
2609 + unsigned long duplex_mode;
2616 + struct net_device_stats stats;
2619 + /* debug /proc entry */
2620 + struct proc_dir_entry *ps;
2621 + int dma_halt_cnt; int dma_run_cnt;
2624 +extern unsigned int idt_cpu_freq;
2626 +/* Index to functions, as function prototypes. */
2627 +static int rc32434_open(struct net_device *dev);
2628 +static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev);
2629 +static void rc32434_mii_handler(unsigned long data);
2630 +static irqreturn_t rc32434_und_interrupt(int irq, void *dev_id);
2631 +static irqreturn_t rc32434_rx_dma_interrupt(int irq, void *dev_id);
2632 +static irqreturn_t rc32434_tx_dma_interrupt(int irq, void *dev_id);
2633 +#ifdef RC32434_REVISION
2634 +static irqreturn_t rc32434_ovr_interrupt(int irq, void *dev_id);
2636 +static int rc32434_close(struct net_device *dev);
2637 +static struct net_device_stats *rc32434_get_stats(struct net_device *dev);
2638 +static void rc32434_multicast_list(struct net_device *dev);
2639 +static int rc32434_init(struct net_device *dev);
2640 +static void rc32434_tx_timeout(struct net_device *dev);
2642 +static void rc32434_tx_tasklet(unsigned long tx_data_dev);
2643 +#ifdef CONFIG_IDT_USE_NAPI
2644 +static int rc32434_poll(struct net_device *rx_data_dev, int *budget);
2646 +static void rc32434_rx_tasklet(unsigned long rx_data_dev);
2648 +static void rc32434_cleanup_module(void);
2649 +static int rc32434_probe(int port_num);
2650 +int rc32434_init_module(void);
2653 +static inline void rc32434_abort_dma(struct net_device *dev, DMA_Chan_t ch)
2655 + if (rc32434_readl(&ch->dmac) & DMAC_run_m) {
2656 + rc32434_writel(0x10, &ch->dmac);
2658 + while (!(rc32434_readl(&ch->dmas) & DMAS_h_m))
2659 + dev->trans_start = jiffies;
2661 + rc32434_writel(0, &ch->dmas);
2664 + rc32434_writel(0, &ch->dmadptr);
2665 + rc32434_writel(0, &ch->dmandptr);
2667 diff -Nur linux-2.6.17/include/asm-mips/bootinfo.h linux-2.6.17-owrt/include/asm-mips/bootinfo.h
2668 --- linux-2.6.17/include/asm-mips/bootinfo.h 2006-06-18 03:49:35.000000000 +0200
2669 +++ linux-2.6.17-owrt/include/asm-mips/bootinfo.h 2006-06-18 12:44:28.000000000 +0200
2670 @@ -218,6 +218,17 @@
2671 #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
2672 #define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
2676 + * Valid machtype for group ARUBA
2678 +#define MACH_GROUP_ARUBA 23
2679 +#define MACH_ARUBA_UNKNOWN 0
2680 +#define MACH_ARUBA_AP60 1
2681 +#define MACH_ARUBA_AP65 2
2682 +#define MACH_ARUBA_AP70 3
2683 +#define MACH_ARUBA_AP40 4
2685 #define CL_SIZE COMMAND_LINE_SIZE
2687 const char *get_system_type(void);
2688 diff -Nur linux-2.6.17/include/asm-mips/cpu.h linux-2.6.17-owrt/include/asm-mips/cpu.h
2689 --- linux-2.6.17/include/asm-mips/cpu.h 2006-06-18 03:49:35.000000000 +0200
2690 +++ linux-2.6.17-owrt/include/asm-mips/cpu.h 2006-06-18 12:45:56.000000000 +0200
2692 #define PRID_IMP_R14000 0x0f00
2693 #define PRID_IMP_R8000 0x1000
2694 #define PRID_IMP_PR4450 0x1200
2695 +#define PRID_IMP_RC32334 0x1800
2696 +#define PRID_IMP_RC32355 0x1900
2697 +#define PRID_IMP_RC32365 0x1900
2698 #define PRID_IMP_R4600 0x2000
2699 #define PRID_IMP_R4700 0x2100
2700 #define PRID_IMP_TX39 0x2200
2704 #define CPU_R14000 64
2705 -#define CPU_LAST 64
2706 +#define CPU_RC32300 65
2707 +#define CPU_LAST 65
2710 * ISA Level encodings
2711 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
2712 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32300.h 1970-01-01 01:00:00.000000000 +0100
2713 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32300.h 2006-06-18 12:44:28.000000000 +0200
2715 +/**************************************************************************
2717 + * BRIEF MODULE DESCRIPTION
2718 + * RC32300 helper routines
2720 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2722 + * This program is free software; you can redistribute it and/or modify it
2723 + * under the terms of the GNU General Public License as published by the
2724 + * Free Software Foundation; either version 2 of the License, or (at your
2725 + * option) any later version.
2727 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2728 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2729 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2730 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2731 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2732 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2733 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2734 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2735 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2736 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2738 + * You should have received a copy of the GNU General Public License along
2739 + * with this program; if not, write to the Free Software Foundation, Inc.,
2740 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2743 + **************************************************************************
2744 + * May 2004 P. Sadik.
2750 + **************************************************************************
2753 +#ifndef __IDT_RC32300_H__
2754 +#define __IDT_RC32300_H__
2756 +#include <linux/delay.h>
2757 +#include <asm/io.h>
2760 +/* cpu pipeline flush */
2761 +static inline void rc32300_sync(void)
2763 + __asm__ volatile ("sync");
2766 +static inline void rc32300_sync_udelay(int us)
2768 + __asm__ volatile ("sync");
2772 +static inline void rc32300_sync_delay(int ms)
2774 + __asm__ volatile ("sync");
2779 + * Macros to access internal RC32300 registers. No byte
2780 + * swapping should be done when accessing the internal
2784 +static inline u8 rc32300_readb(unsigned long pa)
2786 + return *((volatile u8 *)KSEG1ADDR(pa));
2788 +static inline u16 rc32300_readw(unsigned long pa)
2790 + return *((volatile u16 *)KSEG1ADDR(pa));
2792 +static inline u32 rc32300_readl(unsigned long pa)
2794 + return *((volatile u32 *)KSEG1ADDR(pa));
2796 +static inline void rc32300_writeb(u8 val, unsigned long pa)
2798 + *((volatile u8 *)KSEG1ADDR(pa)) = val;
2800 +static inline void rc32300_writew(u16 val, unsigned long pa)
2802 + *((volatile u16 *)KSEG1ADDR(pa)) = val;
2804 +static inline void rc32300_writel(u32 val, unsigned long pa)
2806 + *((volatile u32 *)KSEG1ADDR(pa)) = val;
2810 +#define local_readb __raw_readb
2811 +#define local_readw __raw_readw
2812 +#define local_readl __raw_readl
2814 +#define local_writeb __raw_writeb
2815 +#define local_writew __raw_writew
2816 +#define local_writel __raw_writel
2820 + * C access to CLZ and CLO instructions
2821 + * (count leading zeroes/ones).
2823 +static inline int rc32300_clz(unsigned long val)
2826 + __asm__ volatile (
2827 + ".set\tnoreorder\n\t"
2829 + ".set\tmips32\n\t"
2839 +static inline int rc32300_clo(unsigned long val)
2842 + __asm__ volatile (
2843 + ".set\tnoreorder\n\t"
2845 + ".set\tmips32\n\t"
2856 +#endif // __IDT_RC32300_H__
2857 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
2858 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32334.h 1970-01-01 01:00:00.000000000 +0100
2859 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32334.h 2006-06-18 12:44:28.000000000 +0200
2861 +/**************************************************************************
2863 + * BRIEF MODULE DESCRIPTION
2864 + * Definitions for IDT RC32334 CPU.
2866 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2868 + * This program is free software; you can redistribute it and/or modify it
2869 + * under the terms of the GNU General Public License as published by the
2870 + * Free Software Foundation; either version 2 of the License, or (at your
2871 + * option) any later version.
2873 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2874 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2875 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2876 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2877 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2878 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2879 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2880 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2881 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2882 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2884 + * You should have received a copy of the GNU General Public License along
2885 + * with this program; if not, write to the Free Software Foundation, Inc.,
2886 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2889 + **************************************************************************
2890 + * May 2004 P. Sadik.
2896 + **************************************************************************
2900 +#ifndef __IDT_RC32334_H__
2901 +#define __IDT_RC32334_H__
2903 +#include <linux/delay.h>
2904 +#include <asm/io.h>
2906 +/* Base address of internal registers */
2907 +#define RC32334_REG_BASE 0x18000000
2909 +/* CPU and IP Bus Control */
2910 +#define CPU_PORT_WIDTH 0xffffe200 // virtual!
2911 +#define CPU_BTA 0xffffe204 // virtual!
2912 +#define CPU_BUSERR_ADDR 0xffffe208 // virtual!
2913 +#define CPU_IP_BTA (RC32334_REG_BASE + 0x0000)
2914 +#define CPU_IP_ADDR_LATCH (RC32334_REG_BASE + 0x0004)
2915 +#define CPU_IP_ARBITRATION (RC32334_REG_BASE + 0x0008)
2916 +#define CPU_IP_BUSERR_CNTL (RC32334_REG_BASE + 0x0010)
2917 +#define CPU_IP_BUSERR_ADDR (RC32334_REG_BASE + 0x0014)
2918 +#define CPU_IP_SYSID (RC32334_REG_BASE + 0x0018)
2920 +/* Memory Controller */
2921 +#define MEM_BASE_BANK0 (RC32334_REG_BASE + 0x0080)
2922 +#define MEM_MASK_BANK0 (RC32334_REG_BASE + 0x0084)
2923 +#define MEM_CNTL_BANK0 (RC32334_REG_BASE + 0x0200)
2924 +#define MEM_BASE_BANK1 (RC32334_REG_BASE + 0x0088)
2925 +#define MEM_MASK_BANK1 (RC32334_REG_BASE + 0x008c)
2926 +#define MEM_CNTL_BANK1 (RC32334_REG_BASE + 0x0204)
2927 +#define MEM_CNTL_BANK2 (RC32334_REG_BASE + 0x0208)
2928 +#define MEM_CNTL_BANK3 (RC32334_REG_BASE + 0x020c)
2929 +#define MEM_CNTL_BANK4 (RC32334_REG_BASE + 0x0210)
2930 +#define MEM_CNTL_BANK5 (RC32334_REG_BASE + 0x0214)
2932 +/* PCI Controller */
2933 +#define PCI_INTR_PEND (RC32334_REG_BASE + 0x05b0)
2934 +#define PCI_INTR_MASK (RC32334_REG_BASE + 0x05b4)
2935 +#define PCI_INTR_CLEAR (RC32334_REG_BASE + 0x05b8)
2936 +#define CPU2PCI_INTR_PEND (RC32334_REG_BASE + 0x05c0)
2937 +#define CPU2PCI_INTR_MASK (RC32334_REG_BASE + 0x05c4)
2938 +#define CPU2PCI_INTR_CLEAR (RC32334_REG_BASE + 0x05c8)
2939 +#define PCI2CPU_INTR_PEND (RC32334_REG_BASE + 0x05d0)
2940 +#define PCI2CPU_INTR_MASK (RC32334_REG_BASE + 0x05d4)
2941 +#define PCI2CPU_INTR_CLEAR (RC32334_REG_BASE + 0x05d8)
2942 +#define PCI_MEM1_BASE (RC32334_REG_BASE + 0x20b0)
2943 +#define PCI_MEM2_BASE (RC32334_REG_BASE + 0x20b8)
2944 +#define PCI_MEM3_BASE (RC32334_REG_BASE + 0x20c0)
2945 +#define PCI_IO1_BASE (RC32334_REG_BASE + 0x20c8)
2946 +#define PCI_ARBITRATION (RC32334_REG_BASE + 0x20e0)
2947 +#define PCI_CPU_MEM1_BASE (RC32334_REG_BASE + 0x20e8)
2948 +#define PCI_CPU_IO_BASE (RC32334_REG_BASE + 0x2100)
2949 +#define PCI_CFG_CNTL (RC32334_REG_BASE + 0x2cf8)
2950 +#define PCI_CFG_DATA (RC32334_REG_BASE + 0x2cfc)
2953 +#define TIMER0_CNTL (RC32334_REG_BASE + 0x0700)
2954 +#define TIMER0_COUNT (RC32334_REG_BASE + 0x0704)
2955 +#define TIMER0_COMPARE (RC32334_REG_BASE + 0x0708)
2956 +#define TIMER_REG_OFFSET 0x10
2958 +/* Programmable I/O */
2959 +#define PIO_DATA0 (RC32334_REG_BASE + 0x0600)
2960 +#define PIO_DATA1 (RC32334_REG_BASE + 0x0610)
2965 + * NOTE: DMA_IO is a trick for non linear RC32300_IO_DMA stuff
2971 + * NB: dma number must be immediate value or variable.
2972 + * It MUST NOT be a function since it would get called twice!
2974 +#define DMA_IO(n) (((n)>1?0x500:0)+((n)&1?0x40:0))
2976 +#define RC32300_IO_DMA(n) (RC32334_REG_BASE + 0x1400 + DMA_IO(n))
2977 +#define RC32300_DMA_CONFREG(n) RC32300_IO_DMA(n)
2978 +#define RC32300_DMA_BASEREG(n) (RC32300_IO_DMA(n)+0x4)
2980 +#define RC32300_DMA_CURRREG(n) (RC32300_IO_DMA(n)+0x8)
2981 +#define RC32300_DMA_STATREG(n) (RC32300_IO_DMA(n)+0x10)
2982 +#define RC32300_DMA_SRCREG(n) (RC32300_IO_DMA(n)+0x14)
2983 +#define RC32300_DMA_DSTREG(n) (RC32300_IO_DMA(n)+0x18)
2984 +#define RC32300_DMA_NEXTREG(n) (RC32300_IO_DMA(n)+0x1c)
2986 +#define RC32300_DMA_IRQ(n) (GROUP7_IRQ_BASE+5*(n))
2988 +/* Expansion Interrupt Controller */
2989 +#define IC_GROUP0_PEND (RC32334_REG_BASE + 0x0500)
2990 +#define IC_GROUP0_MASK (RC32334_REG_BASE + 0x0504)
2991 +#define IC_GROUP0_CLEAR (RC32334_REG_BASE + 0x0508)
2992 +#define IC_GROUP_OFFSET 0x10
2994 +#define NUM_INTR_GROUPS 15
2996 + * The IRQ mapping is as follows:
2999 + * --- -------------------
3000 + * 0 SW0 (IP0) SW0 intr
3001 + * 1 SW1 (IP1) SW1 intr
3002 + * 2 Int0 (IP2) board-specific
3003 + * 3 Int1 (IP3) board-specific
3004 + * 4 Int2 (IP4) board-specific
3005 + * - Int3 (IP5) not used, mapped to IRQ's 8 and up
3006 + * 6 Int4 (IP6) board-specific
3007 + * 7 Int5 (IP7) CP0 Timer
3009 + * IRQ's 8 and up are all mapped to Int3 (IP5), which
3010 + * internally on the RC32334 is routed to the Expansion
3011 + * Interrupt Controller.
3013 +#define MIPS_CPU_TIMER_IRQ 7
3015 +#define GROUP1_IRQ_BASE 8 // bus error
3016 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 1) // PIO active low
3017 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 12) // PIO active high
3018 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 8) // Timer Rollovers
3019 +#define GROUP5_IRQ_BASE (GROUP4_IRQ_BASE + 8) // UART0
3020 +#define GROUP6_IRQ_BASE (GROUP5_IRQ_BASE + 3) // UART1
3021 +#define GROUP7_IRQ_BASE (GROUP6_IRQ_BASE + 3) // DMA Ch0
3022 +#define GROUP8_IRQ_BASE (GROUP7_IRQ_BASE + 5) // DMA Ch1
3023 +#define GROUP9_IRQ_BASE (GROUP8_IRQ_BASE + 5) // DMA Ch2
3024 +#define GROUP10_IRQ_BASE (GROUP9_IRQ_BASE + 5) // DMA Ch3
3025 +#define GROUP11_IRQ_BASE (GROUP10_IRQ_BASE + 5) // PCI Ctlr errors
3026 +#define GROUP12_IRQ_BASE (GROUP11_IRQ_BASE + 4) // PCI Satellite Mode
3027 +#define GROUP13_IRQ_BASE (GROUP12_IRQ_BASE + 16) // PCI to CPU Mailbox
3028 +#define GROUP14_IRQ_BASE (GROUP13_IRQ_BASE + 4) // SPI
3030 +#define RC32334_NR_IRQS (GROUP14_IRQ_BASE + 1)
3034 +#define RC32300_UART0_BASE (RC32334_REG_BASE + 0x0803)
3035 +#define RC32300_UART1_BASE (RC32334_REG_BASE + 0x0823)
3037 +#define RC32300_UART0_BASE (RC32334_REG_BASE + 0x0800)
3038 +#define RC32300_UART1_BASE (RC32334_REG_BASE + 0x0820)
3041 +#define RC32300_UART0_IRQ GROUP5_IRQ_BASE
3042 +#define RC32300_UART1_IRQ GROUP6_IRQ_BASE
3044 +#define IDT_CLOCK_MULT 2
3047 +#define NVRAM_BASE 0x12000000
3048 +#define NVRAM_ENVSIZE_OFF 4
3049 +#define NVRAM_ENVSTART_OFF 0x40
3051 +/* LCD 4-digit display */
3052 +#define LCD_CLEAR 0x14000400
3053 +#define LCD_DIGIT0 0x1400000f
3054 +#define LCD_DIGIT1 0x14000008
3055 +#define LCD_DIGIT2 0x14000007
3056 +#define LCD_DIGIT3 0x14000003
3058 +/* Interrupts routed on 79S334A board (see rc32334.h) */
3059 +#define RC32334_SCC8530_IRQ 2
3060 +#define RC32334_PCI_INTA_IRQ 3
3061 +#define RC32334_PCI_INTB_IRQ 4
3062 +#define RC32334_PCI_INTC_IRQ 6
3063 +#define RC32334_PCI_INTD_IRQ 7
3065 +#define RAM_SIZE (32*1024*1024)
3067 +#endif // __IDT_RC32334_H__
3068 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
3069 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32355_dma.h 1970-01-01 01:00:00.000000000 +0100
3070 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32355_dma.h 2006-06-18 12:44:28.000000000 +0200
3072 +/**************************************************************************
3074 + * BRIEF MODULE DESCRIPTION
3075 + * DMA controller defines on IDT RC32355
3077 + * Copyright 2004 IDT Inc.
3078 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3081 + * This program is free software; you can redistribute it and/or modify it
3082 + * under the terms of the GNU General Public License as published by the
3083 + * Free Software Foundation; either version 2 of the License, or (at your
3084 + * option) any later version.
3086 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3087 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3088 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3089 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3090 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3091 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3092 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3093 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3094 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3095 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3097 + * You should have received a copy of the GNU General Public License along
3098 + * with this program; if not, write to the Free Software Foundation, Inc.,
3099 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3105 + **************************************************************************
3108 +#ifndef BANYAN_DMA_H
3109 +#define BANYAN_DMA_H
3110 +#include <asm/idt-boards/rc32300/rc32300.h>
3113 + * An image of one RC32355 dma channel registers
3121 +} rc32355_dma_ch_t;
3124 + * An image of all RC32355 dma channel registers
3127 + rc32355_dma_ch_t ch[16];
3128 +} rc32355_dma_regs_t;
3131 +#define rc32355_dma_regs ((rc32355_dma_regs_t*)KSEG1ADDR(RC32355_DMA_BASE))
3134 +/* DMAC register layout */
3136 +#define DMAC_RUN 0x1 /* Halts processing when cleared */
3137 +#define DMAC_DM 0x2 /* Done Mask, ignore DMA events */
3138 +#define DMAC_MODE_MASK 0xC /* DMA operating mode */
3140 +#define DMAC_MODE_AUTO 0x0 /* DMA Auto Request Mode */
3141 +#define DMAC_MODE_BURST 0x4 /* DMA Burst Request Mode */
3142 +#define DMAC_MODE_TFER 0x8 /* DMA Transfer Request Mode */
3144 +/* DMAS and DMASM register layout */
3146 +#define DMAS_F 0x01 /* Finished */
3147 +#define DMAS_D 0x02 /* Done */
3148 +#define DMAS_C 0x04 /* Chain */
3149 +#define DMAS_E 0x08 /* Error */
3150 +#define DMAS_H 0x10 /* Halt */
3152 +/* Polling count for DMAS_H bit in DMAS register after halting DMA */
3153 +#define DMA_HALT_TIMEOUT 500
3156 +static inline int rc32355_halt_dma(rc32355_dma_ch_t* ch)
3160 + if (local_readl(&ch->dmac) & DMAC_RUN) {
3161 + local_writel(0, &ch->dmac);
3162 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
3163 + if (local_readl(&ch->dmas) & DMAS_H) {
3164 + local_writel(0, &ch->dmas);
3170 + return timeout ? 0 : 1;
3173 +static inline void rc32355_start_dma(rc32355_dma_ch_t* ch, u32 dma_addr)
3175 + local_writel(0, &ch->dmandptr);
3176 + local_writel(dma_addr, &ch->dmadptr);
3179 +static inline void rc32355_chain_dma(rc32355_dma_ch_t* ch, u32 dma_addr)
3181 + local_writel(dma_addr, &ch->dmandptr);
3185 +/* The following can be used to describe DMA channels 0 to 15, and the */
3186 +/* sub device's needed to select them in the DMADESC_DS_MASK field */
3188 +#define DMA_CHAN_ATM01 0 /* ATM interface 0,1 chan */
3190 +#define DMA_CHAN_ATM0IN 0 /* ATM interface 0 input */
3191 +#define DMA_DEV_ATM0IN 0 /* ATM interface 0 input */
3193 +#define DMA_CHAN_ATM1IN 0 /* ATM interface 1 input */
3194 +#define DMA_DEV_ATM1IN 1 /* ATM interface 1 input */
3196 +#define DMA_CHAN_ATM0OUT 0 /* ATM interface 0 output */
3197 +#define DMA_DEV_ATM0OUT 2 /* ATM interface 0 output */
3199 +#define DMA_CHAN_ATM1OUT 0 /* ATM interface 1 output */
3200 +#define DMA_DEV_ATM1OUT 3 /* ATM interface 1 output */
3202 +/* for entry in {0,1,2,3,4,5,6,7} - note 5,6,7 share with those below */
3203 +#define DMA_CHAN_ATMVCC(entry) ((entry)+1) /* ATM VC cache entry */
3204 +#define DMA_DEV_ATMVCC(entry) 0
3206 +#define DMA_CHAN_MEMTOMEM 6 /* Memory to memory DMA */
3207 +#define DMA_DEV_MEMTOMEM 1 /* Memory to memory DMA */
3209 +#define DMA_CHAN_ATMFMB0 7 /* ATM Frame Mode Buffer 0 */
3210 +#define DMA_DEV_ATMFMB0 1 /* ATM Frame Mode Buffer 0 */
3212 +#define DMA_CHAN_ATMFMB1 8 /* ATM Frame Mode Buffer 1 */
3213 +#define DMA_DEV_ATMFMB1 1 /* ATM Frame Mode Buffer 1 */
3215 +#define DMA_CHAN_ETHERIN 9 /* Ethernet input */
3216 +#define DMA_DEV_ETHERIN 0 /* Ethernet input */
3218 +#define DMA_CHAN_ETHEROUT 10 /* Ethernet output */
3219 +#define DMA_DEV_ETHEROUT 0 /* Ethernet output */
3221 +#define DMA_CHAN_TDMIN 11 /* TDM Bus input */
3222 +#define DMA_DEV_TDMIN 0 /* TDM Bus input */
3224 +#define DMA_CHAN_TDMOUT 12 /* TDM Bus output */
3225 +#define DMA_DEV_TDMOUT 0 /* TDM Bus output */
3227 +#define DMA_CHAN_USBIN 13 /* USB input */
3228 +#define DMA_DEV_USBIN 0 /* USB input */
3230 +#define DMA_CHAN_USBOUT 14 /* USB output */
3231 +#define DMA_DEV_USBOUT 0 /* USB output */
3233 +#define DMA_CHAN_EXTERN 15 /* External DMA */
3234 +#define DMA_DEV_EXTERN 0 /* External DMA */
3237 + * An RC32355 dma descriptor in system memory
3240 + u32 cmdstat; /* control and status */
3241 + u32 curr_addr; /* current address of data */
3242 + u32 devcs; /* peripheral-specific control and status */
3243 + u32 link; /* link to next descriptor */
3244 +} rc32355_dma_desc_t;
3246 +/* Values for the descriptor cmdstat word */
3248 +#define DMADESC_F 0x80000000u /* Finished bit */
3249 +#define DMADESC_D 0x40000000u /* Done bit */
3250 +#define DMADESC_T 0x20000000u /* Terminated bit */
3251 +#define DMADESC_IOD 0x10000000u /* Interrupt On Done */
3252 +#define DMADESC_IOF 0x08000000u /* Interrupt On Finished */
3253 +#define DMADESC_COD 0x04000000u /* Chain On Done */
3254 +#define DMADESC_COF 0x02000000u /* Chain On Finished */
3256 +#define DMADESC_DEVCMD_MASK 0x01C00000u /* Device Command mask */
3257 +#define DMADESC_DEVCMD_SHIFT 22 /* Device Command shift */
3259 +#define DMADESC_DS_MASK 0x00300000u /* Device Select mask */
3260 +#define DMADESC_DS_SHIFT 20 /* Device Select shift */
3262 +#define DMADESC_COUNT_MASK 0x0003FFFFu /* Byte Count mask */
3263 +#define DMADESC_COUNT_SHIFT 0 /* Byte Count shift */
3265 +#define IS_DMA_FINISHED(X) ( ( (X) & DMADESC_F ) >> 31) /* F Bit */
3266 +#define IS_DMA_DONE(X) ( ( (X) & DMADESC_D ) >> 30) /* D Bit */
3267 +#define IS_DMA_TERMINATED(X) ( ( (X) & DMADESC_T ) >> 29) /* T Bit */
3268 +#define IS_DMA_USED(X) (((X) & (DMADESC_F | DMADESC_D | DMADESC_T)) != 0)
3270 +#define DMA_DEVCMD(devcmd) \
3271 + (((devcmd) << DMADESC_DEVCMD_SHIFT) & DMADESC_DS_MASK)
3272 +#define DMA_DS(ds) \
3273 + (((ds) << DMADESC_DS_SHIFT) & DMADESC_DS_MASK)
3274 +#define DMA_COUNT(count) \
3275 + ((count) & DMADESC_COUNT_MASK)
3277 +#endif /* RC32355_DMA_H */
3278 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
3279 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32355_eth.h 1970-01-01 01:00:00.000000000 +0100
3280 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32355_eth.h 2006-06-18 12:44:28.000000000 +0200
3282 +/**************************************************************************
3284 + * BRIEF MODULE DESCRIPTION
3285 + * Ethernet registers on IDT RC32355
3287 + * Copyright 2004 IDT Inc.
3288 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3291 + * This program is free software; you can redistribute it and/or modify it
3292 + * under the terms of the GNU General Public License as published by the
3293 + * Free Software Foundation; either version 2 of the License, or (at your
3294 + * option) any later version.
3296 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3297 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3298 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3299 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3300 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3301 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3302 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3303 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3304 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3305 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3307 + * You should have received a copy of the GNU General Public License along
3308 + * with this program; if not, write to the Free Software Foundation, Inc.,
3309 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3315 + **************************************************************************
3319 +#ifndef RC32355_ETHER_H
3320 +#define RC32355_ETHER_H
3322 +#include <asm/idt-boards/rc32300/rc32355_dma.h>
3325 + * A partial image of the RC32355 ethernet registers
3384 +} rc32355_eth_regs_t;
3386 +#define rc32355_eth_regs ((rc32355_eth_regs_t*)KSEG1ADDR(RC32355_ETH_BASE))
3388 +#define ETH_INTFC (RC32355_ETH_BASE + 0x000) /* INTerFace Control */
3389 +#define ETH_FIFOTT (RC32355_ETH_BASE + 0x004) /* FIFO Transmit Threshold */
3390 +#define ETH_ARC (RC32355_ETH_BASE + 0x008) /* Address Recognition Ctrl */
3391 +#define ETH_HASH0 (RC32355_ETH_BASE + 0x00C) /* 32 multicast Hash bits */
3392 +#define ETH_HASH1 (RC32355_ETH_BASE + 0x010) /* another 32 Hash bits */
3393 +#define ETH_FIFOST (RC32355_ETH_BASE + 0x014) /* FIFO Status Threshold */
3394 +#define ETH_FIFOS (RC32355_ETH_BASE + 0x018) /* FIFO Status Register */
3395 +#define ETH_ODEOPS (RC32355_ETH_BASE + 0x01C) /* Out Data End-Of-Pkt Size */
3396 +#define ETH_IS (RC32355_ETH_BASE + 0x020) /* Input Status */
3397 +#define ETH_OS (RC32355_ETH_BASE + 0x024) /* Output Status */
3398 +#define ETH_MCP (RC32355_ETH_BASE + 0x028) /* Managemt Clock Prescaler */
3399 +#define ETH_ID (RC32355_ETH_BASE + 0x030) /* Input Data register */
3400 +#define ETH_OD (RC32355_ETH_BASE + 0x040) /* Output Data register */
3401 +#define ETH_ODEOP (RC32355_ETH_BASE + 0x050) /* OD End-Of-Packet Size */
3403 +/* for n in { 0, 1, 2, 3 } */
3404 +#define ETH_SAL(n) (RC32355_ETH_BASE + 0x100 + (n * 8)) /* Stn Address 2-5 */
3405 +#define ETH_SAH(n) (RC32355_ETH_BASE + 0x104 + (n * 8)) /* Stn Address 0-1 */
3407 +#define ETH_RBC (RC32355_ETH_BASE + 0x120) /* Receive Byte Count */
3408 +#define ETH_RPC (RC32355_ETH_BASE + 0x124) /* Receive Packet Count */
3409 +#define ETH_RUPC (RC32355_ETH_BASE + 0x128) /* Rx Undersized Pkt count */
3410 +#define ETH_RFC (RC32355_ETH_BASE + 0x12C) /* Receive Fragment Count */
3411 +#define ETH_TBC (RC32355_ETH_BASE + 0x130) /* Transmit Byte Count */
3412 +#define ETH_GPF (RC32355_ETH_BASE + 0x134) /* Generate Pause Frame */
3413 +#define ETH_MAC1 (RC32355_ETH_BASE + 0x200) /* Medium Access Control 1 */
3414 +#define ETH_MAC2 (RC32355_ETH_BASE + 0x204) /* Medium Access Control 2 */
3415 +#define ETH_IPGT (RC32355_ETH_BASE + 0x208) /* Back-to-back InterPkt Gap */
3416 +#define ETH_IPGR (RC32355_ETH_BASE + 0x20C) /* Non " InterPkt Gap */
3417 +#define ETH_CLRT (RC32355_ETH_BASE + 0x210) /* Collis'n Window and Retry */
3418 +#define ETH_MAXF (RC32355_ETH_BASE + 0x214) /* Maximum Frame Length */
3419 +#define ETH_MTEST (RC32355_ETH_BASE + 0x21C) /* MAC Test */
3421 +#define ETHMIIM_CFG (RC32355_ETH_BASE + 0x220) /* MII Mgmt Configuration */
3422 +#define ETHMIIM_CMD (RC32355_ETH_BASE + 0x224) /* MII Mgmt Command */
3423 +#define ETHMIIM_ADDR (RC32355_ETH_BASE + 0x228) /* MII Mgmt Address */
3424 +#define ETHMIIM_WTD (RC32355_ETH_BASE + 0x22C) /* MII Mgmt Write Data */
3425 +#define ETHMIIM_RDD (RC32355_ETH_BASE + 0x230) /* MII Mgmt Read Data */
3426 +#define ETHMIIM_IND (RC32355_ETH_BASE + 0x234) /* MII Mgmt Indicators */
3428 +/* for n in { 0, 1, 2 } */
3429 +#define ETH_CFSA(n) (RC32355_ETH_BASE + 0x240 + ((n) * 4)) /* Station Addr */
3433 + * Register Interpretations follow
3436 +/******************************************************************************
3437 + * ETHINTFC register
3438 + *****************************************************************************/
3440 +#define ETHERINTFC_EN (1<<0)
3441 +#define ETHERINTFC_ITS (1<<1)
3442 +#define ETHERINTFC_RES (1<<2)
3443 +#define ETHERINTFC_RIP (1<<2)
3444 +#define ETHERINTFC_JAM (1<<3)
3446 +/******************************************************************************
3447 + * ETHFIFOTT register
3448 + *****************************************************************************/
3450 +#define ETHERFIFOTT_TTH(v) (((v)&0x3f)<<0)
3452 +/******************************************************************************
3454 + *****************************************************************************/
3456 +#define ETHERARC_PRO (1<<0)
3457 +#define ETHERARC_AM (1<<1)
3458 +#define ETHERARC_AFM (1<<2)
3459 +#define ETHERARC_AB (1<<3)
3461 +/******************************************************************************
3462 + * ETHHASH registers
3463 + *****************************************************************************/
3465 +#define ETHERHASH0(v) (((v)&0xffff)<<0)
3466 +#define ETHERHASH1(v) (((v)&0xffff)<<0)
3468 +/******************************************************************************
3470 + *****************************************************************************/
3472 +#define ETHERSAL0(v) (((v)&0xffff)<<0)
3473 +#define ETHERSAL1(v) (((v)&0xffff)<<0)
3474 +#define ETHERSAL2(v) (((v)&0xffff)<<0)
3475 +#define ETHERSAL3(v) (((v)&0xffff)<<0)
3476 +#define ETHERSAH0(v) (((v)&0xff)<<0)
3477 +#define ETHERSAH1(v) (((v)&0xff)<<0)
3478 +#define ETHERSAH2(v) (((v)&0xff)<<0)
3479 +#define ETHERSAH3(v) (((v)&0xff)<<0)
3481 +/******************************************************************************
3482 + * ETHFIFOST register
3483 + *****************************************************************************/
3485 +#define ETHERFIFOST_IRTH(v) (((v)&0x3f)<<0)
3486 +#define ETHERFIFOST_ORTH(v) (((v)&0x3f)<<16)
3488 +/******************************************************************************
3489 + * ETHFIFOS register
3490 + *****************************************************************************/
3492 +#define ETHERFIFOS_IR (1<<0)
3493 +#define ETHERFIFOS_OR (1<<1)
3494 +#define ETHERFIFOS_OVR (1<<2)
3495 +#define ETHERFIFOS_UND (1<<3)
3497 +/******************************************************************************
3499 + *****************************************************************************/
3501 +#define ETHERID(v) (((v)&0xffff)<<0)
3502 +#define ETHEROD(v) (((v)&0xffff)<<0)
3504 +/******************************************************************************
3505 + * ETHODEOPS register
3506 + *****************************************************************************/
3508 +#define ETHERODEOPS_SIZE(v) (((v)&0x3)<<0)
3510 +/******************************************************************************
3511 + * ETHODEOP register
3512 + *****************************************************************************/
3514 +#define ETHERODEOP(v) (((v)&0xffff)<<0)
3516 +/******************************************************************************
3518 + *****************************************************************************/
3520 +#define ETHERIS_EOP (1<<0)
3521 +#define ETHERIS_ROK (1<<2)
3522 +#define ETHERIS_FM (1<<3)
3523 +#define ETHERIS_MP (1<<4)
3524 +#define ETHERIS_BP (1<<5)
3525 +#define ETHERIS_VLT (1<<6)
3526 +#define ETHERIS_CF (1<<7)
3527 +#define ETHERIS_OVR (1<<8)
3528 +#define ETHERIS_CRC (1<<9)
3529 +#define ETHERIS_CV (1<<10)
3530 +#define ETHERIS_DB (1<<11)
3531 +#define ETHERIS_LE (1<<12)
3532 +#define ETHERIS_LOR (1<<13)
3533 +#define ETHERIS_SIZE(v) (((v)&0x3)<<14)
3534 +#define ETHERIS_LENGTH(v) (((v)&0xff)<<16)
3536 +/******************************************************************************
3538 + *****************************************************************************/
3540 +#define ETHEROS_T (1<<0)
3541 +#define ETHEROS_TOK (1<<6)
3542 +#define ETHEROS_MP (1<<7)
3543 +#define ETHEROS_BP (1<<8)
3544 +#define ETHEROS_UND (1<<9)
3545 +#define ETHEROS_OF (1<<10)
3546 +#define ETHEROS_ED (1<<11)
3547 +#define ETHEROS_EC (1<<12)
3548 +#define ETHEROS_LC (1<<13)
3549 +#define ETHEROS_TD (1<<14)
3550 +#define ETHEROS_CRC (1<<15)
3551 +#define ETHEROS_LE (1<<16)
3552 +#define ETHEROS_CC(v) (((v)&0xf)<<17)
3553 +#define ETHEROS_PFD (1<<21)
3555 +/******************************************************************************
3556 + * Statistics registers
3557 + *****************************************************************************/
3559 +#define ETHERRBC(v) (((v)&0xffff)<<0)
3560 +#define ETHERRPC(v) (((v)&0xffff)<<0)
3561 +#define ETHERRUPC(v) (((v)&0xffff)<<0)
3562 +#define ETHERRFC(v) (((v)&0xffff)<<0)
3563 +#define ETHERTBC(v) (((v)&0xffff)<<0)
3565 +/******************************************************************************
3567 + *****************************************************************************/
3569 +#define ETHERGPF_PTV(v) (((v)&0xff)<<0)
3571 +/******************************************************************************
3573 + *****************************************************************************/
3575 +#define ETHERMAC1_RE (1<<0)
3576 +#define ETHERMAC1_PAF (1<<1)
3577 +#define ETHERMAC1_RFC (1<<2)
3578 +#define ETHERMAC1_TFC (1<<3)
3579 +#define ETHERMAC1_LB (1<<4)
3580 +#define ETHERMAC1_MR (1<<15)
3583 +#define ETHERMAC2_FD (1<<0)
3584 +#define ETHERMAC2_FLC (1<<1)
3585 +#define ETHERMAC2_HFE (1<<2)
3586 +#define ETHERMAC2_DC (1<<3)
3587 +#define ETHERMAC2_CEN (1<<4)
3588 +#define ETHERMAC2_PE (1<<5)
3589 +#define ETHERMAC2_VPE (1<<6)
3590 +#define ETHERMAC2_APE (1<<7)
3591 +#define ETHERMAC2_PPE (1<<8)
3592 +#define ETHERMAC2_LPE (1<<9)
3593 +#define ETHERMAC2_NB (1<<12)
3594 +#define ETHERMAC2_BP (1<<13)
3595 +#define ETHERMAC2_ED (1<<14)
3598 +#define ETHERIPGT(v) (((v)&0x3f)<<0)
3601 +#define ETHERIPGR_IPGR1(v) (((v)&0x3f)<<0)
3602 +#define ETHERIPGR_IPGR2(v) (((v)&0x3f)<<8)
3605 +#define ETHERCLRT_MAXRET(v) (((v)&0x3f)<<0)
3606 +#define ETHERCLRT_COLWIN(v) (((v)&0x3f)<<8)
3609 +#define ETHERMAXF(v) (((v)&0x3f)<<0)
3612 +#define ETHERMTEST_TB (1<<2)
3615 +#define ETHERMCP_DIV(v) (((v)&0xff)<<0)
3618 +#define ETHERMIIMCFG_CS(v) (((v)&0x3)<<2)
3619 +#define ETHERMIIMCFG_R (1<<15)
3622 +#define ETHERMIIMCMD_RD (1<<0)
3623 +#define ETHERMIIMCMD_SCN (1<<1)
3626 +#define ETHERMIIMADDR_REGADDR(v) (((v)&0x1f)<<0)
3627 +#define ETHERMIIMADDR_PHYADDR(v) (((v)&0x1f)<<8)
3630 +#define ETHERMIIMWTD(v) (((v)&0xff)<<0)
3633 +#define ETHERMIIMRDD(v) (((v)&0xff)<<0)
3636 +#define ETHERMIIMIND_BSY (1<<0)
3637 +#define ETHERMIIMIND_SCN (1<<1)
3638 +#define ETHERMIIMIND_NV (1<<2)
3641 +#define ETHERDMA_IN_LENGTH(v) (((v)&0xffff)<<16)
3642 +#define ETHERDMA_IN_CES (1<<14)
3643 +#define ETHERDMA_IN_LOR (1<<13)
3644 +#define ETHERDMA_IN_LE (1<<12)
3645 +#define ETHERDMA_IN_DB (1<<11)
3646 +#define ETHERDMA_IN_CV (1<<10)
3647 +#define ETHERDMA_IN_CRC (1<<9)
3648 +#define ETHERDMA_IN_OVR (1<<8)
3649 +#define ETHERDMA_IN_CF (1<<7)
3650 +#define ETHERDMA_IN_VLT (1<<6)
3651 +#define ETHERDMA_IN_BP (1<<5)
3652 +#define ETHERDMA_IN_MP (1<<4)
3653 +#define ETHERDMA_IN_FM (1<<3)
3654 +#define ETHERDMA_IN_ROK (1<<2)
3655 +#define ETHERDMA_IN_LD (1<<1)
3656 +#define ETHERDMA_IN_FD (1<<0)
3659 +#define ETHERDMA_OUT_CC(v) (((v)&0xf)<<17)
3660 +#define ETHERDMA_OUT_CNT 0x001e0000
3661 +#define ETHERDMA_OUT_SHFT 17
3662 +#define ETHERDMA_OUT_LE (1<<16)
3664 +#define ETHERDMA_OUT_CRC (1<<15)
3665 +#define ETHERDMA_OUT_TD (1<<14)
3666 +#define ETHERDMA_OUT_LC (1<<13)
3667 +#define ETHERDMA_OUT_EC (1<<12)
3668 +#define ETHERDMA_OUT_ED (1<<11)
3669 +#define ETHERDMA_OUT_OF (1<<10)
3670 +#define ETHERDMA_OUT_UND (1<<9)
3671 +#define ETHERDMA_OUT_BP (1<<8)
3672 +#define ETHERDMA_OUT_MP (1<<7)
3673 +#define ETHERDMA_OUT_TOK (1<<6)
3674 +#define ETHERDMA_OUT_HEN (1<<5)
3675 +#define ETHERDMA_OUT_CEN (1<<4)
3676 +#define ETHERDMA_OUT_PEN (1<<3)
3677 +#define ETHERDMA_OUT_OEN (1<<2)
3678 +#define ETHERDMA_OUT_LD (1<<1)
3679 +#define ETHERDMA_OUT_FD (1<<0)
3682 + (ETHERDMA_IN_OVR | ETHERDMA_IN_CRC | ETHERDMA_IN_CV | ETHERDMA_IN_LE)
3684 + (ETHERDMA_OUT_LC | ETHERDMA_OUT_EC | ETHERDMA_OUT_ED | \
3685 + ETHERDMA_OUT_OF | ETHERDMA_OUT_UND)
3687 +#define IS_RCV_ROK(X) (((X) & (1<<2)) >> 2) /* Receive Okay */
3688 +#define IS_RCV_FM(X) (((X) & (1<<3)) >> 3) /* Is Filter Match */
3689 +#define IS_RCV_MP(X) (((X) & (1<<4)) >> 4) /* Is it MP */
3690 +#define IS_RCV_BP(X) (((X) & (1<<5)) >> 5) /* Is it BP */
3691 +#define IS_RCV_VLT(X) (((X) & (1<<6)) >> 6) /* VLAN Tag Detect */
3692 +#define IS_RCV_CF(X) (((X) & (1<<7)) >> 7) /* Control Frame */
3693 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<8)) >> 8) /* Receive Overflow */
3694 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<9)) >> 9) /* CRC Error */
3695 +#define IS_RCV_CV_ERR(X) (((X) & (1<<10))>>10) /* Code Violation */
3696 +#define IS_RCV_DB_ERR(X) (((X) & (1<<11))>>11) /* Dribble Bits */
3697 +#define IS_RCV_LE_ERR(X) (((X) & (1<<12))>>12) /* Length error */
3698 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<13))>>13) /* Length Out of
3700 +#define IS_RCV_CES_ERR(X) (((X) & (1<<14))>>14) /* Preamble error */
3701 +#define RCVPKT_LENGTH(X) (((X) & 0xFFFF0000)>>16) /* Length of the
3702 + received packet */
3704 +#define IS_TX_TOK(X) (((X) & (1<<6) ) >> 6 ) /* Transmit Okay */
3705 +#define IS_TX_MP(X) (((X) & (1<<7) ) >> 7 ) /* Multicast */
3707 +#define IS_TX_BP(X) (((X) & (1<<8) ) >> 8 ) /* Broadcast */
3708 +#define IS_TX_UND_ERR(X) (((X) & (1<<9) ) >> 9 ) /* Transmit FIFO
3710 +#define IS_TX_OF_ERR(X) (((X) & (1<<10)) >>10 ) /* Oversized frame */
3711 +#define IS_TX_ED_ERR(X) (((X) & (1<<11)) >>11 ) /* Excessive
3713 +#define IS_TX_EC_ERR(X) (((X) & (1<<12)) >>12 ) /* Excessive
3715 +#define IS_TX_LC_ERR(X) (((X) & (1<<13)) >>13 ) /* Late Collision */
3716 +#define IS_TX_TD_ERR(X) (((X) & (1<<14)) >>14 ) /* Transmit deferred*/
3717 +#define IS_TX_CRC_ERR(X) (((X) & (1<<15)) >>15 ) /* CRC Error */
3718 +#define IS_TX_LE_ERR(X) (((X) & (1<<16)) >>16 ) /* Length Error */
3720 +#define TX_COLLISION_COUNT(X) (((X) & 0x001E0000u)>>17) /* Collision Count */
3722 +#endif /* RC32355_ETHER_H */
3724 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
3725 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32355.h 1970-01-01 01:00:00.000000000 +0100
3726 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32355.h 2006-06-18 12:44:28.000000000 +0200
3728 +/**************************************************************************
3730 + * BRIEF MODULE DESCRIPTION
3731 + * Definitions for IDT RC32355 CPU.
3733 + * Copyright 2004 IDT Inc.
3734 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3737 + * This program is free software; you can redistribute it and/or modify it
3738 + * under the terms of the GNU General Public License as published by the
3739 + * Free Software Foundation; either version 2 of the License, or (at your
3740 + * option) any later version.
3742 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3743 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3744 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3745 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3746 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3747 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3748 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3749 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3750 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3751 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3753 + * You should have received a copy of the GNU General Public License along
3754 + * with this program; if not, write to the Free Software Foundation, Inc.,
3755 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3761 + **************************************************************************
3765 +#ifndef _RC32355_H_
3766 +#define _RC32355_H_
3768 +#include <linux/delay.h>
3769 +#include <asm/io.h>
3771 +/* Base address of internal registers */
3772 +#define RC32355_REG_BASE 0x18000000
3774 +/* System ID Registers */
3775 +#define CPU_SYSID (RC32355_REG_BASE + 0x00018)
3776 +#define CPU_BTADDR (RC32355_REG_BASE + 0x0001c)
3777 +#define CPU_REV (RC32355_REG_BASE + 0x0002c)
3779 +/* Reset Controller */
3780 +#define RESET_CNTL (RC32355_REG_BASE + 0x08000)
3782 +/* Device Controller */
3783 +#define DEV0_BASE (RC32355_REG_BASE + 0x10000)
3784 +#define DEV0_MASK (RC32355_REG_BASE + 0x10004)
3785 +#define DEV0_CNTL (RC32355_REG_BASE + 0x10008)
3786 +#define DEV0_TIMING (RC32355_REG_BASE + 0x1000c)
3787 +#define DEV_REG_OFFSET 0x10
3789 +/* SDRAM Controller */
3790 +#define SDRAM0_BASE (RC32355_REG_BASE + 0x18000)
3791 +#define SDRAM0_MASK (RC32355_REG_BASE + 0x18004)
3792 +#define SDRAM1_BASE (RC32355_REG_BASE + 0x18008)
3793 +#define SDRAM1_MASK (RC32355_REG_BASE + 0x1800c)
3794 +#define SDRAM_CNTL (RC32355_REG_BASE + 0x18010)
3797 +#define BUS_ARB_CNTL0 (RC32355_REG_BASE + 0x20000)
3798 +#define BUS_ARB_CNTL1 (RC32355_REG_BASE + 0x20004)
3800 +/* Counters/Timers */
3801 +#define TIMER0_COUNT (RC32355_REG_BASE + 0x28000)
3802 +#define TIMER0_COMPARE (RC32355_REG_BASE + 0x28004)
3803 +#define TIMER0_CNTL (RC32355_REG_BASE + 0x28008)
3804 +#define TIMER_REG_OFFSET 0x0C
3806 +/* System Integrity */
3808 +/* Interrupt Controller */
3809 +#define IC_GROUP0_PEND (RC32355_REG_BASE + 0x30000)
3810 +#define IC_GROUP0_MASK (RC32355_REG_BASE + 0x30004)
3811 +#define IC_GROUP_OFFSET 0x08
3813 +#define NUM_INTR_GROUPS 5
3815 + * The IRQ mapping is as follows:
3818 + * --- -------------------
3819 + * 0 SW0 (IP0) SW0 intr
3820 + * 1 SW1 (IP1) SW1 intr
3821 + * - Int0 (IP2) mapped to GROUP0_IRQ_BASE
3822 + * - Int1 (IP3) mapped to GROUP1_IRQ_BASE
3823 + * - Int2 (IP4) mapped to GROUP2_IRQ_BASE
3824 + * - Int3 (IP5) mapped to GROUP3_IRQ_BASE
3825 + * - Int4 (IP6) mapped to GROUP4_IRQ_BASE
3826 + * 7 Int5 (IP7) CP0 Timer
3828 + * IRQ's 8 and up are all mapped to Int0-4 (IP2-IP6), which
3829 + * internally on the RC32355 is routed to the Expansion
3830 + * Interrupt Controller.
3832 +#define MIPS_CPU_TIMER_IRQ 7
3834 +#define GROUP0_IRQ_BASE 8 // Counter/Timers, UCW
3835 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) // DMA
3836 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) // ATM
3837 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) // TDM, Eth, USB, UARTs, I2C
3838 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32) // GPIO
3840 +#define RC32355_NR_IRQS (GROUP4_IRQ_BASE + 32)
3842 +/* DMA - see rc32355_dma.h for full list of registers */
3844 +#define RC32355_DMA_BASE (RC32355_REG_BASE + 0x38000)
3845 +#define DMA_CHAN_OFFSET 0x14
3847 +/* GPIO Controller */
3853 +#define RC32300_UART0_BASE (RC32355_REG_BASE + 0x50003)
3854 +#define RC32300_UART1_BASE (RC32355_REG_BASE + 0x50023)
3856 +#define RC32300_UART0_BASE (RC32355_REG_BASE + 0x50000)
3857 +#define RC32300_UART1_BASE (RC32355_REG_BASE + 0x50020)
3860 +#define RC32300_UART0_IRQ (GROUP3_IRQ_BASE + 14)
3861 +#define RC32300_UART1_IRQ (GROUP3_IRQ_BASE + 17)
3865 +/* Ethernet - see rc32355_eth.h for full list of registers */
3867 +#define RC32355_ETH_BASE (RC32355_REG_BASE + 0x60000)
3870 +#define IDT_CLOCK_MULT 2
3872 +/* Memory map of 79EB355 board */
3875 +#define RAM_BASE 0x00000000
3876 +#define RAM_SIZE (32*1024*1024)
3878 +/* SRAM (device 1) */
3879 +#define SRAM_BASE 0x02000000
3880 +#define SRAM_SIZE 0x00100000
3882 +/* FLASH (device 2) */
3883 +#define FLASH_BASE 0x0C000000
3884 +#define FLASH_SIZE 0x00C00000
3886 +/* ATM PHY (device 4) */
3887 +#define ATM_PHY_BASE 0x14000000
3889 +/* TDM switch (device 3) */
3890 +#define TDM_BASE 0x1A000000
3892 +/* LCD panel (device 3) */
3893 +#define LCD_BASE 0x1A002000
3895 +/* RTC (DS1511W) (device 3) */
3896 +#define RTC_BASE 0x1A004000
3898 +/* NVRAM (256 bytes internal to the DS1511 RTC) */
3899 +#define NVRAM_ADDR RTC_BASE + 0x10
3900 +#define NVRAM_DATA RTC_BASE + 0x13
3901 +#define NVRAM_ENVSIZE_OFF 4
3902 +#define NVRAM_ENVSTART_OFF 32
3904 +#endif /* _RC32355_H_ */
3905 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
3906 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_dma.h 1970-01-01 01:00:00.000000000 +0100
3907 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_dma.h 2006-06-18 12:44:28.000000000 +0200
3909 +/**************************************************************************
3911 + * BRIEF MODULE DESCRIPTION
3912 + * RC32365/336 DMA hardware abstraction.
3914 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
3916 + * This program is free software; you can redistribute it and/or modify it
3917 + * under the terms of the GNU General Public License as published by the
3918 + * Free Software Foundation; either version 2 of the License, or (at your
3919 + * option) any later version.
3921 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3922 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3923 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3924 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3925 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3926 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3927 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3928 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3929 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3930 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3932 + * You should have received a copy of the GNU General Public License along
3933 + * with this program; if not, write to the Free Software Foundation, Inc.,
3934 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3937 + **************************************************************************
3938 + * May 2004 P. Sadik.
3944 + **************************************************************************
3947 +#ifndef __IDT_RC32365_DMA_H__
3948 +#define __IDT_RC32365_DMA_H__
3952 + DMA0_PhysicalAddress = 0x18038000,
3953 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
3955 + DMA0_VirtualAddress = 0xb8038000,
3956 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
3960 + * DMA descriptor (in physical memory).
3963 +typedef struct DMAD_s
3965 + u32 control ; // Control. use DMAD_*
3966 + u32 ca ; // Current Address.
3967 + u32 devcs ; // Device control and status.
3968 + u32 link ; // Next descriptor in chain.
3969 +} volatile *DMAD_t ;
3973 + DMAD_size = sizeof (struct DMAD_s),
3974 + DMAD_count_b = 0, // in DMAD_t -> control
3975 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
3976 + DMAD_ds_b = 20, // in DMAD_t -> control
3977 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
3978 + DMAD_ds_extToMem0_v = 0,
3979 + DMAD_ds_memToExt0_v = 1,
3980 + DMAD_ds_extToMem1_v = 0,
3981 + DMAD_ds_memToExt1_v = 1,
3982 + DMAD_ds_ethRcv0_v = 0,
3983 + DMAD_ds_ethXmt0_v = 0,
3984 + DMAD_ds_ethRcv1_v = 0,
3985 + DMAD_ds_ethXmt2_v = 0,
3986 + DMAD_ds_memToFifo_v = 0,
3987 + DMAD_ds_fifoToMem_v = 0,
3988 + DMAD_ds_rng_de_v = 1,//randomNumberGenerator on LC/DE
3989 + DMAD_ds_pciToMem_v = 0,
3990 + DMAD_ds_memToPci_v = 0,
3991 + DMAD_ds_securityInput_v = 0,
3992 + DMAD_ds_securityOutput_v = 0,
3993 + DMAD_ds_rng_se_v = 0,//randomNumberGenerator on SE
3995 + DMAD_devcmd_b = 22, // in DMAD_t -> control
3996 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
3997 + DMAD_devcmd_byte_v = 0, //memory-to-memory
3998 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
3999 + DMAD_devcmd_word_v = 2, //memory-to-memory
4000 + DMAD_devcmd_2words_v = 3, //memory-to-memory
4001 + DMAD_devcmd_4words_v = 4, //memory-to-memory
4002 + DMAD_devcmd_6words_v = 5, //memory-to-memory
4003 + DMAD_devcmd_8words_v = 6, //memory-to-memory
4004 + DMAD_devcmd_16words_v = 7, //memory-to-memory
4005 + DMAD_cof_b = 25, // chain on finished
4006 + DMAD_cof_m = 0x02000000, //
4007 + DMAD_cod_b = 26, // chain on done
4008 + DMAD_cod_m = 0x04000000, //
4009 + DMAD_iof_b = 27, // interrupt on finished
4010 + DMAD_iof_m = 0x08000000, //
4011 + DMAD_iod_b = 28, // interrupt on done
4012 + DMAD_iod_m = 0x10000000, //
4013 + DMAD_t_b = 29, // terminated
4014 + DMAD_t_m = 0x20000000, //
4015 + DMAD_d_b = 30, // done
4016 + DMAD_d_m = 0x40000000, //
4017 + DMAD_f_b = 31, // finished
4018 + DMAD_f_m = 0x80000000, //
4022 + * DMA register (within Internal Register Map).
4027 + u32 dmac ; // Control.
4028 + u32 dmas ; // Status.
4029 + u32 dmasm ; // Mask.
4030 + u32 dmadptr ; // Descriptor pointer.
4031 + u32 dmandptr ; // Next descriptor pointer.
4034 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
4036 +//DMA_Channels use DMACH_count instead
4040 + DMAC_run_b = 0, //
4041 + DMAC_run_m = 0x00000001, //
4042 + DMAC_dm_b = 1, // done mask
4043 + DMAC_dm_m = 0x00000002, //
4044 + DMAC_mode_b = 2, //
4045 + DMAC_mode_m = 0x0000000c, //
4046 + DMAC_mode_auto_v = 0,
4047 + DMAC_mode_burst_v = 1,
4048 + DMAC_mode_transfer_v = 2, //usually used
4049 + DMAC_mode_reserved_v = 3,
4051 + DMAC_a_m = 0x00000010, //
4053 + DMAS_f_b = 0, // finished (sticky)
4054 + DMAS_f_m = 0x00000001, //
4055 + DMAS_d_b = 1, // done (sticky)
4056 + DMAS_d_m = 0x00000002, //
4057 + DMAS_c_b = 2, // chain (sticky)
4058 + DMAS_c_m = 0x00000004, //
4059 + DMAS_e_b = 3, // error (sticky)
4060 + DMAS_e_m = 0x00000008, //
4061 + DMAS_h_b = 4, // halt (sticky)
4062 + DMAS_h_m = 0x00000010, //
4064 + DMASM_f_b = 0, // finished (1=mask)
4065 + DMASM_f_m = 0x00000001, //
4066 + DMASM_d_b = 1, // done (1=mask)
4067 + DMASM_d_m = 0x00000002, //
4068 + DMASM_c_b = 2, // chain (1=mask)
4069 + DMASM_c_m = 0x00000004, //
4070 + DMASM_e_b = 3, // error (1=mask)
4071 + DMASM_e_m = 0x00000008, //
4072 + DMASM_h_b = 4, // halt (1=mask)
4073 + DMASM_h_m = 0x00000010, //
4077 + * DMA channel definitions
4082 + DMACH_ethRcv0 = 0,
4083 + DMACH_ethXmt0 = 1,
4084 + DMACH_ethRcv1 = 2,
4085 + DMACH_ethXmt2 = 3,
4086 + DMACH_pciToMem = 4,
4087 + DMACH_memToPci = 5,
4088 + DMACH_securityInput = 6,
4089 + DMACH_securityOutput = 7,
4092 + DMACH_count //must be last
4096 +typedef struct DMAC_s
4098 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
4099 +} volatile *DMA_t ;
4103 + * External DMA parameters
4108 + DMADEVCMD_ts_b = 0, // ts field in devcmd
4109 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
4110 + DMADEVCMD_ts_byte_v = 0,
4111 + DMADEVCMD_ts_halfword_v = 1,
4112 + DMADEVCMD_ts_word_v = 2,
4113 + DMADEVCMD_ts_2word_v = 3,
4114 + DMADEVCMD_ts_4word_v = 4,
4115 + DMADEVCMD_ts_6word_v = 5,
4116 + DMADEVCMD_ts_8word_v = 6,
4117 + DMADEVCMD_ts_16word_v = 7
4121 +#if 1 // aws - Compatibility.
4122 +# define EXTDMA_ts_b DMADEVCMD_ts_b
4123 +# define EXTDMA_ts_m DMADEVCMD_ts_m
4124 +# define EXTDMA_ts_byte_v DMADEVCMD_ts_byte_v
4125 +# define EXTDMA_ts_halfword_v DMADEVCMD_ts_halfword_v
4126 +# define EXTDMA_ts_word_v DMADEVCMD_ts_word_v
4127 +# define EXTDMA_ts_2word_v DMADEVCMD_ts_2word_v
4128 +# define EXTDMA_ts_4word_v DMADEVCMD_ts_4word_v
4129 +# define EXTDMA_ts_6word_v DMADEVCMD_ts_6word_v
4130 +# define EXTDMA_ts_8word_v DMADEVCMD_ts_8word_v
4131 +# define EXTDMA_ts_16word_v DMADEVCMD_ts_16word_v
4132 +#endif // aws - Compatibility.
4134 +#endif // __IDT_RC32365_DMA_H__
4135 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
4136 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h 1970-01-01 01:00:00.000000000 +0100
4137 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h 2006-06-18 12:44:28.000000000 +0200
4139 +/**************************************************************************
4141 + * BRIEF MODULE DESCRIPTION
4142 + * RC32365/336 DMA interface routines.
4144 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4146 + * This program is free software; you can redistribute it and/or modify it
4147 + * under the terms of the GNU General Public License as published by the
4148 + * Free Software Foundation; either version 2 of the License, or (at your
4149 + * option) any later version.
4151 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4152 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4153 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4154 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4155 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4156 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4157 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4158 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4159 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4160 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4162 + * You should have received a copy of the GNU General Public License along
4163 + * with this program; if not, write to the Free Software Foundation, Inc.,
4164 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4167 + **************************************************************************
4168 + * May 2004 P. Sadik.
4174 + **************************************************************************
4177 +#ifndef __IDT_RC32365_DMA_V_H__
4178 +#define __IDT_RC32365_DMA_V_H__
4181 +#include <asm/idt-boards/rc32300/rc32300.h>
4182 +#include <asm/idt-boards/rc32300/rc32365_dma.h>
4183 +#include <asm/idt-boards/rc32300/rc32365.h>
4185 +#define DMA_CHAN_OFFSET 0x14
4186 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
4187 +#define IS_DMA_FINISHED(X) (((X) & (DMAD_f_m)) != 0)
4188 +#define IS_DMA_DONE(X) (((X) & (DMAD_d_m)) != 0)
4190 +#define DMA_COUNT(count) \
4191 + ((count) & DMAD_count_m)
4193 +#define DMA_HALT_TIMEOUT 500
4195 +static inline int rc32365_halt_dma(DMA_Chan_t ch)
4198 + if (local_readl(&ch->dmac) & DMAC_run_m) {
4199 + local_writel(0, &ch->dmac);
4201 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
4202 + if (local_readl(&ch->dmas) & DMAS_h_m) {
4203 + local_writel(0, &ch->dmas);
4210 + return timeout ? 0 : 1;
4214 +static inline void rc32365_start_dma(DMA_Chan_t ch, u32 dma_addr)
4216 + local_writel(0, &ch->dmandptr);
4217 + local_writel(dma_addr, &ch->dmadptr);
4220 +static inline void rc32365_chain_dma(DMA_Chan_t ch, u32 dma_addr)
4222 + local_writel(dma_addr, &ch->dmandptr);
4224 +#endif //__IDT_RC32365_DMA_V_H__
4225 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
4226 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_eth.h 1970-01-01 01:00:00.000000000 +0100
4227 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_eth.h 2006-06-18 12:44:28.000000000 +0200
4229 +/**************************************************************************
4231 + * BRIEF MODULE DESCRIPTION
4232 + * RC32365/336 Ethernet hardware abstraction.
4234 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4236 + * This program is free software; you can redistribute it and/or modify it
4237 + * under the terms of the GNU General Public License as published by the
4238 + * Free Software Foundation; either version 2 of the License, or (at your
4239 + * option) any later version.
4241 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4242 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4243 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4244 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4245 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4246 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4247 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4248 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4249 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4250 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4252 + * You should have received a copy of the GNU General Public License along
4253 + * with this program; if not, write to the Free Software Foundation, Inc.,
4254 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4257 + **************************************************************************
4258 + * May 2004 P. Sadik.
4264 + **************************************************************************
4267 +#ifndef __IDT_RC32365_ETH_H__
4268 +#define __IDT_RC32365_ETH_H__
4272 + ETH0_PhysicalAddress = 0x18058000,
4273 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
4274 + ETH0_VirtualAddress = 0xb8058000,
4276 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
4278 + ETH1_PhysicalAddress = 0x18060000,
4279 + ETH1_VirtualAddress = 0xb8060000, // Default
4289 + u32 ethu0 [4] ; // Reserved.
4292 + u32 eth_u1 [10] ; // Reserved.
4294 + u32 eth_u2 [42] ; // Reserved.
4309 + u32 eth_u9 [50] ; // Reserved.
4316 + u32 eth_u10 ; // Reserved.
4324 + u32 eth_u11 ; // Reserved.
4325 + u32 eth_u12 ; // Reserved.
4333 + ETHINTFC_en_b = 0,
4334 + ETHINTFC_en_m = 0x00000001,
4335 + ETHINTFC_its_b = 1,
4336 + ETHINTFC_its_m = 0x00000002,
4337 + ETHINTFC_rip_b = 2,
4338 + ETHINTFC_rip_m = 0x00000004,
4339 + ETHINTFC_jam_b = 3,
4340 + ETHINTFC_jam_m = 0x00000008,
4341 + ETHINTFC_ovr_b = 4,
4342 + ETHINTFC_ovr_m = 0x00000010,
4343 + ETHINTFC_und_b = 5,
4344 + ETHINTFC_und_m = 0x00000020,
4346 + ETHFIFOTT_tth_b = 0,
4347 + ETHFIFOTT_tth_m = 0x0000007f,
4350 + ETHARC_pro_m = 0x00000001,
4352 + ETHARC_am_m = 0x00000002,
4354 + ETHARC_afm_m = 0x00000004,
4356 + ETHARC_ab_m = 0x00000008,
4358 + ETHSAL_byte5_b = 0,
4359 + ETHSAL_byte5_m = 0x000000ff,
4360 + ETHSAL_byte4_b = 8,
4361 + ETHSAL_byte4_m = 0x0000ff00,
4362 + ETHSAL_byte3_b = 16,
4363 + ETHSAL_byte3_m = 0x00ff0000,
4364 + ETHSAL_byte2_b = 24,
4365 + ETHSAL_byte2_m = 0xff000000,
4367 + ETHSAH_byte1_b = 0,
4368 + ETHSAH_byte1_m = 0x000000ff,
4369 + ETHSAH_byte0_b = 8,
4370 + ETHSAH_byte0_m = 0x0000ff00,
4373 + ETHGPF_ptv_m = 0x0000ffff,
4376 + ETHPFS_pfd_m = 0x00000001,
4378 + ETHCFSA0_cfsa4_b = 0,
4379 + ETHCFSA0_cfsa4_m = 0x000000ff,
4380 + ETHCFSA0_cfsa5_b = 8,
4381 + ETHCFSA0_cfsa5_m = 0x0000ff00,
4383 + ETHCFSA1_cfsa2_b = 0,
4384 + ETHCFSA1_cfsa2_m = 0x000000ff,
4385 + ETHCFSA1_cfsa3_b = 8,
4386 + ETHCFSA1_cfsa3_m = 0x0000ff00,
4388 + ETHCFSA2_cfsa0_b = 0,
4389 + ETHCFSA2_cfsa0_m = 0x000000ff,
4390 + ETHCFSA2_cfsa1_b = 8,
4391 + ETHCFSA2_cfsa1_m = 0x0000ff00,
4394 + ETHMAC1_re_m = 0x00000001,
4395 + ETHMAC1_paf_b = 1,
4396 + ETHMAC1_paf_m = 0x00000002,
4397 + ETHMAC1_rfc_b = 2,
4398 + ETHMAC1_rfc_m = 0x00000004,
4399 + ETHMAC1_tfc_b = 3,
4400 + ETHMAC1_tfc_m = 0x00000008,
4402 + ETHMAC1_lb_m = 0x00000010,
4403 + ETHMAC1_mr_b = 31,
4404 + ETHMAC1_mr_m = 0x80000000,
4407 + ETHMAC2_fd_m = 0x00000001,
4408 + ETHMAC2_flc_b = 1,
4409 + ETHMAC2_flc_m = 0x00000002,
4410 + ETHMAC2_hfe_b = 2,
4411 + ETHMAC2_hfe_m = 0x00000004,
4413 + ETHMAC2_dc_m = 0x00000008,
4414 + ETHMAC2_cen_b = 4,
4415 + ETHMAC2_cen_m = 0x00000010,
4417 + ETHMAC2_pe_m = 0x00000020,
4418 + ETHMAC2_vpe_b = 6,
4419 + ETHMAC2_vpe_m = 0x00000040,
4420 + ETHMAC2_ape_b = 7,
4421 + ETHMAC2_ape_m = 0x00000080,
4422 + ETHMAC2_ppe_b = 8,
4423 + ETHMAC2_ppe_m = 0x00000100,
4424 + ETHMAC2_lpe_b = 9,
4425 + ETHMAC2_lpe_m = 0x00000200,
4426 + ETHMAC2_nb_b = 12,
4427 + ETHMAC2_nb_m = 0x00001000,
4428 + ETHMAC2_bp_b = 13,
4429 + ETHMAC2_bp_m = 0x00002000,
4430 + ETHMAC2_ed_b = 14,
4431 + ETHMAC2_ed_m = 0x00004000,
4433 + ETHIPGT_ipgt_b = 0,
4434 + ETHIPGT_ipgt_m = 0x0000007f,
4436 + ETHIPGR_ipgr2_b = 0,
4437 + ETHIPGR_ipgr2_m = 0x0000007f,
4438 + ETHIPGR_ipgr1_b = 8,
4439 + ETHIPGR_ipgr1_m = 0x00007f00,
4441 + ETHCLRT_maxret_b = 0,
4442 + ETHCLRT_maxret_m = 0x0000000f,
4443 + ETHCLRT_colwin_b = 8,
4444 + ETHCLRT_colwin_m = 0x00003f00,
4446 + ETHMAXF_maxf_b = 0,
4447 + ETHMAXF_maxf_m = 0x0000ffff,
4449 + ETHMTEST_tb_b = 2,
4450 + ETHMTEST_tb_m = 0x00000004,
4453 + ETHMCP_div_m = 0x000000ff,
4455 + MIIMCFG_rsv_b = 0,
4456 + MIIMCFG_rsv_m = 0x0000000c,
4459 + MIIMCMD_rd_m = 0x00000001,
4460 + MIIMCMD_scn_b = 1,
4461 + MIIMCMD_scn_m = 0x00000002,
4463 + MIIMADDR_regaddr_b = 0,
4464 + MIIMADDR_regaddr_m = 0x0000001f,
4465 + MIIMADDR_phyaddr_b = 8,
4466 + MIIMADDR_phyaddr_m = 0x00001f00,
4468 + MIIMWTD_wdata_b = 0,
4469 + MIIMWTD_wdata_m = 0x0000ffff,
4471 + MIIMRDD_rdata_b = 0,
4472 + MIIMRDD_rdata_m = 0x0000ffff,
4474 + MIIMIND_bsy_b = 0,
4475 + MIIMIND_bsy_m = 0x00000001,
4476 + MIIMIND_scn_b = 1,
4477 + MIIMIND_scn_m = 0x00000002,
4479 + MIIMIND_nv_m = 0x00000004,
4484 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
4489 + ETHRX_fd_m = 0x00000001,
4491 + ETHRX_ld_m = 0x00000002,
4493 + ETHRX_rok_m = 0x00000004,
4495 + ETHRX_fm_m = 0x00000008,
4497 + ETHRX_mp_m = 0x00000010,
4499 + ETHRX_bp_m = 0x00000020,
4501 + ETHRX_vlt_m = 0x00000040,
4503 + ETHRX_cf_m = 0x00000080,
4505 + ETHRX_ovr_m = 0x00000100,
4507 + ETHRX_crc_m = 0x00000200,
4509 + ETHRX_cv_m = 0x00000400,
4511 + ETHRX_db_m = 0x00000800,
4513 + ETHRX_le_m = 0x00001000,
4515 + ETHRX_lor_m = 0x00002000,
4517 + ETHRX_ces_m = 0x00004000,
4518 + ETHRX_length_b = 16,
4519 + ETHRX_length_m = 0xffff0000,
4522 + ETHTX_fd_m = 0x00000001,
4524 + ETHTX_ld_m = 0x00000002,
4526 + ETHTX_oen_m = 0x00000004,
4528 + ETHTX_pen_m = 0x00000008,
4530 + ETHTX_cen_m = 0x00000010,
4532 + ETHTX_hen_m = 0x00000020,
4534 + ETHTX_tok_m = 0x00000040,
4536 + ETHTX_mp_m = 0x00000080,
4538 + ETHTX_bp_m = 0x00000100,
4540 + ETHTX_und_m = 0x00000200,
4542 + ETHTX_of_m = 0x00000400,
4544 + ETHTX_ed_m = 0x00000800,
4546 + ETHTX_ec_m = 0x00001000,
4548 + ETHTX_lc_m = 0x00002000,
4550 + ETHTX_td_m = 0x00004000,
4552 + ETHTX_crc_m = 0x00008000,
4554 + ETHTX_le_m = 0x00010000,
4556 + ETHTX_cc_m = 0x001E0000,
4561 + ETH0_IPABMC_PhysicalAddress = 0x18040010,
4562 + ETH0_IPABMC_VirtualAddress = 0xb8040000,
4563 + ETH1_IPABMC_PhysicalAddress = 0x18040018,
4564 + ETH1_IPABMC_VirtualAddress = 0xb8040018,
4571 +}volatile *IPABM_ETH_t;
4572 +#endif //__IDT_RC32365_ETH_H__
4573 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
4574 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h 1970-01-01 01:00:00.000000000 +0100
4575 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h 2006-06-18 12:44:28.000000000 +0200
4577 +/**************************************************************************
4579 + * BRIEF MODULE DESCRIPTION
4580 + * RC32365/336 Ethernet status checking.
4582 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4584 + * This program is free software; you can redistribute it and/or modify it
4585 + * under the terms of the GNU General Public License as published by the
4586 + * Free Software Foundation; either version 2 of the License, or (at your
4587 + * option) any later version.
4589 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4590 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4591 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4592 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4593 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4594 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4595 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4596 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4597 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4598 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4600 + * You should have received a copy of the GNU General Public License along
4601 + * with this program; if not, write to the Free Software Foundation, Inc.,
4602 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4605 + **************************************************************************
4606 + * May 2004 P. Sadik.
4612 + **************************************************************************
4615 +#ifndef __IDT_RC32365_ETH_V_H__
4616 +#define __IDT_RC32365_ETH_V_H__
4617 +#include <asm/idt-boards/rc32300/rc32365_eth.h>
4619 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
4620 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
4621 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
4622 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
4623 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
4624 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
4625 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
4626 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
4627 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
4628 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
4629 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
4631 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
4633 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
4634 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
4635 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
4636 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
4637 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
4638 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
4639 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
4640 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
4641 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
4642 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
4643 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
4644 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
4645 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
4646 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
4648 +#endif //__IDT_RC32365_ETH_V_H__
4649 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
4650 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h 1970-01-01 01:00:00.000000000 +0100
4651 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h 2006-06-18 12:44:28.000000000 +0200
4653 +/**************************************************************************
4655 + * BRIEF MODULE DESCRIPTION
4656 + * RC32365/336 GPIO hardware abstraction.
4658 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4660 + * This program is free software; you can redistribute it and/or modify it
4661 + * under the terms of the GNU General Public License as published by the
4662 + * Free Software Foundation; either version 2 of the License, or (at your
4663 + * option) any later version.
4665 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4666 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4667 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4668 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4669 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4670 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4671 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4672 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4673 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4674 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4676 + * You should have received a copy of the GNU General Public License along
4677 + * with this program; if not, write to the Free Software Foundation, Inc.,
4678 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4681 + **************************************************************************
4682 + * May 2004 P. Sadik.
4688 + **************************************************************************
4691 +#ifndef __IDT_RC32365_GPIO_H__
4692 +#define __IDT_RC32365_GPIO_H__
4696 + GPIO0_PhysicalAddress = 0x18048000,
4697 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
4699 + GPIO0_VirtualAddress = 0xb8048000,
4700 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
4705 + u32 gpiofunc; /* GPIO Function Register
4706 + * gpiofunc[x]==0 bit = gpio
4707 + * func[x]==1 bit = altfunc
4709 + u32 gpiocfg; /* GPIO Configuration Register
4710 + * gpiocfg[x]==0 bit = input
4711 + * gpiocfg[x]==1 bit = output
4713 + u32 gpiod; /* GPIO Data Register
4714 + * gpiod[x] read/write gpio pinX status
4716 + u32 gpioilevel; /* GPIO Interrupt Status Register
4717 + * interrupt level (see gpioistat)
4719 + u32 gpioistat; /* Gpio Interrupt Status Register
4720 + * istat[x] = (gpiod[x] == level[x])
4721 + * cleared in ISR (STICKY bits)
4723 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
4724 +} volatile * GPIO_t ;
4728 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
4729 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
4730 + GPIO_input_v = 0, // gpiocfg use pin as input.
4731 + GPIO_output_v = 1, // gpiocfg use pin as output.
4733 + GPIO_pin0_m = 0x00000001,
4735 + GPIO_pin1_m = 0x00000002,
4737 + GPIO_pin2_m = 0x00000004,
4739 + GPIO_pin3_m = 0x00000008,
4741 + GPIO_pin4_m = 0x00000010,
4743 + GPIO_pin5_m = 0x00000020,
4745 + GPIO_pin6_m = 0x00000040,
4747 + GPIO_pin7_m = 0x00000080,
4749 + GPIO_pin8_m = 0x00000100,
4751 + GPIO_pin9_m = 0x00000200,
4752 + GPIO_pin10_b = 10,
4753 + GPIO_pin10_m = 0x00000400,
4754 + GPIO_pin11_b = 11,
4755 + GPIO_pin11_m = 0x00000800,
4756 + GPIO_pin12_b = 12,
4757 + GPIO_pin12_m = 0x00001000,
4758 + GPIO_pin13_b = 13,
4759 + GPIO_pin13_m = 0x00002000,
4760 + GPIO_pin14_b = 14,
4761 + GPIO_pin14_m = 0x00004000,
4762 + GPIO_pin15_b = 15,
4763 + GPIO_pin15_m = 0x00008000,
4765 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
4767 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
4768 + GPIO_u0sout_m = GPIO_pin0_m,
4769 + GPIO_u0sout_cfg_v = GPIO_output_v,
4771 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
4772 + GPIO_u0sinp_m = GPIO_pin1_m,
4773 + GPIO_u0sinp_cfg_v = GPIO_input_v,
4775 + GPIO_maddr22_b = GPIO_pin2_b, // M&P bus bit 22.
4776 + GPIO_maddr22_m = GPIO_pin2_m,
4777 + GPIO_maddr22_cfg_v = GPIO_output_v,
4779 + GPIO_maddr23_b = GPIO_pin3_b, // M&P bus bit 23.
4780 + GPIO_maddr23_m = GPIO_pin3_m,
4781 + GPIO_maddr23_cfg_v = GPIO_output_v,
4783 + GPIO_maddr24_b = GPIO_pin4_b, // M&P bus bit 24.
4784 + GPIO_maddr24_m = GPIO_pin4_m,
4785 + GPIO_maddr24_cfg_v = GPIO_output_v,
4787 + GPIO_maddr25_b = GPIO_pin5_b, // M&P bus bit 25.
4788 + GPIO_maddr25_m = GPIO_pin5_m,
4789 + GPIO_maddr25_cfg_v = GPIO_output_v,
4791 + GPIO_rngclk_b = GPIO_pin6_b, // reserved.
4792 + GPIO_rngclk_m = GPIO_pin6_m,
4793 + GPIO_rngclk_cfg_v = GPIO_input_v,
4795 + GPIO_sdckenp_b = GPIO_pin7_b, // reserved.
4796 + GPIO_sdckenp_m = GPIO_pin7_m,
4797 + GPIO_sdckenp_cfg_v = GPIO_output_v,
4799 + GPIO_cen1_b = GPIO_pin8_b, // reserved.
4800 + GPIO_cen1_m = GPIO_pin8_m,
4801 + GPIO_cen1_cfg_v = GPIO_output_v,
4803 + GPIO_cen2_b = GPIO_pin9_b, // reserved.
4804 + GPIO_cen2_m = GPIO_pin9_m,
4805 + GPIO_cen2_cfg_v = GPIO_output_v,
4807 + GPIO_regn_b = GPIO_pin10_b, // reserved.
4808 + GPIO_regn_m = GPIO_pin10_m,
4809 + GPIO_regn_cfg_v = GPIO_output_v,
4811 + GPIO_iordn_b = GPIO_pin11_b, // reserved.
4812 + GPIO_iordn_m = GPIO_pin11_m,
4813 + GPIO_iordn_cfg_v = GPIO_output_v,
4815 + GPIO_iowrn_b = GPIO_pin12_b, // reserved.
4816 + GPIO_iowrn_m = GPIO_pin12_m,
4817 + GPIO_iowrn_cfg_v = GPIO_output_v,
4819 + GPIO_pcireqn2_b = GPIO_pin13_b, // PCI messaging int.
4820 + GPIO_pcireqn2_m = GPIO_pin13_m,
4821 + GPIO_pcireqn2_cfg_v = GPIO_input_v,
4823 + GPIO_pcigntn2_b = GPIO_pin14_b, // PCI messaging int.
4824 + GPIO_pcigntn2_m = GPIO_pin14_m,
4825 + GPIO_pcigntn2_cfg_v = GPIO_output_v,
4827 + GPIO_pcimuintn_b = GPIO_pin15_b, // PCI messaging int.
4828 + GPIO_pcimuintn_m = GPIO_pin15_m,
4829 + GPIO_pcimuintn_cfg_v= GPIO_output_v,
4833 +#endif //__IDT_RC32365_GPIO_H__
4834 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
4835 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h 1970-01-01 01:00:00.000000000 +0100
4836 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h 2006-06-18 12:44:28.000000000 +0200
4838 +/**************************************************************************
4840 + * BRIEF MODULE DESCRIPTION
4841 + * Routines to set/clear/toggle GPIO on RC32365
4843 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4845 + * This program is free software; you can redistribute it and/or modify it
4846 + * under the terms of the GNU General Public License as published by the
4847 + * Free Software Foundation; either version 2 of the License, or (at your
4848 + * option) any later version.
4850 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4851 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4852 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4853 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4854 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4855 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4856 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4857 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4858 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4859 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4861 + * You should have received a copy of the GNU General Public License along
4862 + * with this program; if not, write to the Free Software Foundation, Inc.,
4863 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4866 + **************************************************************************
4867 + * May 2004 P. Sadik.
4873 + **************************************************************************
4875 +#ifndef __IDT_RC32365_GPIO_V_H__
4876 +#define __IDT_RC32365_GPIO_V_H__
4879 +#ifdef _LANGUAGE_ASSEMBLY
4880 +#define SET_GPIO(pin) \
4882 + ori t5,t5,0x8000 ; \
4887 +#define CLEAR_GPIO(pin) \
4889 + ori t5,t5,0x8000 ; \
4892 + ori t6,t6,0xFFFF; \
4893 + xori t6,t6,pin ; \
4897 +#define TOGGLE_GPIO(pin) \
4899 + ori t5,t5,0x8000 ; \
4901 + xori t4,t4,pin ; \
4904 +#else // !_LANGUAGE_ASSEMBLY
4905 +#include <asm/rc32300/types.h>
4906 +#include <asm/rc32300/rc32365_gpio.h>
4907 +#include <asm/rc32300/rc32365.h>
4909 +static inline void set_gpio(unsigned long pin)
4911 + idt_gpio->gpiod |= pin;
4914 +static inline void clear_gpio(unsigned long pin)
4916 + idt_gpio->gpiod &= ~pin;
4918 +static inline void toggle_gpio(unsigned long pin)
4920 + idt_gpio->gpiod ^= pin;
4922 +#define SET_GPIO(pin) set_gpio(pin)
4923 +#define CLEAR_GPIO(pin) clear_gpio(pin)
4924 +#define TOGGLE_GPIO(pin) toggle_gpio(pin)
4925 +#endif // _LANGUAGE_ASSEMBLY
4927 +#endif //__IDT_RC32365_GPIO_V_H__
4929 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
4930 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365.h 1970-01-01 01:00:00.000000000 +0100
4931 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365.h 2006-06-18 12:44:28.000000000 +0200
4933 +/**************************************************************************
4935 + * BRIEF MODULE DESCRIPTION
4936 + * Definitions for IDT RC32365 CPU.
4938 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4940 + * This program is free software; you can redistribute it and/or modify it
4941 + * under the terms of the GNU General Public License as published by the
4942 + * Free Software Foundation; either version 2 of the License, or (at your
4943 + * option) any later version.
4945 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4946 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4947 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4948 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4949 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4950 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4951 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4952 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4953 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4954 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4956 + * You should have received a copy of the GNU General Public License along
4957 + * with this program; if not, write to the Free Software Foundation, Inc.,
4958 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4961 + **************************************************************************
4962 + * May 2004 P. Sadik.
4968 + **************************************************************************
4971 +#ifndef __IDT_RC32365_H__
4972 +#define __IDT_RC32365_H__
4974 +extern unsigned int cedar_za;
4976 +/* Base address of internal registers */
4977 +#define RC32365_REG_BASE 0x18000000
4979 +/* System ID Registers */
4980 +#define CPU_SYSID (RC32365_REG_BASE + 0x00018)
4981 +#define CPU_DEVTYPE (RC32365_REG_BASE + 0x0001c)
4983 +/* Reset Controller */
4984 +#define RESET_CNTL (RC32365_REG_BASE + 0x08000)
4985 +#define BOOT_VECTOR (RC32365_REG_BASE + 0x08004)
4987 +/* Device Controller */
4988 +#define DEV0_BASE (RC32365_REG_BASE + 0x10000)
4989 +#define DEV0_MASK (RC32365_REG_BASE + 0x10004)
4990 +#define DEV0_CNTL (RC32365_REG_BASE + 0x10008)
4991 +#define DEV0_TIMING (RC32365_REG_BASE + 0x1000c)
4992 +#define DEV_REG_OFFSET 0x10
4994 +/* SDRAM Controller */
4995 +#define SDRAM0_BASE (RC32365_REG_BASE + 0x18000)
4996 +#define SDRAM0_MASK (RC32365_REG_BASE + 0x18004)
4997 +#define SDRAM1_BASE (RC32365_REG_BASE + 0x18008)
4998 +#define SDRAM1_MASK (RC32365_REG_BASE + 0x1800c)
4999 +#define SDRAM_CNTL (RC32365_REG_BASE + 0x18010)
5001 +/* Counters/Timers */
5002 +#define TIMER0_COUNT (RC32365_REG_BASE + 0x20000)
5003 +#define TIMER0_COMPARE (RC32365_REG_BASE + 0x20004)
5004 +#define TIMER0_CNTL (RC32365_REG_BASE + 0x20008)
5005 +#define TIMER0_SELECT (RC32365_REG_BASE + 0x2000c)
5006 +#define TIMER_REG_OFFSET 0x10
5008 +/* System Integrity */
5010 +/* Interrupt Controller */
5011 +#define IC_GROUP0_PEND (RC32365_REG_BASE + 0x30000)
5012 +#define IC_GROUP0_TEST (RC32365_REG_BASE + 0x30004)
5013 +#define IC_GROUP0_MASK (RC32365_REG_BASE + 0x30008)
5014 +#define IC_GROUP_OFFSET 0x0c
5016 +#define NUM_INTR_GROUPS 5
5018 + * The IRQ mapping is as follows:
5021 + * --- -------------------
5022 + * 0 SW0 (IP0) SW0 intr
5023 + * 1 SW1 (IP1) SW1 intr
5024 + * - Int0 (IP2) mapped to GROUP0_IRQ_BASE
5025 + * - Int1 (IP3) mapped to GROUP1_IRQ_BASE
5026 + * - Int2 (IP4) mapped to GROUP2_IRQ_BASE
5027 + * - Int3 (IP5) mapped to GROUP3_IRQ_BASE
5028 + * - Int4 (IP6) mapped to GROUP4_IRQ_BASE
5029 + * 7 Int5 (IP7) CP0 Timer
5031 + * IRQ's 8 and up are all mapped to Int0-4 (IP2-IP6), which
5032 + * internally on the RC32365 is routed to the Expansion
5033 + * Interrupt Controller.
5035 +#define MIPS_CPU_TIMER_IRQ 7
5037 +#define GROUP0_IRQ_BASE 8 // Counter/Timers, UCW
5038 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) // DMA
5039 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) // RNG, SEC
5040 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) // Eth, PCI, UARTs
5041 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32) // GPIO
5043 +#define RC32365_NR_IRQS (GROUP4_IRQ_BASE + 32)
5045 +/* DMA - see rc32365_dma.h for full list of registers */
5047 +#define RC32365_DMA_BASE (RC32365_REG_BASE + 0x38000)
5048 +#define DMA_CHAN_OFFSET 0x14
5050 +/* GPIO Controller */
5051 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
5055 +#define RC32300_UART0_BASE (RC32365_REG_BASE + 0x50003)
5057 +#define RC32300_UART0_BASE (RC32365_REG_BASE + 0x50000)
5059 +#define RC32300_UART0_IRQ (GROUP3_IRQ_BASE + 0)
5061 +/* Ethernet - see rc32365_eth.h for full list of registers */
5063 +#define RC32365_ETH_BASE (RC32365_REG_BASE + 0x58000)
5065 +#define IDT_CLOCK_MULT 2
5067 +/* FLASH (device 1) */
5068 +#define FLASH_BASE 0x08000000
5069 +#define FLASH_SIZE 0x00800000
5071 +/* LCD 4-digit display (device 2) */
5072 +#define LCD_DIGIT0 0x0C000003
5073 +#define LCD_DIGIT1 0x0C000002
5074 +#define LCD_DIGIT2 0x0C000001
5075 +#define LCD_DIGIT3 0x0C000000
5077 +/* RTC (DS1553) (device 2) */
5078 +#define RTC_BASE 0x0c800000
5080 +#define NVRAM_BASE RTC_BASE
5081 +#define NVRAM_ENVSIZE_OFF 4
5082 +#define NVRAM_ENVSTART_OFF 32
5084 +/* Interrupts routed on 79EB365 board */
5085 +#define RC32365_PCI_INTA_IRQ (GROUP4_IRQ_BASE + 8)
5086 +#define RC32365_PCI_INTB_IRQ (GROUP4_IRQ_BASE + 9)
5087 +#define RC32365_PCI_INTC_IRQ (GROUP4_IRQ_BASE + 10)
5088 +#define RC32365_PCI_INTD_IRQ (GROUP4_IRQ_BASE + 11)
5090 +#define RAM_SIZE (32 * 1024 * 1024)
5092 +#endif //__IDT_RC32365_H__
5093 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
5094 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_pci.h 1970-01-01 01:00:00.000000000 +0100
5095 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_pci.h 2006-06-18 12:44:28.000000000 +0200
5097 +/**************************************************************************
5099 + * BRIEF MODULE DESCRIPTION
5100 + * Datatype declaration for IDT 79EB365/336 PCI
5102 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5104 + * This program is free software; you can redistribute it and/or modify it
5105 + * under the terms of the GNU General Public License as published by the
5106 + * Free Software Foundation; either version 2 of the License, or (at your
5107 + * option) any later version.
5109 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5110 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5111 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5112 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5113 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5114 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5115 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5116 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5117 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5118 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5120 + * You should have received a copy of the GNU General Public License along
5121 + * with this program; if not, write to the Free Software Foundation, Inc.,
5122 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5125 + **************************************************************************
5126 + * May 2004 P. Sadik.
5132 + **************************************************************************
5135 +#ifndef __IDT_RC32365_PCI_H__
5136 +#define __IDT_RC32365_PCI_H__
5140 + PCI0_PhysicalAddress = 0x18068000,
5141 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
5143 + PCI0_VirtualAddress = 0xb8068000,
5144 + PCI_VirtualAddress = PCI0_VirtualAddress,
5149 + PCI_LbaCount = 4, // Local base addresses.
5154 + u32 a ; // Address.
5155 + u32 c ; // Control.
5156 + u32 m ; // mapping.
5166 + PCI_Map_s pcilba [PCI_LbaCount] ;
5174 +} volatile *PCI_t ;
5176 +// PCI messaging unit.
5183 + u32 pciim [PCIM_Count] ;
5184 + u32 pciom [PCIM_Count] ;
5191 +} volatile *PCIM_t ;
5193 +/*******************************************************************************
5195 + * PCI Control Register
5197 + ******************************************************************************/
5201 + PCIC_en_m = 0x00000001,
5203 + PCIC_tnr_m = 0x00000002,
5205 + PCIC_sce_m = 0x00000004,
5207 + PCIC_ien_m = 0x00000008,
5209 + PCIC_aaa_m = 0x00000010,
5211 + PCIC_eap_m = 0x00000020,
5213 + PCIC_pcim_m = 0x000001c0,
5214 + PCIC_pcim_disabled_v = 0,
5215 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
5216 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
5217 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
5218 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
5219 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
5220 + PCIC_pcim_reserved6_v = 6,
5221 + PCIC_pcim_reserved7_v = 7,
5223 + PCIC_igm_m = 0x00000200,
5226 +/*******************************************************************************
5228 + * PCI Status Register
5230 + ******************************************************************************/
5233 + PCIS_eed_m = 0x00000001,
5235 + PCIS_wr_m = 0x00000002,
5237 + PCIS_nmi_m = 0x00000004,
5239 + PCIS_ii_m = 0x00000008,
5241 + PCIS_cwe_m = 0x00000010,
5243 + PCIS_cre_m = 0x00000020,
5245 + PCIS_mdpe_m = 0x00000040,
5247 + PCIS_sta_m = 0x00000080,
5249 + PCIS_rta_m = 0x00000100,
5251 + PCIS_rma_m = 0x00000200,
5253 + PCIS_sse_m = 0x00000400,
5255 + PCIS_ose_m = 0x00000800,
5257 + PCIS_pe_m = 0x00001000,
5259 + PCIS_tae_m = 0x00002000,
5261 + PCIS_rle_m = 0x00004000,
5263 + PCIS_bme_m = 0x00008000,
5265 + PCIS_prd_m = 0x00010000,
5267 + PCIS_rip_m = 0x00020000,
5270 +/*******************************************************************************
5272 + * PCI Status Mask Register
5274 + ******************************************************************************/
5277 + PCISM_eed_m = 0x00000001,
5279 + PCISM_wr_m = 0x00000002,
5281 + PCISM_nmi_m = 0x00000004,
5283 + PCISM_ii_m = 0x00000008,
5285 + PCISM_cwe_m = 0x00000010,
5287 + PCISM_cre_m = 0x00000020,
5289 + PCISM_mdpe_m = 0x00000040,
5291 + PCISM_sta_m = 0x00000080,
5293 + PCISM_rta_m = 0x00000100,
5295 + PCISM_rma_m = 0x00000200,
5297 + PCISM_sse_m = 0x00000400,
5299 + PCISM_ose_m = 0x00000800,
5301 + PCISM_pe_m = 0x00001000,
5303 + PCISM_tae_m = 0x00002000,
5305 + PCISM_rle_m = 0x00004000,
5307 + PCISM_bme_m = 0x00008000,
5309 + PCISM_prd_m = 0x00010000,
5311 + PCISM_rip_m = 0x00020000,
5314 +/*******************************************************************************
5316 + * PCI Configuration Address Register
5318 + ******************************************************************************/
5320 + PCICFGA_reg_b = 2,
5321 + PCICFGA_reg_m = 0x000000fc,
5322 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
5323 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
5324 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
5325 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
5326 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
5327 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
5328 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
5329 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
5330 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
5331 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
5332 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
5333 + PCICFGA_reg_pba0m_v = 0x48>>2,
5334 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
5335 + PCICFGA_reg_pba1m_v = 0x50>>2,
5336 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
5337 + PCICFGA_reg_pba2m_v = 0x58>>2,
5338 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
5339 + PCICFGA_reg_pba3m_v = 0x60>>2,
5340 + PCICFGA_reg_pmgt_v = 0x64>>2,
5341 + PCICFGA_func_b = 8,
5342 + PCICFGA_func_m = 0x00000700,
5343 + PCICFGA_dev_b = 11,
5344 + PCICFGA_dev_m = 0x0000f800,
5345 + PCICFGA_dev_internal_v = 0,
5346 + PCICFGA_bus_b = 16,
5347 + PCICFGA_bus_m = 0x00ff0000,
5348 + PCICFGA_bus_type0_v = 0, //local bus
5349 + PCICFGA_en_b = 31, // read only
5350 + PCICFGA_en_m = 0x80000000,
5354 + PCFGID_vendor_b = 0,
5355 + PCFGID_vendor_m = 0x0000ffff,
5356 + PCFGID_vendor_IDT_v = 0x111d,
5357 + PCFGID_device_b = 16,
5358 + PCFGID_device_m = 0xffff0000,
5359 + PCFGID_device_Acaciade_v = 0x0207,
5361 + PCFG04_command_ioena_b = 1,
5362 + PCFG04_command_ioena_m = 0x00000001,
5363 + PCFG04_command_memena_b = 2,
5364 + PCFG04_command_memena_m = 0x00000002,
5365 + PCFG04_command_bmena_b = 3,
5366 + PCFG04_command_bmena_m = 0x00000004,
5367 + PCFG04_command_mwinv_b = 5,
5368 + PCFG04_command_mwinv_m = 0x00000010,
5369 + PCFG04_command_parena_b = 7,
5370 + PCFG04_command_parena_m = 0x00000040,
5371 + PCFG04_command_serrena_b = 9,
5372 + PCFG04_command_serrena_m = 0x00000100,
5373 + PCFG04_command_fastbbena_b = 10,
5374 + PCFG04_command_fastbbena_m = 0x00000200,
5375 + PCFG04_status_b = 16,
5376 + PCFG04_status_m = 0xffff0000,
5377 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
5378 + PCFG04_status_66MHz_m = 0x00200000,
5379 + PCFG04_status_fbb_b = 23,
5380 + PCFG04_status_fbb_m = 0x00800000,
5381 + PCFG04_status_mdpe_b = 24,
5382 + PCFG04_status_mdpe_m = 0x01000000,
5383 + PCFG04_status_dst_b = 25,
5384 + PCFG04_status_dst_m = 0x06000000,
5385 + PCFG04_status_sta_b = 27,
5386 + PCFG04_status_sta_m = 0x08000000,
5387 + PCFG04_status_rta_b = 28,
5388 + PCFG04_status_rta_m = 0x10000000,
5389 + PCFG04_status_rma_b = 29,
5390 + PCFG04_status_rma_m = 0x20000000,
5391 + PCFG04_status_sse_b = 30,
5392 + PCFG04_status_sse_m = 0x40000000,
5393 + PCFG04_status_pe_b = 31,
5394 + PCFG04_status_pe_m = 0x40000000,
5396 + PCFG08_revId_b = 0,
5397 + PCFG08_revId_m = 0x000000ff,
5398 + PCFG08_classCode_b = 0,
5399 + PCFG08_classCode_m = 0xffffff00,
5400 + PCFG08_classCode_bridge_v = 06,
5401 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
5402 + PCFG0C_cacheline_b = 0,
5403 + PCFG0C_cacheline_m = 0x000000ff,
5404 + PCFG0C_masterLatency_b = 8,
5405 + PCFG0C_masterLatency_m = 0x0000ff00,
5406 + PCFG0C_headerType_b = 16,
5407 + PCFG0C_headerType_m = 0x00ff0000,
5408 + PCFG0C_bist_b = 24,
5409 + PCFG0C_bist_m = 0xff000000,
5412 + PCIPBA_msi_m = 0x00000001,
5414 + PCIPBA_p_m = 0x00000004,
5415 + PCIPBA_baddr_b = 8,
5416 + PCIPBA_baddr_m = 0xffffff00,
5418 + PCFGSS_vendorId_b = 0,
5419 + PCFGSS_vendorId_m = 0x0000ffff,
5421 + PCFGSS_id_m = 0xffff0000,
5423 + PCFG3C_interruptLine_b = 0,
5424 + PCFG3C_interruptLine_m = 0x000000ff,
5425 + PCFG3C_interruptPin_b = 8,
5426 + PCFG3C_interruptPin_m = 0x0000ff00,
5427 + PCFG3C_minGrant_b = 16,
5428 + PCFG3C_minGrant_m = 0x00ff0000,
5429 + PCFG3C_maxLat_b = 24,
5430 + PCFG3C_maxLat_m = 0xff000000,
5432 + PCIPBAC_msi_b = 0,
5433 + PCIPBAC_msi_m = 0x00000001,
5435 + PCIPBAC_p_m = 0x00000002,
5436 + PCIPBAC_size_b = 2,
5437 + PCIPBAC_size_m = 0x0000007c,
5439 + PCIPBAC_sb_m = 0x00000080,
5441 + PCIPBAC_pp_m = 0x00000100,
5443 + PCIPBAC_mr_m = 0x00000600,
5444 + PCIPBAC_mr_read_v =0, //no prefetching
5445 + PCIPBAC_mr_readLine_v =1,
5446 + PCIPBAC_mr_readMult_v =2,
5447 + PCIPBAC_mrl_b = 11,
5448 + PCIPBAC_mrl_m = 0x00000800,
5449 + PCIPBAC_mrm_b = 12,
5450 + PCIPBAC_mrm_m = 0x00001000,
5451 + PCIPBAC_trp_b = 13,
5452 + PCIPBAC_trp_m = 0x00002000,
5454 + PCFG40_trdyTimeout_b = 0,
5455 + PCFG40_trdyTimeout_m = 0x000000ff,
5456 + PCFG40_retryLim_b = 8,
5457 + PCFG40_retryLim_m = 0x0000ff00,
5460 +/*******************************************************************************
5462 + * PCI Local Base Address [0|1|2|3] Register
5464 + ******************************************************************************/
5466 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
5467 + PCILBA_baddr_m = 0xffffff00,
5469 +/*******************************************************************************
5471 + * PCI Local Base Address Control Register
5473 + ******************************************************************************/
5475 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
5476 + PCILBAC_msi_m = 0x00000001,
5477 + PCILBAC_msi_mem_v = 0,
5478 + PCILBAC_msi_io_v = 1,
5479 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
5480 + PCILBAC_size_m = 0x0000007c,
5481 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
5482 + PCILBAC_sb_m = 0x00000080,
5483 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
5484 + PCILBAC_rt_m = 0x00000100,
5485 + PCILBAC_rt_noprefetch_v = 0, // mem read
5486 + PCILBAC_rt_prefetch_v = 1, // mem readline
5489 +/*******************************************************************************
5491 + * PCI Local Base Address [0|1|2|3] Mapping Register
5493 + ******************************************************************************/
5495 + PCILBAM_maddr_b = 8,
5496 + PCILBAM_maddr_m = 0xffffff00,
5499 +/*******************************************************************************
5501 + * PCI Decoupled Access Control Register
5503 + ******************************************************************************/
5506 + PCIDAC_den_m = 0x00000001,
5509 +/*******************************************************************************
5511 + * PCI Decoupled Access Status Register
5513 + ******************************************************************************/
5516 + PCIDAS_d_m = 0x00000001,
5518 + PCIDAS_b_m = 0x00000002,
5520 + PCIDAS_e_m = 0x00000004,
5522 + PCIDAS_ofe_m = 0x00000008,
5524 + PCIDAS_off_m = 0x00000010,
5526 + PCIDAS_ife_m = 0x00000020,
5528 + PCIDAS_iff_m = 0x00000040,
5531 +/*******************************************************************************
5533 + * PCI DMA Channel 8 Configuration Register
5535 + ******************************************************************************/
5538 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
5539 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
5540 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
5541 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
5544 +/*******************************************************************************
5546 + * PCI DMA Channel 9 Configuration Register
5548 + ******************************************************************************/
5551 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
5552 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
5555 +/*******************************************************************************
5557 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
5559 + ******************************************************************************/
5561 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
5562 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
5563 + // These are for reads (DMA channel 8)
5564 + PCIDMAD_devcmd_mr_v = 0, //memory read
5565 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
5566 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
5567 + PCIDMAD_devcmd_ior_v = 3, //I/O read
5568 + // These are for writes (DMA channel 9)
5569 + PCIDMAD_devcmd_mw_v = 0, //memory write
5570 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
5571 + PCIDMAD_devcmd_iow_v = 3, //I/O write
5573 + // Swap byte field applies to both DMA channel 8 and 9
5574 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
5575 + PCIDMAD_sb_m = 0x01000000, // swap byte field
5579 +/*******************************************************************************
5581 + * PCI Target Control Register
5583 + ******************************************************************************/
5586 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
5587 + PCITC_rtimer_m = 0x000000ff,
5588 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
5589 + PCITC_dtimer_m = 0x0000ff00,
5590 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
5591 + PCITC_rdr_m = 0x00040000,
5592 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
5593 + PCITC_ddt_m = 0x00080000,
5595 +/*******************************************************************************
5597 + * PCI messaging unit [applies to both inbound and outbound registers ]
5599 + ******************************************************************************/
5602 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5603 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
5604 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5605 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
5606 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5607 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
5611 +#endif // __IDT_RC32365_PCI_H__
5612 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
5613 --- linux-2.6.17/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h 1970-01-01 01:00:00.000000000 +0100
5614 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h 2006-06-18 12:44:28.000000000 +0200
5616 +/**************************************************************************
5618 + * BRIEF MODULE DESCRIPTION
5619 + * PCI header values for IDT 79EB365/336
5621 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5623 + * This program is free software; you can redistribute it and/or modify it
5624 + * under the terms of the GNU General Public License as published by the
5625 + * Free Software Foundation; either version 2 of the License, or (at your
5626 + * option) any later version.
5628 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5629 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5630 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5631 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5632 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5633 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5634 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5635 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5636 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5637 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5639 + * You should have received a copy of the GNU General Public License along
5640 + * with this program; if not, write to the Free Software Foundation, Inc.,
5641 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5644 + **************************************************************************
5645 + * May 2004 P. Sadik.
5651 + **************************************************************************
5654 +#ifndef __IDT_RC32365_PCI_V_H__
5655 +#define __IDT_RC32365_PCI_V_H__
5658 +#define PCI_MSG_VirtualAddress 0xB806C010
5659 +#define rc32365_pci ((volatile PCI_t) PCI0_VirtualAddress)
5660 +#define rc32365_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
5662 +#define PCIM_SHFT 0x6
5663 +#define PCIM_BIT_LEN 0x7
5664 +#define PCIM_H_EA 0x3
5665 +#define PCIM_H_IA_FIX 0x4
5666 +#define PCIM_H_IA_RR 0x5
5668 +#define PCI_ADDR_START 0x50000000
5670 +#define CPUTOPCI_MEM_WIN 0x02000000
5671 +#define CPUTOPCI_IO_WIN 0x00100000
5672 +#define PCILBA_SIZE_SHFT 2
5673 +#define PCILBA_SIZE_MASK 0x1F
5674 +#define SIZE_256MB 0x1C
5675 +#define SIZE_128MB 0x1B
5676 +#define SIZE_64MB 0x1A
5677 +#define SIZE_32MB 0x19
5678 +#define SIZE_16MB 0x18
5679 +#define SIZE_4MB 0x16
5680 +#define SIZE_2MB 0x15
5681 +#define SIZE_1MB 0x14
5682 +#define CEDAR_CONFIG0_ADDR 0x80000000
5683 +#define CEDAR_CONFIG1_ADDR 0x80000004
5684 +#define CEDAR_CONFIG2_ADDR 0x80000008
5685 +#define CEDAR_CONFIG3_ADDR 0x8000000C
5686 +#define CEDAR_CONFIG4_ADDR 0x80000010
5687 +#define CEDAR_CONFIG5_ADDR 0x80000014
5688 +#define CEDAR_CONFIG6_ADDR 0x80000018
5689 +#define CEDAR_CONFIG7_ADDR 0x8000001C
5690 +#define CEDAR_CONFIG8_ADDR 0x80000020
5691 +#define CEDAR_CONFIG9_ADDR 0x80000024
5692 +#define CEDAR_CONFIG10_ADDR 0x80000028
5693 +#define CEDAR_CONFIG11_ADDR 0x8000002C
5694 +#define CEDAR_CONFIG12_ADDR 0x80000030
5695 +#define CEDAR_CONFIG13_ADDR 0x80000034
5696 +#define CEDAR_CONFIG14_ADDR 0x80000038
5697 +#define CEDAR_CONFIG15_ADDR 0x8000003C
5698 +#define CEDAR_CONFIG16_ADDR 0x80000040
5699 +#define CEDAR_CONFIG17_ADDR 0x80000044
5700 +#define CEDAR_CONFIG18_ADDR 0x80000048
5701 +#define CEDAR_CONFIG19_ADDR 0x8000004C
5702 +#define CEDAR_CONFIG20_ADDR 0x80000050
5703 +#define CEDAR_CONFIG21_ADDR 0x80000054
5704 +#define CEDAR_CONFIG22_ADDR 0x80000058
5705 +#define CEDAR_CONFIG23_ADDR 0x8000005C
5706 +#define CEDAR_CONFIG24_ADDR 0x80000060
5707 +#define CEDAR_CONFIG25_ADDR 0x80000064
5708 +#define CEDAR_CMD (PCFG04_command_ioena_m | \
5709 + PCFG04_command_memena_m | \
5710 + PCFG04_command_bmena_m | \
5711 + PCFG04_command_mwinv_m | \
5712 + PCFG04_command_parena_m | \
5713 + PCFG04_command_serrena_m )
5715 +#define CEDAR_STAT (PCFG04_status_mdpe_m | \
5716 + PCFG04_status_sta_m | \
5717 + PCFG04_status_rta_m | \
5718 + PCFG04_status_rma_m | \
5719 + PCFG04_status_sse_m | \
5720 + PCFG04_status_pe_m)
5722 +#define CEDAR_CNFG1 ((CEDAR_STAT << 16) | \
5725 +#define CEDAR_REVID 0
5726 +#define CEDAR_CLASS_CODE 0
5727 +#define CEDAR_CNFG2 ((CEDAR_CLASS_CODE << 8) | \
5730 +#define CEDAR_CACHE_LINE_SIZE 4
5731 +#define CEDAR_MASTER_LAT 0x3c
5732 +#define CEDAR_HEADER_TYPE 0
5733 +#define CEDAR_BIST 0
5735 +#define CEDAR_CNFG3 ((CEDAR_BIST << 24) | \
5736 + (CEDAR_HEADER_TYPE << 16) | \
5737 + (CEDAR_MASTER_LAT << 8) | \
5738 + CEDAR_CACHE_LINE_SIZE)
5740 +#define CEDAR_BAR0 0x00000008 /* 128 MB Memory */
5741 +#define CEDAR_BAR1 0x18800001 /* 1 MB IO */
5742 +#define CEDAR_BAR2 0x18000001 /* 2 MB IO window for Cedar
5743 + internal Registers */
5744 +#define CEDAR_BAR3 0x48000008 /* Spare 128 MB Memory */
5746 +#define CEDAR_CNFG4 CEDAR_BAR0
5747 +#define CEDAR_CNFG5 CEDAR_BAR1
5748 +#define CEDAR_CNFG6 CEDAR_BAR2
5749 +#define CEDAR_CNFG7 CEDAR_BAR3
5751 +#define CEDAR_SUBSYS_VENDOR_ID 0
5752 +#define CEDAR_SUBSYSTEM_ID 0
5753 +#define CEDAR_CNFG8 0
5754 +#define CEDAR_CNFG9 0
5755 +#define CEDAR_CNFG10 0
5756 +#define CEDAR_CNFG11 ((CEDAR_SUBSYS_VENDOR_ID << 16) | \
5757 + CEDAR_SUBSYSTEM_ID)
5758 +#define CEDAR_INT_LINE 1
5759 +#define CEDAR_INT_PIN 1
5760 +#define CEDAR_MIN_GNT 8
5761 +#define CEDAR_MAX_LAT 0x38
5762 +#define CEDAR_CNFG12 0
5763 +#define CEDAR_CNFG13 0
5764 +#define CEDAR_CNFG14 0
5765 +#define CEDAR_CNFG15 ((CEDAR_MAX_LAT << 24) | \
5766 + (CEDAR_MIN_GNT << 16) | \
5767 + (CEDAR_INT_PIN << 8) | \
5769 +#define CEDAR_RETRY_LIMIT 0x80
5770 +#define CEDAR_TRDY_LIMIT 0x80
5771 +#define CEDAR_CNFG16 ((CEDAR_RETRY_LIMIT << 8) | \
5773 +#define PCI_PBAxC_R 0x0
5774 +#define PCI_PBAxC_RL 0x1
5775 +#define PCI_PBAxC_RM 0x2
5776 +#define SIZE_SHFT 2
5778 +#define CEDAR_PBA0C (((1 & 0x3) << PCIPBAC_mr_b) | \
5781 + (SIZE_128MB << SIZE_SHFT) | \
5785 +#define CEDAR_PBA0C (((1 & 0x3) << PCIPBAC_mr_b) | \
5787 + (SIZE_128MB << SIZE_SHFT) | \
5790 +#define CEDAR_CNFG17 CEDAR_PBA0C
5791 +#define CEDAR_PBA0M 0x0
5792 +#define CEDAR_CNFG18 CEDAR_PBA0M
5795 +#define CEDAR_PBA1C ((SIZE_1MB << SIZE_SHFT) | \
5799 +#define CEDAR_PBA1C ((SIZE_1MB << SIZE_SHFT) | \
5802 +#define CEDAR_CNFG19 CEDAR_PBA1C
5803 +#define CEDAR_PBA1M 0x0
5804 +#define CEDAR_CNFG20 CEDAR_PBA1M
5807 +#define CEDAR_PBA2C ((SIZE_2MB << SIZE_SHFT) | \
5811 +#define CEDAR_PBA2C ((SIZE_2MB << SIZE_SHFT) | \
5815 +#define CEDAR_CNFG21 CEDAR_PBA2C
5816 +#define CEDAR_PBA2M 0x18000000
5817 +#define CEDAR_CNFG22 CEDAR_PBA2M
5820 +#define CEDAR_PBA3C PCIPBAC_sb_m
5822 +#define CEDAR_PBA3C 0
5825 +#define CEDAR_CNFG23 CEDAR_PBA3C
5826 +#define CEDAR_PBA3M 0
5827 +#define CEDAR_CNFG24 CEDAR_PBA3M
5829 +#define PCITC_DTIMER_VAL 8
5830 +#define PCITC_RTIMER_VAL 0x10
5832 +#endif //__IDT_RC32365_PCI_V_H__
5833 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
5834 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_dma.h 1970-01-01 01:00:00.000000000 +0100
5835 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_dma.h 2006-06-18 12:44:28.000000000 +0200
5837 +/**************************************************************************
5839 + * BRIEF MODULE DESCRIPTION
5840 + * DMA register definition
5842 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5844 + * This program is free software; you can redistribute it and/or modify it
5845 + * under the terms of the GNU General Public License as published by the
5846 + * Free Software Foundation; either version 2 of the License, or (at your
5847 + * option) any later version.
5849 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5850 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5851 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5852 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5853 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5854 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5855 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5856 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5857 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5858 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5860 + * You should have received a copy of the GNU General Public License along
5861 + * with this program; if not, write to the Free Software Foundation, Inc.,
5862 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5865 + **************************************************************************
5866 + * May 2004 rkt, neb
5872 + **************************************************************************
5875 +#ifndef __IDT_DMA_H__
5876 +#define __IDT_DMA_H__
5880 + DMA0_PhysicalAddress = 0x18040000,
5881 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
5883 + DMA0_VirtualAddress = 0xb8040000,
5884 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
5888 + * DMA descriptor (in physical memory).
5891 +typedef struct DMAD_s
5893 + u32 control ; // Control. use DMAD_*
5894 + u32 ca ; // Current Address.
5895 + u32 devcs ; // Device control and status.
5896 + u32 link ; // Next descriptor in chain.
5897 +} volatile *DMAD_t ;
5901 + DMAD_size = sizeof (struct DMAD_s),
5902 + DMAD_count_b = 0, // in DMAD_t -> control
5903 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
5904 + DMAD_ds_b = 20, // in DMAD_t -> control
5905 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
5906 + DMAD_ds_ethRcv0_v = 0,
5907 + DMAD_ds_ethXmt0_v = 0,
5908 + DMAD_ds_memToFifo_v = 0,
5909 + DMAD_ds_fifoToMem_v = 0,
5910 + DMAD_ds_pciToMem_v = 0,
5911 + DMAD_ds_memToPci_v = 0,
5913 + DMAD_devcmd_b = 22, // in DMAD_t -> control
5914 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
5915 + DMAD_devcmd_byte_v = 0, //memory-to-memory
5916 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
5917 + DMAD_devcmd_word_v = 2, //memory-to-memory
5918 + DMAD_devcmd_2words_v = 3, //memory-to-memory
5919 + DMAD_devcmd_4words_v = 4, //memory-to-memory
5920 + DMAD_devcmd_6words_v = 5, //memory-to-memory
5921 + DMAD_devcmd_8words_v = 6, //memory-to-memory
5922 + DMAD_devcmd_16words_v = 7, //memory-to-memory
5923 + DMAD_cof_b = 25, // chain on finished
5924 + DMAD_cof_m = 0x02000000, //
5925 + DMAD_cod_b = 26, // chain on done
5926 + DMAD_cod_m = 0x04000000, //
5927 + DMAD_iof_b = 27, // interrupt on finished
5928 + DMAD_iof_m = 0x08000000, //
5929 + DMAD_iod_b = 28, // interrupt on done
5930 + DMAD_iod_m = 0x10000000, //
5931 + DMAD_t_b = 29, // terminated
5932 + DMAD_t_m = 0x20000000, //
5933 + DMAD_d_b = 30, // done
5934 + DMAD_d_m = 0x40000000, //
5935 + DMAD_f_b = 31, // finished
5936 + DMAD_f_m = 0x80000000, //
5940 + * DMA register (within Internal Register Map).
5945 + u32 dmac ; // Control.
5946 + u32 dmas ; // Status.
5947 + u32 dmasm ; // Mask.
5948 + u32 dmadptr ; // Descriptor pointer.
5949 + u32 dmandptr ; // Next descriptor pointer.
5952 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
5954 +//DMA_Channels use DMACH_count instead
5958 + DMAC_run_b = 0, //
5959 + DMAC_run_m = 0x00000001, //
5960 + DMAC_dm_b = 1, // done mask
5961 + DMAC_dm_m = 0x00000002, //
5962 + DMAC_mode_b = 2, //
5963 + DMAC_mode_m = 0x0000000c, //
5964 + DMAC_mode_auto_v = 0,
5965 + DMAC_mode_burst_v = 1,
5966 + DMAC_mode_transfer_v = 2, //usually used
5967 + DMAC_mode_reserved_v = 3,
5969 + DMAC_a_m = 0x00000010, //
5971 + DMAS_f_b = 0, // finished (sticky)
5972 + DMAS_f_m = 0x00000001, //
5973 + DMAS_d_b = 1, // done (sticky)
5974 + DMAS_d_m = 0x00000002, //
5975 + DMAS_c_b = 2, // chain (sticky)
5976 + DMAS_c_m = 0x00000004, //
5977 + DMAS_e_b = 3, // error (sticky)
5978 + DMAS_e_m = 0x00000008, //
5979 + DMAS_h_b = 4, // halt (sticky)
5980 + DMAS_h_m = 0x00000010, //
5982 + DMASM_f_b = 0, // finished (1=mask)
5983 + DMASM_f_m = 0x00000001, //
5984 + DMASM_d_b = 1, // done (1=mask)
5985 + DMASM_d_m = 0x00000002, //
5986 + DMASM_c_b = 2, // chain (1=mask)
5987 + DMASM_c_m = 0x00000004, //
5988 + DMASM_e_b = 3, // error (1=mask)
5989 + DMASM_e_m = 0x00000008, //
5990 + DMASM_h_b = 4, // halt (1=mask)
5991 + DMASM_h_m = 0x00000010, //
5995 + * DMA channel definitions
6000 + DMACH_ethRcv0 = 0,
6001 + DMACH_ethXmt0 = 1,
6002 + DMACH_memToFifo = 2,
6003 + DMACH_fifoToMem = 3,
6004 + DMACH_pciToMem = 4,
6005 + DMACH_memToPci = 5,
6007 + DMACH_count //must be last
6011 +typedef struct DMAC_s
6013 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
6014 +} volatile *DMA_t ;
6018 + * External DMA parameters
6023 + DMADEVCMD_ts_b = 0, // ts field in devcmd
6024 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
6025 + DMADEVCMD_ts_byte_v = 0,
6026 + DMADEVCMD_ts_halfword_v = 1,
6027 + DMADEVCMD_ts_word_v = 2,
6028 + DMADEVCMD_ts_2word_v = 3,
6029 + DMADEVCMD_ts_4word_v = 4,
6030 + DMADEVCMD_ts_6word_v = 5,
6031 + DMADEVCMD_ts_8word_v = 6,
6032 + DMADEVCMD_ts_16word_v = 7
6036 +#endif // __IDT_DMA_H__
6042 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
6043 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h 1970-01-01 01:00:00.000000000 +0100
6044 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h 2006-06-18 12:44:28.000000000 +0200
6046 +/**************************************************************************
6048 + * BRIEF MODULE DESCRIPTION
6049 + * Definitions for DMA controller.
6051 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6053 + * This program is free software; you can redistribute it and/or modify it
6054 + * under the terms of the GNU General Public License as published by the
6055 + * Free Software Foundation; either version 2 of the License, or (at your
6056 + * option) any later version.
6058 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6059 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6060 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6061 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6062 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6063 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6064 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6065 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6066 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6067 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6069 + * You should have received a copy of the GNU General Public License along
6070 + * with this program; if not, write to the Free Software Foundation, Inc.,
6071 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6074 + **************************************************************************
6075 + * May 2004 rkt, neb.
6081 + **************************************************************************
6084 +#ifndef __IDT_DMA_V_H__
6085 +#define __IDT_DMA_V_H__
6087 +#include <asm/idt-boards/rc32434/rc32434_dma.h>
6088 +#include <asm/idt-boards/rc32434/rc32434.h>
6090 +#define DMA_CHAN_OFFSET 0x14
6091 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
6092 +#define DMA_COUNT(count) \
6093 + ((count) & DMAD_count_m)
6095 +#define DMA_HALT_TIMEOUT 500
6098 +static inline int rc32434_halt_dma(DMA_Chan_t ch)
6101 + if (rc32434_readl(&ch->dmac) & DMAC_run_m) {
6102 + rc32434_writel(0, &ch->dmac);
6104 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
6105 + if (rc32434_readl(&ch->dmas) & DMAS_h_m) {
6106 + rc32434_writel(0, &ch->dmas);
6113 + return timeout ? 0 : 1;
6116 +static inline void rc32434_start_dma(DMA_Chan_t ch, u32 dma_addr)
6118 + rc32434_writel(0, &ch->dmandptr);
6119 + rc32434_writel(dma_addr, &ch->dmadptr);
6122 +static inline void rc32434_chain_dma(DMA_Chan_t ch, u32 dma_addr)
6124 + rc32434_writel(dma_addr, &ch->dmandptr);
6127 +#endif // __IDT_DMA_V_H__
6135 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
6136 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_eth.h 1970-01-01 01:00:00.000000000 +0100
6137 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_eth.h 2006-06-18 12:44:28.000000000 +0200
6139 +/**************************************************************************
6141 + * BRIEF MODULE DESCRIPTION
6142 + * Ethernet register definition
6144 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6146 + * This program is free software; you can redistribute it and/or modify it
6147 + * under the terms of the GNU General Public License as published by the
6148 + * Free Software Foundation; either version 2 of the License, or (at your
6149 + * option) any later version.
6151 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6152 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6153 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6154 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6155 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6156 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6157 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6158 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6159 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6160 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6162 + * You should have received a copy of the GNU General Public License along
6163 + * with this program; if not, write to the Free Software Foundation, Inc.,
6164 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6167 + **************************************************************************
6168 + * May 2004 rkt, neb.
6174 + **************************************************************************
6177 +#ifndef __IDT_ETH_H__
6178 +#define __IDT_ETH_H__
6183 + ETH0_PhysicalAddress = 0x18060000,
6184 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
6186 + ETH0_VirtualAddress = 0xb8060000,
6187 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
6197 + u32 ethu0 [4] ; // Reserved.
6200 + u32 eth_u1 [10] ; // Reserved.
6202 + u32 eth_u2 [42] ; // Reserved.
6217 + u32 eth_u9 [50] ; // Reserved.
6224 + u32 eth_u10 ; // Reserved.
6232 + u32 eth_u11 ; // Reserved.
6233 + u32 eth_u12 ; // Reserved.
6241 + ETHINTFC_en_b = 0,
6242 + ETHINTFC_en_m = 0x00000001,
6243 + ETHINTFC_its_b = 1,
6244 + ETHINTFC_its_m = 0x00000002,
6245 + ETHINTFC_rip_b = 2,
6246 + ETHINTFC_rip_m = 0x00000004,
6247 + ETHINTFC_jam_b = 3,
6248 + ETHINTFC_jam_m = 0x00000008,
6249 + ETHINTFC_ovr_b = 4,
6250 + ETHINTFC_ovr_m = 0x00000010,
6251 + ETHINTFC_und_b = 5,
6252 + ETHINTFC_und_m = 0x00000020,
6254 + ETHFIFOTT_tth_b = 0,
6255 + ETHFIFOTT_tth_m = 0x0000007f,
6258 + ETHARC_pro_m = 0x00000001,
6260 + ETHARC_am_m = 0x00000002,
6262 + ETHARC_afm_m = 0x00000004,
6264 + ETHARC_ab_m = 0x00000008,
6266 + ETHSAL_byte5_b = 0,
6267 + ETHSAL_byte5_m = 0x000000ff,
6268 + ETHSAL_byte4_b = 8,
6269 + ETHSAL_byte4_m = 0x0000ff00,
6270 + ETHSAL_byte3_b = 16,
6271 + ETHSAL_byte3_m = 0x00ff0000,
6272 + ETHSAL_byte2_b = 24,
6273 + ETHSAL_byte2_m = 0xff000000,
6275 + ETHSAH_byte1_b = 0,
6276 + ETHSAH_byte1_m = 0x000000ff,
6277 + ETHSAH_byte0_b = 8,
6278 + ETHSAH_byte0_m = 0x0000ff00,
6281 + ETHGPF_ptv_m = 0x0000ffff,
6284 + ETHPFS_pfd_m = 0x00000001,
6286 + ETHCFSA0_cfsa4_b = 0,
6287 + ETHCFSA0_cfsa4_m = 0x000000ff,
6288 + ETHCFSA0_cfsa5_b = 8,
6289 + ETHCFSA0_cfsa5_m = 0x0000ff00,
6291 + ETHCFSA1_cfsa2_b = 0,
6292 + ETHCFSA1_cfsa2_m = 0x000000ff,
6293 + ETHCFSA1_cfsa3_b = 8,
6294 + ETHCFSA1_cfsa3_m = 0x0000ff00,
6296 + ETHCFSA2_cfsa0_b = 0,
6297 + ETHCFSA2_cfsa0_m = 0x000000ff,
6298 + ETHCFSA2_cfsa1_b = 8,
6299 + ETHCFSA2_cfsa1_m = 0x0000ff00,
6302 + ETHMAC1_re_m = 0x00000001,
6303 + ETHMAC1_paf_b = 1,
6304 + ETHMAC1_paf_m = 0x00000002,
6305 + ETHMAC1_rfc_b = 2,
6306 + ETHMAC1_rfc_m = 0x00000004,
6307 + ETHMAC1_tfc_b = 3,
6308 + ETHMAC1_tfc_m = 0x00000008,
6310 + ETHMAC1_lb_m = 0x00000010,
6311 + ETHMAC1_mr_b = 31,
6312 + ETHMAC1_mr_m = 0x80000000,
6315 + ETHMAC2_fd_m = 0x00000001,
6316 + ETHMAC2_flc_b = 1,
6317 + ETHMAC2_flc_m = 0x00000002,
6318 + ETHMAC2_hfe_b = 2,
6319 + ETHMAC2_hfe_m = 0x00000004,
6321 + ETHMAC2_dc_m = 0x00000008,
6322 + ETHMAC2_cen_b = 4,
6323 + ETHMAC2_cen_m = 0x00000010,
6325 + ETHMAC2_pe_m = 0x00000020,
6326 + ETHMAC2_vpe_b = 6,
6327 + ETHMAC2_vpe_m = 0x00000040,
6328 + ETHMAC2_ape_b = 7,
6329 + ETHMAC2_ape_m = 0x00000080,
6330 + ETHMAC2_ppe_b = 8,
6331 + ETHMAC2_ppe_m = 0x00000100,
6332 + ETHMAC2_lpe_b = 9,
6333 + ETHMAC2_lpe_m = 0x00000200,
6334 + ETHMAC2_nb_b = 12,
6335 + ETHMAC2_nb_m = 0x00001000,
6336 + ETHMAC2_bp_b = 13,
6337 + ETHMAC2_bp_m = 0x00002000,
6338 + ETHMAC2_ed_b = 14,
6339 + ETHMAC2_ed_m = 0x00004000,
6341 + ETHIPGT_ipgt_b = 0,
6342 + ETHIPGT_ipgt_m = 0x0000007f,
6344 + ETHIPGR_ipgr2_b = 0,
6345 + ETHIPGR_ipgr2_m = 0x0000007f,
6346 + ETHIPGR_ipgr1_b = 8,
6347 + ETHIPGR_ipgr1_m = 0x00007f00,
6349 + ETHCLRT_maxret_b = 0,
6350 + ETHCLRT_maxret_m = 0x0000000f,
6351 + ETHCLRT_colwin_b = 8,
6352 + ETHCLRT_colwin_m = 0x00003f00,
6354 + ETHMAXF_maxf_b = 0,
6355 + ETHMAXF_maxf_m = 0x0000ffff,
6357 + ETHMTEST_tb_b = 2,
6358 + ETHMTEST_tb_m = 0x00000004,
6361 + ETHMCP_div_m = 0x000000ff,
6363 + MIIMCFG_rsv_b = 0,
6364 + MIIMCFG_rsv_m = 0x0000000c,
6367 + MIIMCMD_rd_m = 0x00000001,
6368 + MIIMCMD_scn_b = 1,
6369 + MIIMCMD_scn_m = 0x00000002,
6371 + MIIMADDR_regaddr_b = 0,
6372 + MIIMADDR_regaddr_m = 0x0000001f,
6373 + MIIMADDR_phyaddr_b = 8,
6374 + MIIMADDR_phyaddr_m = 0x00001f00,
6376 + MIIMWTD_wdata_b = 0,
6377 + MIIMWTD_wdata_m = 0x0000ffff,
6379 + MIIMRDD_rdata_b = 0,
6380 + MIIMRDD_rdata_m = 0x0000ffff,
6382 + MIIMIND_bsy_b = 0,
6383 + MIIMIND_bsy_m = 0x00000001,
6384 + MIIMIND_scn_b = 1,
6385 + MIIMIND_scn_m = 0x00000002,
6387 + MIIMIND_nv_m = 0x00000004,
6392 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
6397 + ETHRX_fd_m = 0x00000001,
6399 + ETHRX_ld_m = 0x00000002,
6401 + ETHRX_rok_m = 0x00000004,
6403 + ETHRX_fm_m = 0x00000008,
6405 + ETHRX_mp_m = 0x00000010,
6407 + ETHRX_bp_m = 0x00000020,
6409 + ETHRX_vlt_m = 0x00000040,
6411 + ETHRX_cf_m = 0x00000080,
6413 + ETHRX_ovr_m = 0x00000100,
6415 + ETHRX_crc_m = 0x00000200,
6417 + ETHRX_cv_m = 0x00000400,
6419 + ETHRX_db_m = 0x00000800,
6421 + ETHRX_le_m = 0x00001000,
6423 + ETHRX_lor_m = 0x00002000,
6425 + ETHRX_ces_m = 0x00004000,
6426 + ETHRX_length_b = 16,
6427 + ETHRX_length_m = 0xffff0000,
6430 + ETHTX_fd_m = 0x00000001,
6432 + ETHTX_ld_m = 0x00000002,
6434 + ETHTX_oen_m = 0x00000004,
6436 + ETHTX_pen_m = 0x00000008,
6438 + ETHTX_cen_m = 0x00000010,
6440 + ETHTX_hen_m = 0x00000020,
6442 + ETHTX_tok_m = 0x00000040,
6444 + ETHTX_mp_m = 0x00000080,
6446 + ETHTX_bp_m = 0x00000100,
6448 + ETHTX_und_m = 0x00000200,
6450 + ETHTX_of_m = 0x00000400,
6452 + ETHTX_ed_m = 0x00000800,
6454 + ETHTX_ec_m = 0x00001000,
6456 + ETHTX_lc_m = 0x00002000,
6458 + ETHTX_td_m = 0x00004000,
6460 + ETHTX_crc_m = 0x00008000,
6462 + ETHTX_le_m = 0x00010000,
6464 + ETHTX_cc_m = 0x001E0000,
6467 +#endif // __IDT_ETH_H__
6472 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
6473 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h 1970-01-01 01:00:00.000000000 +0100
6474 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h 2006-06-18 12:44:28.000000000 +0200
6476 +/**************************************************************************
6478 + * BRIEF MODULE DESCRIPTION
6479 + * Ethernet register definition
6481 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6483 + * This program is free software; you can redistribute it and/or modify it
6484 + * under the terms of the GNU General Public License as published by the
6485 + * Free Software Foundation; either version 2 of the License, or (at your
6486 + * option) any later version.
6488 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6489 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6490 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6491 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6492 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6493 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6494 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6495 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6496 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6497 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6499 + * You should have received a copy of the GNU General Public License along
6500 + * with this program; if not, write to the Free Software Foundation, Inc.,
6501 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6504 + **************************************************************************
6505 + * May 2004 rkt, neb.
6511 + **************************************************************************
6514 +#ifndef __IDT_ETH_V_H__
6515 +#define __IDT_ETH_V_H__
6517 +#include <asm/idt-boards/rc32434/rc32434_eth.h>
6519 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
6520 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
6521 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
6522 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
6523 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
6524 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
6525 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
6526 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
6527 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
6528 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
6529 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
6531 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
6533 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
6534 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
6535 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
6536 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
6537 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
6538 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
6539 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
6540 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
6541 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
6542 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
6543 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
6544 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
6545 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
6546 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
6547 +#endif // __IDT_ETH_V_H__
6553 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
6554 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h 1970-01-01 01:00:00.000000000 +0100
6555 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h 2006-06-18 12:44:28.000000000 +0200
6557 +/**************************************************************************
6559 + * BRIEF MODULE DESCRIPTION
6560 + * GPIO register definition
6562 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6564 + * This program is free software; you can redistribute it and/or modify it
6565 + * under the terms of the GNU General Public License as published by the
6566 + * Free Software Foundation; either version 2 of the License, or (at your
6567 + * option) any later version.
6569 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6570 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6571 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6572 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6573 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6574 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6575 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6576 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6577 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6578 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6580 + * You should have received a copy of the GNU General Public License along
6581 + * with this program; if not, write to the Free Software Foundation, Inc.,
6582 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6585 + **************************************************************************
6586 + * May 2004 rkt, neb.
6592 + **************************************************************************
6595 +#ifndef __IDT_GPIO_H__
6596 +#define __IDT_GPIO_H__
6600 + GPIO0_PhysicalAddress = 0x18050000,
6601 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
6603 + GPIO0_VirtualAddress = 0xb8050000,
6604 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
6609 + u32 gpiofunc; /* GPIO Function Register
6610 + * gpiofunc[x]==0 bit = gpio
6611 + * func[x]==1 bit = altfunc
6613 + u32 gpiocfg; /* GPIO Configuration Register
6614 + * gpiocfg[x]==0 bit = input
6615 + * gpiocfg[x]==1 bit = output
6617 + u32 gpiod; /* GPIO Data Register
6618 + * gpiod[x] read/write gpio pinX status
6620 + u32 gpioilevel; /* GPIO Interrupt Status Register
6621 + * interrupt level (see gpioistat)
6623 + u32 gpioistat; /* Gpio Interrupt Status Register
6624 + * istat[x] = (gpiod[x] == level[x])
6625 + * cleared in ISR (STICKY bits)
6627 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
6628 +} volatile * GPIO_t ;
6632 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
6633 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
6634 + GPIO_input_v = 0, // gpiocfg use pin as input.
6635 + GPIO_output_v = 1, // gpiocfg use pin as output.
6637 + GPIO_pin0_m = 0x00000001,
6639 + GPIO_pin1_m = 0x00000002,
6641 + GPIO_pin2_m = 0x00000004,
6643 + GPIO_pin3_m = 0x00000008,
6645 + GPIO_pin4_m = 0x00000010,
6647 + GPIO_pin5_m = 0x00000020,
6649 + GPIO_pin6_m = 0x00000040,
6651 + GPIO_pin7_m = 0x00000080,
6653 + GPIO_pin8_m = 0x00000100,
6655 + GPIO_pin9_m = 0x00000200,
6656 + GPIO_pin10_b = 10,
6657 + GPIO_pin10_m = 0x00000400,
6658 + GPIO_pin11_b = 11,
6659 + GPIO_pin11_m = 0x00000800,
6660 + GPIO_pin12_b = 12,
6661 + GPIO_pin12_m = 0x00001000,
6662 + GPIO_pin13_b = 13,
6663 + GPIO_pin13_m = 0x00002000,
6665 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
6667 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
6668 + GPIO_u0sout_m = GPIO_pin0_m,
6669 + GPIO_u0sout_cfg_v = GPIO_output_v,
6670 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
6671 + GPIO_u0sinp_m = GPIO_pin1_m,
6672 + GPIO_u0sinp_cfg_v = GPIO_input_v,
6673 + GPIO_u0rtsn_b = GPIO_pin2_b, // UART 0 req. to send.
6674 + GPIO_u0rtsn_m = GPIO_pin2_m,
6675 + GPIO_u0rtsn_cfg_v = GPIO_output_v,
6676 + GPIO_u0ctsn_b = GPIO_pin3_b, // UART 0 clear to send.
6677 + GPIO_u0ctsn_m = GPIO_pin3_m,
6678 + GPIO_u0ctsn_cfg_v = GPIO_input_v,
6680 + GPIO_maddr22_b = GPIO_pin4_b, // M&P bus bit 22.
6681 + GPIO_maddr22_m = GPIO_pin4_m,
6682 + GPIO_maddr22_cfg_v = GPIO_output_v,
6684 + GPIO_maddr23_b = GPIO_pin5_b, // M&P bus bit 23.
6685 + GPIO_maddr23_m = GPIO_pin5_m,
6686 + GPIO_maddr23_cfg_v = GPIO_output_v,
6688 + GPIO_maddr24_b = GPIO_pin6_b, // M&P bus bit 24.
6689 + GPIO_maddr24_m = GPIO_pin6_m,
6690 + GPIO_maddr24_cfg_v = GPIO_output_v,
6692 + GPIO_maddr25_b = GPIO_pin7_b, // M&P bus bit 25.
6693 + GPIO_maddr25_m = GPIO_pin7_m,
6694 + GPIO_maddr25_cfg_v = GPIO_output_v,
6696 + GPIO_cpudmadebug_b = GPIO_pin8_b, // CPU or DMA debug pin
6697 + GPIO_cpudmadebug_m = GPIO_pin8_m,
6698 + GPIO_cpudmadebug_cfg_v = GPIO_output_v,
6700 + GPIO_pcireq4_b = GPIO_pin9_b, // PCI Request 4
6701 + GPIO_pcireq4_m = GPIO_pin9_m,
6702 + GPIO_pcireq4_cfg_v = GPIO_input_v,
6704 + GPIO_pcigrant4_b = GPIO_pin10_b, // PCI Grant 4
6705 + GPIO_pcigrant4_m = GPIO_pin10_m,
6706 + GPIO_pcigrant4_cfg_v = GPIO_output_v,
6708 + GPIO_pcireq5_b = GPIO_pin11_b, // PCI Request 5
6709 + GPIO_pcireq5_m = GPIO_pin11_m,
6710 + GPIO_pcireq5_cfg_v = GPIO_input_v,
6712 + GPIO_pcigrant5_b = GPIO_pin12_b, // PCI Grant 5
6713 + GPIO_pcigrant5_m = GPIO_pin12_m,
6714 + GPIO_pcigrant5_cfg_v = GPIO_output_v,
6716 + GPIO_pcimuintn_b = GPIO_pin13_b, // PCI messaging int.
6717 + GPIO_pcimuintn_m = GPIO_pin13_m,
6718 + GPIO_pcimuintn_cfg_v = GPIO_output_v,
6722 +#endif // __IDT_GPIO_H__
6724 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
6725 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434.h 1970-01-01 01:00:00.000000000 +0100
6726 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434.h 2006-06-18 12:44:28.000000000 +0200
6728 + /**************************************************************************
6730 + * BRIEF MODULE DESCRIPTION
6731 + * Definitions for IDT RC32434 CPU
6733 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6735 + * This program is free software; you can redistribute it and/or modify it
6736 + * under the terms of the GNU General Public License as published by the
6737 + * Free Software Foundation; either version 2 of the License, or (at your
6738 + * option) any later version.
6740 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6741 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6742 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6743 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6744 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6745 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6746 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6747 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6748 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6749 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6751 + * You should have received a copy of the GNU General Public License along
6752 + * with this program; if not, write to the Free Software Foundation, Inc.,
6753 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6756 + **************************************************************************
6757 + * May 2004 rkt, neb.
6763 + **************************************************************************
6766 +#ifndef _RC32434_H_
6767 +#define _RC32434_H_
6769 +#include <linux/autoconf.h>
6770 +#include <linux/delay.h>
6771 +#include <asm/io.h>
6772 +#include <asm/idt-boards/rc32434/rc32434_timer.h>
6774 +#define RC32434_REG_BASE 0x18000000
6777 +#define interrupt ((volatile INT_t ) INT0_VirtualAddress)
6778 +#define idt_timer ((volatile TIM_t) TIM0_VirtualAddress)
6779 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
6781 +#define IDT_CLOCK_MULT 2
6782 +#define MIPS_CPU_TIMER_IRQ 7
6783 +/* Interrupt Controller */
6784 +#define IC_GROUP0_PEND (RC32434_REG_BASE + 0x38000)
6785 +#define IC_GROUP0_MASK (RC32434_REG_BASE + 0x38008)
6786 +#define IC_GROUP_OFFSET 0x0C
6787 +#define RTC_BASE 0xBA001FF0
6789 +#define NUM_INTR_GROUPS 5
6792 +#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
6793 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) /* GRP3 IRQ numbers start here */
6794 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) /* GRP4 IRQ numbers start here */
6795 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) /* GRP5 IRQ numbers start here */
6796 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
6800 +#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58003)
6801 +#define EB434_UART1_BASE (0x19800003)
6805 +#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58000)
6806 +#define EB434_UART1_BASE (0x19800000)
6810 +#define RC32434_UART0_IRQ GROUP3_IRQ_BASE + 0
6811 +#define EB434_UART1_IRQ GROUP4_IRQ_BASE + 11
6813 +#define RC32434_NR_IRQS (GROUP4_IRQ_BASE + 32)
6815 +/* cpu pipeline flush */
6816 +static inline void rc32434_sync(void)
6818 + __asm__ volatile ("sync");
6821 +static inline void rc32434_sync_udelay(int us)
6823 + __asm__ volatile ("sync");
6827 +static inline void rc32434_sync_delay(int ms)
6829 + __asm__ volatile ("sync");
6836 + * Macros to access internal RC32434 registers. No byte
6837 + * swapping should be done when accessing the internal
6841 +#define rc32434_readb __raw_readb
6842 +#define rc32434_readw __raw_readw
6843 +#define rc32434_readl __raw_readl
6845 +#define rc32434_writeb __raw_writeb
6846 +#define rc32434_writew __raw_writew
6847 +#define rc32434_writel __raw_writel
6850 +static inline u8 rc32434_readb(unsigned long pa)
6852 + return *((volatile u8 *)KSEG1ADDR(pa));
6854 +static inline u16 rc32434_readw(unsigned long pa)
6856 + return *((volatile u16 *)KSEG1ADDR(pa));
6858 +static inline u32 rc32434_readl(unsigned long pa)
6860 + return *((volatile u32 *)KSEG1ADDR(pa));
6862 +static inline void rc32434_writeb(u8 val, unsigned long pa)
6864 + *((volatile u8 *)KSEG1ADDR(pa)) = val;
6866 +static inline void rc32434_writew(u16 val, unsigned long pa)
6868 + *((volatile u16 *)KSEG1ADDR(pa)) = val;
6870 +static inline void rc32434_writel(u32 val, unsigned long pa)
6872 + *((volatile u32 *)KSEG1ADDR(pa)) = val;
6879 + * C access to CLZ and CLO instructions
6880 + * (count leading zeroes/ones).
6882 +static inline int rc32434_clz(unsigned long val)
6885 + __asm__ volatile (
6886 + ".set\tnoreorder\n\t"
6888 + ".set\tmips32\n\t"
6898 +static inline int rc32434_clo(unsigned long val)
6901 + __asm__ volatile (
6902 + ".set\tnoreorder\n\t"
6904 + ".set\tmips32\n\t"
6914 +#endif /* _RC32434_H_ */
6927 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
6928 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_integ.h 1970-01-01 01:00:00.000000000 +0100
6929 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_integ.h 2006-06-18 12:44:28.000000000 +0200
6931 +/**************************************************************************
6933 + * BRIEF MODULE DESCRIPTION
6934 + * System Integrity register definition
6936 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6938 + * This program is free software; you can redistribute it and/or modify it
6939 + * under the terms of the GNU General Public License as published by the
6940 + * Free Software Foundation; either version 2 of the License, or (at your
6941 + * option) any later version.
6943 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6944 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6945 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6946 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6947 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6948 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6949 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6950 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6951 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6952 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6954 + * You should have received a copy of the GNU General Public License along
6955 + * with this program; if not, write to the Free Software Foundation, Inc.,
6956 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6959 + **************************************************************************
6960 + * May 2004 rkt, neb
6966 + **************************************************************************
6969 +#ifndef __IDT_INTEG_H__
6970 +#define __IDT_INTEG_H__
6974 + INTEG0_PhysicalAddress = 0x18030000,
6975 + INTEG_PhysicalAddress = INTEG0_PhysicalAddress, // Default
6977 + INTEG0_VirtualAddress = 0xB8030000,
6978 + INTEG_VirtualAddress = INTEG0_VirtualAddress, // Default
6981 +// if you are looking for CEA, try rst.h
6984 + u32 filler [0xc] ; // 0x30 bytes unused.
6985 + u32 errcs ; // sticky use ERRCS_
6986 + u32 wtcount ; // Watchdog timer count reg.
6987 + u32 wtcompare ; // Watchdog timer timeout value.
6988 + u32 wtc ; // Watchdog timer control. use WTC_
6989 +} volatile *INTEG_t ;
6993 + ERRCS_wto_b = 0, // In INTEG_t -> errcs
6994 + ERRCS_wto_m = 0x00000001,
6995 + ERRCS_wne_b = 1, // In INTEG_t -> errcs
6996 + ERRCS_wne_m = 0x00000002,
6997 + ERRCS_ucw_b = 2, // In INTEG_t -> errcs
6998 + ERRCS_ucw_m = 0x00000004,
6999 + ERRCS_ucr_b = 3, // In INTEG_t -> errcs
7000 + ERRCS_ucr_m = 0x00000008,
7001 + ERRCS_upw_b = 4, // In INTEG_t -> errcs
7002 + ERRCS_upw_m = 0x00000010,
7003 + ERRCS_upr_b = 5, // In INTEG_t -> errcs
7004 + ERRCS_upr_m = 0x00000020,
7005 + ERRCS_udw_b = 6, // In INTEG_t -> errcs
7006 + ERRCS_udw_m = 0x00000040,
7007 + ERRCS_udr_b = 7, // In INTEG_t -> errcs
7008 + ERRCS_udr_m = 0x00000080,
7009 + ERRCS_sae_b = 8, // In INTEG_t -> errcs
7010 + ERRCS_sae_m = 0x00000100,
7011 + ERRCS_wre_b = 9, // In INTEG_t -> errcs
7012 + ERRCS_wre_m = 0x00000200,
7014 + WTC_en_b = 0, // In INTEG_t -> wtc
7015 + WTC_en_m = 0x00000001,
7016 + WTC_to_b = 1, // In INTEG_t -> wtc
7017 + WTC_to_m = 0x00000002,
7020 +#endif // __IDT_INTEG_H__
7021 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
7022 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_int.h 1970-01-01 01:00:00.000000000 +0100
7023 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_int.h 2006-06-18 12:44:28.000000000 +0200
7025 +/**************************************************************************
7027 + * BRIEF MODULE DESCRIPTION
7028 + * Interrupt Controller register definition.
7030 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7032 + * This program is free software; you can redistribute it and/or modify it
7033 + * under the terms of the GNU General Public License as published by the
7034 + * Free Software Foundation; either version 2 of the License, or (at your
7035 + * option) any later version.
7037 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7038 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7039 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7040 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7041 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7042 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7043 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7044 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7045 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7046 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7048 + * You should have received a copy of the GNU General Public License along
7049 + * with this program; if not, write to the Free Software Foundation, Inc.,
7050 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7053 + **************************************************************************
7054 + * May 2004 rkt, neb.
7060 + **************************************************************************
7063 +#ifndef __IDT_INT_H__
7064 +#define __IDT_INT_H__
7068 + INT0_PhysicalAddress = 0x18038000,
7069 + INT_PhysicalAddress = INT0_PhysicalAddress, // Default
7071 + INT0_VirtualAddress = 0xB8038000,
7072 + INT_VirtualAddress = INT0_VirtualAddress, // Default
7077 + u32 ipend ; //Pending interrupts. use INT?_
7078 + u32 itest ; //Test bits. use INT?_
7079 + u32 imask ; //Interrupt disabled when set. use INT?_
7084 + IPEND2 = 0, // HW 2 interrupt to core. use INT2_
7085 + IPEND3 = 1, // HW 3 interrupt to core. use INT3_
7086 + IPEND4 = 2, // HW 4 interrupt to core. use INT4_
7087 + IPEND5 = 3, // HW 5 interrupt to core. use INT5_
7088 + IPEND6 = 4, // HW 6 interrupt to core. use INT6_
7090 + IPEND_count, // must be last (used in loops)
7091 + IPEND_min = IPEND2 // min IPEND (used in loops)
7094 +typedef struct INTC_s
7096 + struct INT_s i [IPEND_count] ;// use i[IPEND?] = INT?_
7097 + u32 nmips ; // use NMIPS_
7098 +} volatile *INT_t ;
7102 + INT2_timer0_b = 0,
7103 + INT2_timer0_m = 0x00000001,
7104 + INT2_timer1_b = 1,
7105 + INT2_timer1_m = 0x00000002,
7106 + INT2_timer2_b = 2,
7107 + INT2_timer2_m = 0x00000004,
7108 + INT2_refresh_b = 3,
7109 + INT2_refresh_m = 0x00000008,
7110 + INT2_watchdogTimeout_b = 4,
7111 + INT2_watchdogTimeout_m = 0x00000010,
7112 + INT2_undecodedCpuWrite_b = 5,
7113 + INT2_undecodedCpuWrite_m = 0x00000020,
7114 + INT2_undecodedCpuRead_b = 6,
7115 + INT2_undecodedCpuRead_m = 0x00000040,
7116 + INT2_undecodedPciWrite_b = 7,
7117 + INT2_undecodedPciWrite_m = 0x00000080,
7118 + INT2_undecodedPciRead_b = 8,
7119 + INT2_undecodedPciRead_m = 0x00000100,
7120 + INT2_undecodedDmaWrite_b = 9,
7121 + INT2_undecodedDmaWrite_m = 0x00000200,
7122 + INT2_undecodedDmaRead_b = 10,
7123 + INT2_undecodedDmaRead_m = 0x00000400,
7124 + INT2_ipBusSlaveAckError_b = 11,
7125 + INT2_ipBusSlaveAckError_m = 0x00000800,
7127 + INT3_dmaChannel0_b = 0,
7128 + INT3_dmaChannel0_m = 0x00000001,
7129 + INT3_dmaChannel1_b = 1,
7130 + INT3_dmaChannel1_m = 0x00000002,
7131 + INT3_dmaChannel2_b = 2,
7132 + INT3_dmaChannel2_m = 0x00000004,
7133 + INT3_dmaChannel3_b = 3,
7134 + INT3_dmaChannel3_m = 0x00000008,
7135 + INT3_dmaChannel4_b = 4,
7136 + INT3_dmaChannel4_m = 0x00000010,
7137 + INT3_dmaChannel5_b = 5,
7138 + INT3_dmaChannel5_m = 0x00000020,
7140 + INT5_uartGeneral0_b = 0,
7141 + INT5_uartGeneral0_m = 0x00000001,
7142 + INT5_uartTxrdy0_b = 1,
7143 + INT5_uartTxrdy0_m = 0x00000002,
7144 + INT5_uartRxrdy0_b = 2,
7145 + INT5_uartRxrdy0_m = 0x00000004,
7147 + INT5_pci_m = 0x00000008,
7148 + INT5_pciDecoupled_b = 4,
7149 + INT5_pciDecoupled_m = 0x00000010,
7151 + INT5_spi_m = 0x00000020,
7152 + INT5_deviceDecoupled_b = 6,
7153 + INT5_deviceDecoupled_m = 0x00000040,
7154 + INT5_eth0Ovr_b = 9,
7155 + INT5_eth0Ovr_m = 0x00000200,
7156 + INT5_eth0Und_b = 10,
7157 + INT5_eth0Und_m = 0x00000400,
7158 + INT5_eth0Pfd_b = 11,
7159 + INT5_eth0Pfd_m = 0x00000800,
7160 + INT5_nvram_b = 12,
7161 + INT5_nvram_m = 0x00001000,
7164 + INT6_gpio0_m = 0x00000001,
7166 + INT6_gpio1_m = 0x00000002,
7168 + INT6_gpio2_m = 0x00000004,
7170 + INT6_gpio3_m = 0x00000008,
7172 + INT6_gpio4_m = 0x00000010,
7174 + INT6_gpio5_m = 0x00000020,
7176 + INT6_gpio6_m = 0x00000040,
7178 + INT6_gpio7_m = 0x00000080,
7180 + INT6_gpio8_m = 0x00000100,
7182 + INT6_gpio9_m = 0x00000200,
7183 + INT6_gpio10_b = 10,
7184 + INT6_gpio10_m = 0x00000400,
7185 + INT6_gpio11_b = 11,
7186 + INT6_gpio11_m = 0x00000800,
7187 + INT6_gpio12_b = 12,
7188 + INT6_gpio12_m = 0x00001000,
7189 + INT6_gpio13_b = 13,
7190 + INT6_gpio13_m = 0x00002000,
7193 + NMIPS_gpio_m = 0x00000001,
7196 +#endif // __IDT_INT_H__
7199 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
7200 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h 1970-01-01 01:00:00.000000000 +0100
7201 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h 2006-06-18 12:44:28.000000000 +0200
7203 +/**************************************************************************
7205 + * BRIEF MODULE DESCRIPTION
7206 + * IP Arbiter register definitions
7208 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7210 + * This program is free software; you can redistribute it and/or modify it
7211 + * under the terms of the GNU General Public License as published by the
7212 + * Free Software Foundation; either version 2 of the License, or (at your
7213 + * option) any later version.
7215 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7216 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7217 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7218 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7219 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7220 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7221 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7222 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7223 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7224 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7226 + * You should have received a copy of the GNU General Public License along
7227 + * with this program; if not, write to the Free Software Foundation, Inc.,
7228 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7231 + **************************************************************************
7232 + * May 2004 rkt,neb
7238 + **************************************************************************
7241 +#ifndef __IDT_IPARB_H__
7242 +#define __IDT_IPARB_H__
7246 + IPARB0_PhysicalAddress = 0x18048000,
7247 + IPARB_PhysicalAddress = IPARB0_PhysicalAddress, // Default
7249 + IPARB0_VirtualAddress = 0xB8048000,
7250 + IPARB_VirtualAddress = IPARB0_VirtualAddress, // Default
7255 + IPABMXC_ethernet0Receive = 0,
7256 + IPABMXC_ethernet0Transmit = 1,
7257 + IPABMXC_memoryToHoldFifo = 2,
7258 + IPABMXC_holdFifoToMemory = 3,
7259 + IPABMXC_pciToMemory = 4,
7260 + IPABMXC_memoryToPci = 5,
7261 + IPABMXC_pciTarget = 6,
7262 + IPABMXC_pciTargetStart = 7,
7263 + IPABMXC_cpuToIpBus = 8,
7265 + IPABMXC_Count, // Must be last in list !
7266 + IPABMXC_Min = IPABMXC_ethernet0Receive,
7268 + IPAPXC_PriorityCount = 4, // 3-highest, 0-lowest.
7273 + u32 ipapc [IPAPXC_PriorityCount] ; // ipapc[IPAPXC_] = IPAPC_
7274 + u32 ipabmc [IPABMXC_Count] ; // ipabmc[IPABMXC_] = IPABMC_
7275 + u32 ipac ; // use IPAC_
7276 + u32 ipaitcc; // use IPAITCC_
7278 +} volatile * IPARB_t ;
7283 + IPAC_dp_m = 0x00000001,
7285 + IPAC_dep_m = 0x00000002,
7287 + IPAC_drm_m = 0x00000004,
7289 + IPAC_dwm_m = 0x00000008,
7291 + IPAC_msk_m = 0x00000010,
7294 + IPAPC_ptc_m = 0x00003fff,
7296 + IPAPC_mf_m = 0x00004000,
7297 + IPAPC_cptc_b = 16,
7298 + IPAPC_cptc_m = 0x3fff0000,
7301 + IPAITCC_itcc, = 0x000001ff,
7304 + IPABMC_mtc_m = 0x00000fff,
7306 + IPABMC_p_m = 0x00003000,
7307 + IPABMC_msk_b = 14,
7308 + IPABMC_msk_m = 0x00004000,
7309 + IPABMC_cmtc_b = 16,
7310 + IPABMC_cmtc_m = 0x0fff0000,
7313 +#endif // __IDT_IPARB_H__
7314 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
7315 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_pci.h 1970-01-01 01:00:00.000000000 +0100
7316 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_pci.h 2006-06-18 12:44:28.000000000 +0200
7318 +/**************************************************************************
7320 + * BRIEF MODULE DESCRIPTION
7321 + * PCI register definitio
7323 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7325 + * This program is free software; you can redistribute it and/or modify it
7326 + * under the terms of the GNU General Public License as published by the
7327 + * Free Software Foundation; either version 2 of the License, or (at your
7328 + * option) any later version.
7330 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7331 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7332 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7333 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7334 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7335 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7336 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7337 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7338 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7339 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7341 + * You should have received a copy of the GNU General Public License along
7342 + * with this program; if not, write to the Free Software Foundation, Inc.,
7343 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7346 + **************************************************************************
7347 + * May 2004 rkt, neb.
7353 + **************************************************************************
7356 +#ifndef __IDT_PCI_H__
7357 +#define __IDT_PCI_H__
7361 + PCI0_PhysicalAddress = 0x18080000,
7362 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
7364 + PCI0_VirtualAddress = 0xB8080000,
7365 + PCI_VirtualAddress = PCI0_VirtualAddress,
7370 + PCI_LbaCount = 4, // Local base addresses.
7375 + u32 a ; // Address.
7376 + u32 c ; // Control.
7377 + u32 m ; // mapping.
7387 + PCI_Map_s pcilba [PCI_LbaCount] ;
7395 +} volatile *PCI_t ;
7397 +// PCI messaging unit.
7404 + u32 pciim [PCIM_Count] ;
7405 + u32 pciom [PCIM_Count] ;
7412 +} volatile *PCIM_t ;
7414 +/*******************************************************************************
7416 + * PCI Control Register
7418 + ******************************************************************************/
7422 + PCIC_en_m = 0x00000001,
7424 + PCIC_tnr_m = 0x00000002,
7426 + PCIC_sce_m = 0x00000004,
7428 + PCIC_ien_m = 0x00000008,
7430 + PCIC_aaa_m = 0x00000010,
7432 + PCIC_eap_m = 0x00000020,
7434 + PCIC_pcim_m = 0x000001c0,
7435 + PCIC_pcim_disabled_v = 0,
7436 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
7437 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
7438 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
7439 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
7440 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
7441 + PCIC_pcim_reserved6_v = 6,
7442 + PCIC_pcim_reserved7_v = 7,
7444 + PCIC_igm_m = 0x00000200,
7447 +/*******************************************************************************
7449 + * PCI Status Register
7451 + ******************************************************************************/
7454 + PCIS_eed_m = 0x00000001,
7456 + PCIS_wr_m = 0x00000002,
7458 + PCIS_nmi_m = 0x00000004,
7460 + PCIS_ii_m = 0x00000008,
7462 + PCIS_cwe_m = 0x00000010,
7464 + PCIS_cre_m = 0x00000020,
7466 + PCIS_mdpe_m = 0x00000040,
7468 + PCIS_sta_m = 0x00000080,
7470 + PCIS_rta_m = 0x00000100,
7472 + PCIS_rma_m = 0x00000200,
7474 + PCIS_sse_m = 0x00000400,
7476 + PCIS_ose_m = 0x00000800,
7478 + PCIS_pe_m = 0x00001000,
7480 + PCIS_tae_m = 0x00002000,
7482 + PCIS_rle_m = 0x00004000,
7484 + PCIS_bme_m = 0x00008000,
7486 + PCIS_prd_m = 0x00010000,
7488 + PCIS_rip_m = 0x00020000,
7491 +/*******************************************************************************
7493 + * PCI Status Mask Register
7495 + ******************************************************************************/
7498 + PCISM_eed_m = 0x00000001,
7500 + PCISM_wr_m = 0x00000002,
7502 + PCISM_nmi_m = 0x00000004,
7504 + PCISM_ii_m = 0x00000008,
7506 + PCISM_cwe_m = 0x00000010,
7508 + PCISM_cre_m = 0x00000020,
7510 + PCISM_mdpe_m = 0x00000040,
7512 + PCISM_sta_m = 0x00000080,
7514 + PCISM_rta_m = 0x00000100,
7516 + PCISM_rma_m = 0x00000200,
7518 + PCISM_sse_m = 0x00000400,
7520 + PCISM_ose_m = 0x00000800,
7522 + PCISM_pe_m = 0x00001000,
7524 + PCISM_tae_m = 0x00002000,
7526 + PCISM_rle_m = 0x00004000,
7528 + PCISM_bme_m = 0x00008000,
7530 + PCISM_prd_m = 0x00010000,
7532 + PCISM_rip_m = 0x00020000,
7535 +/*******************************************************************************
7537 + * PCI Configuration Address Register
7539 + ******************************************************************************/
7541 + PCICFGA_reg_b = 2,
7542 + PCICFGA_reg_m = 0x000000fc,
7543 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
7544 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
7545 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
7546 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
7547 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
7548 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
7549 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
7550 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
7551 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
7552 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
7553 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
7554 + PCICFGA_reg_pba0m_v = 0x48>>2,
7555 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
7556 + PCICFGA_reg_pba1m_v = 0x50>>2,
7557 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
7558 + PCICFGA_reg_pba2m_v = 0x58>>2,
7559 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
7560 + PCICFGA_reg_pba3m_v = 0x60>>2,
7561 + PCICFGA_reg_pmgt_v = 0x64>>2,
7562 + PCICFGA_func_b = 8,
7563 + PCICFGA_func_m = 0x00000700,
7564 + PCICFGA_dev_b = 11,
7565 + PCICFGA_dev_m = 0x0000f800,
7566 + PCICFGA_dev_internal_v = 0,
7567 + PCICFGA_bus_b = 16,
7568 + PCICFGA_bus_m = 0x00ff0000,
7569 + PCICFGA_bus_type0_v = 0, //local bus
7570 + PCICFGA_en_b = 31, // read only
7571 + PCICFGA_en_m = 0x80000000,
7575 + PCFGID_vendor_b = 0,
7576 + PCFGID_vendor_m = 0x0000ffff,
7577 + PCFGID_vendor_IDT_v = 0x111d,
7578 + PCFGID_device_b = 16,
7579 + PCFGID_device_m = 0xffff0000,
7580 + PCFGID_device_Korinade_v = 0x0214,
7582 + PCFG04_command_ioena_b = 1,
7583 + PCFG04_command_ioena_m = 0x00000001,
7584 + PCFG04_command_memena_b = 2,
7585 + PCFG04_command_memena_m = 0x00000002,
7586 + PCFG04_command_bmena_b = 3,
7587 + PCFG04_command_bmena_m = 0x00000004,
7588 + PCFG04_command_mwinv_b = 5,
7589 + PCFG04_command_mwinv_m = 0x00000010,
7590 + PCFG04_command_parena_b = 7,
7591 + PCFG04_command_parena_m = 0x00000040,
7592 + PCFG04_command_serrena_b = 9,
7593 + PCFG04_command_serrena_m = 0x00000100,
7594 + PCFG04_command_fastbbena_b = 10,
7595 + PCFG04_command_fastbbena_m = 0x00000200,
7596 + PCFG04_status_b = 16,
7597 + PCFG04_status_m = 0xffff0000,
7598 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
7599 + PCFG04_status_66MHz_m = 0x00200000,
7600 + PCFG04_status_fbb_b = 23,
7601 + PCFG04_status_fbb_m = 0x00800000,
7602 + PCFG04_status_mdpe_b = 24,
7603 + PCFG04_status_mdpe_m = 0x01000000,
7604 + PCFG04_status_dst_b = 25,
7605 + PCFG04_status_dst_m = 0x06000000,
7606 + PCFG04_status_sta_b = 27,
7607 + PCFG04_status_sta_m = 0x08000000,
7608 + PCFG04_status_rta_b = 28,
7609 + PCFG04_status_rta_m = 0x10000000,
7610 + PCFG04_status_rma_b = 29,
7611 + PCFG04_status_rma_m = 0x20000000,
7612 + PCFG04_status_sse_b = 30,
7613 + PCFG04_status_sse_m = 0x40000000,
7614 + PCFG04_status_pe_b = 31,
7615 + PCFG04_status_pe_m = 0x40000000,
7617 + PCFG08_revId_b = 0,
7618 + PCFG08_revId_m = 0x000000ff,
7619 + PCFG08_classCode_b = 0,
7620 + PCFG08_classCode_m = 0xffffff00,
7621 + PCFG08_classCode_bridge_v = 06,
7622 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
7623 + PCFG0C_cacheline_b = 0,
7624 + PCFG0C_cacheline_m = 0x000000ff,
7625 + PCFG0C_masterLatency_b = 8,
7626 + PCFG0C_masterLatency_m = 0x0000ff00,
7627 + PCFG0C_headerType_b = 16,
7628 + PCFG0C_headerType_m = 0x00ff0000,
7629 + PCFG0C_bist_b = 24,
7630 + PCFG0C_bist_m = 0xff000000,
7633 + PCIPBA_msi_m = 0x00000001,
7635 + PCIPBA_p_m = 0x00000004,
7636 + PCIPBA_baddr_b = 8,
7637 + PCIPBA_baddr_m = 0xffffff00,
7639 + PCFGSS_vendorId_b = 0,
7640 + PCFGSS_vendorId_m = 0x0000ffff,
7642 + PCFGSS_id_m = 0xffff0000,
7644 + PCFG3C_interruptLine_b = 0,
7645 + PCFG3C_interruptLine_m = 0x000000ff,
7646 + PCFG3C_interruptPin_b = 8,
7647 + PCFG3C_interruptPin_m = 0x0000ff00,
7648 + PCFG3C_minGrant_b = 16,
7649 + PCFG3C_minGrant_m = 0x00ff0000,
7650 + PCFG3C_maxLat_b = 24,
7651 + PCFG3C_maxLat_m = 0xff000000,
7653 + PCIPBAC_msi_b = 0,
7654 + PCIPBAC_msi_m = 0x00000001,
7656 + PCIPBAC_p_m = 0x00000002,
7657 + PCIPBAC_size_b = 2,
7658 + PCIPBAC_size_m = 0x0000007c,
7660 + PCIPBAC_sb_m = 0x00000080,
7662 + PCIPBAC_pp_m = 0x00000100,
7664 + PCIPBAC_mr_m = 0x00000600,
7665 + PCIPBAC_mr_read_v =0, //no prefetching
7666 + PCIPBAC_mr_readLine_v =1,
7667 + PCIPBAC_mr_readMult_v =2,
7668 + PCIPBAC_mrl_b = 11,
7669 + PCIPBAC_mrl_m = 0x00000800,
7670 + PCIPBAC_mrm_b = 12,
7671 + PCIPBAC_mrm_m = 0x00001000,
7672 + PCIPBAC_trp_b = 13,
7673 + PCIPBAC_trp_m = 0x00002000,
7675 + PCFG40_trdyTimeout_b = 0,
7676 + PCFG40_trdyTimeout_m = 0x000000ff,
7677 + PCFG40_retryLim_b = 8,
7678 + PCFG40_retryLim_m = 0x0000ff00,
7681 +/*******************************************************************************
7683 + * PCI Local Base Address [0|1|2|3] Register
7685 + ******************************************************************************/
7687 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
7688 + PCILBA_baddr_m = 0xffffff00,
7690 +/*******************************************************************************
7692 + * PCI Local Base Address Control Register
7694 + ******************************************************************************/
7696 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
7697 + PCILBAC_msi_m = 0x00000001,
7698 + PCILBAC_msi_mem_v = 0,
7699 + PCILBAC_msi_io_v = 1,
7700 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
7701 + PCILBAC_size_m = 0x0000007c,
7702 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
7703 + PCILBAC_sb_m = 0x00000080,
7704 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
7705 + PCILBAC_rt_m = 0x00000100,
7706 + PCILBAC_rt_noprefetch_v = 0, // mem read
7707 + PCILBAC_rt_prefetch_v = 1, // mem readline
7710 +/*******************************************************************************
7712 + * PCI Local Base Address [0|1|2|3] Mapping Register
7714 + ******************************************************************************/
7716 + PCILBAM_maddr_b = 8,
7717 + PCILBAM_maddr_m = 0xffffff00,
7720 +/*******************************************************************************
7722 + * PCI Decoupled Access Control Register
7724 + ******************************************************************************/
7727 + PCIDAC_den_m = 0x00000001,
7730 +/*******************************************************************************
7732 + * PCI Decoupled Access Status Register
7734 + ******************************************************************************/
7737 + PCIDAS_d_m = 0x00000001,
7739 + PCIDAS_b_m = 0x00000002,
7741 + PCIDAS_e_m = 0x00000004,
7743 + PCIDAS_ofe_m = 0x00000008,
7745 + PCIDAS_off_m = 0x00000010,
7747 + PCIDAS_ife_m = 0x00000020,
7749 + PCIDAS_iff_m = 0x00000040,
7752 +/*******************************************************************************
7754 + * PCI DMA Channel 8 Configuration Register
7756 + ******************************************************************************/
7759 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
7760 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
7761 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
7762 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
7765 +/*******************************************************************************
7767 + * PCI DMA Channel 9 Configuration Register
7769 + ******************************************************************************/
7772 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
7773 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
7776 +/*******************************************************************************
7778 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
7780 + ******************************************************************************/
7782 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
7783 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
7784 + // These are for reads (DMA channel 8)
7785 + PCIDMAD_devcmd_mr_v = 0, //memory read
7786 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
7787 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
7788 + PCIDMAD_devcmd_ior_v = 3, //I/O read
7789 + // These are for writes (DMA channel 9)
7790 + PCIDMAD_devcmd_mw_v = 0, //memory write
7791 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
7792 + PCIDMAD_devcmd_iow_v = 3, //I/O write
7794 + // Swap byte field applies to both DMA channel 8 and 9
7795 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
7796 + PCIDMAD_sb_m = 0x01000000, // swap byte field
7800 +/*******************************************************************************
7802 + * PCI Target Control Register
7804 + ******************************************************************************/
7807 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
7808 + PCITC_rtimer_m = 0x000000ff,
7809 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
7810 + PCITC_dtimer_m = 0x0000ff00,
7811 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
7812 + PCITC_rdr_m = 0x00040000,
7813 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
7814 + PCITC_ddt_m = 0x00080000,
7816 +/*******************************************************************************
7818 + * PCI messaging unit [applies to both inbound and outbound registers ]
7820 + ******************************************************************************/
7823 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7824 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
7825 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7826 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
7827 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7828 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
7836 +#define PCI_MSG_VirtualAddress 0xB8088010
7837 +#define rc32434_pci ((volatile PCI_t) PCI0_VirtualAddress)
7838 +#define rc32434_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
7840 +#define PCIM_SHFT 0x6
7841 +#define PCIM_BIT_LEN 0x7
7842 +#define PCIM_H_EA 0x3
7843 +#define PCIM_H_IA_FIX 0x4
7844 +#define PCIM_H_IA_RR 0x5
7846 +#define PCI_ADDR_START 0x13000000
7849 +#define PCI_ADDR_START 0x50000000
7851 +#define CPUTOPCI_MEM_WIN 0x02000000
7852 +#define CPUTOPCI_IO_WIN 0x00100000
7853 +#define PCILBA_SIZE_SHFT 2
7854 +#define PCILBA_SIZE_MASK 0x1F
7855 +#define SIZE_256MB 0x1C
7856 +#define SIZE_128MB 0x1B
7857 +#define SIZE_64MB 0x1A
7858 +#define SIZE_32MB 0x19
7859 +#define SIZE_16MB 0x18
7860 +#define SIZE_4MB 0x16
7861 +#define SIZE_2MB 0x15
7862 +#define SIZE_1MB 0x14
7863 +#define KORINA_CONFIG0_ADDR 0x80000000
7864 +#define KORINA_CONFIG1_ADDR 0x80000004
7865 +#define KORINA_CONFIG2_ADDR 0x80000008
7866 +#define KORINA_CONFIG3_ADDR 0x8000000C
7867 +#define KORINA_CONFIG4_ADDR 0x80000010
7868 +#define KORINA_CONFIG5_ADDR 0x80000014
7869 +#define KORINA_CONFIG6_ADDR 0x80000018
7870 +#define KORINA_CONFIG7_ADDR 0x8000001C
7871 +#define KORINA_CONFIG8_ADDR 0x80000020
7872 +#define KORINA_CONFIG9_ADDR 0x80000024
7873 +#define KORINA_CONFIG10_ADDR 0x80000028
7874 +#define KORINA_CONFIG11_ADDR 0x8000002C
7875 +#define KORINA_CONFIG12_ADDR 0x80000030
7876 +#define KORINA_CONFIG13_ADDR 0x80000034
7877 +#define KORINA_CONFIG14_ADDR 0x80000038
7878 +#define KORINA_CONFIG15_ADDR 0x8000003C
7879 +#define KORINA_CONFIG16_ADDR 0x80000040
7880 +#define KORINA_CONFIG17_ADDR 0x80000044
7881 +#define KORINA_CONFIG18_ADDR 0x80000048
7882 +#define KORINA_CONFIG19_ADDR 0x8000004C
7883 +#define KORINA_CONFIG20_ADDR 0x80000050
7884 +#define KORINA_CONFIG21_ADDR 0x80000054
7885 +#define KORINA_CONFIG22_ADDR 0x80000058
7886 +#define KORINA_CONFIG23_ADDR 0x8000005C
7887 +#define KORINA_CONFIG24_ADDR 0x80000060
7888 +#define KORINA_CONFIG25_ADDR 0x80000064
7889 +#define KORINA_CMD (PCFG04_command_ioena_m | \
7890 + PCFG04_command_memena_m | \
7891 + PCFG04_command_bmena_m | \
7892 + PCFG04_command_mwinv_m | \
7893 + PCFG04_command_parena_m | \
7894 + PCFG04_command_serrena_m )
7896 +#define KORINA_STAT (PCFG04_status_mdpe_m | \
7897 + PCFG04_status_sta_m | \
7898 + PCFG04_status_rta_m | \
7899 + PCFG04_status_rma_m | \
7900 + PCFG04_status_sse_m | \
7901 + PCFG04_status_pe_m)
7903 +#define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
7905 +#define KORINA_REVID 0
7906 +#define KORINA_CLASS_CODE 0
7907 +#define KORINA_CNFG2 ((KORINA_CLASS_CODE<<8) | \
7910 +#define KORINA_CACHE_LINE_SIZE 4
7911 +#define KORINA_MASTER_LAT 0x3c
7912 +#define KORINA_HEADER_TYPE 0
7913 +#define KORINA_BIST 0
7915 +#define KORINA_CNFG3 ((KORINA_BIST << 24) | \
7916 + (KORINA_HEADER_TYPE<<16) | \
7917 + (KORINA_MASTER_LAT<<8) | \
7918 + KORINA_CACHE_LINE_SIZE )
7920 +#define KORINA_BAR0 0x00000008 /* 128 MB Memory */
7921 +#define KORINA_BAR1 0x18800001 /* 1 MB IO */
7922 +#define KORINA_BAR2 0x18000001 /* 2 MB IO window for Korina
7923 + internal Registers */
7924 +#define KORINA_BAR3 0x48000008 /* Spare 128 MB Memory */
7926 +#define KORINA_CNFG4 KORINA_BAR0
7927 +#define KORINA_CNFG5 KORINA_BAR1
7928 +#define KORINA_CNFG6 KORINA_BAR2
7929 +#define KORINA_CNFG7 KORINA_BAR3
7931 +#define KORINA_SUBSYS_VENDOR_ID 0x011d
7932 +#define KORINA_SUBSYSTEM_ID 0x0214
7933 +#define KORINA_CNFG8 0
7934 +#define KORINA_CNFG9 0
7935 +#define KORINA_CNFG10 0
7936 +#define KORINA_CNFG11 ((KORINA_SUBSYS_VENDOR_ID<<16) | \
7937 + KORINA_SUBSYSTEM_ID)
7938 +#define KORINA_INT_LINE 1
7939 +#define KORINA_INT_PIN 1
7940 +#define KORINA_MIN_GNT 8
7941 +#define KORINA_MAX_LAT 0x38
7942 +#define KORINA_CNFG12 0
7943 +#define KORINA_CNFG13 0
7944 +#define KORINA_CNFG14 0
7945 +#define KORINA_CNFG15 ((KORINA_MAX_LAT<<24) | \
7946 + (KORINA_MIN_GNT<<16) | \
7947 + (KORINA_INT_PIN<<8) | \
7949 +#define KORINA_RETRY_LIMIT 0x80
7950 +#define KORINA_TRDY_LIMIT 0x80
7951 +#define KORINA_CNFG16 ((KORINA_RETRY_LIMIT<<8) | \
7952 + KORINA_TRDY_LIMIT)
7953 +#define PCI_PBAxC_R 0x0
7954 +#define PCI_PBAxC_RL 0x1
7955 +#define PCI_PBAxC_RM 0x2
7956 +#define SIZE_SHFT 2
7958 +#if defined(__MIPSEB__)
7959 +#define KORINA_PBA0C ( PCIPBAC_mrl_m | PCIPBAC_sb_m | \
7960 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
7962 + (SIZE_128MB<<SIZE_SHFT) | \
7965 +#define KORINA_PBA0C ( PCIPBAC_mrl_m | \
7966 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
7968 + (SIZE_128MB<<SIZE_SHFT) | \
7971 +#define KORINA_CNFG17 KORINA_PBA0C
7972 +#define KORINA_PBA0M 0x0
7973 +#define KORINA_CNFG18 KORINA_PBA0M
7975 +#if defined(__MIPSEB__)
7976 +#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
7979 +#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | \
7982 +#define KORINA_CNFG19 KORINA_PBA1C
7983 +#define KORINA_PBA1M 0x0
7984 +#define KORINA_CNFG20 KORINA_PBA1M
7986 +#if defined(__MIPSEB__)
7987 +#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
7990 +#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | \
7993 +#define KORINA_CNFG21 KORINA_PBA2C
7994 +#define KORINA_PBA2M 0x18000000
7995 +#define KORINA_CNFG22 KORINA_PBA2M
7996 +#define KORINA_PBA3C 0
7997 +#define KORINA_CNFG23 KORINA_PBA3C
7998 +#define KORINA_PBA3M 0
7999 +#define KORINA_CNFG24 KORINA_PBA3M
8003 +#define PCITC_DTIMER_VAL 8
8004 +#define PCITC_RTIMER_VAL 0x10
8009 +#endif // __IDT_PCI_H__
8013 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
8014 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_rst.h 1970-01-01 01:00:00.000000000 +0100
8015 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_rst.h 2006-06-18 12:44:28.000000000 +0200
8017 +/**************************************************************************
8019 + * BRIEF MODULE DESCRIPTION
8020 + * Reset register definitions.
8022 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8024 + * This program is free software; you can redistribute it and/or modify it
8025 + * under the terms of the GNU General Public License as published by the
8026 + * Free Software Foundation; either version 2 of the License, or (at your
8027 + * option) any later version.
8029 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8030 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8031 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8032 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8033 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8034 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8035 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8036 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8037 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8038 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8040 + * You should have received a copy of the GNU General Public License along
8041 + * with this program; if not, write to the Free Software Foundation, Inc.,
8042 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8045 + **************************************************************************
8046 + * May 2004 rkt, neb.
8052 + **************************************************************************
8055 +#ifndef __IDT_RST_H__
8056 +#define __IDT_RST_H__
8060 + RST0_PhysicalAddress = 0x18000000,
8061 + RST_PhysicalAddress = RST0_PhysicalAddress, // Default
8063 + RST0_VirtualAddress = 0xb8000000,
8064 + RST_VirtualAddress = RST0_VirtualAddress, // Default
8067 +typedef struct RST_s
8069 + u32 filler [0x0006] ;
8071 + u32 filler2 [0x2000-8] ; // Pad out to offset 0x8000
8075 +} volatile * RST_t ;
8080 + SYSID_rev_m = 0x000000ff,
8082 + SYSID_imp_m = 0x000fff00,
8083 + SYSID_vendor_b = 8,
8084 + SYSID_vendor_m = 0xfff00000,
8087 + BCV_pll_m = 0x0000000f,
8088 + BCV_pll_PLLBypass_v = 0x0, // PCLK=1*CLK.
8089 + BCV_pll_Mul3_v = 0x1, // PCLK=3*CLK.
8090 + BCV_pll_Mul4_v = 0x2, // PCLK=4*CLK.
8091 + BCV_pll_SlowMul5_v = 0x3, // PCLK=5*CLK.
8092 + BCV_pll_Mul5_v = 0x4, // PCLK=5*CLK.
8093 + BCV_pll_SlowMul6_v = 0x5, // PCLK=6*CLK.
8094 + BCV_pll_Mul6_v = 0x6, // PCLK=6*CLK.
8095 + BCV_pll_Mul8_v = 0x7, // PCLK=8*CLK.
8096 + BCV_pll_Mul10_v = 0x8, // PCLK=10*CLK.
8097 + BCV_pll_Res9_v = 0x9,
8098 + BCV_pll_Res10_v = 0xa,
8099 + BCV_pll_Res11_v = 0xb,
8100 + BCV_pll_Res12_v = 0xc,
8101 + BCV_pll_Res13_v = 0xd,
8102 + BCV_pll_Res14_v = 0xe,
8103 + BCV_pll_Res15_v = 0xf,
8105 + BCV_clkDiv_m = 0x00000030,
8106 + BCV_clkDiv_Div1_v = 0x0,
8107 + BCV_clkDiv_Div2_v = 0x1,
8108 + BCV_clkDiv_Div4_v = 0x2,
8109 + BCV_clkDiv_Res3_v = 0x3,
8110 + BCV_bigEndian_b = 6,
8111 + BCV_bigEndian_m = 0x00000040,
8112 + BCV_resetFast_b = 7,
8113 + BCV_resetFast_m = 0x00000080,
8114 + BCV_pciMode_b = 8,
8115 + BCV_pciMode_m = 0x00000700,
8116 + BCV_pciMode_disabled_v = 0, // PCI is disabled.
8117 + BCV_pciMode_tnr_v = 1, // satellite Target Not Ready.
8118 + BCV_pciMode_suspended_v = 2, // satellite with suspended CPU.
8119 + BCV_pciMode_external_v = 3, // host, external arbiter.
8120 + BCV_pciMode_fixed_v = 4, // host, fixed priority arbiter.
8121 + BCV_pciMode_roundRobin_v= 5, // host, round robin arbiter.
8122 + BCV_pciMode_res6_v = 6,
8123 + BCV_pciMode_res7_v = 7,
8124 + BCV_watchDisable_b = 11,
8125 + BCV_watchDisable_m = 0x00000800,
8127 + BCV_res12_m = 0x00001000,
8129 + BCV_res13_m = 0x00002000,
8131 + BCV_res14_m = 0x00004000,
8133 + BCV_res15_m = 0x00008000,
8135 +#endif // __IDT_RST_H__
8136 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
8137 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_spi.h 1970-01-01 01:00:00.000000000 +0100
8138 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_spi.h 2006-06-18 12:44:28.000000000 +0200
8140 +/**************************************************************************
8142 + * BRIEF MODULE DESCRIPTION
8143 + * Serial Peripheral Interface register definitions.
8145 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8147 + * This program is free software; you can redistribute it and/or modify it
8148 + * under the terms of the GNU General Public License as published by the
8149 + * Free Software Foundation; either version 2 of the License, or (at your
8150 + * option) any later version.
8152 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8153 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8154 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8155 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8156 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8157 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8158 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8159 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8160 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8161 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8163 + * You should have received a copy of the GNU General Public License along
8164 + * with this program; if not, write to the Free Software Foundation, Inc.,
8165 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8168 + **************************************************************************
8169 + * May 2004 rkt, neb.
8175 + **************************************************************************
8178 +#ifndef __IDT_SPI_H__
8179 +#define __IDT_SPI_H__
8183 + SPI0_PhysicalAddress = 0x18070000,
8184 + SPI_PhysicalAddress = SPI0_PhysicalAddress,
8186 + SPI0_VirtualAddress = 0xB8070000,
8187 + SPI_VirtualAddress = SPI0_VirtualAddress,
8192 + u32 spcp ; // prescalar. 0=off, * spiClk = sysClk/(2*(spcp+1)*SPR)
8193 + u32 spc ; // spi control reg use SPC_
8194 + u32 sps ; // spi status reg use SPS_
8195 + u32 spd ; // spi data reg use SPD_
8196 + u32 siofunc ; // serial IO function use SIOFUNC_
8197 + u32 siocfg ; // serial IO config use SIOCFG_
8198 + u32 siod; // serial IO data use SIOD_
8199 +} volatile *SPI_t ;
8204 + SPCP_div_m = 0x000000ff,
8206 + SPC_spr_m = 0x00000003,
8207 + SPC_spr_div2_v = 0,
8208 + SPC_spr_div4_v = 1,
8209 + SPC_spr_div16_v = 2,
8210 + SPC_spr_div32_v = 3,
8212 + SPC_cpha_m = 0x00000004,
8214 + SPC_cpol_m = 0x00000008,
8216 + SPC_mstr_m = 0x00000010,
8218 + SPC_spe_m = 0x00000040,
8220 + SPC_spie_m = 0x00000080,
8223 + SPS_modf_m = 0x00000010,
8225 + SPS_wcol_m = 0x00000040,
8227 + SPS_spif_m = 0x00000070,
8230 + SPD_data_m = 0x000000ff,
8232 + SIOFUNC_sdo_b = 0,
8233 + SIOFUNC_sdo_m = 0x00000001,
8234 + SIOFUNC_sdi_b = 1,
8235 + SIOFUNC_sdi_m = 0x00000002,
8236 + SIOFUNC_sck_b = 2,
8237 + SIOFUNC_sck_m = 0x00000004,
8238 + SIOFUNC_pci_b = 3,
8239 + SIOFUNC_pci_m = 0x00000008,
8242 + SIOCFG_sdo_m = 0x00000001,
8244 + SIOCFG_sdi_m = 0x00000002,
8246 + SIOCFG_sck_m = 0x00000004,
8248 + SIOCFG_pci_m = 0x00000008,
8251 + SIOD_sdo_m = 0x00000001,
8253 + SIOD_sdi_m = 0x00000002,
8255 + SIOD_sck_m = 0x00000004,
8257 + SIOD_pci_m = 0x00000008,
8259 +#endif // __IDT_SPI_H__
8260 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
8261 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_timer.h 1970-01-01 01:00:00.000000000 +0100
8262 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_timer.h 2006-06-18 12:44:28.000000000 +0200
8264 +/**************************************************************************
8266 + * BRIEF MODULE DESCRIPTION
8267 + * Definitions for timer registers
8269 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8271 + * This program is free software; you can redistribute it and/or modify it
8272 + * under the terms of the GNU General Public License as published by the
8273 + * Free Software Foundation; either version 2 of the License, or (at your
8274 + * option) any later version.
8276 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8277 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8278 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8279 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8280 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8281 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8282 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8283 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8284 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8285 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8287 + * You should have received a copy of the GNU General Public License along
8288 + * with this program; if not, write to the Free Software Foundation, Inc.,
8289 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8292 + **************************************************************************
8293 + * May 2004 rkt,neb.
8299 + **************************************************************************
8302 +#ifndef __IDT_TIM_H__
8303 +#define __IDT_TIM_H__
8307 + TIM0_PhysicalAddress = 0x18028000,
8308 + TIM_PhysicalAddress = TIM0_PhysicalAddress, // Default
8310 + TIM0_VirtualAddress = 0xb8028000,
8311 + TIM_VirtualAddress = TIM0_VirtualAddress, // Default
8323 + u32 ctc ; //use CTC_
8326 +typedef struct TIM_s
8328 + struct TIM_CNTR_s tim [TIM_Count] ;
8329 + u32 rcount ; //use RCOUNT_
8330 + u32 rcompare ; //use RCOMPARE_
8331 + u32 rtc ; //use RTC_
8332 +} volatile * TIM_t ;
8337 + CTC_en_m = 0x00000001,
8339 + CTC_to_m = 0x00000002,
8341 + RCOUNT_count_b = 0,
8342 + RCOUNT_count_m = 0x0000ffff,
8343 + RCOMPARE_compare_b = 0,
8344 + RCOMPARE_compare_m = 0x0000ffff,
8346 + RTC_ce_m = 0x00000001,
8348 + RTC_to_m = 0x00000002,
8350 + RTC_rqe_m = 0x00000004,
8353 +#endif // __IDT_TIM_H__
8355 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
8356 --- linux-2.6.17/include/asm-mips/idt-boards/rc32434/rc32434_uart.h 1970-01-01 01:00:00.000000000 +0100
8357 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32434/rc32434_uart.h 2006-06-18 12:44:28.000000000 +0200
8359 +/**************************************************************************
8361 + * BRIEF MODULE DESCRIPTION
8362 + * UART register definitions
8364 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8366 + * This program is free software; you can redistribute it and/or modify it
8367 + * under the terms of the GNU General Public License as published by the
8368 + * Free Software Foundation; either version 2 of the License, or (at your
8369 + * option) any later version.
8371 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8372 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8373 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8374 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8375 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8376 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8377 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8378 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8379 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8380 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8382 + * You should have received a copy of the GNU General Public License along
8383 + * with this program; if not, write to the Free Software Foundation, Inc.,
8384 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8387 + **************************************************************************
8388 + * May 2004 rkt, neb.
8394 + **************************************************************************
8397 +#ifndef __IDT_UART_H__
8398 +#define __IDT_UART_H__
8402 + UART0_PhysicalAddress = 0x1c000000,
8403 + UART_PhysicalAddress = UART0_PhysicalAddress, // Default
8405 + UART0_VirtualAddress = 0xbc000000,
8406 + UART_VirtualAddress = UART0_VirtualAddress, // Default
8410 + * Register definitions are in bytes so we can handle endian problems.
8413 +typedef struct UART_s
8417 + u32 const uartrb ; // 0x00 - DLAB=0, read.
8418 + u32 uartth ; // 0x00 - DLAB=0, write.
8419 + u32 uartdll ; // 0x00 - DLAB=1, read/write.
8424 + u32 uartie ; // 0x04 - DLAB=0, read/write.
8425 + u32 uartdlh ; // 0x04 - DLAB=1, read/write.
8429 + u32 const uartii ; // 0x08 - DLAB=0, read.
8430 + u32 uartfc ; // 0x08 - DLAB=0, write.
8433 + u32 uartlc ; // 0x0c
8434 + u32 uartmc ; // 0x10
8435 + u32 uartls ; // 0x14
8436 + u32 uartms ; // 0x18
8437 + u32 uarts ; // 0x1c
8438 +} volatile *UART_t ;
8440 +// Reset registers.
8441 +typedef u32 volatile *UARTRR_t ;
8446 + UARTIE_rda_m = 0x00000001,
8448 + UARTIE_the_m = 0x00000002,
8450 + UARTIE_rls_m = 0x00000004,
8452 + UARTIE_ems_m = 0x00000008,
8455 + UARTII_pi_m = 0x00000001,
8457 + UARTII_iid_m = 0x0000000e,
8458 + UARTII_iid_ms_v = 0, // Modem stat-CTS,DSR,RI or DCD.
8459 + UARTII_iid_thre_v = 1, // Trans. Holding Reg. empty.
8460 + UARTII_iid_rda_v = 2, // Receive data available
8461 + UARTII_iid_rls_v = 3, // Overrun, parity, etc, error.
8462 + UARTII_iid_res4_v = 4, // reserved.
8463 + UARTII_iid_res5_v = 5, // reserved.
8464 + UARTII_iid_cto_v = 6, // Character timeout.
8465 + UARTII_iid_res7_v = 7, // reserved.
8468 + UARTFC_en_m = 0x00000001,
8470 + UARTFC_rr_m = 0x00000002,
8472 + UARTFC_tr_m = 0x00000004,
8474 + UARTFC_dms_m = 0x00000008,
8476 + UARTFC_rt_m = 0x000000c0,
8477 + UARTFC_rt_1Byte_v = 0,
8478 + UARTFC_rt_4Byte_v = 1,
8479 + UARTFC_rt_8Byte_v = 2,
8480 + UARTFC_rt_14Byte_v = 3,
8483 + UARTLC_wls_m = 0x00000003,
8484 + UARTLC_wls_5Bits_v = 0,
8485 + UARTLC_wls_6Bits_v = 1,
8486 + UARTLC_wls_7Bits_v = 2,
8487 + UARTLC_wls_8Bits_v = 3,
8489 + UARTLC_stb_m = 0x00000004,
8491 + UARTLC_pen_m = 0x00000008,
8493 + UARTLC_eps_m = 0x00000010,
8495 + UARTLC_sp_m = 0x00000020,
8497 + UARTLC_sb_m = 0x00000040,
8498 + UARTLC_dlab_b = 7,
8499 + UARTLC_dlab_m = 0x00000080,
8502 + UARTMC_dtr_m = 0x00000001,
8504 + UARTMC_rts_m = 0x00000002,
8506 + UARTMC_o1_m = 0x00000004,
8508 + UARTMC_o2_m = 0x00000008,
8510 + UARTMC_lp_m = 0x00000010,
8513 + UARTLS_dr_m = 0x00000001,
8515 + UARTLS_oe_m = 0x00000002,
8517 + UARTLS_pe_m = 0x00000004,
8519 + UARTLS_fe_m = 0x00000008,
8521 + UARTLS_bi_m = 0x00000010,
8523 + UARTLS_thr_m = 0x00000020,
8525 + UARTLS_te_m = 0x00000040,
8527 + UARTLS_rfe_m = 0x00000080,
8529 + UARTMS_dcts_b = 0,
8530 + UARTMS_dcts_m = 0x00000001,
8531 + UARTMS_ddsr_b = 1,
8532 + UARTMS_ddsr_m = 0x00000002,
8533 + UARTMS_teri_b = 2,
8534 + UARTMS_teri_m = 0x00000004,
8535 + UARTMS_ddcd_b = 3,
8536 + UARTMS_ddcd_m = 0x00000008,
8538 + UARTMS_cts_m = 0x00000010,
8540 + UARTMS_dsr_m = 0x00000020,
8542 + UARTMS_ri_m = 0x00000040,
8544 + UARTMS_dcd_m = 0x00000080,
8547 +#endif // __IDT_UART_H__
8548 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
8549 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_dma.h 1970-01-01 01:00:00.000000000 +0100
8550 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_dma.h 2006-06-18 12:44:28.000000000 +0200
8552 +/**************************************************************************
8554 + * BRIEF MODULE DESCRIPTION
8555 + * Register definitions for IDT RC32438 DMA.
8557 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8559 + * This program is free software; you can redistribute it and/or modify it
8560 + * under the terms of the GNU General Public License as published by the
8561 + * Free Software Foundation; either version 2 of the License, or (at your
8562 + * option) any later version.
8564 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8565 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8566 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8567 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8568 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8569 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8570 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8571 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8572 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8573 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8575 + * You should have received a copy of the GNU General Public License along
8576 + * with this program; if not, write to the Free Software Foundation, Inc.,
8577 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8580 + **************************************************************************
8581 + * May 2004 P. Sadik.
8587 + **************************************************************************
8589 +#ifndef __IDT_RC32438_DMA_H__
8590 +#define __IDT_RC32438_DMA_H__
8593 + DMA0_PhysicalAddress = 0x18040000,
8594 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
8596 + DMA0_VirtualAddress = 0xb8040000,
8597 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
8601 + * DMA descriptor (in physical memory).
8604 +typedef struct DMAD_s
8606 + u32 control ; // Control. use DMAD_*
8607 + u32 ca ; // Current Address.
8608 + u32 devcs ; // Device control and status.
8609 + u32 link ; // Next descriptor in chain.
8610 +} volatile *DMAD_t ;
8614 + DMAD_size = sizeof (struct DMAD_s),
8615 + DMAD_count_b = 0, // in DMAD_t -> control
8616 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
8617 + DMAD_ds_b = 20, // in DMAD_t -> control
8618 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
8619 + DMAD_ds_extToMem0_v = 0,
8620 + DMAD_ds_memToExt0_v = 1,
8621 + DMAD_ds_extToMem1_v = 0,
8622 + DMAD_ds_memToExt1_v = 1,
8623 + DMAD_ds_ethRcv0_v = 0,
8624 + DMAD_ds_ethXmt0_v = 0,
8625 + DMAD_ds_ethRcv1_v = 0,
8626 + DMAD_ds_ethXmt2_v = 0,
8627 + DMAD_ds_memToFifo_v = 0,
8628 + DMAD_ds_fifoToMem_v = 0,
8629 + DMAD_ds_rng_de_v = 1,//randomNumberGenerator on LC/DE
8630 + DMAD_ds_pciToMem_v = 0,
8631 + DMAD_ds_memToPci_v = 0,
8632 + DMAD_ds_securityInput_v = 0,
8633 + DMAD_ds_securityOutput_v = 0,
8634 + DMAD_ds_rng_se_v = 0,//randomNumberGenerator on SE
8636 + DMAD_devcmd_b = 22, // in DMAD_t -> control
8637 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
8638 + DMAD_devcmd_byte_v = 0, //memory-to-memory
8639 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
8640 + DMAD_devcmd_word_v = 2, //memory-to-memory
8641 + DMAD_devcmd_2words_v = 3, //memory-to-memory
8642 + DMAD_devcmd_4words_v = 4, //memory-to-memory
8643 + DMAD_devcmd_6words_v = 5, //memory-to-memory
8644 + DMAD_devcmd_8words_v = 6, //memory-to-memory
8645 + DMAD_devcmd_16words_v = 7, //memory-to-memory
8646 + DMAD_cof_b = 25, // chain on finished
8647 + DMAD_cof_m = 0x02000000, //
8648 + DMAD_cod_b = 26, // chain on done
8649 + DMAD_cod_m = 0x04000000, //
8650 + DMAD_iof_b = 27, // interrupt on finished
8651 + DMAD_iof_m = 0x08000000, //
8652 + DMAD_iod_b = 28, // interrupt on done
8653 + DMAD_iod_m = 0x10000000, //
8654 + DMAD_t_b = 29, // terminated
8655 + DMAD_t_m = 0x20000000, //
8656 + DMAD_d_b = 30, // done
8657 + DMAD_d_m = 0x40000000, //
8658 + DMAD_f_b = 31, // finished
8659 + DMAD_f_m = 0x80000000, //
8663 + * DMA register (within Internal Register Map).
8668 + u32 dmac ; // Control.
8669 + u32 dmas ; // Status.
8670 + u32 dmasm ; // Mask.
8671 + u32 dmadptr ; // Descriptor pointer.
8672 + u32 dmandptr ; // Next descriptor pointer.
8675 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
8677 +//DMA_Channels use DMACH_count instead
8681 + DMAC_run_b = 0, //
8682 + DMAC_run_m = 0x00000001, //
8683 + DMAC_dm_b = 1, // done mask
8684 + DMAC_dm_m = 0x00000002, //
8685 + DMAC_mode_b = 2, //
8686 + DMAC_mode_m = 0x0000000c, //
8687 + DMAC_mode_auto_v = 0,
8688 + DMAC_mode_burst_v = 1,
8689 + DMAC_mode_transfer_v = 2, //usually used
8690 + DMAC_mode_reserved_v = 3,
8692 + DMAC_a_m = 0x00000010, //
8694 + DMAS_f_b = 0, // finished (sticky)
8695 + DMAS_f_m = 0x00000001, //
8696 + DMAS_d_b = 1, // done (sticky)
8697 + DMAS_d_m = 0x00000002, //
8698 + DMAS_c_b = 2, // chain (sticky)
8699 + DMAS_c_m = 0x00000004, //
8700 + DMAS_e_b = 3, // error (sticky)
8701 + DMAS_e_m = 0x00000008, //
8702 + DMAS_h_b = 4, // halt (sticky)
8703 + DMAS_h_m = 0x00000010, //
8705 + DMASM_f_b = 0, // finished (1=mask)
8706 + DMASM_f_m = 0x00000001, //
8707 + DMASM_d_b = 1, // done (1=mask)
8708 + DMASM_d_m = 0x00000002, //
8709 + DMASM_c_b = 2, // chain (1=mask)
8710 + DMASM_c_m = 0x00000004, //
8711 + DMASM_e_b = 3, // error (1=mask)
8712 + DMASM_e_m = 0x00000008, //
8713 + DMASM_h_b = 4, // halt (1=mask)
8714 + DMASM_h_m = 0x00000010, //
8718 + * DMA channel definitions
8723 + DMACH_extToMem0 = 0,
8724 + DMACH_memToExt0 = 0,
8725 + DMACH_extToMem1 = 1,
8726 + DMACH_memToExt1 = 1,
8727 + DMACH_ethRcv0 = 2,
8728 + DMACH_ethXmt0 = 3,
8729 + DMACH_ethRcv1 = 4,
8730 + DMACH_ethXmt2 = 5,
8731 + DMACH_memToFifo = 6,
8732 + DMACH_fifoToMem = 7,
8733 + DMACH_rng_de = 7,//randomNumberGenerator on LC/DE
8734 + DMACH_pciToMem = 8,
8735 + DMACH_memToPci = 9,
8736 + DMACH_securityInput = 10,
8737 + DMACH_securityOutput = 11,
8738 + DMACH_rng_se = 12, //randomNumberGenerator on SE
8740 + DMACH_count //must be last
8744 +typedef struct DMAC_s
8746 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
8747 +} volatile *DMA_t ;
8751 + * External DMA parameters
8756 + DMADEVCMD_ts_b = 0, // ts field in devcmd
8757 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
8758 + DMADEVCMD_ts_byte_v = 0,
8759 + DMADEVCMD_ts_halfword_v = 1,
8760 + DMADEVCMD_ts_word_v = 2,
8761 + DMADEVCMD_ts_2word_v = 3,
8762 + DMADEVCMD_ts_4word_v = 4,
8763 + DMADEVCMD_ts_6word_v = 5,
8764 + DMADEVCMD_ts_8word_v = 6,
8765 + DMADEVCMD_ts_16word_v = 7
8769 +#if 1 // aws - Compatibility.
8770 +# define EXTDMA_ts_b DMADEVCMD_ts_b
8771 +# define EXTDMA_ts_m DMADEVCMD_ts_m
8772 +# define EXTDMA_ts_byte_v DMADEVCMD_ts_byte_v
8773 +# define EXTDMA_ts_halfword_v DMADEVCMD_ts_halfword_v
8774 +# define EXTDMA_ts_word_v DMADEVCMD_ts_word_v
8775 +# define EXTDMA_ts_2word_v DMADEVCMD_ts_2word_v
8776 +# define EXTDMA_ts_4word_v DMADEVCMD_ts_4word_v
8777 +# define EXTDMA_ts_6word_v DMADEVCMD_ts_6word_v
8778 +# define EXTDMA_ts_8word_v DMADEVCMD_ts_8word_v
8779 +# define EXTDMA_ts_16word_v DMADEVCMD_ts_16word_v
8780 +#endif // aws - Compatibility.
8782 +#endif //__IDT_RC32438_DMA_H__
8783 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
8784 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h 1970-01-01 01:00:00.000000000 +0100
8785 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h 2006-06-18 12:44:28.000000000 +0200
8787 +/**************************************************************************
8789 + * BRIEF MODULE DESCRIPTION
8790 + * DMA operations for IDT RC32438.
8792 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8794 + * This program is free software; you can redistribute it and/or modify it
8795 + * under the terms of the GNU General Public License as published by the
8796 + * Free Software Foundation; either version 2 of the License, or (at your
8797 + * option) any later version.
8799 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8800 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8801 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8802 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8803 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8804 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8805 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8806 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8807 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8808 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8810 + * You should have received a copy of the GNU General Public License along
8811 + * with this program; if not, write to the Free Software Foundation, Inc.,
8812 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8815 + **************************************************************************
8816 + * May 2004 P. Sadik.
8822 + **************************************************************************
8825 +#ifndef __IDT_RC32438_DMA_V_H__
8826 +#define __IDT_RC32438_DMA_V_H__
8827 +#include <asm/idt-boards/rc32438/rc32438_dma.h>
8829 +#define DMA_CHAN_OFFSET 0x14
8830 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
8831 +#define DMA_COUNT(count) \
8832 + ((count) & DMAD_count_m)
8834 +#define DMA_HALT_TIMEOUT 500
8837 +static inline int rc32438_halt_dma(DMA_Chan_t ch)
8840 + if (rc32438_readl(&ch->dmac) & DMAC_run_m) {
8841 + rc32438_writel(0, &ch->dmac);
8843 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
8844 + if (rc32438_readl(&ch->dmas) & DMAS_h_m) {
8845 + rc32438_writel(0, &ch->dmas);
8852 + return timeout ? 0 : 1;
8858 +static inline void rc32438_start_dma(DMA_Chan_t ch, u32 dma_addr)
8860 + rc32438_writel(0, &ch->dmandptr);
8861 + rc32438_writel(dma_addr, &ch->dmadptr);
8864 +static inline void rc32438_chain_dma(DMA_Chan_t ch, u32 dma_addr)
8866 + rc32438_writel(dma_addr, &ch->dmandptr);
8868 +#endif //__IDT_RC32438_DMA_V_H__
8869 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
8870 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_eth.h 1970-01-01 01:00:00.000000000 +0100
8871 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_eth.h 2006-06-18 12:44:28.000000000 +0200
8873 +/**************************************************************************
8875 + * BRIEF MODULE DESCRIPTION
8876 + * Definitions for IDT EB438 ethernet
8878 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8880 + * This program is free software; you can redistribute it and/or modify it
8881 + * under the terms of the GNU General Public License as published by the
8882 + * Free Software Foundation; either version 2 of the License, or (at your
8883 + * option) any later version.
8885 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8886 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8887 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8888 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8889 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8890 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8891 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8892 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8893 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8894 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8896 + * You should have received a copy of the GNU General Public License along
8897 + * with this program; if not, write to the Free Software Foundation, Inc.,
8898 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8901 + **************************************************************************
8902 + * May 2004 P. Sadik.
8908 + **************************************************************************
8911 +#ifndef __IDT_RC32438_ETH_H__
8912 +#define __IDT_RC32438_ETH_H__
8915 + ETH0_PhysicalAddress = 0x18058000,
8916 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
8918 + ETH0_VirtualAddress = 0xb8058000,
8919 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
8920 + ETH1_PhysicalAddress = 0x18060000,
8921 + ETH1_VirtualAddress = 0xb8060000, // Default
8931 + u32 ethu0 [4] ; // Reserved.
8934 + u32 eth_u1 [10] ; // Reserved.
8936 + u32 eth_u2 [42] ; // Reserved.
8951 + u32 eth_u9 [50] ; // Reserved.
8958 + u32 eth_u10 ; // Reserved.
8966 + u32 eth_u11 ; // Reserved.
8967 + u32 eth_u12 ; // Reserved.
8975 + ETHINTFC_en_b = 0,
8976 + ETHINTFC_en_m = 0x00000001,
8977 + ETHINTFC_its_b = 1,
8978 + ETHINTFC_its_m = 0x00000002,
8979 + ETHINTFC_rip_b = 2,
8980 + ETHINTFC_rip_m = 0x00000004,
8981 + ETHINTFC_jam_b = 3,
8982 + ETHINTFC_jam_m = 0x00000008,
8983 + ETHINTFC_ovr_b = 4,
8984 + ETHINTFC_ovr_m = 0x00000010,
8985 + ETHINTFC_und_b = 5,
8986 + ETHINTFC_und_m = 0x00000020,
8988 + ETHFIFOTT_tth_b = 0,
8989 + ETHFIFOTT_tth_m = 0x0000007f,
8992 + ETHARC_pro_m = 0x00000001,
8994 + ETHARC_am_m = 0x00000002,
8996 + ETHARC_afm_m = 0x00000004,
8998 + ETHARC_ab_m = 0x00000008,
9000 + ETHSAL_byte5_b = 0,
9001 + ETHSAL_byte5_m = 0x000000ff,
9002 + ETHSAL_byte4_b = 8,
9003 + ETHSAL_byte4_m = 0x0000ff00,
9004 + ETHSAL_byte3_b = 16,
9005 + ETHSAL_byte3_m = 0x00ff0000,
9006 + ETHSAL_byte2_b = 24,
9007 + ETHSAL_byte2_m = 0xff000000,
9009 + ETHSAH_byte1_b = 0,
9010 + ETHSAH_byte1_m = 0x000000ff,
9011 + ETHSAH_byte0_b = 8,
9012 + ETHSAH_byte0_m = 0x0000ff00,
9015 + ETHGPF_ptv_m = 0x0000ffff,
9018 + ETHPFS_pfd_m = 0x00000001,
9020 + ETHCFSA0_cfsa4_b = 0,
9021 + ETHCFSA0_cfsa4_m = 0x000000ff,
9022 + ETHCFSA0_cfsa5_b = 8,
9023 + ETHCFSA0_cfsa5_m = 0x0000ff00,
9025 + ETHCFSA1_cfsa2_b = 0,
9026 + ETHCFSA1_cfsa2_m = 0x000000ff,
9027 + ETHCFSA1_cfsa3_b = 8,
9028 + ETHCFSA1_cfsa3_m = 0x0000ff00,
9030 + ETHCFSA2_cfsa0_b = 0,
9031 + ETHCFSA2_cfsa0_m = 0x000000ff,
9032 + ETHCFSA2_cfsa1_b = 8,
9033 + ETHCFSA2_cfsa1_m = 0x0000ff00,
9036 + ETHMAC1_re_m = 0x00000001,
9037 + ETHMAC1_paf_b = 1,
9038 + ETHMAC1_paf_m = 0x00000002,
9039 + ETHMAC1_rfc_b = 2,
9040 + ETHMAC1_rfc_m = 0x00000004,
9041 + ETHMAC1_tfc_b = 3,
9042 + ETHMAC1_tfc_m = 0x00000008,
9044 + ETHMAC1_lb_m = 0x00000010,
9045 + ETHMAC1_mr_b = 31,
9046 + ETHMAC1_mr_m = 0x80000000,
9049 + ETHMAC2_fd_m = 0x00000001,
9050 + ETHMAC2_flc_b = 1,
9051 + ETHMAC2_flc_m = 0x00000002,
9052 + ETHMAC2_hfe_b = 2,
9053 + ETHMAC2_hfe_m = 0x00000004,
9055 + ETHMAC2_dc_m = 0x00000008,
9056 + ETHMAC2_cen_b = 4,
9057 + ETHMAC2_cen_m = 0x00000010,
9059 + ETHMAC2_pe_m = 0x00000020,
9060 + ETHMAC2_vpe_b = 6,
9061 + ETHMAC2_vpe_m = 0x00000040,
9062 + ETHMAC2_ape_b = 7,
9063 + ETHMAC2_ape_m = 0x00000080,
9064 + ETHMAC2_ppe_b = 8,
9065 + ETHMAC2_ppe_m = 0x00000100,
9066 + ETHMAC2_lpe_b = 9,
9067 + ETHMAC2_lpe_m = 0x00000200,
9068 + ETHMAC2_nb_b = 12,
9069 + ETHMAC2_nb_m = 0x00001000,
9070 + ETHMAC2_bp_b = 13,
9071 + ETHMAC2_bp_m = 0x00002000,
9072 + ETHMAC2_ed_b = 14,
9073 + ETHMAC2_ed_m = 0x00004000,
9075 + ETHIPGT_ipgt_b = 0,
9076 + ETHIPGT_ipgt_m = 0x0000007f,
9078 + ETHIPGR_ipgr2_b = 0,
9079 + ETHIPGR_ipgr2_m = 0x0000007f,
9080 + ETHIPGR_ipgr1_b = 8,
9081 + ETHIPGR_ipgr1_m = 0x00007f00,
9083 + ETHCLRT_maxret_b = 0,
9084 + ETHCLRT_maxret_m = 0x0000000f,
9085 + ETHCLRT_colwin_b = 8,
9086 + ETHCLRT_colwin_m = 0x00003f00,
9088 + ETHMAXF_maxf_b = 0,
9089 + ETHMAXF_maxf_m = 0x0000ffff,
9091 + ETHMTEST_tb_b = 2,
9092 + ETHMTEST_tb_m = 0x00000004,
9095 + ETHMCP_div_m = 0x000000ff,
9097 + MIIMCFG_rsv_b = 0,
9098 + MIIMCFG_rsv_m = 0x0000000c,
9101 + MIIMCMD_rd_m = 0x00000001,
9102 + MIIMCMD_scn_b = 1,
9103 + MIIMCMD_scn_m = 0x00000002,
9105 + MIIMADDR_regaddr_b = 0,
9106 + MIIMADDR_regaddr_m = 0x0000001f,
9107 + MIIMADDR_phyaddr_b = 8,
9108 + MIIMADDR_phyaddr_m = 0x00001f00,
9110 + MIIMWTD_wdata_b = 0,
9111 + MIIMWTD_wdata_m = 0x0000ffff,
9113 + MIIMRDD_rdata_b = 0,
9114 + MIIMRDD_rdata_m = 0x0000ffff,
9116 + MIIMIND_bsy_b = 0,
9117 + MIIMIND_bsy_m = 0x00000001,
9118 + MIIMIND_scn_b = 1,
9119 + MIIMIND_scn_m = 0x00000002,
9121 + MIIMIND_nv_m = 0x00000004,
9126 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
9131 + ETHRX_fd_m = 0x00000001,
9133 + ETHRX_ld_m = 0x00000002,
9135 + ETHRX_rok_m = 0x00000004,
9137 + ETHRX_fm_m = 0x00000008,
9139 + ETHRX_mp_m = 0x00000010,
9141 + ETHRX_bp_m = 0x00000020,
9143 + ETHRX_vlt_m = 0x00000040,
9145 + ETHRX_cf_m = 0x00000080,
9147 + ETHRX_ovr_m = 0x00000100,
9149 + ETHRX_crc_m = 0x00000200,
9151 + ETHRX_cv_m = 0x00000400,
9153 + ETHRX_db_m = 0x00000800,
9155 + ETHRX_le_m = 0x00001000,
9157 + ETHRX_lor_m = 0x00002000,
9159 + ETHRX_ces_m = 0x00004000,
9160 + ETHRX_length_b = 16,
9161 + ETHRX_length_m = 0xffff0000,
9164 + ETHTX_fd_m = 0x00000001,
9166 + ETHTX_ld_m = 0x00000002,
9168 + ETHTX_oen_m = 0x00000004,
9170 + ETHTX_pen_m = 0x00000008,
9172 + ETHTX_cen_m = 0x00000010,
9174 + ETHTX_hen_m = 0x00000020,
9176 + ETHTX_tok_m = 0x00000040,
9178 + ETHTX_mp_m = 0x00000080,
9180 + ETHTX_bp_m = 0x00000100,
9182 + ETHTX_und_m = 0x00000200,
9184 + ETHTX_of_m = 0x00000400,
9186 + ETHTX_ed_m = 0x00000800,
9188 + ETHTX_ec_m = 0x00001000,
9190 + ETHTX_lc_m = 0x00002000,
9192 + ETHTX_td_m = 0x00004000,
9194 + ETHTX_crc_m = 0x00008000,
9196 + ETHTX_le_m = 0x00010000,
9198 + ETHTX_cc_m = 0x001E0000,
9200 +#endif //__IDT_RC32438_ETH_H__
9201 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
9202 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h 1970-01-01 01:00:00.000000000 +0100
9203 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h 2006-06-18 12:44:28.000000000 +0200
9205 +/**************************************************************************
9207 + * BRIEF MODULE DESCRIPTION
9208 + * macros for IDT EB438 ethernet
9210 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9212 + * This program is free software; you can redistribute it and/or modify it
9213 + * under the terms of the GNU General Public License as published by the
9214 + * Free Software Foundation; either version 2 of the License, or (at your
9215 + * option) any later version.
9217 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9218 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9219 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9220 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9221 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9222 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9223 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9224 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9225 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9226 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9228 + * You should have received a copy of the GNU General Public License along
9229 + * with this program; if not, write to the Free Software Foundation, Inc.,
9230 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9233 + **************************************************************************
9234 + * May 2004 P. Sadik.
9240 + **************************************************************************
9243 +#ifndef __IDT_RC32438_ETH_V_H__
9244 +#define __IDT_RC32438_ETH_V_H__
9245 +#include <asm/idt-boards/rc32438/rc32438_eth.h>
9247 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
9248 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
9249 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
9250 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
9251 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
9252 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
9253 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
9254 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
9255 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
9256 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
9257 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
9259 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
9261 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
9262 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
9263 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
9264 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
9265 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
9266 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
9267 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
9268 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
9269 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
9270 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
9271 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
9272 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
9273 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
9274 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
9276 +#endif //__IDT_RC32438_ETH_V_H__
9277 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
9278 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h 1970-01-01 01:00:00.000000000 +0100
9279 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h 2006-06-18 12:44:28.000000000 +0200
9281 +/**************************************************************************
9283 + * BRIEF MODULE DESCRIPTION
9284 + * Definitions for IDT RC32438 GPIO.
9286 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9288 + * This program is free software; you can redistribute it and/or modify it
9289 + * under the terms of the GNU General Public License as published by the
9290 + * Free Software Foundation; either version 2 of the License, or (at your
9291 + * option) any later version.
9293 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9294 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9295 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9296 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9297 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9298 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9299 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9300 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9301 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9302 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9304 + * You should have received a copy of the GNU General Public License along
9305 + * with this program; if not, write to the Free Software Foundation, Inc.,
9306 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9309 + **************************************************************************
9310 + * May 2004 P. Sadik.
9316 + **************************************************************************
9318 +#ifndef __IDT_RC32438_GPIO_H__
9319 +#define __IDT_RC32438_GPIO_H__
9322 + GPIO0_PhysicalAddress = 0x18048000,
9323 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
9325 + GPIO0_VirtualAddress = 0xb8048000,
9326 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
9331 + u32 gpiofunc; /* GPIO Function Register
9332 + * gpiofunc[x]==0 bit = gpio
9333 + * func[x]==1 bit = altfunc
9335 + u32 gpiocfg; /* GPIO Configuration Register
9336 + * gpiocfg[x]==0 bit = input
9337 + * gpiocfg[x]==1 bit = output
9339 + u32 gpiod; /* GPIO Data Register
9340 + * gpiod[x] read/write gpio pinX status
9342 + u32 gpioilevel; /* GPIO Interrupt Status Register
9343 + * interrupt level (see gpioistat)
9345 + u32 gpioistat; /* Gpio Interrupt Status Register
9346 + * istat[x] = (gpiod[x] == level[x])
9347 + * cleared in ISR (STICKY bits)
9349 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
9350 +} volatile * GPIO_t ;
9354 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
9355 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
9356 + GPIO_input_v = 0, // gpiocfg use pin as input.
9357 + GPIO_output_v = 1, // gpiocfg use pin as output.
9359 + GPIO_pin0_m = 0x00000001,
9361 + GPIO_pin1_m = 0x00000002,
9363 + GPIO_pin2_m = 0x00000004,
9365 + GPIO_pin3_m = 0x00000008,
9367 + GPIO_pin4_m = 0x00000010,
9369 + GPIO_pin5_m = 0x00000020,
9371 + GPIO_pin6_m = 0x00000040,
9373 + GPIO_pin7_m = 0x00000080,
9375 + GPIO_pin8_m = 0x00000100,
9377 + GPIO_pin9_m = 0x00000200,
9378 + GPIO_pin10_b = 10,
9379 + GPIO_pin10_m = 0x00000400,
9380 + GPIO_pin11_b = 11,
9381 + GPIO_pin11_m = 0x00000800,
9382 + GPIO_pin12_b = 12,
9383 + GPIO_pin12_m = 0x00001000,
9384 + GPIO_pin13_b = 13,
9385 + GPIO_pin13_m = 0x00002000,
9386 + GPIO_pin14_b = 14,
9387 + GPIO_pin14_m = 0x00004000,
9388 + GPIO_pin15_b = 15,
9389 + GPIO_pin15_m = 0x00008000,
9390 + GPIO_pin16_b = 16,
9391 + GPIO_pin16_m = 0x00010000,
9392 + GPIO_pin17_b = 17,
9393 + GPIO_pin17_m = 0x00020000,
9394 + GPIO_pin18_b = 18,
9395 + GPIO_pin18_m = 0x00040000,
9396 + GPIO_pin19_b = 19,
9397 + GPIO_pin19_m = 0x00080000,
9398 + GPIO_pin20_b = 20,
9399 + GPIO_pin20_m = 0x00100000,
9400 + GPIO_pin21_b = 21,
9401 + GPIO_pin21_m = 0x00200000,
9402 + GPIO_pin22_b = 22,
9403 + GPIO_pin22_m = 0x00400000,
9404 + GPIO_pin23_b = 23,
9405 + GPIO_pin23_m = 0x00800000,
9406 + GPIO_pin24_b = 24,
9407 + GPIO_pin24_m = 0x01000000,
9408 + GPIO_pin25_b = 25,
9409 + GPIO_pin25_m = 0x02000000,
9410 + GPIO_pin26_b = 26,
9411 + GPIO_pin26_m = 0x04000000,
9412 + GPIO_pin27_b = 27,
9413 + GPIO_pin27_m = 0x08000000,
9414 + GPIO_pin28_b = 28,
9415 + GPIO_pin28_m = 0x10000000,
9416 + GPIO_pin29_b = 29,
9417 + GPIO_pin29_m = 0x20000000,
9418 + GPIO_pin30_b = 30,
9419 + GPIO_pin30_m = 0x40000000,
9420 + GPIO_pin31_b = 31,
9421 + GPIO_pin31_m = 0x80000000,
9423 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
9425 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
9426 + GPIO_u0sout_m = GPIO_pin0_m,
9427 + GPIO_u0sout_cfg_v = GPIO_output_v,
9428 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
9429 + GPIO_u0sinp_m = GPIO_pin1_m,
9430 + GPIO_u0sinp_cfg_v = GPIO_input_v,
9431 + GPIO_u0rin_b = GPIO_pin2_b, // UART 0 ring indic.
9432 + GPIO_u0rin_m = GPIO_pin2_m,
9433 + GPIO_u0rin_cfg_v = GPIO_input_v,
9434 + GPIO_u0dcdn_b = GPIO_pin3_b, // UART 0 data carr.det.
9435 + GPIO_u0dcdn_m = GPIO_pin3_m,
9436 + GPIO_u0dcdn_cfg_v = GPIO_input_v,
9437 + GPIO_u0dtrn_b = GPIO_pin4_b, // UART 0 data term rdy.
9438 + GPIO_u0dtrn_m = GPIO_pin4_m,
9439 + GPIO_u0dtrn_cfg_v = GPIO_output_v,
9440 + GPIO_u0dsrn_b = GPIO_pin5_b, // UART 0 data set rdy.
9441 + GPIO_u0dsrn_m = GPIO_pin5_m,
9442 + GPIO_u0dsrn_cfg_v = GPIO_input_v,
9443 + GPIO_u0rtsn_b = GPIO_pin6_b, // UART 0 req. to send.
9444 + GPIO_u0rtsn_m = GPIO_pin6_m,
9445 + GPIO_u0rtsn_cfg_v = GPIO_output_v,
9446 + GPIO_u0ctsn_b = GPIO_pin7_b, // UART 0 clear to send.
9447 + GPIO_u0ctsn_m = GPIO_pin7_m,
9448 + GPIO_u0ctsn_cfg_v = GPIO_input_v,
9450 + GPIO_u1sout_b = GPIO_pin8_b, // UART 1 serial out.
9451 + GPIO_u1sout_m = GPIO_pin8_m,
9452 + GPIO_u1sout_cfg_v = GPIO_output_v,
9453 + GPIO_u1sinp_b = GPIO_pin9_b, // UART 1 serial in.
9454 + GPIO_u1sinp_m = GPIO_pin9_m,
9455 + GPIO_u1sinp_cfg_v = GPIO_input_v,
9456 + GPIO_u1dtrn_b = GPIO_pin10_b, // UART 1 data term rdy.
9457 + GPIO_u1dtrn_m = GPIO_pin10_m,
9458 + GPIO_u1dtrn_cfg_v = GPIO_output_v,
9459 + GPIO_u1dsrn_b = GPIO_pin11_b, // UART 1 data set rdy.
9460 + GPIO_u1dsrn_m = GPIO_pin11_m,
9461 + GPIO_u1dsrn_cfg_v = GPIO_input_v,
9462 + GPIO_u1rtsn_b = GPIO_pin12_b, // UART 1 req. to send.
9463 + GPIO_u1rtsn_m = GPIO_pin12_m,
9464 + GPIO_u1rtsn_cfg_v = GPIO_output_v,
9465 + GPIO_u1ctsn_b = GPIO_pin13_b, // UART 1 clear to send.
9466 + GPIO_u1ctsn_m = GPIO_pin13_m,
9467 + GPIO_u1ctsn_cfg_v = GPIO_input_v,
9469 + GPIO_dmareqn0_b = GPIO_pin14_b, // Ext. DMA 0 request
9470 + GPIO_dmareqn0_m = GPIO_pin14_m,
9471 + GPIO_dmareqn0_cfg_v = GPIO_input_v,
9473 + GPIO_dmareqn1_b = GPIO_pin15_b, // Ext. DMA 1 request
9474 + GPIO_dmareqn1_m = GPIO_pin15_m,
9475 + GPIO_dmareqn1_cfg_v = GPIO_input_v,
9477 + GPIO_dmadonen0_b = GPIO_pin16_b, // Ext. DMA 0 done
9478 + GPIO_dmadonen0_m = GPIO_pin16_m,
9479 + GPIO_dmadonen0_cfg_v = GPIO_input_v,
9481 + GPIO_dmadonen1_b = GPIO_pin17_b, // Ext. DMA 1 done
9482 + GPIO_dmadonen1_m = GPIO_pin17_m,
9483 + GPIO_dmadonen1_cfg_v = GPIO_input_v,
9485 + GPIO_dmafinn0_b = GPIO_pin18_b, // Ext. DMA 0 finished
9486 + GPIO_dmafinn0_m = GPIO_pin18_m,
9487 + GPIO_dmafinn0_cfg_v = GPIO_output_v,
9489 + GPIO_dmafinn1_b = GPIO_pin19_b, // Ext. DMA 1 finished
9490 + GPIO_dmafinn1_m = GPIO_pin19_m,
9491 + GPIO_dmafinn1_cfg_v = GPIO_output_v,
9493 + GPIO_maddr22_b = GPIO_pin20_b, // M&P bus bit 22.
9494 + GPIO_maddr22_m = GPIO_pin20_m,
9495 + GPIO_maddr22_cfg_v = GPIO_output_v,
9497 + GPIO_maddr23_b = GPIO_pin21_b, // M&P bus bit 23.
9498 + GPIO_maddr23_m = GPIO_pin21_m,
9499 + GPIO_maddr23_cfg_v = GPIO_output_v,
9501 + GPIO_maddr24_b = GPIO_pin22_b, // M&P bus bit 24.
9502 + GPIO_maddr24_m = GPIO_pin22_m,
9503 + GPIO_maddr24_cfg_v = GPIO_output_v,
9505 + GPIO_maddr25_b = GPIO_pin23_b, // M&P bus bit 25.
9506 + GPIO_maddr25_m = GPIO_pin23_m,
9507 + GPIO_maddr25_cfg_v = GPIO_output_v,
9509 + GPIO_afspare6_b = GPIO_pin24_b, // reserved.
9510 + GPIO_afspare6_m = GPIO_pin24_m,
9511 + GPIO_afspare6_cfg_v = GPIO_input_v,
9512 + GPIO_afspare5_b = GPIO_pin25_b, // reserved.
9513 + GPIO_afspare5_m = GPIO_pin25_m,
9514 + GPIO_afspare5_cfg_v = GPIO_input_v,
9515 + GPIO_afspare4_b = GPIO_pin26_b, // reserved.
9516 + GPIO_afspare4_m = GPIO_pin26_m,
9517 + GPIO_afspare4_cfg_v = GPIO_input_v,
9518 + GPIO_afspare3_b = GPIO_pin27_b, // reserved.
9519 + GPIO_afspare3_m = GPIO_pin27_m,
9520 + GPIO_afspare3_cfg_v = GPIO_input_v,
9521 + GPIO_afspare2_b = GPIO_pin28_b, // reserved.
9522 + GPIO_afspare2_m = GPIO_pin28_m,
9523 + GPIO_afspare2_cfg_v = GPIO_input_v,
9524 + GPIO_afspare1_b = GPIO_pin29_b, // reserved.
9525 + GPIO_afspare1_m = GPIO_pin29_m,
9526 + GPIO_afspare1_cfg_v = GPIO_input_v,
9528 + GPIO_pcimuintn_b = GPIO_pin30_b, // PCI messaging int.
9529 + GPIO_pcimuintn_m = GPIO_pin30_m,
9530 + GPIO_pcimuintn_cfg_v = GPIO_output_v,
9532 + GPIO_rngclk_b = GPIO_pin31_b, // RNG external clock
9533 + GPIO_rngclk_m = GPIO_pin31_m,
9534 + GPIO_rncclk_cfg_v = GPIO_input_v,
9537 +#endif //__IDT_RC32438_GPIO_H__
9538 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
9539 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438.h 1970-01-01 01:00:00.000000000 +0100
9540 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438.h 2006-06-18 12:44:28.000000000 +0200
9542 +/**************************************************************************
9544 + * BRIEF MODULE DESCRIPTION
9545 + * Definitions for IDT RC32438 CPU.
9547 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9549 + * This program is free software; you can redistribute it and/or modify it
9550 + * under the terms of the GNU General Public License as published by the
9551 + * Free Software Foundation; either version 2 of the License, or (at your
9552 + * option) any later version.
9554 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9555 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9556 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9557 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9558 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9559 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9560 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9561 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9562 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9563 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9565 + * You should have received a copy of the GNU General Public License along
9566 + * with this program; if not, write to the Free Software Foundation, Inc.,
9567 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9570 + **************************************************************************
9571 + * May 2004 P. Sadik.
9577 + **************************************************************************
9580 +#ifndef __IDT_RC32438_H__
9581 +#define __IDT_RC32438_H__
9582 +#include <linux/autoconf.h>
9583 +#include <linux/delay.h>
9584 +#include <asm/io.h>
9585 +#include <asm/idt-boards/rc32438/rc32438_timer.h>
9587 +#define RC32438_REG_BASE 0x18000000
9589 +#define interrupt ((volatile INT_t ) INT0_VirtualAddress)
9590 +#define idttimer ((volatile TIM_t) TIM0_VirtualAddress)
9591 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
9593 +#define IDT_CLOCK_MULT 2
9594 +#define MIPS_CPU_TIMER_IRQ 7
9595 +/* Interrupt Controller */
9596 +#define IC_GROUP0_PEND (RC32438_REG_BASE + 0x38000)
9597 +#define IC_GROUP0_MASK (RC32438_REG_BASE + 0x38008)
9598 +#define IC_GROUP_OFFSET 0x0C
9599 +#define RTC_BASE 0xAC0801FF0
9601 +#define NUM_INTR_GROUPS 5
9604 +#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
9605 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) /* GRP3 IRQ numbers start here */
9606 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) /* GRP4 IRQ numbers start here */
9607 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) /* GRP5 IRQ numbers start here */
9608 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
9611 +#define RC32438_UART0_BASE (RC32438_REG_BASE + 0x50003)
9612 +#define RC32438_UART1_BASE (RC32438_REG_BASE + 0x50023)
9614 +#define RC32438_UART0_BASE (RC32438_REG_BASE + 0x50000)
9615 +#define RC32438_UART1_BASE (RC32438_REG_BASE + 0x50020)
9618 +#define RC32438_UART0_IRQ GROUP3_IRQ_BASE + 0
9619 +#define RC32438_UART1_IRQ GROUP3_IRQ_BASE + 3
9621 +#define RC32438_NR_IRQS (GROUP4_IRQ_BASE + 32)
9625 +/* cpu pipeline flush */
9626 +static inline void rc32438_sync(void)
9628 + __asm__ volatile ("sync");
9631 +static inline void rc32438_sync_udelay(int us)
9633 + __asm__ volatile ("sync");
9637 +static inline void rc32438_sync_delay(int ms)
9639 + __asm__ volatile ("sync");
9644 + * Macros to access internal RC32438 registers. No byte
9645 + * swapping should be done when accessing the internal
9649 +#define rc32438_readb __raw_readb
9650 +#define rc32438_readw __raw_readw
9651 +#define rc32438_readl __raw_readl
9653 +#define rc32438_writeb __raw_writeb
9654 +#define rc32438_writew __raw_writew
9655 +#define rc32438_writel __raw_writel
9658 + * C access to CLZ and CLO instructions
9659 + * (count leading zeroes/ones).
9661 +static inline int rc32438_clz(unsigned long val)
9664 + __asm__ volatile (
9665 + ".set\tnoreorder\n\t"
9667 + ".set\tmips32\n\t"
9677 +static inline int rc32438_clo(unsigned long val)
9680 + __asm__ volatile (
9681 + ".set\tnoreorder\n\t"
9683 + ".set\tmips32\n\t"
9693 +#endif //__IDT_RC32438_H__
9694 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
9695 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_pci.h 1970-01-01 01:00:00.000000000 +0100
9696 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_pci.h 2006-06-18 12:44:28.000000000 +0200
9698 +/**************************************************************************
9700 + * BRIEF MODULE DESCRIPTION
9701 + * Definitions for IDT RC32438 PCI.
9703 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9705 + * This program is free software; you can redistribute it and/or modify it
9706 + * under the terms of the GNU General Public License as published by the
9707 + * Free Software Foundation; either version 2 of the License, or (at your
9708 + * option) any later version.
9710 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9711 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9712 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9713 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9714 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9715 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9716 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9717 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9718 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9719 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9721 + * You should have received a copy of the GNU General Public License along
9722 + * with this program; if not, write to the Free Software Foundation, Inc.,
9723 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9726 + **************************************************************************
9727 + * May 2004 P. Sadik
9733 + **************************************************************************
9738 + PCI0_PhysicalAddress = 0x18080000,
9739 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
9741 + PCI0_VirtualAddress = 0xb8080000,
9742 + PCI_VirtualAddress = PCI0_VirtualAddress,
9747 + PCI_LbaCount = 4, // Local base addresses.
9752 + u32 a ; // Address.
9753 + u32 c ; // Control.
9754 + u32 m ; // mapping.
9764 + PCI_Map_s pcilba [PCI_LbaCount] ;
9772 +} volatile *PCI_t ;
9774 +// PCI messaging unit.
9781 + u32 pciim [PCIM_Count] ;
9782 + u32 pciom [PCIM_Count] ;
9789 +} volatile *PCIM_t ;
9791 +/*******************************************************************************
9793 + * PCI Control Register
9795 + ******************************************************************************/
9799 + PCIC_en_m = 0x00000001,
9801 + PCIC_tnr_m = 0x00000002,
9803 + PCIC_sce_m = 0x00000004,
9805 + PCIC_ien_m = 0x00000008,
9807 + PCIC_aaa_m = 0x00000010,
9809 + PCIC_eap_m = 0x00000020,
9811 + PCIC_pcim_m = 0x000001c0,
9812 + PCIC_pcim_disabled_v = 0,
9813 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
9814 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
9815 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
9816 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
9817 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
9818 + PCIC_pcim_reserved6_v = 6,
9819 + PCIC_pcim_reserved7_v = 7,
9821 + PCIC_igm_m = 0x00000200,
9824 +/*******************************************************************************
9826 + * PCI Status Register
9828 + ******************************************************************************/
9831 + PCIS_eed_m = 0x00000001,
9833 + PCIS_wr_m = 0x00000002,
9835 + PCIS_nmi_m = 0x00000004,
9837 + PCIS_ii_m = 0x00000008,
9839 + PCIS_cwe_m = 0x00000010,
9841 + PCIS_cre_m = 0x00000020,
9843 + PCIS_mdpe_m = 0x00000040,
9845 + PCIS_sta_m = 0x00000080,
9847 + PCIS_rta_m = 0x00000100,
9849 + PCIS_rma_m = 0x00000200,
9851 + PCIS_sse_m = 0x00000400,
9853 + PCIS_ose_m = 0x00000800,
9855 + PCIS_pe_m = 0x00001000,
9857 + PCIS_tae_m = 0x00002000,
9859 + PCIS_rle_m = 0x00004000,
9861 + PCIS_bme_m = 0x00008000,
9863 + PCIS_prd_m = 0x00010000,
9865 + PCIS_rip_m = 0x00020000,
9868 +/*******************************************************************************
9870 + * PCI Status Mask Register
9872 + ******************************************************************************/
9875 + PCISM_eed_m = 0x00000001,
9877 + PCISM_wr_m = 0x00000002,
9879 + PCISM_nmi_m = 0x00000004,
9881 + PCISM_ii_m = 0x00000008,
9883 + PCISM_cwe_m = 0x00000010,
9885 + PCISM_cre_m = 0x00000020,
9887 + PCISM_mdpe_m = 0x00000040,
9889 + PCISM_sta_m = 0x00000080,
9891 + PCISM_rta_m = 0x00000100,
9893 + PCISM_rma_m = 0x00000200,
9895 + PCISM_sse_m = 0x00000400,
9897 + PCISM_ose_m = 0x00000800,
9899 + PCISM_pe_m = 0x00001000,
9901 + PCISM_tae_m = 0x00002000,
9903 + PCISM_rle_m = 0x00004000,
9905 + PCISM_bme_m = 0x00008000,
9907 + PCISM_prd_m = 0x00010000,
9909 + PCISM_rip_m = 0x00020000,
9912 +/*******************************************************************************
9914 + * PCI Configuration Address Register
9916 + ******************************************************************************/
9918 + PCICFGA_reg_b = 2,
9919 + PCICFGA_reg_m = 0x000000fc,
9920 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
9921 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
9922 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
9923 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
9924 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
9925 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
9926 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
9927 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
9928 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
9929 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
9930 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
9931 + PCICFGA_reg_pba0m_v = 0x48>>2,
9932 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
9933 + PCICFGA_reg_pba1m_v = 0x50>>2,
9934 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
9935 + PCICFGA_reg_pba2m_v = 0x58>>2,
9936 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
9937 + PCICFGA_reg_pba3m_v = 0x60>>2,
9938 + PCICFGA_reg_pmgt_v = 0x64>>2,
9939 + PCICFGA_func_b = 8,
9940 + PCICFGA_func_m = 0x00000700,
9941 + PCICFGA_dev_b = 11,
9942 + PCICFGA_dev_m = 0x0000f800,
9943 + PCICFGA_dev_internal_v = 0,
9944 + PCICFGA_bus_b = 16,
9945 + PCICFGA_bus_m = 0x00ff0000,
9946 + PCICFGA_bus_type0_v = 0, //local bus
9947 + PCICFGA_en_b = 31, // read only
9948 + PCICFGA_en_m = 0x80000000,
9952 + PCFGID_vendor_b = 0,
9953 + PCFGID_vendor_m = 0x0000ffff,
9954 + PCFGID_vendor_IDT_v = 0x111d,
9955 + PCFGID_device_b = 16,
9956 + PCFGID_device_m = 0xffff0000,
9957 + PCFGID_device_Acaciade_v = 0x0207,
9959 + PCFG04_command_ioena_b = 1,
9960 + PCFG04_command_ioena_m = 0x00000001,
9961 + PCFG04_command_memena_b = 2,
9962 + PCFG04_command_memena_m = 0x00000002,
9963 + PCFG04_command_bmena_b = 3,
9964 + PCFG04_command_bmena_m = 0x00000004,
9965 + PCFG04_command_mwinv_b = 5,
9966 + PCFG04_command_mwinv_m = 0x00000010,
9967 + PCFG04_command_parena_b = 7,
9968 + PCFG04_command_parena_m = 0x00000040,
9969 + PCFG04_command_serrena_b = 9,
9970 + PCFG04_command_serrena_m = 0x00000100,
9971 + PCFG04_command_fastbbena_b = 10,
9972 + PCFG04_command_fastbbena_m = 0x00000200,
9973 + PCFG04_status_b = 16,
9974 + PCFG04_status_m = 0xffff0000,
9975 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
9976 + PCFG04_status_66MHz_m = 0x00200000,
9977 + PCFG04_status_fbb_b = 23,
9978 + PCFG04_status_fbb_m = 0x00800000,
9979 + PCFG04_status_mdpe_b = 24,
9980 + PCFG04_status_mdpe_m = 0x01000000,
9981 + PCFG04_status_dst_b = 25,
9982 + PCFG04_status_dst_m = 0x06000000,
9983 + PCFG04_status_sta_b = 27,
9984 + PCFG04_status_sta_m = 0x08000000,
9985 + PCFG04_status_rta_b = 28,
9986 + PCFG04_status_rta_m = 0x10000000,
9987 + PCFG04_status_rma_b = 29,
9988 + PCFG04_status_rma_m = 0x20000000,
9989 + PCFG04_status_sse_b = 30,
9990 + PCFG04_status_sse_m = 0x40000000,
9991 + PCFG04_status_pe_b = 31,
9992 + PCFG04_status_pe_m = 0x40000000,
9994 + PCFG08_revId_b = 0,
9995 + PCFG08_revId_m = 0x000000ff,
9996 + PCFG08_classCode_b = 0,
9997 + PCFG08_classCode_m = 0xffffff00,
9998 + PCFG08_classCode_bridge_v = 06,
9999 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
10000 + PCFG0C_cacheline_b = 0,
10001 + PCFG0C_cacheline_m = 0x000000ff,
10002 + PCFG0C_masterLatency_b = 8,
10003 + PCFG0C_masterLatency_m = 0x0000ff00,
10004 + PCFG0C_headerType_b = 16,
10005 + PCFG0C_headerType_m = 0x00ff0000,
10006 + PCFG0C_bist_b = 24,
10007 + PCFG0C_bist_m = 0xff000000,
10009 + PCIPBA_msi_b = 0,
10010 + PCIPBA_msi_m = 0x00000001,
10012 + PCIPBA_p_m = 0x00000004,
10013 + PCIPBA_baddr_b = 8,
10014 + PCIPBA_baddr_m = 0xffffff00,
10016 + PCFGSS_vendorId_b = 0,
10017 + PCFGSS_vendorId_m = 0x0000ffff,
10018 + PCFGSS_id_b = 16,
10019 + PCFGSS_id_m = 0xffff0000,
10021 + PCFG3C_interruptLine_b = 0,
10022 + PCFG3C_interruptLine_m = 0x000000ff,
10023 + PCFG3C_interruptPin_b = 8,
10024 + PCFG3C_interruptPin_m = 0x0000ff00,
10025 + PCFG3C_minGrant_b = 16,
10026 + PCFG3C_minGrant_m = 0x00ff0000,
10027 + PCFG3C_maxLat_b = 24,
10028 + PCFG3C_maxLat_m = 0xff000000,
10030 + PCIPBAC_msi_b = 0,
10031 + PCIPBAC_msi_m = 0x00000001,
10033 + PCIPBAC_p_m = 0x00000002,
10034 + PCIPBAC_size_b = 2,
10035 + PCIPBAC_size_m = 0x0000007c,
10036 + PCIPBAC_sb_b = 7,
10037 + PCIPBAC_sb_m = 0x00000080,
10038 + PCIPBAC_pp_b = 8,
10039 + PCIPBAC_pp_m = 0x00000100,
10040 + PCIPBAC_mr_b = 9,
10041 + PCIPBAC_mr_m = 0x00000600,
10042 + PCIPBAC_mr_read_v =0, //no prefetching
10043 + PCIPBAC_mr_readLine_v =1,
10044 + PCIPBAC_mr_readMult_v =2,
10045 + PCIPBAC_mrl_b = 11,
10046 + PCIPBAC_mrl_m = 0x00000800,
10047 + PCIPBAC_mrm_b = 12,
10048 + PCIPBAC_mrm_m = 0x00001000,
10049 + PCIPBAC_trp_b = 13,
10050 + PCIPBAC_trp_m = 0x00002000,
10052 + PCFG40_trdyTimeout_b = 0,
10053 + PCFG40_trdyTimeout_m = 0x000000ff,
10054 + PCFG40_retryLim_b = 8,
10055 + PCFG40_retryLim_m = 0x0000ff00,
10058 +/*******************************************************************************
10060 + * PCI Local Base Address [0|1|2|3] Register
10062 + ******************************************************************************/
10064 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
10065 + PCILBA_baddr_m = 0xffffff00,
10067 +/*******************************************************************************
10069 + * PCI Local Base Address Control Register
10071 + ******************************************************************************/
10073 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
10074 + PCILBAC_msi_m = 0x00000001,
10075 + PCILBAC_msi_mem_v = 0,
10076 + PCILBAC_msi_io_v = 1,
10077 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
10078 + PCILBAC_size_m = 0x0000007c,
10079 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
10080 + PCILBAC_sb_m = 0x00000080,
10081 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
10082 + PCILBAC_rt_m = 0x00000100,
10083 + PCILBAC_rt_noprefetch_v = 0, // mem read
10084 + PCILBAC_rt_prefetch_v = 1, // mem readline
10087 +/*******************************************************************************
10089 + * PCI Local Base Address [0|1|2|3] Mapping Register
10091 + ******************************************************************************/
10093 + PCILBAM_maddr_b = 8,
10094 + PCILBAM_maddr_m = 0xffffff00,
10097 +/*******************************************************************************
10099 + * PCI Decoupled Access Control Register
10101 + ******************************************************************************/
10103 + PCIDAC_den_b = 0,
10104 + PCIDAC_den_m = 0x00000001,
10107 +/*******************************************************************************
10109 + * PCI Decoupled Access Status Register
10111 + ******************************************************************************/
10114 + PCIDAS_d_m = 0x00000001,
10116 + PCIDAS_b_m = 0x00000002,
10118 + PCIDAS_e_m = 0x00000004,
10119 + PCIDAS_ofe_b = 3,
10120 + PCIDAS_ofe_m = 0x00000008,
10121 + PCIDAS_off_b = 4,
10122 + PCIDAS_off_m = 0x00000010,
10123 + PCIDAS_ife_b = 5,
10124 + PCIDAS_ife_m = 0x00000020,
10125 + PCIDAS_iff_b = 6,
10126 + PCIDAS_iff_m = 0x00000040,
10129 +/*******************************************************************************
10131 + * PCI DMA Channel 8 Configuration Register
10133 + ******************************************************************************/
10136 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
10137 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
10138 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
10139 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
10142 +/*******************************************************************************
10144 + * PCI DMA Channel 9 Configuration Register
10146 + ******************************************************************************/
10149 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
10150 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
10153 +/*******************************************************************************
10155 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
10157 + ******************************************************************************/
10159 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
10160 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
10161 + // These are for reads (DMA channel 8)
10162 + PCIDMAD_devcmd_mr_v = 0, //memory read
10163 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
10164 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
10165 + PCIDMAD_devcmd_ior_v = 3, //I/O read
10166 + // These are for writes (DMA channel 9)
10167 + PCIDMAD_devcmd_mw_v = 0, //memory write
10168 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
10169 + PCIDMAD_devcmd_iow_v = 3, //I/O write
10171 + // Swap byte field applies to both DMA channel 8 and 9
10172 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
10173 + PCIDMAD_sb_m = 0x01000000, // swap byte field
10177 +/*******************************************************************************
10179 + * PCI Target Control Register
10181 + ******************************************************************************/
10184 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
10185 + PCITC_rtimer_m = 0x000000ff,
10186 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
10187 + PCITC_dtimer_m = 0x0000ff00,
10188 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
10189 + PCITC_rdr_m = 0x00040000,
10190 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
10191 + PCITC_ddt_m = 0x00080000,
10193 +/*******************************************************************************
10195 + * PCI messaging unit [applies to both inbound and outbound registers ]
10197 + ******************************************************************************/
10200 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10201 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
10202 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10203 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
10204 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10205 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
10208 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
10209 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h 1970-01-01 01:00:00.000000000 +0100
10210 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h 2006-06-18 12:44:28.000000000 +0200
10212 +/**************************************************************************
10214 + * BRIEF MODULE DESCRIPTION
10215 + * Definitions for IDT RC32438 PCI setup.
10217 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10219 + * This program is free software; you can redistribute it and/or modify it
10220 + * under the terms of the GNU General Public License as published by the
10221 + * Free Software Foundation; either version 2 of the License, or (at your
10222 + * option) any later version.
10224 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10225 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10226 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10227 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10228 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10229 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10230 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10231 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10232 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10233 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10235 + * You should have received a copy of the GNU General Public License along
10236 + * with this program; if not, write to the Free Software Foundation, Inc.,
10237 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10240 + **************************************************************************
10241 + * May 2004 P. Sadik
10243 + * Initial Release
10247 + **************************************************************************
10250 +#define PCI_MSG_VirtualAddress 0xB8088010
10251 +#define rc32438_pci ((volatile PCI_t) PCI0_VirtualAddress)
10252 +#define rc32438_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
10254 +#define PCIM_SHFT 0x6
10255 +#define PCIM_BIT_LEN 0x7
10256 +#define PCIM_H_EA 0x3
10257 +#define PCIM_H_IA_FIX 0x4
10258 +#define PCIM_H_IA_RR 0x5
10260 +#define PCI_ADDR_START 0x50000000
10262 +#define CPUTOPCI_MEM_WIN 0x02000000
10263 +#define CPUTOPCI_IO_WIN 0x00100000
10264 +#define PCILBA_SIZE_SHFT 2
10265 +#define PCILBA_SIZE_MASK 0x1F
10266 +#define SIZE_256MB 0x1C
10267 +#define SIZE_128MB 0x1B
10268 +#define SIZE_64MB 0x1A
10269 +#define SIZE_32MB 0x19
10270 +#define SIZE_16MB 0x18
10271 +#define SIZE_4MB 0x16
10272 +#define SIZE_2MB 0x15
10273 +#define SIZE_1MB 0x14
10274 +#define ACACIA_CONFIG0_ADDR 0x80000000
10275 +#define ACACIA_CONFIG1_ADDR 0x80000004
10276 +#define ACACIA_CONFIG2_ADDR 0x80000008
10277 +#define ACACIA_CONFIG3_ADDR 0x8000000C
10278 +#define ACACIA_CONFIG4_ADDR 0x80000010
10279 +#define ACACIA_CONFIG5_ADDR 0x80000014
10280 +#define ACACIA_CONFIG6_ADDR 0x80000018
10281 +#define ACACIA_CONFIG7_ADDR 0x8000001C
10282 +#define ACACIA_CONFIG8_ADDR 0x80000020
10283 +#define ACACIA_CONFIG9_ADDR 0x80000024
10284 +#define ACACIA_CONFIG10_ADDR 0x80000028
10285 +#define ACACIA_CONFIG11_ADDR 0x8000002C
10286 +#define ACACIA_CONFIG12_ADDR 0x80000030
10287 +#define ACACIA_CONFIG13_ADDR 0x80000034
10288 +#define ACACIA_CONFIG14_ADDR 0x80000038
10289 +#define ACACIA_CONFIG15_ADDR 0x8000003C
10290 +#define ACACIA_CONFIG16_ADDR 0x80000040
10291 +#define ACACIA_CONFIG17_ADDR 0x80000044
10292 +#define ACACIA_CONFIG18_ADDR 0x80000048
10293 +#define ACACIA_CONFIG19_ADDR 0x8000004C
10294 +#define ACACIA_CONFIG20_ADDR 0x80000050
10295 +#define ACACIA_CONFIG21_ADDR 0x80000054
10296 +#define ACACIA_CONFIG22_ADDR 0x80000058
10297 +#define ACACIA_CONFIG23_ADDR 0x8000005C
10298 +#define ACACIA_CONFIG24_ADDR 0x80000060
10299 +#define ACACIA_CONFIG25_ADDR 0x80000064
10300 +#define ACACIA_CMD (PCFG04_command_ioena_m | \
10301 + PCFG04_command_memena_m | \
10302 + PCFG04_command_bmena_m | \
10303 + PCFG04_command_mwinv_m | \
10304 + PCFG04_command_parena_m | \
10305 + PCFG04_command_serrena_m )
10307 +#define ACACIA_STAT (PCFG04_status_mdpe_m | \
10308 + PCFG04_status_sta_m | \
10309 + PCFG04_status_rta_m | \
10310 + PCFG04_status_rma_m | \
10311 + PCFG04_status_sse_m | \
10312 + PCFG04_status_pe_m)
10314 +#define ACACIA_CNFG1 ((ACACIA_STAT<<16)|ACACIA_CMD)
10316 +#define ACACIA_REVID 0
10317 +#define ACACIA_CLASS_CODE 0
10318 +#define ACACIA_CNFG2 ((ACACIA_CLASS_CODE<<8) | \
10321 +#define ACACIA_CACHE_LINE_SIZE 4
10322 +#define ACACIA_MASTER_LAT 0x3c
10323 +#define ACACIA_HEADER_TYPE 0
10324 +#define ACACIA_BIST 0
10326 +#define ACACIA_CNFG3 ((ACACIA_BIST << 24) | \
10327 + (ACACIA_HEADER_TYPE<<16) | \
10328 + (ACACIA_MASTER_LAT<<8) | \
10329 + ACACIA_CACHE_LINE_SIZE )
10331 +#define ACACIA_BAR0 0x00000008 /* 128 MB Memory */
10332 +#define ACACIA_BAR1 0x18800001 /* 1 MB IO */
10333 +#define ACACIA_BAR2 0x18000001 /* 2 MB IO window for Acacia
10334 + internal Registers */
10335 +#define ACACIA_BAR3 0x48000008 /* Spare 128 MB Memory */
10337 +#define ACACIA_CNFG4 ACACIA_BAR0
10338 +#define ACACIA_CNFG5 ACACIA_BAR1
10339 +#define ACACIA_CNFG6 ACACIA_BAR2
10340 +#define ACACIA_CNFG7 ACACIA_BAR3
10342 +#define ACACIA_SUBSYS_VENDOR_ID 0
10343 +#define ACACIA_SUBSYSTEM_ID 0
10344 +#define ACACIA_CNFG8 0
10345 +#define ACACIA_CNFG9 0
10346 +#define ACACIA_CNFG10 0
10347 +#define ACACIA_CNFG11 ((ACACIA_SUBSYS_VENDOR_ID<<16) | \
10348 + ACACIA_SUBSYSTEM_ID)
10349 +#define ACACIA_INT_LINE 1
10350 +#define ACACIA_INT_PIN 1
10351 +#define ACACIA_MIN_GNT 8
10352 +#define ACACIA_MAX_LAT 0x38
10353 +#define ACACIA_CNFG12 0
10354 +#define ACACIA_CNFG13 0
10355 +#define ACACIA_CNFG14 0
10356 +#define ACACIA_CNFG15 ((ACACIA_MAX_LAT<<24) | \
10357 + (ACACIA_MIN_GNT<<16) | \
10358 + (ACACIA_INT_PIN<<8) | \
10360 +#define ACACIA_RETRY_LIMIT 0x80
10361 +#define ACACIA_TRDY_LIMIT 0x80
10362 +#define ACACIA_CNFG16 ((ACACIA_RETRY_LIMIT<<8) | \
10363 + ACACIA_TRDY_LIMIT)
10364 +#define PCI_PBAxC_R 0x0
10365 +#define PCI_PBAxC_RL 0x1
10366 +#define PCI_PBAxC_RM 0x2
10367 +#define SIZE_SHFT 2
10369 +#define ACACIA_PBA0C ( PCIPBAC_mrl_m | PCIPBAC_sb_m | \
10370 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
10372 + (SIZE_128MB<<SIZE_SHFT) | \
10375 +#define ACACIA_CNFG17 ACACIA_PBA0C
10376 +#define ACACIA_PBA0M 0x0
10377 +#define ACACIA_CNFG18 ACACIA_PBA0M
10379 +#define ACACIA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
10382 +#define ACACIA_CNFG19 ACACIA_PBA1C
10383 +#define ACACIA_PBA1M 0x0
10384 +#define ACACIA_CNFG20 ACACIA_PBA1M
10386 +#define ACACIA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
10389 +#define ACACIA_CNFG21 ACACIA_PBA2C
10390 +#define ACACIA_PBA2M 0x18000000
10391 +#define ACACIA_CNFG22 ACACIA_PBA2M
10392 +#define ACACIA_PBA3C 0
10393 +#define ACACIA_CNFG23 ACACIA_PBA3C
10394 +#define ACACIA_PBA3M 0
10395 +#define ACACIA_CNFG24 ACACIA_PBA3M
10399 +#define PCITC_DTIMER_VAL 8
10400 +#define PCITC_RTIMER_VAL 0x10
10402 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
10403 --- linux-2.6.17/include/asm-mips/idt-boards/rc32438/rc32438_timer.h 1970-01-01 01:00:00.000000000 +0100
10404 +++ linux-2.6.17-owrt/include/asm-mips/idt-boards/rc32438/rc32438_timer.h 2006-06-18 12:44:28.000000000 +0200
10406 +/**************************************************************************
10408 + * BRIEF MODULE DESCRIPTION
10409 + * Timer register definition IDT RC32438 CPU.
10411 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10413 + * This program is free software; you can redistribute it and/or modify it
10414 + * under the terms of the GNU General Public License as published by the
10415 + * Free Software Foundation; either version 2 of the License, or (at your
10416 + * option) any later version.
10418 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10419 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10420 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10421 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10422 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10423 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10424 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10425 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10426 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10427 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10429 + * You should have received a copy of the GNU General Public License along
10430 + * with this program; if not, write to the Free Software Foundation, Inc.,
10431 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10434 + **************************************************************************
10435 + * May 2004 P. Sadik.
10437 + * Initial Release
10441 + **************************************************************************
10444 +#ifndef __IDT_RC32438_TIM_H__
10445 +#define __IDT_RC32438_TIM_H__
10449 + TIM0_PhysicalAddress = 0x18028000,
10450 + TIM_PhysicalAddress = TIM0_PhysicalAddress, // Default
10452 + TIM0_VirtualAddress = 0xb8028000,
10453 + TIM_VirtualAddress = TIM0_VirtualAddress, // Default
10465 + u32 ctc ; //use CTC_
10468 +typedef struct TIM_s
10470 + struct TIM_CNTR_s tim [TIM_Count] ;
10471 + u32 rcount ; //use RCOUNT_
10472 + u32 rcompare ; //use RCOMPARE_
10473 + u32 rtc ; //use RTC_
10474 +} volatile * TIM_t ;
10479 + CTC_en_m = 0x00000001,
10481 + CTC_to_m = 0x00000002,
10483 + RCOUNT_count_b = 0,
10484 + RCOUNT_count_m = 0x0000ffff,
10485 + RCOMPARE_compare_b = 0,
10486 + RCOMPARE_compare_m = 0x0000ffff,
10488 + RTC_ce_m = 0x00000001,
10490 + RTC_to_m = 0x00000002,
10492 + RTC_rqe_m = 0x00000004,
10495 +#endif //__IDT_RC32438_TIM_H__
10497 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
10498 --- linux-2.6.17/include/asm-mips/mach-generic/irq.h 2006-06-18 03:49:35.000000000 +0200
10499 +++ linux-2.6.17-owrt/include/asm-mips/mach-generic/irq.h 2006-06-18 12:44:28.000000000 +0200
10501 #ifndef __ASM_MACH_GENERIC_IRQ_H
10502 #define __ASM_MACH_GENERIC_IRQ_H
10504 -#define NR_IRQS 128
10505 +#define NR_IRQS 256
10507 #endif /* __ASM_MACH_GENERIC_IRQ_H */
10508 diff -Nur linux-2.6.17/include/linux/kernel.h linux-2.6.17-owrt/include/linux/kernel.h
10509 --- linux-2.6.17/include/linux/kernel.h 2006-06-18 03:49:35.000000000 +0200
10510 +++ linux-2.6.17-owrt/include/linux/kernel.h 2006-06-18 12:44:28.000000000 +0200
10511 @@ -329,6 +329,7 @@
10514 /* Force a compilation error if condition is true */
10515 +extern void BUILD_BUG(void);
10516 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
10518 /* Trap pasters of __FUNCTION__ at compile-time */