1 diff -Nur linux-2.6.15/arch/mips/aruba/Makefile linux-2.6.15-openwrt/arch/mips/aruba/Makefile
2 --- linux-2.6.15/arch/mips/aruba/Makefile 1970-01-01 01:00:00.000000000 +0100
3 +++ linux-2.6.15-openwrt/arch/mips/aruba/Makefile 2006-01-10 00:32:32.000000000 +0100
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 idtIRQ.o irq.o time.o flash_lock.o wdt_merlot.o
49 +obj-$(CONFIG_SERIAL_8250) += serial.o
52 +obj-y += nvram/built-in.o
54 diff -Nur linux-2.6.15/arch/mips/aruba/nvram/Makefile linux-2.6.15-openwrt/arch/mips/aruba/nvram/Makefile
55 --- linux-2.6.15/arch/mips/aruba/nvram/Makefile 1970-01-01 01:00:00.000000000 +0100
56 +++ linux-2.6.15-openwrt/arch/mips/aruba/nvram/Makefile 2006-01-10 00:32:32.000000000 +0100
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.15/arch/mips/aruba/nvram/nvram434.c linux-2.6.15-openwrt/arch/mips/aruba/nvram/nvram434.c
105 --- linux-2.6.15/arch/mips/aruba/nvram/nvram434.c 1970-01-01 01:00:00.000000000 +0100
106 +++ linux-2.6.15-openwrt/arch/mips/aruba/nvram/nvram434.c 2006-01-10 00:32:32.000000000 +0100
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.15/arch/mips/aruba/nvram/nvram434.h linux-2.6.15-openwrt/arch/mips/aruba/nvram/nvram434.h
501 --- linux-2.6.15/arch/mips/aruba/nvram/nvram434.h 1970-01-01 01:00:00.000000000 +0100
502 +++ linux-2.6.15-openwrt/arch/mips/aruba/nvram/nvram434.h 2006-01-10 00:32:32.000000000 +0100
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.15/arch/mips/aruba/prom.c linux-2.6.15-openwrt/arch/mips/aruba/prom.c
571 --- linux-2.6.15/arch/mips/aruba/prom.c 1970-01-01 01:00:00.000000000 +0100
572 +++ linux-2.6.15-openwrt/arch/mips/aruba/prom.c 2006-01-10 00:32:32.000000000 +0100
574 +/**************************************************************************
576 + * BRIEF MODULE DESCRIPTION
577 + * prom interface routines
579 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
581 + * This program is free software; you can redistribute it and/or modify it
582 + * under the terms of the GNU General Public License as published by the
583 + * Free Software Foundation; either version 2 of the License, or (at your
584 + * option) any later version.
586 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
587 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
588 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
589 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
590 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
591 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
592 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
593 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
594 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
595 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
597 + * You should have received a copy of the GNU General Public License along
598 + * with this program; if not, write to the Free Software Foundation, Inc.,
599 + * 675 Mass Ave, Cambridge, MA 02139, USA.
602 + **************************************************************************
603 + * May 2004 rkt, neb
609 + **************************************************************************
612 +#include <linux/config.h>
613 +#include <linux/init.h>
614 +#include <linux/mm.h>
615 +#include <linux/module.h>
616 +#include <linux/string.h>
617 +#include <linux/console.h>
618 +#include <asm/bootinfo.h>
619 +#include <linux/bootmem.h>
620 +#include <linux/ioport.h>
621 +#include <linux/serial.h>
622 +#include <linux/serialP.h>
623 +#include <asm/serial.h>
624 +#include <linux/ioport.h>
626 +unsigned int idt_cpu_freq;
627 +EXPORT_SYMBOL(idt_cpu_freq);
629 +unsigned int arch_has_pci=0;
631 +/* Kernel Boot parameters */
632 +static unsigned char bootparm[] = "console=ttyS0,9600 root=/dev/mtdblock1 rootfstype=jffs2";
634 +extern unsigned long mips_machgroup;
635 +extern unsigned long mips_machtype;
637 +extern void setup_serial_port(void);
638 +extern char * getenv(char *e);
640 +/* IDT 79EB434 memory map -- we really should be auto sizing it */
641 +#define RAM_SIZE 32*1024*1024
643 +char *__init prom_getcmdline(void)
645 + return &(arcs_cmdline[0]);
648 +void __init prom_init(void)
651 + sprintf(arcs_cmdline, "%s", bootparm);
653 + /* set our arch type */
654 + mips_machgroup = MACH_GROUP_ARUBA;
655 + mips_machtype = MACH_ARUBA_UNKNOWN;
657 + boardname=getenv("boardname");
659 + if (!strcmp(boardname,"Muscat")) {
660 + mips_machtype = MACH_ARUBA_AP70;
661 + idt_cpu_freq = 133000000;
663 + } else if (!strcmp(boardname,"Mataro")) {
664 + mips_machtype = MACH_ARUBA_AP65;
665 + idt_cpu_freq = 110000000;
666 + } else if (!strcmp(boardname,"Merlot")) {
667 + mips_machtype = MACH_ARUBA_AP60;
668 + idt_cpu_freq = 90000000;
671 + /* turn on the console */
672 + setup_serial_port();
675 + * give all RAM to boot allocator,
676 + * except where the kernel was loaded
678 + add_memory_region(0,RAM_SIZE,BOOT_MEM_RAM);
681 +void prom_free_prom_memory(void)
683 + printk("stubbed prom_free_prom_memory()\n");
685 diff -Nur linux-2.6.15/arch/mips/aruba/serial.c linux-2.6.15-openwrt/arch/mips/aruba/serial.c
686 --- linux-2.6.15/arch/mips/aruba/serial.c 1970-01-01 01:00:00.000000000 +0100
687 +++ linux-2.6.15-openwrt/arch/mips/aruba/serial.c 2006-01-10 00:32:32.000000000 +0100
689 +/**************************************************************************
691 + * BRIEF MODULE DESCRIPTION
692 + * Serial port initialisation.
694 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
696 + * This program is free software; you can redistribute it and/or modify it
697 + * under the terms of the GNU General Public License as published by the
698 + * Free Software Foundation; either version 2 of the License, or (at your
699 + * option) any later version.
701 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
702 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
703 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
704 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
705 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
706 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
707 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
708 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
709 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
710 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
712 + * You should have received a copy of the GNU General Public License along
713 + * with this program; if not, write to the Free Software Foundation, Inc.,
714 + * 675 Mass Ave, Cambridge, MA 02139, USA.
717 + **************************************************************************
718 + * May 2004 rkt, neb
724 + **************************************************************************
728 +#include <linux/config.h>
729 +#include <linux/init.h>
730 +#include <linux/sched.h>
731 +#include <linux/pci.h>
732 +#include <linux/interrupt.h>
733 +#include <linux/tty.h>
734 +#include <linux/serial.h>
735 +#include <linux/serial_core.h>
737 +#include <asm/time.h>
738 +#include <asm/cpu.h>
739 +#include <asm/bootinfo.h>
740 +#include <asm/irq.h>
741 +#include <asm/serial.h>
743 +#include <asm/idt-boards/rc32434/rc32434.h>
745 +extern int __init early_serial_setup(struct uart_port *port);
747 +#define BASE_BAUD (1843200 / 16)
749 +extern unsigned int idt_cpu_freq;
751 +extern int __init setup_serial_port(void)
753 + static struct uart_port serial_req[2];
755 + memset(serial_req, 0, sizeof(serial_req));
756 + serial_req[0].type = PORT_16550A;
757 + serial_req[0].line = 0;
758 + serial_req[0].flags = STD_COM_FLAGS;
759 + serial_req[0].iotype = SERIAL_IO_MEM;
760 + serial_req[0].regshift = 2;
762 + switch (mips_machtype) {
763 + case MACH_ARUBA_AP70:
764 + serial_req[0].irq = 104;
765 + serial_req[0].mapbase = KSEG1ADDR(0x18058003);
766 + serial_req[0].membase = (char *) KSEG1ADDR(0x18058003);
767 + serial_req[0].uartclk = idt_cpu_freq;
769 + case MACH_ARUBA_AP65:
770 + case MACH_ARUBA_AP60:
772 + serial_req[0].irq = 12;
773 + serial_req[0].mapbase = KSEG1ADDR(0xbc000003);
774 + serial_req[0].membase = (char *) KSEG1ADDR(0xbc000003);
775 + serial_req[0].uartclk = idt_cpu_freq / 2;
779 + early_serial_setup(&serial_req[0]);
783 diff -Nur linux-2.6.15/arch/mips/aruba/setup.c linux-2.6.15-openwrt/arch/mips/aruba/setup.c
784 --- linux-2.6.15/arch/mips/aruba/setup.c 1970-01-01 01:00:00.000000000 +0100
785 +++ linux-2.6.15-openwrt/arch/mips/aruba/setup.c 2006-01-10 00:32:32.000000000 +0100
787 +/**************************************************************************
789 + * BRIEF MODULE DESCRIPTION
790 + * setup routines for IDT EB434 boards
792 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
794 + * This program is free software; you can redistribute it and/or modify it
795 + * under the terms of the GNU General Public License as published by the
796 + * Free Software Foundation; either version 2 of the License, or (at your
797 + * option) any later version.
799 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
800 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
801 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
802 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
803 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
804 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
805 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
806 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
807 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
808 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
810 + * You should have received a copy of the GNU General Public License along
811 + * with this program; if not, write to the Free Software Foundation, Inc.,
812 + * 675 Mass Ave, Cambridge, MA 02139, USA.
815 + **************************************************************************
816 + * May 2004 rkt, neb
822 + **************************************************************************
825 +#include <linux/init.h>
826 +#include <linux/mm.h>
827 +#include <linux/sched.h>
828 +#include <linux/irq.h>
829 +#include <asm/bootinfo.h>
831 +#include <linux/ioport.h>
832 +#include <asm/mipsregs.h>
833 +#include <asm/pgtable.h>
834 +#include <asm/reboot.h>
835 +#include <asm/addrspace.h> /* for KSEG1ADDR() */
836 +#include <asm/idt-boards/rc32434/rc32434.h>
838 +extern char *__init prom_getcmdline(void);
840 +extern void (*board_time_init) (void);
841 +extern void (*board_timer_setup) (struct irqaction * irq);
842 +extern void aruba_time_init(void);
843 +extern void aruba_timer_setup(struct irqaction *irq);
844 +extern void aruba_reset(void);
846 +#define epldMask ((volatile unsigned char *)0xB900000d)
848 +static void aruba_machine_restart(char *command)
850 + switch (mips_machtype) {
851 + case MACH_ARUBA_AP70:
852 + *(volatile u32 *)KSEG1ADDR(0x18008000) = 0x80000001;
854 + case MACH_ARUBA_AP65:
855 + case MACH_ARUBA_AP60:
858 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0x00080350; // reset everything in sight
860 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0; // reset everything in sight
862 + *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0x3; // cold reset the cpu & system
867 +static void aruba_machine_halt(void)
872 +extern char * getenv(char *e);
873 +extern void unlock_ap60_70_flash(void);
874 +extern void wdt_merlot_disable(void);
876 +void __init plat_setup(void)
878 + board_time_init = aruba_time_init;
880 + board_timer_setup = aruba_timer_setup;
882 + _machine_restart = aruba_machine_restart;
883 + _machine_halt = aruba_machine_halt;
884 + _machine_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"));
897 + wdt_merlot_disable();
902 +int page_is_ram(unsigned long pagenr)
907 +const char *get_system_type(void)
909 + return "MIPS IDT32434 - ARUBA";
911 diff -Nur linux-2.6.15/arch/mips/aruba/time.c linux-2.6.15-openwrt/arch/mips/aruba/time.c
912 --- linux-2.6.15/arch/mips/aruba/time.c 1970-01-01 01:00:00.000000000 +0100
913 +++ linux-2.6.15-openwrt/arch/mips/aruba/time.c 2006-01-10 00:32:32.000000000 +0100
915 +/**************************************************************************
917 + * BRIEF MODULE DESCRIPTION
918 + * timer routines for IDT EB434 boards
920 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
922 + * This program is free software; you can redistribute it and/or modify it
923 + * under the terms of the GNU General Public License as published by the
924 + * Free Software Foundation; either version 2 of the License, or (at your
925 + * option) any later version.
927 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
928 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
929 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
930 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
931 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
932 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
933 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
934 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
935 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
936 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
938 + * You should have received a copy of the GNU General Public License along
939 + * with this program; if not, write to the Free Software Foundation, Inc.,
940 + * 675 Mass Ave, Cambridge, MA 02139, USA.
943 + **************************************************************************
944 + * May 2004 rkt, neb
950 + **************************************************************************
953 +#include <linux/config.h>
954 +#include <linux/init.h>
955 +#include <linux/kernel_stat.h>
956 +#include <linux/sched.h>
957 +#include <linux/spinlock.h>
958 +#include <linux/mc146818rtc.h>
959 +#include <linux/irq.h>
960 +#include <linux/timex.h>
962 +#include <linux/param.h>
963 +#include <asm/mipsregs.h>
964 +#include <asm/ptrace.h>
965 +#include <asm/time.h>
966 +#include <asm/hardirq.h>
968 +#include <asm/mipsregs.h>
969 +#include <asm/ptrace.h>
970 +#include <asm/debug.h>
971 +#include <asm/time.h>
973 +#include <asm/idt-boards/rc32434/rc32434.h>
975 +static unsigned long r4k_offset; /* Amount to incr compare reg each time */
976 +static unsigned long r4k_cur; /* What counter should be at next timer irq */
978 +extern unsigned int idt_cpu_freq;
980 +static unsigned long __init cal_r4koff(void)
982 + mips_hpt_frequency = idt_cpu_freq * IDT_CLOCK_MULT / 2;
983 + return (mips_hpt_frequency / HZ);
986 +void __init aruba_time_init(void)
988 + unsigned int est_freq, flags;
989 + local_irq_save(flags);
991 + printk("calculating r4koff... ");
992 + r4k_offset = cal_r4koff();
993 + printk("%08lx(%d)\n", r4k_offset, (int)r4k_offset);
995 + est_freq = 2 * r4k_offset * HZ;
996 + est_freq += 5000; /* round */
997 + est_freq -= est_freq % 10000;
998 + printk("CPU frequency %d.%02d MHz\n", est_freq / 1000000,
999 + (est_freq % 1000000) * 100 / 1000000);
1000 + local_irq_restore(flags);
1004 +void __init aruba_timer_setup(struct irqaction *irq)
1006 + /* we are using the cpu counter for timer interrupts */
1007 + setup_irq(MIPS_CPU_TIMER_IRQ, irq);
1009 + /* to generate the first timer interrupt */
1010 + r4k_cur = (read_c0_count() + r4k_offset);
1011 + write_c0_compare(r4k_cur);
1015 +asmlinkage void aruba_timer_interrupt(int irq, struct pt_regs *regs)
1018 + kstat_this_cpu.irqs[irq]++;
1020 + timer_interrupt(irq, NULL, regs);
1023 diff -Nur linux-2.6.15/arch/mips/aruba/wdt_merlot.c linux-2.6.15-openwrt/arch/mips/aruba/wdt_merlot.c
1024 --- linux-2.6.15/arch/mips/aruba/wdt_merlot.c 1970-01-01 01:00:00.000000000 +0100
1025 +++ linux-2.6.15-openwrt/arch/mips/aruba/wdt_merlot.c 2006-01-10 00:32:32.000000000 +0100
1027 +#include <linux/config.h>
1028 +#include <linux/kernel.h>
1029 +#include <asm/bootinfo.h>
1031 +void wdt_merlot_disable()
1033 + volatile __u32 *wdt_errcs;
1034 + volatile __u32 *wdt_wtc;
1035 + volatile __u32 *wdt_ctl;
1036 + volatile __u32 val;
1038 + switch (mips_machtype) {
1039 + case MACH_ARUBA_AP70:
1040 + wdt_errcs = (__u32 *) 0xb8030030;
1041 + wdt_wtc = (__u32 *) 0xb803003c;
1049 + case MACH_ARUBA_AP65:
1050 + case MACH_ARUBA_AP60:
1052 + wdt_ctl = (__u32 *) 0xbc003008;
1057 diff -Nur linux-2.6.15/arch/mips/Kconfig linux-2.6.15-openwrt/arch/mips/Kconfig
1058 --- linux-2.6.15/arch/mips/Kconfig 2006-01-03 04:21:10.000000000 +0100
1059 +++ linux-2.6.15-openwrt/arch/mips/Kconfig 2006-01-10 00:32:32.000000000 +0100
1060 @@ -227,6 +227,18 @@
1061 either a NEC Vr5432 or QED RM5231. Say Y here if you wish to build
1062 a kernel for this platform.
1065 + bool "Support for the ARUBA product line"
1066 + select DMA_NONCOHERENT
1068 + select CPU_HAS_PREFETCH
1070 + select SWAP_IO_SPACE
1071 + select SYS_SUPPORTS_32BIT_KERNEL
1072 + select SYS_HAS_CPU_MIPS32_R1
1073 + select SYS_SUPPORTS_BIG_ENDIAN
1077 bool "Support for the Jazz family of machines"
1079 diff -Nur linux-2.6.15/arch/mips/Makefile linux-2.6.15-openwrt/arch/mips/Makefile
1080 --- linux-2.6.15/arch/mips/Makefile 2006-01-03 04:21:10.000000000 +0100
1081 +++ linux-2.6.15-openwrt/arch/mips/Makefile 2006-01-10 00:32:32.000000000 +0100
1082 @@ -258,6 +258,14 @@
1089 +core-$(CONFIG_MACH_ARUBA) += arch/mips/aruba/
1090 +cflags-$(CONFIG_MACH_ARUBA) += -Iinclude/asm-mips/aruba
1091 +load-$(CONFIG_MACH_ARUBA) += 0x80100000
1094 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
1096 core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
1097 diff -Nur linux-2.6.15/arch/mips/mm/tlbex.c linux-2.6.15-openwrt/arch/mips/mm/tlbex.c
1098 --- linux-2.6.15/arch/mips/mm/tlbex.c 2006-01-03 04:21:10.000000000 +0100
1099 +++ linux-2.6.15-openwrt/arch/mips/mm/tlbex.c 2006-01-10 00:32:32.000000000 +0100
1116 diff -Nur linux-2.6.15/drivers/net/Kconfig linux-2.6.15-openwrt/drivers/net/Kconfig
1117 --- linux-2.6.15/drivers/net/Kconfig 2006-01-03 04:21:10.000000000 +0100
1118 +++ linux-2.6.15-openwrt/drivers/net/Kconfig 2006-01-10 00:32:32.000000000 +0100
1119 @@ -176,6 +176,13 @@
1121 source "drivers/net/arm/Kconfig"
1123 +config IDT_RC32434_ETH
1124 + tristate "IDT RC32434 Local Ethernet support"
1125 + depends on NET_ETHERNET
1127 + IDT RC32434 has one local ethernet port. Say Y here to enable it.
1128 + To compile this driver as a module, choose M here.
1131 tristate "MACE (Power Mac ethernet) support"
1132 depends on NET_ETHERNET && PPC_PMAC && PPC32
1133 diff -Nur linux-2.6.15/drivers/net/Makefile linux-2.6.15-openwrt/drivers/net/Makefile
1134 --- linux-2.6.15/drivers/net/Makefile 2006-01-03 04:21:10.000000000 +0100
1135 +++ linux-2.6.15-openwrt/drivers/net/Makefile 2006-01-10 00:32:33.000000000 +0100
1137 obj-$(CONFIG_SMC91X) += smc91x.o
1138 obj-$(CONFIG_DM9000) += dm9000.o
1139 obj-$(CONFIG_FEC_8XX) += fec_8xx/
1140 +obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
1142 obj-$(CONFIG_ARM) += arm/
1143 obj-$(CONFIG_DEV_APPLETALK) += appletalk/
1144 diff -Nur linux-2.6.15/drivers/net/rc32434_eth.c linux-2.6.15-openwrt/drivers/net/rc32434_eth.c
1145 --- linux-2.6.15/drivers/net/rc32434_eth.c 1970-01-01 01:00:00.000000000 +0100
1146 +++ linux-2.6.15-openwrt/drivers/net/rc32434_eth.c 2006-01-10 00:32:33.000000000 +0100
1148 +/**************************************************************************
1150 + * BRIEF MODULE DESCRIPTION
1151 + * Driver for the IDT RC32434 on-chip ethernet controller.
1153 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1155 + * This program is free software; you can redistribute it and/or modify it
1156 + * under the terms of the GNU General Public License as published by the
1157 + * Free Software Foundation; either version 2 of the License, or (at your
1158 + * option) any later version.
1160 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1161 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1162 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1163 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1164 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1165 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1166 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1167 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1168 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1169 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1171 + * You should have received a copy of the GNU General Public License along
1172 + * with this program; if not, write to the Free Software Foundation, Inc.,
1173 + * 675 Mass Ave, Cambridge, MA 02139, USA.
1176 + **************************************************************************
1177 + * May 2004 rkt, neb
1179 + * Based on the driver developed by B. Maruthanayakam, H. Kou and others.
1185 + **************************************************************************
1188 +#include <linux/config.h>
1189 +#include <linux/module.h>
1190 +#include <linux/kernel.h>
1191 +#include <linux/moduleparam.h>
1192 +#include <linux/sched.h>
1193 +#include <linux/ctype.h>
1194 +#include <linux/types.h>
1195 +#include <linux/fcntl.h>
1196 +#include <linux/interrupt.h>
1197 +#include <linux/ptrace.h>
1198 +#include <linux/init.h>
1199 +#include <linux/ioport.h>
1200 +#include <linux/proc_fs.h>
1201 +#include <linux/in.h>
1202 +#include <linux/slab.h>
1203 +#include <linux/string.h>
1204 +#include <linux/delay.h>
1205 +#include <linux/netdevice.h>
1206 +#include <linux/etherdevice.h>
1207 +#include <linux/skbuff.h>
1208 +#include <linux/errno.h>
1209 +#include <asm/bootinfo.h>
1210 +#include <asm/system.h>
1211 +#include <asm/bitops.h>
1212 +#include <asm/pgtable.h>
1213 +#include <asm/segment.h>
1214 +#include <asm/io.h>
1215 +#include <asm/dma.h>
1217 +#include "rc32434_eth.h"
1219 +#define DRIVER_VERSION "(mar2904)"
1221 +#define DRIVER_NAME "rc32434 Ethernet driver. " DRIVER_VERSION
1224 +#define STATION_ADDRESS_HIGH(dev) (((dev)->dev_addr[0] << 8) | \
1225 + ((dev)->dev_addr[1]))
1226 +#define STATION_ADDRESS_LOW(dev) (((dev)->dev_addr[2] << 24) | \
1227 + ((dev)->dev_addr[3] << 16) | \
1228 + ((dev)->dev_addr[4] << 8) | \
1229 + ((dev)->dev_addr[5]))
1231 +#define MII_CLOCK 1250000 /* no more than 2.5MHz */
1232 +static char mac0[18] = "08:00:06:05:40:01";
1234 +MODULE_PARM(mac0, "c18");
1235 +MODULE_PARM_DESC(mac0, "MAC address for RC32434 ethernet0");
1237 +static struct rc32434_if_t {
1239 + struct net_device *dev;
1249 +} rc32434_iflist[] =
1252 + "rc32434_eth0", NULL, mac0,
1254 + ETH0_PhysicalAddress,
1265 +static int parse_mac_addr(struct net_device *dev, char* macstr)
1268 + unsigned char result, value;
1270 + for (i=0; i<6; i++) {
1272 + if (i != 5 && *(macstr+2) != ':') {
1273 + ERR("invalid mac address format: %d %c\n",
1277 + for (j=0; j<2; j++) {
1278 + if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
1279 + toupper(*macstr)-'A'+10) < 16) {
1280 + result = result*16 + value;
1284 + ERR("invalid mac address "
1285 + "character: %c\n", *macstr);
1291 + dev->dev_addr[i] = result;
1299 +static inline void rc32434_abort_tx(struct net_device *dev)
1301 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1302 + rc32434_abort_dma(dev, lp->tx_dma_regs);
1306 +static inline void rc32434_abort_rx(struct net_device *dev)
1308 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1309 + rc32434_abort_dma(dev, lp->rx_dma_regs);
1313 +static inline void rc32434_start_tx(struct rc32434_local *lp, volatile DMAD_t td)
1315 + rc32434_start_dma(lp->tx_dma_regs, CPHYSADDR(td));
1318 +static inline void rc32434_start_rx(struct rc32434_local *lp, volatile DMAD_t rd)
1320 + rc32434_start_dma(lp->rx_dma_regs, CPHYSADDR(rd));
1323 +static inline void rc32434_chain_tx(struct rc32434_local *lp, volatile DMAD_t td)
1325 + rc32434_chain_dma(lp->tx_dma_regs, CPHYSADDR(td));
1328 +static inline void rc32434_chain_rx(struct rc32434_local *lp, volatile DMAD_t rd)
1330 + rc32434_chain_dma(lp->rx_dma_regs, CPHYSADDR(rd));
1333 +#ifdef RC32434_PROC_DEBUG
1334 +static int rc32434_read_proc(char *buf, char **start, off_t fpos,
1335 + int length, int *eof, void *data)
1337 + struct net_device *dev = (struct net_device *)data;
1338 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1341 + /* print out header */
1342 + len += sprintf(buf + len, "\n\tRC32434 Ethernet Debug\n\n");
1343 + len += sprintf (buf + len,
1344 + "DMA halt count = %10d, DMA run count = %10d\n",
1345 + lp->dma_halt_cnt, lp->dma_run_cnt);
1347 + if (fpos >= len) {
1352 + *start = buf + fpos;
1354 + if ((len -= fpos) > length)
1365 + * Restart the RC32434 ethernet controller.
1367 +static int rc32434_restart(struct net_device *dev)
1369 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1372 + * Disable interrupts
1374 + disable_irq(lp->rx_irq);
1375 + disable_irq(lp->tx_irq);
1376 +#ifdef RC32434_REVISION
1377 + disable_irq(lp->ovr_irq);
1379 + disable_irq(lp->und_irq);
1381 + /* Mask F E bit in Tx DMA */
1382 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) | DMASM_f_m | DMASM_e_m, &lp->tx_dma_regs->dmasm);
1383 + /* Mask D H E bit in Rx DMA */
1384 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) | DMASM_d_m | DMASM_h_m | DMASM_e_m, &lp->rx_dma_regs->dmasm);
1386 + rc32434_init(dev);
1387 + rc32434_multicast_list(dev);
1389 + enable_irq(lp->und_irq);
1390 +#ifdef RC32434_REVISION
1391 + enable_irq(lp->ovr_irq);
1393 + enable_irq(lp->tx_irq);
1394 + enable_irq(lp->rx_irq);
1399 +int rc32434_init_module(void)
1401 +#ifdef CONFIG_MACH_ARUBA
1402 + if (mips_machtype != MACH_ARUBA_AP70)
1406 + printk(KERN_INFO DRIVER_NAME " \n");
1407 + return rc32434_probe(0);
1410 +static int rc32434_probe(int port_num)
1412 + struct rc32434_if_t *bif = &rc32434_iflist[port_num];
1413 + struct rc32434_local *lp = NULL;
1414 + struct net_device *dev = NULL;
1415 + int i, retval,err;
1417 + dev = alloc_etherdev(sizeof(struct rc32434_local));
1419 + ERR("rc32434_eth: alloc_etherdev failed\n");
1423 + SET_MODULE_OWNER(dev);
1426 +#ifdef CONFIG_MACH_ARUBA
1428 + extern char * getenv(char *e);
1429 + memcpy(bif->mac_str, getenv("ethaddr"), 17);
1433 + printk("mac: %s\n", bif->mac_str);
1434 + if ((retval = parse_mac_addr(dev, bif->mac_str))) {
1435 + ERR("MAC address parse failed\n");
1441 + /* Initialize the device structure. */
1442 + if (dev->priv == NULL) {
1443 + lp = (struct rc32434_local *)kmalloc(sizeof(*lp), GFP_KERNEL);
1444 + memset(lp, 0, sizeof(struct rc32434_local));
1447 + lp = (struct rc32434_local *)dev->priv;
1450 + lp->rx_irq = bif->rx_dma_irq;
1451 + lp->tx_irq = bif->tx_dma_irq;
1452 + lp->ovr_irq = bif->rx_ovr_irq;
1453 + lp->und_irq = bif->tx_und_irq;
1455 + lp->eth_regs = ioremap_nocache(bif->iobase, sizeof(*lp->eth_regs));
1457 + if (!lp->eth_regs) {
1458 + ERR("Can't remap eth registers\n");
1460 + goto probe_err_out;
1463 + lp->rx_dma_regs = ioremap_nocache(bif->rxdmabase, sizeof(struct DMA_Chan_s));
1465 + if (!lp->rx_dma_regs) {
1466 + ERR("Can't remap Rx DMA registers\n");
1468 + goto probe_err_out;
1470 + lp->tx_dma_regs = ioremap_nocache(bif->txdmabase,sizeof(struct DMA_Chan_s));
1472 + if (!lp->tx_dma_regs) {
1473 + ERR("Can't remap Tx DMA registers\n");
1475 + goto probe_err_out;
1478 +#ifdef RC32434_PROC_DEBUG
1479 + lp->ps = create_proc_read_entry (bif->name, 0, proc_net,
1480 + rc32434_read_proc, dev);
1483 + lp->td_ring = (DMAD_t)kmalloc(TD_RING_SIZE + RD_RING_SIZE, GFP_KERNEL);
1484 + if (!lp->td_ring) {
1485 + ERR("Can't allocate descriptors\n");
1487 + goto probe_err_out;
1490 + dma_cache_inv((unsigned long)(lp->td_ring), TD_RING_SIZE + RD_RING_SIZE);
1492 + /* now convert TD_RING pointer to KSEG1 */
1493 + lp->td_ring = (DMAD_t )KSEG1ADDR(lp->td_ring);
1494 + lp->rd_ring = &lp->td_ring[RC32434_NUM_TDS];
1497 + spin_lock_init(&lp->lock);
1499 + dev->base_addr = bif->iobase;
1500 + /* just use the rx dma irq */
1501 + dev->irq = bif->rx_dma_irq;
1505 + dev->open = rc32434_open;
1506 + dev->stop = rc32434_close;
1507 + dev->hard_start_xmit = rc32434_send_packet;
1508 + dev->get_stats = rc32434_get_stats;
1509 + dev->set_multicast_list = &rc32434_multicast_list;
1510 + dev->tx_timeout = rc32434_tx_timeout;
1511 + dev->watchdog_timeo = RC32434_TX_TIMEOUT;
1513 +#ifdef CONFIG_IDT_USE_NAPI
1514 + dev->poll = rc32434_poll;
1515 + dev->weight = bif->weight;
1516 + printk("Using NAPI with weight %d\n",dev->weight);
1518 + lp->rx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
1519 + tasklet_init(lp->rx_tasklet, rc32434_rx_tasklet, (unsigned long)dev);
1521 + lp->tx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
1522 + tasklet_init(lp->tx_tasklet, rc32434_tx_tasklet, (unsigned long)dev);
1524 + if ((err = register_netdev(dev))) {
1525 + printk(KERN_ERR "rc32434 ethernet. Cannot register net device %d\n", err);
1528 + goto probe_err_out;
1531 + INFO("Rx IRQ %d, Tx IRQ %d, ", bif->rx_dma_irq, bif->tx_dma_irq);
1532 + for (i = 0; i < 6; i++) {
1533 + printk("%2.2x", dev->dev_addr[i]);
1542 + rc32434_cleanup_module();
1543 + ERR(" failed. Returns %d\n", retval);
1549 +static void rc32434_cleanup_module(void)
1553 + for (i = 0; rc32434_iflist[i].iobase; i++) {
1554 + struct rc32434_if_t * bif = &rc32434_iflist[i];
1555 + if (bif->dev != NULL) {
1556 + struct rc32434_local *lp = (struct rc32434_local *)bif->dev->priv;
1559 + iounmap((void*)lp->eth_regs);
1560 + if (lp->rx_dma_regs)
1561 + iounmap((void*)lp->rx_dma_regs);
1562 + if (lp->tx_dma_regs)
1563 + iounmap((void*)lp->tx_dma_regs);
1565 + kfree((void*)KSEG0ADDR(lp->td_ring));
1567 +#ifdef RC32434_PROC_DEBUG
1569 + remove_proc_entry(bif->name, proc_net);
1575 + unregister_netdev(bif->dev);
1576 + free_netdev(bif->dev);
1584 +static int rc32434_open(struct net_device *dev)
1586 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1589 + if (rc32434_init(dev)) {
1590 + ERR("Error: cannot open the Ethernet device\n");
1594 + /* Install the interrupt handler that handles the Done Finished Ovr and Und Events */
1595 + if (request_irq(lp->rx_irq, &rc32434_rx_dma_interrupt,
1596 + SA_SHIRQ | SA_INTERRUPT,
1597 + "rc32434 ethernet Rx", dev)) {
1598 + ERR(": unable to get Rx DMA IRQ %d\n",
1602 + if (request_irq(lp->tx_irq, &rc32434_tx_dma_interrupt,
1603 + SA_SHIRQ | SA_INTERRUPT,
1604 + "rc32434 ethernet Tx", dev)) {
1605 + ERR(": unable to get Tx DMA IRQ %d\n",
1607 + free_irq(lp->rx_irq, dev);
1611 +#ifdef RC32434_REVISION
1612 + /* Install handler for overrun error. */
1613 + if (request_irq(lp->ovr_irq, &rc32434_ovr_interrupt,
1614 + SA_SHIRQ | SA_INTERRUPT,
1615 + "Ethernet Overflow", dev)) {
1616 + ERR(": unable to get OVR IRQ %d\n",
1618 + free_irq(lp->rx_irq, dev);
1619 + free_irq(lp->tx_irq, dev);
1624 + /* Install handler for underflow error. */
1625 + if (request_irq(lp->und_irq, &rc32434_und_interrupt,
1626 + SA_SHIRQ | SA_INTERRUPT,
1627 + "Ethernet Underflow", dev)) {
1628 + ERR(": unable to get UND IRQ %d\n",
1630 + free_irq(lp->rx_irq, dev);
1631 + free_irq(lp->tx_irq, dev);
1632 +#ifdef RC32434_REVISION
1633 + free_irq(lp->ovr_irq, dev);
1645 +static int rc32434_close(struct net_device *dev)
1647 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1650 + /* Disable interrupts */
1651 + disable_irq(lp->rx_irq);
1652 + disable_irq(lp->tx_irq);
1653 +#ifdef RC32434_REVISION
1654 + disable_irq(lp->ovr_irq);
1656 + disable_irq(lp->und_irq);
1658 + tmp = rc32434_readl(&lp->tx_dma_regs->dmasm);
1659 + tmp = tmp | DMASM_f_m | DMASM_e_m;
1660 + rc32434_writel(tmp, &lp->tx_dma_regs->dmasm);
1662 + tmp = rc32434_readl(&lp->rx_dma_regs->dmasm);
1663 + tmp = tmp | DMASM_d_m | DMASM_h_m | DMASM_e_m;
1664 + rc32434_writel(tmp, &lp->rx_dma_regs->dmasm);
1666 + free_irq(lp->rx_irq, dev);
1667 + free_irq(lp->tx_irq, dev);
1668 +#ifdef RC32434_REVISION
1669 + free_irq(lp->ovr_irq, dev);
1671 + free_irq(lp->und_irq, dev);
1676 +/* transmit packet */
1677 +static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev)
1679 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1680 + unsigned long flags;
1685 + spin_lock_irqsave(&lp->lock, flags);
1687 + td = &lp->td_ring[lp->tx_chain_tail];
1689 + /* stop queue when full, drop pkts if queue already full */
1690 + if(lp->tx_count >= (RC32434_NUM_TDS - 2)) {
1693 + if(lp->tx_count == (RC32434_NUM_TDS - 2)) {
1694 + netif_stop_queue(dev);
1697 + lp->stats.tx_dropped++;
1698 + dev_kfree_skb_any(skb);
1699 + spin_unlock_irqrestore(&lp->lock, flags);
1706 + lp->tx_skb[lp->tx_chain_tail] = skb;
1708 + length = skb->len;
1710 + /* Setup the transmit descriptor. */
1711 + td->ca = CPHYSADDR(skb->data);
1713 + if(rc32434_readl(&(lp->tx_dma_regs->dmandptr)) == 0) {
1714 + if( lp->tx_chain_status == empty ) {
1715 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1716 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1717 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR */
1718 + lp->tx_chain_head = lp->tx_chain_tail; /* Move head to tail */
1721 + td->control = DMA_COUNT(length) |DMAD_cof_m|DMAD_iof_m; /* Update tail */
1722 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &= ~(DMAD_cof_m); /* Link to prev */
1723 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link = CPHYSADDR(td); /* Link to prev */
1724 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1725 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR */
1726 + lp->tx_chain_head = lp->tx_chain_tail; /* Move head to tail */
1727 + lp->tx_chain_status = empty;
1731 + if( lp->tx_chain_status == empty ) {
1732 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1733 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1734 + lp->tx_chain_status = filled;
1737 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1738 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &= ~(DMAD_cof_m); /* Link to prev */
1739 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link = CPHYSADDR(td); /* Link to prev */
1740 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1744 + dev->trans_start = jiffies;
1746 + spin_unlock_irqrestore(&lp->lock, flags);
1752 +/* Ethernet MII-PHY Handler */
1753 +static void rc32434_mii_handler(unsigned long data)
1755 + struct net_device *dev = (struct net_device *)data;
1756 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1757 + unsigned long flags;
1758 + unsigned long duplex_status;
1759 + int port_addr = (lp->rx_irq == 0x2c? 1:0) << 8;
1761 + spin_lock_irqsave(&lp->lock, flags);
1763 + /* Two ports are using the same MII, the difference is the PHY address */
1764 + rc32434_writel(0, &rc32434_eth0_regs->miimcfg);
1765 + rc32434_writel(0, &rc32434_eth0_regs->miimcmd);
1766 + rc32434_writel(port_addr |0x05, &rc32434_eth0_regs->miimaddr);
1767 + rc32434_writel(MIIMCMD_scn_m, &rc32434_eth0_regs->miimcmd);
1768 + while(rc32434_readl(&rc32434_eth0_regs->miimind) & MIIMIND_nv_m);
1770 + ERR("irq:%x port_addr:%x RDD:%x\n",
1771 + lp->rx_irq, port_addr, rc32434_readl(&rc32434_eth0_regs->miimrdd));
1772 + duplex_status = (rc32434_readl(&rc32434_eth0_regs->miimrdd) & 0x140)? ETHMAC2_fd_m: 0;
1773 + if(duplex_status != lp->duplex_mode) {
1774 + 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);
1775 + lp->duplex_mode = duplex_status;
1776 + rc32434_restart(dev);
1779 + lp->mii_phy_timer.expires = jiffies + 10 * HZ;
1780 + add_timer(&lp->mii_phy_timer);
1782 + spin_unlock_irqrestore(&lp->lock, flags);
1786 +#ifdef RC32434_REVISION
1787 +/* Ethernet Rx Overflow interrupt */
1789 +rc32434_ovr_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1791 + struct net_device *dev = (struct net_device *)dev_id;
1792 + struct rc32434_local *lp;
1794 + irqreturn_t retval = IRQ_NONE;
1796 + ASSERT(dev != NULL);
1798 + lp = (struct rc32434_local *)dev->priv;
1799 + spin_lock(&lp->lock);
1800 + ovr = rc32434_readl(&lp->eth_regs->ethintfc);
1802 + if(ovr & ETHINTFC_ovr_m) {
1803 + netif_stop_queue(dev);
1805 + /* clear OVR bit */
1806 + rc32434_writel((ovr & ~ETHINTFC_ovr_m), &lp->eth_regs->ethintfc);
1808 + /* Restart interface */
1809 + rc32434_restart(dev);
1810 + retval = IRQ_HANDLED;
1812 + spin_unlock(&lp->lock);
1820 +/* Ethernet Tx Underflow interrupt */
1822 +rc32434_und_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1824 + struct net_device *dev = (struct net_device *)dev_id;
1825 + struct rc32434_local *lp;
1827 + irqreturn_t retval = IRQ_NONE;
1829 + ASSERT(dev != NULL);
1831 + lp = (struct rc32434_local *)dev->priv;
1833 + spin_lock(&lp->lock);
1835 + und = rc32434_readl(&lp->eth_regs->ethintfc);
1837 + if(und & ETHINTFC_und_m) {
1838 + netif_stop_queue(dev);
1840 + rc32434_writel((und & ~ETHINTFC_und_m), &lp->eth_regs->ethintfc);
1842 + /* Restart interface */
1843 + rc32434_restart(dev);
1844 + retval = IRQ_HANDLED;
1847 + spin_unlock(&lp->lock);
1853 +/* Ethernet Rx DMA interrupt */
1855 +rc32434_rx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1857 + struct net_device *dev = (struct net_device *)dev_id;
1858 + struct rc32434_local* lp;
1859 + volatile u32 dmas,dmasm;
1860 + irqreturn_t retval;
1862 + ASSERT(dev != NULL);
1864 + lp = (struct rc32434_local *)dev->priv;
1866 + spin_lock(&lp->lock);
1867 + dmas = rc32434_readl(&lp->rx_dma_regs->dmas);
1868 + if(dmas & (DMAS_d_m|DMAS_h_m|DMAS_e_m)) {
1869 + /* Mask D H E bit in Rx DMA */
1870 + dmasm = rc32434_readl(&lp->rx_dma_regs->dmasm);
1871 + rc32434_writel(dmasm | (DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm);
1872 +#ifdef CONFIG_IDT_USE_NAPI
1873 + if(netif_rx_schedule_prep(dev))
1874 + __netif_rx_schedule(dev);
1876 + tasklet_hi_schedule(lp->rx_tasklet);
1879 + if (dmas & DMAS_e_m)
1880 + ERR(": DMA error\n");
1882 + retval = IRQ_HANDLED;
1885 + retval = IRQ_NONE;
1887 + spin_unlock(&lp->lock);
1891 +#ifdef CONFIG_IDT_USE_NAPI
1892 +static int rc32434_poll(struct net_device *rx_data_dev, int *budget)
1894 +static void rc32434_rx_tasklet(unsigned long rx_data_dev)
1897 + struct net_device *dev = (struct net_device *)rx_data_dev;
1898 + struct rc32434_local* lp = netdev_priv(dev);
1899 + volatile DMAD_t rd = &lp->rd_ring[lp->rx_next_done];
1900 + struct sk_buff *skb, *skb_new;
1902 + u32 devcs, count, pkt_len, pktuncrc_len;
1903 + volatile u32 dmas;
1904 +#ifdef CONFIG_IDT_USE_NAPI
1906 + int rx_work_limit = min(*budget,dev->quota);
1908 + unsigned long flags;
1909 + spin_lock_irqsave(&lp->lock, flags);
1912 + while ( (count = RC32434_RBSIZE - (u32)DMA_COUNT(rd->control)) != 0) {
1913 +#ifdef CONFIG_IDT_USE_NAPI
1914 + if(--rx_work_limit <0)
1919 + /* init the var. used for the later operations within the while loop */
1921 + devcs = rd->devcs;
1922 + pkt_len = RCVPKT_LENGTH(devcs);
1923 + skb = lp->rx_skb[lp->rx_next_done];
1926 + lp->stats.rx_errors++;
1927 + lp->stats.rx_dropped++;
1929 + else if ((devcs & ( ETHRX_ld_m)) != ETHRX_ld_m) {
1930 + /* check that this is a whole packet */
1931 + /* WARNING: DMA_FD bit incorrectly set in Rc32434 (errata ref #077) */
1932 + lp->stats.rx_errors++;
1933 + lp->stats.rx_dropped++;
1935 + else if ( (devcs & ETHRX_rok_m) ) {
1938 + /* must be the (first and) last descriptor then */
1939 + pkt_buf = (u8*)lp->rx_skb[lp->rx_next_done]->data;
1941 + pktuncrc_len = pkt_len - 4;
1942 + /* invalidate the cache */
1943 + dma_cache_inv((unsigned long)pkt_buf, pktuncrc_len);
1945 + /* Malloc up new buffer. */
1946 + skb_new = dev_alloc_skb(RC32434_RBSIZE + 2);
1948 + if (skb_new != NULL){
1950 + skb_put(skb, pktuncrc_len);
1952 + skb->protocol = eth_type_trans(skb, dev);
1954 + /* pass the packet to upper layers */
1955 +#ifdef CONFIG_IDT_USE_NAPI
1956 + netif_receive_skb(skb);
1961 + dev->last_rx = jiffies;
1962 + lp->stats.rx_packets++;
1963 + lp->stats.rx_bytes += pktuncrc_len;
1965 + if (IS_RCV_MP(devcs))
1966 + lp->stats.multicast++;
1968 + /* 16 bit align */
1969 + skb_reserve(skb_new, 2);
1971 + skb_new->dev = dev;
1972 + lp->rx_skb[lp->rx_next_done] = skb_new;
1975 + ERR("no memory, dropping rx packet.\n");
1976 + lp->stats.rx_errors++;
1977 + lp->stats.rx_dropped++;
1983 + /* This should only happen if we enable accepting broken packets */
1984 + lp->stats.rx_errors++;
1985 + lp->stats.rx_dropped++;
1987 + /* add statistics counters */
1988 + if (IS_RCV_CRC_ERR(devcs)) {
1989 + DBG(2, "RX CRC error\n");
1990 + lp->stats.rx_crc_errors++;
1992 + else if (IS_RCV_LOR_ERR(devcs)) {
1993 + DBG(2, "RX LOR error\n");
1994 + lp->stats.rx_length_errors++;
1996 + else if (IS_RCV_LE_ERR(devcs)) {
1997 + DBG(2, "RX LE error\n");
1998 + lp->stats.rx_length_errors++;
2000 + else if (IS_RCV_OVR_ERR(devcs)) {
2001 + lp->stats.rx_over_errors++;
2003 + else if (IS_RCV_CV_ERR(devcs)) {
2004 + /* code violation */
2005 + DBG(2, "RX CV error\n");
2006 + lp->stats.rx_frame_errors++;
2008 + else if (IS_RCV_CES_ERR(devcs)) {
2009 + DBG(2, "RX Preamble error\n");
2015 + /* restore descriptor's curr_addr */
2017 + rd->ca = CPHYSADDR(skb_new->data);
2019 + rd->ca = CPHYSADDR(skb->data);
2021 + rd->control = DMA_COUNT(RC32434_RBSIZE) |DMAD_cod_m |DMAD_iod_m;
2022 + lp->rd_ring[(lp->rx_next_done-1)& RC32434_RDS_MASK].control &= ~(DMAD_cod_m);
2024 + lp->rx_next_done = (lp->rx_next_done + 1) & RC32434_RDS_MASK;
2025 + rd = &lp->rd_ring[lp->rx_next_done];
2026 + rc32434_writel( ~DMAS_d_m, &lp->rx_dma_regs->dmas);
2028 +#ifdef CONFIG_IDT_USE_NAPI
2029 + dev->quota -= received;
2030 + *budget =- received;
2031 + if(rx_work_limit < 0)
2035 + dmas = rc32434_readl(&lp->rx_dma_regs->dmas);
2037 + if(dmas & DMAS_h_m) {
2038 + rc32434_writel( ~(DMAS_h_m | DMAS_e_m), &lp->rx_dma_regs->dmas);
2039 +#ifdef RC32434_PROC_DEBUG
2040 + lp->dma_halt_cnt++;
2043 + skb = lp->rx_skb[lp->rx_next_done];
2044 + rd->ca = CPHYSADDR(skb->data);
2045 + rc32434_chain_rx(lp,rd);
2048 +#ifdef CONFIG_IDT_USE_NAPI
2049 + netif_rx_complete(dev);
2051 + /* Enable D H E bit in Rx DMA */
2052 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m |DMASM_e_m), &lp->rx_dma_regs->dmasm);
2053 +#ifdef CONFIG_IDT_USE_NAPI
2058 + spin_unlock_irqrestore(&lp->lock, flags);
2067 +/* Ethernet Tx DMA interrupt */
2069 +rc32434_tx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs)
2071 + struct net_device *dev = (struct net_device *)dev_id;
2072 + struct rc32434_local *lp;
2073 + volatile u32 dmas,dmasm;
2074 + irqreturn_t retval;
2076 + ASSERT(dev != NULL);
2078 + lp = (struct rc32434_local *)dev->priv;
2080 + spin_lock(&lp->lock);
2082 + dmas = rc32434_readl(&lp->tx_dma_regs->dmas);
2084 + if (dmas & (DMAS_f_m | DMAS_e_m)) {
2085 + dmasm = rc32434_readl(&lp->tx_dma_regs->dmasm);
2086 + /* Mask F E bit in Tx DMA */
2087 + rc32434_writel(dmasm | (DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2089 + tasklet_hi_schedule(lp->tx_tasklet);
2091 + if(lp->tx_chain_status == filled && (rc32434_readl(&(lp->tx_dma_regs->dmandptr)) == 0)) {
2092 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr));
2093 + lp->tx_chain_status = empty;
2094 + lp->tx_chain_head = lp->tx_chain_tail;
2095 + dev->trans_start = jiffies;
2098 + if (dmas & DMAS_e_m)
2099 + ERR(": DMA error\n");
2101 + retval = IRQ_HANDLED;
2104 + retval = IRQ_NONE;
2106 + spin_unlock(&lp->lock);
2112 +static void rc32434_tx_tasklet(unsigned long tx_data_dev)
2114 + struct net_device *dev = (struct net_device *)tx_data_dev;
2115 + struct rc32434_local* lp = (struct rc32434_local *)dev->priv;
2116 + volatile DMAD_t td = &lp->td_ring[lp->tx_next_done];
2118 + unsigned long flags;
2119 + volatile u32 dmas;
2121 + spin_lock_irqsave(&lp->lock, flags);
2123 + /* process all desc that are done */
2124 + while(IS_DMA_FINISHED(td->control)) {
2125 + if(lp->tx_full == 1) {
2126 + netif_wake_queue(dev);
2130 + devcs = lp->td_ring[lp->tx_next_done].devcs;
2131 + if ((devcs & (ETHTX_fd_m | ETHTX_ld_m)) != (ETHTX_fd_m | ETHTX_ld_m)) {
2132 + lp->stats.tx_errors++;
2133 + lp->stats.tx_dropped++;
2135 + /* should never happen */
2136 + DBG(1, __FUNCTION__ ": split tx ignored\n");
2138 + else if (IS_TX_TOK(devcs)) {
2139 + lp->stats.tx_packets++;
2142 + lp->stats.tx_errors++;
2143 + lp->stats.tx_dropped++;
2146 + if (IS_TX_UND_ERR(devcs))
2147 + lp->stats.tx_fifo_errors++;
2149 + /* oversized frame */
2150 + if (IS_TX_OF_ERR(devcs))
2151 + lp->stats.tx_aborted_errors++;
2153 + /* excessive deferrals */
2154 + if (IS_TX_ED_ERR(devcs))
2155 + lp->stats.tx_carrier_errors++;
2157 + /* collisions: medium busy */
2158 + if (IS_TX_EC_ERR(devcs))
2159 + lp->stats.collisions++;
2161 + /* late collision */
2162 + if (IS_TX_LC_ERR(devcs))
2163 + lp->stats.tx_window_errors++;
2167 + /* We must always free the original skb */
2168 + if (lp->tx_skb[lp->tx_next_done] != NULL) {
2169 + dev_kfree_skb_any(lp->tx_skb[lp->tx_next_done]);
2170 + lp->tx_skb[lp->tx_next_done] = NULL;
2173 + lp->td_ring[lp->tx_next_done].control = DMAD_iof_m;
2174 + lp->td_ring[lp->tx_next_done].devcs = ETHTX_fd_m | ETHTX_ld_m;
2175 + lp->td_ring[lp->tx_next_done].link = 0;
2176 + lp->td_ring[lp->tx_next_done].ca = 0;
2179 + /* go on to next transmission */
2180 + lp->tx_next_done = (lp->tx_next_done + 1) & RC32434_TDS_MASK;
2181 + td = &lp->td_ring[lp->tx_next_done];
2185 + dmas = rc32434_readl(&lp->tx_dma_regs->dmas);
2186 + rc32434_writel( ~dmas, &lp->tx_dma_regs->dmas);
2188 + /* Enable F E bit in Tx DMA */
2189 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2190 + spin_unlock_irqrestore(&lp->lock, flags);
2195 +static struct net_device_stats * rc32434_get_stats(struct net_device *dev)
2197 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2198 + return &lp->stats;
2203 + * Set or clear the multicast filter for this adaptor.
2205 +static void rc32434_multicast_list(struct net_device *dev)
2207 + /* listen to broadcasts always and to treat */
2208 + /* IFF bits independantly */
2209 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2210 + unsigned long flags;
2211 + u32 recognise = ETHARC_ab_m; /* always accept broadcasts */
2213 + if (dev->flags & IFF_PROMISC) /* set promiscuous mode */
2214 + recognise |= ETHARC_pro_m;
2216 + if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 15))
2217 + recognise |= ETHARC_am_m; /* all multicast & bcast */
2218 + else if (dev->mc_count > 0) {
2219 + DBG(2, __FUNCTION__ ": mc_count %d\n", dev->mc_count);
2220 + recognise |= ETHARC_am_m; /* for the time being */
2223 + spin_lock_irqsave(&lp->lock, flags);
2224 + rc32434_writel(recognise, &lp->eth_regs->etharc);
2225 + spin_unlock_irqrestore(&lp->lock, flags);
2229 +static void rc32434_tx_timeout(struct net_device *dev)
2231 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2232 + unsigned long flags;
2234 + spin_lock_irqsave(&lp->lock, flags);
2235 + rc32434_restart(dev);
2236 + spin_unlock_irqrestore(&lp->lock, flags);
2242 + * Initialize the RC32434 ethernet controller.
2244 +static int rc32434_init(struct net_device *dev)
2246 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2250 + rc32434_abort_tx(dev);
2251 + rc32434_abort_rx(dev);
2253 + /* reset ethernet logic */
2254 + rc32434_writel(0, &lp->eth_regs->ethintfc);
2255 + while((rc32434_readl(&lp->eth_regs->ethintfc) & ETHINTFC_rip_m))
2256 + dev->trans_start = jiffies;
2258 + /* Enable Ethernet Interface */
2259 + rc32434_writel(ETHINTFC_en_m, &lp->eth_regs->ethintfc);
2261 +#ifndef CONFIG_IDT_USE_NAPI
2262 + tasklet_disable(lp->rx_tasklet);
2264 + tasklet_disable(lp->tx_tasklet);
2266 + /* Initialize the transmit Descriptors */
2267 + for (i = 0; i < RC32434_NUM_TDS; i++) {
2268 + lp->td_ring[i].control = DMAD_iof_m;
2269 + lp->td_ring[i].devcs = ETHTX_fd_m | ETHTX_ld_m;
2270 + lp->td_ring[i].ca = 0;
2271 + lp->td_ring[i].link = 0;
2272 + if (lp->tx_skb[i] != NULL) {
2273 + dev_kfree_skb_any(lp->tx_skb[i]);
2274 + lp->tx_skb[i] = NULL;
2277 + lp->tx_next_done = lp->tx_chain_head = lp->tx_chain_tail = lp->tx_full = lp->tx_count = 0;
2278 + lp-> tx_chain_status = empty;
2281 + * Initialize the receive descriptors so that they
2282 + * become a circular linked list, ie. let the last
2283 + * descriptor point to the first again.
2285 + for (i=0; i<RC32434_NUM_RDS; i++) {
2286 + struct sk_buff *skb = lp->rx_skb[i];
2288 + if (lp->rx_skb[i] == NULL) {
2289 + skb = dev_alloc_skb(RC32434_RBSIZE + 2);
2290 + if (skb == NULL) {
2291 + ERR("No memory in the system\n");
2292 + for (j = 0; j < RC32434_NUM_RDS; j ++)
2293 + if (lp->rx_skb[j] != NULL)
2294 + dev_kfree_skb_any(lp->rx_skb[j]);
2300 + skb_reserve(skb, 2);
2301 + lp->rx_skb[i] = skb;
2302 + lp->rd_ring[i].ca = CPHYSADDR(skb->data);
2306 + lp->rd_ring[i].control = DMAD_iod_m | DMA_COUNT(RC32434_RBSIZE);
2307 + lp->rd_ring[i].devcs = 0;
2308 + lp->rd_ring[i].ca = CPHYSADDR(skb->data);
2309 + lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]);
2313 + lp->rd_ring[RC32434_NUM_RDS-1].link = CPHYSADDR(&lp->rd_ring[0]);
2314 + lp->rx_next_done = 0;
2316 + lp->rd_ring[RC32434_NUM_RDS-1].control |= DMAD_cod_m;
2317 + lp->rx_chain_head = 0;
2318 + lp->rx_chain_tail = 0;
2319 + lp->rx_chain_status = empty;
2321 + rc32434_writel(0, &lp->rx_dma_regs->dmas);
2322 + /* Start Rx DMA */
2323 + rc32434_start_rx(lp, &lp->rd_ring[0]);
2325 + /* Enable F E bit in Tx DMA */
2326 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2327 + /* Enable D H E bit in Rx DMA */
2328 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm);
2330 + /* Accept only packets destined for this Ethernet device address */
2331 + rc32434_writel(ETHARC_ab_m, &lp->eth_regs->etharc);
2333 + /* Set all Ether station address registers to their initial values */
2334 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal0);
2335 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah0);
2337 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal1);
2338 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah1);
2340 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal2);
2341 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah2);
2343 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal3);
2344 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah3);
2347 + /* Frame Length Checking, Pad Enable, CRC Enable, Full Duplex set */
2348 + rc32434_writel(ETHMAC2_pe_m | ETHMAC2_cen_m | ETHMAC2_fd_m, &lp->eth_regs->ethmac2);
2349 + //ETHMAC2_flc_m ETHMAC2_fd_m lp->duplex_mode
2351 + /* Back to back inter-packet-gap */
2352 + rc32434_writel(0x15, &lp->eth_regs->ethipgt);
2353 + /* Non - Back to back inter-packet-gap */
2354 + rc32434_writel(0x12, &lp->eth_regs->ethipgr);
2356 + /* Management Clock Prescaler Divisor */
2357 + /* Clock independent setting */
2358 + rc32434_writel(((idt_cpu_freq)/MII_CLOCK+1) & ~1,
2359 + &lp->eth_regs->ethmcp);
2361 + /* don't transmit until fifo contains 48b */
2362 + rc32434_writel(48, &lp->eth_regs->ethfifott);
2364 + rc32434_writel(ETHMAC1_re_m, &lp->eth_regs->ethmac1);
2366 +#ifndef CONFIG_IDT_USE_NAPI
2367 + tasklet_enable(lp->rx_tasklet);
2369 + tasklet_enable(lp->tx_tasklet);
2371 + netif_start_queue(dev);
2381 +static int __init rc32434_setup(char *options)
2383 + /* no options yet */
2387 +static int __init rc32434_setup_ethaddr0(char *options)
2389 + memcpy(mac0, options, 17);
2394 +__setup("rc32434eth=", rc32434_setup);
2395 +__setup("ethaddr0=", rc32434_setup_ethaddr0);
2398 +#endif /* MODULE */
2400 +module_init(rc32434_init_module);
2401 +module_exit(rc32434_cleanup_module);
2416 diff -Nur linux-2.6.15/drivers/net/rc32434_eth.h linux-2.6.15-openwrt/drivers/net/rc32434_eth.h
2417 --- linux-2.6.15/drivers/net/rc32434_eth.h 1970-01-01 01:00:00.000000000 +0100
2418 +++ linux-2.6.15-openwrt/drivers/net/rc32434_eth.h 2006-01-10 00:32:33.000000000 +0100
2420 +/**************************************************************************
2422 + * BRIEF MODULE DESCRIPTION
2423 + * Definitions for IDT RC32434 on-chip ethernet controller.
2425 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2427 + * This program is free software; you can redistribute it and/or modify it
2428 + * under the terms of the GNU General Public License as published by the
2429 + * Free Software Foundation; either version 2 of the License, or (at your
2430 + * option) any later version.
2432 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2433 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2434 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2435 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2436 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2437 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2438 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2439 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2440 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2441 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2443 + * You should have received a copy of the GNU General Public License along
2444 + * with this program; if not, write to the Free Software Foundation, Inc.,
2445 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2448 + **************************************************************************
2449 + * May 2004 rkt, neb
2457 + **************************************************************************
2461 +#include <asm/idt-boards/rc32434/rc32434.h>
2462 +#include <asm/idt-boards/rc32434/rc32434_dma_v.h>
2463 +#include <asm/idt-boards/rc32434/rc32434_eth_v.h>
2465 +#define RC32434_DEBUG 2
2466 +//#define RC32434_PROC_DEBUG
2467 +#undef RC32434_DEBUG
2469 +#ifdef RC32434_DEBUG
2471 +/* use 0 for production, 1 for verification, >2 for debug */
2472 +static int rc32434_debug = RC32434_DEBUG;
2473 +#define ASSERT(expr) \
2475 + printk( "Assertion failed! %s,%s,%s,line=%d\n", \
2476 + #expr,__FILE__,__FUNCTION__,__LINE__); }
2477 +#define DBG(lvl, format, arg...) if (rc32434_debug > lvl) printk(KERN_INFO "%s: " format, dev->name , ## arg)
2479 +#define ASSERT(expr) do {} while (0)
2480 +#define DBG(lvl, format, arg...) do {} while (0)
2483 +#define INFO(format, arg...) printk(KERN_INFO "%s: " format, dev->name , ## arg)
2484 +#define ERR(format, arg...) printk(KERN_ERR "%s: " format, dev->name , ## arg)
2485 +#define WARN(format, arg...) printk(KERN_WARNING "%s: " format, dev->name , ## arg)
2487 +#define ETH0_DMA_RX_IRQ GROUP1_IRQ_BASE + 0
2488 +#define ETH0_DMA_TX_IRQ GROUP1_IRQ_BASE + 1
2489 +#define ETH0_RX_OVR_IRQ GROUP3_IRQ_BASE + 9
2490 +#define ETH0_TX_UND_IRQ GROUP3_IRQ_BASE + 10
2492 +#define ETH0_RX_DMA_ADDR (DMA0_PhysicalAddress + 0*DMA_CHAN_OFFSET)
2493 +#define ETH0_TX_DMA_ADDR (DMA0_PhysicalAddress + 1*DMA_CHAN_OFFSET)
2495 +/* the following must be powers of two */
2496 +#ifdef CONFIG_IDT_USE_NAPI
2497 +#define RC32434_NUM_RDS 64 /* number of receive descriptors */
2498 +#define RC32434_NUM_TDS 64 /* number of transmit descriptors */
2500 +#define RC32434_NUM_RDS 128 /* number of receive descriptors */
2501 +#define RC32434_NUM_TDS 128 /* number of transmit descriptors */
2504 +#define RC32434_RBSIZE 1536 /* size of one resource buffer = Ether MTU */
2505 +#define RC32434_RDS_MASK (RC32434_NUM_RDS-1)
2506 +#define RC32434_TDS_MASK (RC32434_NUM_TDS-1)
2507 +#define RD_RING_SIZE (RC32434_NUM_RDS * sizeof(struct DMAD_s))
2508 +#define TD_RING_SIZE (RC32434_NUM_TDS * sizeof(struct DMAD_s))
2510 +#define RC32434_TX_TIMEOUT HZ * 100
2512 +#define rc32434_eth0_regs ((ETH_t)(ETH0_VirtualAddress))
2513 +#define rc32434_eth1_regs ((ETH_t)(ETH1_VirtualAddress))
2515 +enum status { filled, empty};
2516 +#define IS_DMA_FINISHED(X) (((X) & (DMAD_f_m)) != 0)
2517 +#define IS_DMA_DONE(X) (((X) & (DMAD_d_m)) != 0)
2520 +/* Information that need to be kept for each board. */
2521 +struct rc32434_local {
2523 + DMA_Chan_t rx_dma_regs;
2524 + DMA_Chan_t tx_dma_regs;
2525 + volatile DMAD_t td_ring; /* transmit descriptor ring */
2526 + volatile DMAD_t rd_ring; /* receive descriptor ring */
2528 + struct sk_buff* tx_skb[RC32434_NUM_TDS]; /* skbuffs for pkt to trans */
2529 + struct sk_buff* rx_skb[RC32434_NUM_RDS]; /* skbuffs for pkt to trans */
2531 +#ifndef CONFIG_IDT_USE_NAPI
2532 + struct tasklet_struct * rx_tasklet;
2534 + struct tasklet_struct * tx_tasklet;
2537 + int rx_chain_head;
2538 + int rx_chain_tail;
2539 + enum status rx_chain_status;
2542 + int tx_chain_head;
2543 + int tx_chain_tail;
2544 + enum status tx_chain_status;
2548 + struct timer_list mii_phy_timer;
2549 + unsigned long duplex_mode;
2556 + struct net_device_stats stats;
2559 + /* debug /proc entry */
2560 + struct proc_dir_entry *ps;
2561 + int dma_halt_cnt; int dma_run_cnt;
2564 +extern unsigned int idt_cpu_freq;
2566 +/* Index to functions, as function prototypes. */
2567 +static int rc32434_open(struct net_device *dev);
2568 +static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev);
2569 +static void rc32434_mii_handler(unsigned long data);
2570 +static irqreturn_t rc32434_und_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2571 +static irqreturn_t rc32434_rx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2572 +static irqreturn_t rc32434_tx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2573 +#ifdef RC32434_REVISION
2574 +static irqreturn_t rc32434_ovr_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2576 +static int rc32434_close(struct net_device *dev);
2577 +static struct net_device_stats *rc32434_get_stats(struct net_device *dev);
2578 +static void rc32434_multicast_list(struct net_device *dev);
2579 +static int rc32434_init(struct net_device *dev);
2580 +static void rc32434_tx_timeout(struct net_device *dev);
2582 +static void rc32434_tx_tasklet(unsigned long tx_data_dev);
2583 +#ifdef CONFIG_IDT_USE_NAPI
2584 +static int rc32434_poll(struct net_device *rx_data_dev, int *budget);
2586 +static void rc32434_rx_tasklet(unsigned long rx_data_dev);
2588 +static void rc32434_cleanup_module(void);
2589 +static int rc32434_probe(int port_num);
2590 +int rc32434_init_module(void);
2593 +static inline void rc32434_abort_dma(struct net_device *dev, DMA_Chan_t ch)
2595 + if (rc32434_readl(&ch->dmac) & DMAC_run_m) {
2596 + rc32434_writel(0x10, &ch->dmac);
2598 + while (!(rc32434_readl(&ch->dmas) & DMAS_h_m))
2599 + dev->trans_start = jiffies;
2601 + rc32434_writel(0, &ch->dmas);
2604 + rc32434_writel(0, &ch->dmadptr);
2605 + rc32434_writel(0, &ch->dmandptr);
2607 diff -Nur linux-2.6.15/include/asm-mips/bootinfo.h linux-2.6.15-openwrt/include/asm-mips/bootinfo.h
2608 --- linux-2.6.15/include/asm-mips/bootinfo.h 2006-01-03 04:21:10.000000000 +0100
2609 +++ linux-2.6.15-openwrt/include/asm-mips/bootinfo.h 2006-01-10 00:32:33.000000000 +0100
2610 @@ -218,6 +218,17 @@
2611 #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
2612 #define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
2616 + * Valid machtype for group ARUBA
2618 +#define MACH_GROUP_ARUBA 23
2619 +#define MACH_ARUBA_UNKNOWN 0
2620 +#define MACH_ARUBA_AP60 1
2621 +#define MACH_ARUBA_AP65 2
2622 +#define MACH_ARUBA_AP70 3
2623 +#define MACH_ARUBA_AP40 4
2625 #define CL_SIZE COMMAND_LINE_SIZE
2627 const char *get_system_type(void);
2628 diff -Nur linux-2.6.15/include/asm-mips/cpu.h linux-2.6.15-openwrt/include/asm-mips/cpu.h
2629 --- linux-2.6.15/include/asm-mips/cpu.h 2006-01-03 04:21:10.000000000 +0100
2630 +++ linux-2.6.15-openwrt/include/asm-mips/cpu.h 2006-01-10 00:32:33.000000000 +0100
2632 #define PRID_IMP_R12000 0x0e00
2633 #define PRID_IMP_R8000 0x1000
2634 #define PRID_IMP_PR4450 0x1200
2635 +#define PRID_IMP_RC32334 0x1800
2636 +#define PRID_IMP_RC32355 0x1900
2637 +#define PRID_IMP_RC32365 0x1900
2638 #define PRID_IMP_R4600 0x2000
2639 #define PRID_IMP_R4700 0x2100
2640 #define PRID_IMP_TX39 0x2200
2643 #define CPU_PR4450 61
2645 -#define CPU_LAST 62
2646 +#define CPU_RC32300 63
2647 +#define CPU_LAST 63
2650 * ISA Level encodings
2651 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32300.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32300.h
2652 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32300.h 1970-01-01 01:00:00.000000000 +0100
2653 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32300.h 2006-01-10 00:32:33.000000000 +0100
2655 +/**************************************************************************
2657 + * BRIEF MODULE DESCRIPTION
2658 + * RC32300 helper routines
2660 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2662 + * This program is free software; you can redistribute it and/or modify it
2663 + * under the terms of the GNU General Public License as published by the
2664 + * Free Software Foundation; either version 2 of the License, or (at your
2665 + * option) any later version.
2667 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2668 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2669 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2670 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2671 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2672 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2673 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2674 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2675 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2676 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2678 + * You should have received a copy of the GNU General Public License along
2679 + * with this program; if not, write to the Free Software Foundation, Inc.,
2680 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2683 + **************************************************************************
2684 + * May 2004 P. Sadik.
2690 + **************************************************************************
2693 +#ifndef __IDT_RC32300_H__
2694 +#define __IDT_RC32300_H__
2696 +#include <linux/delay.h>
2697 +#include <asm/io.h>
2700 +/* cpu pipeline flush */
2701 +static inline void rc32300_sync(void)
2703 + __asm__ volatile ("sync");
2706 +static inline void rc32300_sync_udelay(int us)
2708 + __asm__ volatile ("sync");
2712 +static inline void rc32300_sync_delay(int ms)
2714 + __asm__ volatile ("sync");
2719 + * Macros to access internal RC32300 registers. No byte
2720 + * swapping should be done when accessing the internal
2724 +static inline u8 rc32300_readb(unsigned long pa)
2726 + return *((volatile u8 *)KSEG1ADDR(pa));
2728 +static inline u16 rc32300_readw(unsigned long pa)
2730 + return *((volatile u16 *)KSEG1ADDR(pa));
2732 +static inline u32 rc32300_readl(unsigned long pa)
2734 + return *((volatile u32 *)KSEG1ADDR(pa));
2736 +static inline void rc32300_writeb(u8 val, unsigned long pa)
2738 + *((volatile u8 *)KSEG1ADDR(pa)) = val;
2740 +static inline void rc32300_writew(u16 val, unsigned long pa)
2742 + *((volatile u16 *)KSEG1ADDR(pa)) = val;
2744 +static inline void rc32300_writel(u32 val, unsigned long pa)
2746 + *((volatile u32 *)KSEG1ADDR(pa)) = val;
2750 +#define local_readb __raw_readb
2751 +#define local_readw __raw_readw
2752 +#define local_readl __raw_readl
2754 +#define local_writeb __raw_writeb
2755 +#define local_writew __raw_writew
2756 +#define local_writel __raw_writel
2760 + * C access to CLZ and CLO instructions
2761 + * (count leading zeroes/ones).
2763 +static inline int rc32300_clz(unsigned long val)
2766 + __asm__ volatile (
2767 + ".set\tnoreorder\n\t"
2769 + ".set\tmips32\n\t"
2779 +static inline int rc32300_clo(unsigned long val)
2782 + __asm__ volatile (
2783 + ".set\tnoreorder\n\t"
2785 + ".set\tmips32\n\t"
2796 +#endif // __IDT_RC32300_H__
2797 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32334.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32334.h
2798 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32334.h 1970-01-01 01:00:00.000000000 +0100
2799 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32334.h 2006-01-10 00:32:33.000000000 +0100
2801 +/**************************************************************************
2803 + * BRIEF MODULE DESCRIPTION
2804 + * Definitions for IDT RC32334 CPU.
2806 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2808 + * This program is free software; you can redistribute it and/or modify it
2809 + * under the terms of the GNU General Public License as published by the
2810 + * Free Software Foundation; either version 2 of the License, or (at your
2811 + * option) any later version.
2813 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2814 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2815 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2816 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2817 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2818 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2819 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2820 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2821 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2822 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2824 + * You should have received a copy of the GNU General Public License along
2825 + * with this program; if not, write to the Free Software Foundation, Inc.,
2826 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2829 + **************************************************************************
2830 + * May 2004 P. Sadik.
2836 + **************************************************************************
2840 +#ifndef __IDT_RC32334_H__
2841 +#define __IDT_RC32334_H__
2843 +#include <linux/delay.h>
2844 +#include <asm/io.h>
2846 +/* Base address of internal registers */
2847 +#define RC32334_REG_BASE 0x18000000
2849 +/* CPU and IP Bus Control */
2850 +#define CPU_PORT_WIDTH 0xffffe200 // virtual!
2851 +#define CPU_BTA 0xffffe204 // virtual!
2852 +#define CPU_BUSERR_ADDR 0xffffe208 // virtual!
2853 +#define CPU_IP_BTA (RC32334_REG_BASE + 0x0000)
2854 +#define CPU_IP_ADDR_LATCH (RC32334_REG_BASE + 0x0004)
2855 +#define CPU_IP_ARBITRATION (RC32334_REG_BASE + 0x0008)
2856 +#define CPU_IP_BUSERR_CNTL (RC32334_REG_BASE + 0x0010)
2857 +#define CPU_IP_BUSERR_ADDR (RC32334_REG_BASE + 0x0014)
2858 +#define CPU_IP_SYSID (RC32334_REG_BASE + 0x0018)
2860 +/* Memory Controller */
2861 +#define MEM_BASE_BANK0 (RC32334_REG_BASE + 0x0080)
2862 +#define MEM_MASK_BANK0 (RC32334_REG_BASE + 0x0084)
2863 +#define MEM_CNTL_BANK0 (RC32334_REG_BASE + 0x0200)
2864 +#define MEM_BASE_BANK1 (RC32334_REG_BASE + 0x0088)
2865 +#define MEM_MASK_BANK1 (RC32334_REG_BASE + 0x008c)
2866 +#define MEM_CNTL_BANK1 (RC32334_REG_BASE + 0x0204)
2867 +#define MEM_CNTL_BANK2 (RC32334_REG_BASE + 0x0208)
2868 +#define MEM_CNTL_BANK3 (RC32334_REG_BASE + 0x020c)
2869 +#define MEM_CNTL_BANK4 (RC32334_REG_BASE + 0x0210)
2870 +#define MEM_CNTL_BANK5 (RC32334_REG_BASE + 0x0214)
2872 +/* PCI Controller */
2873 +#define PCI_INTR_PEND (RC32334_REG_BASE + 0x05b0)
2874 +#define PCI_INTR_MASK (RC32334_REG_BASE + 0x05b4)
2875 +#define PCI_INTR_CLEAR (RC32334_REG_BASE + 0x05b8)
2876 +#define CPU2PCI_INTR_PEND (RC32334_REG_BASE + 0x05c0)
2877 +#define CPU2PCI_INTR_MASK (RC32334_REG_BASE + 0x05c4)
2878 +#define CPU2PCI_INTR_CLEAR (RC32334_REG_BASE + 0x05c8)
2879 +#define PCI2CPU_INTR_PEND (RC32334_REG_BASE + 0x05d0)
2880 +#define PCI2CPU_INTR_MASK (RC32334_REG_BASE + 0x05d4)
2881 +#define PCI2CPU_INTR_CLEAR (RC32334_REG_BASE + 0x05d8)
2882 +#define PCI_MEM1_BASE (RC32334_REG_BASE + 0x20b0)
2883 +#define PCI_MEM2_BASE (RC32334_REG_BASE + 0x20b8)
2884 +#define PCI_MEM3_BASE (RC32334_REG_BASE + 0x20c0)
2885 +#define PCI_IO1_BASE (RC32334_REG_BASE + 0x20c8)
2886 +#define PCI_ARBITRATION (RC32334_REG_BASE + 0x20e0)
2887 +#define PCI_CPU_MEM1_BASE (RC32334_REG_BASE + 0x20e8)
2888 +#define PCI_CPU_IO_BASE (RC32334_REG_BASE + 0x2100)
2889 +#define PCI_CFG_CNTL (RC32334_REG_BASE + 0x2cf8)
2890 +#define PCI_CFG_DATA (RC32334_REG_BASE + 0x2cfc)
2893 +#define TIMER0_CNTL (RC32334_REG_BASE + 0x0700)
2894 +#define TIMER0_COUNT (RC32334_REG_BASE + 0x0704)
2895 +#define TIMER0_COMPARE (RC32334_REG_BASE + 0x0708)
2896 +#define TIMER_REG_OFFSET 0x10
2898 +/* Programmable I/O */
2899 +#define PIO_DATA0 (RC32334_REG_BASE + 0x0600)
2900 +#define PIO_DATA1 (RC32334_REG_BASE + 0x0610)
2905 + * NOTE: DMA_IO is a trick for non linear RC32300_IO_DMA stuff
2911 + * NB: dma number must be immediate value or variable.
2912 + * It MUST NOT be a function since it would get called twice!
2914 +#define DMA_IO(n) (((n)>1?0x500:0)+((n)&1?0x40:0))
2916 +#define RC32300_IO_DMA(n) (RC32334_REG_BASE + 0x1400 + DMA_IO(n))
2917 +#define RC32300_DMA_CONFREG(n) RC32300_IO_DMA(n)
2918 +#define RC32300_DMA_BASEREG(n) (RC32300_IO_DMA(n)+0x4)
2920 +#define RC32300_DMA_CURRREG(n) (RC32300_IO_DMA(n)+0x8)
2921 +#define RC32300_DMA_STATREG(n) (RC32300_IO_DMA(n)+0x10)
2922 +#define RC32300_DMA_SRCREG(n) (RC32300_IO_DMA(n)+0x14)
2923 +#define RC32300_DMA_DSTREG(n) (RC32300_IO_DMA(n)+0x18)
2924 +#define RC32300_DMA_NEXTREG(n) (RC32300_IO_DMA(n)+0x1c)
2926 +#define RC32300_DMA_IRQ(n) (GROUP7_IRQ_BASE+5*(n))
2928 +/* Expansion Interrupt Controller */
2929 +#define IC_GROUP0_PEND (RC32334_REG_BASE + 0x0500)
2930 +#define IC_GROUP0_MASK (RC32334_REG_BASE + 0x0504)
2931 +#define IC_GROUP0_CLEAR (RC32334_REG_BASE + 0x0508)
2932 +#define IC_GROUP_OFFSET 0x10
2934 +#define NUM_INTR_GROUPS 15
2936 + * The IRQ mapping is as follows:
2939 + * --- -------------------
2940 + * 0 SW0 (IP0) SW0 intr
2941 + * 1 SW1 (IP1) SW1 intr
2942 + * 2 Int0 (IP2) board-specific
2943 + * 3 Int1 (IP3) board-specific
2944 + * 4 Int2 (IP4) board-specific
2945 + * - Int3 (IP5) not used, mapped to IRQ's 8 and up
2946 + * 6 Int4 (IP6) board-specific
2947 + * 7 Int5 (IP7) CP0 Timer
2949 + * IRQ's 8 and up are all mapped to Int3 (IP5), which
2950 + * internally on the RC32334 is routed to the Expansion
2951 + * Interrupt Controller.
2953 +#define MIPS_CPU_TIMER_IRQ 7
2955 +#define GROUP1_IRQ_BASE 8 // bus error
2956 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 1) // PIO active low
2957 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 12) // PIO active high
2958 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 8) // Timer Rollovers
2959 +#define GROUP5_IRQ_BASE (GROUP4_IRQ_BASE + 8) // UART0
2960 +#define GROUP6_IRQ_BASE (GROUP5_IRQ_BASE + 3) // UART1
2961 +#define GROUP7_IRQ_BASE (GROUP6_IRQ_BASE + 3) // DMA Ch0
2962 +#define GROUP8_IRQ_BASE (GROUP7_IRQ_BASE + 5) // DMA Ch1
2963 +#define GROUP9_IRQ_BASE (GROUP8_IRQ_BASE + 5) // DMA Ch2
2964 +#define GROUP10_IRQ_BASE (GROUP9_IRQ_BASE + 5) // DMA Ch3
2965 +#define GROUP11_IRQ_BASE (GROUP10_IRQ_BASE + 5) // PCI Ctlr errors
2966 +#define GROUP12_IRQ_BASE (GROUP11_IRQ_BASE + 4) // PCI Satellite Mode
2967 +#define GROUP13_IRQ_BASE (GROUP12_IRQ_BASE + 16) // PCI to CPU Mailbox
2968 +#define GROUP14_IRQ_BASE (GROUP13_IRQ_BASE + 4) // SPI
2970 +#define RC32334_NR_IRQS (GROUP14_IRQ_BASE + 1)
2974 +#define RC32300_UART0_BASE (RC32334_REG_BASE + 0x0803)
2975 +#define RC32300_UART1_BASE (RC32334_REG_BASE + 0x0823)
2977 +#define RC32300_UART0_BASE (RC32334_REG_BASE + 0x0800)
2978 +#define RC32300_UART1_BASE (RC32334_REG_BASE + 0x0820)
2981 +#define RC32300_UART0_IRQ GROUP5_IRQ_BASE
2982 +#define RC32300_UART1_IRQ GROUP6_IRQ_BASE
2984 +#define IDT_CLOCK_MULT 2
2987 +#define NVRAM_BASE 0x12000000
2988 +#define NVRAM_ENVSIZE_OFF 4
2989 +#define NVRAM_ENVSTART_OFF 0x40
2991 +/* LCD 4-digit display */
2992 +#define LCD_CLEAR 0x14000400
2993 +#define LCD_DIGIT0 0x1400000f
2994 +#define LCD_DIGIT1 0x14000008
2995 +#define LCD_DIGIT2 0x14000007
2996 +#define LCD_DIGIT3 0x14000003
2998 +/* Interrupts routed on 79S334A board (see rc32334.h) */
2999 +#define RC32334_SCC8530_IRQ 2
3000 +#define RC32334_PCI_INTA_IRQ 3
3001 +#define RC32334_PCI_INTB_IRQ 4
3002 +#define RC32334_PCI_INTC_IRQ 6
3003 +#define RC32334_PCI_INTD_IRQ 7
3005 +#define RAM_SIZE (32*1024*1024)
3007 +#endif // __IDT_RC32334_H__
3008 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355_dma.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355_dma.h
3009 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355_dma.h 1970-01-01 01:00:00.000000000 +0100
3010 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355_dma.h 2006-01-10 00:32:33.000000000 +0100
3012 +/**************************************************************************
3014 + * BRIEF MODULE DESCRIPTION
3015 + * DMA controller defines on IDT RC32355
3017 + * Copyright 2004 IDT Inc.
3018 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3021 + * This program is free software; you can redistribute it and/or modify it
3022 + * under the terms of the GNU General Public License as published by the
3023 + * Free Software Foundation; either version 2 of the License, or (at your
3024 + * option) any later version.
3026 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3027 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3028 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3029 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3030 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3031 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3032 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3033 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3034 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3035 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3037 + * You should have received a copy of the GNU General Public License along
3038 + * with this program; if not, write to the Free Software Foundation, Inc.,
3039 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3045 + **************************************************************************
3048 +#ifndef BANYAN_DMA_H
3049 +#define BANYAN_DMA_H
3050 +#include <asm/idt-boards/rc32300/rc32300.h>
3053 + * An image of one RC32355 dma channel registers
3061 +} rc32355_dma_ch_t;
3064 + * An image of all RC32355 dma channel registers
3067 + rc32355_dma_ch_t ch[16];
3068 +} rc32355_dma_regs_t;
3071 +#define rc32355_dma_regs ((rc32355_dma_regs_t*)KSEG1ADDR(RC32355_DMA_BASE))
3074 +/* DMAC register layout */
3076 +#define DMAC_RUN 0x1 /* Halts processing when cleared */
3077 +#define DMAC_DM 0x2 /* Done Mask, ignore DMA events */
3078 +#define DMAC_MODE_MASK 0xC /* DMA operating mode */
3080 +#define DMAC_MODE_AUTO 0x0 /* DMA Auto Request Mode */
3081 +#define DMAC_MODE_BURST 0x4 /* DMA Burst Request Mode */
3082 +#define DMAC_MODE_TFER 0x8 /* DMA Transfer Request Mode */
3084 +/* DMAS and DMASM register layout */
3086 +#define DMAS_F 0x01 /* Finished */
3087 +#define DMAS_D 0x02 /* Done */
3088 +#define DMAS_C 0x04 /* Chain */
3089 +#define DMAS_E 0x08 /* Error */
3090 +#define DMAS_H 0x10 /* Halt */
3092 +/* Polling count for DMAS_H bit in DMAS register after halting DMA */
3093 +#define DMA_HALT_TIMEOUT 500
3096 +static inline int rc32355_halt_dma(rc32355_dma_ch_t* ch)
3100 + if (local_readl(&ch->dmac) & DMAC_RUN) {
3101 + local_writel(0, &ch->dmac);
3102 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
3103 + if (local_readl(&ch->dmas) & DMAS_H) {
3104 + local_writel(0, &ch->dmas);
3110 + return timeout ? 0 : 1;
3113 +static inline void rc32355_start_dma(rc32355_dma_ch_t* ch, u32 dma_addr)
3115 + local_writel(0, &ch->dmandptr);
3116 + local_writel(dma_addr, &ch->dmadptr);
3119 +static inline void rc32355_chain_dma(rc32355_dma_ch_t* ch, u32 dma_addr)
3121 + local_writel(dma_addr, &ch->dmandptr);
3125 +/* The following can be used to describe DMA channels 0 to 15, and the */
3126 +/* sub device's needed to select them in the DMADESC_DS_MASK field */
3128 +#define DMA_CHAN_ATM01 0 /* ATM interface 0,1 chan */
3130 +#define DMA_CHAN_ATM0IN 0 /* ATM interface 0 input */
3131 +#define DMA_DEV_ATM0IN 0 /* ATM interface 0 input */
3133 +#define DMA_CHAN_ATM1IN 0 /* ATM interface 1 input */
3134 +#define DMA_DEV_ATM1IN 1 /* ATM interface 1 input */
3136 +#define DMA_CHAN_ATM0OUT 0 /* ATM interface 0 output */
3137 +#define DMA_DEV_ATM0OUT 2 /* ATM interface 0 output */
3139 +#define DMA_CHAN_ATM1OUT 0 /* ATM interface 1 output */
3140 +#define DMA_DEV_ATM1OUT 3 /* ATM interface 1 output */
3142 +/* for entry in {0,1,2,3,4,5,6,7} - note 5,6,7 share with those below */
3143 +#define DMA_CHAN_ATMVCC(entry) ((entry)+1) /* ATM VC cache entry */
3144 +#define DMA_DEV_ATMVCC(entry) 0
3146 +#define DMA_CHAN_MEMTOMEM 6 /* Memory to memory DMA */
3147 +#define DMA_DEV_MEMTOMEM 1 /* Memory to memory DMA */
3149 +#define DMA_CHAN_ATMFMB0 7 /* ATM Frame Mode Buffer 0 */
3150 +#define DMA_DEV_ATMFMB0 1 /* ATM Frame Mode Buffer 0 */
3152 +#define DMA_CHAN_ATMFMB1 8 /* ATM Frame Mode Buffer 1 */
3153 +#define DMA_DEV_ATMFMB1 1 /* ATM Frame Mode Buffer 1 */
3155 +#define DMA_CHAN_ETHERIN 9 /* Ethernet input */
3156 +#define DMA_DEV_ETHERIN 0 /* Ethernet input */
3158 +#define DMA_CHAN_ETHEROUT 10 /* Ethernet output */
3159 +#define DMA_DEV_ETHEROUT 0 /* Ethernet output */
3161 +#define DMA_CHAN_TDMIN 11 /* TDM Bus input */
3162 +#define DMA_DEV_TDMIN 0 /* TDM Bus input */
3164 +#define DMA_CHAN_TDMOUT 12 /* TDM Bus output */
3165 +#define DMA_DEV_TDMOUT 0 /* TDM Bus output */
3167 +#define DMA_CHAN_USBIN 13 /* USB input */
3168 +#define DMA_DEV_USBIN 0 /* USB input */
3170 +#define DMA_CHAN_USBOUT 14 /* USB output */
3171 +#define DMA_DEV_USBOUT 0 /* USB output */
3173 +#define DMA_CHAN_EXTERN 15 /* External DMA */
3174 +#define DMA_DEV_EXTERN 0 /* External DMA */
3177 + * An RC32355 dma descriptor in system memory
3180 + u32 cmdstat; /* control and status */
3181 + u32 curr_addr; /* current address of data */
3182 + u32 devcs; /* peripheral-specific control and status */
3183 + u32 link; /* link to next descriptor */
3184 +} rc32355_dma_desc_t;
3186 +/* Values for the descriptor cmdstat word */
3188 +#define DMADESC_F 0x80000000u /* Finished bit */
3189 +#define DMADESC_D 0x40000000u /* Done bit */
3190 +#define DMADESC_T 0x20000000u /* Terminated bit */
3191 +#define DMADESC_IOD 0x10000000u /* Interrupt On Done */
3192 +#define DMADESC_IOF 0x08000000u /* Interrupt On Finished */
3193 +#define DMADESC_COD 0x04000000u /* Chain On Done */
3194 +#define DMADESC_COF 0x02000000u /* Chain On Finished */
3196 +#define DMADESC_DEVCMD_MASK 0x01C00000u /* Device Command mask */
3197 +#define DMADESC_DEVCMD_SHIFT 22 /* Device Command shift */
3199 +#define DMADESC_DS_MASK 0x00300000u /* Device Select mask */
3200 +#define DMADESC_DS_SHIFT 20 /* Device Select shift */
3202 +#define DMADESC_COUNT_MASK 0x0003FFFFu /* Byte Count mask */
3203 +#define DMADESC_COUNT_SHIFT 0 /* Byte Count shift */
3205 +#define IS_DMA_FINISHED(X) ( ( (X) & DMADESC_F ) >> 31) /* F Bit */
3206 +#define IS_DMA_DONE(X) ( ( (X) & DMADESC_D ) >> 30) /* D Bit */
3207 +#define IS_DMA_TERMINATED(X) ( ( (X) & DMADESC_T ) >> 29) /* T Bit */
3208 +#define IS_DMA_USED(X) (((X) & (DMADESC_F | DMADESC_D | DMADESC_T)) != 0)
3210 +#define DMA_DEVCMD(devcmd) \
3211 + (((devcmd) << DMADESC_DEVCMD_SHIFT) & DMADESC_DS_MASK)
3212 +#define DMA_DS(ds) \
3213 + (((ds) << DMADESC_DS_SHIFT) & DMADESC_DS_MASK)
3214 +#define DMA_COUNT(count) \
3215 + ((count) & DMADESC_COUNT_MASK)
3217 +#endif /* RC32355_DMA_H */
3218 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355_eth.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355_eth.h
3219 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355_eth.h 1970-01-01 01:00:00.000000000 +0100
3220 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355_eth.h 2006-01-10 00:32:33.000000000 +0100
3222 +/**************************************************************************
3224 + * BRIEF MODULE DESCRIPTION
3225 + * Ethernet registers on IDT RC32355
3227 + * Copyright 2004 IDT Inc.
3228 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3231 + * This program is free software; you can redistribute it and/or modify it
3232 + * under the terms of the GNU General Public License as published by the
3233 + * Free Software Foundation; either version 2 of the License, or (at your
3234 + * option) any later version.
3236 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3237 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3238 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3239 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3240 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3241 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3242 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3243 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3244 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3245 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3247 + * You should have received a copy of the GNU General Public License along
3248 + * with this program; if not, write to the Free Software Foundation, Inc.,
3249 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3255 + **************************************************************************
3259 +#ifndef RC32355_ETHER_H
3260 +#define RC32355_ETHER_H
3262 +#include <asm/idt-boards/rc32300/rc32355_dma.h>
3265 + * A partial image of the RC32355 ethernet registers
3324 +} rc32355_eth_regs_t;
3326 +#define rc32355_eth_regs ((rc32355_eth_regs_t*)KSEG1ADDR(RC32355_ETH_BASE))
3328 +#define ETH_INTFC (RC32355_ETH_BASE + 0x000) /* INTerFace Control */
3329 +#define ETH_FIFOTT (RC32355_ETH_BASE + 0x004) /* FIFO Transmit Threshold */
3330 +#define ETH_ARC (RC32355_ETH_BASE + 0x008) /* Address Recognition Ctrl */
3331 +#define ETH_HASH0 (RC32355_ETH_BASE + 0x00C) /* 32 multicast Hash bits */
3332 +#define ETH_HASH1 (RC32355_ETH_BASE + 0x010) /* another 32 Hash bits */
3333 +#define ETH_FIFOST (RC32355_ETH_BASE + 0x014) /* FIFO Status Threshold */
3334 +#define ETH_FIFOS (RC32355_ETH_BASE + 0x018) /* FIFO Status Register */
3335 +#define ETH_ODEOPS (RC32355_ETH_BASE + 0x01C) /* Out Data End-Of-Pkt Size */
3336 +#define ETH_IS (RC32355_ETH_BASE + 0x020) /* Input Status */
3337 +#define ETH_OS (RC32355_ETH_BASE + 0x024) /* Output Status */
3338 +#define ETH_MCP (RC32355_ETH_BASE + 0x028) /* Managemt Clock Prescaler */
3339 +#define ETH_ID (RC32355_ETH_BASE + 0x030) /* Input Data register */
3340 +#define ETH_OD (RC32355_ETH_BASE + 0x040) /* Output Data register */
3341 +#define ETH_ODEOP (RC32355_ETH_BASE + 0x050) /* OD End-Of-Packet Size */
3343 +/* for n in { 0, 1, 2, 3 } */
3344 +#define ETH_SAL(n) (RC32355_ETH_BASE + 0x100 + (n * 8)) /* Stn Address 2-5 */
3345 +#define ETH_SAH(n) (RC32355_ETH_BASE + 0x104 + (n * 8)) /* Stn Address 0-1 */
3347 +#define ETH_RBC (RC32355_ETH_BASE + 0x120) /* Receive Byte Count */
3348 +#define ETH_RPC (RC32355_ETH_BASE + 0x124) /* Receive Packet Count */
3349 +#define ETH_RUPC (RC32355_ETH_BASE + 0x128) /* Rx Undersized Pkt count */
3350 +#define ETH_RFC (RC32355_ETH_BASE + 0x12C) /* Receive Fragment Count */
3351 +#define ETH_TBC (RC32355_ETH_BASE + 0x130) /* Transmit Byte Count */
3352 +#define ETH_GPF (RC32355_ETH_BASE + 0x134) /* Generate Pause Frame */
3353 +#define ETH_MAC1 (RC32355_ETH_BASE + 0x200) /* Medium Access Control 1 */
3354 +#define ETH_MAC2 (RC32355_ETH_BASE + 0x204) /* Medium Access Control 2 */
3355 +#define ETH_IPGT (RC32355_ETH_BASE + 0x208) /* Back-to-back InterPkt Gap */
3356 +#define ETH_IPGR (RC32355_ETH_BASE + 0x20C) /* Non " InterPkt Gap */
3357 +#define ETH_CLRT (RC32355_ETH_BASE + 0x210) /* Collis'n Window and Retry */
3358 +#define ETH_MAXF (RC32355_ETH_BASE + 0x214) /* Maximum Frame Length */
3359 +#define ETH_MTEST (RC32355_ETH_BASE + 0x21C) /* MAC Test */
3361 +#define ETHMIIM_CFG (RC32355_ETH_BASE + 0x220) /* MII Mgmt Configuration */
3362 +#define ETHMIIM_CMD (RC32355_ETH_BASE + 0x224) /* MII Mgmt Command */
3363 +#define ETHMIIM_ADDR (RC32355_ETH_BASE + 0x228) /* MII Mgmt Address */
3364 +#define ETHMIIM_WTD (RC32355_ETH_BASE + 0x22C) /* MII Mgmt Write Data */
3365 +#define ETHMIIM_RDD (RC32355_ETH_BASE + 0x230) /* MII Mgmt Read Data */
3366 +#define ETHMIIM_IND (RC32355_ETH_BASE + 0x234) /* MII Mgmt Indicators */
3368 +/* for n in { 0, 1, 2 } */
3369 +#define ETH_CFSA(n) (RC32355_ETH_BASE + 0x240 + ((n) * 4)) /* Station Addr */
3373 + * Register Interpretations follow
3376 +/******************************************************************************
3377 + * ETHINTFC register
3378 + *****************************************************************************/
3380 +#define ETHERINTFC_EN (1<<0)
3381 +#define ETHERINTFC_ITS (1<<1)
3382 +#define ETHERINTFC_RES (1<<2)
3383 +#define ETHERINTFC_RIP (1<<2)
3384 +#define ETHERINTFC_JAM (1<<3)
3386 +/******************************************************************************
3387 + * ETHFIFOTT register
3388 + *****************************************************************************/
3390 +#define ETHERFIFOTT_TTH(v) (((v)&0x3f)<<0)
3392 +/******************************************************************************
3394 + *****************************************************************************/
3396 +#define ETHERARC_PRO (1<<0)
3397 +#define ETHERARC_AM (1<<1)
3398 +#define ETHERARC_AFM (1<<2)
3399 +#define ETHERARC_AB (1<<3)
3401 +/******************************************************************************
3402 + * ETHHASH registers
3403 + *****************************************************************************/
3405 +#define ETHERHASH0(v) (((v)&0xffff)<<0)
3406 +#define ETHERHASH1(v) (((v)&0xffff)<<0)
3408 +/******************************************************************************
3410 + *****************************************************************************/
3412 +#define ETHERSAL0(v) (((v)&0xffff)<<0)
3413 +#define ETHERSAL1(v) (((v)&0xffff)<<0)
3414 +#define ETHERSAL2(v) (((v)&0xffff)<<0)
3415 +#define ETHERSAL3(v) (((v)&0xffff)<<0)
3416 +#define ETHERSAH0(v) (((v)&0xff)<<0)
3417 +#define ETHERSAH1(v) (((v)&0xff)<<0)
3418 +#define ETHERSAH2(v) (((v)&0xff)<<0)
3419 +#define ETHERSAH3(v) (((v)&0xff)<<0)
3421 +/******************************************************************************
3422 + * ETHFIFOST register
3423 + *****************************************************************************/
3425 +#define ETHERFIFOST_IRTH(v) (((v)&0x3f)<<0)
3426 +#define ETHERFIFOST_ORTH(v) (((v)&0x3f)<<16)
3428 +/******************************************************************************
3429 + * ETHFIFOS register
3430 + *****************************************************************************/
3432 +#define ETHERFIFOS_IR (1<<0)
3433 +#define ETHERFIFOS_OR (1<<1)
3434 +#define ETHERFIFOS_OVR (1<<2)
3435 +#define ETHERFIFOS_UND (1<<3)
3437 +/******************************************************************************
3439 + *****************************************************************************/
3441 +#define ETHERID(v) (((v)&0xffff)<<0)
3442 +#define ETHEROD(v) (((v)&0xffff)<<0)
3444 +/******************************************************************************
3445 + * ETHODEOPS register
3446 + *****************************************************************************/
3448 +#define ETHERODEOPS_SIZE(v) (((v)&0x3)<<0)
3450 +/******************************************************************************
3451 + * ETHODEOP register
3452 + *****************************************************************************/
3454 +#define ETHERODEOP(v) (((v)&0xffff)<<0)
3456 +/******************************************************************************
3458 + *****************************************************************************/
3460 +#define ETHERIS_EOP (1<<0)
3461 +#define ETHERIS_ROK (1<<2)
3462 +#define ETHERIS_FM (1<<3)
3463 +#define ETHERIS_MP (1<<4)
3464 +#define ETHERIS_BP (1<<5)
3465 +#define ETHERIS_VLT (1<<6)
3466 +#define ETHERIS_CF (1<<7)
3467 +#define ETHERIS_OVR (1<<8)
3468 +#define ETHERIS_CRC (1<<9)
3469 +#define ETHERIS_CV (1<<10)
3470 +#define ETHERIS_DB (1<<11)
3471 +#define ETHERIS_LE (1<<12)
3472 +#define ETHERIS_LOR (1<<13)
3473 +#define ETHERIS_SIZE(v) (((v)&0x3)<<14)
3474 +#define ETHERIS_LENGTH(v) (((v)&0xff)<<16)
3476 +/******************************************************************************
3478 + *****************************************************************************/
3480 +#define ETHEROS_T (1<<0)
3481 +#define ETHEROS_TOK (1<<6)
3482 +#define ETHEROS_MP (1<<7)
3483 +#define ETHEROS_BP (1<<8)
3484 +#define ETHEROS_UND (1<<9)
3485 +#define ETHEROS_OF (1<<10)
3486 +#define ETHEROS_ED (1<<11)
3487 +#define ETHEROS_EC (1<<12)
3488 +#define ETHEROS_LC (1<<13)
3489 +#define ETHEROS_TD (1<<14)
3490 +#define ETHEROS_CRC (1<<15)
3491 +#define ETHEROS_LE (1<<16)
3492 +#define ETHEROS_CC(v) (((v)&0xf)<<17)
3493 +#define ETHEROS_PFD (1<<21)
3495 +/******************************************************************************
3496 + * Statistics registers
3497 + *****************************************************************************/
3499 +#define ETHERRBC(v) (((v)&0xffff)<<0)
3500 +#define ETHERRPC(v) (((v)&0xffff)<<0)
3501 +#define ETHERRUPC(v) (((v)&0xffff)<<0)
3502 +#define ETHERRFC(v) (((v)&0xffff)<<0)
3503 +#define ETHERTBC(v) (((v)&0xffff)<<0)
3505 +/******************************************************************************
3507 + *****************************************************************************/
3509 +#define ETHERGPF_PTV(v) (((v)&0xff)<<0)
3511 +/******************************************************************************
3513 + *****************************************************************************/
3515 +#define ETHERMAC1_RE (1<<0)
3516 +#define ETHERMAC1_PAF (1<<1)
3517 +#define ETHERMAC1_RFC (1<<2)
3518 +#define ETHERMAC1_TFC (1<<3)
3519 +#define ETHERMAC1_LB (1<<4)
3520 +#define ETHERMAC1_MR (1<<15)
3523 +#define ETHERMAC2_FD (1<<0)
3524 +#define ETHERMAC2_FLC (1<<1)
3525 +#define ETHERMAC2_HFE (1<<2)
3526 +#define ETHERMAC2_DC (1<<3)
3527 +#define ETHERMAC2_CEN (1<<4)
3528 +#define ETHERMAC2_PE (1<<5)
3529 +#define ETHERMAC2_VPE (1<<6)
3530 +#define ETHERMAC2_APE (1<<7)
3531 +#define ETHERMAC2_PPE (1<<8)
3532 +#define ETHERMAC2_LPE (1<<9)
3533 +#define ETHERMAC2_NB (1<<12)
3534 +#define ETHERMAC2_BP (1<<13)
3535 +#define ETHERMAC2_ED (1<<14)
3538 +#define ETHERIPGT(v) (((v)&0x3f)<<0)
3541 +#define ETHERIPGR_IPGR1(v) (((v)&0x3f)<<0)
3542 +#define ETHERIPGR_IPGR2(v) (((v)&0x3f)<<8)
3545 +#define ETHERCLRT_MAXRET(v) (((v)&0x3f)<<0)
3546 +#define ETHERCLRT_COLWIN(v) (((v)&0x3f)<<8)
3549 +#define ETHERMAXF(v) (((v)&0x3f)<<0)
3552 +#define ETHERMTEST_TB (1<<2)
3555 +#define ETHERMCP_DIV(v) (((v)&0xff)<<0)
3558 +#define ETHERMIIMCFG_CS(v) (((v)&0x3)<<2)
3559 +#define ETHERMIIMCFG_R (1<<15)
3562 +#define ETHERMIIMCMD_RD (1<<0)
3563 +#define ETHERMIIMCMD_SCN (1<<1)
3566 +#define ETHERMIIMADDR_REGADDR(v) (((v)&0x1f)<<0)
3567 +#define ETHERMIIMADDR_PHYADDR(v) (((v)&0x1f)<<8)
3570 +#define ETHERMIIMWTD(v) (((v)&0xff)<<0)
3573 +#define ETHERMIIMRDD(v) (((v)&0xff)<<0)
3576 +#define ETHERMIIMIND_BSY (1<<0)
3577 +#define ETHERMIIMIND_SCN (1<<1)
3578 +#define ETHERMIIMIND_NV (1<<2)
3581 +#define ETHERDMA_IN_LENGTH(v) (((v)&0xffff)<<16)
3582 +#define ETHERDMA_IN_CES (1<<14)
3583 +#define ETHERDMA_IN_LOR (1<<13)
3584 +#define ETHERDMA_IN_LE (1<<12)
3585 +#define ETHERDMA_IN_DB (1<<11)
3586 +#define ETHERDMA_IN_CV (1<<10)
3587 +#define ETHERDMA_IN_CRC (1<<9)
3588 +#define ETHERDMA_IN_OVR (1<<8)
3589 +#define ETHERDMA_IN_CF (1<<7)
3590 +#define ETHERDMA_IN_VLT (1<<6)
3591 +#define ETHERDMA_IN_BP (1<<5)
3592 +#define ETHERDMA_IN_MP (1<<4)
3593 +#define ETHERDMA_IN_FM (1<<3)
3594 +#define ETHERDMA_IN_ROK (1<<2)
3595 +#define ETHERDMA_IN_LD (1<<1)
3596 +#define ETHERDMA_IN_FD (1<<0)
3599 +#define ETHERDMA_OUT_CC(v) (((v)&0xf)<<17)
3600 +#define ETHERDMA_OUT_CNT 0x001e0000
3601 +#define ETHERDMA_OUT_SHFT 17
3602 +#define ETHERDMA_OUT_LE (1<<16)
3604 +#define ETHERDMA_OUT_CRC (1<<15)
3605 +#define ETHERDMA_OUT_TD (1<<14)
3606 +#define ETHERDMA_OUT_LC (1<<13)
3607 +#define ETHERDMA_OUT_EC (1<<12)
3608 +#define ETHERDMA_OUT_ED (1<<11)
3609 +#define ETHERDMA_OUT_OF (1<<10)
3610 +#define ETHERDMA_OUT_UND (1<<9)
3611 +#define ETHERDMA_OUT_BP (1<<8)
3612 +#define ETHERDMA_OUT_MP (1<<7)
3613 +#define ETHERDMA_OUT_TOK (1<<6)
3614 +#define ETHERDMA_OUT_HEN (1<<5)
3615 +#define ETHERDMA_OUT_CEN (1<<4)
3616 +#define ETHERDMA_OUT_PEN (1<<3)
3617 +#define ETHERDMA_OUT_OEN (1<<2)
3618 +#define ETHERDMA_OUT_LD (1<<1)
3619 +#define ETHERDMA_OUT_FD (1<<0)
3622 + (ETHERDMA_IN_OVR | ETHERDMA_IN_CRC | ETHERDMA_IN_CV | ETHERDMA_IN_LE)
3624 + (ETHERDMA_OUT_LC | ETHERDMA_OUT_EC | ETHERDMA_OUT_ED | \
3625 + ETHERDMA_OUT_OF | ETHERDMA_OUT_UND)
3627 +#define IS_RCV_ROK(X) (((X) & (1<<2)) >> 2) /* Receive Okay */
3628 +#define IS_RCV_FM(X) (((X) & (1<<3)) >> 3) /* Is Filter Match */
3629 +#define IS_RCV_MP(X) (((X) & (1<<4)) >> 4) /* Is it MP */
3630 +#define IS_RCV_BP(X) (((X) & (1<<5)) >> 5) /* Is it BP */
3631 +#define IS_RCV_VLT(X) (((X) & (1<<6)) >> 6) /* VLAN Tag Detect */
3632 +#define IS_RCV_CF(X) (((X) & (1<<7)) >> 7) /* Control Frame */
3633 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<8)) >> 8) /* Receive Overflow */
3634 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<9)) >> 9) /* CRC Error */
3635 +#define IS_RCV_CV_ERR(X) (((X) & (1<<10))>>10) /* Code Violation */
3636 +#define IS_RCV_DB_ERR(X) (((X) & (1<<11))>>11) /* Dribble Bits */
3637 +#define IS_RCV_LE_ERR(X) (((X) & (1<<12))>>12) /* Length error */
3638 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<13))>>13) /* Length Out of
3640 +#define IS_RCV_CES_ERR(X) (((X) & (1<<14))>>14) /* Preamble error */
3641 +#define RCVPKT_LENGTH(X) (((X) & 0xFFFF0000)>>16) /* Length of the
3642 + received packet */
3644 +#define IS_TX_TOK(X) (((X) & (1<<6) ) >> 6 ) /* Transmit Okay */
3645 +#define IS_TX_MP(X) (((X) & (1<<7) ) >> 7 ) /* Multicast */
3647 +#define IS_TX_BP(X) (((X) & (1<<8) ) >> 8 ) /* Broadcast */
3648 +#define IS_TX_UND_ERR(X) (((X) & (1<<9) ) >> 9 ) /* Transmit FIFO
3650 +#define IS_TX_OF_ERR(X) (((X) & (1<<10)) >>10 ) /* Oversized frame */
3651 +#define IS_TX_ED_ERR(X) (((X) & (1<<11)) >>11 ) /* Excessive
3653 +#define IS_TX_EC_ERR(X) (((X) & (1<<12)) >>12 ) /* Excessive
3655 +#define IS_TX_LC_ERR(X) (((X) & (1<<13)) >>13 ) /* Late Collision */
3656 +#define IS_TX_TD_ERR(X) (((X) & (1<<14)) >>14 ) /* Transmit deferred*/
3657 +#define IS_TX_CRC_ERR(X) (((X) & (1<<15)) >>15 ) /* CRC Error */
3658 +#define IS_TX_LE_ERR(X) (((X) & (1<<16)) >>16 ) /* Length Error */
3660 +#define TX_COLLISION_COUNT(X) (((X) & 0x001E0000u)>>17) /* Collision Count */
3662 +#endif /* RC32355_ETHER_H */
3664 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355.h
3665 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355.h 1970-01-01 01:00:00.000000000 +0100
3666 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355.h 2006-01-10 00:32:33.000000000 +0100
3668 +/**************************************************************************
3670 + * BRIEF MODULE DESCRIPTION
3671 + * Definitions for IDT RC32355 CPU.
3673 + * Copyright 2004 IDT Inc.
3674 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3677 + * This program is free software; you can redistribute it and/or modify it
3678 + * under the terms of the GNU General Public License as published by the
3679 + * Free Software Foundation; either version 2 of the License, or (at your
3680 + * option) any later version.
3682 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3683 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3684 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3685 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3686 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3687 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3688 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3689 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3690 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3691 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3693 + * You should have received a copy of the GNU General Public License along
3694 + * with this program; if not, write to the Free Software Foundation, Inc.,
3695 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3701 + **************************************************************************
3705 +#ifndef _RC32355_H_
3706 +#define _RC32355_H_
3708 +#include <linux/delay.h>
3709 +#include <asm/io.h>
3711 +/* Base address of internal registers */
3712 +#define RC32355_REG_BASE 0x18000000
3714 +/* System ID Registers */
3715 +#define CPU_SYSID (RC32355_REG_BASE + 0x00018)
3716 +#define CPU_BTADDR (RC32355_REG_BASE + 0x0001c)
3717 +#define CPU_REV (RC32355_REG_BASE + 0x0002c)
3719 +/* Reset Controller */
3720 +#define RESET_CNTL (RC32355_REG_BASE + 0x08000)
3722 +/* Device Controller */
3723 +#define DEV0_BASE (RC32355_REG_BASE + 0x10000)
3724 +#define DEV0_MASK (RC32355_REG_BASE + 0x10004)
3725 +#define DEV0_CNTL (RC32355_REG_BASE + 0x10008)
3726 +#define DEV0_TIMING (RC32355_REG_BASE + 0x1000c)
3727 +#define DEV_REG_OFFSET 0x10
3729 +/* SDRAM Controller */
3730 +#define SDRAM0_BASE (RC32355_REG_BASE + 0x18000)
3731 +#define SDRAM0_MASK (RC32355_REG_BASE + 0x18004)
3732 +#define SDRAM1_BASE (RC32355_REG_BASE + 0x18008)
3733 +#define SDRAM1_MASK (RC32355_REG_BASE + 0x1800c)
3734 +#define SDRAM_CNTL (RC32355_REG_BASE + 0x18010)
3737 +#define BUS_ARB_CNTL0 (RC32355_REG_BASE + 0x20000)
3738 +#define BUS_ARB_CNTL1 (RC32355_REG_BASE + 0x20004)
3740 +/* Counters/Timers */
3741 +#define TIMER0_COUNT (RC32355_REG_BASE + 0x28000)
3742 +#define TIMER0_COMPARE (RC32355_REG_BASE + 0x28004)
3743 +#define TIMER0_CNTL (RC32355_REG_BASE + 0x28008)
3744 +#define TIMER_REG_OFFSET 0x0C
3746 +/* System Integrity */
3748 +/* Interrupt Controller */
3749 +#define IC_GROUP0_PEND (RC32355_REG_BASE + 0x30000)
3750 +#define IC_GROUP0_MASK (RC32355_REG_BASE + 0x30004)
3751 +#define IC_GROUP_OFFSET 0x08
3753 +#define NUM_INTR_GROUPS 5
3755 + * The IRQ mapping is as follows:
3758 + * --- -------------------
3759 + * 0 SW0 (IP0) SW0 intr
3760 + * 1 SW1 (IP1) SW1 intr
3761 + * - Int0 (IP2) mapped to GROUP0_IRQ_BASE
3762 + * - Int1 (IP3) mapped to GROUP1_IRQ_BASE
3763 + * - Int2 (IP4) mapped to GROUP2_IRQ_BASE
3764 + * - Int3 (IP5) mapped to GROUP3_IRQ_BASE
3765 + * - Int4 (IP6) mapped to GROUP4_IRQ_BASE
3766 + * 7 Int5 (IP7) CP0 Timer
3768 + * IRQ's 8 and up are all mapped to Int0-4 (IP2-IP6), which
3769 + * internally on the RC32355 is routed to the Expansion
3770 + * Interrupt Controller.
3772 +#define MIPS_CPU_TIMER_IRQ 7
3774 +#define GROUP0_IRQ_BASE 8 // Counter/Timers, UCW
3775 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) // DMA
3776 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) // ATM
3777 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) // TDM, Eth, USB, UARTs, I2C
3778 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32) // GPIO
3780 +#define RC32355_NR_IRQS (GROUP4_IRQ_BASE + 32)
3782 +/* DMA - see rc32355_dma.h for full list of registers */
3784 +#define RC32355_DMA_BASE (RC32355_REG_BASE + 0x38000)
3785 +#define DMA_CHAN_OFFSET 0x14
3787 +/* GPIO Controller */
3793 +#define RC32300_UART0_BASE (RC32355_REG_BASE + 0x50003)
3794 +#define RC32300_UART1_BASE (RC32355_REG_BASE + 0x50023)
3796 +#define RC32300_UART0_BASE (RC32355_REG_BASE + 0x50000)
3797 +#define RC32300_UART1_BASE (RC32355_REG_BASE + 0x50020)
3800 +#define RC32300_UART0_IRQ (GROUP3_IRQ_BASE + 14)
3801 +#define RC32300_UART1_IRQ (GROUP3_IRQ_BASE + 17)
3805 +/* Ethernet - see rc32355_eth.h for full list of registers */
3807 +#define RC32355_ETH_BASE (RC32355_REG_BASE + 0x60000)
3810 +#define IDT_CLOCK_MULT 2
3812 +/* Memory map of 79EB355 board */
3815 +#define RAM_BASE 0x00000000
3816 +#define RAM_SIZE (32*1024*1024)
3818 +/* SRAM (device 1) */
3819 +#define SRAM_BASE 0x02000000
3820 +#define SRAM_SIZE 0x00100000
3822 +/* FLASH (device 2) */
3823 +#define FLASH_BASE 0x0C000000
3824 +#define FLASH_SIZE 0x00C00000
3826 +/* ATM PHY (device 4) */
3827 +#define ATM_PHY_BASE 0x14000000
3829 +/* TDM switch (device 3) */
3830 +#define TDM_BASE 0x1A000000
3832 +/* LCD panel (device 3) */
3833 +#define LCD_BASE 0x1A002000
3835 +/* RTC (DS1511W) (device 3) */
3836 +#define RTC_BASE 0x1A004000
3838 +/* NVRAM (256 bytes internal to the DS1511 RTC) */
3839 +#define NVRAM_ADDR RTC_BASE + 0x10
3840 +#define NVRAM_DATA RTC_BASE + 0x13
3841 +#define NVRAM_ENVSIZE_OFF 4
3842 +#define NVRAM_ENVSTART_OFF 32
3844 +#endif /* _RC32355_H_ */
3845 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_dma.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_dma.h
3846 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_dma.h 1970-01-01 01:00:00.000000000 +0100
3847 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_dma.h 2006-01-10 00:32:33.000000000 +0100
3849 +/**************************************************************************
3851 + * BRIEF MODULE DESCRIPTION
3852 + * RC32365/336 DMA hardware abstraction.
3854 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
3856 + * This program is free software; you can redistribute it and/or modify it
3857 + * under the terms of the GNU General Public License as published by the
3858 + * Free Software Foundation; either version 2 of the License, or (at your
3859 + * option) any later version.
3861 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3862 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3863 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3864 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3865 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3866 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3867 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3868 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3869 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3870 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3872 + * You should have received a copy of the GNU General Public License along
3873 + * with this program; if not, write to the Free Software Foundation, Inc.,
3874 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3877 + **************************************************************************
3878 + * May 2004 P. Sadik.
3884 + **************************************************************************
3887 +#ifndef __IDT_RC32365_DMA_H__
3888 +#define __IDT_RC32365_DMA_H__
3892 + DMA0_PhysicalAddress = 0x18038000,
3893 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
3895 + DMA0_VirtualAddress = 0xb8038000,
3896 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
3900 + * DMA descriptor (in physical memory).
3903 +typedef struct DMAD_s
3905 + u32 control ; // Control. use DMAD_*
3906 + u32 ca ; // Current Address.
3907 + u32 devcs ; // Device control and status.
3908 + u32 link ; // Next descriptor in chain.
3909 +} volatile *DMAD_t ;
3913 + DMAD_size = sizeof (struct DMAD_s),
3914 + DMAD_count_b = 0, // in DMAD_t -> control
3915 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
3916 + DMAD_ds_b = 20, // in DMAD_t -> control
3917 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
3918 + DMAD_ds_extToMem0_v = 0,
3919 + DMAD_ds_memToExt0_v = 1,
3920 + DMAD_ds_extToMem1_v = 0,
3921 + DMAD_ds_memToExt1_v = 1,
3922 + DMAD_ds_ethRcv0_v = 0,
3923 + DMAD_ds_ethXmt0_v = 0,
3924 + DMAD_ds_ethRcv1_v = 0,
3925 + DMAD_ds_ethXmt2_v = 0,
3926 + DMAD_ds_memToFifo_v = 0,
3927 + DMAD_ds_fifoToMem_v = 0,
3928 + DMAD_ds_rng_de_v = 1,//randomNumberGenerator on LC/DE
3929 + DMAD_ds_pciToMem_v = 0,
3930 + DMAD_ds_memToPci_v = 0,
3931 + DMAD_ds_securityInput_v = 0,
3932 + DMAD_ds_securityOutput_v = 0,
3933 + DMAD_ds_rng_se_v = 0,//randomNumberGenerator on SE
3935 + DMAD_devcmd_b = 22, // in DMAD_t -> control
3936 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
3937 + DMAD_devcmd_byte_v = 0, //memory-to-memory
3938 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
3939 + DMAD_devcmd_word_v = 2, //memory-to-memory
3940 + DMAD_devcmd_2words_v = 3, //memory-to-memory
3941 + DMAD_devcmd_4words_v = 4, //memory-to-memory
3942 + DMAD_devcmd_6words_v = 5, //memory-to-memory
3943 + DMAD_devcmd_8words_v = 6, //memory-to-memory
3944 + DMAD_devcmd_16words_v = 7, //memory-to-memory
3945 + DMAD_cof_b = 25, // chain on finished
3946 + DMAD_cof_m = 0x02000000, //
3947 + DMAD_cod_b = 26, // chain on done
3948 + DMAD_cod_m = 0x04000000, //
3949 + DMAD_iof_b = 27, // interrupt on finished
3950 + DMAD_iof_m = 0x08000000, //
3951 + DMAD_iod_b = 28, // interrupt on done
3952 + DMAD_iod_m = 0x10000000, //
3953 + DMAD_t_b = 29, // terminated
3954 + DMAD_t_m = 0x20000000, //
3955 + DMAD_d_b = 30, // done
3956 + DMAD_d_m = 0x40000000, //
3957 + DMAD_f_b = 31, // finished
3958 + DMAD_f_m = 0x80000000, //
3962 + * DMA register (within Internal Register Map).
3967 + u32 dmac ; // Control.
3968 + u32 dmas ; // Status.
3969 + u32 dmasm ; // Mask.
3970 + u32 dmadptr ; // Descriptor pointer.
3971 + u32 dmandptr ; // Next descriptor pointer.
3974 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
3976 +//DMA_Channels use DMACH_count instead
3980 + DMAC_run_b = 0, //
3981 + DMAC_run_m = 0x00000001, //
3982 + DMAC_dm_b = 1, // done mask
3983 + DMAC_dm_m = 0x00000002, //
3984 + DMAC_mode_b = 2, //
3985 + DMAC_mode_m = 0x0000000c, //
3986 + DMAC_mode_auto_v = 0,
3987 + DMAC_mode_burst_v = 1,
3988 + DMAC_mode_transfer_v = 2, //usually used
3989 + DMAC_mode_reserved_v = 3,
3991 + DMAC_a_m = 0x00000010, //
3993 + DMAS_f_b = 0, // finished (sticky)
3994 + DMAS_f_m = 0x00000001, //
3995 + DMAS_d_b = 1, // done (sticky)
3996 + DMAS_d_m = 0x00000002, //
3997 + DMAS_c_b = 2, // chain (sticky)
3998 + DMAS_c_m = 0x00000004, //
3999 + DMAS_e_b = 3, // error (sticky)
4000 + DMAS_e_m = 0x00000008, //
4001 + DMAS_h_b = 4, // halt (sticky)
4002 + DMAS_h_m = 0x00000010, //
4004 + DMASM_f_b = 0, // finished (1=mask)
4005 + DMASM_f_m = 0x00000001, //
4006 + DMASM_d_b = 1, // done (1=mask)
4007 + DMASM_d_m = 0x00000002, //
4008 + DMASM_c_b = 2, // chain (1=mask)
4009 + DMASM_c_m = 0x00000004, //
4010 + DMASM_e_b = 3, // error (1=mask)
4011 + DMASM_e_m = 0x00000008, //
4012 + DMASM_h_b = 4, // halt (1=mask)
4013 + DMASM_h_m = 0x00000010, //
4017 + * DMA channel definitions
4022 + DMACH_ethRcv0 = 0,
4023 + DMACH_ethXmt0 = 1,
4024 + DMACH_ethRcv1 = 2,
4025 + DMACH_ethXmt2 = 3,
4026 + DMACH_pciToMem = 4,
4027 + DMACH_memToPci = 5,
4028 + DMACH_securityInput = 6,
4029 + DMACH_securityOutput = 7,
4032 + DMACH_count //must be last
4036 +typedef struct DMAC_s
4038 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
4039 +} volatile *DMA_t ;
4043 + * External DMA parameters
4048 + DMADEVCMD_ts_b = 0, // ts field in devcmd
4049 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
4050 + DMADEVCMD_ts_byte_v = 0,
4051 + DMADEVCMD_ts_halfword_v = 1,
4052 + DMADEVCMD_ts_word_v = 2,
4053 + DMADEVCMD_ts_2word_v = 3,
4054 + DMADEVCMD_ts_4word_v = 4,
4055 + DMADEVCMD_ts_6word_v = 5,
4056 + DMADEVCMD_ts_8word_v = 6,
4057 + DMADEVCMD_ts_16word_v = 7
4061 +#if 1 // aws - Compatibility.
4062 +# define EXTDMA_ts_b DMADEVCMD_ts_b
4063 +# define EXTDMA_ts_m DMADEVCMD_ts_m
4064 +# define EXTDMA_ts_byte_v DMADEVCMD_ts_byte_v
4065 +# define EXTDMA_ts_halfword_v DMADEVCMD_ts_halfword_v
4066 +# define EXTDMA_ts_word_v DMADEVCMD_ts_word_v
4067 +# define EXTDMA_ts_2word_v DMADEVCMD_ts_2word_v
4068 +# define EXTDMA_ts_4word_v DMADEVCMD_ts_4word_v
4069 +# define EXTDMA_ts_6word_v DMADEVCMD_ts_6word_v
4070 +# define EXTDMA_ts_8word_v DMADEVCMD_ts_8word_v
4071 +# define EXTDMA_ts_16word_v DMADEVCMD_ts_16word_v
4072 +#endif // aws - Compatibility.
4074 +#endif // __IDT_RC32365_DMA_H__
4075 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h
4076 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h 1970-01-01 01:00:00.000000000 +0100
4077 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h 2006-01-10 00:32:33.000000000 +0100
4079 +/**************************************************************************
4081 + * BRIEF MODULE DESCRIPTION
4082 + * RC32365/336 DMA interface routines.
4084 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4086 + * This program is free software; you can redistribute it and/or modify it
4087 + * under the terms of the GNU General Public License as published by the
4088 + * Free Software Foundation; either version 2 of the License, or (at your
4089 + * option) any later version.
4091 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4092 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4093 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4094 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4095 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4096 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4097 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4098 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4099 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4100 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4102 + * You should have received a copy of the GNU General Public License along
4103 + * with this program; if not, write to the Free Software Foundation, Inc.,
4104 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4107 + **************************************************************************
4108 + * May 2004 P. Sadik.
4114 + **************************************************************************
4117 +#ifndef __IDT_RC32365_DMA_V_H__
4118 +#define __IDT_RC32365_DMA_V_H__
4121 +#include <asm/idt-boards/rc32300/rc32300.h>
4122 +#include <asm/idt-boards/rc32300/rc32365_dma.h>
4123 +#include <asm/idt-boards/rc32300/rc32365.h>
4125 +#define DMA_CHAN_OFFSET 0x14
4126 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
4127 +#define IS_DMA_FINISHED(X) (((X) & (DMAD_f_m)) != 0)
4128 +#define IS_DMA_DONE(X) (((X) & (DMAD_d_m)) != 0)
4130 +#define DMA_COUNT(count) \
4131 + ((count) & DMAD_count_m)
4133 +#define DMA_HALT_TIMEOUT 500
4135 +static inline int rc32365_halt_dma(DMA_Chan_t ch)
4138 + if (local_readl(&ch->dmac) & DMAC_run_m) {
4139 + local_writel(0, &ch->dmac);
4141 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
4142 + if (local_readl(&ch->dmas) & DMAS_h_m) {
4143 + local_writel(0, &ch->dmas);
4150 + return timeout ? 0 : 1;
4154 +static inline void rc32365_start_dma(DMA_Chan_t ch, u32 dma_addr)
4156 + local_writel(0, &ch->dmandptr);
4157 + local_writel(dma_addr, &ch->dmadptr);
4160 +static inline void rc32365_chain_dma(DMA_Chan_t ch, u32 dma_addr)
4162 + local_writel(dma_addr, &ch->dmandptr);
4164 +#endif //__IDT_RC32365_DMA_V_H__
4165 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_eth.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_eth.h
4166 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_eth.h 1970-01-01 01:00:00.000000000 +0100
4167 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_eth.h 2006-01-10 00:32:33.000000000 +0100
4169 +/**************************************************************************
4171 + * BRIEF MODULE DESCRIPTION
4172 + * RC32365/336 Ethernet hardware abstraction.
4174 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4176 + * This program is free software; you can redistribute it and/or modify it
4177 + * under the terms of the GNU General Public License as published by the
4178 + * Free Software Foundation; either version 2 of the License, or (at your
4179 + * option) any later version.
4181 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4182 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4183 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4184 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4185 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4186 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4187 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4188 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4189 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4190 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4192 + * You should have received a copy of the GNU General Public License along
4193 + * with this program; if not, write to the Free Software Foundation, Inc.,
4194 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4197 + **************************************************************************
4198 + * May 2004 P. Sadik.
4204 + **************************************************************************
4207 +#ifndef __IDT_RC32365_ETH_H__
4208 +#define __IDT_RC32365_ETH_H__
4212 + ETH0_PhysicalAddress = 0x18058000,
4213 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
4214 + ETH0_VirtualAddress = 0xb8058000,
4216 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
4218 + ETH1_PhysicalAddress = 0x18060000,
4219 + ETH1_VirtualAddress = 0xb8060000, // Default
4229 + u32 ethu0 [4] ; // Reserved.
4232 + u32 eth_u1 [10] ; // Reserved.
4234 + u32 eth_u2 [42] ; // Reserved.
4249 + u32 eth_u9 [50] ; // Reserved.
4256 + u32 eth_u10 ; // Reserved.
4264 + u32 eth_u11 ; // Reserved.
4265 + u32 eth_u12 ; // Reserved.
4273 + ETHINTFC_en_b = 0,
4274 + ETHINTFC_en_m = 0x00000001,
4275 + ETHINTFC_its_b = 1,
4276 + ETHINTFC_its_m = 0x00000002,
4277 + ETHINTFC_rip_b = 2,
4278 + ETHINTFC_rip_m = 0x00000004,
4279 + ETHINTFC_jam_b = 3,
4280 + ETHINTFC_jam_m = 0x00000008,
4281 + ETHINTFC_ovr_b = 4,
4282 + ETHINTFC_ovr_m = 0x00000010,
4283 + ETHINTFC_und_b = 5,
4284 + ETHINTFC_und_m = 0x00000020,
4286 + ETHFIFOTT_tth_b = 0,
4287 + ETHFIFOTT_tth_m = 0x0000007f,
4290 + ETHARC_pro_m = 0x00000001,
4292 + ETHARC_am_m = 0x00000002,
4294 + ETHARC_afm_m = 0x00000004,
4296 + ETHARC_ab_m = 0x00000008,
4298 + ETHSAL_byte5_b = 0,
4299 + ETHSAL_byte5_m = 0x000000ff,
4300 + ETHSAL_byte4_b = 8,
4301 + ETHSAL_byte4_m = 0x0000ff00,
4302 + ETHSAL_byte3_b = 16,
4303 + ETHSAL_byte3_m = 0x00ff0000,
4304 + ETHSAL_byte2_b = 24,
4305 + ETHSAL_byte2_m = 0xff000000,
4307 + ETHSAH_byte1_b = 0,
4308 + ETHSAH_byte1_m = 0x000000ff,
4309 + ETHSAH_byte0_b = 8,
4310 + ETHSAH_byte0_m = 0x0000ff00,
4313 + ETHGPF_ptv_m = 0x0000ffff,
4316 + ETHPFS_pfd_m = 0x00000001,
4318 + ETHCFSA0_cfsa4_b = 0,
4319 + ETHCFSA0_cfsa4_m = 0x000000ff,
4320 + ETHCFSA0_cfsa5_b = 8,
4321 + ETHCFSA0_cfsa5_m = 0x0000ff00,
4323 + ETHCFSA1_cfsa2_b = 0,
4324 + ETHCFSA1_cfsa2_m = 0x000000ff,
4325 + ETHCFSA1_cfsa3_b = 8,
4326 + ETHCFSA1_cfsa3_m = 0x0000ff00,
4328 + ETHCFSA2_cfsa0_b = 0,
4329 + ETHCFSA2_cfsa0_m = 0x000000ff,
4330 + ETHCFSA2_cfsa1_b = 8,
4331 + ETHCFSA2_cfsa1_m = 0x0000ff00,
4334 + ETHMAC1_re_m = 0x00000001,
4335 + ETHMAC1_paf_b = 1,
4336 + ETHMAC1_paf_m = 0x00000002,
4337 + ETHMAC1_rfc_b = 2,
4338 + ETHMAC1_rfc_m = 0x00000004,
4339 + ETHMAC1_tfc_b = 3,
4340 + ETHMAC1_tfc_m = 0x00000008,
4342 + ETHMAC1_lb_m = 0x00000010,
4343 + ETHMAC1_mr_b = 31,
4344 + ETHMAC1_mr_m = 0x80000000,
4347 + ETHMAC2_fd_m = 0x00000001,
4348 + ETHMAC2_flc_b = 1,
4349 + ETHMAC2_flc_m = 0x00000002,
4350 + ETHMAC2_hfe_b = 2,
4351 + ETHMAC2_hfe_m = 0x00000004,
4353 + ETHMAC2_dc_m = 0x00000008,
4354 + ETHMAC2_cen_b = 4,
4355 + ETHMAC2_cen_m = 0x00000010,
4357 + ETHMAC2_pe_m = 0x00000020,
4358 + ETHMAC2_vpe_b = 6,
4359 + ETHMAC2_vpe_m = 0x00000040,
4360 + ETHMAC2_ape_b = 7,
4361 + ETHMAC2_ape_m = 0x00000080,
4362 + ETHMAC2_ppe_b = 8,
4363 + ETHMAC2_ppe_m = 0x00000100,
4364 + ETHMAC2_lpe_b = 9,
4365 + ETHMAC2_lpe_m = 0x00000200,
4366 + ETHMAC2_nb_b = 12,
4367 + ETHMAC2_nb_m = 0x00001000,
4368 + ETHMAC2_bp_b = 13,
4369 + ETHMAC2_bp_m = 0x00002000,
4370 + ETHMAC2_ed_b = 14,
4371 + ETHMAC2_ed_m = 0x00004000,
4373 + ETHIPGT_ipgt_b = 0,
4374 + ETHIPGT_ipgt_m = 0x0000007f,
4376 + ETHIPGR_ipgr2_b = 0,
4377 + ETHIPGR_ipgr2_m = 0x0000007f,
4378 + ETHIPGR_ipgr1_b = 8,
4379 + ETHIPGR_ipgr1_m = 0x00007f00,
4381 + ETHCLRT_maxret_b = 0,
4382 + ETHCLRT_maxret_m = 0x0000000f,
4383 + ETHCLRT_colwin_b = 8,
4384 + ETHCLRT_colwin_m = 0x00003f00,
4386 + ETHMAXF_maxf_b = 0,
4387 + ETHMAXF_maxf_m = 0x0000ffff,
4389 + ETHMTEST_tb_b = 2,
4390 + ETHMTEST_tb_m = 0x00000004,
4393 + ETHMCP_div_m = 0x000000ff,
4395 + MIIMCFG_rsv_b = 0,
4396 + MIIMCFG_rsv_m = 0x0000000c,
4399 + MIIMCMD_rd_m = 0x00000001,
4400 + MIIMCMD_scn_b = 1,
4401 + MIIMCMD_scn_m = 0x00000002,
4403 + MIIMADDR_regaddr_b = 0,
4404 + MIIMADDR_regaddr_m = 0x0000001f,
4405 + MIIMADDR_phyaddr_b = 8,
4406 + MIIMADDR_phyaddr_m = 0x00001f00,
4408 + MIIMWTD_wdata_b = 0,
4409 + MIIMWTD_wdata_m = 0x0000ffff,
4411 + MIIMRDD_rdata_b = 0,
4412 + MIIMRDD_rdata_m = 0x0000ffff,
4414 + MIIMIND_bsy_b = 0,
4415 + MIIMIND_bsy_m = 0x00000001,
4416 + MIIMIND_scn_b = 1,
4417 + MIIMIND_scn_m = 0x00000002,
4419 + MIIMIND_nv_m = 0x00000004,
4424 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
4429 + ETHRX_fd_m = 0x00000001,
4431 + ETHRX_ld_m = 0x00000002,
4433 + ETHRX_rok_m = 0x00000004,
4435 + ETHRX_fm_m = 0x00000008,
4437 + ETHRX_mp_m = 0x00000010,
4439 + ETHRX_bp_m = 0x00000020,
4441 + ETHRX_vlt_m = 0x00000040,
4443 + ETHRX_cf_m = 0x00000080,
4445 + ETHRX_ovr_m = 0x00000100,
4447 + ETHRX_crc_m = 0x00000200,
4449 + ETHRX_cv_m = 0x00000400,
4451 + ETHRX_db_m = 0x00000800,
4453 + ETHRX_le_m = 0x00001000,
4455 + ETHRX_lor_m = 0x00002000,
4457 + ETHRX_ces_m = 0x00004000,
4458 + ETHRX_length_b = 16,
4459 + ETHRX_length_m = 0xffff0000,
4462 + ETHTX_fd_m = 0x00000001,
4464 + ETHTX_ld_m = 0x00000002,
4466 + ETHTX_oen_m = 0x00000004,
4468 + ETHTX_pen_m = 0x00000008,
4470 + ETHTX_cen_m = 0x00000010,
4472 + ETHTX_hen_m = 0x00000020,
4474 + ETHTX_tok_m = 0x00000040,
4476 + ETHTX_mp_m = 0x00000080,
4478 + ETHTX_bp_m = 0x00000100,
4480 + ETHTX_und_m = 0x00000200,
4482 + ETHTX_of_m = 0x00000400,
4484 + ETHTX_ed_m = 0x00000800,
4486 + ETHTX_ec_m = 0x00001000,
4488 + ETHTX_lc_m = 0x00002000,
4490 + ETHTX_td_m = 0x00004000,
4492 + ETHTX_crc_m = 0x00008000,
4494 + ETHTX_le_m = 0x00010000,
4496 + ETHTX_cc_m = 0x001E0000,
4501 + ETH0_IPABMC_PhysicalAddress = 0x18040010,
4502 + ETH0_IPABMC_VirtualAddress = 0xb8040000,
4503 + ETH1_IPABMC_PhysicalAddress = 0x18040018,
4504 + ETH1_IPABMC_VirtualAddress = 0xb8040018,
4511 +}volatile *IPABM_ETH_t;
4512 +#endif //__IDT_RC32365_ETH_H__
4513 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h
4514 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h 1970-01-01 01:00:00.000000000 +0100
4515 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h 2006-01-10 00:32:33.000000000 +0100
4517 +/**************************************************************************
4519 + * BRIEF MODULE DESCRIPTION
4520 + * RC32365/336 Ethernet status checking.
4522 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4524 + * This program is free software; you can redistribute it and/or modify it
4525 + * under the terms of the GNU General Public License as published by the
4526 + * Free Software Foundation; either version 2 of the License, or (at your
4527 + * option) any later version.
4529 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4530 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4531 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4532 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4533 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4534 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4535 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4536 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4537 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4538 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4540 + * You should have received a copy of the GNU General Public License along
4541 + * with this program; if not, write to the Free Software Foundation, Inc.,
4542 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4545 + **************************************************************************
4546 + * May 2004 P. Sadik.
4552 + **************************************************************************
4555 +#ifndef __IDT_RC32365_ETH_V_H__
4556 +#define __IDT_RC32365_ETH_V_H__
4557 +#include <asm/idt-boards/rc32300/rc32365_eth.h>
4559 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
4560 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
4561 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
4562 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
4563 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
4564 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
4565 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
4566 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
4567 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
4568 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
4569 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
4571 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
4573 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
4574 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
4575 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
4576 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
4577 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
4578 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
4579 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
4580 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
4581 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
4582 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
4583 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
4584 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
4585 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
4586 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
4588 +#endif //__IDT_RC32365_ETH_V_H__
4589 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h
4590 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h 1970-01-01 01:00:00.000000000 +0100
4591 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h 2006-01-10 00:32:33.000000000 +0100
4593 +/**************************************************************************
4595 + * BRIEF MODULE DESCRIPTION
4596 + * RC32365/336 GPIO hardware abstraction.
4598 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4600 + * This program is free software; you can redistribute it and/or modify it
4601 + * under the terms of the GNU General Public License as published by the
4602 + * Free Software Foundation; either version 2 of the License, or (at your
4603 + * option) any later version.
4605 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4606 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4607 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4608 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4609 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4610 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4611 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4612 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4613 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4614 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4616 + * You should have received a copy of the GNU General Public License along
4617 + * with this program; if not, write to the Free Software Foundation, Inc.,
4618 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4621 + **************************************************************************
4622 + * May 2004 P. Sadik.
4628 + **************************************************************************
4631 +#ifndef __IDT_RC32365_GPIO_H__
4632 +#define __IDT_RC32365_GPIO_H__
4636 + GPIO0_PhysicalAddress = 0x18048000,
4637 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
4639 + GPIO0_VirtualAddress = 0xb8048000,
4640 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
4645 + u32 gpiofunc; /* GPIO Function Register
4646 + * gpiofunc[x]==0 bit = gpio
4647 + * func[x]==1 bit = altfunc
4649 + u32 gpiocfg; /* GPIO Configuration Register
4650 + * gpiocfg[x]==0 bit = input
4651 + * gpiocfg[x]==1 bit = output
4653 + u32 gpiod; /* GPIO Data Register
4654 + * gpiod[x] read/write gpio pinX status
4656 + u32 gpioilevel; /* GPIO Interrupt Status Register
4657 + * interrupt level (see gpioistat)
4659 + u32 gpioistat; /* Gpio Interrupt Status Register
4660 + * istat[x] = (gpiod[x] == level[x])
4661 + * cleared in ISR (STICKY bits)
4663 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
4664 +} volatile * GPIO_t ;
4668 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
4669 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
4670 + GPIO_input_v = 0, // gpiocfg use pin as input.
4671 + GPIO_output_v = 1, // gpiocfg use pin as output.
4673 + GPIO_pin0_m = 0x00000001,
4675 + GPIO_pin1_m = 0x00000002,
4677 + GPIO_pin2_m = 0x00000004,
4679 + GPIO_pin3_m = 0x00000008,
4681 + GPIO_pin4_m = 0x00000010,
4683 + GPIO_pin5_m = 0x00000020,
4685 + GPIO_pin6_m = 0x00000040,
4687 + GPIO_pin7_m = 0x00000080,
4689 + GPIO_pin8_m = 0x00000100,
4691 + GPIO_pin9_m = 0x00000200,
4692 + GPIO_pin10_b = 10,
4693 + GPIO_pin10_m = 0x00000400,
4694 + GPIO_pin11_b = 11,
4695 + GPIO_pin11_m = 0x00000800,
4696 + GPIO_pin12_b = 12,
4697 + GPIO_pin12_m = 0x00001000,
4698 + GPIO_pin13_b = 13,
4699 + GPIO_pin13_m = 0x00002000,
4700 + GPIO_pin14_b = 14,
4701 + GPIO_pin14_m = 0x00004000,
4702 + GPIO_pin15_b = 15,
4703 + GPIO_pin15_m = 0x00008000,
4705 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
4707 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
4708 + GPIO_u0sout_m = GPIO_pin0_m,
4709 + GPIO_u0sout_cfg_v = GPIO_output_v,
4711 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
4712 + GPIO_u0sinp_m = GPIO_pin1_m,
4713 + GPIO_u0sinp_cfg_v = GPIO_input_v,
4715 + GPIO_maddr22_b = GPIO_pin2_b, // M&P bus bit 22.
4716 + GPIO_maddr22_m = GPIO_pin2_m,
4717 + GPIO_maddr22_cfg_v = GPIO_output_v,
4719 + GPIO_maddr23_b = GPIO_pin3_b, // M&P bus bit 23.
4720 + GPIO_maddr23_m = GPIO_pin3_m,
4721 + GPIO_maddr23_cfg_v = GPIO_output_v,
4723 + GPIO_maddr24_b = GPIO_pin4_b, // M&P bus bit 24.
4724 + GPIO_maddr24_m = GPIO_pin4_m,
4725 + GPIO_maddr24_cfg_v = GPIO_output_v,
4727 + GPIO_maddr25_b = GPIO_pin5_b, // M&P bus bit 25.
4728 + GPIO_maddr25_m = GPIO_pin5_m,
4729 + GPIO_maddr25_cfg_v = GPIO_output_v,
4731 + GPIO_rngclk_b = GPIO_pin6_b, // reserved.
4732 + GPIO_rngclk_m = GPIO_pin6_m,
4733 + GPIO_rngclk_cfg_v = GPIO_input_v,
4735 + GPIO_sdckenp_b = GPIO_pin7_b, // reserved.
4736 + GPIO_sdckenp_m = GPIO_pin7_m,
4737 + GPIO_sdckenp_cfg_v = GPIO_output_v,
4739 + GPIO_cen1_b = GPIO_pin8_b, // reserved.
4740 + GPIO_cen1_m = GPIO_pin8_m,
4741 + GPIO_cen1_cfg_v = GPIO_output_v,
4743 + GPIO_cen2_b = GPIO_pin9_b, // reserved.
4744 + GPIO_cen2_m = GPIO_pin9_m,
4745 + GPIO_cen2_cfg_v = GPIO_output_v,
4747 + GPIO_regn_b = GPIO_pin10_b, // reserved.
4748 + GPIO_regn_m = GPIO_pin10_m,
4749 + GPIO_regn_cfg_v = GPIO_output_v,
4751 + GPIO_iordn_b = GPIO_pin11_b, // reserved.
4752 + GPIO_iordn_m = GPIO_pin11_m,
4753 + GPIO_iordn_cfg_v = GPIO_output_v,
4755 + GPIO_iowrn_b = GPIO_pin12_b, // reserved.
4756 + GPIO_iowrn_m = GPIO_pin12_m,
4757 + GPIO_iowrn_cfg_v = GPIO_output_v,
4759 + GPIO_pcireqn2_b = GPIO_pin13_b, // PCI messaging int.
4760 + GPIO_pcireqn2_m = GPIO_pin13_m,
4761 + GPIO_pcireqn2_cfg_v = GPIO_input_v,
4763 + GPIO_pcigntn2_b = GPIO_pin14_b, // PCI messaging int.
4764 + GPIO_pcigntn2_m = GPIO_pin14_m,
4765 + GPIO_pcigntn2_cfg_v = GPIO_output_v,
4767 + GPIO_pcimuintn_b = GPIO_pin15_b, // PCI messaging int.
4768 + GPIO_pcimuintn_m = GPIO_pin15_m,
4769 + GPIO_pcimuintn_cfg_v= GPIO_output_v,
4773 +#endif //__IDT_RC32365_GPIO_H__
4774 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h
4775 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h 1970-01-01 01:00:00.000000000 +0100
4776 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h 2006-01-10 00:32:33.000000000 +0100
4778 +/**************************************************************************
4780 + * BRIEF MODULE DESCRIPTION
4781 + * Routines to set/clear/toggle GPIO on RC32365
4783 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4785 + * This program is free software; you can redistribute it and/or modify it
4786 + * under the terms of the GNU General Public License as published by the
4787 + * Free Software Foundation; either version 2 of the License, or (at your
4788 + * option) any later version.
4790 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4791 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4792 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4793 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4794 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4795 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4796 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4797 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4798 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4799 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4801 + * You should have received a copy of the GNU General Public License along
4802 + * with this program; if not, write to the Free Software Foundation, Inc.,
4803 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4806 + **************************************************************************
4807 + * May 2004 P. Sadik.
4813 + **************************************************************************
4815 +#ifndef __IDT_RC32365_GPIO_V_H__
4816 +#define __IDT_RC32365_GPIO_V_H__
4819 +#ifdef _LANGUAGE_ASSEMBLY
4820 +#define SET_GPIO(pin) \
4822 + ori t5,t5,0x8000 ; \
4827 +#define CLEAR_GPIO(pin) \
4829 + ori t5,t5,0x8000 ; \
4832 + ori t6,t6,0xFFFF; \
4833 + xori t6,t6,pin ; \
4837 +#define TOGGLE_GPIO(pin) \
4839 + ori t5,t5,0x8000 ; \
4841 + xori t4,t4,pin ; \
4844 +#else // !_LANGUAGE_ASSEMBLY
4845 +#include <asm/rc32300/types.h>
4846 +#include <asm/rc32300/rc32365_gpio.h>
4847 +#include <asm/rc32300/rc32365.h>
4849 +static inline void set_gpio(unsigned long pin)
4851 + idt_gpio->gpiod |= pin;
4854 +static inline void clear_gpio(unsigned long pin)
4856 + idt_gpio->gpiod &= ~pin;
4858 +static inline void toggle_gpio(unsigned long pin)
4860 + idt_gpio->gpiod ^= pin;
4862 +#define SET_GPIO(pin) set_gpio(pin)
4863 +#define CLEAR_GPIO(pin) clear_gpio(pin)
4864 +#define TOGGLE_GPIO(pin) toggle_gpio(pin)
4865 +#endif // _LANGUAGE_ASSEMBLY
4867 +#endif //__IDT_RC32365_GPIO_V_H__
4869 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365.h
4870 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365.h 1970-01-01 01:00:00.000000000 +0100
4871 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365.h 2006-01-10 00:32:33.000000000 +0100
4873 +/**************************************************************************
4875 + * BRIEF MODULE DESCRIPTION
4876 + * Definitions for IDT RC32365 CPU.
4878 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4880 + * This program is free software; you can redistribute it and/or modify it
4881 + * under the terms of the GNU General Public License as published by the
4882 + * Free Software Foundation; either version 2 of the License, or (at your
4883 + * option) any later version.
4885 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4886 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4887 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4888 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4889 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4890 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4891 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4892 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4893 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4894 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4896 + * You should have received a copy of the GNU General Public License along
4897 + * with this program; if not, write to the Free Software Foundation, Inc.,
4898 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4901 + **************************************************************************
4902 + * May 2004 P. Sadik.
4908 + **************************************************************************
4911 +#ifndef __IDT_RC32365_H__
4912 +#define __IDT_RC32365_H__
4914 +extern unsigned int cedar_za;
4916 +/* Base address of internal registers */
4917 +#define RC32365_REG_BASE 0x18000000
4919 +/* System ID Registers */
4920 +#define CPU_SYSID (RC32365_REG_BASE + 0x00018)
4921 +#define CPU_DEVTYPE (RC32365_REG_BASE + 0x0001c)
4923 +/* Reset Controller */
4924 +#define RESET_CNTL (RC32365_REG_BASE + 0x08000)
4925 +#define BOOT_VECTOR (RC32365_REG_BASE + 0x08004)
4927 +/* Device Controller */
4928 +#define DEV0_BASE (RC32365_REG_BASE + 0x10000)
4929 +#define DEV0_MASK (RC32365_REG_BASE + 0x10004)
4930 +#define DEV0_CNTL (RC32365_REG_BASE + 0x10008)
4931 +#define DEV0_TIMING (RC32365_REG_BASE + 0x1000c)
4932 +#define DEV_REG_OFFSET 0x10
4934 +/* SDRAM Controller */
4935 +#define SDRAM0_BASE (RC32365_REG_BASE + 0x18000)
4936 +#define SDRAM0_MASK (RC32365_REG_BASE + 0x18004)
4937 +#define SDRAM1_BASE (RC32365_REG_BASE + 0x18008)
4938 +#define SDRAM1_MASK (RC32365_REG_BASE + 0x1800c)
4939 +#define SDRAM_CNTL (RC32365_REG_BASE + 0x18010)
4941 +/* Counters/Timers */
4942 +#define TIMER0_COUNT (RC32365_REG_BASE + 0x20000)
4943 +#define TIMER0_COMPARE (RC32365_REG_BASE + 0x20004)
4944 +#define TIMER0_CNTL (RC32365_REG_BASE + 0x20008)
4945 +#define TIMER0_SELECT (RC32365_REG_BASE + 0x2000c)
4946 +#define TIMER_REG_OFFSET 0x10
4948 +/* System Integrity */
4950 +/* Interrupt Controller */
4951 +#define IC_GROUP0_PEND (RC32365_REG_BASE + 0x30000)
4952 +#define IC_GROUP0_TEST (RC32365_REG_BASE + 0x30004)
4953 +#define IC_GROUP0_MASK (RC32365_REG_BASE + 0x30008)
4954 +#define IC_GROUP_OFFSET 0x0c
4956 +#define NUM_INTR_GROUPS 5
4958 + * The IRQ mapping is as follows:
4961 + * --- -------------------
4962 + * 0 SW0 (IP0) SW0 intr
4963 + * 1 SW1 (IP1) SW1 intr
4964 + * - Int0 (IP2) mapped to GROUP0_IRQ_BASE
4965 + * - Int1 (IP3) mapped to GROUP1_IRQ_BASE
4966 + * - Int2 (IP4) mapped to GROUP2_IRQ_BASE
4967 + * - Int3 (IP5) mapped to GROUP3_IRQ_BASE
4968 + * - Int4 (IP6) mapped to GROUP4_IRQ_BASE
4969 + * 7 Int5 (IP7) CP0 Timer
4971 + * IRQ's 8 and up are all mapped to Int0-4 (IP2-IP6), which
4972 + * internally on the RC32365 is routed to the Expansion
4973 + * Interrupt Controller.
4975 +#define MIPS_CPU_TIMER_IRQ 7
4977 +#define GROUP0_IRQ_BASE 8 // Counter/Timers, UCW
4978 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) // DMA
4979 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) // RNG, SEC
4980 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) // Eth, PCI, UARTs
4981 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32) // GPIO
4983 +#define RC32365_NR_IRQS (GROUP4_IRQ_BASE + 32)
4985 +/* DMA - see rc32365_dma.h for full list of registers */
4987 +#define RC32365_DMA_BASE (RC32365_REG_BASE + 0x38000)
4988 +#define DMA_CHAN_OFFSET 0x14
4990 +/* GPIO Controller */
4991 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
4995 +#define RC32300_UART0_BASE (RC32365_REG_BASE + 0x50003)
4997 +#define RC32300_UART0_BASE (RC32365_REG_BASE + 0x50000)
4999 +#define RC32300_UART0_IRQ (GROUP3_IRQ_BASE + 0)
5001 +/* Ethernet - see rc32365_eth.h for full list of registers */
5003 +#define RC32365_ETH_BASE (RC32365_REG_BASE + 0x58000)
5005 +#define IDT_CLOCK_MULT 2
5007 +/* FLASH (device 1) */
5008 +#define FLASH_BASE 0x08000000
5009 +#define FLASH_SIZE 0x00800000
5011 +/* LCD 4-digit display (device 2) */
5012 +#define LCD_DIGIT0 0x0C000003
5013 +#define LCD_DIGIT1 0x0C000002
5014 +#define LCD_DIGIT2 0x0C000001
5015 +#define LCD_DIGIT3 0x0C000000
5017 +/* RTC (DS1553) (device 2) */
5018 +#define RTC_BASE 0x0c800000
5020 +#define NVRAM_BASE RTC_BASE
5021 +#define NVRAM_ENVSIZE_OFF 4
5022 +#define NVRAM_ENVSTART_OFF 32
5024 +/* Interrupts routed on 79EB365 board */
5025 +#define RC32365_PCI_INTA_IRQ (GROUP4_IRQ_BASE + 8)
5026 +#define RC32365_PCI_INTB_IRQ (GROUP4_IRQ_BASE + 9)
5027 +#define RC32365_PCI_INTC_IRQ (GROUP4_IRQ_BASE + 10)
5028 +#define RC32365_PCI_INTD_IRQ (GROUP4_IRQ_BASE + 11)
5030 +#define RAM_SIZE (32 * 1024 * 1024)
5032 +#endif //__IDT_RC32365_H__
5033 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_pci.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_pci.h
5034 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_pci.h 1970-01-01 01:00:00.000000000 +0100
5035 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_pci.h 2006-01-10 00:32:33.000000000 +0100
5037 +/**************************************************************************
5039 + * BRIEF MODULE DESCRIPTION
5040 + * Datatype declaration for IDT 79EB365/336 PCI
5042 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5044 + * This program is free software; you can redistribute it and/or modify it
5045 + * under the terms of the GNU General Public License as published by the
5046 + * Free Software Foundation; either version 2 of the License, or (at your
5047 + * option) any later version.
5049 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5050 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5051 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5052 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5053 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5054 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5055 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5056 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5057 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5058 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5060 + * You should have received a copy of the GNU General Public License along
5061 + * with this program; if not, write to the Free Software Foundation, Inc.,
5062 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5065 + **************************************************************************
5066 + * May 2004 P. Sadik.
5072 + **************************************************************************
5075 +#ifndef __IDT_RC32365_PCI_H__
5076 +#define __IDT_RC32365_PCI_H__
5080 + PCI0_PhysicalAddress = 0x18068000,
5081 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
5083 + PCI0_VirtualAddress = 0xb8068000,
5084 + PCI_VirtualAddress = PCI0_VirtualAddress,
5089 + PCI_LbaCount = 4, // Local base addresses.
5094 + u32 a ; // Address.
5095 + u32 c ; // Control.
5096 + u32 m ; // mapping.
5106 + PCI_Map_s pcilba [PCI_LbaCount] ;
5114 +} volatile *PCI_t ;
5116 +// PCI messaging unit.
5123 + u32 pciim [PCIM_Count] ;
5124 + u32 pciom [PCIM_Count] ;
5131 +} volatile *PCIM_t ;
5133 +/*******************************************************************************
5135 + * PCI Control Register
5137 + ******************************************************************************/
5141 + PCIC_en_m = 0x00000001,
5143 + PCIC_tnr_m = 0x00000002,
5145 + PCIC_sce_m = 0x00000004,
5147 + PCIC_ien_m = 0x00000008,
5149 + PCIC_aaa_m = 0x00000010,
5151 + PCIC_eap_m = 0x00000020,
5153 + PCIC_pcim_m = 0x000001c0,
5154 + PCIC_pcim_disabled_v = 0,
5155 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
5156 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
5157 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
5158 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
5159 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
5160 + PCIC_pcim_reserved6_v = 6,
5161 + PCIC_pcim_reserved7_v = 7,
5163 + PCIC_igm_m = 0x00000200,
5166 +/*******************************************************************************
5168 + * PCI Status Register
5170 + ******************************************************************************/
5173 + PCIS_eed_m = 0x00000001,
5175 + PCIS_wr_m = 0x00000002,
5177 + PCIS_nmi_m = 0x00000004,
5179 + PCIS_ii_m = 0x00000008,
5181 + PCIS_cwe_m = 0x00000010,
5183 + PCIS_cre_m = 0x00000020,
5185 + PCIS_mdpe_m = 0x00000040,
5187 + PCIS_sta_m = 0x00000080,
5189 + PCIS_rta_m = 0x00000100,
5191 + PCIS_rma_m = 0x00000200,
5193 + PCIS_sse_m = 0x00000400,
5195 + PCIS_ose_m = 0x00000800,
5197 + PCIS_pe_m = 0x00001000,
5199 + PCIS_tae_m = 0x00002000,
5201 + PCIS_rle_m = 0x00004000,
5203 + PCIS_bme_m = 0x00008000,
5205 + PCIS_prd_m = 0x00010000,
5207 + PCIS_rip_m = 0x00020000,
5210 +/*******************************************************************************
5212 + * PCI Status Mask Register
5214 + ******************************************************************************/
5217 + PCISM_eed_m = 0x00000001,
5219 + PCISM_wr_m = 0x00000002,
5221 + PCISM_nmi_m = 0x00000004,
5223 + PCISM_ii_m = 0x00000008,
5225 + PCISM_cwe_m = 0x00000010,
5227 + PCISM_cre_m = 0x00000020,
5229 + PCISM_mdpe_m = 0x00000040,
5231 + PCISM_sta_m = 0x00000080,
5233 + PCISM_rta_m = 0x00000100,
5235 + PCISM_rma_m = 0x00000200,
5237 + PCISM_sse_m = 0x00000400,
5239 + PCISM_ose_m = 0x00000800,
5241 + PCISM_pe_m = 0x00001000,
5243 + PCISM_tae_m = 0x00002000,
5245 + PCISM_rle_m = 0x00004000,
5247 + PCISM_bme_m = 0x00008000,
5249 + PCISM_prd_m = 0x00010000,
5251 + PCISM_rip_m = 0x00020000,
5254 +/*******************************************************************************
5256 + * PCI Configuration Address Register
5258 + ******************************************************************************/
5260 + PCICFGA_reg_b = 2,
5261 + PCICFGA_reg_m = 0x000000fc,
5262 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
5263 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
5264 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
5265 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
5266 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
5267 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
5268 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
5269 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
5270 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
5271 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
5272 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
5273 + PCICFGA_reg_pba0m_v = 0x48>>2,
5274 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
5275 + PCICFGA_reg_pba1m_v = 0x50>>2,
5276 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
5277 + PCICFGA_reg_pba2m_v = 0x58>>2,
5278 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
5279 + PCICFGA_reg_pba3m_v = 0x60>>2,
5280 + PCICFGA_reg_pmgt_v = 0x64>>2,
5281 + PCICFGA_func_b = 8,
5282 + PCICFGA_func_m = 0x00000700,
5283 + PCICFGA_dev_b = 11,
5284 + PCICFGA_dev_m = 0x0000f800,
5285 + PCICFGA_dev_internal_v = 0,
5286 + PCICFGA_bus_b = 16,
5287 + PCICFGA_bus_m = 0x00ff0000,
5288 + PCICFGA_bus_type0_v = 0, //local bus
5289 + PCICFGA_en_b = 31, // read only
5290 + PCICFGA_en_m = 0x80000000,
5294 + PCFGID_vendor_b = 0,
5295 + PCFGID_vendor_m = 0x0000ffff,
5296 + PCFGID_vendor_IDT_v = 0x111d,
5297 + PCFGID_device_b = 16,
5298 + PCFGID_device_m = 0xffff0000,
5299 + PCFGID_device_Acaciade_v = 0x0207,
5301 + PCFG04_command_ioena_b = 1,
5302 + PCFG04_command_ioena_m = 0x00000001,
5303 + PCFG04_command_memena_b = 2,
5304 + PCFG04_command_memena_m = 0x00000002,
5305 + PCFG04_command_bmena_b = 3,
5306 + PCFG04_command_bmena_m = 0x00000004,
5307 + PCFG04_command_mwinv_b = 5,
5308 + PCFG04_command_mwinv_m = 0x00000010,
5309 + PCFG04_command_parena_b = 7,
5310 + PCFG04_command_parena_m = 0x00000040,
5311 + PCFG04_command_serrena_b = 9,
5312 + PCFG04_command_serrena_m = 0x00000100,
5313 + PCFG04_command_fastbbena_b = 10,
5314 + PCFG04_command_fastbbena_m = 0x00000200,
5315 + PCFG04_status_b = 16,
5316 + PCFG04_status_m = 0xffff0000,
5317 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
5318 + PCFG04_status_66MHz_m = 0x00200000,
5319 + PCFG04_status_fbb_b = 23,
5320 + PCFG04_status_fbb_m = 0x00800000,
5321 + PCFG04_status_mdpe_b = 24,
5322 + PCFG04_status_mdpe_m = 0x01000000,
5323 + PCFG04_status_dst_b = 25,
5324 + PCFG04_status_dst_m = 0x06000000,
5325 + PCFG04_status_sta_b = 27,
5326 + PCFG04_status_sta_m = 0x08000000,
5327 + PCFG04_status_rta_b = 28,
5328 + PCFG04_status_rta_m = 0x10000000,
5329 + PCFG04_status_rma_b = 29,
5330 + PCFG04_status_rma_m = 0x20000000,
5331 + PCFG04_status_sse_b = 30,
5332 + PCFG04_status_sse_m = 0x40000000,
5333 + PCFG04_status_pe_b = 31,
5334 + PCFG04_status_pe_m = 0x40000000,
5336 + PCFG08_revId_b = 0,
5337 + PCFG08_revId_m = 0x000000ff,
5338 + PCFG08_classCode_b = 0,
5339 + PCFG08_classCode_m = 0xffffff00,
5340 + PCFG08_classCode_bridge_v = 06,
5341 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
5342 + PCFG0C_cacheline_b = 0,
5343 + PCFG0C_cacheline_m = 0x000000ff,
5344 + PCFG0C_masterLatency_b = 8,
5345 + PCFG0C_masterLatency_m = 0x0000ff00,
5346 + PCFG0C_headerType_b = 16,
5347 + PCFG0C_headerType_m = 0x00ff0000,
5348 + PCFG0C_bist_b = 24,
5349 + PCFG0C_bist_m = 0xff000000,
5352 + PCIPBA_msi_m = 0x00000001,
5354 + PCIPBA_p_m = 0x00000004,
5355 + PCIPBA_baddr_b = 8,
5356 + PCIPBA_baddr_m = 0xffffff00,
5358 + PCFGSS_vendorId_b = 0,
5359 + PCFGSS_vendorId_m = 0x0000ffff,
5361 + PCFGSS_id_m = 0xffff0000,
5363 + PCFG3C_interruptLine_b = 0,
5364 + PCFG3C_interruptLine_m = 0x000000ff,
5365 + PCFG3C_interruptPin_b = 8,
5366 + PCFG3C_interruptPin_m = 0x0000ff00,
5367 + PCFG3C_minGrant_b = 16,
5368 + PCFG3C_minGrant_m = 0x00ff0000,
5369 + PCFG3C_maxLat_b = 24,
5370 + PCFG3C_maxLat_m = 0xff000000,
5372 + PCIPBAC_msi_b = 0,
5373 + PCIPBAC_msi_m = 0x00000001,
5375 + PCIPBAC_p_m = 0x00000002,
5376 + PCIPBAC_size_b = 2,
5377 + PCIPBAC_size_m = 0x0000007c,
5379 + PCIPBAC_sb_m = 0x00000080,
5381 + PCIPBAC_pp_m = 0x00000100,
5383 + PCIPBAC_mr_m = 0x00000600,
5384 + PCIPBAC_mr_read_v =0, //no prefetching
5385 + PCIPBAC_mr_readLine_v =1,
5386 + PCIPBAC_mr_readMult_v =2,
5387 + PCIPBAC_mrl_b = 11,
5388 + PCIPBAC_mrl_m = 0x00000800,
5389 + PCIPBAC_mrm_b = 12,
5390 + PCIPBAC_mrm_m = 0x00001000,
5391 + PCIPBAC_trp_b = 13,
5392 + PCIPBAC_trp_m = 0x00002000,
5394 + PCFG40_trdyTimeout_b = 0,
5395 + PCFG40_trdyTimeout_m = 0x000000ff,
5396 + PCFG40_retryLim_b = 8,
5397 + PCFG40_retryLim_m = 0x0000ff00,
5400 +/*******************************************************************************
5402 + * PCI Local Base Address [0|1|2|3] Register
5404 + ******************************************************************************/
5406 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
5407 + PCILBA_baddr_m = 0xffffff00,
5409 +/*******************************************************************************
5411 + * PCI Local Base Address Control Register
5413 + ******************************************************************************/
5415 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
5416 + PCILBAC_msi_m = 0x00000001,
5417 + PCILBAC_msi_mem_v = 0,
5418 + PCILBAC_msi_io_v = 1,
5419 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
5420 + PCILBAC_size_m = 0x0000007c,
5421 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
5422 + PCILBAC_sb_m = 0x00000080,
5423 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
5424 + PCILBAC_rt_m = 0x00000100,
5425 + PCILBAC_rt_noprefetch_v = 0, // mem read
5426 + PCILBAC_rt_prefetch_v = 1, // mem readline
5429 +/*******************************************************************************
5431 + * PCI Local Base Address [0|1|2|3] Mapping Register
5433 + ******************************************************************************/
5435 + PCILBAM_maddr_b = 8,
5436 + PCILBAM_maddr_m = 0xffffff00,
5439 +/*******************************************************************************
5441 + * PCI Decoupled Access Control Register
5443 + ******************************************************************************/
5446 + PCIDAC_den_m = 0x00000001,
5449 +/*******************************************************************************
5451 + * PCI Decoupled Access Status Register
5453 + ******************************************************************************/
5456 + PCIDAS_d_m = 0x00000001,
5458 + PCIDAS_b_m = 0x00000002,
5460 + PCIDAS_e_m = 0x00000004,
5462 + PCIDAS_ofe_m = 0x00000008,
5464 + PCIDAS_off_m = 0x00000010,
5466 + PCIDAS_ife_m = 0x00000020,
5468 + PCIDAS_iff_m = 0x00000040,
5471 +/*******************************************************************************
5473 + * PCI DMA Channel 8 Configuration Register
5475 + ******************************************************************************/
5478 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
5479 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
5480 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
5481 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
5484 +/*******************************************************************************
5486 + * PCI DMA Channel 9 Configuration Register
5488 + ******************************************************************************/
5491 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
5492 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
5495 +/*******************************************************************************
5497 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
5499 + ******************************************************************************/
5501 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
5502 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
5503 + // These are for reads (DMA channel 8)
5504 + PCIDMAD_devcmd_mr_v = 0, //memory read
5505 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
5506 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
5507 + PCIDMAD_devcmd_ior_v = 3, //I/O read
5508 + // These are for writes (DMA channel 9)
5509 + PCIDMAD_devcmd_mw_v = 0, //memory write
5510 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
5511 + PCIDMAD_devcmd_iow_v = 3, //I/O write
5513 + // Swap byte field applies to both DMA channel 8 and 9
5514 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
5515 + PCIDMAD_sb_m = 0x01000000, // swap byte field
5519 +/*******************************************************************************
5521 + * PCI Target Control Register
5523 + ******************************************************************************/
5526 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
5527 + PCITC_rtimer_m = 0x000000ff,
5528 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
5529 + PCITC_dtimer_m = 0x0000ff00,
5530 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
5531 + PCITC_rdr_m = 0x00040000,
5532 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
5533 + PCITC_ddt_m = 0x00080000,
5535 +/*******************************************************************************
5537 + * PCI messaging unit [applies to both inbound and outbound registers ]
5539 + ******************************************************************************/
5542 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5543 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
5544 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5545 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
5546 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5547 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
5551 +#endif // __IDT_RC32365_PCI_H__
5552 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h
5553 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h 1970-01-01 01:00:00.000000000 +0100
5554 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h 2006-01-10 00:32:33.000000000 +0100
5556 +/**************************************************************************
5558 + * BRIEF MODULE DESCRIPTION
5559 + * PCI header values for IDT 79EB365/336
5561 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5563 + * This program is free software; you can redistribute it and/or modify it
5564 + * under the terms of the GNU General Public License as published by the
5565 + * Free Software Foundation; either version 2 of the License, or (at your
5566 + * option) any later version.
5568 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5569 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5570 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5571 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5572 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5573 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5574 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5575 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5576 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5577 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5579 + * You should have received a copy of the GNU General Public License along
5580 + * with this program; if not, write to the Free Software Foundation, Inc.,
5581 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5584 + **************************************************************************
5585 + * May 2004 P. Sadik.
5591 + **************************************************************************
5594 +#ifndef __IDT_RC32365_PCI_V_H__
5595 +#define __IDT_RC32365_PCI_V_H__
5598 +#define PCI_MSG_VirtualAddress 0xB806C010
5599 +#define rc32365_pci ((volatile PCI_t) PCI0_VirtualAddress)
5600 +#define rc32365_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
5602 +#define PCIM_SHFT 0x6
5603 +#define PCIM_BIT_LEN 0x7
5604 +#define PCIM_H_EA 0x3
5605 +#define PCIM_H_IA_FIX 0x4
5606 +#define PCIM_H_IA_RR 0x5
5608 +#define PCI_ADDR_START 0x50000000
5610 +#define CPUTOPCI_MEM_WIN 0x02000000
5611 +#define CPUTOPCI_IO_WIN 0x00100000
5612 +#define PCILBA_SIZE_SHFT 2
5613 +#define PCILBA_SIZE_MASK 0x1F
5614 +#define SIZE_256MB 0x1C
5615 +#define SIZE_128MB 0x1B
5616 +#define SIZE_64MB 0x1A
5617 +#define SIZE_32MB 0x19
5618 +#define SIZE_16MB 0x18
5619 +#define SIZE_4MB 0x16
5620 +#define SIZE_2MB 0x15
5621 +#define SIZE_1MB 0x14
5622 +#define CEDAR_CONFIG0_ADDR 0x80000000
5623 +#define CEDAR_CONFIG1_ADDR 0x80000004
5624 +#define CEDAR_CONFIG2_ADDR 0x80000008
5625 +#define CEDAR_CONFIG3_ADDR 0x8000000C
5626 +#define CEDAR_CONFIG4_ADDR 0x80000010
5627 +#define CEDAR_CONFIG5_ADDR 0x80000014
5628 +#define CEDAR_CONFIG6_ADDR 0x80000018
5629 +#define CEDAR_CONFIG7_ADDR 0x8000001C
5630 +#define CEDAR_CONFIG8_ADDR 0x80000020
5631 +#define CEDAR_CONFIG9_ADDR 0x80000024
5632 +#define CEDAR_CONFIG10_ADDR 0x80000028
5633 +#define CEDAR_CONFIG11_ADDR 0x8000002C
5634 +#define CEDAR_CONFIG12_ADDR 0x80000030
5635 +#define CEDAR_CONFIG13_ADDR 0x80000034
5636 +#define CEDAR_CONFIG14_ADDR 0x80000038
5637 +#define CEDAR_CONFIG15_ADDR 0x8000003C
5638 +#define CEDAR_CONFIG16_ADDR 0x80000040
5639 +#define CEDAR_CONFIG17_ADDR 0x80000044
5640 +#define CEDAR_CONFIG18_ADDR 0x80000048
5641 +#define CEDAR_CONFIG19_ADDR 0x8000004C
5642 +#define CEDAR_CONFIG20_ADDR 0x80000050
5643 +#define CEDAR_CONFIG21_ADDR 0x80000054
5644 +#define CEDAR_CONFIG22_ADDR 0x80000058
5645 +#define CEDAR_CONFIG23_ADDR 0x8000005C
5646 +#define CEDAR_CONFIG24_ADDR 0x80000060
5647 +#define CEDAR_CONFIG25_ADDR 0x80000064
5648 +#define CEDAR_CMD (PCFG04_command_ioena_m | \
5649 + PCFG04_command_memena_m | \
5650 + PCFG04_command_bmena_m | \
5651 + PCFG04_command_mwinv_m | \
5652 + PCFG04_command_parena_m | \
5653 + PCFG04_command_serrena_m )
5655 +#define CEDAR_STAT (PCFG04_status_mdpe_m | \
5656 + PCFG04_status_sta_m | \
5657 + PCFG04_status_rta_m | \
5658 + PCFG04_status_rma_m | \
5659 + PCFG04_status_sse_m | \
5660 + PCFG04_status_pe_m)
5662 +#define CEDAR_CNFG1 ((CEDAR_STAT << 16) | \
5665 +#define CEDAR_REVID 0
5666 +#define CEDAR_CLASS_CODE 0
5667 +#define CEDAR_CNFG2 ((CEDAR_CLASS_CODE << 8) | \
5670 +#define CEDAR_CACHE_LINE_SIZE 4
5671 +#define CEDAR_MASTER_LAT 0x3c
5672 +#define CEDAR_HEADER_TYPE 0
5673 +#define CEDAR_BIST 0
5675 +#define CEDAR_CNFG3 ((CEDAR_BIST << 24) | \
5676 + (CEDAR_HEADER_TYPE << 16) | \
5677 + (CEDAR_MASTER_LAT << 8) | \
5678 + CEDAR_CACHE_LINE_SIZE)
5680 +#define CEDAR_BAR0 0x00000008 /* 128 MB Memory */
5681 +#define CEDAR_BAR1 0x18800001 /* 1 MB IO */
5682 +#define CEDAR_BAR2 0x18000001 /* 2 MB IO window for Cedar
5683 + internal Registers */
5684 +#define CEDAR_BAR3 0x48000008 /* Spare 128 MB Memory */
5686 +#define CEDAR_CNFG4 CEDAR_BAR0
5687 +#define CEDAR_CNFG5 CEDAR_BAR1
5688 +#define CEDAR_CNFG6 CEDAR_BAR2
5689 +#define CEDAR_CNFG7 CEDAR_BAR3
5691 +#define CEDAR_SUBSYS_VENDOR_ID 0
5692 +#define CEDAR_SUBSYSTEM_ID 0
5693 +#define CEDAR_CNFG8 0
5694 +#define CEDAR_CNFG9 0
5695 +#define CEDAR_CNFG10 0
5696 +#define CEDAR_CNFG11 ((CEDAR_SUBSYS_VENDOR_ID << 16) | \
5697 + CEDAR_SUBSYSTEM_ID)
5698 +#define CEDAR_INT_LINE 1
5699 +#define CEDAR_INT_PIN 1
5700 +#define CEDAR_MIN_GNT 8
5701 +#define CEDAR_MAX_LAT 0x38
5702 +#define CEDAR_CNFG12 0
5703 +#define CEDAR_CNFG13 0
5704 +#define CEDAR_CNFG14 0
5705 +#define CEDAR_CNFG15 ((CEDAR_MAX_LAT << 24) | \
5706 + (CEDAR_MIN_GNT << 16) | \
5707 + (CEDAR_INT_PIN << 8) | \
5709 +#define CEDAR_RETRY_LIMIT 0x80
5710 +#define CEDAR_TRDY_LIMIT 0x80
5711 +#define CEDAR_CNFG16 ((CEDAR_RETRY_LIMIT << 8) | \
5713 +#define PCI_PBAxC_R 0x0
5714 +#define PCI_PBAxC_RL 0x1
5715 +#define PCI_PBAxC_RM 0x2
5716 +#define SIZE_SHFT 2
5718 +#define CEDAR_PBA0C (((1 & 0x3) << PCIPBAC_mr_b) | \
5721 + (SIZE_128MB << SIZE_SHFT) | \
5725 +#define CEDAR_PBA0C (((1 & 0x3) << PCIPBAC_mr_b) | \
5727 + (SIZE_128MB << SIZE_SHFT) | \
5730 +#define CEDAR_CNFG17 CEDAR_PBA0C
5731 +#define CEDAR_PBA0M 0x0
5732 +#define CEDAR_CNFG18 CEDAR_PBA0M
5735 +#define CEDAR_PBA1C ((SIZE_1MB << SIZE_SHFT) | \
5739 +#define CEDAR_PBA1C ((SIZE_1MB << SIZE_SHFT) | \
5742 +#define CEDAR_CNFG19 CEDAR_PBA1C
5743 +#define CEDAR_PBA1M 0x0
5744 +#define CEDAR_CNFG20 CEDAR_PBA1M
5747 +#define CEDAR_PBA2C ((SIZE_2MB << SIZE_SHFT) | \
5751 +#define CEDAR_PBA2C ((SIZE_2MB << SIZE_SHFT) | \
5755 +#define CEDAR_CNFG21 CEDAR_PBA2C
5756 +#define CEDAR_PBA2M 0x18000000
5757 +#define CEDAR_CNFG22 CEDAR_PBA2M
5760 +#define CEDAR_PBA3C PCIPBAC_sb_m
5762 +#define CEDAR_PBA3C 0
5765 +#define CEDAR_CNFG23 CEDAR_PBA3C
5766 +#define CEDAR_PBA3M 0
5767 +#define CEDAR_CNFG24 CEDAR_PBA3M
5769 +#define PCITC_DTIMER_VAL 8
5770 +#define PCITC_RTIMER_VAL 0x10
5772 +#endif //__IDT_RC32365_PCI_V_H__
5773 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_dma.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_dma.h
5774 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_dma.h 1970-01-01 01:00:00.000000000 +0100
5775 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_dma.h 2006-01-10 00:32:33.000000000 +0100
5777 +/**************************************************************************
5779 + * BRIEF MODULE DESCRIPTION
5780 + * DMA register definition
5782 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5784 + * This program is free software; you can redistribute it and/or modify it
5785 + * under the terms of the GNU General Public License as published by the
5786 + * Free Software Foundation; either version 2 of the License, or (at your
5787 + * option) any later version.
5789 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5790 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5791 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5792 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5793 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5794 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5795 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5796 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5797 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5798 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5800 + * You should have received a copy of the GNU General Public License along
5801 + * with this program; if not, write to the Free Software Foundation, Inc.,
5802 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5805 + **************************************************************************
5806 + * May 2004 rkt, neb
5812 + **************************************************************************
5815 +#ifndef __IDT_DMA_H__
5816 +#define __IDT_DMA_H__
5820 + DMA0_PhysicalAddress = 0x18040000,
5821 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
5823 + DMA0_VirtualAddress = 0xb8040000,
5824 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
5828 + * DMA descriptor (in physical memory).
5831 +typedef struct DMAD_s
5833 + u32 control ; // Control. use DMAD_*
5834 + u32 ca ; // Current Address.
5835 + u32 devcs ; // Device control and status.
5836 + u32 link ; // Next descriptor in chain.
5837 +} volatile *DMAD_t ;
5841 + DMAD_size = sizeof (struct DMAD_s),
5842 + DMAD_count_b = 0, // in DMAD_t -> control
5843 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
5844 + DMAD_ds_b = 20, // in DMAD_t -> control
5845 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
5846 + DMAD_ds_ethRcv0_v = 0,
5847 + DMAD_ds_ethXmt0_v = 0,
5848 + DMAD_ds_memToFifo_v = 0,
5849 + DMAD_ds_fifoToMem_v = 0,
5850 + DMAD_ds_pciToMem_v = 0,
5851 + DMAD_ds_memToPci_v = 0,
5853 + DMAD_devcmd_b = 22, // in DMAD_t -> control
5854 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
5855 + DMAD_devcmd_byte_v = 0, //memory-to-memory
5856 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
5857 + DMAD_devcmd_word_v = 2, //memory-to-memory
5858 + DMAD_devcmd_2words_v = 3, //memory-to-memory
5859 + DMAD_devcmd_4words_v = 4, //memory-to-memory
5860 + DMAD_devcmd_6words_v = 5, //memory-to-memory
5861 + DMAD_devcmd_8words_v = 6, //memory-to-memory
5862 + DMAD_devcmd_16words_v = 7, //memory-to-memory
5863 + DMAD_cof_b = 25, // chain on finished
5864 + DMAD_cof_m = 0x02000000, //
5865 + DMAD_cod_b = 26, // chain on done
5866 + DMAD_cod_m = 0x04000000, //
5867 + DMAD_iof_b = 27, // interrupt on finished
5868 + DMAD_iof_m = 0x08000000, //
5869 + DMAD_iod_b = 28, // interrupt on done
5870 + DMAD_iod_m = 0x10000000, //
5871 + DMAD_t_b = 29, // terminated
5872 + DMAD_t_m = 0x20000000, //
5873 + DMAD_d_b = 30, // done
5874 + DMAD_d_m = 0x40000000, //
5875 + DMAD_f_b = 31, // finished
5876 + DMAD_f_m = 0x80000000, //
5880 + * DMA register (within Internal Register Map).
5885 + u32 dmac ; // Control.
5886 + u32 dmas ; // Status.
5887 + u32 dmasm ; // Mask.
5888 + u32 dmadptr ; // Descriptor pointer.
5889 + u32 dmandptr ; // Next descriptor pointer.
5892 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
5894 +//DMA_Channels use DMACH_count instead
5898 + DMAC_run_b = 0, //
5899 + DMAC_run_m = 0x00000001, //
5900 + DMAC_dm_b = 1, // done mask
5901 + DMAC_dm_m = 0x00000002, //
5902 + DMAC_mode_b = 2, //
5903 + DMAC_mode_m = 0x0000000c, //
5904 + DMAC_mode_auto_v = 0,
5905 + DMAC_mode_burst_v = 1,
5906 + DMAC_mode_transfer_v = 2, //usually used
5907 + DMAC_mode_reserved_v = 3,
5909 + DMAC_a_m = 0x00000010, //
5911 + DMAS_f_b = 0, // finished (sticky)
5912 + DMAS_f_m = 0x00000001, //
5913 + DMAS_d_b = 1, // done (sticky)
5914 + DMAS_d_m = 0x00000002, //
5915 + DMAS_c_b = 2, // chain (sticky)
5916 + DMAS_c_m = 0x00000004, //
5917 + DMAS_e_b = 3, // error (sticky)
5918 + DMAS_e_m = 0x00000008, //
5919 + DMAS_h_b = 4, // halt (sticky)
5920 + DMAS_h_m = 0x00000010, //
5922 + DMASM_f_b = 0, // finished (1=mask)
5923 + DMASM_f_m = 0x00000001, //
5924 + DMASM_d_b = 1, // done (1=mask)
5925 + DMASM_d_m = 0x00000002, //
5926 + DMASM_c_b = 2, // chain (1=mask)
5927 + DMASM_c_m = 0x00000004, //
5928 + DMASM_e_b = 3, // error (1=mask)
5929 + DMASM_e_m = 0x00000008, //
5930 + DMASM_h_b = 4, // halt (1=mask)
5931 + DMASM_h_m = 0x00000010, //
5935 + * DMA channel definitions
5940 + DMACH_ethRcv0 = 0,
5941 + DMACH_ethXmt0 = 1,
5942 + DMACH_memToFifo = 2,
5943 + DMACH_fifoToMem = 3,
5944 + DMACH_pciToMem = 4,
5945 + DMACH_memToPci = 5,
5947 + DMACH_count //must be last
5951 +typedef struct DMAC_s
5953 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
5954 +} volatile *DMA_t ;
5958 + * External DMA parameters
5963 + DMADEVCMD_ts_b = 0, // ts field in devcmd
5964 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
5965 + DMADEVCMD_ts_byte_v = 0,
5966 + DMADEVCMD_ts_halfword_v = 1,
5967 + DMADEVCMD_ts_word_v = 2,
5968 + DMADEVCMD_ts_2word_v = 3,
5969 + DMADEVCMD_ts_4word_v = 4,
5970 + DMADEVCMD_ts_6word_v = 5,
5971 + DMADEVCMD_ts_8word_v = 6,
5972 + DMADEVCMD_ts_16word_v = 7
5976 +#endif // __IDT_DMA_H__
5982 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h
5983 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h 1970-01-01 01:00:00.000000000 +0100
5984 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h 2006-01-10 00:32:33.000000000 +0100
5986 +/**************************************************************************
5988 + * BRIEF MODULE DESCRIPTION
5989 + * Definitions for DMA controller.
5991 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5993 + * This program is free software; you can redistribute it and/or modify it
5994 + * under the terms of the GNU General Public License as published by the
5995 + * Free Software Foundation; either version 2 of the License, or (at your
5996 + * option) any later version.
5998 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5999 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6000 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6001 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6002 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6003 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6004 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6005 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6006 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6007 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6009 + * You should have received a copy of the GNU General Public License along
6010 + * with this program; if not, write to the Free Software Foundation, Inc.,
6011 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6014 + **************************************************************************
6015 + * May 2004 rkt, neb.
6021 + **************************************************************************
6024 +#ifndef __IDT_DMA_V_H__
6025 +#define __IDT_DMA_V_H__
6027 +#include <asm/idt-boards/rc32434/rc32434_dma.h>
6028 +#include <asm/idt-boards/rc32434/rc32434.h>
6030 +#define DMA_CHAN_OFFSET 0x14
6031 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
6032 +#define DMA_COUNT(count) \
6033 + ((count) & DMAD_count_m)
6035 +#define DMA_HALT_TIMEOUT 500
6038 +static inline int rc32434_halt_dma(DMA_Chan_t ch)
6041 + if (rc32434_readl(&ch->dmac) & DMAC_run_m) {
6042 + rc32434_writel(0, &ch->dmac);
6044 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
6045 + if (rc32434_readl(&ch->dmas) & DMAS_h_m) {
6046 + rc32434_writel(0, &ch->dmas);
6053 + return timeout ? 0 : 1;
6056 +static inline void rc32434_start_dma(DMA_Chan_t ch, u32 dma_addr)
6058 + rc32434_writel(0, &ch->dmandptr);
6059 + rc32434_writel(dma_addr, &ch->dmadptr);
6062 +static inline void rc32434_chain_dma(DMA_Chan_t ch, u32 dma_addr)
6064 + rc32434_writel(dma_addr, &ch->dmandptr);
6067 +#endif // __IDT_DMA_V_H__
6075 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_eth.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_eth.h
6076 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_eth.h 1970-01-01 01:00:00.000000000 +0100
6077 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_eth.h 2006-01-10 00:32:33.000000000 +0100
6079 +/**************************************************************************
6081 + * BRIEF MODULE DESCRIPTION
6082 + * Ethernet register definition
6084 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6086 + * This program is free software; you can redistribute it and/or modify it
6087 + * under the terms of the GNU General Public License as published by the
6088 + * Free Software Foundation; either version 2 of the License, or (at your
6089 + * option) any later version.
6091 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6092 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6093 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6094 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6095 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6096 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6097 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6098 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6099 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6100 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6102 + * You should have received a copy of the GNU General Public License along
6103 + * with this program; if not, write to the Free Software Foundation, Inc.,
6104 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6107 + **************************************************************************
6108 + * May 2004 rkt, neb.
6114 + **************************************************************************
6117 +#ifndef __IDT_ETH_H__
6118 +#define __IDT_ETH_H__
6123 + ETH0_PhysicalAddress = 0x18060000,
6124 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
6126 + ETH0_VirtualAddress = 0xb8060000,
6127 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
6137 + u32 ethu0 [4] ; // Reserved.
6140 + u32 eth_u1 [10] ; // Reserved.
6142 + u32 eth_u2 [42] ; // Reserved.
6157 + u32 eth_u9 [50] ; // Reserved.
6164 + u32 eth_u10 ; // Reserved.
6172 + u32 eth_u11 ; // Reserved.
6173 + u32 eth_u12 ; // Reserved.
6181 + ETHINTFC_en_b = 0,
6182 + ETHINTFC_en_m = 0x00000001,
6183 + ETHINTFC_its_b = 1,
6184 + ETHINTFC_its_m = 0x00000002,
6185 + ETHINTFC_rip_b = 2,
6186 + ETHINTFC_rip_m = 0x00000004,
6187 + ETHINTFC_jam_b = 3,
6188 + ETHINTFC_jam_m = 0x00000008,
6189 + ETHINTFC_ovr_b = 4,
6190 + ETHINTFC_ovr_m = 0x00000010,
6191 + ETHINTFC_und_b = 5,
6192 + ETHINTFC_und_m = 0x00000020,
6194 + ETHFIFOTT_tth_b = 0,
6195 + ETHFIFOTT_tth_m = 0x0000007f,
6198 + ETHARC_pro_m = 0x00000001,
6200 + ETHARC_am_m = 0x00000002,
6202 + ETHARC_afm_m = 0x00000004,
6204 + ETHARC_ab_m = 0x00000008,
6206 + ETHSAL_byte5_b = 0,
6207 + ETHSAL_byte5_m = 0x000000ff,
6208 + ETHSAL_byte4_b = 8,
6209 + ETHSAL_byte4_m = 0x0000ff00,
6210 + ETHSAL_byte3_b = 16,
6211 + ETHSAL_byte3_m = 0x00ff0000,
6212 + ETHSAL_byte2_b = 24,
6213 + ETHSAL_byte2_m = 0xff000000,
6215 + ETHSAH_byte1_b = 0,
6216 + ETHSAH_byte1_m = 0x000000ff,
6217 + ETHSAH_byte0_b = 8,
6218 + ETHSAH_byte0_m = 0x0000ff00,
6221 + ETHGPF_ptv_m = 0x0000ffff,
6224 + ETHPFS_pfd_m = 0x00000001,
6226 + ETHCFSA0_cfsa4_b = 0,
6227 + ETHCFSA0_cfsa4_m = 0x000000ff,
6228 + ETHCFSA0_cfsa5_b = 8,
6229 + ETHCFSA0_cfsa5_m = 0x0000ff00,
6231 + ETHCFSA1_cfsa2_b = 0,
6232 + ETHCFSA1_cfsa2_m = 0x000000ff,
6233 + ETHCFSA1_cfsa3_b = 8,
6234 + ETHCFSA1_cfsa3_m = 0x0000ff00,
6236 + ETHCFSA2_cfsa0_b = 0,
6237 + ETHCFSA2_cfsa0_m = 0x000000ff,
6238 + ETHCFSA2_cfsa1_b = 8,
6239 + ETHCFSA2_cfsa1_m = 0x0000ff00,
6242 + ETHMAC1_re_m = 0x00000001,
6243 + ETHMAC1_paf_b = 1,
6244 + ETHMAC1_paf_m = 0x00000002,
6245 + ETHMAC1_rfc_b = 2,
6246 + ETHMAC1_rfc_m = 0x00000004,
6247 + ETHMAC1_tfc_b = 3,
6248 + ETHMAC1_tfc_m = 0x00000008,
6250 + ETHMAC1_lb_m = 0x00000010,
6251 + ETHMAC1_mr_b = 31,
6252 + ETHMAC1_mr_m = 0x80000000,
6255 + ETHMAC2_fd_m = 0x00000001,
6256 + ETHMAC2_flc_b = 1,
6257 + ETHMAC2_flc_m = 0x00000002,
6258 + ETHMAC2_hfe_b = 2,
6259 + ETHMAC2_hfe_m = 0x00000004,
6261 + ETHMAC2_dc_m = 0x00000008,
6262 + ETHMAC2_cen_b = 4,
6263 + ETHMAC2_cen_m = 0x00000010,
6265 + ETHMAC2_pe_m = 0x00000020,
6266 + ETHMAC2_vpe_b = 6,
6267 + ETHMAC2_vpe_m = 0x00000040,
6268 + ETHMAC2_ape_b = 7,
6269 + ETHMAC2_ape_m = 0x00000080,
6270 + ETHMAC2_ppe_b = 8,
6271 + ETHMAC2_ppe_m = 0x00000100,
6272 + ETHMAC2_lpe_b = 9,
6273 + ETHMAC2_lpe_m = 0x00000200,
6274 + ETHMAC2_nb_b = 12,
6275 + ETHMAC2_nb_m = 0x00001000,
6276 + ETHMAC2_bp_b = 13,
6277 + ETHMAC2_bp_m = 0x00002000,
6278 + ETHMAC2_ed_b = 14,
6279 + ETHMAC2_ed_m = 0x00004000,
6281 + ETHIPGT_ipgt_b = 0,
6282 + ETHIPGT_ipgt_m = 0x0000007f,
6284 + ETHIPGR_ipgr2_b = 0,
6285 + ETHIPGR_ipgr2_m = 0x0000007f,
6286 + ETHIPGR_ipgr1_b = 8,
6287 + ETHIPGR_ipgr1_m = 0x00007f00,
6289 + ETHCLRT_maxret_b = 0,
6290 + ETHCLRT_maxret_m = 0x0000000f,
6291 + ETHCLRT_colwin_b = 8,
6292 + ETHCLRT_colwin_m = 0x00003f00,
6294 + ETHMAXF_maxf_b = 0,
6295 + ETHMAXF_maxf_m = 0x0000ffff,
6297 + ETHMTEST_tb_b = 2,
6298 + ETHMTEST_tb_m = 0x00000004,
6301 + ETHMCP_div_m = 0x000000ff,
6303 + MIIMCFG_rsv_b = 0,
6304 + MIIMCFG_rsv_m = 0x0000000c,
6307 + MIIMCMD_rd_m = 0x00000001,
6308 + MIIMCMD_scn_b = 1,
6309 + MIIMCMD_scn_m = 0x00000002,
6311 + MIIMADDR_regaddr_b = 0,
6312 + MIIMADDR_regaddr_m = 0x0000001f,
6313 + MIIMADDR_phyaddr_b = 8,
6314 + MIIMADDR_phyaddr_m = 0x00001f00,
6316 + MIIMWTD_wdata_b = 0,
6317 + MIIMWTD_wdata_m = 0x0000ffff,
6319 + MIIMRDD_rdata_b = 0,
6320 + MIIMRDD_rdata_m = 0x0000ffff,
6322 + MIIMIND_bsy_b = 0,
6323 + MIIMIND_bsy_m = 0x00000001,
6324 + MIIMIND_scn_b = 1,
6325 + MIIMIND_scn_m = 0x00000002,
6327 + MIIMIND_nv_m = 0x00000004,
6332 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
6337 + ETHRX_fd_m = 0x00000001,
6339 + ETHRX_ld_m = 0x00000002,
6341 + ETHRX_rok_m = 0x00000004,
6343 + ETHRX_fm_m = 0x00000008,
6345 + ETHRX_mp_m = 0x00000010,
6347 + ETHRX_bp_m = 0x00000020,
6349 + ETHRX_vlt_m = 0x00000040,
6351 + ETHRX_cf_m = 0x00000080,
6353 + ETHRX_ovr_m = 0x00000100,
6355 + ETHRX_crc_m = 0x00000200,
6357 + ETHRX_cv_m = 0x00000400,
6359 + ETHRX_db_m = 0x00000800,
6361 + ETHRX_le_m = 0x00001000,
6363 + ETHRX_lor_m = 0x00002000,
6365 + ETHRX_ces_m = 0x00004000,
6366 + ETHRX_length_b = 16,
6367 + ETHRX_length_m = 0xffff0000,
6370 + ETHTX_fd_m = 0x00000001,
6372 + ETHTX_ld_m = 0x00000002,
6374 + ETHTX_oen_m = 0x00000004,
6376 + ETHTX_pen_m = 0x00000008,
6378 + ETHTX_cen_m = 0x00000010,
6380 + ETHTX_hen_m = 0x00000020,
6382 + ETHTX_tok_m = 0x00000040,
6384 + ETHTX_mp_m = 0x00000080,
6386 + ETHTX_bp_m = 0x00000100,
6388 + ETHTX_und_m = 0x00000200,
6390 + ETHTX_of_m = 0x00000400,
6392 + ETHTX_ed_m = 0x00000800,
6394 + ETHTX_ec_m = 0x00001000,
6396 + ETHTX_lc_m = 0x00002000,
6398 + ETHTX_td_m = 0x00004000,
6400 + ETHTX_crc_m = 0x00008000,
6402 + ETHTX_le_m = 0x00010000,
6404 + ETHTX_cc_m = 0x001E0000,
6407 +#endif // __IDT_ETH_H__
6412 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h
6413 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h 1970-01-01 01:00:00.000000000 +0100
6414 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h 2006-01-10 00:32:33.000000000 +0100
6416 +/**************************************************************************
6418 + * BRIEF MODULE DESCRIPTION
6419 + * Ethernet register definition
6421 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6423 + * This program is free software; you can redistribute it and/or modify it
6424 + * under the terms of the GNU General Public License as published by the
6425 + * Free Software Foundation; either version 2 of the License, or (at your
6426 + * option) any later version.
6428 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6429 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6430 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6431 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6432 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6433 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6434 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6435 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6436 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6437 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6439 + * You should have received a copy of the GNU General Public License along
6440 + * with this program; if not, write to the Free Software Foundation, Inc.,
6441 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6444 + **************************************************************************
6445 + * May 2004 rkt, neb.
6451 + **************************************************************************
6454 +#ifndef __IDT_ETH_V_H__
6455 +#define __IDT_ETH_V_H__
6457 +#include <asm/idt-boards/rc32434/rc32434_eth.h>
6459 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
6460 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
6461 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
6462 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
6463 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
6464 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
6465 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
6466 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
6467 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
6468 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
6469 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
6471 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
6473 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
6474 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
6475 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
6476 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
6477 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
6478 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
6479 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
6480 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
6481 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
6482 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
6483 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
6484 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
6485 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
6486 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
6487 +#endif // __IDT_ETH_V_H__
6493 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h
6494 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h 1970-01-01 01:00:00.000000000 +0100
6495 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h 2006-01-10 00:32:33.000000000 +0100
6497 +/**************************************************************************
6499 + * BRIEF MODULE DESCRIPTION
6500 + * GPIO register definition
6502 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6504 + * This program is free software; you can redistribute it and/or modify it
6505 + * under the terms of the GNU General Public License as published by the
6506 + * Free Software Foundation; either version 2 of the License, or (at your
6507 + * option) any later version.
6509 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6510 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6511 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6512 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6513 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6514 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6515 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6516 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6517 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6518 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6520 + * You should have received a copy of the GNU General Public License along
6521 + * with this program; if not, write to the Free Software Foundation, Inc.,
6522 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6525 + **************************************************************************
6526 + * May 2004 rkt, neb.
6532 + **************************************************************************
6535 +#ifndef __IDT_GPIO_H__
6536 +#define __IDT_GPIO_H__
6540 + GPIO0_PhysicalAddress = 0x18050000,
6541 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
6543 + GPIO0_VirtualAddress = 0xb8050000,
6544 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
6549 + u32 gpiofunc; /* GPIO Function Register
6550 + * gpiofunc[x]==0 bit = gpio
6551 + * func[x]==1 bit = altfunc
6553 + u32 gpiocfg; /* GPIO Configuration Register
6554 + * gpiocfg[x]==0 bit = input
6555 + * gpiocfg[x]==1 bit = output
6557 + u32 gpiod; /* GPIO Data Register
6558 + * gpiod[x] read/write gpio pinX status
6560 + u32 gpioilevel; /* GPIO Interrupt Status Register
6561 + * interrupt level (see gpioistat)
6563 + u32 gpioistat; /* Gpio Interrupt Status Register
6564 + * istat[x] = (gpiod[x] == level[x])
6565 + * cleared in ISR (STICKY bits)
6567 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
6568 +} volatile * GPIO_t ;
6572 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
6573 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
6574 + GPIO_input_v = 0, // gpiocfg use pin as input.
6575 + GPIO_output_v = 1, // gpiocfg use pin as output.
6577 + GPIO_pin0_m = 0x00000001,
6579 + GPIO_pin1_m = 0x00000002,
6581 + GPIO_pin2_m = 0x00000004,
6583 + GPIO_pin3_m = 0x00000008,
6585 + GPIO_pin4_m = 0x00000010,
6587 + GPIO_pin5_m = 0x00000020,
6589 + GPIO_pin6_m = 0x00000040,
6591 + GPIO_pin7_m = 0x00000080,
6593 + GPIO_pin8_m = 0x00000100,
6595 + GPIO_pin9_m = 0x00000200,
6596 + GPIO_pin10_b = 10,
6597 + GPIO_pin10_m = 0x00000400,
6598 + GPIO_pin11_b = 11,
6599 + GPIO_pin11_m = 0x00000800,
6600 + GPIO_pin12_b = 12,
6601 + GPIO_pin12_m = 0x00001000,
6602 + GPIO_pin13_b = 13,
6603 + GPIO_pin13_m = 0x00002000,
6605 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
6607 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
6608 + GPIO_u0sout_m = GPIO_pin0_m,
6609 + GPIO_u0sout_cfg_v = GPIO_output_v,
6610 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
6611 + GPIO_u0sinp_m = GPIO_pin1_m,
6612 + GPIO_u0sinp_cfg_v = GPIO_input_v,
6613 + GPIO_u0rtsn_b = GPIO_pin2_b, // UART 0 req. to send.
6614 + GPIO_u0rtsn_m = GPIO_pin2_m,
6615 + GPIO_u0rtsn_cfg_v = GPIO_output_v,
6616 + GPIO_u0ctsn_b = GPIO_pin3_b, // UART 0 clear to send.
6617 + GPIO_u0ctsn_m = GPIO_pin3_m,
6618 + GPIO_u0ctsn_cfg_v = GPIO_input_v,
6620 + GPIO_maddr22_b = GPIO_pin4_b, // M&P bus bit 22.
6621 + GPIO_maddr22_m = GPIO_pin4_m,
6622 + GPIO_maddr22_cfg_v = GPIO_output_v,
6624 + GPIO_maddr23_b = GPIO_pin5_b, // M&P bus bit 23.
6625 + GPIO_maddr23_m = GPIO_pin5_m,
6626 + GPIO_maddr23_cfg_v = GPIO_output_v,
6628 + GPIO_maddr24_b = GPIO_pin6_b, // M&P bus bit 24.
6629 + GPIO_maddr24_m = GPIO_pin6_m,
6630 + GPIO_maddr24_cfg_v = GPIO_output_v,
6632 + GPIO_maddr25_b = GPIO_pin7_b, // M&P bus bit 25.
6633 + GPIO_maddr25_m = GPIO_pin7_m,
6634 + GPIO_maddr25_cfg_v = GPIO_output_v,
6636 + GPIO_cpudmadebug_b = GPIO_pin8_b, // CPU or DMA debug pin
6637 + GPIO_cpudmadebug_m = GPIO_pin8_m,
6638 + GPIO_cpudmadebug_cfg_v = GPIO_output_v,
6640 + GPIO_pcireq4_b = GPIO_pin9_b, // PCI Request 4
6641 + GPIO_pcireq4_m = GPIO_pin9_m,
6642 + GPIO_pcireq4_cfg_v = GPIO_input_v,
6644 + GPIO_pcigrant4_b = GPIO_pin10_b, // PCI Grant 4
6645 + GPIO_pcigrant4_m = GPIO_pin10_m,
6646 + GPIO_pcigrant4_cfg_v = GPIO_output_v,
6648 + GPIO_pcireq5_b = GPIO_pin11_b, // PCI Request 5
6649 + GPIO_pcireq5_m = GPIO_pin11_m,
6650 + GPIO_pcireq5_cfg_v = GPIO_input_v,
6652 + GPIO_pcigrant5_b = GPIO_pin12_b, // PCI Grant 5
6653 + GPIO_pcigrant5_m = GPIO_pin12_m,
6654 + GPIO_pcigrant5_cfg_v = GPIO_output_v,
6656 + GPIO_pcimuintn_b = GPIO_pin13_b, // PCI messaging int.
6657 + GPIO_pcimuintn_m = GPIO_pin13_m,
6658 + GPIO_pcimuintn_cfg_v = GPIO_output_v,
6662 +#endif // __IDT_GPIO_H__
6664 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434.h
6665 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434.h 1970-01-01 01:00:00.000000000 +0100
6666 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434.h 2006-01-10 00:32:33.000000000 +0100
6668 + /**************************************************************************
6670 + * BRIEF MODULE DESCRIPTION
6671 + * Definitions for IDT RC32434 CPU
6673 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6675 + * This program is free software; you can redistribute it and/or modify it
6676 + * under the terms of the GNU General Public License as published by the
6677 + * Free Software Foundation; either version 2 of the License, or (at your
6678 + * option) any later version.
6680 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6681 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6682 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6683 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6684 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6685 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6686 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6687 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6688 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6689 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6691 + * You should have received a copy of the GNU General Public License along
6692 + * with this program; if not, write to the Free Software Foundation, Inc.,
6693 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6696 + **************************************************************************
6697 + * May 2004 rkt, neb.
6703 + **************************************************************************
6706 +#ifndef _RC32434_H_
6707 +#define _RC32434_H_
6709 +#include <linux/config.h>
6710 +#include <linux/delay.h>
6711 +#include <asm/io.h>
6712 +#include <asm/idt-boards/rc32434/rc32434_timer.h>
6714 +#define RC32434_REG_BASE 0x18000000
6717 +#define interrupt ((volatile INT_t ) INT0_VirtualAddress)
6718 +#define idt_timer ((volatile TIM_t) TIM0_VirtualAddress)
6719 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
6721 +#define IDT_CLOCK_MULT 2
6722 +#define MIPS_CPU_TIMER_IRQ 7
6723 +/* Interrupt Controller */
6724 +#define IC_GROUP0_PEND (RC32434_REG_BASE + 0x38000)
6725 +#define IC_GROUP0_MASK (RC32434_REG_BASE + 0x38008)
6726 +#define IC_GROUP_OFFSET 0x0C
6727 +#define RTC_BASE 0xBA001FF0
6729 +#define NUM_INTR_GROUPS 5
6732 +#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
6733 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) /* GRP3 IRQ numbers start here */
6734 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) /* GRP4 IRQ numbers start here */
6735 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) /* GRP5 IRQ numbers start here */
6736 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
6740 +#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58003)
6741 +#define EB434_UART1_BASE (0x19800003)
6745 +#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58000)
6746 +#define EB434_UART1_BASE (0x19800000)
6750 +#define RC32434_UART0_IRQ GROUP3_IRQ_BASE + 0
6751 +#define EB434_UART1_IRQ GROUP4_IRQ_BASE + 11
6753 +#define RC32434_NR_IRQS (GROUP4_IRQ_BASE + 32)
6755 +/* cpu pipeline flush */
6756 +static inline void rc32434_sync(void)
6758 + __asm__ volatile ("sync");
6761 +static inline void rc32434_sync_udelay(int us)
6763 + __asm__ volatile ("sync");
6767 +static inline void rc32434_sync_delay(int ms)
6769 + __asm__ volatile ("sync");
6776 + * Macros to access internal RC32434 registers. No byte
6777 + * swapping should be done when accessing the internal
6781 +#define rc32434_readb __raw_readb
6782 +#define rc32434_readw __raw_readw
6783 +#define rc32434_readl __raw_readl
6785 +#define rc32434_writeb __raw_writeb
6786 +#define rc32434_writew __raw_writew
6787 +#define rc32434_writel __raw_writel
6790 +static inline u8 rc32434_readb(unsigned long pa)
6792 + return *((volatile u8 *)KSEG1ADDR(pa));
6794 +static inline u16 rc32434_readw(unsigned long pa)
6796 + return *((volatile u16 *)KSEG1ADDR(pa));
6798 +static inline u32 rc32434_readl(unsigned long pa)
6800 + return *((volatile u32 *)KSEG1ADDR(pa));
6802 +static inline void rc32434_writeb(u8 val, unsigned long pa)
6804 + *((volatile u8 *)KSEG1ADDR(pa)) = val;
6806 +static inline void rc32434_writew(u16 val, unsigned long pa)
6808 + *((volatile u16 *)KSEG1ADDR(pa)) = val;
6810 +static inline void rc32434_writel(u32 val, unsigned long pa)
6812 + *((volatile u32 *)KSEG1ADDR(pa)) = val;
6819 + * C access to CLZ and CLO instructions
6820 + * (count leading zeroes/ones).
6822 +static inline int rc32434_clz(unsigned long val)
6825 + __asm__ volatile (
6826 + ".set\tnoreorder\n\t"
6828 + ".set\tmips32\n\t"
6838 +static inline int rc32434_clo(unsigned long val)
6841 + __asm__ volatile (
6842 + ".set\tnoreorder\n\t"
6844 + ".set\tmips32\n\t"
6854 +#endif /* _RC32434_H_ */
6867 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_integ.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_integ.h
6868 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_integ.h 1970-01-01 01:00:00.000000000 +0100
6869 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_integ.h 2006-01-10 00:32:33.000000000 +0100
6871 +/**************************************************************************
6873 + * BRIEF MODULE DESCRIPTION
6874 + * System Integrity register definition
6876 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6878 + * This program is free software; you can redistribute it and/or modify it
6879 + * under the terms of the GNU General Public License as published by the
6880 + * Free Software Foundation; either version 2 of the License, or (at your
6881 + * option) any later version.
6883 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6884 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6885 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6886 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6887 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6888 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6889 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6890 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6891 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6892 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6894 + * You should have received a copy of the GNU General Public License along
6895 + * with this program; if not, write to the Free Software Foundation, Inc.,
6896 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6899 + **************************************************************************
6900 + * May 2004 rkt, neb
6906 + **************************************************************************
6909 +#ifndef __IDT_INTEG_H__
6910 +#define __IDT_INTEG_H__
6914 + INTEG0_PhysicalAddress = 0x18030000,
6915 + INTEG_PhysicalAddress = INTEG0_PhysicalAddress, // Default
6917 + INTEG0_VirtualAddress = 0xB8030000,
6918 + INTEG_VirtualAddress = INTEG0_VirtualAddress, // Default
6921 +// if you are looking for CEA, try rst.h
6924 + u32 filler [0xc] ; // 0x30 bytes unused.
6925 + u32 errcs ; // sticky use ERRCS_
6926 + u32 wtcount ; // Watchdog timer count reg.
6927 + u32 wtcompare ; // Watchdog timer timeout value.
6928 + u32 wtc ; // Watchdog timer control. use WTC_
6929 +} volatile *INTEG_t ;
6933 + ERRCS_wto_b = 0, // In INTEG_t -> errcs
6934 + ERRCS_wto_m = 0x00000001,
6935 + ERRCS_wne_b = 1, // In INTEG_t -> errcs
6936 + ERRCS_wne_m = 0x00000002,
6937 + ERRCS_ucw_b = 2, // In INTEG_t -> errcs
6938 + ERRCS_ucw_m = 0x00000004,
6939 + ERRCS_ucr_b = 3, // In INTEG_t -> errcs
6940 + ERRCS_ucr_m = 0x00000008,
6941 + ERRCS_upw_b = 4, // In INTEG_t -> errcs
6942 + ERRCS_upw_m = 0x00000010,
6943 + ERRCS_upr_b = 5, // In INTEG_t -> errcs
6944 + ERRCS_upr_m = 0x00000020,
6945 + ERRCS_udw_b = 6, // In INTEG_t -> errcs
6946 + ERRCS_udw_m = 0x00000040,
6947 + ERRCS_udr_b = 7, // In INTEG_t -> errcs
6948 + ERRCS_udr_m = 0x00000080,
6949 + ERRCS_sae_b = 8, // In INTEG_t -> errcs
6950 + ERRCS_sae_m = 0x00000100,
6951 + ERRCS_wre_b = 9, // In INTEG_t -> errcs
6952 + ERRCS_wre_m = 0x00000200,
6954 + WTC_en_b = 0, // In INTEG_t -> wtc
6955 + WTC_en_m = 0x00000001,
6956 + WTC_to_b = 1, // In INTEG_t -> wtc
6957 + WTC_to_m = 0x00000002,
6960 +#endif // __IDT_INTEG_H__
6961 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_int.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_int.h
6962 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_int.h 1970-01-01 01:00:00.000000000 +0100
6963 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_int.h 2006-01-10 00:32:33.000000000 +0100
6965 +/**************************************************************************
6967 + * BRIEF MODULE DESCRIPTION
6968 + * Interrupt Controller register definition.
6970 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6972 + * This program is free software; you can redistribute it and/or modify it
6973 + * under the terms of the GNU General Public License as published by the
6974 + * Free Software Foundation; either version 2 of the License, or (at your
6975 + * option) any later version.
6977 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6978 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6979 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6980 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6981 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6982 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6983 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6984 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6985 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6986 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6988 + * You should have received a copy of the GNU General Public License along
6989 + * with this program; if not, write to the Free Software Foundation, Inc.,
6990 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6993 + **************************************************************************
6994 + * May 2004 rkt, neb.
7000 + **************************************************************************
7003 +#ifndef __IDT_INT_H__
7004 +#define __IDT_INT_H__
7008 + INT0_PhysicalAddress = 0x18038000,
7009 + INT_PhysicalAddress = INT0_PhysicalAddress, // Default
7011 + INT0_VirtualAddress = 0xB8038000,
7012 + INT_VirtualAddress = INT0_VirtualAddress, // Default
7017 + u32 ipend ; //Pending interrupts. use INT?_
7018 + u32 itest ; //Test bits. use INT?_
7019 + u32 imask ; //Interrupt disabled when set. use INT?_
7024 + IPEND2 = 0, // HW 2 interrupt to core. use INT2_
7025 + IPEND3 = 1, // HW 3 interrupt to core. use INT3_
7026 + IPEND4 = 2, // HW 4 interrupt to core. use INT4_
7027 + IPEND5 = 3, // HW 5 interrupt to core. use INT5_
7028 + IPEND6 = 4, // HW 6 interrupt to core. use INT6_
7030 + IPEND_count, // must be last (used in loops)
7031 + IPEND_min = IPEND2 // min IPEND (used in loops)
7034 +typedef struct INTC_s
7036 + struct INT_s i [IPEND_count] ;// use i[IPEND?] = INT?_
7037 + u32 nmips ; // use NMIPS_
7038 +} volatile *INT_t ;
7042 + INT2_timer0_b = 0,
7043 + INT2_timer0_m = 0x00000001,
7044 + INT2_timer1_b = 1,
7045 + INT2_timer1_m = 0x00000002,
7046 + INT2_timer2_b = 2,
7047 + INT2_timer2_m = 0x00000004,
7048 + INT2_refresh_b = 3,
7049 + INT2_refresh_m = 0x00000008,
7050 + INT2_watchdogTimeout_b = 4,
7051 + INT2_watchdogTimeout_m = 0x00000010,
7052 + INT2_undecodedCpuWrite_b = 5,
7053 + INT2_undecodedCpuWrite_m = 0x00000020,
7054 + INT2_undecodedCpuRead_b = 6,
7055 + INT2_undecodedCpuRead_m = 0x00000040,
7056 + INT2_undecodedPciWrite_b = 7,
7057 + INT2_undecodedPciWrite_m = 0x00000080,
7058 + INT2_undecodedPciRead_b = 8,
7059 + INT2_undecodedPciRead_m = 0x00000100,
7060 + INT2_undecodedDmaWrite_b = 9,
7061 + INT2_undecodedDmaWrite_m = 0x00000200,
7062 + INT2_undecodedDmaRead_b = 10,
7063 + INT2_undecodedDmaRead_m = 0x00000400,
7064 + INT2_ipBusSlaveAckError_b = 11,
7065 + INT2_ipBusSlaveAckError_m = 0x00000800,
7067 + INT3_dmaChannel0_b = 0,
7068 + INT3_dmaChannel0_m = 0x00000001,
7069 + INT3_dmaChannel1_b = 1,
7070 + INT3_dmaChannel1_m = 0x00000002,
7071 + INT3_dmaChannel2_b = 2,
7072 + INT3_dmaChannel2_m = 0x00000004,
7073 + INT3_dmaChannel3_b = 3,
7074 + INT3_dmaChannel3_m = 0x00000008,
7075 + INT3_dmaChannel4_b = 4,
7076 + INT3_dmaChannel4_m = 0x00000010,
7077 + INT3_dmaChannel5_b = 5,
7078 + INT3_dmaChannel5_m = 0x00000020,
7080 + INT5_uartGeneral0_b = 0,
7081 + INT5_uartGeneral0_m = 0x00000001,
7082 + INT5_uartTxrdy0_b = 1,
7083 + INT5_uartTxrdy0_m = 0x00000002,
7084 + INT5_uartRxrdy0_b = 2,
7085 + INT5_uartRxrdy0_m = 0x00000004,
7087 + INT5_pci_m = 0x00000008,
7088 + INT5_pciDecoupled_b = 4,
7089 + INT5_pciDecoupled_m = 0x00000010,
7091 + INT5_spi_m = 0x00000020,
7092 + INT5_deviceDecoupled_b = 6,
7093 + INT5_deviceDecoupled_m = 0x00000040,
7094 + INT5_eth0Ovr_b = 9,
7095 + INT5_eth0Ovr_m = 0x00000200,
7096 + INT5_eth0Und_b = 10,
7097 + INT5_eth0Und_m = 0x00000400,
7098 + INT5_eth0Pfd_b = 11,
7099 + INT5_eth0Pfd_m = 0x00000800,
7100 + INT5_nvram_b = 12,
7101 + INT5_nvram_m = 0x00001000,
7104 + INT6_gpio0_m = 0x00000001,
7106 + INT6_gpio1_m = 0x00000002,
7108 + INT6_gpio2_m = 0x00000004,
7110 + INT6_gpio3_m = 0x00000008,
7112 + INT6_gpio4_m = 0x00000010,
7114 + INT6_gpio5_m = 0x00000020,
7116 + INT6_gpio6_m = 0x00000040,
7118 + INT6_gpio7_m = 0x00000080,
7120 + INT6_gpio8_m = 0x00000100,
7122 + INT6_gpio9_m = 0x00000200,
7123 + INT6_gpio10_b = 10,
7124 + INT6_gpio10_m = 0x00000400,
7125 + INT6_gpio11_b = 11,
7126 + INT6_gpio11_m = 0x00000800,
7127 + INT6_gpio12_b = 12,
7128 + INT6_gpio12_m = 0x00001000,
7129 + INT6_gpio13_b = 13,
7130 + INT6_gpio13_m = 0x00002000,
7133 + NMIPS_gpio_m = 0x00000001,
7136 +#endif // __IDT_INT_H__
7139 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h
7140 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h 1970-01-01 01:00:00.000000000 +0100
7141 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h 2006-01-10 00:32:33.000000000 +0100
7143 +/**************************************************************************
7145 + * BRIEF MODULE DESCRIPTION
7146 + * IP Arbiter register definitions
7148 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7150 + * This program is free software; you can redistribute it and/or modify it
7151 + * under the terms of the GNU General Public License as published by the
7152 + * Free Software Foundation; either version 2 of the License, or (at your
7153 + * option) any later version.
7155 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7156 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7157 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7158 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7159 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7160 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7161 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7162 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7163 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7164 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7166 + * You should have received a copy of the GNU General Public License along
7167 + * with this program; if not, write to the Free Software Foundation, Inc.,
7168 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7171 + **************************************************************************
7172 + * May 2004 rkt,neb
7178 + **************************************************************************
7181 +#ifndef __IDT_IPARB_H__
7182 +#define __IDT_IPARB_H__
7186 + IPARB0_PhysicalAddress = 0x18048000,
7187 + IPARB_PhysicalAddress = IPARB0_PhysicalAddress, // Default
7189 + IPARB0_VirtualAddress = 0xB8048000,
7190 + IPARB_VirtualAddress = IPARB0_VirtualAddress, // Default
7195 + IPABMXC_ethernet0Receive = 0,
7196 + IPABMXC_ethernet0Transmit = 1,
7197 + IPABMXC_memoryToHoldFifo = 2,
7198 + IPABMXC_holdFifoToMemory = 3,
7199 + IPABMXC_pciToMemory = 4,
7200 + IPABMXC_memoryToPci = 5,
7201 + IPABMXC_pciTarget = 6,
7202 + IPABMXC_pciTargetStart = 7,
7203 + IPABMXC_cpuToIpBus = 8,
7205 + IPABMXC_Count, // Must be last in list !
7206 + IPABMXC_Min = IPABMXC_ethernet0Receive,
7208 + IPAPXC_PriorityCount = 4, // 3-highest, 0-lowest.
7213 + u32 ipapc [IPAPXC_PriorityCount] ; // ipapc[IPAPXC_] = IPAPC_
7214 + u32 ipabmc [IPABMXC_Count] ; // ipabmc[IPABMXC_] = IPABMC_
7215 + u32 ipac ; // use IPAC_
7216 + u32 ipaitcc; // use IPAITCC_
7218 +} volatile * IPARB_t ;
7223 + IPAC_dp_m = 0x00000001,
7225 + IPAC_dep_m = 0x00000002,
7227 + IPAC_drm_m = 0x00000004,
7229 + IPAC_dwm_m = 0x00000008,
7231 + IPAC_msk_m = 0x00000010,
7234 + IPAPC_ptc_m = 0x00003fff,
7236 + IPAPC_mf_m = 0x00004000,
7237 + IPAPC_cptc_b = 16,
7238 + IPAPC_cptc_m = 0x3fff0000,
7241 + IPAITCC_itcc, = 0x000001ff,
7244 + IPABMC_mtc_m = 0x00000fff,
7246 + IPABMC_p_m = 0x00003000,
7247 + IPABMC_msk_b = 14,
7248 + IPABMC_msk_m = 0x00004000,
7249 + IPABMC_cmtc_b = 16,
7250 + IPABMC_cmtc_m = 0x0fff0000,
7253 +#endif // __IDT_IPARB_H__
7254 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_pci.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_pci.h
7255 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_pci.h 1970-01-01 01:00:00.000000000 +0100
7256 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_pci.h 2006-01-10 00:32:33.000000000 +0100
7258 +/**************************************************************************
7260 + * BRIEF MODULE DESCRIPTION
7261 + * PCI register definitio
7263 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7265 + * This program is free software; you can redistribute it and/or modify it
7266 + * under the terms of the GNU General Public License as published by the
7267 + * Free Software Foundation; either version 2 of the License, or (at your
7268 + * option) any later version.
7270 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7271 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7272 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7273 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7274 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7275 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7276 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7277 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7278 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7279 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7281 + * You should have received a copy of the GNU General Public License along
7282 + * with this program; if not, write to the Free Software Foundation, Inc.,
7283 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7286 + **************************************************************************
7287 + * May 2004 rkt, neb.
7293 + **************************************************************************
7296 +#ifndef __IDT_PCI_H__
7297 +#define __IDT_PCI_H__
7301 + PCI0_PhysicalAddress = 0x18080000,
7302 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
7304 + PCI0_VirtualAddress = 0xB8080000,
7305 + PCI_VirtualAddress = PCI0_VirtualAddress,
7310 + PCI_LbaCount = 4, // Local base addresses.
7315 + u32 a ; // Address.
7316 + u32 c ; // Control.
7317 + u32 m ; // mapping.
7327 + PCI_Map_s pcilba [PCI_LbaCount] ;
7335 +} volatile *PCI_t ;
7337 +// PCI messaging unit.
7344 + u32 pciim [PCIM_Count] ;
7345 + u32 pciom [PCIM_Count] ;
7352 +} volatile *PCIM_t ;
7354 +/*******************************************************************************
7356 + * PCI Control Register
7358 + ******************************************************************************/
7362 + PCIC_en_m = 0x00000001,
7364 + PCIC_tnr_m = 0x00000002,
7366 + PCIC_sce_m = 0x00000004,
7368 + PCIC_ien_m = 0x00000008,
7370 + PCIC_aaa_m = 0x00000010,
7372 + PCIC_eap_m = 0x00000020,
7374 + PCIC_pcim_m = 0x000001c0,
7375 + PCIC_pcim_disabled_v = 0,
7376 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
7377 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
7378 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
7379 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
7380 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
7381 + PCIC_pcim_reserved6_v = 6,
7382 + PCIC_pcim_reserved7_v = 7,
7384 + PCIC_igm_m = 0x00000200,
7387 +/*******************************************************************************
7389 + * PCI Status Register
7391 + ******************************************************************************/
7394 + PCIS_eed_m = 0x00000001,
7396 + PCIS_wr_m = 0x00000002,
7398 + PCIS_nmi_m = 0x00000004,
7400 + PCIS_ii_m = 0x00000008,
7402 + PCIS_cwe_m = 0x00000010,
7404 + PCIS_cre_m = 0x00000020,
7406 + PCIS_mdpe_m = 0x00000040,
7408 + PCIS_sta_m = 0x00000080,
7410 + PCIS_rta_m = 0x00000100,
7412 + PCIS_rma_m = 0x00000200,
7414 + PCIS_sse_m = 0x00000400,
7416 + PCIS_ose_m = 0x00000800,
7418 + PCIS_pe_m = 0x00001000,
7420 + PCIS_tae_m = 0x00002000,
7422 + PCIS_rle_m = 0x00004000,
7424 + PCIS_bme_m = 0x00008000,
7426 + PCIS_prd_m = 0x00010000,
7428 + PCIS_rip_m = 0x00020000,
7431 +/*******************************************************************************
7433 + * PCI Status Mask Register
7435 + ******************************************************************************/
7438 + PCISM_eed_m = 0x00000001,
7440 + PCISM_wr_m = 0x00000002,
7442 + PCISM_nmi_m = 0x00000004,
7444 + PCISM_ii_m = 0x00000008,
7446 + PCISM_cwe_m = 0x00000010,
7448 + PCISM_cre_m = 0x00000020,
7450 + PCISM_mdpe_m = 0x00000040,
7452 + PCISM_sta_m = 0x00000080,
7454 + PCISM_rta_m = 0x00000100,
7456 + PCISM_rma_m = 0x00000200,
7458 + PCISM_sse_m = 0x00000400,
7460 + PCISM_ose_m = 0x00000800,
7462 + PCISM_pe_m = 0x00001000,
7464 + PCISM_tae_m = 0x00002000,
7466 + PCISM_rle_m = 0x00004000,
7468 + PCISM_bme_m = 0x00008000,
7470 + PCISM_prd_m = 0x00010000,
7472 + PCISM_rip_m = 0x00020000,
7475 +/*******************************************************************************
7477 + * PCI Configuration Address Register
7479 + ******************************************************************************/
7481 + PCICFGA_reg_b = 2,
7482 + PCICFGA_reg_m = 0x000000fc,
7483 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
7484 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
7485 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
7486 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
7487 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
7488 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
7489 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
7490 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
7491 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
7492 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
7493 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
7494 + PCICFGA_reg_pba0m_v = 0x48>>2,
7495 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
7496 + PCICFGA_reg_pba1m_v = 0x50>>2,
7497 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
7498 + PCICFGA_reg_pba2m_v = 0x58>>2,
7499 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
7500 + PCICFGA_reg_pba3m_v = 0x60>>2,
7501 + PCICFGA_reg_pmgt_v = 0x64>>2,
7502 + PCICFGA_func_b = 8,
7503 + PCICFGA_func_m = 0x00000700,
7504 + PCICFGA_dev_b = 11,
7505 + PCICFGA_dev_m = 0x0000f800,
7506 + PCICFGA_dev_internal_v = 0,
7507 + PCICFGA_bus_b = 16,
7508 + PCICFGA_bus_m = 0x00ff0000,
7509 + PCICFGA_bus_type0_v = 0, //local bus
7510 + PCICFGA_en_b = 31, // read only
7511 + PCICFGA_en_m = 0x80000000,
7515 + PCFGID_vendor_b = 0,
7516 + PCFGID_vendor_m = 0x0000ffff,
7517 + PCFGID_vendor_IDT_v = 0x111d,
7518 + PCFGID_device_b = 16,
7519 + PCFGID_device_m = 0xffff0000,
7520 + PCFGID_device_Korinade_v = 0x0214,
7522 + PCFG04_command_ioena_b = 1,
7523 + PCFG04_command_ioena_m = 0x00000001,
7524 + PCFG04_command_memena_b = 2,
7525 + PCFG04_command_memena_m = 0x00000002,
7526 + PCFG04_command_bmena_b = 3,
7527 + PCFG04_command_bmena_m = 0x00000004,
7528 + PCFG04_command_mwinv_b = 5,
7529 + PCFG04_command_mwinv_m = 0x00000010,
7530 + PCFG04_command_parena_b = 7,
7531 + PCFG04_command_parena_m = 0x00000040,
7532 + PCFG04_command_serrena_b = 9,
7533 + PCFG04_command_serrena_m = 0x00000100,
7534 + PCFG04_command_fastbbena_b = 10,
7535 + PCFG04_command_fastbbena_m = 0x00000200,
7536 + PCFG04_status_b = 16,
7537 + PCFG04_status_m = 0xffff0000,
7538 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
7539 + PCFG04_status_66MHz_m = 0x00200000,
7540 + PCFG04_status_fbb_b = 23,
7541 + PCFG04_status_fbb_m = 0x00800000,
7542 + PCFG04_status_mdpe_b = 24,
7543 + PCFG04_status_mdpe_m = 0x01000000,
7544 + PCFG04_status_dst_b = 25,
7545 + PCFG04_status_dst_m = 0x06000000,
7546 + PCFG04_status_sta_b = 27,
7547 + PCFG04_status_sta_m = 0x08000000,
7548 + PCFG04_status_rta_b = 28,
7549 + PCFG04_status_rta_m = 0x10000000,
7550 + PCFG04_status_rma_b = 29,
7551 + PCFG04_status_rma_m = 0x20000000,
7552 + PCFG04_status_sse_b = 30,
7553 + PCFG04_status_sse_m = 0x40000000,
7554 + PCFG04_status_pe_b = 31,
7555 + PCFG04_status_pe_m = 0x40000000,
7557 + PCFG08_revId_b = 0,
7558 + PCFG08_revId_m = 0x000000ff,
7559 + PCFG08_classCode_b = 0,
7560 + PCFG08_classCode_m = 0xffffff00,
7561 + PCFG08_classCode_bridge_v = 06,
7562 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
7563 + PCFG0C_cacheline_b = 0,
7564 + PCFG0C_cacheline_m = 0x000000ff,
7565 + PCFG0C_masterLatency_b = 8,
7566 + PCFG0C_masterLatency_m = 0x0000ff00,
7567 + PCFG0C_headerType_b = 16,
7568 + PCFG0C_headerType_m = 0x00ff0000,
7569 + PCFG0C_bist_b = 24,
7570 + PCFG0C_bist_m = 0xff000000,
7573 + PCIPBA_msi_m = 0x00000001,
7575 + PCIPBA_p_m = 0x00000004,
7576 + PCIPBA_baddr_b = 8,
7577 + PCIPBA_baddr_m = 0xffffff00,
7579 + PCFGSS_vendorId_b = 0,
7580 + PCFGSS_vendorId_m = 0x0000ffff,
7582 + PCFGSS_id_m = 0xffff0000,
7584 + PCFG3C_interruptLine_b = 0,
7585 + PCFG3C_interruptLine_m = 0x000000ff,
7586 + PCFG3C_interruptPin_b = 8,
7587 + PCFG3C_interruptPin_m = 0x0000ff00,
7588 + PCFG3C_minGrant_b = 16,
7589 + PCFG3C_minGrant_m = 0x00ff0000,
7590 + PCFG3C_maxLat_b = 24,
7591 + PCFG3C_maxLat_m = 0xff000000,
7593 + PCIPBAC_msi_b = 0,
7594 + PCIPBAC_msi_m = 0x00000001,
7596 + PCIPBAC_p_m = 0x00000002,
7597 + PCIPBAC_size_b = 2,
7598 + PCIPBAC_size_m = 0x0000007c,
7600 + PCIPBAC_sb_m = 0x00000080,
7602 + PCIPBAC_pp_m = 0x00000100,
7604 + PCIPBAC_mr_m = 0x00000600,
7605 + PCIPBAC_mr_read_v =0, //no prefetching
7606 + PCIPBAC_mr_readLine_v =1,
7607 + PCIPBAC_mr_readMult_v =2,
7608 + PCIPBAC_mrl_b = 11,
7609 + PCIPBAC_mrl_m = 0x00000800,
7610 + PCIPBAC_mrm_b = 12,
7611 + PCIPBAC_mrm_m = 0x00001000,
7612 + PCIPBAC_trp_b = 13,
7613 + PCIPBAC_trp_m = 0x00002000,
7615 + PCFG40_trdyTimeout_b = 0,
7616 + PCFG40_trdyTimeout_m = 0x000000ff,
7617 + PCFG40_retryLim_b = 8,
7618 + PCFG40_retryLim_m = 0x0000ff00,
7621 +/*******************************************************************************
7623 + * PCI Local Base Address [0|1|2|3] Register
7625 + ******************************************************************************/
7627 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
7628 + PCILBA_baddr_m = 0xffffff00,
7630 +/*******************************************************************************
7632 + * PCI Local Base Address Control Register
7634 + ******************************************************************************/
7636 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
7637 + PCILBAC_msi_m = 0x00000001,
7638 + PCILBAC_msi_mem_v = 0,
7639 + PCILBAC_msi_io_v = 1,
7640 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
7641 + PCILBAC_size_m = 0x0000007c,
7642 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
7643 + PCILBAC_sb_m = 0x00000080,
7644 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
7645 + PCILBAC_rt_m = 0x00000100,
7646 + PCILBAC_rt_noprefetch_v = 0, // mem read
7647 + PCILBAC_rt_prefetch_v = 1, // mem readline
7650 +/*******************************************************************************
7652 + * PCI Local Base Address [0|1|2|3] Mapping Register
7654 + ******************************************************************************/
7656 + PCILBAM_maddr_b = 8,
7657 + PCILBAM_maddr_m = 0xffffff00,
7660 +/*******************************************************************************
7662 + * PCI Decoupled Access Control Register
7664 + ******************************************************************************/
7667 + PCIDAC_den_m = 0x00000001,
7670 +/*******************************************************************************
7672 + * PCI Decoupled Access Status Register
7674 + ******************************************************************************/
7677 + PCIDAS_d_m = 0x00000001,
7679 + PCIDAS_b_m = 0x00000002,
7681 + PCIDAS_e_m = 0x00000004,
7683 + PCIDAS_ofe_m = 0x00000008,
7685 + PCIDAS_off_m = 0x00000010,
7687 + PCIDAS_ife_m = 0x00000020,
7689 + PCIDAS_iff_m = 0x00000040,
7692 +/*******************************************************************************
7694 + * PCI DMA Channel 8 Configuration Register
7696 + ******************************************************************************/
7699 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
7700 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
7701 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
7702 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
7705 +/*******************************************************************************
7707 + * PCI DMA Channel 9 Configuration Register
7709 + ******************************************************************************/
7712 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
7713 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
7716 +/*******************************************************************************
7718 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
7720 + ******************************************************************************/
7722 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
7723 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
7724 + // These are for reads (DMA channel 8)
7725 + PCIDMAD_devcmd_mr_v = 0, //memory read
7726 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
7727 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
7728 + PCIDMAD_devcmd_ior_v = 3, //I/O read
7729 + // These are for writes (DMA channel 9)
7730 + PCIDMAD_devcmd_mw_v = 0, //memory write
7731 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
7732 + PCIDMAD_devcmd_iow_v = 3, //I/O write
7734 + // Swap byte field applies to both DMA channel 8 and 9
7735 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
7736 + PCIDMAD_sb_m = 0x01000000, // swap byte field
7740 +/*******************************************************************************
7742 + * PCI Target Control Register
7744 + ******************************************************************************/
7747 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
7748 + PCITC_rtimer_m = 0x000000ff,
7749 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
7750 + PCITC_dtimer_m = 0x0000ff00,
7751 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
7752 + PCITC_rdr_m = 0x00040000,
7753 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
7754 + PCITC_ddt_m = 0x00080000,
7756 +/*******************************************************************************
7758 + * PCI messaging unit [applies to both inbound and outbound registers ]
7760 + ******************************************************************************/
7763 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7764 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
7765 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7766 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
7767 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7768 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
7776 +#define PCI_MSG_VirtualAddress 0xB8088010
7777 +#define rc32434_pci ((volatile PCI_t) PCI0_VirtualAddress)
7778 +#define rc32434_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
7780 +#define PCIM_SHFT 0x6
7781 +#define PCIM_BIT_LEN 0x7
7782 +#define PCIM_H_EA 0x3
7783 +#define PCIM_H_IA_FIX 0x4
7784 +#define PCIM_H_IA_RR 0x5
7786 +#define PCI_ADDR_START 0x13000000
7789 +#define PCI_ADDR_START 0x50000000
7791 +#define CPUTOPCI_MEM_WIN 0x02000000
7792 +#define CPUTOPCI_IO_WIN 0x00100000
7793 +#define PCILBA_SIZE_SHFT 2
7794 +#define PCILBA_SIZE_MASK 0x1F
7795 +#define SIZE_256MB 0x1C
7796 +#define SIZE_128MB 0x1B
7797 +#define SIZE_64MB 0x1A
7798 +#define SIZE_32MB 0x19
7799 +#define SIZE_16MB 0x18
7800 +#define SIZE_4MB 0x16
7801 +#define SIZE_2MB 0x15
7802 +#define SIZE_1MB 0x14
7803 +#define KORINA_CONFIG0_ADDR 0x80000000
7804 +#define KORINA_CONFIG1_ADDR 0x80000004
7805 +#define KORINA_CONFIG2_ADDR 0x80000008
7806 +#define KORINA_CONFIG3_ADDR 0x8000000C
7807 +#define KORINA_CONFIG4_ADDR 0x80000010
7808 +#define KORINA_CONFIG5_ADDR 0x80000014
7809 +#define KORINA_CONFIG6_ADDR 0x80000018
7810 +#define KORINA_CONFIG7_ADDR 0x8000001C
7811 +#define KORINA_CONFIG8_ADDR 0x80000020
7812 +#define KORINA_CONFIG9_ADDR 0x80000024
7813 +#define KORINA_CONFIG10_ADDR 0x80000028
7814 +#define KORINA_CONFIG11_ADDR 0x8000002C
7815 +#define KORINA_CONFIG12_ADDR 0x80000030
7816 +#define KORINA_CONFIG13_ADDR 0x80000034
7817 +#define KORINA_CONFIG14_ADDR 0x80000038
7818 +#define KORINA_CONFIG15_ADDR 0x8000003C
7819 +#define KORINA_CONFIG16_ADDR 0x80000040
7820 +#define KORINA_CONFIG17_ADDR 0x80000044
7821 +#define KORINA_CONFIG18_ADDR 0x80000048
7822 +#define KORINA_CONFIG19_ADDR 0x8000004C
7823 +#define KORINA_CONFIG20_ADDR 0x80000050
7824 +#define KORINA_CONFIG21_ADDR 0x80000054
7825 +#define KORINA_CONFIG22_ADDR 0x80000058
7826 +#define KORINA_CONFIG23_ADDR 0x8000005C
7827 +#define KORINA_CONFIG24_ADDR 0x80000060
7828 +#define KORINA_CONFIG25_ADDR 0x80000064
7829 +#define KORINA_CMD (PCFG04_command_ioena_m | \
7830 + PCFG04_command_memena_m | \
7831 + PCFG04_command_bmena_m | \
7832 + PCFG04_command_mwinv_m | \
7833 + PCFG04_command_parena_m | \
7834 + PCFG04_command_serrena_m )
7836 +#define KORINA_STAT (PCFG04_status_mdpe_m | \
7837 + PCFG04_status_sta_m | \
7838 + PCFG04_status_rta_m | \
7839 + PCFG04_status_rma_m | \
7840 + PCFG04_status_sse_m | \
7841 + PCFG04_status_pe_m)
7843 +#define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
7845 +#define KORINA_REVID 0
7846 +#define KORINA_CLASS_CODE 0
7847 +#define KORINA_CNFG2 ((KORINA_CLASS_CODE<<8) | \
7850 +#define KORINA_CACHE_LINE_SIZE 4
7851 +#define KORINA_MASTER_LAT 0x3c
7852 +#define KORINA_HEADER_TYPE 0
7853 +#define KORINA_BIST 0
7855 +#define KORINA_CNFG3 ((KORINA_BIST << 24) | \
7856 + (KORINA_HEADER_TYPE<<16) | \
7857 + (KORINA_MASTER_LAT<<8) | \
7858 + KORINA_CACHE_LINE_SIZE )
7860 +#define KORINA_BAR0 0x00000008 /* 128 MB Memory */
7861 +#define KORINA_BAR1 0x18800001 /* 1 MB IO */
7862 +#define KORINA_BAR2 0x18000001 /* 2 MB IO window for Korina
7863 + internal Registers */
7864 +#define KORINA_BAR3 0x48000008 /* Spare 128 MB Memory */
7866 +#define KORINA_CNFG4 KORINA_BAR0
7867 +#define KORINA_CNFG5 KORINA_BAR1
7868 +#define KORINA_CNFG6 KORINA_BAR2
7869 +#define KORINA_CNFG7 KORINA_BAR3
7871 +#define KORINA_SUBSYS_VENDOR_ID 0x011d
7872 +#define KORINA_SUBSYSTEM_ID 0x0214
7873 +#define KORINA_CNFG8 0
7874 +#define KORINA_CNFG9 0
7875 +#define KORINA_CNFG10 0
7876 +#define KORINA_CNFG11 ((KORINA_SUBSYS_VENDOR_ID<<16) | \
7877 + KORINA_SUBSYSTEM_ID)
7878 +#define KORINA_INT_LINE 1
7879 +#define KORINA_INT_PIN 1
7880 +#define KORINA_MIN_GNT 8
7881 +#define KORINA_MAX_LAT 0x38
7882 +#define KORINA_CNFG12 0
7883 +#define KORINA_CNFG13 0
7884 +#define KORINA_CNFG14 0
7885 +#define KORINA_CNFG15 ((KORINA_MAX_LAT<<24) | \
7886 + (KORINA_MIN_GNT<<16) | \
7887 + (KORINA_INT_PIN<<8) | \
7889 +#define KORINA_RETRY_LIMIT 0x80
7890 +#define KORINA_TRDY_LIMIT 0x80
7891 +#define KORINA_CNFG16 ((KORINA_RETRY_LIMIT<<8) | \
7892 + KORINA_TRDY_LIMIT)
7893 +#define PCI_PBAxC_R 0x0
7894 +#define PCI_PBAxC_RL 0x1
7895 +#define PCI_PBAxC_RM 0x2
7896 +#define SIZE_SHFT 2
7898 +#if defined(__MIPSEB__)
7899 +#define KORINA_PBA0C ( PCIPBAC_mrl_m | PCIPBAC_sb_m | \
7900 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
7902 + (SIZE_128MB<<SIZE_SHFT) | \
7905 +#define KORINA_PBA0C ( PCIPBAC_mrl_m | \
7906 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
7908 + (SIZE_128MB<<SIZE_SHFT) | \
7911 +#define KORINA_CNFG17 KORINA_PBA0C
7912 +#define KORINA_PBA0M 0x0
7913 +#define KORINA_CNFG18 KORINA_PBA0M
7915 +#if defined(__MIPSEB__)
7916 +#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
7919 +#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | \
7922 +#define KORINA_CNFG19 KORINA_PBA1C
7923 +#define KORINA_PBA1M 0x0
7924 +#define KORINA_CNFG20 KORINA_PBA1M
7926 +#if defined(__MIPSEB__)
7927 +#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
7930 +#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | \
7933 +#define KORINA_CNFG21 KORINA_PBA2C
7934 +#define KORINA_PBA2M 0x18000000
7935 +#define KORINA_CNFG22 KORINA_PBA2M
7936 +#define KORINA_PBA3C 0
7937 +#define KORINA_CNFG23 KORINA_PBA3C
7938 +#define KORINA_PBA3M 0
7939 +#define KORINA_CNFG24 KORINA_PBA3M
7943 +#define PCITC_DTIMER_VAL 8
7944 +#define PCITC_RTIMER_VAL 0x10
7949 +#endif // __IDT_PCI_H__
7953 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_rst.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_rst.h
7954 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_rst.h 1970-01-01 01:00:00.000000000 +0100
7955 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_rst.h 2006-01-10 00:32:33.000000000 +0100
7957 +/**************************************************************************
7959 + * BRIEF MODULE DESCRIPTION
7960 + * Reset register definitions.
7962 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7964 + * This program is free software; you can redistribute it and/or modify it
7965 + * under the terms of the GNU General Public License as published by the
7966 + * Free Software Foundation; either version 2 of the License, or (at your
7967 + * option) any later version.
7969 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7970 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7971 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7972 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7973 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7974 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7975 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7976 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7977 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7978 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7980 + * You should have received a copy of the GNU General Public License along
7981 + * with this program; if not, write to the Free Software Foundation, Inc.,
7982 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7985 + **************************************************************************
7986 + * May 2004 rkt, neb.
7992 + **************************************************************************
7995 +#ifndef __IDT_RST_H__
7996 +#define __IDT_RST_H__
8000 + RST0_PhysicalAddress = 0x18000000,
8001 + RST_PhysicalAddress = RST0_PhysicalAddress, // Default
8003 + RST0_VirtualAddress = 0xb8000000,
8004 + RST_VirtualAddress = RST0_VirtualAddress, // Default
8007 +typedef struct RST_s
8009 + u32 filler [0x0006] ;
8011 + u32 filler2 [0x2000-8] ; // Pad out to offset 0x8000
8015 +} volatile * RST_t ;
8020 + SYSID_rev_m = 0x000000ff,
8022 + SYSID_imp_m = 0x000fff00,
8023 + SYSID_vendor_b = 8,
8024 + SYSID_vendor_m = 0xfff00000,
8027 + BCV_pll_m = 0x0000000f,
8028 + BCV_pll_PLLBypass_v = 0x0, // PCLK=1*CLK.
8029 + BCV_pll_Mul3_v = 0x1, // PCLK=3*CLK.
8030 + BCV_pll_Mul4_v = 0x2, // PCLK=4*CLK.
8031 + BCV_pll_SlowMul5_v = 0x3, // PCLK=5*CLK.
8032 + BCV_pll_Mul5_v = 0x4, // PCLK=5*CLK.
8033 + BCV_pll_SlowMul6_v = 0x5, // PCLK=6*CLK.
8034 + BCV_pll_Mul6_v = 0x6, // PCLK=6*CLK.
8035 + BCV_pll_Mul8_v = 0x7, // PCLK=8*CLK.
8036 + BCV_pll_Mul10_v = 0x8, // PCLK=10*CLK.
8037 + BCV_pll_Res9_v = 0x9,
8038 + BCV_pll_Res10_v = 0xa,
8039 + BCV_pll_Res11_v = 0xb,
8040 + BCV_pll_Res12_v = 0xc,
8041 + BCV_pll_Res13_v = 0xd,
8042 + BCV_pll_Res14_v = 0xe,
8043 + BCV_pll_Res15_v = 0xf,
8045 + BCV_clkDiv_m = 0x00000030,
8046 + BCV_clkDiv_Div1_v = 0x0,
8047 + BCV_clkDiv_Div2_v = 0x1,
8048 + BCV_clkDiv_Div4_v = 0x2,
8049 + BCV_clkDiv_Res3_v = 0x3,
8050 + BCV_bigEndian_b = 6,
8051 + BCV_bigEndian_m = 0x00000040,
8052 + BCV_resetFast_b = 7,
8053 + BCV_resetFast_m = 0x00000080,
8054 + BCV_pciMode_b = 8,
8055 + BCV_pciMode_m = 0x00000700,
8056 + BCV_pciMode_disabled_v = 0, // PCI is disabled.
8057 + BCV_pciMode_tnr_v = 1, // satellite Target Not Ready.
8058 + BCV_pciMode_suspended_v = 2, // satellite with suspended CPU.
8059 + BCV_pciMode_external_v = 3, // host, external arbiter.
8060 + BCV_pciMode_fixed_v = 4, // host, fixed priority arbiter.
8061 + BCV_pciMode_roundRobin_v= 5, // host, round robin arbiter.
8062 + BCV_pciMode_res6_v = 6,
8063 + BCV_pciMode_res7_v = 7,
8064 + BCV_watchDisable_b = 11,
8065 + BCV_watchDisable_m = 0x00000800,
8067 + BCV_res12_m = 0x00001000,
8069 + BCV_res13_m = 0x00002000,
8071 + BCV_res14_m = 0x00004000,
8073 + BCV_res15_m = 0x00008000,
8075 +#endif // __IDT_RST_H__
8076 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_spi.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_spi.h
8077 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_spi.h 1970-01-01 01:00:00.000000000 +0100
8078 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_spi.h 2006-01-10 00:32:33.000000000 +0100
8080 +/**************************************************************************
8082 + * BRIEF MODULE DESCRIPTION
8083 + * Serial Peripheral Interface register definitions.
8085 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8087 + * This program is free software; you can redistribute it and/or modify it
8088 + * under the terms of the GNU General Public License as published by the
8089 + * Free Software Foundation; either version 2 of the License, or (at your
8090 + * option) any later version.
8092 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8093 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8094 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8095 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8096 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8097 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8098 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8099 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8100 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8101 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8103 + * You should have received a copy of the GNU General Public License along
8104 + * with this program; if not, write to the Free Software Foundation, Inc.,
8105 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8108 + **************************************************************************
8109 + * May 2004 rkt, neb.
8115 + **************************************************************************
8118 +#ifndef __IDT_SPI_H__
8119 +#define __IDT_SPI_H__
8123 + SPI0_PhysicalAddress = 0x18070000,
8124 + SPI_PhysicalAddress = SPI0_PhysicalAddress,
8126 + SPI0_VirtualAddress = 0xB8070000,
8127 + SPI_VirtualAddress = SPI0_VirtualAddress,
8132 + u32 spcp ; // prescalar. 0=off, * spiClk = sysClk/(2*(spcp+1)*SPR)
8133 + u32 spc ; // spi control reg use SPC_
8134 + u32 sps ; // spi status reg use SPS_
8135 + u32 spd ; // spi data reg use SPD_
8136 + u32 siofunc ; // serial IO function use SIOFUNC_
8137 + u32 siocfg ; // serial IO config use SIOCFG_
8138 + u32 siod; // serial IO data use SIOD_
8139 +} volatile *SPI_t ;
8144 + SPCP_div_m = 0x000000ff,
8146 + SPC_spr_m = 0x00000003,
8147 + SPC_spr_div2_v = 0,
8148 + SPC_spr_div4_v = 1,
8149 + SPC_spr_div16_v = 2,
8150 + SPC_spr_div32_v = 3,
8152 + SPC_cpha_m = 0x00000004,
8154 + SPC_cpol_m = 0x00000008,
8156 + SPC_mstr_m = 0x00000010,
8158 + SPC_spe_m = 0x00000040,
8160 + SPC_spie_m = 0x00000080,
8163 + SPS_modf_m = 0x00000010,
8165 + SPS_wcol_m = 0x00000040,
8167 + SPS_spif_m = 0x00000070,
8170 + SPD_data_m = 0x000000ff,
8172 + SIOFUNC_sdo_b = 0,
8173 + SIOFUNC_sdo_m = 0x00000001,
8174 + SIOFUNC_sdi_b = 1,
8175 + SIOFUNC_sdi_m = 0x00000002,
8176 + SIOFUNC_sck_b = 2,
8177 + SIOFUNC_sck_m = 0x00000004,
8178 + SIOFUNC_pci_b = 3,
8179 + SIOFUNC_pci_m = 0x00000008,
8182 + SIOCFG_sdo_m = 0x00000001,
8184 + SIOCFG_sdi_m = 0x00000002,
8186 + SIOCFG_sck_m = 0x00000004,
8188 + SIOCFG_pci_m = 0x00000008,
8191 + SIOD_sdo_m = 0x00000001,
8193 + SIOD_sdi_m = 0x00000002,
8195 + SIOD_sck_m = 0x00000004,
8197 + SIOD_pci_m = 0x00000008,
8199 +#endif // __IDT_SPI_H__
8200 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_timer.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_timer.h
8201 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_timer.h 1970-01-01 01:00:00.000000000 +0100
8202 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_timer.h 2006-01-10 00:32:33.000000000 +0100
8204 +/**************************************************************************
8206 + * BRIEF MODULE DESCRIPTION
8207 + * Definitions for timer registers
8209 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8211 + * This program is free software; you can redistribute it and/or modify it
8212 + * under the terms of the GNU General Public License as published by the
8213 + * Free Software Foundation; either version 2 of the License, or (at your
8214 + * option) any later version.
8216 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8217 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8218 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8219 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8220 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8221 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8222 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8223 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8224 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8225 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8227 + * You should have received a copy of the GNU General Public License along
8228 + * with this program; if not, write to the Free Software Foundation, Inc.,
8229 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8232 + **************************************************************************
8233 + * May 2004 rkt,neb.
8239 + **************************************************************************
8242 +#ifndef __IDT_TIM_H__
8243 +#define __IDT_TIM_H__
8247 + TIM0_PhysicalAddress = 0x18028000,
8248 + TIM_PhysicalAddress = TIM0_PhysicalAddress, // Default
8250 + TIM0_VirtualAddress = 0xb8028000,
8251 + TIM_VirtualAddress = TIM0_VirtualAddress, // Default
8263 + u32 ctc ; //use CTC_
8266 +typedef struct TIM_s
8268 + struct TIM_CNTR_s tim [TIM_Count] ;
8269 + u32 rcount ; //use RCOUNT_
8270 + u32 rcompare ; //use RCOMPARE_
8271 + u32 rtc ; //use RTC_
8272 +} volatile * TIM_t ;
8277 + CTC_en_m = 0x00000001,
8279 + CTC_to_m = 0x00000002,
8281 + RCOUNT_count_b = 0,
8282 + RCOUNT_count_m = 0x0000ffff,
8283 + RCOMPARE_compare_b = 0,
8284 + RCOMPARE_compare_m = 0x0000ffff,
8286 + RTC_ce_m = 0x00000001,
8288 + RTC_to_m = 0x00000002,
8290 + RTC_rqe_m = 0x00000004,
8293 +#endif // __IDT_TIM_H__
8295 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_uart.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_uart.h
8296 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_uart.h 1970-01-01 01:00:00.000000000 +0100
8297 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_uart.h 2006-01-10 00:32:33.000000000 +0100
8299 +/**************************************************************************
8301 + * BRIEF MODULE DESCRIPTION
8302 + * UART register definitions
8304 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8306 + * This program is free software; you can redistribute it and/or modify it
8307 + * under the terms of the GNU General Public License as published by the
8308 + * Free Software Foundation; either version 2 of the License, or (at your
8309 + * option) any later version.
8311 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8312 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8313 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8314 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8315 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8316 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8317 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8318 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8319 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8320 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8322 + * You should have received a copy of the GNU General Public License along
8323 + * with this program; if not, write to the Free Software Foundation, Inc.,
8324 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8327 + **************************************************************************
8328 + * May 2004 rkt, neb.
8334 + **************************************************************************
8337 +#ifndef __IDT_UART_H__
8338 +#define __IDT_UART_H__
8342 + UART0_PhysicalAddress = 0x1c000000,
8343 + UART_PhysicalAddress = UART0_PhysicalAddress, // Default
8345 + UART0_VirtualAddress = 0xbc000000,
8346 + UART_VirtualAddress = UART0_VirtualAddress, // Default
8350 + * Register definitions are in bytes so we can handle endian problems.
8353 +typedef struct UART_s
8357 + u32 const uartrb ; // 0x00 - DLAB=0, read.
8358 + u32 uartth ; // 0x00 - DLAB=0, write.
8359 + u32 uartdll ; // 0x00 - DLAB=1, read/write.
8364 + u32 uartie ; // 0x04 - DLAB=0, read/write.
8365 + u32 uartdlh ; // 0x04 - DLAB=1, read/write.
8369 + u32 const uartii ; // 0x08 - DLAB=0, read.
8370 + u32 uartfc ; // 0x08 - DLAB=0, write.
8373 + u32 uartlc ; // 0x0c
8374 + u32 uartmc ; // 0x10
8375 + u32 uartls ; // 0x14
8376 + u32 uartms ; // 0x18
8377 + u32 uarts ; // 0x1c
8378 +} volatile *UART_t ;
8380 +// Reset registers.
8381 +typedef u32 volatile *UARTRR_t ;
8386 + UARTIE_rda_m = 0x00000001,
8388 + UARTIE_the_m = 0x00000002,
8390 + UARTIE_rls_m = 0x00000004,
8392 + UARTIE_ems_m = 0x00000008,
8395 + UARTII_pi_m = 0x00000001,
8397 + UARTII_iid_m = 0x0000000e,
8398 + UARTII_iid_ms_v = 0, // Modem stat-CTS,DSR,RI or DCD.
8399 + UARTII_iid_thre_v = 1, // Trans. Holding Reg. empty.
8400 + UARTII_iid_rda_v = 2, // Receive data available
8401 + UARTII_iid_rls_v = 3, // Overrun, parity, etc, error.
8402 + UARTII_iid_res4_v = 4, // reserved.
8403 + UARTII_iid_res5_v = 5, // reserved.
8404 + UARTII_iid_cto_v = 6, // Character timeout.
8405 + UARTII_iid_res7_v = 7, // reserved.
8408 + UARTFC_en_m = 0x00000001,
8410 + UARTFC_rr_m = 0x00000002,
8412 + UARTFC_tr_m = 0x00000004,
8414 + UARTFC_dms_m = 0x00000008,
8416 + UARTFC_rt_m = 0x000000c0,
8417 + UARTFC_rt_1Byte_v = 0,
8418 + UARTFC_rt_4Byte_v = 1,
8419 + UARTFC_rt_8Byte_v = 2,
8420 + UARTFC_rt_14Byte_v = 3,
8423 + UARTLC_wls_m = 0x00000003,
8424 + UARTLC_wls_5Bits_v = 0,
8425 + UARTLC_wls_6Bits_v = 1,
8426 + UARTLC_wls_7Bits_v = 2,
8427 + UARTLC_wls_8Bits_v = 3,
8429 + UARTLC_stb_m = 0x00000004,
8431 + UARTLC_pen_m = 0x00000008,
8433 + UARTLC_eps_m = 0x00000010,
8435 + UARTLC_sp_m = 0x00000020,
8437 + UARTLC_sb_m = 0x00000040,
8438 + UARTLC_dlab_b = 7,
8439 + UARTLC_dlab_m = 0x00000080,
8442 + UARTMC_dtr_m = 0x00000001,
8444 + UARTMC_rts_m = 0x00000002,
8446 + UARTMC_o1_m = 0x00000004,
8448 + UARTMC_o2_m = 0x00000008,
8450 + UARTMC_lp_m = 0x00000010,
8453 + UARTLS_dr_m = 0x00000001,
8455 + UARTLS_oe_m = 0x00000002,
8457 + UARTLS_pe_m = 0x00000004,
8459 + UARTLS_fe_m = 0x00000008,
8461 + UARTLS_bi_m = 0x00000010,
8463 + UARTLS_thr_m = 0x00000020,
8465 + UARTLS_te_m = 0x00000040,
8467 + UARTLS_rfe_m = 0x00000080,
8469 + UARTMS_dcts_b = 0,
8470 + UARTMS_dcts_m = 0x00000001,
8471 + UARTMS_ddsr_b = 1,
8472 + UARTMS_ddsr_m = 0x00000002,
8473 + UARTMS_teri_b = 2,
8474 + UARTMS_teri_m = 0x00000004,
8475 + UARTMS_ddcd_b = 3,
8476 + UARTMS_ddcd_m = 0x00000008,
8478 + UARTMS_cts_m = 0x00000010,
8480 + UARTMS_dsr_m = 0x00000020,
8482 + UARTMS_ri_m = 0x00000040,
8484 + UARTMS_dcd_m = 0x00000080,
8487 +#endif // __IDT_UART_H__
8488 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_dma.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_dma.h
8489 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_dma.h 1970-01-01 01:00:00.000000000 +0100
8490 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_dma.h 2006-01-10 00:32:33.000000000 +0100
8492 +/**************************************************************************
8494 + * BRIEF MODULE DESCRIPTION
8495 + * Register definitions for IDT RC32438 DMA.
8497 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8499 + * This program is free software; you can redistribute it and/or modify it
8500 + * under the terms of the GNU General Public License as published by the
8501 + * Free Software Foundation; either version 2 of the License, or (at your
8502 + * option) any later version.
8504 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8505 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8506 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8507 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8508 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8509 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8510 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8511 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8512 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8513 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8515 + * You should have received a copy of the GNU General Public License along
8516 + * with this program; if not, write to the Free Software Foundation, Inc.,
8517 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8520 + **************************************************************************
8521 + * May 2004 P. Sadik.
8527 + **************************************************************************
8529 +#ifndef __IDT_RC32438_DMA_H__
8530 +#define __IDT_RC32438_DMA_H__
8533 + DMA0_PhysicalAddress = 0x18040000,
8534 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
8536 + DMA0_VirtualAddress = 0xb8040000,
8537 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
8541 + * DMA descriptor (in physical memory).
8544 +typedef struct DMAD_s
8546 + u32 control ; // Control. use DMAD_*
8547 + u32 ca ; // Current Address.
8548 + u32 devcs ; // Device control and status.
8549 + u32 link ; // Next descriptor in chain.
8550 +} volatile *DMAD_t ;
8554 + DMAD_size = sizeof (struct DMAD_s),
8555 + DMAD_count_b = 0, // in DMAD_t -> control
8556 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
8557 + DMAD_ds_b = 20, // in DMAD_t -> control
8558 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
8559 + DMAD_ds_extToMem0_v = 0,
8560 + DMAD_ds_memToExt0_v = 1,
8561 + DMAD_ds_extToMem1_v = 0,
8562 + DMAD_ds_memToExt1_v = 1,
8563 + DMAD_ds_ethRcv0_v = 0,
8564 + DMAD_ds_ethXmt0_v = 0,
8565 + DMAD_ds_ethRcv1_v = 0,
8566 + DMAD_ds_ethXmt2_v = 0,
8567 + DMAD_ds_memToFifo_v = 0,
8568 + DMAD_ds_fifoToMem_v = 0,
8569 + DMAD_ds_rng_de_v = 1,//randomNumberGenerator on LC/DE
8570 + DMAD_ds_pciToMem_v = 0,
8571 + DMAD_ds_memToPci_v = 0,
8572 + DMAD_ds_securityInput_v = 0,
8573 + DMAD_ds_securityOutput_v = 0,
8574 + DMAD_ds_rng_se_v = 0,//randomNumberGenerator on SE
8576 + DMAD_devcmd_b = 22, // in DMAD_t -> control
8577 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
8578 + DMAD_devcmd_byte_v = 0, //memory-to-memory
8579 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
8580 + DMAD_devcmd_word_v = 2, //memory-to-memory
8581 + DMAD_devcmd_2words_v = 3, //memory-to-memory
8582 + DMAD_devcmd_4words_v = 4, //memory-to-memory
8583 + DMAD_devcmd_6words_v = 5, //memory-to-memory
8584 + DMAD_devcmd_8words_v = 6, //memory-to-memory
8585 + DMAD_devcmd_16words_v = 7, //memory-to-memory
8586 + DMAD_cof_b = 25, // chain on finished
8587 + DMAD_cof_m = 0x02000000, //
8588 + DMAD_cod_b = 26, // chain on done
8589 + DMAD_cod_m = 0x04000000, //
8590 + DMAD_iof_b = 27, // interrupt on finished
8591 + DMAD_iof_m = 0x08000000, //
8592 + DMAD_iod_b = 28, // interrupt on done
8593 + DMAD_iod_m = 0x10000000, //
8594 + DMAD_t_b = 29, // terminated
8595 + DMAD_t_m = 0x20000000, //
8596 + DMAD_d_b = 30, // done
8597 + DMAD_d_m = 0x40000000, //
8598 + DMAD_f_b = 31, // finished
8599 + DMAD_f_m = 0x80000000, //
8603 + * DMA register (within Internal Register Map).
8608 + u32 dmac ; // Control.
8609 + u32 dmas ; // Status.
8610 + u32 dmasm ; // Mask.
8611 + u32 dmadptr ; // Descriptor pointer.
8612 + u32 dmandptr ; // Next descriptor pointer.
8615 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
8617 +//DMA_Channels use DMACH_count instead
8621 + DMAC_run_b = 0, //
8622 + DMAC_run_m = 0x00000001, //
8623 + DMAC_dm_b = 1, // done mask
8624 + DMAC_dm_m = 0x00000002, //
8625 + DMAC_mode_b = 2, //
8626 + DMAC_mode_m = 0x0000000c, //
8627 + DMAC_mode_auto_v = 0,
8628 + DMAC_mode_burst_v = 1,
8629 + DMAC_mode_transfer_v = 2, //usually used
8630 + DMAC_mode_reserved_v = 3,
8632 + DMAC_a_m = 0x00000010, //
8634 + DMAS_f_b = 0, // finished (sticky)
8635 + DMAS_f_m = 0x00000001, //
8636 + DMAS_d_b = 1, // done (sticky)
8637 + DMAS_d_m = 0x00000002, //
8638 + DMAS_c_b = 2, // chain (sticky)
8639 + DMAS_c_m = 0x00000004, //
8640 + DMAS_e_b = 3, // error (sticky)
8641 + DMAS_e_m = 0x00000008, //
8642 + DMAS_h_b = 4, // halt (sticky)
8643 + DMAS_h_m = 0x00000010, //
8645 + DMASM_f_b = 0, // finished (1=mask)
8646 + DMASM_f_m = 0x00000001, //
8647 + DMASM_d_b = 1, // done (1=mask)
8648 + DMASM_d_m = 0x00000002, //
8649 + DMASM_c_b = 2, // chain (1=mask)
8650 + DMASM_c_m = 0x00000004, //
8651 + DMASM_e_b = 3, // error (1=mask)
8652 + DMASM_e_m = 0x00000008, //
8653 + DMASM_h_b = 4, // halt (1=mask)
8654 + DMASM_h_m = 0x00000010, //
8658 + * DMA channel definitions
8663 + DMACH_extToMem0 = 0,
8664 + DMACH_memToExt0 = 0,
8665 + DMACH_extToMem1 = 1,
8666 + DMACH_memToExt1 = 1,
8667 + DMACH_ethRcv0 = 2,
8668 + DMACH_ethXmt0 = 3,
8669 + DMACH_ethRcv1 = 4,
8670 + DMACH_ethXmt2 = 5,
8671 + DMACH_memToFifo = 6,
8672 + DMACH_fifoToMem = 7,
8673 + DMACH_rng_de = 7,//randomNumberGenerator on LC/DE
8674 + DMACH_pciToMem = 8,
8675 + DMACH_memToPci = 9,
8676 + DMACH_securityInput = 10,
8677 + DMACH_securityOutput = 11,
8678 + DMACH_rng_se = 12, //randomNumberGenerator on SE
8680 + DMACH_count //must be last
8684 +typedef struct DMAC_s
8686 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
8687 +} volatile *DMA_t ;
8691 + * External DMA parameters
8696 + DMADEVCMD_ts_b = 0, // ts field in devcmd
8697 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
8698 + DMADEVCMD_ts_byte_v = 0,
8699 + DMADEVCMD_ts_halfword_v = 1,
8700 + DMADEVCMD_ts_word_v = 2,
8701 + DMADEVCMD_ts_2word_v = 3,
8702 + DMADEVCMD_ts_4word_v = 4,
8703 + DMADEVCMD_ts_6word_v = 5,
8704 + DMADEVCMD_ts_8word_v = 6,
8705 + DMADEVCMD_ts_16word_v = 7
8709 +#if 1 // aws - Compatibility.
8710 +# define EXTDMA_ts_b DMADEVCMD_ts_b
8711 +# define EXTDMA_ts_m DMADEVCMD_ts_m
8712 +# define EXTDMA_ts_byte_v DMADEVCMD_ts_byte_v
8713 +# define EXTDMA_ts_halfword_v DMADEVCMD_ts_halfword_v
8714 +# define EXTDMA_ts_word_v DMADEVCMD_ts_word_v
8715 +# define EXTDMA_ts_2word_v DMADEVCMD_ts_2word_v
8716 +# define EXTDMA_ts_4word_v DMADEVCMD_ts_4word_v
8717 +# define EXTDMA_ts_6word_v DMADEVCMD_ts_6word_v
8718 +# define EXTDMA_ts_8word_v DMADEVCMD_ts_8word_v
8719 +# define EXTDMA_ts_16word_v DMADEVCMD_ts_16word_v
8720 +#endif // aws - Compatibility.
8722 +#endif //__IDT_RC32438_DMA_H__
8723 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h
8724 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h 1970-01-01 01:00:00.000000000 +0100
8725 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h 2006-01-10 00:32:33.000000000 +0100
8727 +/**************************************************************************
8729 + * BRIEF MODULE DESCRIPTION
8730 + * DMA operations for IDT RC32438.
8732 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8734 + * This program is free software; you can redistribute it and/or modify it
8735 + * under the terms of the GNU General Public License as published by the
8736 + * Free Software Foundation; either version 2 of the License, or (at your
8737 + * option) any later version.
8739 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8740 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8741 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8742 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8743 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8744 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8745 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8746 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8747 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8748 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8750 + * You should have received a copy of the GNU General Public License along
8751 + * with this program; if not, write to the Free Software Foundation, Inc.,
8752 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8755 + **************************************************************************
8756 + * May 2004 P. Sadik.
8762 + **************************************************************************
8765 +#ifndef __IDT_RC32438_DMA_V_H__
8766 +#define __IDT_RC32438_DMA_V_H__
8767 +#include <asm/idt-boards/rc32438/rc32438_dma.h>
8769 +#define DMA_CHAN_OFFSET 0x14
8770 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
8771 +#define DMA_COUNT(count) \
8772 + ((count) & DMAD_count_m)
8774 +#define DMA_HALT_TIMEOUT 500
8777 +static inline int rc32438_halt_dma(DMA_Chan_t ch)
8780 + if (rc32438_readl(&ch->dmac) & DMAC_run_m) {
8781 + rc32438_writel(0, &ch->dmac);
8783 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
8784 + if (rc32438_readl(&ch->dmas) & DMAS_h_m) {
8785 + rc32438_writel(0, &ch->dmas);
8792 + return timeout ? 0 : 1;
8798 +static inline void rc32438_start_dma(DMA_Chan_t ch, u32 dma_addr)
8800 + rc32438_writel(0, &ch->dmandptr);
8801 + rc32438_writel(dma_addr, &ch->dmadptr);
8804 +static inline void rc32438_chain_dma(DMA_Chan_t ch, u32 dma_addr)
8806 + rc32438_writel(dma_addr, &ch->dmandptr);
8808 +#endif //__IDT_RC32438_DMA_V_H__
8809 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_eth.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_eth.h
8810 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_eth.h 1970-01-01 01:00:00.000000000 +0100
8811 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_eth.h 2006-01-10 00:32:33.000000000 +0100
8813 +/**************************************************************************
8815 + * BRIEF MODULE DESCRIPTION
8816 + * Definitions for IDT EB438 ethernet
8818 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8820 + * This program is free software; you can redistribute it and/or modify it
8821 + * under the terms of the GNU General Public License as published by the
8822 + * Free Software Foundation; either version 2 of the License, or (at your
8823 + * option) any later version.
8825 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8826 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8827 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8828 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8829 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8830 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8831 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8832 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8833 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8834 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8836 + * You should have received a copy of the GNU General Public License along
8837 + * with this program; if not, write to the Free Software Foundation, Inc.,
8838 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8841 + **************************************************************************
8842 + * May 2004 P. Sadik.
8848 + **************************************************************************
8851 +#ifndef __IDT_RC32438_ETH_H__
8852 +#define __IDT_RC32438_ETH_H__
8855 + ETH0_PhysicalAddress = 0x18058000,
8856 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
8858 + ETH0_VirtualAddress = 0xb8058000,
8859 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
8860 + ETH1_PhysicalAddress = 0x18060000,
8861 + ETH1_VirtualAddress = 0xb8060000, // Default
8871 + u32 ethu0 [4] ; // Reserved.
8874 + u32 eth_u1 [10] ; // Reserved.
8876 + u32 eth_u2 [42] ; // Reserved.
8891 + u32 eth_u9 [50] ; // Reserved.
8898 + u32 eth_u10 ; // Reserved.
8906 + u32 eth_u11 ; // Reserved.
8907 + u32 eth_u12 ; // Reserved.
8915 + ETHINTFC_en_b = 0,
8916 + ETHINTFC_en_m = 0x00000001,
8917 + ETHINTFC_its_b = 1,
8918 + ETHINTFC_its_m = 0x00000002,
8919 + ETHINTFC_rip_b = 2,
8920 + ETHINTFC_rip_m = 0x00000004,
8921 + ETHINTFC_jam_b = 3,
8922 + ETHINTFC_jam_m = 0x00000008,
8923 + ETHINTFC_ovr_b = 4,
8924 + ETHINTFC_ovr_m = 0x00000010,
8925 + ETHINTFC_und_b = 5,
8926 + ETHINTFC_und_m = 0x00000020,
8928 + ETHFIFOTT_tth_b = 0,
8929 + ETHFIFOTT_tth_m = 0x0000007f,
8932 + ETHARC_pro_m = 0x00000001,
8934 + ETHARC_am_m = 0x00000002,
8936 + ETHARC_afm_m = 0x00000004,
8938 + ETHARC_ab_m = 0x00000008,
8940 + ETHSAL_byte5_b = 0,
8941 + ETHSAL_byte5_m = 0x000000ff,
8942 + ETHSAL_byte4_b = 8,
8943 + ETHSAL_byte4_m = 0x0000ff00,
8944 + ETHSAL_byte3_b = 16,
8945 + ETHSAL_byte3_m = 0x00ff0000,
8946 + ETHSAL_byte2_b = 24,
8947 + ETHSAL_byte2_m = 0xff000000,
8949 + ETHSAH_byte1_b = 0,
8950 + ETHSAH_byte1_m = 0x000000ff,
8951 + ETHSAH_byte0_b = 8,
8952 + ETHSAH_byte0_m = 0x0000ff00,
8955 + ETHGPF_ptv_m = 0x0000ffff,
8958 + ETHPFS_pfd_m = 0x00000001,
8960 + ETHCFSA0_cfsa4_b = 0,
8961 + ETHCFSA0_cfsa4_m = 0x000000ff,
8962 + ETHCFSA0_cfsa5_b = 8,
8963 + ETHCFSA0_cfsa5_m = 0x0000ff00,
8965 + ETHCFSA1_cfsa2_b = 0,
8966 + ETHCFSA1_cfsa2_m = 0x000000ff,
8967 + ETHCFSA1_cfsa3_b = 8,
8968 + ETHCFSA1_cfsa3_m = 0x0000ff00,
8970 + ETHCFSA2_cfsa0_b = 0,
8971 + ETHCFSA2_cfsa0_m = 0x000000ff,
8972 + ETHCFSA2_cfsa1_b = 8,
8973 + ETHCFSA2_cfsa1_m = 0x0000ff00,
8976 + ETHMAC1_re_m = 0x00000001,
8977 + ETHMAC1_paf_b = 1,
8978 + ETHMAC1_paf_m = 0x00000002,
8979 + ETHMAC1_rfc_b = 2,
8980 + ETHMAC1_rfc_m = 0x00000004,
8981 + ETHMAC1_tfc_b = 3,
8982 + ETHMAC1_tfc_m = 0x00000008,
8984 + ETHMAC1_lb_m = 0x00000010,
8985 + ETHMAC1_mr_b = 31,
8986 + ETHMAC1_mr_m = 0x80000000,
8989 + ETHMAC2_fd_m = 0x00000001,
8990 + ETHMAC2_flc_b = 1,
8991 + ETHMAC2_flc_m = 0x00000002,
8992 + ETHMAC2_hfe_b = 2,
8993 + ETHMAC2_hfe_m = 0x00000004,
8995 + ETHMAC2_dc_m = 0x00000008,
8996 + ETHMAC2_cen_b = 4,
8997 + ETHMAC2_cen_m = 0x00000010,
8999 + ETHMAC2_pe_m = 0x00000020,
9000 + ETHMAC2_vpe_b = 6,
9001 + ETHMAC2_vpe_m = 0x00000040,
9002 + ETHMAC2_ape_b = 7,
9003 + ETHMAC2_ape_m = 0x00000080,
9004 + ETHMAC2_ppe_b = 8,
9005 + ETHMAC2_ppe_m = 0x00000100,
9006 + ETHMAC2_lpe_b = 9,
9007 + ETHMAC2_lpe_m = 0x00000200,
9008 + ETHMAC2_nb_b = 12,
9009 + ETHMAC2_nb_m = 0x00001000,
9010 + ETHMAC2_bp_b = 13,
9011 + ETHMAC2_bp_m = 0x00002000,
9012 + ETHMAC2_ed_b = 14,
9013 + ETHMAC2_ed_m = 0x00004000,
9015 + ETHIPGT_ipgt_b = 0,
9016 + ETHIPGT_ipgt_m = 0x0000007f,
9018 + ETHIPGR_ipgr2_b = 0,
9019 + ETHIPGR_ipgr2_m = 0x0000007f,
9020 + ETHIPGR_ipgr1_b = 8,
9021 + ETHIPGR_ipgr1_m = 0x00007f00,
9023 + ETHCLRT_maxret_b = 0,
9024 + ETHCLRT_maxret_m = 0x0000000f,
9025 + ETHCLRT_colwin_b = 8,
9026 + ETHCLRT_colwin_m = 0x00003f00,
9028 + ETHMAXF_maxf_b = 0,
9029 + ETHMAXF_maxf_m = 0x0000ffff,
9031 + ETHMTEST_tb_b = 2,
9032 + ETHMTEST_tb_m = 0x00000004,
9035 + ETHMCP_div_m = 0x000000ff,
9037 + MIIMCFG_rsv_b = 0,
9038 + MIIMCFG_rsv_m = 0x0000000c,
9041 + MIIMCMD_rd_m = 0x00000001,
9042 + MIIMCMD_scn_b = 1,
9043 + MIIMCMD_scn_m = 0x00000002,
9045 + MIIMADDR_regaddr_b = 0,
9046 + MIIMADDR_regaddr_m = 0x0000001f,
9047 + MIIMADDR_phyaddr_b = 8,
9048 + MIIMADDR_phyaddr_m = 0x00001f00,
9050 + MIIMWTD_wdata_b = 0,
9051 + MIIMWTD_wdata_m = 0x0000ffff,
9053 + MIIMRDD_rdata_b = 0,
9054 + MIIMRDD_rdata_m = 0x0000ffff,
9056 + MIIMIND_bsy_b = 0,
9057 + MIIMIND_bsy_m = 0x00000001,
9058 + MIIMIND_scn_b = 1,
9059 + MIIMIND_scn_m = 0x00000002,
9061 + MIIMIND_nv_m = 0x00000004,
9066 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
9071 + ETHRX_fd_m = 0x00000001,
9073 + ETHRX_ld_m = 0x00000002,
9075 + ETHRX_rok_m = 0x00000004,
9077 + ETHRX_fm_m = 0x00000008,
9079 + ETHRX_mp_m = 0x00000010,
9081 + ETHRX_bp_m = 0x00000020,
9083 + ETHRX_vlt_m = 0x00000040,
9085 + ETHRX_cf_m = 0x00000080,
9087 + ETHRX_ovr_m = 0x00000100,
9089 + ETHRX_crc_m = 0x00000200,
9091 + ETHRX_cv_m = 0x00000400,
9093 + ETHRX_db_m = 0x00000800,
9095 + ETHRX_le_m = 0x00001000,
9097 + ETHRX_lor_m = 0x00002000,
9099 + ETHRX_ces_m = 0x00004000,
9100 + ETHRX_length_b = 16,
9101 + ETHRX_length_m = 0xffff0000,
9104 + ETHTX_fd_m = 0x00000001,
9106 + ETHTX_ld_m = 0x00000002,
9108 + ETHTX_oen_m = 0x00000004,
9110 + ETHTX_pen_m = 0x00000008,
9112 + ETHTX_cen_m = 0x00000010,
9114 + ETHTX_hen_m = 0x00000020,
9116 + ETHTX_tok_m = 0x00000040,
9118 + ETHTX_mp_m = 0x00000080,
9120 + ETHTX_bp_m = 0x00000100,
9122 + ETHTX_und_m = 0x00000200,
9124 + ETHTX_of_m = 0x00000400,
9126 + ETHTX_ed_m = 0x00000800,
9128 + ETHTX_ec_m = 0x00001000,
9130 + ETHTX_lc_m = 0x00002000,
9132 + ETHTX_td_m = 0x00004000,
9134 + ETHTX_crc_m = 0x00008000,
9136 + ETHTX_le_m = 0x00010000,
9138 + ETHTX_cc_m = 0x001E0000,
9140 +#endif //__IDT_RC32438_ETH_H__
9141 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h
9142 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h 1970-01-01 01:00:00.000000000 +0100
9143 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h 2006-01-10 00:32:33.000000000 +0100
9145 +/**************************************************************************
9147 + * BRIEF MODULE DESCRIPTION
9148 + * macros for IDT EB438 ethernet
9150 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9152 + * This program is free software; you can redistribute it and/or modify it
9153 + * under the terms of the GNU General Public License as published by the
9154 + * Free Software Foundation; either version 2 of the License, or (at your
9155 + * option) any later version.
9157 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9158 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9159 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9160 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9161 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9162 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9163 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9164 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9165 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9166 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9168 + * You should have received a copy of the GNU General Public License along
9169 + * with this program; if not, write to the Free Software Foundation, Inc.,
9170 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9173 + **************************************************************************
9174 + * May 2004 P. Sadik.
9180 + **************************************************************************
9183 +#ifndef __IDT_RC32438_ETH_V_H__
9184 +#define __IDT_RC32438_ETH_V_H__
9185 +#include <asm/idt-boards/rc32438/rc32438_eth.h>
9187 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
9188 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
9189 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
9190 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
9191 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
9192 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
9193 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
9194 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
9195 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
9196 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
9197 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
9199 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
9201 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
9202 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
9203 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
9204 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
9205 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
9206 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
9207 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
9208 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
9209 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
9210 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
9211 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
9212 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
9213 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
9214 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
9216 +#endif //__IDT_RC32438_ETH_V_H__
9217 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h
9218 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h 1970-01-01 01:00:00.000000000 +0100
9219 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h 2006-01-10 00:32:33.000000000 +0100
9221 +/**************************************************************************
9223 + * BRIEF MODULE DESCRIPTION
9224 + * Definitions for IDT RC32438 GPIO.
9226 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9228 + * This program is free software; you can redistribute it and/or modify it
9229 + * under the terms of the GNU General Public License as published by the
9230 + * Free Software Foundation; either version 2 of the License, or (at your
9231 + * option) any later version.
9233 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9234 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9235 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9236 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9237 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9238 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9239 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9240 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9241 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9242 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9244 + * You should have received a copy of the GNU General Public License along
9245 + * with this program; if not, write to the Free Software Foundation, Inc.,
9246 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9249 + **************************************************************************
9250 + * May 2004 P. Sadik.
9256 + **************************************************************************
9258 +#ifndef __IDT_RC32438_GPIO_H__
9259 +#define __IDT_RC32438_GPIO_H__
9262 + GPIO0_PhysicalAddress = 0x18048000,
9263 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
9265 + GPIO0_VirtualAddress = 0xb8048000,
9266 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
9271 + u32 gpiofunc; /* GPIO Function Register
9272 + * gpiofunc[x]==0 bit = gpio
9273 + * func[x]==1 bit = altfunc
9275 + u32 gpiocfg; /* GPIO Configuration Register
9276 + * gpiocfg[x]==0 bit = input
9277 + * gpiocfg[x]==1 bit = output
9279 + u32 gpiod; /* GPIO Data Register
9280 + * gpiod[x] read/write gpio pinX status
9282 + u32 gpioilevel; /* GPIO Interrupt Status Register
9283 + * interrupt level (see gpioistat)
9285 + u32 gpioistat; /* Gpio Interrupt Status Register
9286 + * istat[x] = (gpiod[x] == level[x])
9287 + * cleared in ISR (STICKY bits)
9289 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
9290 +} volatile * GPIO_t ;
9294 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
9295 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
9296 + GPIO_input_v = 0, // gpiocfg use pin as input.
9297 + GPIO_output_v = 1, // gpiocfg use pin as output.
9299 + GPIO_pin0_m = 0x00000001,
9301 + GPIO_pin1_m = 0x00000002,
9303 + GPIO_pin2_m = 0x00000004,
9305 + GPIO_pin3_m = 0x00000008,
9307 + GPIO_pin4_m = 0x00000010,
9309 + GPIO_pin5_m = 0x00000020,
9311 + GPIO_pin6_m = 0x00000040,
9313 + GPIO_pin7_m = 0x00000080,
9315 + GPIO_pin8_m = 0x00000100,
9317 + GPIO_pin9_m = 0x00000200,
9318 + GPIO_pin10_b = 10,
9319 + GPIO_pin10_m = 0x00000400,
9320 + GPIO_pin11_b = 11,
9321 + GPIO_pin11_m = 0x00000800,
9322 + GPIO_pin12_b = 12,
9323 + GPIO_pin12_m = 0x00001000,
9324 + GPIO_pin13_b = 13,
9325 + GPIO_pin13_m = 0x00002000,
9326 + GPIO_pin14_b = 14,
9327 + GPIO_pin14_m = 0x00004000,
9328 + GPIO_pin15_b = 15,
9329 + GPIO_pin15_m = 0x00008000,
9330 + GPIO_pin16_b = 16,
9331 + GPIO_pin16_m = 0x00010000,
9332 + GPIO_pin17_b = 17,
9333 + GPIO_pin17_m = 0x00020000,
9334 + GPIO_pin18_b = 18,
9335 + GPIO_pin18_m = 0x00040000,
9336 + GPIO_pin19_b = 19,
9337 + GPIO_pin19_m = 0x00080000,
9338 + GPIO_pin20_b = 20,
9339 + GPIO_pin20_m = 0x00100000,
9340 + GPIO_pin21_b = 21,
9341 + GPIO_pin21_m = 0x00200000,
9342 + GPIO_pin22_b = 22,
9343 + GPIO_pin22_m = 0x00400000,
9344 + GPIO_pin23_b = 23,
9345 + GPIO_pin23_m = 0x00800000,
9346 + GPIO_pin24_b = 24,
9347 + GPIO_pin24_m = 0x01000000,
9348 + GPIO_pin25_b = 25,
9349 + GPIO_pin25_m = 0x02000000,
9350 + GPIO_pin26_b = 26,
9351 + GPIO_pin26_m = 0x04000000,
9352 + GPIO_pin27_b = 27,
9353 + GPIO_pin27_m = 0x08000000,
9354 + GPIO_pin28_b = 28,
9355 + GPIO_pin28_m = 0x10000000,
9356 + GPIO_pin29_b = 29,
9357 + GPIO_pin29_m = 0x20000000,
9358 + GPIO_pin30_b = 30,
9359 + GPIO_pin30_m = 0x40000000,
9360 + GPIO_pin31_b = 31,
9361 + GPIO_pin31_m = 0x80000000,
9363 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
9365 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
9366 + GPIO_u0sout_m = GPIO_pin0_m,
9367 + GPIO_u0sout_cfg_v = GPIO_output_v,
9368 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
9369 + GPIO_u0sinp_m = GPIO_pin1_m,
9370 + GPIO_u0sinp_cfg_v = GPIO_input_v,
9371 + GPIO_u0rin_b = GPIO_pin2_b, // UART 0 ring indic.
9372 + GPIO_u0rin_m = GPIO_pin2_m,
9373 + GPIO_u0rin_cfg_v = GPIO_input_v,
9374 + GPIO_u0dcdn_b = GPIO_pin3_b, // UART 0 data carr.det.
9375 + GPIO_u0dcdn_m = GPIO_pin3_m,
9376 + GPIO_u0dcdn_cfg_v = GPIO_input_v,
9377 + GPIO_u0dtrn_b = GPIO_pin4_b, // UART 0 data term rdy.
9378 + GPIO_u0dtrn_m = GPIO_pin4_m,
9379 + GPIO_u0dtrn_cfg_v = GPIO_output_v,
9380 + GPIO_u0dsrn_b = GPIO_pin5_b, // UART 0 data set rdy.
9381 + GPIO_u0dsrn_m = GPIO_pin5_m,
9382 + GPIO_u0dsrn_cfg_v = GPIO_input_v,
9383 + GPIO_u0rtsn_b = GPIO_pin6_b, // UART 0 req. to send.
9384 + GPIO_u0rtsn_m = GPIO_pin6_m,
9385 + GPIO_u0rtsn_cfg_v = GPIO_output_v,
9386 + GPIO_u0ctsn_b = GPIO_pin7_b, // UART 0 clear to send.
9387 + GPIO_u0ctsn_m = GPIO_pin7_m,
9388 + GPIO_u0ctsn_cfg_v = GPIO_input_v,
9390 + GPIO_u1sout_b = GPIO_pin8_b, // UART 1 serial out.
9391 + GPIO_u1sout_m = GPIO_pin8_m,
9392 + GPIO_u1sout_cfg_v = GPIO_output_v,
9393 + GPIO_u1sinp_b = GPIO_pin9_b, // UART 1 serial in.
9394 + GPIO_u1sinp_m = GPIO_pin9_m,
9395 + GPIO_u1sinp_cfg_v = GPIO_input_v,
9396 + GPIO_u1dtrn_b = GPIO_pin10_b, // UART 1 data term rdy.
9397 + GPIO_u1dtrn_m = GPIO_pin10_m,
9398 + GPIO_u1dtrn_cfg_v = GPIO_output_v,
9399 + GPIO_u1dsrn_b = GPIO_pin11_b, // UART 1 data set rdy.
9400 + GPIO_u1dsrn_m = GPIO_pin11_m,
9401 + GPIO_u1dsrn_cfg_v = GPIO_input_v,
9402 + GPIO_u1rtsn_b = GPIO_pin12_b, // UART 1 req. to send.
9403 + GPIO_u1rtsn_m = GPIO_pin12_m,
9404 + GPIO_u1rtsn_cfg_v = GPIO_output_v,
9405 + GPIO_u1ctsn_b = GPIO_pin13_b, // UART 1 clear to send.
9406 + GPIO_u1ctsn_m = GPIO_pin13_m,
9407 + GPIO_u1ctsn_cfg_v = GPIO_input_v,
9409 + GPIO_dmareqn0_b = GPIO_pin14_b, // Ext. DMA 0 request
9410 + GPIO_dmareqn0_m = GPIO_pin14_m,
9411 + GPIO_dmareqn0_cfg_v = GPIO_input_v,
9413 + GPIO_dmareqn1_b = GPIO_pin15_b, // Ext. DMA 1 request
9414 + GPIO_dmareqn1_m = GPIO_pin15_m,
9415 + GPIO_dmareqn1_cfg_v = GPIO_input_v,
9417 + GPIO_dmadonen0_b = GPIO_pin16_b, // Ext. DMA 0 done
9418 + GPIO_dmadonen0_m = GPIO_pin16_m,
9419 + GPIO_dmadonen0_cfg_v = GPIO_input_v,
9421 + GPIO_dmadonen1_b = GPIO_pin17_b, // Ext. DMA 1 done
9422 + GPIO_dmadonen1_m = GPIO_pin17_m,
9423 + GPIO_dmadonen1_cfg_v = GPIO_input_v,
9425 + GPIO_dmafinn0_b = GPIO_pin18_b, // Ext. DMA 0 finished
9426 + GPIO_dmafinn0_m = GPIO_pin18_m,
9427 + GPIO_dmafinn0_cfg_v = GPIO_output_v,
9429 + GPIO_dmafinn1_b = GPIO_pin19_b, // Ext. DMA 1 finished
9430 + GPIO_dmafinn1_m = GPIO_pin19_m,
9431 + GPIO_dmafinn1_cfg_v = GPIO_output_v,
9433 + GPIO_maddr22_b = GPIO_pin20_b, // M&P bus bit 22.
9434 + GPIO_maddr22_m = GPIO_pin20_m,
9435 + GPIO_maddr22_cfg_v = GPIO_output_v,
9437 + GPIO_maddr23_b = GPIO_pin21_b, // M&P bus bit 23.
9438 + GPIO_maddr23_m = GPIO_pin21_m,
9439 + GPIO_maddr23_cfg_v = GPIO_output_v,
9441 + GPIO_maddr24_b = GPIO_pin22_b, // M&P bus bit 24.
9442 + GPIO_maddr24_m = GPIO_pin22_m,
9443 + GPIO_maddr24_cfg_v = GPIO_output_v,
9445 + GPIO_maddr25_b = GPIO_pin23_b, // M&P bus bit 25.
9446 + GPIO_maddr25_m = GPIO_pin23_m,
9447 + GPIO_maddr25_cfg_v = GPIO_output_v,
9449 + GPIO_afspare6_b = GPIO_pin24_b, // reserved.
9450 + GPIO_afspare6_m = GPIO_pin24_m,
9451 + GPIO_afspare6_cfg_v = GPIO_input_v,
9452 + GPIO_afspare5_b = GPIO_pin25_b, // reserved.
9453 + GPIO_afspare5_m = GPIO_pin25_m,
9454 + GPIO_afspare5_cfg_v = GPIO_input_v,
9455 + GPIO_afspare4_b = GPIO_pin26_b, // reserved.
9456 + GPIO_afspare4_m = GPIO_pin26_m,
9457 + GPIO_afspare4_cfg_v = GPIO_input_v,
9458 + GPIO_afspare3_b = GPIO_pin27_b, // reserved.
9459 + GPIO_afspare3_m = GPIO_pin27_m,
9460 + GPIO_afspare3_cfg_v = GPIO_input_v,
9461 + GPIO_afspare2_b = GPIO_pin28_b, // reserved.
9462 + GPIO_afspare2_m = GPIO_pin28_m,
9463 + GPIO_afspare2_cfg_v = GPIO_input_v,
9464 + GPIO_afspare1_b = GPIO_pin29_b, // reserved.
9465 + GPIO_afspare1_m = GPIO_pin29_m,
9466 + GPIO_afspare1_cfg_v = GPIO_input_v,
9468 + GPIO_pcimuintn_b = GPIO_pin30_b, // PCI messaging int.
9469 + GPIO_pcimuintn_m = GPIO_pin30_m,
9470 + GPIO_pcimuintn_cfg_v = GPIO_output_v,
9472 + GPIO_rngclk_b = GPIO_pin31_b, // RNG external clock
9473 + GPIO_rngclk_m = GPIO_pin31_m,
9474 + GPIO_rncclk_cfg_v = GPIO_input_v,
9477 +#endif //__IDT_RC32438_GPIO_H__
9478 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438.h
9479 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438.h 1970-01-01 01:00:00.000000000 +0100
9480 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438.h 2006-01-10 00:32:33.000000000 +0100
9482 +/**************************************************************************
9484 + * BRIEF MODULE DESCRIPTION
9485 + * Definitions for IDT RC32438 CPU.
9487 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9489 + * This program is free software; you can redistribute it and/or modify it
9490 + * under the terms of the GNU General Public License as published by the
9491 + * Free Software Foundation; either version 2 of the License, or (at your
9492 + * option) any later version.
9494 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9495 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9496 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9497 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9498 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9499 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9500 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9501 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9502 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9503 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9505 + * You should have received a copy of the GNU General Public License along
9506 + * with this program; if not, write to the Free Software Foundation, Inc.,
9507 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9510 + **************************************************************************
9511 + * May 2004 P. Sadik.
9517 + **************************************************************************
9520 +#ifndef __IDT_RC32438_H__
9521 +#define __IDT_RC32438_H__
9522 +#include <linux/config.h>
9523 +#include <linux/delay.h>
9524 +#include <asm/io.h>
9525 +#include <asm/idt-boards/rc32438/rc32438_timer.h>
9527 +#define RC32438_REG_BASE 0x18000000
9529 +#define interrupt ((volatile INT_t ) INT0_VirtualAddress)
9530 +#define idttimer ((volatile TIM_t) TIM0_VirtualAddress)
9531 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
9533 +#define IDT_CLOCK_MULT 2
9534 +#define MIPS_CPU_TIMER_IRQ 7
9535 +/* Interrupt Controller */
9536 +#define IC_GROUP0_PEND (RC32438_REG_BASE + 0x38000)
9537 +#define IC_GROUP0_MASK (RC32438_REG_BASE + 0x38008)
9538 +#define IC_GROUP_OFFSET 0x0C
9539 +#define RTC_BASE 0xAC0801FF0
9541 +#define NUM_INTR_GROUPS 5
9544 +#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
9545 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) /* GRP3 IRQ numbers start here */
9546 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) /* GRP4 IRQ numbers start here */
9547 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) /* GRP5 IRQ numbers start here */
9548 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
9551 +#define RC32438_UART0_BASE (RC32438_REG_BASE + 0x50003)
9552 +#define RC32438_UART1_BASE (RC32438_REG_BASE + 0x50023)
9554 +#define RC32438_UART0_BASE (RC32438_REG_BASE + 0x50000)
9555 +#define RC32438_UART1_BASE (RC32438_REG_BASE + 0x50020)
9558 +#define RC32438_UART0_IRQ GROUP3_IRQ_BASE + 0
9559 +#define RC32438_UART1_IRQ GROUP3_IRQ_BASE + 3
9561 +#define RC32438_NR_IRQS (GROUP4_IRQ_BASE + 32)
9565 +/* cpu pipeline flush */
9566 +static inline void rc32438_sync(void)
9568 + __asm__ volatile ("sync");
9571 +static inline void rc32438_sync_udelay(int us)
9573 + __asm__ volatile ("sync");
9577 +static inline void rc32438_sync_delay(int ms)
9579 + __asm__ volatile ("sync");
9584 + * Macros to access internal RC32438 registers. No byte
9585 + * swapping should be done when accessing the internal
9589 +#define rc32438_readb __raw_readb
9590 +#define rc32438_readw __raw_readw
9591 +#define rc32438_readl __raw_readl
9593 +#define rc32438_writeb __raw_writeb
9594 +#define rc32438_writew __raw_writew
9595 +#define rc32438_writel __raw_writel
9598 + * C access to CLZ and CLO instructions
9599 + * (count leading zeroes/ones).
9601 +static inline int rc32438_clz(unsigned long val)
9604 + __asm__ volatile (
9605 + ".set\tnoreorder\n\t"
9607 + ".set\tmips32\n\t"
9617 +static inline int rc32438_clo(unsigned long val)
9620 + __asm__ volatile (
9621 + ".set\tnoreorder\n\t"
9623 + ".set\tmips32\n\t"
9633 +#endif //__IDT_RC32438_H__
9634 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_pci.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_pci.h
9635 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_pci.h 1970-01-01 01:00:00.000000000 +0100
9636 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_pci.h 2006-01-10 00:32:33.000000000 +0100
9638 +/**************************************************************************
9640 + * BRIEF MODULE DESCRIPTION
9641 + * Definitions for IDT RC32438 PCI.
9643 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9645 + * This program is free software; you can redistribute it and/or modify it
9646 + * under the terms of the GNU General Public License as published by the
9647 + * Free Software Foundation; either version 2 of the License, or (at your
9648 + * option) any later version.
9650 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9651 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9652 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9653 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9654 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9655 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9656 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9657 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9658 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9659 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9661 + * You should have received a copy of the GNU General Public License along
9662 + * with this program; if not, write to the Free Software Foundation, Inc.,
9663 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9666 + **************************************************************************
9667 + * May 2004 P. Sadik
9673 + **************************************************************************
9678 + PCI0_PhysicalAddress = 0x18080000,
9679 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
9681 + PCI0_VirtualAddress = 0xb8080000,
9682 + PCI_VirtualAddress = PCI0_VirtualAddress,
9687 + PCI_LbaCount = 4, // Local base addresses.
9692 + u32 a ; // Address.
9693 + u32 c ; // Control.
9694 + u32 m ; // mapping.
9704 + PCI_Map_s pcilba [PCI_LbaCount] ;
9712 +} volatile *PCI_t ;
9714 +// PCI messaging unit.
9721 + u32 pciim [PCIM_Count] ;
9722 + u32 pciom [PCIM_Count] ;
9729 +} volatile *PCIM_t ;
9731 +/*******************************************************************************
9733 + * PCI Control Register
9735 + ******************************************************************************/
9739 + PCIC_en_m = 0x00000001,
9741 + PCIC_tnr_m = 0x00000002,
9743 + PCIC_sce_m = 0x00000004,
9745 + PCIC_ien_m = 0x00000008,
9747 + PCIC_aaa_m = 0x00000010,
9749 + PCIC_eap_m = 0x00000020,
9751 + PCIC_pcim_m = 0x000001c0,
9752 + PCIC_pcim_disabled_v = 0,
9753 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
9754 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
9755 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
9756 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
9757 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
9758 + PCIC_pcim_reserved6_v = 6,
9759 + PCIC_pcim_reserved7_v = 7,
9761 + PCIC_igm_m = 0x00000200,
9764 +/*******************************************************************************
9766 + * PCI Status Register
9768 + ******************************************************************************/
9771 + PCIS_eed_m = 0x00000001,
9773 + PCIS_wr_m = 0x00000002,
9775 + PCIS_nmi_m = 0x00000004,
9777 + PCIS_ii_m = 0x00000008,
9779 + PCIS_cwe_m = 0x00000010,
9781 + PCIS_cre_m = 0x00000020,
9783 + PCIS_mdpe_m = 0x00000040,
9785 + PCIS_sta_m = 0x00000080,
9787 + PCIS_rta_m = 0x00000100,
9789 + PCIS_rma_m = 0x00000200,
9791 + PCIS_sse_m = 0x00000400,
9793 + PCIS_ose_m = 0x00000800,
9795 + PCIS_pe_m = 0x00001000,
9797 + PCIS_tae_m = 0x00002000,
9799 + PCIS_rle_m = 0x00004000,
9801 + PCIS_bme_m = 0x00008000,
9803 + PCIS_prd_m = 0x00010000,
9805 + PCIS_rip_m = 0x00020000,
9808 +/*******************************************************************************
9810 + * PCI Status Mask Register
9812 + ******************************************************************************/
9815 + PCISM_eed_m = 0x00000001,
9817 + PCISM_wr_m = 0x00000002,
9819 + PCISM_nmi_m = 0x00000004,
9821 + PCISM_ii_m = 0x00000008,
9823 + PCISM_cwe_m = 0x00000010,
9825 + PCISM_cre_m = 0x00000020,
9827 + PCISM_mdpe_m = 0x00000040,
9829 + PCISM_sta_m = 0x00000080,
9831 + PCISM_rta_m = 0x00000100,
9833 + PCISM_rma_m = 0x00000200,
9835 + PCISM_sse_m = 0x00000400,
9837 + PCISM_ose_m = 0x00000800,
9839 + PCISM_pe_m = 0x00001000,
9841 + PCISM_tae_m = 0x00002000,
9843 + PCISM_rle_m = 0x00004000,
9845 + PCISM_bme_m = 0x00008000,
9847 + PCISM_prd_m = 0x00010000,
9849 + PCISM_rip_m = 0x00020000,
9852 +/*******************************************************************************
9854 + * PCI Configuration Address Register
9856 + ******************************************************************************/
9858 + PCICFGA_reg_b = 2,
9859 + PCICFGA_reg_m = 0x000000fc,
9860 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
9861 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
9862 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
9863 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
9864 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
9865 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
9866 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
9867 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
9868 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
9869 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
9870 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
9871 + PCICFGA_reg_pba0m_v = 0x48>>2,
9872 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
9873 + PCICFGA_reg_pba1m_v = 0x50>>2,
9874 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
9875 + PCICFGA_reg_pba2m_v = 0x58>>2,
9876 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
9877 + PCICFGA_reg_pba3m_v = 0x60>>2,
9878 + PCICFGA_reg_pmgt_v = 0x64>>2,
9879 + PCICFGA_func_b = 8,
9880 + PCICFGA_func_m = 0x00000700,
9881 + PCICFGA_dev_b = 11,
9882 + PCICFGA_dev_m = 0x0000f800,
9883 + PCICFGA_dev_internal_v = 0,
9884 + PCICFGA_bus_b = 16,
9885 + PCICFGA_bus_m = 0x00ff0000,
9886 + PCICFGA_bus_type0_v = 0, //local bus
9887 + PCICFGA_en_b = 31, // read only
9888 + PCICFGA_en_m = 0x80000000,
9892 + PCFGID_vendor_b = 0,
9893 + PCFGID_vendor_m = 0x0000ffff,
9894 + PCFGID_vendor_IDT_v = 0x111d,
9895 + PCFGID_device_b = 16,
9896 + PCFGID_device_m = 0xffff0000,
9897 + PCFGID_device_Acaciade_v = 0x0207,
9899 + PCFG04_command_ioena_b = 1,
9900 + PCFG04_command_ioena_m = 0x00000001,
9901 + PCFG04_command_memena_b = 2,
9902 + PCFG04_command_memena_m = 0x00000002,
9903 + PCFG04_command_bmena_b = 3,
9904 + PCFG04_command_bmena_m = 0x00000004,
9905 + PCFG04_command_mwinv_b = 5,
9906 + PCFG04_command_mwinv_m = 0x00000010,
9907 + PCFG04_command_parena_b = 7,
9908 + PCFG04_command_parena_m = 0x00000040,
9909 + PCFG04_command_serrena_b = 9,
9910 + PCFG04_command_serrena_m = 0x00000100,
9911 + PCFG04_command_fastbbena_b = 10,
9912 + PCFG04_command_fastbbena_m = 0x00000200,
9913 + PCFG04_status_b = 16,
9914 + PCFG04_status_m = 0xffff0000,
9915 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
9916 + PCFG04_status_66MHz_m = 0x00200000,
9917 + PCFG04_status_fbb_b = 23,
9918 + PCFG04_status_fbb_m = 0x00800000,
9919 + PCFG04_status_mdpe_b = 24,
9920 + PCFG04_status_mdpe_m = 0x01000000,
9921 + PCFG04_status_dst_b = 25,
9922 + PCFG04_status_dst_m = 0x06000000,
9923 + PCFG04_status_sta_b = 27,
9924 + PCFG04_status_sta_m = 0x08000000,
9925 + PCFG04_status_rta_b = 28,
9926 + PCFG04_status_rta_m = 0x10000000,
9927 + PCFG04_status_rma_b = 29,
9928 + PCFG04_status_rma_m = 0x20000000,
9929 + PCFG04_status_sse_b = 30,
9930 + PCFG04_status_sse_m = 0x40000000,
9931 + PCFG04_status_pe_b = 31,
9932 + PCFG04_status_pe_m = 0x40000000,
9934 + PCFG08_revId_b = 0,
9935 + PCFG08_revId_m = 0x000000ff,
9936 + PCFG08_classCode_b = 0,
9937 + PCFG08_classCode_m = 0xffffff00,
9938 + PCFG08_classCode_bridge_v = 06,
9939 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
9940 + PCFG0C_cacheline_b = 0,
9941 + PCFG0C_cacheline_m = 0x000000ff,
9942 + PCFG0C_masterLatency_b = 8,
9943 + PCFG0C_masterLatency_m = 0x0000ff00,
9944 + PCFG0C_headerType_b = 16,
9945 + PCFG0C_headerType_m = 0x00ff0000,
9946 + PCFG0C_bist_b = 24,
9947 + PCFG0C_bist_m = 0xff000000,
9950 + PCIPBA_msi_m = 0x00000001,
9952 + PCIPBA_p_m = 0x00000004,
9953 + PCIPBA_baddr_b = 8,
9954 + PCIPBA_baddr_m = 0xffffff00,
9956 + PCFGSS_vendorId_b = 0,
9957 + PCFGSS_vendorId_m = 0x0000ffff,
9959 + PCFGSS_id_m = 0xffff0000,
9961 + PCFG3C_interruptLine_b = 0,
9962 + PCFG3C_interruptLine_m = 0x000000ff,
9963 + PCFG3C_interruptPin_b = 8,
9964 + PCFG3C_interruptPin_m = 0x0000ff00,
9965 + PCFG3C_minGrant_b = 16,
9966 + PCFG3C_minGrant_m = 0x00ff0000,
9967 + PCFG3C_maxLat_b = 24,
9968 + PCFG3C_maxLat_m = 0xff000000,
9970 + PCIPBAC_msi_b = 0,
9971 + PCIPBAC_msi_m = 0x00000001,
9973 + PCIPBAC_p_m = 0x00000002,
9974 + PCIPBAC_size_b = 2,
9975 + PCIPBAC_size_m = 0x0000007c,
9977 + PCIPBAC_sb_m = 0x00000080,
9979 + PCIPBAC_pp_m = 0x00000100,
9981 + PCIPBAC_mr_m = 0x00000600,
9982 + PCIPBAC_mr_read_v =0, //no prefetching
9983 + PCIPBAC_mr_readLine_v =1,
9984 + PCIPBAC_mr_readMult_v =2,
9985 + PCIPBAC_mrl_b = 11,
9986 + PCIPBAC_mrl_m = 0x00000800,
9987 + PCIPBAC_mrm_b = 12,
9988 + PCIPBAC_mrm_m = 0x00001000,
9989 + PCIPBAC_trp_b = 13,
9990 + PCIPBAC_trp_m = 0x00002000,
9992 + PCFG40_trdyTimeout_b = 0,
9993 + PCFG40_trdyTimeout_m = 0x000000ff,
9994 + PCFG40_retryLim_b = 8,
9995 + PCFG40_retryLim_m = 0x0000ff00,
9998 +/*******************************************************************************
10000 + * PCI Local Base Address [0|1|2|3] Register
10002 + ******************************************************************************/
10004 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
10005 + PCILBA_baddr_m = 0xffffff00,
10007 +/*******************************************************************************
10009 + * PCI Local Base Address Control Register
10011 + ******************************************************************************/
10013 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
10014 + PCILBAC_msi_m = 0x00000001,
10015 + PCILBAC_msi_mem_v = 0,
10016 + PCILBAC_msi_io_v = 1,
10017 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
10018 + PCILBAC_size_m = 0x0000007c,
10019 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
10020 + PCILBAC_sb_m = 0x00000080,
10021 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
10022 + PCILBAC_rt_m = 0x00000100,
10023 + PCILBAC_rt_noprefetch_v = 0, // mem read
10024 + PCILBAC_rt_prefetch_v = 1, // mem readline
10027 +/*******************************************************************************
10029 + * PCI Local Base Address [0|1|2|3] Mapping Register
10031 + ******************************************************************************/
10033 + PCILBAM_maddr_b = 8,
10034 + PCILBAM_maddr_m = 0xffffff00,
10037 +/*******************************************************************************
10039 + * PCI Decoupled Access Control Register
10041 + ******************************************************************************/
10043 + PCIDAC_den_b = 0,
10044 + PCIDAC_den_m = 0x00000001,
10047 +/*******************************************************************************
10049 + * PCI Decoupled Access Status Register
10051 + ******************************************************************************/
10054 + PCIDAS_d_m = 0x00000001,
10056 + PCIDAS_b_m = 0x00000002,
10058 + PCIDAS_e_m = 0x00000004,
10059 + PCIDAS_ofe_b = 3,
10060 + PCIDAS_ofe_m = 0x00000008,
10061 + PCIDAS_off_b = 4,
10062 + PCIDAS_off_m = 0x00000010,
10063 + PCIDAS_ife_b = 5,
10064 + PCIDAS_ife_m = 0x00000020,
10065 + PCIDAS_iff_b = 6,
10066 + PCIDAS_iff_m = 0x00000040,
10069 +/*******************************************************************************
10071 + * PCI DMA Channel 8 Configuration Register
10073 + ******************************************************************************/
10076 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
10077 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
10078 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
10079 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
10082 +/*******************************************************************************
10084 + * PCI DMA Channel 9 Configuration Register
10086 + ******************************************************************************/
10089 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
10090 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
10093 +/*******************************************************************************
10095 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
10097 + ******************************************************************************/
10099 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
10100 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
10101 + // These are for reads (DMA channel 8)
10102 + PCIDMAD_devcmd_mr_v = 0, //memory read
10103 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
10104 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
10105 + PCIDMAD_devcmd_ior_v = 3, //I/O read
10106 + // These are for writes (DMA channel 9)
10107 + PCIDMAD_devcmd_mw_v = 0, //memory write
10108 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
10109 + PCIDMAD_devcmd_iow_v = 3, //I/O write
10111 + // Swap byte field applies to both DMA channel 8 and 9
10112 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
10113 + PCIDMAD_sb_m = 0x01000000, // swap byte field
10117 +/*******************************************************************************
10119 + * PCI Target Control Register
10121 + ******************************************************************************/
10124 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
10125 + PCITC_rtimer_m = 0x000000ff,
10126 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
10127 + PCITC_dtimer_m = 0x0000ff00,
10128 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
10129 + PCITC_rdr_m = 0x00040000,
10130 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
10131 + PCITC_ddt_m = 0x00080000,
10133 +/*******************************************************************************
10135 + * PCI messaging unit [applies to both inbound and outbound registers ]
10137 + ******************************************************************************/
10140 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10141 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
10142 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10143 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
10144 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10145 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
10148 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h
10149 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h 1970-01-01 01:00:00.000000000 +0100
10150 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h 2006-01-10 00:32:33.000000000 +0100
10152 +/**************************************************************************
10154 + * BRIEF MODULE DESCRIPTION
10155 + * Definitions for IDT RC32438 PCI setup.
10157 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10159 + * This program is free software; you can redistribute it and/or modify it
10160 + * under the terms of the GNU General Public License as published by the
10161 + * Free Software Foundation; either version 2 of the License, or (at your
10162 + * option) any later version.
10164 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10165 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10166 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10167 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10168 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10169 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10170 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10171 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10172 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10173 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10175 + * You should have received a copy of the GNU General Public License along
10176 + * with this program; if not, write to the Free Software Foundation, Inc.,
10177 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10180 + **************************************************************************
10181 + * May 2004 P. Sadik
10183 + * Initial Release
10187 + **************************************************************************
10190 +#define PCI_MSG_VirtualAddress 0xB8088010
10191 +#define rc32438_pci ((volatile PCI_t) PCI0_VirtualAddress)
10192 +#define rc32438_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
10194 +#define PCIM_SHFT 0x6
10195 +#define PCIM_BIT_LEN 0x7
10196 +#define PCIM_H_EA 0x3
10197 +#define PCIM_H_IA_FIX 0x4
10198 +#define PCIM_H_IA_RR 0x5
10200 +#define PCI_ADDR_START 0x50000000
10202 +#define CPUTOPCI_MEM_WIN 0x02000000
10203 +#define CPUTOPCI_IO_WIN 0x00100000
10204 +#define PCILBA_SIZE_SHFT 2
10205 +#define PCILBA_SIZE_MASK 0x1F
10206 +#define SIZE_256MB 0x1C
10207 +#define SIZE_128MB 0x1B
10208 +#define SIZE_64MB 0x1A
10209 +#define SIZE_32MB 0x19
10210 +#define SIZE_16MB 0x18
10211 +#define SIZE_4MB 0x16
10212 +#define SIZE_2MB 0x15
10213 +#define SIZE_1MB 0x14
10214 +#define ACACIA_CONFIG0_ADDR 0x80000000
10215 +#define ACACIA_CONFIG1_ADDR 0x80000004
10216 +#define ACACIA_CONFIG2_ADDR 0x80000008
10217 +#define ACACIA_CONFIG3_ADDR 0x8000000C
10218 +#define ACACIA_CONFIG4_ADDR 0x80000010
10219 +#define ACACIA_CONFIG5_ADDR 0x80000014
10220 +#define ACACIA_CONFIG6_ADDR 0x80000018
10221 +#define ACACIA_CONFIG7_ADDR 0x8000001C
10222 +#define ACACIA_CONFIG8_ADDR 0x80000020
10223 +#define ACACIA_CONFIG9_ADDR 0x80000024
10224 +#define ACACIA_CONFIG10_ADDR 0x80000028
10225 +#define ACACIA_CONFIG11_ADDR 0x8000002C
10226 +#define ACACIA_CONFIG12_ADDR 0x80000030
10227 +#define ACACIA_CONFIG13_ADDR 0x80000034
10228 +#define ACACIA_CONFIG14_ADDR 0x80000038
10229 +#define ACACIA_CONFIG15_ADDR 0x8000003C
10230 +#define ACACIA_CONFIG16_ADDR 0x80000040
10231 +#define ACACIA_CONFIG17_ADDR 0x80000044
10232 +#define ACACIA_CONFIG18_ADDR 0x80000048
10233 +#define ACACIA_CONFIG19_ADDR 0x8000004C
10234 +#define ACACIA_CONFIG20_ADDR 0x80000050
10235 +#define ACACIA_CONFIG21_ADDR 0x80000054
10236 +#define ACACIA_CONFIG22_ADDR 0x80000058
10237 +#define ACACIA_CONFIG23_ADDR 0x8000005C
10238 +#define ACACIA_CONFIG24_ADDR 0x80000060
10239 +#define ACACIA_CONFIG25_ADDR 0x80000064
10240 +#define ACACIA_CMD (PCFG04_command_ioena_m | \
10241 + PCFG04_command_memena_m | \
10242 + PCFG04_command_bmena_m | \
10243 + PCFG04_command_mwinv_m | \
10244 + PCFG04_command_parena_m | \
10245 + PCFG04_command_serrena_m )
10247 +#define ACACIA_STAT (PCFG04_status_mdpe_m | \
10248 + PCFG04_status_sta_m | \
10249 + PCFG04_status_rta_m | \
10250 + PCFG04_status_rma_m | \
10251 + PCFG04_status_sse_m | \
10252 + PCFG04_status_pe_m)
10254 +#define ACACIA_CNFG1 ((ACACIA_STAT<<16)|ACACIA_CMD)
10256 +#define ACACIA_REVID 0
10257 +#define ACACIA_CLASS_CODE 0
10258 +#define ACACIA_CNFG2 ((ACACIA_CLASS_CODE<<8) | \
10261 +#define ACACIA_CACHE_LINE_SIZE 4
10262 +#define ACACIA_MASTER_LAT 0x3c
10263 +#define ACACIA_HEADER_TYPE 0
10264 +#define ACACIA_BIST 0
10266 +#define ACACIA_CNFG3 ((ACACIA_BIST << 24) | \
10267 + (ACACIA_HEADER_TYPE<<16) | \
10268 + (ACACIA_MASTER_LAT<<8) | \
10269 + ACACIA_CACHE_LINE_SIZE )
10271 +#define ACACIA_BAR0 0x00000008 /* 128 MB Memory */
10272 +#define ACACIA_BAR1 0x18800001 /* 1 MB IO */
10273 +#define ACACIA_BAR2 0x18000001 /* 2 MB IO window for Acacia
10274 + internal Registers */
10275 +#define ACACIA_BAR3 0x48000008 /* Spare 128 MB Memory */
10277 +#define ACACIA_CNFG4 ACACIA_BAR0
10278 +#define ACACIA_CNFG5 ACACIA_BAR1
10279 +#define ACACIA_CNFG6 ACACIA_BAR2
10280 +#define ACACIA_CNFG7 ACACIA_BAR3
10282 +#define ACACIA_SUBSYS_VENDOR_ID 0
10283 +#define ACACIA_SUBSYSTEM_ID 0
10284 +#define ACACIA_CNFG8 0
10285 +#define ACACIA_CNFG9 0
10286 +#define ACACIA_CNFG10 0
10287 +#define ACACIA_CNFG11 ((ACACIA_SUBSYS_VENDOR_ID<<16) | \
10288 + ACACIA_SUBSYSTEM_ID)
10289 +#define ACACIA_INT_LINE 1
10290 +#define ACACIA_INT_PIN 1
10291 +#define ACACIA_MIN_GNT 8
10292 +#define ACACIA_MAX_LAT 0x38
10293 +#define ACACIA_CNFG12 0
10294 +#define ACACIA_CNFG13 0
10295 +#define ACACIA_CNFG14 0
10296 +#define ACACIA_CNFG15 ((ACACIA_MAX_LAT<<24) | \
10297 + (ACACIA_MIN_GNT<<16) | \
10298 + (ACACIA_INT_PIN<<8) | \
10300 +#define ACACIA_RETRY_LIMIT 0x80
10301 +#define ACACIA_TRDY_LIMIT 0x80
10302 +#define ACACIA_CNFG16 ((ACACIA_RETRY_LIMIT<<8) | \
10303 + ACACIA_TRDY_LIMIT)
10304 +#define PCI_PBAxC_R 0x0
10305 +#define PCI_PBAxC_RL 0x1
10306 +#define PCI_PBAxC_RM 0x2
10307 +#define SIZE_SHFT 2
10309 +#define ACACIA_PBA0C ( PCIPBAC_mrl_m | PCIPBAC_sb_m | \
10310 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
10312 + (SIZE_128MB<<SIZE_SHFT) | \
10315 +#define ACACIA_CNFG17 ACACIA_PBA0C
10316 +#define ACACIA_PBA0M 0x0
10317 +#define ACACIA_CNFG18 ACACIA_PBA0M
10319 +#define ACACIA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
10322 +#define ACACIA_CNFG19 ACACIA_PBA1C
10323 +#define ACACIA_PBA1M 0x0
10324 +#define ACACIA_CNFG20 ACACIA_PBA1M
10326 +#define ACACIA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
10329 +#define ACACIA_CNFG21 ACACIA_PBA2C
10330 +#define ACACIA_PBA2M 0x18000000
10331 +#define ACACIA_CNFG22 ACACIA_PBA2M
10332 +#define ACACIA_PBA3C 0
10333 +#define ACACIA_CNFG23 ACACIA_PBA3C
10334 +#define ACACIA_PBA3M 0
10335 +#define ACACIA_CNFG24 ACACIA_PBA3M
10339 +#define PCITC_DTIMER_VAL 8
10340 +#define PCITC_RTIMER_VAL 0x10
10342 diff -Nur linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_timer.h linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_timer.h
10343 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_timer.h 1970-01-01 01:00:00.000000000 +0100
10344 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_timer.h 2006-01-10 00:32:33.000000000 +0100
10346 +/**************************************************************************
10348 + * BRIEF MODULE DESCRIPTION
10349 + * Timer register definition IDT RC32438 CPU.
10351 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10353 + * This program is free software; you can redistribute it and/or modify it
10354 + * under the terms of the GNU General Public License as published by the
10355 + * Free Software Foundation; either version 2 of the License, or (at your
10356 + * option) any later version.
10358 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10359 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10360 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10361 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10362 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10363 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10364 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10365 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10366 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10367 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10369 + * You should have received a copy of the GNU General Public License along
10370 + * with this program; if not, write to the Free Software Foundation, Inc.,
10371 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10374 + **************************************************************************
10375 + * May 2004 P. Sadik.
10377 + * Initial Release
10381 + **************************************************************************
10384 +#ifndef __IDT_RC32438_TIM_H__
10385 +#define __IDT_RC32438_TIM_H__
10389 + TIM0_PhysicalAddress = 0x18028000,
10390 + TIM_PhysicalAddress = TIM0_PhysicalAddress, // Default
10392 + TIM0_VirtualAddress = 0xb8028000,
10393 + TIM_VirtualAddress = TIM0_VirtualAddress, // Default
10405 + u32 ctc ; //use CTC_
10408 +typedef struct TIM_s
10410 + struct TIM_CNTR_s tim [TIM_Count] ;
10411 + u32 rcount ; //use RCOUNT_
10412 + u32 rcompare ; //use RCOMPARE_
10413 + u32 rtc ; //use RTC_
10414 +} volatile * TIM_t ;
10419 + CTC_en_m = 0x00000001,
10421 + CTC_to_m = 0x00000002,
10423 + RCOUNT_count_b = 0,
10424 + RCOUNT_count_m = 0x0000ffff,
10425 + RCOMPARE_compare_b = 0,
10426 + RCOMPARE_compare_m = 0x0000ffff,
10428 + RTC_ce_m = 0x00000001,
10430 + RTC_to_m = 0x00000002,
10432 + RTC_rqe_m = 0x00000004,
10435 +#endif //__IDT_RC32438_TIM_H__
10437 diff -Nur linux-2.6.15/include/asm-mips/mach-generic/irq.h linux-2.6.15-openwrt/include/asm-mips/mach-generic/irq.h
10438 --- linux-2.6.15/include/asm-mips/mach-generic/irq.h 2006-01-03 04:21:10.000000000 +0100
10439 +++ linux-2.6.15-openwrt/include/asm-mips/mach-generic/irq.h 2006-01-10 00:32:33.000000000 +0100
10441 #ifndef __ASM_MACH_GENERIC_IRQ_H
10442 #define __ASM_MACH_GENERIC_IRQ_H
10444 -#define NR_IRQS 128
10445 +#define NR_IRQS 256
10447 #endif /* __ASM_MACH_GENERIC_IRQ_H */
10448 diff -Nur linux-2.6.15/include/linux/init.h linux-2.6.15-openwrt/include/linux/init.h
10449 --- linux-2.6.15/include/linux/init.h 2006-01-03 04:21:10.000000000 +0100
10450 +++ linux-2.6.15-openwrt/include/linux/init.h 2006-01-10 00:32:33.000000000 +0100
10452 static initcall_t __initcall_##fn __attribute_used__ \
10453 __attribute__((__section__(".initcall" level ".init"))) = fn
10455 +#define early_initcall(fn) __define_initcall(".early1",fn)
10457 #define core_initcall(fn) __define_initcall("1",fn)
10458 #define postcore_initcall(fn) __define_initcall("2",fn)
10459 #define arch_initcall(fn) __define_initcall("3",fn)
10460 diff -Nur linux-2.6.15/include/linux/kernel.h linux-2.6.15-openwrt/include/linux/kernel.h
10461 --- linux-2.6.15/include/linux/kernel.h 2006-01-03 04:21:10.000000000 +0100
10462 +++ linux-2.6.15-openwrt/include/linux/kernel.h 2006-01-10 00:32:33.000000000 +0100
10463 @@ -307,6 +307,7 @@
10466 /* Force a compilation error if condition is true */
10467 +extern void BUILD_BUG(void);
10468 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
10470 #ifdef CONFIG_SYSCTL
10471 diff -Nur linux-2.6.15/Makefile linux-2.6.15-openwrt/Makefile
10472 --- linux-2.6.15/Makefile 2006-01-03 04:21:10.000000000 +0100
10473 +++ linux-2.6.15-openwrt/Makefile 2006-01-10 00:32:33.000000000 +0100
10474 @@ -166,10 +166,7 @@
10475 # then ARCH is assigned, getting whatever value it gets normally, and
10476 # SUBARCH is subsequently ignored.
10478 -SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
10479 - -e s/arm.*/arm/ -e s/sa110/arm/ \
10480 - -e s/s390x/s390/ -e s/parisc64/parisc/ \
10481 - -e s/ppc64/powerpc/ )
10484 # Cross compiling and selecting different set of gcc/bin-utils
10485 # ---------------------------------------------------------------------------
10486 diff -Nur linux-2.6.15/drivers/net/natsemi.c linux-2.6.15-openwrt/drivers/net/natsemi.c
10487 --- linux-2.6.15/drivers/net/natsemi.c 2006-01-02 19:21:10.000000000 -0800
10488 +++ linux-2.6.15-openwrt/drivers/net/natsemi.c 2006-01-10 07:29:49.581994000 -0800
10489 @@ -771,6 +771,49 @@
10490 static int netdev_get_eeprom(struct net_device *dev, u8 *buf);
10491 static struct ethtool_ops ethtool_ops;
10493 +#ifdef CONFIG_MACH_ARUBA
10495 +#include <linux/ctype.h>
10498 +#define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args)
10501 +static int parse_mac_addr(struct net_device *dev, char* macstr)
10504 + unsigned char result, value;
10506 + for (i=0; i<6; i++) {
10508 + if (i != 5 && *(macstr+2) != ':') {
10509 + ERR("invalid mac address format: %d %c\n",
10513 + for (j=0; j<2; j++) {
10514 + if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
10515 + toupper(*macstr)-'A'+10) < 16) {
10516 + result = result*16 + value;
10520 + ERR("invalid mac address "
10521 + "character: %c\n", *macstr);
10527 + dev->dev_addr[i] = result;
10530 + dev->dev_addr[5]++;
10536 static inline void __iomem *ns_ioaddr(struct net_device *dev)
10538 return (void __iomem *) dev->base_addr;
10539 @@ -859,6 +902,7 @@
10543 +#ifndef CONFIG_MACH_ARUBA
10544 /* Work around the dropped serial bit. */
10545 prev_eedata = eeprom_read(ioaddr, 6);
10546 for (i = 0; i < 3; i++) {
10547 @@ -867,6 +911,19 @@
10548 dev->dev_addr[i*2+1] = eedata >> 7;
10549 prev_eedata = eedata;
10554 + unsigned char def_mac[6] = {00, 0x0b, 0x86, 0xba, 0xdb, 0xad};
10555 + extern char *getenv(char *e);
10556 + memset(mac, 0, 32);
10557 + memcpy(mac, getenv("ethaddr"), 17);
10558 + if (parse_mac_addr(dev, mac)){
10559 + printk("%s: MAC address not found\n", __func__);
10560 + memcpy(dev->dev_addr, def_mac, 6);
10565 dev->base_addr = (unsigned long __force) ioaddr;
10567 diff -Nur linux-2.6.15/drivers/net/Makefile linux-2.6.15-openwrt/drivers/net/Makefile
10568 --- linux-2.6.15/drivers/net/Makefile 2006-01-13 09:19:55.000000000 -0800
10569 +++ linux-2.6.15-openwrt/drivers/net/Makefile 2006-01-09 20:44:10.378339000 -0800
10572 obj-$(CONFIG_OAKNET) += oaknet.o 8390.o
10574 +obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
10575 obj-$(CONFIG_DGRS) += dgrs.o
10576 obj-$(CONFIG_VORTEX) += 3c59x.o
10577 obj-$(CONFIG_TYPHOON) += typhoon.o
10578 @@ -190,7 +189,6 @@
10579 obj-$(CONFIG_SMC91X) += smc91x.o
10580 obj-$(CONFIG_DM9000) += dm9000.o
10581 obj-$(CONFIG_FEC_8XX) += fec_8xx/
10582 -obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
10584 obj-$(CONFIG_ARM) += arm/
10585 obj-$(CONFIG_DEV_APPLETALK) += appletalk/