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,17 @@
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
1067 + select CPU_HAS_PREFETCH
1069 + select SWAP_IO_SPACE
1070 + select SYS_SUPPORTS_32BIT_KERNEL
1071 + select SYS_HAS_CPU_MIPS32_R1
1072 + select SYS_SUPPORTS_BIG_ENDIAN
1076 bool "Support for the Jazz family of machines"
1078 diff -Nur linux-2.6.15/arch/mips/Makefile linux-2.6.15-openwrt/arch/mips/Makefile
1079 --- linux-2.6.15/arch/mips/Makefile 2006-01-03 04:21:10.000000000 +0100
1080 +++ linux-2.6.15-openwrt/arch/mips/Makefile 2006-01-10 00:32:32.000000000 +0100
1081 @@ -258,6 +258,14 @@
1088 +core-$(CONFIG_MACH_ARUBA) += arch/mips/aruba/
1089 +cflags-$(CONFIG_MACH_ARUBA) += -Iinclude/asm-mips/aruba
1090 +load-$(CONFIG_MACH_ARUBA) += 0x80100000
1093 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
1095 core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
1096 diff -Nur linux-2.6.15/arch/mips/mm/tlbex.c linux-2.6.15-openwrt/arch/mips/mm/tlbex.c
1097 --- linux-2.6.15/arch/mips/mm/tlbex.c 2006-01-03 04:21:10.000000000 +0100
1098 +++ linux-2.6.15-openwrt/arch/mips/mm/tlbex.c 2006-01-10 00:32:32.000000000 +0100
1115 diff -Nur linux-2.6.15/drivers/net/Kconfig linux-2.6.15-openwrt/drivers/net/Kconfig
1116 --- linux-2.6.15/drivers/net/Kconfig 2006-01-03 04:21:10.000000000 +0100
1117 +++ linux-2.6.15-openwrt/drivers/net/Kconfig 2006-01-10 00:32:32.000000000 +0100
1118 @@ -176,6 +176,13 @@
1120 source "drivers/net/arm/Kconfig"
1122 +config IDT_RC32434_ETH
1123 + tristate "IDT RC32434 Local Ethernet support"
1124 + depends on NET_ETHERNET
1126 + IDT RC32434 has one local ethernet port. Say Y here to enable it.
1127 + To compile this driver as a module, choose M here.
1130 tristate "MACE (Power Mac ethernet) support"
1131 depends on NET_ETHERNET && PPC_PMAC && PPC32
1132 diff -Nur linux-2.6.15/drivers/net/Makefile linux-2.6.15-openwrt/drivers/net/Makefile
1133 --- linux-2.6.15/drivers/net/Makefile 2006-01-03 04:21:10.000000000 +0100
1134 +++ linux-2.6.15-openwrt/drivers/net/Makefile 2006-01-10 00:32:33.000000000 +0100
1136 obj-$(CONFIG_SMC91X) += smc91x.o
1137 obj-$(CONFIG_DM9000) += dm9000.o
1138 obj-$(CONFIG_FEC_8XX) += fec_8xx/
1139 +obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
1141 obj-$(CONFIG_ARM) += arm/
1142 obj-$(CONFIG_DEV_APPLETALK) += appletalk/
1143 diff -Nur linux-2.6.15/drivers/net/rc32434_eth.c linux-2.6.15-openwrt/drivers/net/rc32434_eth.c
1144 --- linux-2.6.15/drivers/net/rc32434_eth.c 1970-01-01 01:00:00.000000000 +0100
1145 +++ linux-2.6.15-openwrt/drivers/net/rc32434_eth.c 2006-01-10 00:32:33.000000000 +0100
1147 +/**************************************************************************
1149 + * BRIEF MODULE DESCRIPTION
1150 + * Driver for the IDT RC32434 on-chip ethernet controller.
1152 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
1154 + * This program is free software; you can redistribute it and/or modify it
1155 + * under the terms of the GNU General Public License as published by the
1156 + * Free Software Foundation; either version 2 of the License, or (at your
1157 + * option) any later version.
1159 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1160 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1161 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1162 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1163 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1164 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1165 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1166 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1167 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1168 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1170 + * You should have received a copy of the GNU General Public License along
1171 + * with this program; if not, write to the Free Software Foundation, Inc.,
1172 + * 675 Mass Ave, Cambridge, MA 02139, USA.
1175 + **************************************************************************
1176 + * May 2004 rkt, neb
1178 + * Based on the driver developed by B. Maruthanayakam, H. Kou and others.
1184 + **************************************************************************
1187 +#include <linux/config.h>
1188 +#include <linux/module.h>
1189 +#include <linux/kernel.h>
1190 +#include <linux/moduleparam.h>
1191 +#include <linux/sched.h>
1192 +#include <linux/ctype.h>
1193 +#include <linux/types.h>
1194 +#include <linux/fcntl.h>
1195 +#include <linux/interrupt.h>
1196 +#include <linux/ptrace.h>
1197 +#include <linux/init.h>
1198 +#include <linux/ioport.h>
1199 +#include <linux/proc_fs.h>
1200 +#include <linux/in.h>
1201 +#include <linux/slab.h>
1202 +#include <linux/string.h>
1203 +#include <linux/delay.h>
1204 +#include <linux/netdevice.h>
1205 +#include <linux/etherdevice.h>
1206 +#include <linux/skbuff.h>
1207 +#include <linux/errno.h>
1208 +#include <asm/bootinfo.h>
1209 +#include <asm/system.h>
1210 +#include <asm/bitops.h>
1211 +#include <asm/pgtable.h>
1212 +#include <asm/segment.h>
1213 +#include <asm/io.h>
1214 +#include <asm/dma.h>
1216 +#include "rc32434_eth.h"
1218 +#define DRIVER_VERSION "(mar2904)"
1220 +#define DRIVER_NAME "rc32434 Ethernet driver. " DRIVER_VERSION
1223 +#define STATION_ADDRESS_HIGH(dev) (((dev)->dev_addr[0] << 8) | \
1224 + ((dev)->dev_addr[1]))
1225 +#define STATION_ADDRESS_LOW(dev) (((dev)->dev_addr[2] << 24) | \
1226 + ((dev)->dev_addr[3] << 16) | \
1227 + ((dev)->dev_addr[4] << 8) | \
1228 + ((dev)->dev_addr[5]))
1230 +#define MII_CLOCK 1250000 /* no more than 2.5MHz */
1231 +static char mac0[18] = "08:00:06:05:40:01";
1233 +MODULE_PARM(mac0, "c18");
1234 +MODULE_PARM_DESC(mac0, "MAC address for RC32434 ethernet0");
1236 +static struct rc32434_if_t {
1238 + struct net_device *dev;
1248 +} rc32434_iflist[] =
1251 + "rc32434_eth0", NULL, mac0,
1253 + ETH0_PhysicalAddress,
1264 +static int parse_mac_addr(struct net_device *dev, char* macstr)
1267 + unsigned char result, value;
1269 + for (i=0; i<6; i++) {
1271 + if (i != 5 && *(macstr+2) != ':') {
1272 + ERR("invalid mac address format: %d %c\n",
1276 + for (j=0; j<2; j++) {
1277 + if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
1278 + toupper(*macstr)-'A'+10) < 16) {
1279 + result = result*16 + value;
1283 + ERR("invalid mac address "
1284 + "character: %c\n", *macstr);
1290 + dev->dev_addr[i] = result;
1298 +static inline void rc32434_abort_tx(struct net_device *dev)
1300 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1301 + rc32434_abort_dma(dev, lp->tx_dma_regs);
1305 +static inline void rc32434_abort_rx(struct net_device *dev)
1307 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1308 + rc32434_abort_dma(dev, lp->rx_dma_regs);
1312 +static inline void rc32434_start_tx(struct rc32434_local *lp, volatile DMAD_t td)
1314 + rc32434_start_dma(lp->tx_dma_regs, CPHYSADDR(td));
1317 +static inline void rc32434_start_rx(struct rc32434_local *lp, volatile DMAD_t rd)
1319 + rc32434_start_dma(lp->rx_dma_regs, CPHYSADDR(rd));
1322 +static inline void rc32434_chain_tx(struct rc32434_local *lp, volatile DMAD_t td)
1324 + rc32434_chain_dma(lp->tx_dma_regs, CPHYSADDR(td));
1327 +static inline void rc32434_chain_rx(struct rc32434_local *lp, volatile DMAD_t rd)
1329 + rc32434_chain_dma(lp->rx_dma_regs, CPHYSADDR(rd));
1332 +#ifdef RC32434_PROC_DEBUG
1333 +static int rc32434_read_proc(char *buf, char **start, off_t fpos,
1334 + int length, int *eof, void *data)
1336 + struct net_device *dev = (struct net_device *)data;
1337 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1340 + /* print out header */
1341 + len += sprintf(buf + len, "\n\tRC32434 Ethernet Debug\n\n");
1342 + len += sprintf (buf + len,
1343 + "DMA halt count = %10d, DMA run count = %10d\n",
1344 + lp->dma_halt_cnt, lp->dma_run_cnt);
1346 + if (fpos >= len) {
1351 + *start = buf + fpos;
1353 + if ((len -= fpos) > length)
1364 + * Restart the RC32434 ethernet controller.
1366 +static int rc32434_restart(struct net_device *dev)
1368 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1371 + * Disable interrupts
1373 + disable_irq(lp->rx_irq);
1374 + disable_irq(lp->tx_irq);
1375 +#ifdef RC32434_REVISION
1376 + disable_irq(lp->ovr_irq);
1378 + disable_irq(lp->und_irq);
1380 + /* Mask F E bit in Tx DMA */
1381 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) | DMASM_f_m | DMASM_e_m, &lp->tx_dma_regs->dmasm);
1382 + /* Mask D H E bit in Rx DMA */
1383 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) | DMASM_d_m | DMASM_h_m | DMASM_e_m, &lp->rx_dma_regs->dmasm);
1385 + rc32434_init(dev);
1386 + rc32434_multicast_list(dev);
1388 + enable_irq(lp->und_irq);
1389 +#ifdef RC32434_REVISION
1390 + enable_irq(lp->ovr_irq);
1392 + enable_irq(lp->tx_irq);
1393 + enable_irq(lp->rx_irq);
1398 +int rc32434_init_module(void)
1400 +#ifdef CONFIG_MACH_ARUBA
1401 + if (mips_machtype != MACH_ARUBA_AP70)
1405 + printk(KERN_INFO DRIVER_NAME " \n");
1406 + return rc32434_probe(0);
1409 +static int rc32434_probe(int port_num)
1411 + struct rc32434_if_t *bif = &rc32434_iflist[port_num];
1412 + struct rc32434_local *lp = NULL;
1413 + struct net_device *dev = NULL;
1414 + int i, retval,err;
1416 + dev = alloc_etherdev(sizeof(struct rc32434_local));
1418 + ERR("rc32434_eth: alloc_etherdev failed\n");
1422 + SET_MODULE_OWNER(dev);
1425 +#ifdef CONFIG_MACH_ARUBA
1427 + extern char * getenv(char *e);
1428 + memcpy(bif->mac_str, getenv("ethaddr"), 17);
1432 + printk("mac: %s\n", bif->mac_str);
1433 + if ((retval = parse_mac_addr(dev, bif->mac_str))) {
1434 + ERR("MAC address parse failed\n");
1440 + /* Initialize the device structure. */
1441 + if (dev->priv == NULL) {
1442 + lp = (struct rc32434_local *)kmalloc(sizeof(*lp), GFP_KERNEL);
1443 + memset(lp, 0, sizeof(struct rc32434_local));
1446 + lp = (struct rc32434_local *)dev->priv;
1449 + lp->rx_irq = bif->rx_dma_irq;
1450 + lp->tx_irq = bif->tx_dma_irq;
1451 + lp->ovr_irq = bif->rx_ovr_irq;
1452 + lp->und_irq = bif->tx_und_irq;
1454 + lp->eth_regs = ioremap_nocache(bif->iobase, sizeof(*lp->eth_regs));
1456 + if (!lp->eth_regs) {
1457 + ERR("Can't remap eth registers\n");
1459 + goto probe_err_out;
1462 + lp->rx_dma_regs = ioremap_nocache(bif->rxdmabase, sizeof(struct DMA_Chan_s));
1464 + if (!lp->rx_dma_regs) {
1465 + ERR("Can't remap Rx DMA registers\n");
1467 + goto probe_err_out;
1469 + lp->tx_dma_regs = ioremap_nocache(bif->txdmabase,sizeof(struct DMA_Chan_s));
1471 + if (!lp->tx_dma_regs) {
1472 + ERR("Can't remap Tx DMA registers\n");
1474 + goto probe_err_out;
1477 +#ifdef RC32434_PROC_DEBUG
1478 + lp->ps = create_proc_read_entry (bif->name, 0, proc_net,
1479 + rc32434_read_proc, dev);
1482 + lp->td_ring = (DMAD_t)kmalloc(TD_RING_SIZE + RD_RING_SIZE, GFP_KERNEL);
1483 + if (!lp->td_ring) {
1484 + ERR("Can't allocate descriptors\n");
1486 + goto probe_err_out;
1489 + dma_cache_inv((unsigned long)(lp->td_ring), TD_RING_SIZE + RD_RING_SIZE);
1491 + /* now convert TD_RING pointer to KSEG1 */
1492 + lp->td_ring = (DMAD_t )KSEG1ADDR(lp->td_ring);
1493 + lp->rd_ring = &lp->td_ring[RC32434_NUM_TDS];
1496 + spin_lock_init(&lp->lock);
1498 + dev->base_addr = bif->iobase;
1499 + /* just use the rx dma irq */
1500 + dev->irq = bif->rx_dma_irq;
1504 + dev->open = rc32434_open;
1505 + dev->stop = rc32434_close;
1506 + dev->hard_start_xmit = rc32434_send_packet;
1507 + dev->get_stats = rc32434_get_stats;
1508 + dev->set_multicast_list = &rc32434_multicast_list;
1509 + dev->tx_timeout = rc32434_tx_timeout;
1510 + dev->watchdog_timeo = RC32434_TX_TIMEOUT;
1512 +#ifdef CONFIG_IDT_USE_NAPI
1513 + dev->poll = rc32434_poll;
1514 + dev->weight = bif->weight;
1515 + printk("Using NAPI with weight %d\n",dev->weight);
1517 + lp->rx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
1518 + tasklet_init(lp->rx_tasklet, rc32434_rx_tasklet, (unsigned long)dev);
1520 + lp->tx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
1521 + tasklet_init(lp->tx_tasklet, rc32434_tx_tasklet, (unsigned long)dev);
1523 + if ((err = register_netdev(dev))) {
1524 + printk(KERN_ERR "rc32434 ethernet. Cannot register net device %d\n", err);
1527 + goto probe_err_out;
1530 + INFO("Rx IRQ %d, Tx IRQ %d, ", bif->rx_dma_irq, bif->tx_dma_irq);
1531 + for (i = 0; i < 6; i++) {
1532 + printk("%2.2x", dev->dev_addr[i]);
1541 + rc32434_cleanup_module();
1542 + ERR(" failed. Returns %d\n", retval);
1548 +static void rc32434_cleanup_module(void)
1552 + for (i = 0; rc32434_iflist[i].iobase; i++) {
1553 + struct rc32434_if_t * bif = &rc32434_iflist[i];
1554 + if (bif->dev != NULL) {
1555 + struct rc32434_local *lp = (struct rc32434_local *)bif->dev->priv;
1558 + iounmap((void*)lp->eth_regs);
1559 + if (lp->rx_dma_regs)
1560 + iounmap((void*)lp->rx_dma_regs);
1561 + if (lp->tx_dma_regs)
1562 + iounmap((void*)lp->tx_dma_regs);
1564 + kfree((void*)KSEG0ADDR(lp->td_ring));
1566 +#ifdef RC32434_PROC_DEBUG
1568 + remove_proc_entry(bif->name, proc_net);
1574 + unregister_netdev(bif->dev);
1575 + free_netdev(bif->dev);
1583 +static int rc32434_open(struct net_device *dev)
1585 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1588 + if (rc32434_init(dev)) {
1589 + ERR("Error: cannot open the Ethernet device\n");
1593 + /* Install the interrupt handler that handles the Done Finished Ovr and Und Events */
1594 + if (request_irq(lp->rx_irq, &rc32434_rx_dma_interrupt,
1595 + SA_SHIRQ | SA_INTERRUPT,
1596 + "rc32434 ethernet Rx", dev)) {
1597 + ERR(": unable to get Rx DMA IRQ %d\n",
1601 + if (request_irq(lp->tx_irq, &rc32434_tx_dma_interrupt,
1602 + SA_SHIRQ | SA_INTERRUPT,
1603 + "rc32434 ethernet Tx", dev)) {
1604 + ERR(": unable to get Tx DMA IRQ %d\n",
1606 + free_irq(lp->rx_irq, dev);
1610 +#ifdef RC32434_REVISION
1611 + /* Install handler for overrun error. */
1612 + if (request_irq(lp->ovr_irq, &rc32434_ovr_interrupt,
1613 + SA_SHIRQ | SA_INTERRUPT,
1614 + "Ethernet Overflow", dev)) {
1615 + ERR(": unable to get OVR IRQ %d\n",
1617 + free_irq(lp->rx_irq, dev);
1618 + free_irq(lp->tx_irq, dev);
1623 + /* Install handler for underflow error. */
1624 + if (request_irq(lp->und_irq, &rc32434_und_interrupt,
1625 + SA_SHIRQ | SA_INTERRUPT,
1626 + "Ethernet Underflow", dev)) {
1627 + ERR(": unable to get UND IRQ %d\n",
1629 + free_irq(lp->rx_irq, dev);
1630 + free_irq(lp->tx_irq, dev);
1631 +#ifdef RC32434_REVISION
1632 + free_irq(lp->ovr_irq, dev);
1644 +static int rc32434_close(struct net_device *dev)
1646 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1649 + /* Disable interrupts */
1650 + disable_irq(lp->rx_irq);
1651 + disable_irq(lp->tx_irq);
1652 +#ifdef RC32434_REVISION
1653 + disable_irq(lp->ovr_irq);
1655 + disable_irq(lp->und_irq);
1657 + tmp = rc32434_readl(&lp->tx_dma_regs->dmasm);
1658 + tmp = tmp | DMASM_f_m | DMASM_e_m;
1659 + rc32434_writel(tmp, &lp->tx_dma_regs->dmasm);
1661 + tmp = rc32434_readl(&lp->rx_dma_regs->dmasm);
1662 + tmp = tmp | DMASM_d_m | DMASM_h_m | DMASM_e_m;
1663 + rc32434_writel(tmp, &lp->rx_dma_regs->dmasm);
1665 + free_irq(lp->rx_irq, dev);
1666 + free_irq(lp->tx_irq, dev);
1667 +#ifdef RC32434_REVISION
1668 + free_irq(lp->ovr_irq, dev);
1670 + free_irq(lp->und_irq, dev);
1675 +/* transmit packet */
1676 +static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev)
1678 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1679 + unsigned long flags;
1684 + spin_lock_irqsave(&lp->lock, flags);
1686 + td = &lp->td_ring[lp->tx_chain_tail];
1688 + /* stop queue when full, drop pkts if queue already full */
1689 + if(lp->tx_count >= (RC32434_NUM_TDS - 2)) {
1692 + if(lp->tx_count == (RC32434_NUM_TDS - 2)) {
1693 + netif_stop_queue(dev);
1696 + lp->stats.tx_dropped++;
1697 + dev_kfree_skb_any(skb);
1698 + spin_unlock_irqrestore(&lp->lock, flags);
1705 + lp->tx_skb[lp->tx_chain_tail] = skb;
1707 + length = skb->len;
1709 + /* Setup the transmit descriptor. */
1710 + td->ca = CPHYSADDR(skb->data);
1712 + if(rc32434_readl(&(lp->tx_dma_regs->dmandptr)) == 0) {
1713 + if( lp->tx_chain_status == empty ) {
1714 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1715 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1716 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR */
1717 + lp->tx_chain_head = lp->tx_chain_tail; /* Move head to tail */
1720 + td->control = DMA_COUNT(length) |DMAD_cof_m|DMAD_iof_m; /* Update tail */
1721 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &= ~(DMAD_cof_m); /* Link to prev */
1722 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link = CPHYSADDR(td); /* Link to prev */
1723 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1724 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR */
1725 + lp->tx_chain_head = lp->tx_chain_tail; /* Move head to tail */
1726 + lp->tx_chain_status = empty;
1730 + if( lp->tx_chain_status == empty ) {
1731 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1732 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1733 + lp->tx_chain_status = filled;
1736 + td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m; /* Update tail */
1737 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &= ~(DMAD_cof_m); /* Link to prev */
1738 + lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link = CPHYSADDR(td); /* Link to prev */
1739 + lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK; /* Move tail */
1743 + dev->trans_start = jiffies;
1745 + spin_unlock_irqrestore(&lp->lock, flags);
1751 +/* Ethernet MII-PHY Handler */
1752 +static void rc32434_mii_handler(unsigned long data)
1754 + struct net_device *dev = (struct net_device *)data;
1755 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
1756 + unsigned long flags;
1757 + unsigned long duplex_status;
1758 + int port_addr = (lp->rx_irq == 0x2c? 1:0) << 8;
1760 + spin_lock_irqsave(&lp->lock, flags);
1762 + /* Two ports are using the same MII, the difference is the PHY address */
1763 + rc32434_writel(0, &rc32434_eth0_regs->miimcfg);
1764 + rc32434_writel(0, &rc32434_eth0_regs->miimcmd);
1765 + rc32434_writel(port_addr |0x05, &rc32434_eth0_regs->miimaddr);
1766 + rc32434_writel(MIIMCMD_scn_m, &rc32434_eth0_regs->miimcmd);
1767 + while(rc32434_readl(&rc32434_eth0_regs->miimind) & MIIMIND_nv_m);
1769 + ERR("irq:%x port_addr:%x RDD:%x\n",
1770 + lp->rx_irq, port_addr, rc32434_readl(&rc32434_eth0_regs->miimrdd));
1771 + duplex_status = (rc32434_readl(&rc32434_eth0_regs->miimrdd) & 0x140)? ETHMAC2_fd_m: 0;
1772 + if(duplex_status != lp->duplex_mode) {
1773 + 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);
1774 + lp->duplex_mode = duplex_status;
1775 + rc32434_restart(dev);
1778 + lp->mii_phy_timer.expires = jiffies + 10 * HZ;
1779 + add_timer(&lp->mii_phy_timer);
1781 + spin_unlock_irqrestore(&lp->lock, flags);
1785 +#ifdef RC32434_REVISION
1786 +/* Ethernet Rx Overflow interrupt */
1788 +rc32434_ovr_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1790 + struct net_device *dev = (struct net_device *)dev_id;
1791 + struct rc32434_local *lp;
1793 + irqreturn_t retval = IRQ_NONE;
1795 + ASSERT(dev != NULL);
1797 + lp = (struct rc32434_local *)dev->priv;
1798 + spin_lock(&lp->lock);
1799 + ovr = rc32434_readl(&lp->eth_regs->ethintfc);
1801 + if(ovr & ETHINTFC_ovr_m) {
1802 + netif_stop_queue(dev);
1804 + /* clear OVR bit */
1805 + rc32434_writel((ovr & ~ETHINTFC_ovr_m), &lp->eth_regs->ethintfc);
1807 + /* Restart interface */
1808 + rc32434_restart(dev);
1809 + retval = IRQ_HANDLED;
1811 + spin_unlock(&lp->lock);
1819 +/* Ethernet Tx Underflow interrupt */
1821 +rc32434_und_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1823 + struct net_device *dev = (struct net_device *)dev_id;
1824 + struct rc32434_local *lp;
1826 + irqreturn_t retval = IRQ_NONE;
1828 + ASSERT(dev != NULL);
1830 + lp = (struct rc32434_local *)dev->priv;
1832 + spin_lock(&lp->lock);
1834 + und = rc32434_readl(&lp->eth_regs->ethintfc);
1836 + if(und & ETHINTFC_und_m) {
1837 + netif_stop_queue(dev);
1839 + rc32434_writel((und & ~ETHINTFC_und_m), &lp->eth_regs->ethintfc);
1841 + /* Restart interface */
1842 + rc32434_restart(dev);
1843 + retval = IRQ_HANDLED;
1846 + spin_unlock(&lp->lock);
1852 +/* Ethernet Rx DMA interrupt */
1854 +rc32434_rx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1856 + struct net_device *dev = (struct net_device *)dev_id;
1857 + struct rc32434_local* lp;
1858 + volatile u32 dmas,dmasm;
1859 + irqreturn_t retval;
1861 + ASSERT(dev != NULL);
1863 + lp = (struct rc32434_local *)dev->priv;
1865 + spin_lock(&lp->lock);
1866 + dmas = rc32434_readl(&lp->rx_dma_regs->dmas);
1867 + if(dmas & (DMAS_d_m|DMAS_h_m|DMAS_e_m)) {
1868 + /* Mask D H E bit in Rx DMA */
1869 + dmasm = rc32434_readl(&lp->rx_dma_regs->dmasm);
1870 + rc32434_writel(dmasm | (DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm);
1871 +#ifdef CONFIG_IDT_USE_NAPI
1872 + if(netif_rx_schedule_prep(dev))
1873 + __netif_rx_schedule(dev);
1875 + tasklet_hi_schedule(lp->rx_tasklet);
1878 + if (dmas & DMAS_e_m)
1879 + ERR(": DMA error\n");
1881 + retval = IRQ_HANDLED;
1884 + retval = IRQ_NONE;
1886 + spin_unlock(&lp->lock);
1890 +#ifdef CONFIG_IDT_USE_NAPI
1891 +static int rc32434_poll(struct net_device *rx_data_dev, int *budget)
1893 +static void rc32434_rx_tasklet(unsigned long rx_data_dev)
1896 + struct net_device *dev = (struct net_device *)rx_data_dev;
1897 + struct rc32434_local* lp = netdev_priv(dev);
1898 + volatile DMAD_t rd = &lp->rd_ring[lp->rx_next_done];
1899 + struct sk_buff *skb, *skb_new;
1901 + u32 devcs, count, pkt_len, pktuncrc_len;
1902 + volatile u32 dmas;
1903 +#ifdef CONFIG_IDT_USE_NAPI
1905 + int rx_work_limit = min(*budget,dev->quota);
1907 + unsigned long flags;
1908 + spin_lock_irqsave(&lp->lock, flags);
1911 + while ( (count = RC32434_RBSIZE - (u32)DMA_COUNT(rd->control)) != 0) {
1912 +#ifdef CONFIG_IDT_USE_NAPI
1913 + if(--rx_work_limit <0)
1918 + /* init the var. used for the later operations within the while loop */
1920 + devcs = rd->devcs;
1921 + pkt_len = RCVPKT_LENGTH(devcs);
1922 + skb = lp->rx_skb[lp->rx_next_done];
1925 + lp->stats.rx_errors++;
1926 + lp->stats.rx_dropped++;
1928 + else if ((devcs & ( ETHRX_ld_m)) != ETHRX_ld_m) {
1929 + /* check that this is a whole packet */
1930 + /* WARNING: DMA_FD bit incorrectly set in Rc32434 (errata ref #077) */
1931 + lp->stats.rx_errors++;
1932 + lp->stats.rx_dropped++;
1934 + else if ( (devcs & ETHRX_rok_m) ) {
1937 + /* must be the (first and) last descriptor then */
1938 + pkt_buf = (u8*)lp->rx_skb[lp->rx_next_done]->data;
1940 + pktuncrc_len = pkt_len - 4;
1941 + /* invalidate the cache */
1942 + dma_cache_inv((unsigned long)pkt_buf, pktuncrc_len);
1944 + /* Malloc up new buffer. */
1945 + skb_new = dev_alloc_skb(RC32434_RBSIZE + 2);
1947 + if (skb_new != NULL){
1949 + skb_put(skb, pktuncrc_len);
1951 + skb->protocol = eth_type_trans(skb, dev);
1953 + /* pass the packet to upper layers */
1954 +#ifdef CONFIG_IDT_USE_NAPI
1955 + netif_receive_skb(skb);
1960 + dev->last_rx = jiffies;
1961 + lp->stats.rx_packets++;
1962 + lp->stats.rx_bytes += pktuncrc_len;
1964 + if (IS_RCV_MP(devcs))
1965 + lp->stats.multicast++;
1967 + /* 16 bit align */
1968 + skb_reserve(skb_new, 2);
1970 + skb_new->dev = dev;
1971 + lp->rx_skb[lp->rx_next_done] = skb_new;
1974 + ERR("no memory, dropping rx packet.\n");
1975 + lp->stats.rx_errors++;
1976 + lp->stats.rx_dropped++;
1982 + /* This should only happen if we enable accepting broken packets */
1983 + lp->stats.rx_errors++;
1984 + lp->stats.rx_dropped++;
1986 + /* add statistics counters */
1987 + if (IS_RCV_CRC_ERR(devcs)) {
1988 + DBG(2, "RX CRC error\n");
1989 + lp->stats.rx_crc_errors++;
1991 + else if (IS_RCV_LOR_ERR(devcs)) {
1992 + DBG(2, "RX LOR error\n");
1993 + lp->stats.rx_length_errors++;
1995 + else if (IS_RCV_LE_ERR(devcs)) {
1996 + DBG(2, "RX LE error\n");
1997 + lp->stats.rx_length_errors++;
1999 + else if (IS_RCV_OVR_ERR(devcs)) {
2000 + lp->stats.rx_over_errors++;
2002 + else if (IS_RCV_CV_ERR(devcs)) {
2003 + /* code violation */
2004 + DBG(2, "RX CV error\n");
2005 + lp->stats.rx_frame_errors++;
2007 + else if (IS_RCV_CES_ERR(devcs)) {
2008 + DBG(2, "RX Preamble error\n");
2014 + /* restore descriptor's curr_addr */
2016 + rd->ca = CPHYSADDR(skb_new->data);
2018 + rd->ca = CPHYSADDR(skb->data);
2020 + rd->control = DMA_COUNT(RC32434_RBSIZE) |DMAD_cod_m |DMAD_iod_m;
2021 + lp->rd_ring[(lp->rx_next_done-1)& RC32434_RDS_MASK].control &= ~(DMAD_cod_m);
2023 + lp->rx_next_done = (lp->rx_next_done + 1) & RC32434_RDS_MASK;
2024 + rd = &lp->rd_ring[lp->rx_next_done];
2025 + rc32434_writel( ~DMAS_d_m, &lp->rx_dma_regs->dmas);
2027 +#ifdef CONFIG_IDT_USE_NAPI
2028 + dev->quota -= received;
2029 + *budget =- received;
2030 + if(rx_work_limit < 0)
2034 + dmas = rc32434_readl(&lp->rx_dma_regs->dmas);
2036 + if(dmas & DMAS_h_m) {
2037 + rc32434_writel( ~(DMAS_h_m | DMAS_e_m), &lp->rx_dma_regs->dmas);
2038 +#ifdef RC32434_PROC_DEBUG
2039 + lp->dma_halt_cnt++;
2042 + skb = lp->rx_skb[lp->rx_next_done];
2043 + rd->ca = CPHYSADDR(skb->data);
2044 + rc32434_chain_rx(lp,rd);
2047 +#ifdef CONFIG_IDT_USE_NAPI
2048 + netif_rx_complete(dev);
2050 + /* Enable D H E bit in Rx DMA */
2051 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m |DMASM_e_m), &lp->rx_dma_regs->dmasm);
2052 +#ifdef CONFIG_IDT_USE_NAPI
2057 + spin_unlock_irqrestore(&lp->lock, flags);
2066 +/* Ethernet Tx DMA interrupt */
2068 +rc32434_tx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs)
2070 + struct net_device *dev = (struct net_device *)dev_id;
2071 + struct rc32434_local *lp;
2072 + volatile u32 dmas,dmasm;
2073 + irqreturn_t retval;
2075 + ASSERT(dev != NULL);
2077 + lp = (struct rc32434_local *)dev->priv;
2079 + spin_lock(&lp->lock);
2081 + dmas = rc32434_readl(&lp->tx_dma_regs->dmas);
2083 + if (dmas & (DMAS_f_m | DMAS_e_m)) {
2084 + dmasm = rc32434_readl(&lp->tx_dma_regs->dmasm);
2085 + /* Mask F E bit in Tx DMA */
2086 + rc32434_writel(dmasm | (DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2088 + tasklet_hi_schedule(lp->tx_tasklet);
2090 + if(lp->tx_chain_status == filled && (rc32434_readl(&(lp->tx_dma_regs->dmandptr)) == 0)) {
2091 + rc32434_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr));
2092 + lp->tx_chain_status = empty;
2093 + lp->tx_chain_head = lp->tx_chain_tail;
2094 + dev->trans_start = jiffies;
2097 + if (dmas & DMAS_e_m)
2098 + ERR(": DMA error\n");
2100 + retval = IRQ_HANDLED;
2103 + retval = IRQ_NONE;
2105 + spin_unlock(&lp->lock);
2111 +static void rc32434_tx_tasklet(unsigned long tx_data_dev)
2113 + struct net_device *dev = (struct net_device *)tx_data_dev;
2114 + struct rc32434_local* lp = (struct rc32434_local *)dev->priv;
2115 + volatile DMAD_t td = &lp->td_ring[lp->tx_next_done];
2117 + unsigned long flags;
2118 + volatile u32 dmas;
2120 + spin_lock_irqsave(&lp->lock, flags);
2122 + /* process all desc that are done */
2123 + while(IS_DMA_FINISHED(td->control)) {
2124 + if(lp->tx_full == 1) {
2125 + netif_wake_queue(dev);
2129 + devcs = lp->td_ring[lp->tx_next_done].devcs;
2130 + if ((devcs & (ETHTX_fd_m | ETHTX_ld_m)) != (ETHTX_fd_m | ETHTX_ld_m)) {
2131 + lp->stats.tx_errors++;
2132 + lp->stats.tx_dropped++;
2134 + /* should never happen */
2135 + DBG(1, __FUNCTION__ ": split tx ignored\n");
2137 + else if (IS_TX_TOK(devcs)) {
2138 + lp->stats.tx_packets++;
2141 + lp->stats.tx_errors++;
2142 + lp->stats.tx_dropped++;
2145 + if (IS_TX_UND_ERR(devcs))
2146 + lp->stats.tx_fifo_errors++;
2148 + /* oversized frame */
2149 + if (IS_TX_OF_ERR(devcs))
2150 + lp->stats.tx_aborted_errors++;
2152 + /* excessive deferrals */
2153 + if (IS_TX_ED_ERR(devcs))
2154 + lp->stats.tx_carrier_errors++;
2156 + /* collisions: medium busy */
2157 + if (IS_TX_EC_ERR(devcs))
2158 + lp->stats.collisions++;
2160 + /* late collision */
2161 + if (IS_TX_LC_ERR(devcs))
2162 + lp->stats.tx_window_errors++;
2166 + /* We must always free the original skb */
2167 + if (lp->tx_skb[lp->tx_next_done] != NULL) {
2168 + dev_kfree_skb_any(lp->tx_skb[lp->tx_next_done]);
2169 + lp->tx_skb[lp->tx_next_done] = NULL;
2172 + lp->td_ring[lp->tx_next_done].control = DMAD_iof_m;
2173 + lp->td_ring[lp->tx_next_done].devcs = ETHTX_fd_m | ETHTX_ld_m;
2174 + lp->td_ring[lp->tx_next_done].link = 0;
2175 + lp->td_ring[lp->tx_next_done].ca = 0;
2178 + /* go on to next transmission */
2179 + lp->tx_next_done = (lp->tx_next_done + 1) & RC32434_TDS_MASK;
2180 + td = &lp->td_ring[lp->tx_next_done];
2184 + dmas = rc32434_readl(&lp->tx_dma_regs->dmas);
2185 + rc32434_writel( ~dmas, &lp->tx_dma_regs->dmas);
2187 + /* Enable F E bit in Tx DMA */
2188 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2189 + spin_unlock_irqrestore(&lp->lock, flags);
2194 +static struct net_device_stats * rc32434_get_stats(struct net_device *dev)
2196 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2197 + return &lp->stats;
2202 + * Set or clear the multicast filter for this adaptor.
2204 +static void rc32434_multicast_list(struct net_device *dev)
2206 + /* listen to broadcasts always and to treat */
2207 + /* IFF bits independantly */
2208 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2209 + unsigned long flags;
2210 + u32 recognise = ETHARC_ab_m; /* always accept broadcasts */
2212 + if (dev->flags & IFF_PROMISC) /* set promiscuous mode */
2213 + recognise |= ETHARC_pro_m;
2215 + if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 15))
2216 + recognise |= ETHARC_am_m; /* all multicast & bcast */
2217 + else if (dev->mc_count > 0) {
2218 + DBG(2, __FUNCTION__ ": mc_count %d\n", dev->mc_count);
2219 + recognise |= ETHARC_am_m; /* for the time being */
2222 + spin_lock_irqsave(&lp->lock, flags);
2223 + rc32434_writel(recognise, &lp->eth_regs->etharc);
2224 + spin_unlock_irqrestore(&lp->lock, flags);
2228 +static void rc32434_tx_timeout(struct net_device *dev)
2230 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2231 + unsigned long flags;
2233 + spin_lock_irqsave(&lp->lock, flags);
2234 + rc32434_restart(dev);
2235 + spin_unlock_irqrestore(&lp->lock, flags);
2241 + * Initialize the RC32434 ethernet controller.
2243 +static int rc32434_init(struct net_device *dev)
2245 + struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
2249 + rc32434_abort_tx(dev);
2250 + rc32434_abort_rx(dev);
2252 + /* reset ethernet logic */
2253 + rc32434_writel(0, &lp->eth_regs->ethintfc);
2254 + while((rc32434_readl(&lp->eth_regs->ethintfc) & ETHINTFC_rip_m))
2255 + dev->trans_start = jiffies;
2257 + /* Enable Ethernet Interface */
2258 + rc32434_writel(ETHINTFC_en_m, &lp->eth_regs->ethintfc);
2260 +#ifndef CONFIG_IDT_USE_NAPI
2261 + tasklet_disable(lp->rx_tasklet);
2263 + tasklet_disable(lp->tx_tasklet);
2265 + /* Initialize the transmit Descriptors */
2266 + for (i = 0; i < RC32434_NUM_TDS; i++) {
2267 + lp->td_ring[i].control = DMAD_iof_m;
2268 + lp->td_ring[i].devcs = ETHTX_fd_m | ETHTX_ld_m;
2269 + lp->td_ring[i].ca = 0;
2270 + lp->td_ring[i].link = 0;
2271 + if (lp->tx_skb[i] != NULL) {
2272 + dev_kfree_skb_any(lp->tx_skb[i]);
2273 + lp->tx_skb[i] = NULL;
2276 + lp->tx_next_done = lp->tx_chain_head = lp->tx_chain_tail = lp->tx_full = lp->tx_count = 0;
2277 + lp-> tx_chain_status = empty;
2280 + * Initialize the receive descriptors so that they
2281 + * become a circular linked list, ie. let the last
2282 + * descriptor point to the first again.
2284 + for (i=0; i<RC32434_NUM_RDS; i++) {
2285 + struct sk_buff *skb = lp->rx_skb[i];
2287 + if (lp->rx_skb[i] == NULL) {
2288 + skb = dev_alloc_skb(RC32434_RBSIZE + 2);
2289 + if (skb == NULL) {
2290 + ERR("No memory in the system\n");
2291 + for (j = 0; j < RC32434_NUM_RDS; j ++)
2292 + if (lp->rx_skb[j] != NULL)
2293 + dev_kfree_skb_any(lp->rx_skb[j]);
2299 + skb_reserve(skb, 2);
2300 + lp->rx_skb[i] = skb;
2301 + lp->rd_ring[i].ca = CPHYSADDR(skb->data);
2305 + lp->rd_ring[i].control = DMAD_iod_m | DMA_COUNT(RC32434_RBSIZE);
2306 + lp->rd_ring[i].devcs = 0;
2307 + lp->rd_ring[i].ca = CPHYSADDR(skb->data);
2308 + lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]);
2312 + lp->rd_ring[RC32434_NUM_RDS-1].link = CPHYSADDR(&lp->rd_ring[0]);
2313 + lp->rx_next_done = 0;
2315 + lp->rd_ring[RC32434_NUM_RDS-1].control |= DMAD_cod_m;
2316 + lp->rx_chain_head = 0;
2317 + lp->rx_chain_tail = 0;
2318 + lp->rx_chain_status = empty;
2320 + rc32434_writel(0, &lp->rx_dma_regs->dmas);
2321 + /* Start Rx DMA */
2322 + rc32434_start_rx(lp, &lp->rd_ring[0]);
2324 + /* Enable F E bit in Tx DMA */
2325 + rc32434_writel(rc32434_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
2326 + /* Enable D H E bit in Rx DMA */
2327 + rc32434_writel(rc32434_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm);
2329 + /* Accept only packets destined for this Ethernet device address */
2330 + rc32434_writel(ETHARC_ab_m, &lp->eth_regs->etharc);
2332 + /* Set all Ether station address registers to their initial values */
2333 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal0);
2334 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah0);
2336 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal1);
2337 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah1);
2339 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal2);
2340 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah2);
2342 + rc32434_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal3);
2343 + rc32434_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah3);
2346 + /* Frame Length Checking, Pad Enable, CRC Enable, Full Duplex set */
2347 + rc32434_writel(ETHMAC2_pe_m | ETHMAC2_cen_m | ETHMAC2_fd_m, &lp->eth_regs->ethmac2);
2348 + //ETHMAC2_flc_m ETHMAC2_fd_m lp->duplex_mode
2350 + /* Back to back inter-packet-gap */
2351 + rc32434_writel(0x15, &lp->eth_regs->ethipgt);
2352 + /* Non - Back to back inter-packet-gap */
2353 + rc32434_writel(0x12, &lp->eth_regs->ethipgr);
2355 + /* Management Clock Prescaler Divisor */
2356 + /* Clock independent setting */
2357 + rc32434_writel(((idt_cpu_freq)/MII_CLOCK+1) & ~1,
2358 + &lp->eth_regs->ethmcp);
2360 + /* don't transmit until fifo contains 48b */
2361 + rc32434_writel(48, &lp->eth_regs->ethfifott);
2363 + rc32434_writel(ETHMAC1_re_m, &lp->eth_regs->ethmac1);
2365 +#ifndef CONFIG_IDT_USE_NAPI
2366 + tasklet_enable(lp->rx_tasklet);
2368 + tasklet_enable(lp->tx_tasklet);
2370 + netif_start_queue(dev);
2380 +static int __init rc32434_setup(char *options)
2382 + /* no options yet */
2386 +static int __init rc32434_setup_ethaddr0(char *options)
2388 + memcpy(mac0, options, 17);
2393 +__setup("rc32434eth=", rc32434_setup);
2394 +__setup("ethaddr0=", rc32434_setup_ethaddr0);
2397 +#endif /* MODULE */
2399 +module_init(rc32434_init_module);
2400 +module_exit(rc32434_cleanup_module);
2415 diff -Nur linux-2.6.15/drivers/net/rc32434_eth.h linux-2.6.15-openwrt/drivers/net/rc32434_eth.h
2416 --- linux-2.6.15/drivers/net/rc32434_eth.h 1970-01-01 01:00:00.000000000 +0100
2417 +++ linux-2.6.15-openwrt/drivers/net/rc32434_eth.h 2006-01-10 00:32:33.000000000 +0100
2419 +/**************************************************************************
2421 + * BRIEF MODULE DESCRIPTION
2422 + * Definitions for IDT RC32434 on-chip ethernet controller.
2424 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2426 + * This program is free software; you can redistribute it and/or modify it
2427 + * under the terms of the GNU General Public License as published by the
2428 + * Free Software Foundation; either version 2 of the License, or (at your
2429 + * option) any later version.
2431 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2432 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2433 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2434 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2435 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2436 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2437 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2438 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2439 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2440 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2442 + * You should have received a copy of the GNU General Public License along
2443 + * with this program; if not, write to the Free Software Foundation, Inc.,
2444 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2447 + **************************************************************************
2448 + * May 2004 rkt, neb
2456 + **************************************************************************
2460 +#include <asm/idt-boards/rc32434/rc32434.h>
2461 +#include <asm/idt-boards/rc32434/rc32434_dma_v.h>
2462 +#include <asm/idt-boards/rc32434/rc32434_eth_v.h>
2464 +#define RC32434_DEBUG 2
2465 +//#define RC32434_PROC_DEBUG
2466 +#undef RC32434_DEBUG
2468 +#ifdef RC32434_DEBUG
2470 +/* use 0 for production, 1 for verification, >2 for debug */
2471 +static int rc32434_debug = RC32434_DEBUG;
2472 +#define ASSERT(expr) \
2474 + printk( "Assertion failed! %s,%s,%s,line=%d\n", \
2475 + #expr,__FILE__,__FUNCTION__,__LINE__); }
2476 +#define DBG(lvl, format, arg...) if (rc32434_debug > lvl) printk(KERN_INFO "%s: " format, dev->name , ## arg)
2478 +#define ASSERT(expr) do {} while (0)
2479 +#define DBG(lvl, format, arg...) do {} while (0)
2482 +#define INFO(format, arg...) printk(KERN_INFO "%s: " format, dev->name , ## arg)
2483 +#define ERR(format, arg...) printk(KERN_ERR "%s: " format, dev->name , ## arg)
2484 +#define WARN(format, arg...) printk(KERN_WARNING "%s: " format, dev->name , ## arg)
2486 +#define ETH0_DMA_RX_IRQ GROUP1_IRQ_BASE + 0
2487 +#define ETH0_DMA_TX_IRQ GROUP1_IRQ_BASE + 1
2488 +#define ETH0_RX_OVR_IRQ GROUP3_IRQ_BASE + 9
2489 +#define ETH0_TX_UND_IRQ GROUP3_IRQ_BASE + 10
2491 +#define ETH0_RX_DMA_ADDR (DMA0_PhysicalAddress + 0*DMA_CHAN_OFFSET)
2492 +#define ETH0_TX_DMA_ADDR (DMA0_PhysicalAddress + 1*DMA_CHAN_OFFSET)
2494 +/* the following must be powers of two */
2495 +#ifdef CONFIG_IDT_USE_NAPI
2496 +#define RC32434_NUM_RDS 64 /* number of receive descriptors */
2497 +#define RC32434_NUM_TDS 64 /* number of transmit descriptors */
2499 +#define RC32434_NUM_RDS 128 /* number of receive descriptors */
2500 +#define RC32434_NUM_TDS 128 /* number of transmit descriptors */
2503 +#define RC32434_RBSIZE 1536 /* size of one resource buffer = Ether MTU */
2504 +#define RC32434_RDS_MASK (RC32434_NUM_RDS-1)
2505 +#define RC32434_TDS_MASK (RC32434_NUM_TDS-1)
2506 +#define RD_RING_SIZE (RC32434_NUM_RDS * sizeof(struct DMAD_s))
2507 +#define TD_RING_SIZE (RC32434_NUM_TDS * sizeof(struct DMAD_s))
2509 +#define RC32434_TX_TIMEOUT HZ * 100
2511 +#define rc32434_eth0_regs ((ETH_t)(ETH0_VirtualAddress))
2512 +#define rc32434_eth1_regs ((ETH_t)(ETH1_VirtualAddress))
2514 +enum status { filled, empty};
2515 +#define IS_DMA_FINISHED(X) (((X) & (DMAD_f_m)) != 0)
2516 +#define IS_DMA_DONE(X) (((X) & (DMAD_d_m)) != 0)
2519 +/* Information that need to be kept for each board. */
2520 +struct rc32434_local {
2522 + DMA_Chan_t rx_dma_regs;
2523 + DMA_Chan_t tx_dma_regs;
2524 + volatile DMAD_t td_ring; /* transmit descriptor ring */
2525 + volatile DMAD_t rd_ring; /* receive descriptor ring */
2527 + struct sk_buff* tx_skb[RC32434_NUM_TDS]; /* skbuffs for pkt to trans */
2528 + struct sk_buff* rx_skb[RC32434_NUM_RDS]; /* skbuffs for pkt to trans */
2530 +#ifndef CONFIG_IDT_USE_NAPI
2531 + struct tasklet_struct * rx_tasklet;
2533 + struct tasklet_struct * tx_tasklet;
2536 + int rx_chain_head;
2537 + int rx_chain_tail;
2538 + enum status rx_chain_status;
2541 + int tx_chain_head;
2542 + int tx_chain_tail;
2543 + enum status tx_chain_status;
2547 + struct timer_list mii_phy_timer;
2548 + unsigned long duplex_mode;
2555 + struct net_device_stats stats;
2558 + /* debug /proc entry */
2559 + struct proc_dir_entry *ps;
2560 + int dma_halt_cnt; int dma_run_cnt;
2563 +extern unsigned int idt_cpu_freq;
2565 +/* Index to functions, as function prototypes. */
2566 +static int rc32434_open(struct net_device *dev);
2567 +static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev);
2568 +static void rc32434_mii_handler(unsigned long data);
2569 +static irqreturn_t rc32434_und_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2570 +static irqreturn_t rc32434_rx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2571 +static irqreturn_t rc32434_tx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2572 +#ifdef RC32434_REVISION
2573 +static irqreturn_t rc32434_ovr_interrupt(int irq, void *dev_id, struct pt_regs * regs);
2575 +static int rc32434_close(struct net_device *dev);
2576 +static struct net_device_stats *rc32434_get_stats(struct net_device *dev);
2577 +static void rc32434_multicast_list(struct net_device *dev);
2578 +static int rc32434_init(struct net_device *dev);
2579 +static void rc32434_tx_timeout(struct net_device *dev);
2581 +static void rc32434_tx_tasklet(unsigned long tx_data_dev);
2582 +#ifdef CONFIG_IDT_USE_NAPI
2583 +static int rc32434_poll(struct net_device *rx_data_dev, int *budget);
2585 +static void rc32434_rx_tasklet(unsigned long rx_data_dev);
2587 +static void rc32434_cleanup_module(void);
2588 +static int rc32434_probe(int port_num);
2589 +int rc32434_init_module(void);
2592 +static inline void rc32434_abort_dma(struct net_device *dev, DMA_Chan_t ch)
2594 + if (rc32434_readl(&ch->dmac) & DMAC_run_m) {
2595 + rc32434_writel(0x10, &ch->dmac);
2597 + while (!(rc32434_readl(&ch->dmas) & DMAS_h_m))
2598 + dev->trans_start = jiffies;
2600 + rc32434_writel(0, &ch->dmas);
2603 + rc32434_writel(0, &ch->dmadptr);
2604 + rc32434_writel(0, &ch->dmandptr);
2606 diff -Nur linux-2.6.15/include/asm-mips/bootinfo.h linux-2.6.15-openwrt/include/asm-mips/bootinfo.h
2607 --- linux-2.6.15/include/asm-mips/bootinfo.h 2006-01-03 04:21:10.000000000 +0100
2608 +++ linux-2.6.15-openwrt/include/asm-mips/bootinfo.h 2006-01-10 00:32:33.000000000 +0100
2609 @@ -218,6 +218,17 @@
2610 #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
2611 #define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
2615 + * Valid machtype for group ARUBA
2617 +#define MACH_GROUP_ARUBA 23
2618 +#define MACH_ARUBA_UNKNOWN 0
2619 +#define MACH_ARUBA_AP60 1
2620 +#define MACH_ARUBA_AP65 2
2621 +#define MACH_ARUBA_AP70 3
2622 +#define MACH_ARUBA_AP40 4
2624 #define CL_SIZE COMMAND_LINE_SIZE
2626 const char *get_system_type(void);
2627 diff -Nur linux-2.6.15/include/asm-mips/cpu.h linux-2.6.15-openwrt/include/asm-mips/cpu.h
2628 --- linux-2.6.15/include/asm-mips/cpu.h 2006-01-03 04:21:10.000000000 +0100
2629 +++ linux-2.6.15-openwrt/include/asm-mips/cpu.h 2006-01-10 00:32:33.000000000 +0100
2631 #define PRID_IMP_R12000 0x0e00
2632 #define PRID_IMP_R8000 0x1000
2633 #define PRID_IMP_PR4450 0x1200
2634 +#define PRID_IMP_RC32334 0x1800
2635 +#define PRID_IMP_RC32355 0x1900
2636 +#define PRID_IMP_RC32365 0x1900
2637 #define PRID_IMP_R4600 0x2000
2638 #define PRID_IMP_R4700 0x2100
2639 #define PRID_IMP_TX39 0x2200
2642 #define CPU_PR4450 61
2644 -#define CPU_LAST 62
2645 +#define CPU_RC32300 63
2646 +#define CPU_LAST 63
2649 * ISA Level encodings
2650 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
2651 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32300.h 1970-01-01 01:00:00.000000000 +0100
2652 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32300.h 2006-01-10 00:32:33.000000000 +0100
2654 +/**************************************************************************
2656 + * BRIEF MODULE DESCRIPTION
2657 + * RC32300 helper routines
2659 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2661 + * This program is free software; you can redistribute it and/or modify it
2662 + * under the terms of the GNU General Public License as published by the
2663 + * Free Software Foundation; either version 2 of the License, or (at your
2664 + * option) any later version.
2666 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2667 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2668 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2669 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2670 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2671 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2672 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2673 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2674 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2675 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2677 + * You should have received a copy of the GNU General Public License along
2678 + * with this program; if not, write to the Free Software Foundation, Inc.,
2679 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2682 + **************************************************************************
2683 + * May 2004 P. Sadik.
2689 + **************************************************************************
2692 +#ifndef __IDT_RC32300_H__
2693 +#define __IDT_RC32300_H__
2695 +#include <linux/delay.h>
2696 +#include <asm/io.h>
2699 +/* cpu pipeline flush */
2700 +static inline void rc32300_sync(void)
2702 + __asm__ volatile ("sync");
2705 +static inline void rc32300_sync_udelay(int us)
2707 + __asm__ volatile ("sync");
2711 +static inline void rc32300_sync_delay(int ms)
2713 + __asm__ volatile ("sync");
2718 + * Macros to access internal RC32300 registers. No byte
2719 + * swapping should be done when accessing the internal
2723 +static inline u8 rc32300_readb(unsigned long pa)
2725 + return *((volatile u8 *)KSEG1ADDR(pa));
2727 +static inline u16 rc32300_readw(unsigned long pa)
2729 + return *((volatile u16 *)KSEG1ADDR(pa));
2731 +static inline u32 rc32300_readl(unsigned long pa)
2733 + return *((volatile u32 *)KSEG1ADDR(pa));
2735 +static inline void rc32300_writeb(u8 val, unsigned long pa)
2737 + *((volatile u8 *)KSEG1ADDR(pa)) = val;
2739 +static inline void rc32300_writew(u16 val, unsigned long pa)
2741 + *((volatile u16 *)KSEG1ADDR(pa)) = val;
2743 +static inline void rc32300_writel(u32 val, unsigned long pa)
2745 + *((volatile u32 *)KSEG1ADDR(pa)) = val;
2749 +#define local_readb __raw_readb
2750 +#define local_readw __raw_readw
2751 +#define local_readl __raw_readl
2753 +#define local_writeb __raw_writeb
2754 +#define local_writew __raw_writew
2755 +#define local_writel __raw_writel
2759 + * C access to CLZ and CLO instructions
2760 + * (count leading zeroes/ones).
2762 +static inline int rc32300_clz(unsigned long val)
2765 + __asm__ volatile (
2766 + ".set\tnoreorder\n\t"
2768 + ".set\tmips32\n\t"
2778 +static inline int rc32300_clo(unsigned long val)
2781 + __asm__ volatile (
2782 + ".set\tnoreorder\n\t"
2784 + ".set\tmips32\n\t"
2795 +#endif // __IDT_RC32300_H__
2796 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
2797 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32334.h 1970-01-01 01:00:00.000000000 +0100
2798 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32334.h 2006-01-10 00:32:33.000000000 +0100
2800 +/**************************************************************************
2802 + * BRIEF MODULE DESCRIPTION
2803 + * Definitions for IDT RC32334 CPU.
2805 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
2807 + * This program is free software; you can redistribute it and/or modify it
2808 + * under the terms of the GNU General Public License as published by the
2809 + * Free Software Foundation; either version 2 of the License, or (at your
2810 + * option) any later version.
2812 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
2813 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2814 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
2815 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2816 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2817 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2818 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2819 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2820 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2821 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2823 + * You should have received a copy of the GNU General Public License along
2824 + * with this program; if not, write to the Free Software Foundation, Inc.,
2825 + * 675 Mass Ave, Cambridge, MA 02139, USA.
2828 + **************************************************************************
2829 + * May 2004 P. Sadik.
2835 + **************************************************************************
2839 +#ifndef __IDT_RC32334_H__
2840 +#define __IDT_RC32334_H__
2842 +#include <linux/delay.h>
2843 +#include <asm/io.h>
2845 +/* Base address of internal registers */
2846 +#define RC32334_REG_BASE 0x18000000
2848 +/* CPU and IP Bus Control */
2849 +#define CPU_PORT_WIDTH 0xffffe200 // virtual!
2850 +#define CPU_BTA 0xffffe204 // virtual!
2851 +#define CPU_BUSERR_ADDR 0xffffe208 // virtual!
2852 +#define CPU_IP_BTA (RC32334_REG_BASE + 0x0000)
2853 +#define CPU_IP_ADDR_LATCH (RC32334_REG_BASE + 0x0004)
2854 +#define CPU_IP_ARBITRATION (RC32334_REG_BASE + 0x0008)
2855 +#define CPU_IP_BUSERR_CNTL (RC32334_REG_BASE + 0x0010)
2856 +#define CPU_IP_BUSERR_ADDR (RC32334_REG_BASE + 0x0014)
2857 +#define CPU_IP_SYSID (RC32334_REG_BASE + 0x0018)
2859 +/* Memory Controller */
2860 +#define MEM_BASE_BANK0 (RC32334_REG_BASE + 0x0080)
2861 +#define MEM_MASK_BANK0 (RC32334_REG_BASE + 0x0084)
2862 +#define MEM_CNTL_BANK0 (RC32334_REG_BASE + 0x0200)
2863 +#define MEM_BASE_BANK1 (RC32334_REG_BASE + 0x0088)
2864 +#define MEM_MASK_BANK1 (RC32334_REG_BASE + 0x008c)
2865 +#define MEM_CNTL_BANK1 (RC32334_REG_BASE + 0x0204)
2866 +#define MEM_CNTL_BANK2 (RC32334_REG_BASE + 0x0208)
2867 +#define MEM_CNTL_BANK3 (RC32334_REG_BASE + 0x020c)
2868 +#define MEM_CNTL_BANK4 (RC32334_REG_BASE + 0x0210)
2869 +#define MEM_CNTL_BANK5 (RC32334_REG_BASE + 0x0214)
2871 +/* PCI Controller */
2872 +#define PCI_INTR_PEND (RC32334_REG_BASE + 0x05b0)
2873 +#define PCI_INTR_MASK (RC32334_REG_BASE + 0x05b4)
2874 +#define PCI_INTR_CLEAR (RC32334_REG_BASE + 0x05b8)
2875 +#define CPU2PCI_INTR_PEND (RC32334_REG_BASE + 0x05c0)
2876 +#define CPU2PCI_INTR_MASK (RC32334_REG_BASE + 0x05c4)
2877 +#define CPU2PCI_INTR_CLEAR (RC32334_REG_BASE + 0x05c8)
2878 +#define PCI2CPU_INTR_PEND (RC32334_REG_BASE + 0x05d0)
2879 +#define PCI2CPU_INTR_MASK (RC32334_REG_BASE + 0x05d4)
2880 +#define PCI2CPU_INTR_CLEAR (RC32334_REG_BASE + 0x05d8)
2881 +#define PCI_MEM1_BASE (RC32334_REG_BASE + 0x20b0)
2882 +#define PCI_MEM2_BASE (RC32334_REG_BASE + 0x20b8)
2883 +#define PCI_MEM3_BASE (RC32334_REG_BASE + 0x20c0)
2884 +#define PCI_IO1_BASE (RC32334_REG_BASE + 0x20c8)
2885 +#define PCI_ARBITRATION (RC32334_REG_BASE + 0x20e0)
2886 +#define PCI_CPU_MEM1_BASE (RC32334_REG_BASE + 0x20e8)
2887 +#define PCI_CPU_IO_BASE (RC32334_REG_BASE + 0x2100)
2888 +#define PCI_CFG_CNTL (RC32334_REG_BASE + 0x2cf8)
2889 +#define PCI_CFG_DATA (RC32334_REG_BASE + 0x2cfc)
2892 +#define TIMER0_CNTL (RC32334_REG_BASE + 0x0700)
2893 +#define TIMER0_COUNT (RC32334_REG_BASE + 0x0704)
2894 +#define TIMER0_COMPARE (RC32334_REG_BASE + 0x0708)
2895 +#define TIMER_REG_OFFSET 0x10
2897 +/* Programmable I/O */
2898 +#define PIO_DATA0 (RC32334_REG_BASE + 0x0600)
2899 +#define PIO_DATA1 (RC32334_REG_BASE + 0x0610)
2904 + * NOTE: DMA_IO is a trick for non linear RC32300_IO_DMA stuff
2910 + * NB: dma number must be immediate value or variable.
2911 + * It MUST NOT be a function since it would get called twice!
2913 +#define DMA_IO(n) (((n)>1?0x500:0)+((n)&1?0x40:0))
2915 +#define RC32300_IO_DMA(n) (RC32334_REG_BASE + 0x1400 + DMA_IO(n))
2916 +#define RC32300_DMA_CONFREG(n) RC32300_IO_DMA(n)
2917 +#define RC32300_DMA_BASEREG(n) (RC32300_IO_DMA(n)+0x4)
2919 +#define RC32300_DMA_CURRREG(n) (RC32300_IO_DMA(n)+0x8)
2920 +#define RC32300_DMA_STATREG(n) (RC32300_IO_DMA(n)+0x10)
2921 +#define RC32300_DMA_SRCREG(n) (RC32300_IO_DMA(n)+0x14)
2922 +#define RC32300_DMA_DSTREG(n) (RC32300_IO_DMA(n)+0x18)
2923 +#define RC32300_DMA_NEXTREG(n) (RC32300_IO_DMA(n)+0x1c)
2925 +#define RC32300_DMA_IRQ(n) (GROUP7_IRQ_BASE+5*(n))
2927 +/* Expansion Interrupt Controller */
2928 +#define IC_GROUP0_PEND (RC32334_REG_BASE + 0x0500)
2929 +#define IC_GROUP0_MASK (RC32334_REG_BASE + 0x0504)
2930 +#define IC_GROUP0_CLEAR (RC32334_REG_BASE + 0x0508)
2931 +#define IC_GROUP_OFFSET 0x10
2933 +#define NUM_INTR_GROUPS 15
2935 + * The IRQ mapping is as follows:
2938 + * --- -------------------
2939 + * 0 SW0 (IP0) SW0 intr
2940 + * 1 SW1 (IP1) SW1 intr
2941 + * 2 Int0 (IP2) board-specific
2942 + * 3 Int1 (IP3) board-specific
2943 + * 4 Int2 (IP4) board-specific
2944 + * - Int3 (IP5) not used, mapped to IRQ's 8 and up
2945 + * 6 Int4 (IP6) board-specific
2946 + * 7 Int5 (IP7) CP0 Timer
2948 + * IRQ's 8 and up are all mapped to Int3 (IP5), which
2949 + * internally on the RC32334 is routed to the Expansion
2950 + * Interrupt Controller.
2952 +#define MIPS_CPU_TIMER_IRQ 7
2954 +#define GROUP1_IRQ_BASE 8 // bus error
2955 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 1) // PIO active low
2956 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 12) // PIO active high
2957 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 8) // Timer Rollovers
2958 +#define GROUP5_IRQ_BASE (GROUP4_IRQ_BASE + 8) // UART0
2959 +#define GROUP6_IRQ_BASE (GROUP5_IRQ_BASE + 3) // UART1
2960 +#define GROUP7_IRQ_BASE (GROUP6_IRQ_BASE + 3) // DMA Ch0
2961 +#define GROUP8_IRQ_BASE (GROUP7_IRQ_BASE + 5) // DMA Ch1
2962 +#define GROUP9_IRQ_BASE (GROUP8_IRQ_BASE + 5) // DMA Ch2
2963 +#define GROUP10_IRQ_BASE (GROUP9_IRQ_BASE + 5) // DMA Ch3
2964 +#define GROUP11_IRQ_BASE (GROUP10_IRQ_BASE + 5) // PCI Ctlr errors
2965 +#define GROUP12_IRQ_BASE (GROUP11_IRQ_BASE + 4) // PCI Satellite Mode
2966 +#define GROUP13_IRQ_BASE (GROUP12_IRQ_BASE + 16) // PCI to CPU Mailbox
2967 +#define GROUP14_IRQ_BASE (GROUP13_IRQ_BASE + 4) // SPI
2969 +#define RC32334_NR_IRQS (GROUP14_IRQ_BASE + 1)
2973 +#define RC32300_UART0_BASE (RC32334_REG_BASE + 0x0803)
2974 +#define RC32300_UART1_BASE (RC32334_REG_BASE + 0x0823)
2976 +#define RC32300_UART0_BASE (RC32334_REG_BASE + 0x0800)
2977 +#define RC32300_UART1_BASE (RC32334_REG_BASE + 0x0820)
2980 +#define RC32300_UART0_IRQ GROUP5_IRQ_BASE
2981 +#define RC32300_UART1_IRQ GROUP6_IRQ_BASE
2983 +#define IDT_CLOCK_MULT 2
2986 +#define NVRAM_BASE 0x12000000
2987 +#define NVRAM_ENVSIZE_OFF 4
2988 +#define NVRAM_ENVSTART_OFF 0x40
2990 +/* LCD 4-digit display */
2991 +#define LCD_CLEAR 0x14000400
2992 +#define LCD_DIGIT0 0x1400000f
2993 +#define LCD_DIGIT1 0x14000008
2994 +#define LCD_DIGIT2 0x14000007
2995 +#define LCD_DIGIT3 0x14000003
2997 +/* Interrupts routed on 79S334A board (see rc32334.h) */
2998 +#define RC32334_SCC8530_IRQ 2
2999 +#define RC32334_PCI_INTA_IRQ 3
3000 +#define RC32334_PCI_INTB_IRQ 4
3001 +#define RC32334_PCI_INTC_IRQ 6
3002 +#define RC32334_PCI_INTD_IRQ 7
3004 +#define RAM_SIZE (32*1024*1024)
3006 +#endif // __IDT_RC32334_H__
3007 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
3008 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355_dma.h 1970-01-01 01:00:00.000000000 +0100
3009 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355_dma.h 2006-01-10 00:32:33.000000000 +0100
3011 +/**************************************************************************
3013 + * BRIEF MODULE DESCRIPTION
3014 + * DMA controller defines on IDT RC32355
3016 + * Copyright 2004 IDT Inc.
3017 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3020 + * This program is free software; you can redistribute it and/or modify it
3021 + * under the terms of the GNU General Public License as published by the
3022 + * Free Software Foundation; either version 2 of the License, or (at your
3023 + * option) any later version.
3025 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3026 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3027 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3028 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3029 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3030 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3031 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3032 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3033 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3034 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3036 + * You should have received a copy of the GNU General Public License along
3037 + * with this program; if not, write to the Free Software Foundation, Inc.,
3038 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3044 + **************************************************************************
3047 +#ifndef BANYAN_DMA_H
3048 +#define BANYAN_DMA_H
3049 +#include <asm/idt-boards/rc32300/rc32300.h>
3052 + * An image of one RC32355 dma channel registers
3060 +} rc32355_dma_ch_t;
3063 + * An image of all RC32355 dma channel registers
3066 + rc32355_dma_ch_t ch[16];
3067 +} rc32355_dma_regs_t;
3070 +#define rc32355_dma_regs ((rc32355_dma_regs_t*)KSEG1ADDR(RC32355_DMA_BASE))
3073 +/* DMAC register layout */
3075 +#define DMAC_RUN 0x1 /* Halts processing when cleared */
3076 +#define DMAC_DM 0x2 /* Done Mask, ignore DMA events */
3077 +#define DMAC_MODE_MASK 0xC /* DMA operating mode */
3079 +#define DMAC_MODE_AUTO 0x0 /* DMA Auto Request Mode */
3080 +#define DMAC_MODE_BURST 0x4 /* DMA Burst Request Mode */
3081 +#define DMAC_MODE_TFER 0x8 /* DMA Transfer Request Mode */
3083 +/* DMAS and DMASM register layout */
3085 +#define DMAS_F 0x01 /* Finished */
3086 +#define DMAS_D 0x02 /* Done */
3087 +#define DMAS_C 0x04 /* Chain */
3088 +#define DMAS_E 0x08 /* Error */
3089 +#define DMAS_H 0x10 /* Halt */
3091 +/* Polling count for DMAS_H bit in DMAS register after halting DMA */
3092 +#define DMA_HALT_TIMEOUT 500
3095 +static inline int rc32355_halt_dma(rc32355_dma_ch_t* ch)
3099 + if (local_readl(&ch->dmac) & DMAC_RUN) {
3100 + local_writel(0, &ch->dmac);
3101 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
3102 + if (local_readl(&ch->dmas) & DMAS_H) {
3103 + local_writel(0, &ch->dmas);
3109 + return timeout ? 0 : 1;
3112 +static inline void rc32355_start_dma(rc32355_dma_ch_t* ch, u32 dma_addr)
3114 + local_writel(0, &ch->dmandptr);
3115 + local_writel(dma_addr, &ch->dmadptr);
3118 +static inline void rc32355_chain_dma(rc32355_dma_ch_t* ch, u32 dma_addr)
3120 + local_writel(dma_addr, &ch->dmandptr);
3124 +/* The following can be used to describe DMA channels 0 to 15, and the */
3125 +/* sub device's needed to select them in the DMADESC_DS_MASK field */
3127 +#define DMA_CHAN_ATM01 0 /* ATM interface 0,1 chan */
3129 +#define DMA_CHAN_ATM0IN 0 /* ATM interface 0 input */
3130 +#define DMA_DEV_ATM0IN 0 /* ATM interface 0 input */
3132 +#define DMA_CHAN_ATM1IN 0 /* ATM interface 1 input */
3133 +#define DMA_DEV_ATM1IN 1 /* ATM interface 1 input */
3135 +#define DMA_CHAN_ATM0OUT 0 /* ATM interface 0 output */
3136 +#define DMA_DEV_ATM0OUT 2 /* ATM interface 0 output */
3138 +#define DMA_CHAN_ATM1OUT 0 /* ATM interface 1 output */
3139 +#define DMA_DEV_ATM1OUT 3 /* ATM interface 1 output */
3141 +/* for entry in {0,1,2,3,4,5,6,7} - note 5,6,7 share with those below */
3142 +#define DMA_CHAN_ATMVCC(entry) ((entry)+1) /* ATM VC cache entry */
3143 +#define DMA_DEV_ATMVCC(entry) 0
3145 +#define DMA_CHAN_MEMTOMEM 6 /* Memory to memory DMA */
3146 +#define DMA_DEV_MEMTOMEM 1 /* Memory to memory DMA */
3148 +#define DMA_CHAN_ATMFMB0 7 /* ATM Frame Mode Buffer 0 */
3149 +#define DMA_DEV_ATMFMB0 1 /* ATM Frame Mode Buffer 0 */
3151 +#define DMA_CHAN_ATMFMB1 8 /* ATM Frame Mode Buffer 1 */
3152 +#define DMA_DEV_ATMFMB1 1 /* ATM Frame Mode Buffer 1 */
3154 +#define DMA_CHAN_ETHERIN 9 /* Ethernet input */
3155 +#define DMA_DEV_ETHERIN 0 /* Ethernet input */
3157 +#define DMA_CHAN_ETHEROUT 10 /* Ethernet output */
3158 +#define DMA_DEV_ETHEROUT 0 /* Ethernet output */
3160 +#define DMA_CHAN_TDMIN 11 /* TDM Bus input */
3161 +#define DMA_DEV_TDMIN 0 /* TDM Bus input */
3163 +#define DMA_CHAN_TDMOUT 12 /* TDM Bus output */
3164 +#define DMA_DEV_TDMOUT 0 /* TDM Bus output */
3166 +#define DMA_CHAN_USBIN 13 /* USB input */
3167 +#define DMA_DEV_USBIN 0 /* USB input */
3169 +#define DMA_CHAN_USBOUT 14 /* USB output */
3170 +#define DMA_DEV_USBOUT 0 /* USB output */
3172 +#define DMA_CHAN_EXTERN 15 /* External DMA */
3173 +#define DMA_DEV_EXTERN 0 /* External DMA */
3176 + * An RC32355 dma descriptor in system memory
3179 + u32 cmdstat; /* control and status */
3180 + u32 curr_addr; /* current address of data */
3181 + u32 devcs; /* peripheral-specific control and status */
3182 + u32 link; /* link to next descriptor */
3183 +} rc32355_dma_desc_t;
3185 +/* Values for the descriptor cmdstat word */
3187 +#define DMADESC_F 0x80000000u /* Finished bit */
3188 +#define DMADESC_D 0x40000000u /* Done bit */
3189 +#define DMADESC_T 0x20000000u /* Terminated bit */
3190 +#define DMADESC_IOD 0x10000000u /* Interrupt On Done */
3191 +#define DMADESC_IOF 0x08000000u /* Interrupt On Finished */
3192 +#define DMADESC_COD 0x04000000u /* Chain On Done */
3193 +#define DMADESC_COF 0x02000000u /* Chain On Finished */
3195 +#define DMADESC_DEVCMD_MASK 0x01C00000u /* Device Command mask */
3196 +#define DMADESC_DEVCMD_SHIFT 22 /* Device Command shift */
3198 +#define DMADESC_DS_MASK 0x00300000u /* Device Select mask */
3199 +#define DMADESC_DS_SHIFT 20 /* Device Select shift */
3201 +#define DMADESC_COUNT_MASK 0x0003FFFFu /* Byte Count mask */
3202 +#define DMADESC_COUNT_SHIFT 0 /* Byte Count shift */
3204 +#define IS_DMA_FINISHED(X) ( ( (X) & DMADESC_F ) >> 31) /* F Bit */
3205 +#define IS_DMA_DONE(X) ( ( (X) & DMADESC_D ) >> 30) /* D Bit */
3206 +#define IS_DMA_TERMINATED(X) ( ( (X) & DMADESC_T ) >> 29) /* T Bit */
3207 +#define IS_DMA_USED(X) (((X) & (DMADESC_F | DMADESC_D | DMADESC_T)) != 0)
3209 +#define DMA_DEVCMD(devcmd) \
3210 + (((devcmd) << DMADESC_DEVCMD_SHIFT) & DMADESC_DS_MASK)
3211 +#define DMA_DS(ds) \
3212 + (((ds) << DMADESC_DS_SHIFT) & DMADESC_DS_MASK)
3213 +#define DMA_COUNT(count) \
3214 + ((count) & DMADESC_COUNT_MASK)
3216 +#endif /* RC32355_DMA_H */
3217 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
3218 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355_eth.h 1970-01-01 01:00:00.000000000 +0100
3219 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355_eth.h 2006-01-10 00:32:33.000000000 +0100
3221 +/**************************************************************************
3223 + * BRIEF MODULE DESCRIPTION
3224 + * Ethernet registers on IDT RC32355
3226 + * Copyright 2004 IDT Inc.
3227 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3230 + * This program is free software; you can redistribute it and/or modify it
3231 + * under the terms of the GNU General Public License as published by the
3232 + * Free Software Foundation; either version 2 of the License, or (at your
3233 + * option) any later version.
3235 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3236 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3237 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3238 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3239 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3240 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3241 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3242 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3243 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3244 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3246 + * You should have received a copy of the GNU General Public License along
3247 + * with this program; if not, write to the Free Software Foundation, Inc.,
3248 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3254 + **************************************************************************
3258 +#ifndef RC32355_ETHER_H
3259 +#define RC32355_ETHER_H
3261 +#include <asm/idt-boards/rc32300/rc32355_dma.h>
3264 + * A partial image of the RC32355 ethernet registers
3323 +} rc32355_eth_regs_t;
3325 +#define rc32355_eth_regs ((rc32355_eth_regs_t*)KSEG1ADDR(RC32355_ETH_BASE))
3327 +#define ETH_INTFC (RC32355_ETH_BASE + 0x000) /* INTerFace Control */
3328 +#define ETH_FIFOTT (RC32355_ETH_BASE + 0x004) /* FIFO Transmit Threshold */
3329 +#define ETH_ARC (RC32355_ETH_BASE + 0x008) /* Address Recognition Ctrl */
3330 +#define ETH_HASH0 (RC32355_ETH_BASE + 0x00C) /* 32 multicast Hash bits */
3331 +#define ETH_HASH1 (RC32355_ETH_BASE + 0x010) /* another 32 Hash bits */
3332 +#define ETH_FIFOST (RC32355_ETH_BASE + 0x014) /* FIFO Status Threshold */
3333 +#define ETH_FIFOS (RC32355_ETH_BASE + 0x018) /* FIFO Status Register */
3334 +#define ETH_ODEOPS (RC32355_ETH_BASE + 0x01C) /* Out Data End-Of-Pkt Size */
3335 +#define ETH_IS (RC32355_ETH_BASE + 0x020) /* Input Status */
3336 +#define ETH_OS (RC32355_ETH_BASE + 0x024) /* Output Status */
3337 +#define ETH_MCP (RC32355_ETH_BASE + 0x028) /* Managemt Clock Prescaler */
3338 +#define ETH_ID (RC32355_ETH_BASE + 0x030) /* Input Data register */
3339 +#define ETH_OD (RC32355_ETH_BASE + 0x040) /* Output Data register */
3340 +#define ETH_ODEOP (RC32355_ETH_BASE + 0x050) /* OD End-Of-Packet Size */
3342 +/* for n in { 0, 1, 2, 3 } */
3343 +#define ETH_SAL(n) (RC32355_ETH_BASE + 0x100 + (n * 8)) /* Stn Address 2-5 */
3344 +#define ETH_SAH(n) (RC32355_ETH_BASE + 0x104 + (n * 8)) /* Stn Address 0-1 */
3346 +#define ETH_RBC (RC32355_ETH_BASE + 0x120) /* Receive Byte Count */
3347 +#define ETH_RPC (RC32355_ETH_BASE + 0x124) /* Receive Packet Count */
3348 +#define ETH_RUPC (RC32355_ETH_BASE + 0x128) /* Rx Undersized Pkt count */
3349 +#define ETH_RFC (RC32355_ETH_BASE + 0x12C) /* Receive Fragment Count */
3350 +#define ETH_TBC (RC32355_ETH_BASE + 0x130) /* Transmit Byte Count */
3351 +#define ETH_GPF (RC32355_ETH_BASE + 0x134) /* Generate Pause Frame */
3352 +#define ETH_MAC1 (RC32355_ETH_BASE + 0x200) /* Medium Access Control 1 */
3353 +#define ETH_MAC2 (RC32355_ETH_BASE + 0x204) /* Medium Access Control 2 */
3354 +#define ETH_IPGT (RC32355_ETH_BASE + 0x208) /* Back-to-back InterPkt Gap */
3355 +#define ETH_IPGR (RC32355_ETH_BASE + 0x20C) /* Non " InterPkt Gap */
3356 +#define ETH_CLRT (RC32355_ETH_BASE + 0x210) /* Collis'n Window and Retry */
3357 +#define ETH_MAXF (RC32355_ETH_BASE + 0x214) /* Maximum Frame Length */
3358 +#define ETH_MTEST (RC32355_ETH_BASE + 0x21C) /* MAC Test */
3360 +#define ETHMIIM_CFG (RC32355_ETH_BASE + 0x220) /* MII Mgmt Configuration */
3361 +#define ETHMIIM_CMD (RC32355_ETH_BASE + 0x224) /* MII Mgmt Command */
3362 +#define ETHMIIM_ADDR (RC32355_ETH_BASE + 0x228) /* MII Mgmt Address */
3363 +#define ETHMIIM_WTD (RC32355_ETH_BASE + 0x22C) /* MII Mgmt Write Data */
3364 +#define ETHMIIM_RDD (RC32355_ETH_BASE + 0x230) /* MII Mgmt Read Data */
3365 +#define ETHMIIM_IND (RC32355_ETH_BASE + 0x234) /* MII Mgmt Indicators */
3367 +/* for n in { 0, 1, 2 } */
3368 +#define ETH_CFSA(n) (RC32355_ETH_BASE + 0x240 + ((n) * 4)) /* Station Addr */
3372 + * Register Interpretations follow
3375 +/******************************************************************************
3376 + * ETHINTFC register
3377 + *****************************************************************************/
3379 +#define ETHERINTFC_EN (1<<0)
3380 +#define ETHERINTFC_ITS (1<<1)
3381 +#define ETHERINTFC_RES (1<<2)
3382 +#define ETHERINTFC_RIP (1<<2)
3383 +#define ETHERINTFC_JAM (1<<3)
3385 +/******************************************************************************
3386 + * ETHFIFOTT register
3387 + *****************************************************************************/
3389 +#define ETHERFIFOTT_TTH(v) (((v)&0x3f)<<0)
3391 +/******************************************************************************
3393 + *****************************************************************************/
3395 +#define ETHERARC_PRO (1<<0)
3396 +#define ETHERARC_AM (1<<1)
3397 +#define ETHERARC_AFM (1<<2)
3398 +#define ETHERARC_AB (1<<3)
3400 +/******************************************************************************
3401 + * ETHHASH registers
3402 + *****************************************************************************/
3404 +#define ETHERHASH0(v) (((v)&0xffff)<<0)
3405 +#define ETHERHASH1(v) (((v)&0xffff)<<0)
3407 +/******************************************************************************
3409 + *****************************************************************************/
3411 +#define ETHERSAL0(v) (((v)&0xffff)<<0)
3412 +#define ETHERSAL1(v) (((v)&0xffff)<<0)
3413 +#define ETHERSAL2(v) (((v)&0xffff)<<0)
3414 +#define ETHERSAL3(v) (((v)&0xffff)<<0)
3415 +#define ETHERSAH0(v) (((v)&0xff)<<0)
3416 +#define ETHERSAH1(v) (((v)&0xff)<<0)
3417 +#define ETHERSAH2(v) (((v)&0xff)<<0)
3418 +#define ETHERSAH3(v) (((v)&0xff)<<0)
3420 +/******************************************************************************
3421 + * ETHFIFOST register
3422 + *****************************************************************************/
3424 +#define ETHERFIFOST_IRTH(v) (((v)&0x3f)<<0)
3425 +#define ETHERFIFOST_ORTH(v) (((v)&0x3f)<<16)
3427 +/******************************************************************************
3428 + * ETHFIFOS register
3429 + *****************************************************************************/
3431 +#define ETHERFIFOS_IR (1<<0)
3432 +#define ETHERFIFOS_OR (1<<1)
3433 +#define ETHERFIFOS_OVR (1<<2)
3434 +#define ETHERFIFOS_UND (1<<3)
3436 +/******************************************************************************
3438 + *****************************************************************************/
3440 +#define ETHERID(v) (((v)&0xffff)<<0)
3441 +#define ETHEROD(v) (((v)&0xffff)<<0)
3443 +/******************************************************************************
3444 + * ETHODEOPS register
3445 + *****************************************************************************/
3447 +#define ETHERODEOPS_SIZE(v) (((v)&0x3)<<0)
3449 +/******************************************************************************
3450 + * ETHODEOP register
3451 + *****************************************************************************/
3453 +#define ETHERODEOP(v) (((v)&0xffff)<<0)
3455 +/******************************************************************************
3457 + *****************************************************************************/
3459 +#define ETHERIS_EOP (1<<0)
3460 +#define ETHERIS_ROK (1<<2)
3461 +#define ETHERIS_FM (1<<3)
3462 +#define ETHERIS_MP (1<<4)
3463 +#define ETHERIS_BP (1<<5)
3464 +#define ETHERIS_VLT (1<<6)
3465 +#define ETHERIS_CF (1<<7)
3466 +#define ETHERIS_OVR (1<<8)
3467 +#define ETHERIS_CRC (1<<9)
3468 +#define ETHERIS_CV (1<<10)
3469 +#define ETHERIS_DB (1<<11)
3470 +#define ETHERIS_LE (1<<12)
3471 +#define ETHERIS_LOR (1<<13)
3472 +#define ETHERIS_SIZE(v) (((v)&0x3)<<14)
3473 +#define ETHERIS_LENGTH(v) (((v)&0xff)<<16)
3475 +/******************************************************************************
3477 + *****************************************************************************/
3479 +#define ETHEROS_T (1<<0)
3480 +#define ETHEROS_TOK (1<<6)
3481 +#define ETHEROS_MP (1<<7)
3482 +#define ETHEROS_BP (1<<8)
3483 +#define ETHEROS_UND (1<<9)
3484 +#define ETHEROS_OF (1<<10)
3485 +#define ETHEROS_ED (1<<11)
3486 +#define ETHEROS_EC (1<<12)
3487 +#define ETHEROS_LC (1<<13)
3488 +#define ETHEROS_TD (1<<14)
3489 +#define ETHEROS_CRC (1<<15)
3490 +#define ETHEROS_LE (1<<16)
3491 +#define ETHEROS_CC(v) (((v)&0xf)<<17)
3492 +#define ETHEROS_PFD (1<<21)
3494 +/******************************************************************************
3495 + * Statistics registers
3496 + *****************************************************************************/
3498 +#define ETHERRBC(v) (((v)&0xffff)<<0)
3499 +#define ETHERRPC(v) (((v)&0xffff)<<0)
3500 +#define ETHERRUPC(v) (((v)&0xffff)<<0)
3501 +#define ETHERRFC(v) (((v)&0xffff)<<0)
3502 +#define ETHERTBC(v) (((v)&0xffff)<<0)
3504 +/******************************************************************************
3506 + *****************************************************************************/
3508 +#define ETHERGPF_PTV(v) (((v)&0xff)<<0)
3510 +/******************************************************************************
3512 + *****************************************************************************/
3514 +#define ETHERMAC1_RE (1<<0)
3515 +#define ETHERMAC1_PAF (1<<1)
3516 +#define ETHERMAC1_RFC (1<<2)
3517 +#define ETHERMAC1_TFC (1<<3)
3518 +#define ETHERMAC1_LB (1<<4)
3519 +#define ETHERMAC1_MR (1<<15)
3522 +#define ETHERMAC2_FD (1<<0)
3523 +#define ETHERMAC2_FLC (1<<1)
3524 +#define ETHERMAC2_HFE (1<<2)
3525 +#define ETHERMAC2_DC (1<<3)
3526 +#define ETHERMAC2_CEN (1<<4)
3527 +#define ETHERMAC2_PE (1<<5)
3528 +#define ETHERMAC2_VPE (1<<6)
3529 +#define ETHERMAC2_APE (1<<7)
3530 +#define ETHERMAC2_PPE (1<<8)
3531 +#define ETHERMAC2_LPE (1<<9)
3532 +#define ETHERMAC2_NB (1<<12)
3533 +#define ETHERMAC2_BP (1<<13)
3534 +#define ETHERMAC2_ED (1<<14)
3537 +#define ETHERIPGT(v) (((v)&0x3f)<<0)
3540 +#define ETHERIPGR_IPGR1(v) (((v)&0x3f)<<0)
3541 +#define ETHERIPGR_IPGR2(v) (((v)&0x3f)<<8)
3544 +#define ETHERCLRT_MAXRET(v) (((v)&0x3f)<<0)
3545 +#define ETHERCLRT_COLWIN(v) (((v)&0x3f)<<8)
3548 +#define ETHERMAXF(v) (((v)&0x3f)<<0)
3551 +#define ETHERMTEST_TB (1<<2)
3554 +#define ETHERMCP_DIV(v) (((v)&0xff)<<0)
3557 +#define ETHERMIIMCFG_CS(v) (((v)&0x3)<<2)
3558 +#define ETHERMIIMCFG_R (1<<15)
3561 +#define ETHERMIIMCMD_RD (1<<0)
3562 +#define ETHERMIIMCMD_SCN (1<<1)
3565 +#define ETHERMIIMADDR_REGADDR(v) (((v)&0x1f)<<0)
3566 +#define ETHERMIIMADDR_PHYADDR(v) (((v)&0x1f)<<8)
3569 +#define ETHERMIIMWTD(v) (((v)&0xff)<<0)
3572 +#define ETHERMIIMRDD(v) (((v)&0xff)<<0)
3575 +#define ETHERMIIMIND_BSY (1<<0)
3576 +#define ETHERMIIMIND_SCN (1<<1)
3577 +#define ETHERMIIMIND_NV (1<<2)
3580 +#define ETHERDMA_IN_LENGTH(v) (((v)&0xffff)<<16)
3581 +#define ETHERDMA_IN_CES (1<<14)
3582 +#define ETHERDMA_IN_LOR (1<<13)
3583 +#define ETHERDMA_IN_LE (1<<12)
3584 +#define ETHERDMA_IN_DB (1<<11)
3585 +#define ETHERDMA_IN_CV (1<<10)
3586 +#define ETHERDMA_IN_CRC (1<<9)
3587 +#define ETHERDMA_IN_OVR (1<<8)
3588 +#define ETHERDMA_IN_CF (1<<7)
3589 +#define ETHERDMA_IN_VLT (1<<6)
3590 +#define ETHERDMA_IN_BP (1<<5)
3591 +#define ETHERDMA_IN_MP (1<<4)
3592 +#define ETHERDMA_IN_FM (1<<3)
3593 +#define ETHERDMA_IN_ROK (1<<2)
3594 +#define ETHERDMA_IN_LD (1<<1)
3595 +#define ETHERDMA_IN_FD (1<<0)
3598 +#define ETHERDMA_OUT_CC(v) (((v)&0xf)<<17)
3599 +#define ETHERDMA_OUT_CNT 0x001e0000
3600 +#define ETHERDMA_OUT_SHFT 17
3601 +#define ETHERDMA_OUT_LE (1<<16)
3603 +#define ETHERDMA_OUT_CRC (1<<15)
3604 +#define ETHERDMA_OUT_TD (1<<14)
3605 +#define ETHERDMA_OUT_LC (1<<13)
3606 +#define ETHERDMA_OUT_EC (1<<12)
3607 +#define ETHERDMA_OUT_ED (1<<11)
3608 +#define ETHERDMA_OUT_OF (1<<10)
3609 +#define ETHERDMA_OUT_UND (1<<9)
3610 +#define ETHERDMA_OUT_BP (1<<8)
3611 +#define ETHERDMA_OUT_MP (1<<7)
3612 +#define ETHERDMA_OUT_TOK (1<<6)
3613 +#define ETHERDMA_OUT_HEN (1<<5)
3614 +#define ETHERDMA_OUT_CEN (1<<4)
3615 +#define ETHERDMA_OUT_PEN (1<<3)
3616 +#define ETHERDMA_OUT_OEN (1<<2)
3617 +#define ETHERDMA_OUT_LD (1<<1)
3618 +#define ETHERDMA_OUT_FD (1<<0)
3621 + (ETHERDMA_IN_OVR | ETHERDMA_IN_CRC | ETHERDMA_IN_CV | ETHERDMA_IN_LE)
3623 + (ETHERDMA_OUT_LC | ETHERDMA_OUT_EC | ETHERDMA_OUT_ED | \
3624 + ETHERDMA_OUT_OF | ETHERDMA_OUT_UND)
3626 +#define IS_RCV_ROK(X) (((X) & (1<<2)) >> 2) /* Receive Okay */
3627 +#define IS_RCV_FM(X) (((X) & (1<<3)) >> 3) /* Is Filter Match */
3628 +#define IS_RCV_MP(X) (((X) & (1<<4)) >> 4) /* Is it MP */
3629 +#define IS_RCV_BP(X) (((X) & (1<<5)) >> 5) /* Is it BP */
3630 +#define IS_RCV_VLT(X) (((X) & (1<<6)) >> 6) /* VLAN Tag Detect */
3631 +#define IS_RCV_CF(X) (((X) & (1<<7)) >> 7) /* Control Frame */
3632 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<8)) >> 8) /* Receive Overflow */
3633 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<9)) >> 9) /* CRC Error */
3634 +#define IS_RCV_CV_ERR(X) (((X) & (1<<10))>>10) /* Code Violation */
3635 +#define IS_RCV_DB_ERR(X) (((X) & (1<<11))>>11) /* Dribble Bits */
3636 +#define IS_RCV_LE_ERR(X) (((X) & (1<<12))>>12) /* Length error */
3637 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<13))>>13) /* Length Out of
3639 +#define IS_RCV_CES_ERR(X) (((X) & (1<<14))>>14) /* Preamble error */
3640 +#define RCVPKT_LENGTH(X) (((X) & 0xFFFF0000)>>16) /* Length of the
3641 + received packet */
3643 +#define IS_TX_TOK(X) (((X) & (1<<6) ) >> 6 ) /* Transmit Okay */
3644 +#define IS_TX_MP(X) (((X) & (1<<7) ) >> 7 ) /* Multicast */
3646 +#define IS_TX_BP(X) (((X) & (1<<8) ) >> 8 ) /* Broadcast */
3647 +#define IS_TX_UND_ERR(X) (((X) & (1<<9) ) >> 9 ) /* Transmit FIFO
3649 +#define IS_TX_OF_ERR(X) (((X) & (1<<10)) >>10 ) /* Oversized frame */
3650 +#define IS_TX_ED_ERR(X) (((X) & (1<<11)) >>11 ) /* Excessive
3652 +#define IS_TX_EC_ERR(X) (((X) & (1<<12)) >>12 ) /* Excessive
3654 +#define IS_TX_LC_ERR(X) (((X) & (1<<13)) >>13 ) /* Late Collision */
3655 +#define IS_TX_TD_ERR(X) (((X) & (1<<14)) >>14 ) /* Transmit deferred*/
3656 +#define IS_TX_CRC_ERR(X) (((X) & (1<<15)) >>15 ) /* CRC Error */
3657 +#define IS_TX_LE_ERR(X) (((X) & (1<<16)) >>16 ) /* Length Error */
3659 +#define TX_COLLISION_COUNT(X) (((X) & 0x001E0000u)>>17) /* Collision Count */
3661 +#endif /* RC32355_ETHER_H */
3663 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
3664 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32355.h 1970-01-01 01:00:00.000000000 +0100
3665 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32355.h 2006-01-10 00:32:33.000000000 +0100
3667 +/**************************************************************************
3669 + * BRIEF MODULE DESCRIPTION
3670 + * Definitions for IDT RC32355 CPU.
3672 + * Copyright 2004 IDT Inc.
3673 + * Author: Integrated Device Technology Inc. rischelp@idt.com
3676 + * This program is free software; you can redistribute it and/or modify it
3677 + * under the terms of the GNU General Public License as published by the
3678 + * Free Software Foundation; either version 2 of the License, or (at your
3679 + * option) any later version.
3681 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3682 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3683 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3684 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3685 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3686 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3687 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3688 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3689 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3690 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3692 + * You should have received a copy of the GNU General Public License along
3693 + * with this program; if not, write to the Free Software Foundation, Inc.,
3694 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3700 + **************************************************************************
3704 +#ifndef _RC32355_H_
3705 +#define _RC32355_H_
3707 +#include <linux/delay.h>
3708 +#include <asm/io.h>
3710 +/* Base address of internal registers */
3711 +#define RC32355_REG_BASE 0x18000000
3713 +/* System ID Registers */
3714 +#define CPU_SYSID (RC32355_REG_BASE + 0x00018)
3715 +#define CPU_BTADDR (RC32355_REG_BASE + 0x0001c)
3716 +#define CPU_REV (RC32355_REG_BASE + 0x0002c)
3718 +/* Reset Controller */
3719 +#define RESET_CNTL (RC32355_REG_BASE + 0x08000)
3721 +/* Device Controller */
3722 +#define DEV0_BASE (RC32355_REG_BASE + 0x10000)
3723 +#define DEV0_MASK (RC32355_REG_BASE + 0x10004)
3724 +#define DEV0_CNTL (RC32355_REG_BASE + 0x10008)
3725 +#define DEV0_TIMING (RC32355_REG_BASE + 0x1000c)
3726 +#define DEV_REG_OFFSET 0x10
3728 +/* SDRAM Controller */
3729 +#define SDRAM0_BASE (RC32355_REG_BASE + 0x18000)
3730 +#define SDRAM0_MASK (RC32355_REG_BASE + 0x18004)
3731 +#define SDRAM1_BASE (RC32355_REG_BASE + 0x18008)
3732 +#define SDRAM1_MASK (RC32355_REG_BASE + 0x1800c)
3733 +#define SDRAM_CNTL (RC32355_REG_BASE + 0x18010)
3736 +#define BUS_ARB_CNTL0 (RC32355_REG_BASE + 0x20000)
3737 +#define BUS_ARB_CNTL1 (RC32355_REG_BASE + 0x20004)
3739 +/* Counters/Timers */
3740 +#define TIMER0_COUNT (RC32355_REG_BASE + 0x28000)
3741 +#define TIMER0_COMPARE (RC32355_REG_BASE + 0x28004)
3742 +#define TIMER0_CNTL (RC32355_REG_BASE + 0x28008)
3743 +#define TIMER_REG_OFFSET 0x0C
3745 +/* System Integrity */
3747 +/* Interrupt Controller */
3748 +#define IC_GROUP0_PEND (RC32355_REG_BASE + 0x30000)
3749 +#define IC_GROUP0_MASK (RC32355_REG_BASE + 0x30004)
3750 +#define IC_GROUP_OFFSET 0x08
3752 +#define NUM_INTR_GROUPS 5
3754 + * The IRQ mapping is as follows:
3757 + * --- -------------------
3758 + * 0 SW0 (IP0) SW0 intr
3759 + * 1 SW1 (IP1) SW1 intr
3760 + * - Int0 (IP2) mapped to GROUP0_IRQ_BASE
3761 + * - Int1 (IP3) mapped to GROUP1_IRQ_BASE
3762 + * - Int2 (IP4) mapped to GROUP2_IRQ_BASE
3763 + * - Int3 (IP5) mapped to GROUP3_IRQ_BASE
3764 + * - Int4 (IP6) mapped to GROUP4_IRQ_BASE
3765 + * 7 Int5 (IP7) CP0 Timer
3767 + * IRQ's 8 and up are all mapped to Int0-4 (IP2-IP6), which
3768 + * internally on the RC32355 is routed to the Expansion
3769 + * Interrupt Controller.
3771 +#define MIPS_CPU_TIMER_IRQ 7
3773 +#define GROUP0_IRQ_BASE 8 // Counter/Timers, UCW
3774 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) // DMA
3775 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) // ATM
3776 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) // TDM, Eth, USB, UARTs, I2C
3777 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32) // GPIO
3779 +#define RC32355_NR_IRQS (GROUP4_IRQ_BASE + 32)
3781 +/* DMA - see rc32355_dma.h for full list of registers */
3783 +#define RC32355_DMA_BASE (RC32355_REG_BASE + 0x38000)
3784 +#define DMA_CHAN_OFFSET 0x14
3786 +/* GPIO Controller */
3792 +#define RC32300_UART0_BASE (RC32355_REG_BASE + 0x50003)
3793 +#define RC32300_UART1_BASE (RC32355_REG_BASE + 0x50023)
3795 +#define RC32300_UART0_BASE (RC32355_REG_BASE + 0x50000)
3796 +#define RC32300_UART1_BASE (RC32355_REG_BASE + 0x50020)
3799 +#define RC32300_UART0_IRQ (GROUP3_IRQ_BASE + 14)
3800 +#define RC32300_UART1_IRQ (GROUP3_IRQ_BASE + 17)
3804 +/* Ethernet - see rc32355_eth.h for full list of registers */
3806 +#define RC32355_ETH_BASE (RC32355_REG_BASE + 0x60000)
3809 +#define IDT_CLOCK_MULT 2
3811 +/* Memory map of 79EB355 board */
3814 +#define RAM_BASE 0x00000000
3815 +#define RAM_SIZE (32*1024*1024)
3817 +/* SRAM (device 1) */
3818 +#define SRAM_BASE 0x02000000
3819 +#define SRAM_SIZE 0x00100000
3821 +/* FLASH (device 2) */
3822 +#define FLASH_BASE 0x0C000000
3823 +#define FLASH_SIZE 0x00C00000
3825 +/* ATM PHY (device 4) */
3826 +#define ATM_PHY_BASE 0x14000000
3828 +/* TDM switch (device 3) */
3829 +#define TDM_BASE 0x1A000000
3831 +/* LCD panel (device 3) */
3832 +#define LCD_BASE 0x1A002000
3834 +/* RTC (DS1511W) (device 3) */
3835 +#define RTC_BASE 0x1A004000
3837 +/* NVRAM (256 bytes internal to the DS1511 RTC) */
3838 +#define NVRAM_ADDR RTC_BASE + 0x10
3839 +#define NVRAM_DATA RTC_BASE + 0x13
3840 +#define NVRAM_ENVSIZE_OFF 4
3841 +#define NVRAM_ENVSTART_OFF 32
3843 +#endif /* _RC32355_H_ */
3844 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
3845 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_dma.h 1970-01-01 01:00:00.000000000 +0100
3846 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_dma.h 2006-01-10 00:32:33.000000000 +0100
3848 +/**************************************************************************
3850 + * BRIEF MODULE DESCRIPTION
3851 + * RC32365/336 DMA hardware abstraction.
3853 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
3855 + * This program is free software; you can redistribute it and/or modify it
3856 + * under the terms of the GNU General Public License as published by the
3857 + * Free Software Foundation; either version 2 of the License, or (at your
3858 + * option) any later version.
3860 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3861 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3862 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
3863 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3864 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3865 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
3866 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
3867 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3868 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3869 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3871 + * You should have received a copy of the GNU General Public License along
3872 + * with this program; if not, write to the Free Software Foundation, Inc.,
3873 + * 675 Mass Ave, Cambridge, MA 02139, USA.
3876 + **************************************************************************
3877 + * May 2004 P. Sadik.
3883 + **************************************************************************
3886 +#ifndef __IDT_RC32365_DMA_H__
3887 +#define __IDT_RC32365_DMA_H__
3891 + DMA0_PhysicalAddress = 0x18038000,
3892 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
3894 + DMA0_VirtualAddress = 0xb8038000,
3895 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
3899 + * DMA descriptor (in physical memory).
3902 +typedef struct DMAD_s
3904 + u32 control ; // Control. use DMAD_*
3905 + u32 ca ; // Current Address.
3906 + u32 devcs ; // Device control and status.
3907 + u32 link ; // Next descriptor in chain.
3908 +} volatile *DMAD_t ;
3912 + DMAD_size = sizeof (struct DMAD_s),
3913 + DMAD_count_b = 0, // in DMAD_t -> control
3914 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
3915 + DMAD_ds_b = 20, // in DMAD_t -> control
3916 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
3917 + DMAD_ds_extToMem0_v = 0,
3918 + DMAD_ds_memToExt0_v = 1,
3919 + DMAD_ds_extToMem1_v = 0,
3920 + DMAD_ds_memToExt1_v = 1,
3921 + DMAD_ds_ethRcv0_v = 0,
3922 + DMAD_ds_ethXmt0_v = 0,
3923 + DMAD_ds_ethRcv1_v = 0,
3924 + DMAD_ds_ethXmt2_v = 0,
3925 + DMAD_ds_memToFifo_v = 0,
3926 + DMAD_ds_fifoToMem_v = 0,
3927 + DMAD_ds_rng_de_v = 1,//randomNumberGenerator on LC/DE
3928 + DMAD_ds_pciToMem_v = 0,
3929 + DMAD_ds_memToPci_v = 0,
3930 + DMAD_ds_securityInput_v = 0,
3931 + DMAD_ds_securityOutput_v = 0,
3932 + DMAD_ds_rng_se_v = 0,//randomNumberGenerator on SE
3934 + DMAD_devcmd_b = 22, // in DMAD_t -> control
3935 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
3936 + DMAD_devcmd_byte_v = 0, //memory-to-memory
3937 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
3938 + DMAD_devcmd_word_v = 2, //memory-to-memory
3939 + DMAD_devcmd_2words_v = 3, //memory-to-memory
3940 + DMAD_devcmd_4words_v = 4, //memory-to-memory
3941 + DMAD_devcmd_6words_v = 5, //memory-to-memory
3942 + DMAD_devcmd_8words_v = 6, //memory-to-memory
3943 + DMAD_devcmd_16words_v = 7, //memory-to-memory
3944 + DMAD_cof_b = 25, // chain on finished
3945 + DMAD_cof_m = 0x02000000, //
3946 + DMAD_cod_b = 26, // chain on done
3947 + DMAD_cod_m = 0x04000000, //
3948 + DMAD_iof_b = 27, // interrupt on finished
3949 + DMAD_iof_m = 0x08000000, //
3950 + DMAD_iod_b = 28, // interrupt on done
3951 + DMAD_iod_m = 0x10000000, //
3952 + DMAD_t_b = 29, // terminated
3953 + DMAD_t_m = 0x20000000, //
3954 + DMAD_d_b = 30, // done
3955 + DMAD_d_m = 0x40000000, //
3956 + DMAD_f_b = 31, // finished
3957 + DMAD_f_m = 0x80000000, //
3961 + * DMA register (within Internal Register Map).
3966 + u32 dmac ; // Control.
3967 + u32 dmas ; // Status.
3968 + u32 dmasm ; // Mask.
3969 + u32 dmadptr ; // Descriptor pointer.
3970 + u32 dmandptr ; // Next descriptor pointer.
3973 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
3975 +//DMA_Channels use DMACH_count instead
3979 + DMAC_run_b = 0, //
3980 + DMAC_run_m = 0x00000001, //
3981 + DMAC_dm_b = 1, // done mask
3982 + DMAC_dm_m = 0x00000002, //
3983 + DMAC_mode_b = 2, //
3984 + DMAC_mode_m = 0x0000000c, //
3985 + DMAC_mode_auto_v = 0,
3986 + DMAC_mode_burst_v = 1,
3987 + DMAC_mode_transfer_v = 2, //usually used
3988 + DMAC_mode_reserved_v = 3,
3990 + DMAC_a_m = 0x00000010, //
3992 + DMAS_f_b = 0, // finished (sticky)
3993 + DMAS_f_m = 0x00000001, //
3994 + DMAS_d_b = 1, // done (sticky)
3995 + DMAS_d_m = 0x00000002, //
3996 + DMAS_c_b = 2, // chain (sticky)
3997 + DMAS_c_m = 0x00000004, //
3998 + DMAS_e_b = 3, // error (sticky)
3999 + DMAS_e_m = 0x00000008, //
4000 + DMAS_h_b = 4, // halt (sticky)
4001 + DMAS_h_m = 0x00000010, //
4003 + DMASM_f_b = 0, // finished (1=mask)
4004 + DMASM_f_m = 0x00000001, //
4005 + DMASM_d_b = 1, // done (1=mask)
4006 + DMASM_d_m = 0x00000002, //
4007 + DMASM_c_b = 2, // chain (1=mask)
4008 + DMASM_c_m = 0x00000004, //
4009 + DMASM_e_b = 3, // error (1=mask)
4010 + DMASM_e_m = 0x00000008, //
4011 + DMASM_h_b = 4, // halt (1=mask)
4012 + DMASM_h_m = 0x00000010, //
4016 + * DMA channel definitions
4021 + DMACH_ethRcv0 = 0,
4022 + DMACH_ethXmt0 = 1,
4023 + DMACH_ethRcv1 = 2,
4024 + DMACH_ethXmt2 = 3,
4025 + DMACH_pciToMem = 4,
4026 + DMACH_memToPci = 5,
4027 + DMACH_securityInput = 6,
4028 + DMACH_securityOutput = 7,
4031 + DMACH_count //must be last
4035 +typedef struct DMAC_s
4037 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
4038 +} volatile *DMA_t ;
4042 + * External DMA parameters
4047 + DMADEVCMD_ts_b = 0, // ts field in devcmd
4048 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
4049 + DMADEVCMD_ts_byte_v = 0,
4050 + DMADEVCMD_ts_halfword_v = 1,
4051 + DMADEVCMD_ts_word_v = 2,
4052 + DMADEVCMD_ts_2word_v = 3,
4053 + DMADEVCMD_ts_4word_v = 4,
4054 + DMADEVCMD_ts_6word_v = 5,
4055 + DMADEVCMD_ts_8word_v = 6,
4056 + DMADEVCMD_ts_16word_v = 7
4060 +#if 1 // aws - Compatibility.
4061 +# define EXTDMA_ts_b DMADEVCMD_ts_b
4062 +# define EXTDMA_ts_m DMADEVCMD_ts_m
4063 +# define EXTDMA_ts_byte_v DMADEVCMD_ts_byte_v
4064 +# define EXTDMA_ts_halfword_v DMADEVCMD_ts_halfword_v
4065 +# define EXTDMA_ts_word_v DMADEVCMD_ts_word_v
4066 +# define EXTDMA_ts_2word_v DMADEVCMD_ts_2word_v
4067 +# define EXTDMA_ts_4word_v DMADEVCMD_ts_4word_v
4068 +# define EXTDMA_ts_6word_v DMADEVCMD_ts_6word_v
4069 +# define EXTDMA_ts_8word_v DMADEVCMD_ts_8word_v
4070 +# define EXTDMA_ts_16word_v DMADEVCMD_ts_16word_v
4071 +#endif // aws - Compatibility.
4073 +#endif // __IDT_RC32365_DMA_H__
4074 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
4075 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h 1970-01-01 01:00:00.000000000 +0100
4076 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_dma_v.h 2006-01-10 00:32:33.000000000 +0100
4078 +/**************************************************************************
4080 + * BRIEF MODULE DESCRIPTION
4081 + * RC32365/336 DMA interface routines.
4083 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4085 + * This program is free software; you can redistribute it and/or modify it
4086 + * under the terms of the GNU General Public License as published by the
4087 + * Free Software Foundation; either version 2 of the License, or (at your
4088 + * option) any later version.
4090 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4091 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4092 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4093 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4094 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4095 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4096 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4097 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4098 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4099 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4101 + * You should have received a copy of the GNU General Public License along
4102 + * with this program; if not, write to the Free Software Foundation, Inc.,
4103 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4106 + **************************************************************************
4107 + * May 2004 P. Sadik.
4113 + **************************************************************************
4116 +#ifndef __IDT_RC32365_DMA_V_H__
4117 +#define __IDT_RC32365_DMA_V_H__
4120 +#include <asm/idt-boards/rc32300/rc32300.h>
4121 +#include <asm/idt-boards/rc32300/rc32365_dma.h>
4122 +#include <asm/idt-boards/rc32300/rc32365.h>
4124 +#define DMA_CHAN_OFFSET 0x14
4125 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
4126 +#define IS_DMA_FINISHED(X) (((X) & (DMAD_f_m)) != 0)
4127 +#define IS_DMA_DONE(X) (((X) & (DMAD_d_m)) != 0)
4129 +#define DMA_COUNT(count) \
4130 + ((count) & DMAD_count_m)
4132 +#define DMA_HALT_TIMEOUT 500
4134 +static inline int rc32365_halt_dma(DMA_Chan_t ch)
4137 + if (local_readl(&ch->dmac) & DMAC_run_m) {
4138 + local_writel(0, &ch->dmac);
4140 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
4141 + if (local_readl(&ch->dmas) & DMAS_h_m) {
4142 + local_writel(0, &ch->dmas);
4149 + return timeout ? 0 : 1;
4153 +static inline void rc32365_start_dma(DMA_Chan_t ch, u32 dma_addr)
4155 + local_writel(0, &ch->dmandptr);
4156 + local_writel(dma_addr, &ch->dmadptr);
4159 +static inline void rc32365_chain_dma(DMA_Chan_t ch, u32 dma_addr)
4161 + local_writel(dma_addr, &ch->dmandptr);
4163 +#endif //__IDT_RC32365_DMA_V_H__
4164 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
4165 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_eth.h 1970-01-01 01:00:00.000000000 +0100
4166 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_eth.h 2006-01-10 00:32:33.000000000 +0100
4168 +/**************************************************************************
4170 + * BRIEF MODULE DESCRIPTION
4171 + * RC32365/336 Ethernet hardware abstraction.
4173 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4175 + * This program is free software; you can redistribute it and/or modify it
4176 + * under the terms of the GNU General Public License as published by the
4177 + * Free Software Foundation; either version 2 of the License, or (at your
4178 + * option) any later version.
4180 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4181 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4182 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4183 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4184 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4185 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4186 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4187 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4188 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4189 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4191 + * You should have received a copy of the GNU General Public License along
4192 + * with this program; if not, write to the Free Software Foundation, Inc.,
4193 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4196 + **************************************************************************
4197 + * May 2004 P. Sadik.
4203 + **************************************************************************
4206 +#ifndef __IDT_RC32365_ETH_H__
4207 +#define __IDT_RC32365_ETH_H__
4211 + ETH0_PhysicalAddress = 0x18058000,
4212 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
4213 + ETH0_VirtualAddress = 0xb8058000,
4215 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
4217 + ETH1_PhysicalAddress = 0x18060000,
4218 + ETH1_VirtualAddress = 0xb8060000, // Default
4228 + u32 ethu0 [4] ; // Reserved.
4231 + u32 eth_u1 [10] ; // Reserved.
4233 + u32 eth_u2 [42] ; // Reserved.
4248 + u32 eth_u9 [50] ; // Reserved.
4255 + u32 eth_u10 ; // Reserved.
4263 + u32 eth_u11 ; // Reserved.
4264 + u32 eth_u12 ; // Reserved.
4272 + ETHINTFC_en_b = 0,
4273 + ETHINTFC_en_m = 0x00000001,
4274 + ETHINTFC_its_b = 1,
4275 + ETHINTFC_its_m = 0x00000002,
4276 + ETHINTFC_rip_b = 2,
4277 + ETHINTFC_rip_m = 0x00000004,
4278 + ETHINTFC_jam_b = 3,
4279 + ETHINTFC_jam_m = 0x00000008,
4280 + ETHINTFC_ovr_b = 4,
4281 + ETHINTFC_ovr_m = 0x00000010,
4282 + ETHINTFC_und_b = 5,
4283 + ETHINTFC_und_m = 0x00000020,
4285 + ETHFIFOTT_tth_b = 0,
4286 + ETHFIFOTT_tth_m = 0x0000007f,
4289 + ETHARC_pro_m = 0x00000001,
4291 + ETHARC_am_m = 0x00000002,
4293 + ETHARC_afm_m = 0x00000004,
4295 + ETHARC_ab_m = 0x00000008,
4297 + ETHSAL_byte5_b = 0,
4298 + ETHSAL_byte5_m = 0x000000ff,
4299 + ETHSAL_byte4_b = 8,
4300 + ETHSAL_byte4_m = 0x0000ff00,
4301 + ETHSAL_byte3_b = 16,
4302 + ETHSAL_byte3_m = 0x00ff0000,
4303 + ETHSAL_byte2_b = 24,
4304 + ETHSAL_byte2_m = 0xff000000,
4306 + ETHSAH_byte1_b = 0,
4307 + ETHSAH_byte1_m = 0x000000ff,
4308 + ETHSAH_byte0_b = 8,
4309 + ETHSAH_byte0_m = 0x0000ff00,
4312 + ETHGPF_ptv_m = 0x0000ffff,
4315 + ETHPFS_pfd_m = 0x00000001,
4317 + ETHCFSA0_cfsa4_b = 0,
4318 + ETHCFSA0_cfsa4_m = 0x000000ff,
4319 + ETHCFSA0_cfsa5_b = 8,
4320 + ETHCFSA0_cfsa5_m = 0x0000ff00,
4322 + ETHCFSA1_cfsa2_b = 0,
4323 + ETHCFSA1_cfsa2_m = 0x000000ff,
4324 + ETHCFSA1_cfsa3_b = 8,
4325 + ETHCFSA1_cfsa3_m = 0x0000ff00,
4327 + ETHCFSA2_cfsa0_b = 0,
4328 + ETHCFSA2_cfsa0_m = 0x000000ff,
4329 + ETHCFSA2_cfsa1_b = 8,
4330 + ETHCFSA2_cfsa1_m = 0x0000ff00,
4333 + ETHMAC1_re_m = 0x00000001,
4334 + ETHMAC1_paf_b = 1,
4335 + ETHMAC1_paf_m = 0x00000002,
4336 + ETHMAC1_rfc_b = 2,
4337 + ETHMAC1_rfc_m = 0x00000004,
4338 + ETHMAC1_tfc_b = 3,
4339 + ETHMAC1_tfc_m = 0x00000008,
4341 + ETHMAC1_lb_m = 0x00000010,
4342 + ETHMAC1_mr_b = 31,
4343 + ETHMAC1_mr_m = 0x80000000,
4346 + ETHMAC2_fd_m = 0x00000001,
4347 + ETHMAC2_flc_b = 1,
4348 + ETHMAC2_flc_m = 0x00000002,
4349 + ETHMAC2_hfe_b = 2,
4350 + ETHMAC2_hfe_m = 0x00000004,
4352 + ETHMAC2_dc_m = 0x00000008,
4353 + ETHMAC2_cen_b = 4,
4354 + ETHMAC2_cen_m = 0x00000010,
4356 + ETHMAC2_pe_m = 0x00000020,
4357 + ETHMAC2_vpe_b = 6,
4358 + ETHMAC2_vpe_m = 0x00000040,
4359 + ETHMAC2_ape_b = 7,
4360 + ETHMAC2_ape_m = 0x00000080,
4361 + ETHMAC2_ppe_b = 8,
4362 + ETHMAC2_ppe_m = 0x00000100,
4363 + ETHMAC2_lpe_b = 9,
4364 + ETHMAC2_lpe_m = 0x00000200,
4365 + ETHMAC2_nb_b = 12,
4366 + ETHMAC2_nb_m = 0x00001000,
4367 + ETHMAC2_bp_b = 13,
4368 + ETHMAC2_bp_m = 0x00002000,
4369 + ETHMAC2_ed_b = 14,
4370 + ETHMAC2_ed_m = 0x00004000,
4372 + ETHIPGT_ipgt_b = 0,
4373 + ETHIPGT_ipgt_m = 0x0000007f,
4375 + ETHIPGR_ipgr2_b = 0,
4376 + ETHIPGR_ipgr2_m = 0x0000007f,
4377 + ETHIPGR_ipgr1_b = 8,
4378 + ETHIPGR_ipgr1_m = 0x00007f00,
4380 + ETHCLRT_maxret_b = 0,
4381 + ETHCLRT_maxret_m = 0x0000000f,
4382 + ETHCLRT_colwin_b = 8,
4383 + ETHCLRT_colwin_m = 0x00003f00,
4385 + ETHMAXF_maxf_b = 0,
4386 + ETHMAXF_maxf_m = 0x0000ffff,
4388 + ETHMTEST_tb_b = 2,
4389 + ETHMTEST_tb_m = 0x00000004,
4392 + ETHMCP_div_m = 0x000000ff,
4394 + MIIMCFG_rsv_b = 0,
4395 + MIIMCFG_rsv_m = 0x0000000c,
4398 + MIIMCMD_rd_m = 0x00000001,
4399 + MIIMCMD_scn_b = 1,
4400 + MIIMCMD_scn_m = 0x00000002,
4402 + MIIMADDR_regaddr_b = 0,
4403 + MIIMADDR_regaddr_m = 0x0000001f,
4404 + MIIMADDR_phyaddr_b = 8,
4405 + MIIMADDR_phyaddr_m = 0x00001f00,
4407 + MIIMWTD_wdata_b = 0,
4408 + MIIMWTD_wdata_m = 0x0000ffff,
4410 + MIIMRDD_rdata_b = 0,
4411 + MIIMRDD_rdata_m = 0x0000ffff,
4413 + MIIMIND_bsy_b = 0,
4414 + MIIMIND_bsy_m = 0x00000001,
4415 + MIIMIND_scn_b = 1,
4416 + MIIMIND_scn_m = 0x00000002,
4418 + MIIMIND_nv_m = 0x00000004,
4423 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
4428 + ETHRX_fd_m = 0x00000001,
4430 + ETHRX_ld_m = 0x00000002,
4432 + ETHRX_rok_m = 0x00000004,
4434 + ETHRX_fm_m = 0x00000008,
4436 + ETHRX_mp_m = 0x00000010,
4438 + ETHRX_bp_m = 0x00000020,
4440 + ETHRX_vlt_m = 0x00000040,
4442 + ETHRX_cf_m = 0x00000080,
4444 + ETHRX_ovr_m = 0x00000100,
4446 + ETHRX_crc_m = 0x00000200,
4448 + ETHRX_cv_m = 0x00000400,
4450 + ETHRX_db_m = 0x00000800,
4452 + ETHRX_le_m = 0x00001000,
4454 + ETHRX_lor_m = 0x00002000,
4456 + ETHRX_ces_m = 0x00004000,
4457 + ETHRX_length_b = 16,
4458 + ETHRX_length_m = 0xffff0000,
4461 + ETHTX_fd_m = 0x00000001,
4463 + ETHTX_ld_m = 0x00000002,
4465 + ETHTX_oen_m = 0x00000004,
4467 + ETHTX_pen_m = 0x00000008,
4469 + ETHTX_cen_m = 0x00000010,
4471 + ETHTX_hen_m = 0x00000020,
4473 + ETHTX_tok_m = 0x00000040,
4475 + ETHTX_mp_m = 0x00000080,
4477 + ETHTX_bp_m = 0x00000100,
4479 + ETHTX_und_m = 0x00000200,
4481 + ETHTX_of_m = 0x00000400,
4483 + ETHTX_ed_m = 0x00000800,
4485 + ETHTX_ec_m = 0x00001000,
4487 + ETHTX_lc_m = 0x00002000,
4489 + ETHTX_td_m = 0x00004000,
4491 + ETHTX_crc_m = 0x00008000,
4493 + ETHTX_le_m = 0x00010000,
4495 + ETHTX_cc_m = 0x001E0000,
4500 + ETH0_IPABMC_PhysicalAddress = 0x18040010,
4501 + ETH0_IPABMC_VirtualAddress = 0xb8040000,
4502 + ETH1_IPABMC_PhysicalAddress = 0x18040018,
4503 + ETH1_IPABMC_VirtualAddress = 0xb8040018,
4510 +}volatile *IPABM_ETH_t;
4511 +#endif //__IDT_RC32365_ETH_H__
4512 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
4513 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h 1970-01-01 01:00:00.000000000 +0100
4514 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_eth_v.h 2006-01-10 00:32:33.000000000 +0100
4516 +/**************************************************************************
4518 + * BRIEF MODULE DESCRIPTION
4519 + * RC32365/336 Ethernet status checking.
4521 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4523 + * This program is free software; you can redistribute it and/or modify it
4524 + * under the terms of the GNU General Public License as published by the
4525 + * Free Software Foundation; either version 2 of the License, or (at your
4526 + * option) any later version.
4528 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4529 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4530 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4531 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4532 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4533 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4534 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4535 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4536 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4537 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4539 + * You should have received a copy of the GNU General Public License along
4540 + * with this program; if not, write to the Free Software Foundation, Inc.,
4541 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4544 + **************************************************************************
4545 + * May 2004 P. Sadik.
4551 + **************************************************************************
4554 +#ifndef __IDT_RC32365_ETH_V_H__
4555 +#define __IDT_RC32365_ETH_V_H__
4556 +#include <asm/idt-boards/rc32300/rc32365_eth.h>
4558 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
4559 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
4560 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
4561 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
4562 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
4563 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
4564 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
4565 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
4566 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
4567 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
4568 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
4570 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
4572 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
4573 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
4574 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
4575 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
4576 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
4577 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
4578 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
4579 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
4580 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
4581 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
4582 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
4583 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
4584 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
4585 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
4587 +#endif //__IDT_RC32365_ETH_V_H__
4588 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
4589 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h 1970-01-01 01:00:00.000000000 +0100
4590 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio.h 2006-01-10 00:32:33.000000000 +0100
4592 +/**************************************************************************
4594 + * BRIEF MODULE DESCRIPTION
4595 + * RC32365/336 GPIO hardware abstraction.
4597 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4599 + * This program is free software; you can redistribute it and/or modify it
4600 + * under the terms of the GNU General Public License as published by the
4601 + * Free Software Foundation; either version 2 of the License, or (at your
4602 + * option) any later version.
4604 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4605 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4606 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4607 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4608 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4609 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4610 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4611 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4612 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4613 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4615 + * You should have received a copy of the GNU General Public License along
4616 + * with this program; if not, write to the Free Software Foundation, Inc.,
4617 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4620 + **************************************************************************
4621 + * May 2004 P. Sadik.
4627 + **************************************************************************
4630 +#ifndef __IDT_RC32365_GPIO_H__
4631 +#define __IDT_RC32365_GPIO_H__
4635 + GPIO0_PhysicalAddress = 0x18048000,
4636 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
4638 + GPIO0_VirtualAddress = 0xb8048000,
4639 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
4644 + u32 gpiofunc; /* GPIO Function Register
4645 + * gpiofunc[x]==0 bit = gpio
4646 + * func[x]==1 bit = altfunc
4648 + u32 gpiocfg; /* GPIO Configuration Register
4649 + * gpiocfg[x]==0 bit = input
4650 + * gpiocfg[x]==1 bit = output
4652 + u32 gpiod; /* GPIO Data Register
4653 + * gpiod[x] read/write gpio pinX status
4655 + u32 gpioilevel; /* GPIO Interrupt Status Register
4656 + * interrupt level (see gpioistat)
4658 + u32 gpioistat; /* Gpio Interrupt Status Register
4659 + * istat[x] = (gpiod[x] == level[x])
4660 + * cleared in ISR (STICKY bits)
4662 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
4663 +} volatile * GPIO_t ;
4667 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
4668 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
4669 + GPIO_input_v = 0, // gpiocfg use pin as input.
4670 + GPIO_output_v = 1, // gpiocfg use pin as output.
4672 + GPIO_pin0_m = 0x00000001,
4674 + GPIO_pin1_m = 0x00000002,
4676 + GPIO_pin2_m = 0x00000004,
4678 + GPIO_pin3_m = 0x00000008,
4680 + GPIO_pin4_m = 0x00000010,
4682 + GPIO_pin5_m = 0x00000020,
4684 + GPIO_pin6_m = 0x00000040,
4686 + GPIO_pin7_m = 0x00000080,
4688 + GPIO_pin8_m = 0x00000100,
4690 + GPIO_pin9_m = 0x00000200,
4691 + GPIO_pin10_b = 10,
4692 + GPIO_pin10_m = 0x00000400,
4693 + GPIO_pin11_b = 11,
4694 + GPIO_pin11_m = 0x00000800,
4695 + GPIO_pin12_b = 12,
4696 + GPIO_pin12_m = 0x00001000,
4697 + GPIO_pin13_b = 13,
4698 + GPIO_pin13_m = 0x00002000,
4699 + GPIO_pin14_b = 14,
4700 + GPIO_pin14_m = 0x00004000,
4701 + GPIO_pin15_b = 15,
4702 + GPIO_pin15_m = 0x00008000,
4704 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
4706 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
4707 + GPIO_u0sout_m = GPIO_pin0_m,
4708 + GPIO_u0sout_cfg_v = GPIO_output_v,
4710 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
4711 + GPIO_u0sinp_m = GPIO_pin1_m,
4712 + GPIO_u0sinp_cfg_v = GPIO_input_v,
4714 + GPIO_maddr22_b = GPIO_pin2_b, // M&P bus bit 22.
4715 + GPIO_maddr22_m = GPIO_pin2_m,
4716 + GPIO_maddr22_cfg_v = GPIO_output_v,
4718 + GPIO_maddr23_b = GPIO_pin3_b, // M&P bus bit 23.
4719 + GPIO_maddr23_m = GPIO_pin3_m,
4720 + GPIO_maddr23_cfg_v = GPIO_output_v,
4722 + GPIO_maddr24_b = GPIO_pin4_b, // M&P bus bit 24.
4723 + GPIO_maddr24_m = GPIO_pin4_m,
4724 + GPIO_maddr24_cfg_v = GPIO_output_v,
4726 + GPIO_maddr25_b = GPIO_pin5_b, // M&P bus bit 25.
4727 + GPIO_maddr25_m = GPIO_pin5_m,
4728 + GPIO_maddr25_cfg_v = GPIO_output_v,
4730 + GPIO_rngclk_b = GPIO_pin6_b, // reserved.
4731 + GPIO_rngclk_m = GPIO_pin6_m,
4732 + GPIO_rngclk_cfg_v = GPIO_input_v,
4734 + GPIO_sdckenp_b = GPIO_pin7_b, // reserved.
4735 + GPIO_sdckenp_m = GPIO_pin7_m,
4736 + GPIO_sdckenp_cfg_v = GPIO_output_v,
4738 + GPIO_cen1_b = GPIO_pin8_b, // reserved.
4739 + GPIO_cen1_m = GPIO_pin8_m,
4740 + GPIO_cen1_cfg_v = GPIO_output_v,
4742 + GPIO_cen2_b = GPIO_pin9_b, // reserved.
4743 + GPIO_cen2_m = GPIO_pin9_m,
4744 + GPIO_cen2_cfg_v = GPIO_output_v,
4746 + GPIO_regn_b = GPIO_pin10_b, // reserved.
4747 + GPIO_regn_m = GPIO_pin10_m,
4748 + GPIO_regn_cfg_v = GPIO_output_v,
4750 + GPIO_iordn_b = GPIO_pin11_b, // reserved.
4751 + GPIO_iordn_m = GPIO_pin11_m,
4752 + GPIO_iordn_cfg_v = GPIO_output_v,
4754 + GPIO_iowrn_b = GPIO_pin12_b, // reserved.
4755 + GPIO_iowrn_m = GPIO_pin12_m,
4756 + GPIO_iowrn_cfg_v = GPIO_output_v,
4758 + GPIO_pcireqn2_b = GPIO_pin13_b, // PCI messaging int.
4759 + GPIO_pcireqn2_m = GPIO_pin13_m,
4760 + GPIO_pcireqn2_cfg_v = GPIO_input_v,
4762 + GPIO_pcigntn2_b = GPIO_pin14_b, // PCI messaging int.
4763 + GPIO_pcigntn2_m = GPIO_pin14_m,
4764 + GPIO_pcigntn2_cfg_v = GPIO_output_v,
4766 + GPIO_pcimuintn_b = GPIO_pin15_b, // PCI messaging int.
4767 + GPIO_pcimuintn_m = GPIO_pin15_m,
4768 + GPIO_pcimuintn_cfg_v= GPIO_output_v,
4772 +#endif //__IDT_RC32365_GPIO_H__
4773 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
4774 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h 1970-01-01 01:00:00.000000000 +0100
4775 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_gpio_v.h 2006-01-10 00:32:33.000000000 +0100
4777 +/**************************************************************************
4779 + * BRIEF MODULE DESCRIPTION
4780 + * Routines to set/clear/toggle GPIO on RC32365
4782 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4784 + * This program is free software; you can redistribute it and/or modify it
4785 + * under the terms of the GNU General Public License as published by the
4786 + * Free Software Foundation; either version 2 of the License, or (at your
4787 + * option) any later version.
4789 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4790 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4791 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4792 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4793 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4794 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4795 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4796 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4797 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4798 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4800 + * You should have received a copy of the GNU General Public License along
4801 + * with this program; if not, write to the Free Software Foundation, Inc.,
4802 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4805 + **************************************************************************
4806 + * May 2004 P. Sadik.
4812 + **************************************************************************
4814 +#ifndef __IDT_RC32365_GPIO_V_H__
4815 +#define __IDT_RC32365_GPIO_V_H__
4818 +#ifdef _LANGUAGE_ASSEMBLY
4819 +#define SET_GPIO(pin) \
4821 + ori t5,t5,0x8000 ; \
4826 +#define CLEAR_GPIO(pin) \
4828 + ori t5,t5,0x8000 ; \
4831 + ori t6,t6,0xFFFF; \
4832 + xori t6,t6,pin ; \
4836 +#define TOGGLE_GPIO(pin) \
4838 + ori t5,t5,0x8000 ; \
4840 + xori t4,t4,pin ; \
4843 +#else // !_LANGUAGE_ASSEMBLY
4844 +#include <asm/rc32300/types.h>
4845 +#include <asm/rc32300/rc32365_gpio.h>
4846 +#include <asm/rc32300/rc32365.h>
4848 +static inline void set_gpio(unsigned long pin)
4850 + idt_gpio->gpiod |= pin;
4853 +static inline void clear_gpio(unsigned long pin)
4855 + idt_gpio->gpiod &= ~pin;
4857 +static inline void toggle_gpio(unsigned long pin)
4859 + idt_gpio->gpiod ^= pin;
4861 +#define SET_GPIO(pin) set_gpio(pin)
4862 +#define CLEAR_GPIO(pin) clear_gpio(pin)
4863 +#define TOGGLE_GPIO(pin) toggle_gpio(pin)
4864 +#endif // _LANGUAGE_ASSEMBLY
4866 +#endif //__IDT_RC32365_GPIO_V_H__
4868 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
4869 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365.h 1970-01-01 01:00:00.000000000 +0100
4870 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365.h 2006-01-10 00:32:33.000000000 +0100
4872 +/**************************************************************************
4874 + * BRIEF MODULE DESCRIPTION
4875 + * Definitions for IDT RC32365 CPU.
4877 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
4879 + * This program is free software; you can redistribute it and/or modify it
4880 + * under the terms of the GNU General Public License as published by the
4881 + * Free Software Foundation; either version 2 of the License, or (at your
4882 + * option) any later version.
4884 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
4885 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4886 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
4887 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
4888 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4889 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
4890 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4891 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4892 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
4893 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4895 + * You should have received a copy of the GNU General Public License along
4896 + * with this program; if not, write to the Free Software Foundation, Inc.,
4897 + * 675 Mass Ave, Cambridge, MA 02139, USA.
4900 + **************************************************************************
4901 + * May 2004 P. Sadik.
4907 + **************************************************************************
4910 +#ifndef __IDT_RC32365_H__
4911 +#define __IDT_RC32365_H__
4913 +extern unsigned int cedar_za;
4915 +/* Base address of internal registers */
4916 +#define RC32365_REG_BASE 0x18000000
4918 +/* System ID Registers */
4919 +#define CPU_SYSID (RC32365_REG_BASE + 0x00018)
4920 +#define CPU_DEVTYPE (RC32365_REG_BASE + 0x0001c)
4922 +/* Reset Controller */
4923 +#define RESET_CNTL (RC32365_REG_BASE + 0x08000)
4924 +#define BOOT_VECTOR (RC32365_REG_BASE + 0x08004)
4926 +/* Device Controller */
4927 +#define DEV0_BASE (RC32365_REG_BASE + 0x10000)
4928 +#define DEV0_MASK (RC32365_REG_BASE + 0x10004)
4929 +#define DEV0_CNTL (RC32365_REG_BASE + 0x10008)
4930 +#define DEV0_TIMING (RC32365_REG_BASE + 0x1000c)
4931 +#define DEV_REG_OFFSET 0x10
4933 +/* SDRAM Controller */
4934 +#define SDRAM0_BASE (RC32365_REG_BASE + 0x18000)
4935 +#define SDRAM0_MASK (RC32365_REG_BASE + 0x18004)
4936 +#define SDRAM1_BASE (RC32365_REG_BASE + 0x18008)
4937 +#define SDRAM1_MASK (RC32365_REG_BASE + 0x1800c)
4938 +#define SDRAM_CNTL (RC32365_REG_BASE + 0x18010)
4940 +/* Counters/Timers */
4941 +#define TIMER0_COUNT (RC32365_REG_BASE + 0x20000)
4942 +#define TIMER0_COMPARE (RC32365_REG_BASE + 0x20004)
4943 +#define TIMER0_CNTL (RC32365_REG_BASE + 0x20008)
4944 +#define TIMER0_SELECT (RC32365_REG_BASE + 0x2000c)
4945 +#define TIMER_REG_OFFSET 0x10
4947 +/* System Integrity */
4949 +/* Interrupt Controller */
4950 +#define IC_GROUP0_PEND (RC32365_REG_BASE + 0x30000)
4951 +#define IC_GROUP0_TEST (RC32365_REG_BASE + 0x30004)
4952 +#define IC_GROUP0_MASK (RC32365_REG_BASE + 0x30008)
4953 +#define IC_GROUP_OFFSET 0x0c
4955 +#define NUM_INTR_GROUPS 5
4957 + * The IRQ mapping is as follows:
4960 + * --- -------------------
4961 + * 0 SW0 (IP0) SW0 intr
4962 + * 1 SW1 (IP1) SW1 intr
4963 + * - Int0 (IP2) mapped to GROUP0_IRQ_BASE
4964 + * - Int1 (IP3) mapped to GROUP1_IRQ_BASE
4965 + * - Int2 (IP4) mapped to GROUP2_IRQ_BASE
4966 + * - Int3 (IP5) mapped to GROUP3_IRQ_BASE
4967 + * - Int4 (IP6) mapped to GROUP4_IRQ_BASE
4968 + * 7 Int5 (IP7) CP0 Timer
4970 + * IRQ's 8 and up are all mapped to Int0-4 (IP2-IP6), which
4971 + * internally on the RC32365 is routed to the Expansion
4972 + * Interrupt Controller.
4974 +#define MIPS_CPU_TIMER_IRQ 7
4976 +#define GROUP0_IRQ_BASE 8 // Counter/Timers, UCW
4977 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) // DMA
4978 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) // RNG, SEC
4979 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) // Eth, PCI, UARTs
4980 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32) // GPIO
4982 +#define RC32365_NR_IRQS (GROUP4_IRQ_BASE + 32)
4984 +/* DMA - see rc32365_dma.h for full list of registers */
4986 +#define RC32365_DMA_BASE (RC32365_REG_BASE + 0x38000)
4987 +#define DMA_CHAN_OFFSET 0x14
4989 +/* GPIO Controller */
4990 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
4994 +#define RC32300_UART0_BASE (RC32365_REG_BASE + 0x50003)
4996 +#define RC32300_UART0_BASE (RC32365_REG_BASE + 0x50000)
4998 +#define RC32300_UART0_IRQ (GROUP3_IRQ_BASE + 0)
5000 +/* Ethernet - see rc32365_eth.h for full list of registers */
5002 +#define RC32365_ETH_BASE (RC32365_REG_BASE + 0x58000)
5004 +#define IDT_CLOCK_MULT 2
5006 +/* FLASH (device 1) */
5007 +#define FLASH_BASE 0x08000000
5008 +#define FLASH_SIZE 0x00800000
5010 +/* LCD 4-digit display (device 2) */
5011 +#define LCD_DIGIT0 0x0C000003
5012 +#define LCD_DIGIT1 0x0C000002
5013 +#define LCD_DIGIT2 0x0C000001
5014 +#define LCD_DIGIT3 0x0C000000
5016 +/* RTC (DS1553) (device 2) */
5017 +#define RTC_BASE 0x0c800000
5019 +#define NVRAM_BASE RTC_BASE
5020 +#define NVRAM_ENVSIZE_OFF 4
5021 +#define NVRAM_ENVSTART_OFF 32
5023 +/* Interrupts routed on 79EB365 board */
5024 +#define RC32365_PCI_INTA_IRQ (GROUP4_IRQ_BASE + 8)
5025 +#define RC32365_PCI_INTB_IRQ (GROUP4_IRQ_BASE + 9)
5026 +#define RC32365_PCI_INTC_IRQ (GROUP4_IRQ_BASE + 10)
5027 +#define RC32365_PCI_INTD_IRQ (GROUP4_IRQ_BASE + 11)
5029 +#define RAM_SIZE (32 * 1024 * 1024)
5031 +#endif //__IDT_RC32365_H__
5032 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
5033 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_pci.h 1970-01-01 01:00:00.000000000 +0100
5034 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_pci.h 2006-01-10 00:32:33.000000000 +0100
5036 +/**************************************************************************
5038 + * BRIEF MODULE DESCRIPTION
5039 + * Datatype declaration for IDT 79EB365/336 PCI
5041 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5043 + * This program is free software; you can redistribute it and/or modify it
5044 + * under the terms of the GNU General Public License as published by the
5045 + * Free Software Foundation; either version 2 of the License, or (at your
5046 + * option) any later version.
5048 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5049 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5050 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5051 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5052 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5053 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5054 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5055 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5056 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5057 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5059 + * You should have received a copy of the GNU General Public License along
5060 + * with this program; if not, write to the Free Software Foundation, Inc.,
5061 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5064 + **************************************************************************
5065 + * May 2004 P. Sadik.
5071 + **************************************************************************
5074 +#ifndef __IDT_RC32365_PCI_H__
5075 +#define __IDT_RC32365_PCI_H__
5079 + PCI0_PhysicalAddress = 0x18068000,
5080 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
5082 + PCI0_VirtualAddress = 0xb8068000,
5083 + PCI_VirtualAddress = PCI0_VirtualAddress,
5088 + PCI_LbaCount = 4, // Local base addresses.
5093 + u32 a ; // Address.
5094 + u32 c ; // Control.
5095 + u32 m ; // mapping.
5105 + PCI_Map_s pcilba [PCI_LbaCount] ;
5113 +} volatile *PCI_t ;
5115 +// PCI messaging unit.
5122 + u32 pciim [PCIM_Count] ;
5123 + u32 pciom [PCIM_Count] ;
5130 +} volatile *PCIM_t ;
5132 +/*******************************************************************************
5134 + * PCI Control Register
5136 + ******************************************************************************/
5140 + PCIC_en_m = 0x00000001,
5142 + PCIC_tnr_m = 0x00000002,
5144 + PCIC_sce_m = 0x00000004,
5146 + PCIC_ien_m = 0x00000008,
5148 + PCIC_aaa_m = 0x00000010,
5150 + PCIC_eap_m = 0x00000020,
5152 + PCIC_pcim_m = 0x000001c0,
5153 + PCIC_pcim_disabled_v = 0,
5154 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
5155 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
5156 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
5157 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
5158 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
5159 + PCIC_pcim_reserved6_v = 6,
5160 + PCIC_pcim_reserved7_v = 7,
5162 + PCIC_igm_m = 0x00000200,
5165 +/*******************************************************************************
5167 + * PCI Status Register
5169 + ******************************************************************************/
5172 + PCIS_eed_m = 0x00000001,
5174 + PCIS_wr_m = 0x00000002,
5176 + PCIS_nmi_m = 0x00000004,
5178 + PCIS_ii_m = 0x00000008,
5180 + PCIS_cwe_m = 0x00000010,
5182 + PCIS_cre_m = 0x00000020,
5184 + PCIS_mdpe_m = 0x00000040,
5186 + PCIS_sta_m = 0x00000080,
5188 + PCIS_rta_m = 0x00000100,
5190 + PCIS_rma_m = 0x00000200,
5192 + PCIS_sse_m = 0x00000400,
5194 + PCIS_ose_m = 0x00000800,
5196 + PCIS_pe_m = 0x00001000,
5198 + PCIS_tae_m = 0x00002000,
5200 + PCIS_rle_m = 0x00004000,
5202 + PCIS_bme_m = 0x00008000,
5204 + PCIS_prd_m = 0x00010000,
5206 + PCIS_rip_m = 0x00020000,
5209 +/*******************************************************************************
5211 + * PCI Status Mask Register
5213 + ******************************************************************************/
5216 + PCISM_eed_m = 0x00000001,
5218 + PCISM_wr_m = 0x00000002,
5220 + PCISM_nmi_m = 0x00000004,
5222 + PCISM_ii_m = 0x00000008,
5224 + PCISM_cwe_m = 0x00000010,
5226 + PCISM_cre_m = 0x00000020,
5228 + PCISM_mdpe_m = 0x00000040,
5230 + PCISM_sta_m = 0x00000080,
5232 + PCISM_rta_m = 0x00000100,
5234 + PCISM_rma_m = 0x00000200,
5236 + PCISM_sse_m = 0x00000400,
5238 + PCISM_ose_m = 0x00000800,
5240 + PCISM_pe_m = 0x00001000,
5242 + PCISM_tae_m = 0x00002000,
5244 + PCISM_rle_m = 0x00004000,
5246 + PCISM_bme_m = 0x00008000,
5248 + PCISM_prd_m = 0x00010000,
5250 + PCISM_rip_m = 0x00020000,
5253 +/*******************************************************************************
5255 + * PCI Configuration Address Register
5257 + ******************************************************************************/
5259 + PCICFGA_reg_b = 2,
5260 + PCICFGA_reg_m = 0x000000fc,
5261 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
5262 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
5263 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
5264 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
5265 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
5266 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
5267 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
5268 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
5269 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
5270 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
5271 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
5272 + PCICFGA_reg_pba0m_v = 0x48>>2,
5273 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
5274 + PCICFGA_reg_pba1m_v = 0x50>>2,
5275 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
5276 + PCICFGA_reg_pba2m_v = 0x58>>2,
5277 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
5278 + PCICFGA_reg_pba3m_v = 0x60>>2,
5279 + PCICFGA_reg_pmgt_v = 0x64>>2,
5280 + PCICFGA_func_b = 8,
5281 + PCICFGA_func_m = 0x00000700,
5282 + PCICFGA_dev_b = 11,
5283 + PCICFGA_dev_m = 0x0000f800,
5284 + PCICFGA_dev_internal_v = 0,
5285 + PCICFGA_bus_b = 16,
5286 + PCICFGA_bus_m = 0x00ff0000,
5287 + PCICFGA_bus_type0_v = 0, //local bus
5288 + PCICFGA_en_b = 31, // read only
5289 + PCICFGA_en_m = 0x80000000,
5293 + PCFGID_vendor_b = 0,
5294 + PCFGID_vendor_m = 0x0000ffff,
5295 + PCFGID_vendor_IDT_v = 0x111d,
5296 + PCFGID_device_b = 16,
5297 + PCFGID_device_m = 0xffff0000,
5298 + PCFGID_device_Acaciade_v = 0x0207,
5300 + PCFG04_command_ioena_b = 1,
5301 + PCFG04_command_ioena_m = 0x00000001,
5302 + PCFG04_command_memena_b = 2,
5303 + PCFG04_command_memena_m = 0x00000002,
5304 + PCFG04_command_bmena_b = 3,
5305 + PCFG04_command_bmena_m = 0x00000004,
5306 + PCFG04_command_mwinv_b = 5,
5307 + PCFG04_command_mwinv_m = 0x00000010,
5308 + PCFG04_command_parena_b = 7,
5309 + PCFG04_command_parena_m = 0x00000040,
5310 + PCFG04_command_serrena_b = 9,
5311 + PCFG04_command_serrena_m = 0x00000100,
5312 + PCFG04_command_fastbbena_b = 10,
5313 + PCFG04_command_fastbbena_m = 0x00000200,
5314 + PCFG04_status_b = 16,
5315 + PCFG04_status_m = 0xffff0000,
5316 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
5317 + PCFG04_status_66MHz_m = 0x00200000,
5318 + PCFG04_status_fbb_b = 23,
5319 + PCFG04_status_fbb_m = 0x00800000,
5320 + PCFG04_status_mdpe_b = 24,
5321 + PCFG04_status_mdpe_m = 0x01000000,
5322 + PCFG04_status_dst_b = 25,
5323 + PCFG04_status_dst_m = 0x06000000,
5324 + PCFG04_status_sta_b = 27,
5325 + PCFG04_status_sta_m = 0x08000000,
5326 + PCFG04_status_rta_b = 28,
5327 + PCFG04_status_rta_m = 0x10000000,
5328 + PCFG04_status_rma_b = 29,
5329 + PCFG04_status_rma_m = 0x20000000,
5330 + PCFG04_status_sse_b = 30,
5331 + PCFG04_status_sse_m = 0x40000000,
5332 + PCFG04_status_pe_b = 31,
5333 + PCFG04_status_pe_m = 0x40000000,
5335 + PCFG08_revId_b = 0,
5336 + PCFG08_revId_m = 0x000000ff,
5337 + PCFG08_classCode_b = 0,
5338 + PCFG08_classCode_m = 0xffffff00,
5339 + PCFG08_classCode_bridge_v = 06,
5340 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
5341 + PCFG0C_cacheline_b = 0,
5342 + PCFG0C_cacheline_m = 0x000000ff,
5343 + PCFG0C_masterLatency_b = 8,
5344 + PCFG0C_masterLatency_m = 0x0000ff00,
5345 + PCFG0C_headerType_b = 16,
5346 + PCFG0C_headerType_m = 0x00ff0000,
5347 + PCFG0C_bist_b = 24,
5348 + PCFG0C_bist_m = 0xff000000,
5351 + PCIPBA_msi_m = 0x00000001,
5353 + PCIPBA_p_m = 0x00000004,
5354 + PCIPBA_baddr_b = 8,
5355 + PCIPBA_baddr_m = 0xffffff00,
5357 + PCFGSS_vendorId_b = 0,
5358 + PCFGSS_vendorId_m = 0x0000ffff,
5360 + PCFGSS_id_m = 0xffff0000,
5362 + PCFG3C_interruptLine_b = 0,
5363 + PCFG3C_interruptLine_m = 0x000000ff,
5364 + PCFG3C_interruptPin_b = 8,
5365 + PCFG3C_interruptPin_m = 0x0000ff00,
5366 + PCFG3C_minGrant_b = 16,
5367 + PCFG3C_minGrant_m = 0x00ff0000,
5368 + PCFG3C_maxLat_b = 24,
5369 + PCFG3C_maxLat_m = 0xff000000,
5371 + PCIPBAC_msi_b = 0,
5372 + PCIPBAC_msi_m = 0x00000001,
5374 + PCIPBAC_p_m = 0x00000002,
5375 + PCIPBAC_size_b = 2,
5376 + PCIPBAC_size_m = 0x0000007c,
5378 + PCIPBAC_sb_m = 0x00000080,
5380 + PCIPBAC_pp_m = 0x00000100,
5382 + PCIPBAC_mr_m = 0x00000600,
5383 + PCIPBAC_mr_read_v =0, //no prefetching
5384 + PCIPBAC_mr_readLine_v =1,
5385 + PCIPBAC_mr_readMult_v =2,
5386 + PCIPBAC_mrl_b = 11,
5387 + PCIPBAC_mrl_m = 0x00000800,
5388 + PCIPBAC_mrm_b = 12,
5389 + PCIPBAC_mrm_m = 0x00001000,
5390 + PCIPBAC_trp_b = 13,
5391 + PCIPBAC_trp_m = 0x00002000,
5393 + PCFG40_trdyTimeout_b = 0,
5394 + PCFG40_trdyTimeout_m = 0x000000ff,
5395 + PCFG40_retryLim_b = 8,
5396 + PCFG40_retryLim_m = 0x0000ff00,
5399 +/*******************************************************************************
5401 + * PCI Local Base Address [0|1|2|3] Register
5403 + ******************************************************************************/
5405 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
5406 + PCILBA_baddr_m = 0xffffff00,
5408 +/*******************************************************************************
5410 + * PCI Local Base Address Control Register
5412 + ******************************************************************************/
5414 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
5415 + PCILBAC_msi_m = 0x00000001,
5416 + PCILBAC_msi_mem_v = 0,
5417 + PCILBAC_msi_io_v = 1,
5418 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
5419 + PCILBAC_size_m = 0x0000007c,
5420 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
5421 + PCILBAC_sb_m = 0x00000080,
5422 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
5423 + PCILBAC_rt_m = 0x00000100,
5424 + PCILBAC_rt_noprefetch_v = 0, // mem read
5425 + PCILBAC_rt_prefetch_v = 1, // mem readline
5428 +/*******************************************************************************
5430 + * PCI Local Base Address [0|1|2|3] Mapping Register
5432 + ******************************************************************************/
5434 + PCILBAM_maddr_b = 8,
5435 + PCILBAM_maddr_m = 0xffffff00,
5438 +/*******************************************************************************
5440 + * PCI Decoupled Access Control Register
5442 + ******************************************************************************/
5445 + PCIDAC_den_m = 0x00000001,
5448 +/*******************************************************************************
5450 + * PCI Decoupled Access Status Register
5452 + ******************************************************************************/
5455 + PCIDAS_d_m = 0x00000001,
5457 + PCIDAS_b_m = 0x00000002,
5459 + PCIDAS_e_m = 0x00000004,
5461 + PCIDAS_ofe_m = 0x00000008,
5463 + PCIDAS_off_m = 0x00000010,
5465 + PCIDAS_ife_m = 0x00000020,
5467 + PCIDAS_iff_m = 0x00000040,
5470 +/*******************************************************************************
5472 + * PCI DMA Channel 8 Configuration Register
5474 + ******************************************************************************/
5477 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
5478 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
5479 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
5480 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
5483 +/*******************************************************************************
5485 + * PCI DMA Channel 9 Configuration Register
5487 + ******************************************************************************/
5490 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
5491 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
5494 +/*******************************************************************************
5496 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
5498 + ******************************************************************************/
5500 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
5501 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
5502 + // These are for reads (DMA channel 8)
5503 + PCIDMAD_devcmd_mr_v = 0, //memory read
5504 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
5505 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
5506 + PCIDMAD_devcmd_ior_v = 3, //I/O read
5507 + // These are for writes (DMA channel 9)
5508 + PCIDMAD_devcmd_mw_v = 0, //memory write
5509 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
5510 + PCIDMAD_devcmd_iow_v = 3, //I/O write
5512 + // Swap byte field applies to both DMA channel 8 and 9
5513 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
5514 + PCIDMAD_sb_m = 0x01000000, // swap byte field
5518 +/*******************************************************************************
5520 + * PCI Target Control Register
5522 + ******************************************************************************/
5525 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
5526 + PCITC_rtimer_m = 0x000000ff,
5527 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
5528 + PCITC_dtimer_m = 0x0000ff00,
5529 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
5530 + PCITC_rdr_m = 0x00040000,
5531 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
5532 + PCITC_ddt_m = 0x00080000,
5534 +/*******************************************************************************
5536 + * PCI messaging unit [applies to both inbound and outbound registers ]
5538 + ******************************************************************************/
5541 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5542 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
5543 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5544 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
5545 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
5546 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
5550 +#endif // __IDT_RC32365_PCI_H__
5551 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
5552 --- linux-2.6.15/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h 1970-01-01 01:00:00.000000000 +0100
5553 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32300/rc32365_pci_v.h 2006-01-10 00:32:33.000000000 +0100
5555 +/**************************************************************************
5557 + * BRIEF MODULE DESCRIPTION
5558 + * PCI header values for IDT 79EB365/336
5560 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5562 + * This program is free software; you can redistribute it and/or modify it
5563 + * under the terms of the GNU General Public License as published by the
5564 + * Free Software Foundation; either version 2 of the License, or (at your
5565 + * option) any later version.
5567 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5568 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5569 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5570 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5571 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5572 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5573 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5574 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5575 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5576 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5578 + * You should have received a copy of the GNU General Public License along
5579 + * with this program; if not, write to the Free Software Foundation, Inc.,
5580 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5583 + **************************************************************************
5584 + * May 2004 P. Sadik.
5590 + **************************************************************************
5593 +#ifndef __IDT_RC32365_PCI_V_H__
5594 +#define __IDT_RC32365_PCI_V_H__
5597 +#define PCI_MSG_VirtualAddress 0xB806C010
5598 +#define rc32365_pci ((volatile PCI_t) PCI0_VirtualAddress)
5599 +#define rc32365_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
5601 +#define PCIM_SHFT 0x6
5602 +#define PCIM_BIT_LEN 0x7
5603 +#define PCIM_H_EA 0x3
5604 +#define PCIM_H_IA_FIX 0x4
5605 +#define PCIM_H_IA_RR 0x5
5607 +#define PCI_ADDR_START 0x50000000
5609 +#define CPUTOPCI_MEM_WIN 0x02000000
5610 +#define CPUTOPCI_IO_WIN 0x00100000
5611 +#define PCILBA_SIZE_SHFT 2
5612 +#define PCILBA_SIZE_MASK 0x1F
5613 +#define SIZE_256MB 0x1C
5614 +#define SIZE_128MB 0x1B
5615 +#define SIZE_64MB 0x1A
5616 +#define SIZE_32MB 0x19
5617 +#define SIZE_16MB 0x18
5618 +#define SIZE_4MB 0x16
5619 +#define SIZE_2MB 0x15
5620 +#define SIZE_1MB 0x14
5621 +#define CEDAR_CONFIG0_ADDR 0x80000000
5622 +#define CEDAR_CONFIG1_ADDR 0x80000004
5623 +#define CEDAR_CONFIG2_ADDR 0x80000008
5624 +#define CEDAR_CONFIG3_ADDR 0x8000000C
5625 +#define CEDAR_CONFIG4_ADDR 0x80000010
5626 +#define CEDAR_CONFIG5_ADDR 0x80000014
5627 +#define CEDAR_CONFIG6_ADDR 0x80000018
5628 +#define CEDAR_CONFIG7_ADDR 0x8000001C
5629 +#define CEDAR_CONFIG8_ADDR 0x80000020
5630 +#define CEDAR_CONFIG9_ADDR 0x80000024
5631 +#define CEDAR_CONFIG10_ADDR 0x80000028
5632 +#define CEDAR_CONFIG11_ADDR 0x8000002C
5633 +#define CEDAR_CONFIG12_ADDR 0x80000030
5634 +#define CEDAR_CONFIG13_ADDR 0x80000034
5635 +#define CEDAR_CONFIG14_ADDR 0x80000038
5636 +#define CEDAR_CONFIG15_ADDR 0x8000003C
5637 +#define CEDAR_CONFIG16_ADDR 0x80000040
5638 +#define CEDAR_CONFIG17_ADDR 0x80000044
5639 +#define CEDAR_CONFIG18_ADDR 0x80000048
5640 +#define CEDAR_CONFIG19_ADDR 0x8000004C
5641 +#define CEDAR_CONFIG20_ADDR 0x80000050
5642 +#define CEDAR_CONFIG21_ADDR 0x80000054
5643 +#define CEDAR_CONFIG22_ADDR 0x80000058
5644 +#define CEDAR_CONFIG23_ADDR 0x8000005C
5645 +#define CEDAR_CONFIG24_ADDR 0x80000060
5646 +#define CEDAR_CONFIG25_ADDR 0x80000064
5647 +#define CEDAR_CMD (PCFG04_command_ioena_m | \
5648 + PCFG04_command_memena_m | \
5649 + PCFG04_command_bmena_m | \
5650 + PCFG04_command_mwinv_m | \
5651 + PCFG04_command_parena_m | \
5652 + PCFG04_command_serrena_m )
5654 +#define CEDAR_STAT (PCFG04_status_mdpe_m | \
5655 + PCFG04_status_sta_m | \
5656 + PCFG04_status_rta_m | \
5657 + PCFG04_status_rma_m | \
5658 + PCFG04_status_sse_m | \
5659 + PCFG04_status_pe_m)
5661 +#define CEDAR_CNFG1 ((CEDAR_STAT << 16) | \
5664 +#define CEDAR_REVID 0
5665 +#define CEDAR_CLASS_CODE 0
5666 +#define CEDAR_CNFG2 ((CEDAR_CLASS_CODE << 8) | \
5669 +#define CEDAR_CACHE_LINE_SIZE 4
5670 +#define CEDAR_MASTER_LAT 0x3c
5671 +#define CEDAR_HEADER_TYPE 0
5672 +#define CEDAR_BIST 0
5674 +#define CEDAR_CNFG3 ((CEDAR_BIST << 24) | \
5675 + (CEDAR_HEADER_TYPE << 16) | \
5676 + (CEDAR_MASTER_LAT << 8) | \
5677 + CEDAR_CACHE_LINE_SIZE)
5679 +#define CEDAR_BAR0 0x00000008 /* 128 MB Memory */
5680 +#define CEDAR_BAR1 0x18800001 /* 1 MB IO */
5681 +#define CEDAR_BAR2 0x18000001 /* 2 MB IO window for Cedar
5682 + internal Registers */
5683 +#define CEDAR_BAR3 0x48000008 /* Spare 128 MB Memory */
5685 +#define CEDAR_CNFG4 CEDAR_BAR0
5686 +#define CEDAR_CNFG5 CEDAR_BAR1
5687 +#define CEDAR_CNFG6 CEDAR_BAR2
5688 +#define CEDAR_CNFG7 CEDAR_BAR3
5690 +#define CEDAR_SUBSYS_VENDOR_ID 0
5691 +#define CEDAR_SUBSYSTEM_ID 0
5692 +#define CEDAR_CNFG8 0
5693 +#define CEDAR_CNFG9 0
5694 +#define CEDAR_CNFG10 0
5695 +#define CEDAR_CNFG11 ((CEDAR_SUBSYS_VENDOR_ID << 16) | \
5696 + CEDAR_SUBSYSTEM_ID)
5697 +#define CEDAR_INT_LINE 1
5698 +#define CEDAR_INT_PIN 1
5699 +#define CEDAR_MIN_GNT 8
5700 +#define CEDAR_MAX_LAT 0x38
5701 +#define CEDAR_CNFG12 0
5702 +#define CEDAR_CNFG13 0
5703 +#define CEDAR_CNFG14 0
5704 +#define CEDAR_CNFG15 ((CEDAR_MAX_LAT << 24) | \
5705 + (CEDAR_MIN_GNT << 16) | \
5706 + (CEDAR_INT_PIN << 8) | \
5708 +#define CEDAR_RETRY_LIMIT 0x80
5709 +#define CEDAR_TRDY_LIMIT 0x80
5710 +#define CEDAR_CNFG16 ((CEDAR_RETRY_LIMIT << 8) | \
5712 +#define PCI_PBAxC_R 0x0
5713 +#define PCI_PBAxC_RL 0x1
5714 +#define PCI_PBAxC_RM 0x2
5715 +#define SIZE_SHFT 2
5717 +#define CEDAR_PBA0C (((1 & 0x3) << PCIPBAC_mr_b) | \
5720 + (SIZE_128MB << SIZE_SHFT) | \
5724 +#define CEDAR_PBA0C (((1 & 0x3) << PCIPBAC_mr_b) | \
5726 + (SIZE_128MB << SIZE_SHFT) | \
5729 +#define CEDAR_CNFG17 CEDAR_PBA0C
5730 +#define CEDAR_PBA0M 0x0
5731 +#define CEDAR_CNFG18 CEDAR_PBA0M
5734 +#define CEDAR_PBA1C ((SIZE_1MB << SIZE_SHFT) | \
5738 +#define CEDAR_PBA1C ((SIZE_1MB << SIZE_SHFT) | \
5741 +#define CEDAR_CNFG19 CEDAR_PBA1C
5742 +#define CEDAR_PBA1M 0x0
5743 +#define CEDAR_CNFG20 CEDAR_PBA1M
5746 +#define CEDAR_PBA2C ((SIZE_2MB << SIZE_SHFT) | \
5750 +#define CEDAR_PBA2C ((SIZE_2MB << SIZE_SHFT) | \
5754 +#define CEDAR_CNFG21 CEDAR_PBA2C
5755 +#define CEDAR_PBA2M 0x18000000
5756 +#define CEDAR_CNFG22 CEDAR_PBA2M
5759 +#define CEDAR_PBA3C PCIPBAC_sb_m
5761 +#define CEDAR_PBA3C 0
5764 +#define CEDAR_CNFG23 CEDAR_PBA3C
5765 +#define CEDAR_PBA3M 0
5766 +#define CEDAR_CNFG24 CEDAR_PBA3M
5768 +#define PCITC_DTIMER_VAL 8
5769 +#define PCITC_RTIMER_VAL 0x10
5771 +#endif //__IDT_RC32365_PCI_V_H__
5772 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
5773 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_dma.h 1970-01-01 01:00:00.000000000 +0100
5774 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_dma.h 2006-01-10 00:32:33.000000000 +0100
5776 +/**************************************************************************
5778 + * BRIEF MODULE DESCRIPTION
5779 + * DMA register definition
5781 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5783 + * This program is free software; you can redistribute it and/or modify it
5784 + * under the terms of the GNU General Public License as published by the
5785 + * Free Software Foundation; either version 2 of the License, or (at your
5786 + * option) any later version.
5788 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5789 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5790 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
5791 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5792 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5793 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
5794 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
5795 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5796 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5797 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5799 + * You should have received a copy of the GNU General Public License along
5800 + * with this program; if not, write to the Free Software Foundation, Inc.,
5801 + * 675 Mass Ave, Cambridge, MA 02139, USA.
5804 + **************************************************************************
5805 + * May 2004 rkt, neb
5811 + **************************************************************************
5814 +#ifndef __IDT_DMA_H__
5815 +#define __IDT_DMA_H__
5819 + DMA0_PhysicalAddress = 0x18040000,
5820 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
5822 + DMA0_VirtualAddress = 0xb8040000,
5823 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
5827 + * DMA descriptor (in physical memory).
5830 +typedef struct DMAD_s
5832 + u32 control ; // Control. use DMAD_*
5833 + u32 ca ; // Current Address.
5834 + u32 devcs ; // Device control and status.
5835 + u32 link ; // Next descriptor in chain.
5836 +} volatile *DMAD_t ;
5840 + DMAD_size = sizeof (struct DMAD_s),
5841 + DMAD_count_b = 0, // in DMAD_t -> control
5842 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
5843 + DMAD_ds_b = 20, // in DMAD_t -> control
5844 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
5845 + DMAD_ds_ethRcv0_v = 0,
5846 + DMAD_ds_ethXmt0_v = 0,
5847 + DMAD_ds_memToFifo_v = 0,
5848 + DMAD_ds_fifoToMem_v = 0,
5849 + DMAD_ds_pciToMem_v = 0,
5850 + DMAD_ds_memToPci_v = 0,
5852 + DMAD_devcmd_b = 22, // in DMAD_t -> control
5853 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
5854 + DMAD_devcmd_byte_v = 0, //memory-to-memory
5855 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
5856 + DMAD_devcmd_word_v = 2, //memory-to-memory
5857 + DMAD_devcmd_2words_v = 3, //memory-to-memory
5858 + DMAD_devcmd_4words_v = 4, //memory-to-memory
5859 + DMAD_devcmd_6words_v = 5, //memory-to-memory
5860 + DMAD_devcmd_8words_v = 6, //memory-to-memory
5861 + DMAD_devcmd_16words_v = 7, //memory-to-memory
5862 + DMAD_cof_b = 25, // chain on finished
5863 + DMAD_cof_m = 0x02000000, //
5864 + DMAD_cod_b = 26, // chain on done
5865 + DMAD_cod_m = 0x04000000, //
5866 + DMAD_iof_b = 27, // interrupt on finished
5867 + DMAD_iof_m = 0x08000000, //
5868 + DMAD_iod_b = 28, // interrupt on done
5869 + DMAD_iod_m = 0x10000000, //
5870 + DMAD_t_b = 29, // terminated
5871 + DMAD_t_m = 0x20000000, //
5872 + DMAD_d_b = 30, // done
5873 + DMAD_d_m = 0x40000000, //
5874 + DMAD_f_b = 31, // finished
5875 + DMAD_f_m = 0x80000000, //
5879 + * DMA register (within Internal Register Map).
5884 + u32 dmac ; // Control.
5885 + u32 dmas ; // Status.
5886 + u32 dmasm ; // Mask.
5887 + u32 dmadptr ; // Descriptor pointer.
5888 + u32 dmandptr ; // Next descriptor pointer.
5891 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
5893 +//DMA_Channels use DMACH_count instead
5897 + DMAC_run_b = 0, //
5898 + DMAC_run_m = 0x00000001, //
5899 + DMAC_dm_b = 1, // done mask
5900 + DMAC_dm_m = 0x00000002, //
5901 + DMAC_mode_b = 2, //
5902 + DMAC_mode_m = 0x0000000c, //
5903 + DMAC_mode_auto_v = 0,
5904 + DMAC_mode_burst_v = 1,
5905 + DMAC_mode_transfer_v = 2, //usually used
5906 + DMAC_mode_reserved_v = 3,
5908 + DMAC_a_m = 0x00000010, //
5910 + DMAS_f_b = 0, // finished (sticky)
5911 + DMAS_f_m = 0x00000001, //
5912 + DMAS_d_b = 1, // done (sticky)
5913 + DMAS_d_m = 0x00000002, //
5914 + DMAS_c_b = 2, // chain (sticky)
5915 + DMAS_c_m = 0x00000004, //
5916 + DMAS_e_b = 3, // error (sticky)
5917 + DMAS_e_m = 0x00000008, //
5918 + DMAS_h_b = 4, // halt (sticky)
5919 + DMAS_h_m = 0x00000010, //
5921 + DMASM_f_b = 0, // finished (1=mask)
5922 + DMASM_f_m = 0x00000001, //
5923 + DMASM_d_b = 1, // done (1=mask)
5924 + DMASM_d_m = 0x00000002, //
5925 + DMASM_c_b = 2, // chain (1=mask)
5926 + DMASM_c_m = 0x00000004, //
5927 + DMASM_e_b = 3, // error (1=mask)
5928 + DMASM_e_m = 0x00000008, //
5929 + DMASM_h_b = 4, // halt (1=mask)
5930 + DMASM_h_m = 0x00000010, //
5934 + * DMA channel definitions
5939 + DMACH_ethRcv0 = 0,
5940 + DMACH_ethXmt0 = 1,
5941 + DMACH_memToFifo = 2,
5942 + DMACH_fifoToMem = 3,
5943 + DMACH_pciToMem = 4,
5944 + DMACH_memToPci = 5,
5946 + DMACH_count //must be last
5950 +typedef struct DMAC_s
5952 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
5953 +} volatile *DMA_t ;
5957 + * External DMA parameters
5962 + DMADEVCMD_ts_b = 0, // ts field in devcmd
5963 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
5964 + DMADEVCMD_ts_byte_v = 0,
5965 + DMADEVCMD_ts_halfword_v = 1,
5966 + DMADEVCMD_ts_word_v = 2,
5967 + DMADEVCMD_ts_2word_v = 3,
5968 + DMADEVCMD_ts_4word_v = 4,
5969 + DMADEVCMD_ts_6word_v = 5,
5970 + DMADEVCMD_ts_8word_v = 6,
5971 + DMADEVCMD_ts_16word_v = 7
5975 +#endif // __IDT_DMA_H__
5981 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
5982 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h 1970-01-01 01:00:00.000000000 +0100
5983 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_dma_v.h 2006-01-10 00:32:33.000000000 +0100
5985 +/**************************************************************************
5987 + * BRIEF MODULE DESCRIPTION
5988 + * Definitions for DMA controller.
5990 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
5992 + * This program is free software; you can redistribute it and/or modify it
5993 + * under the terms of the GNU General Public License as published by the
5994 + * Free Software Foundation; either version 2 of the License, or (at your
5995 + * option) any later version.
5997 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5998 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5999 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6000 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6001 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6002 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6003 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6004 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6005 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6006 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6008 + * You should have received a copy of the GNU General Public License along
6009 + * with this program; if not, write to the Free Software Foundation, Inc.,
6010 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6013 + **************************************************************************
6014 + * May 2004 rkt, neb.
6020 + **************************************************************************
6023 +#ifndef __IDT_DMA_V_H__
6024 +#define __IDT_DMA_V_H__
6026 +#include <asm/idt-boards/rc32434/rc32434_dma.h>
6027 +#include <asm/idt-boards/rc32434/rc32434.h>
6029 +#define DMA_CHAN_OFFSET 0x14
6030 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
6031 +#define DMA_COUNT(count) \
6032 + ((count) & DMAD_count_m)
6034 +#define DMA_HALT_TIMEOUT 500
6037 +static inline int rc32434_halt_dma(DMA_Chan_t ch)
6040 + if (rc32434_readl(&ch->dmac) & DMAC_run_m) {
6041 + rc32434_writel(0, &ch->dmac);
6043 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
6044 + if (rc32434_readl(&ch->dmas) & DMAS_h_m) {
6045 + rc32434_writel(0, &ch->dmas);
6052 + return timeout ? 0 : 1;
6055 +static inline void rc32434_start_dma(DMA_Chan_t ch, u32 dma_addr)
6057 + rc32434_writel(0, &ch->dmandptr);
6058 + rc32434_writel(dma_addr, &ch->dmadptr);
6061 +static inline void rc32434_chain_dma(DMA_Chan_t ch, u32 dma_addr)
6063 + rc32434_writel(dma_addr, &ch->dmandptr);
6066 +#endif // __IDT_DMA_V_H__
6074 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
6075 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_eth.h 1970-01-01 01:00:00.000000000 +0100
6076 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_eth.h 2006-01-10 00:32:33.000000000 +0100
6078 +/**************************************************************************
6080 + * BRIEF MODULE DESCRIPTION
6081 + * Ethernet register definition
6083 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6085 + * This program is free software; you can redistribute it and/or modify it
6086 + * under the terms of the GNU General Public License as published by the
6087 + * Free Software Foundation; either version 2 of the License, or (at your
6088 + * option) any later version.
6090 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6091 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6092 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6093 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6094 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6095 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6096 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6097 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6098 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6099 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6101 + * You should have received a copy of the GNU General Public License along
6102 + * with this program; if not, write to the Free Software Foundation, Inc.,
6103 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6106 + **************************************************************************
6107 + * May 2004 rkt, neb.
6113 + **************************************************************************
6116 +#ifndef __IDT_ETH_H__
6117 +#define __IDT_ETH_H__
6122 + ETH0_PhysicalAddress = 0x18060000,
6123 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
6125 + ETH0_VirtualAddress = 0xb8060000,
6126 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
6136 + u32 ethu0 [4] ; // Reserved.
6139 + u32 eth_u1 [10] ; // Reserved.
6141 + u32 eth_u2 [42] ; // Reserved.
6156 + u32 eth_u9 [50] ; // Reserved.
6163 + u32 eth_u10 ; // Reserved.
6171 + u32 eth_u11 ; // Reserved.
6172 + u32 eth_u12 ; // Reserved.
6180 + ETHINTFC_en_b = 0,
6181 + ETHINTFC_en_m = 0x00000001,
6182 + ETHINTFC_its_b = 1,
6183 + ETHINTFC_its_m = 0x00000002,
6184 + ETHINTFC_rip_b = 2,
6185 + ETHINTFC_rip_m = 0x00000004,
6186 + ETHINTFC_jam_b = 3,
6187 + ETHINTFC_jam_m = 0x00000008,
6188 + ETHINTFC_ovr_b = 4,
6189 + ETHINTFC_ovr_m = 0x00000010,
6190 + ETHINTFC_und_b = 5,
6191 + ETHINTFC_und_m = 0x00000020,
6193 + ETHFIFOTT_tth_b = 0,
6194 + ETHFIFOTT_tth_m = 0x0000007f,
6197 + ETHARC_pro_m = 0x00000001,
6199 + ETHARC_am_m = 0x00000002,
6201 + ETHARC_afm_m = 0x00000004,
6203 + ETHARC_ab_m = 0x00000008,
6205 + ETHSAL_byte5_b = 0,
6206 + ETHSAL_byte5_m = 0x000000ff,
6207 + ETHSAL_byte4_b = 8,
6208 + ETHSAL_byte4_m = 0x0000ff00,
6209 + ETHSAL_byte3_b = 16,
6210 + ETHSAL_byte3_m = 0x00ff0000,
6211 + ETHSAL_byte2_b = 24,
6212 + ETHSAL_byte2_m = 0xff000000,
6214 + ETHSAH_byte1_b = 0,
6215 + ETHSAH_byte1_m = 0x000000ff,
6216 + ETHSAH_byte0_b = 8,
6217 + ETHSAH_byte0_m = 0x0000ff00,
6220 + ETHGPF_ptv_m = 0x0000ffff,
6223 + ETHPFS_pfd_m = 0x00000001,
6225 + ETHCFSA0_cfsa4_b = 0,
6226 + ETHCFSA0_cfsa4_m = 0x000000ff,
6227 + ETHCFSA0_cfsa5_b = 8,
6228 + ETHCFSA0_cfsa5_m = 0x0000ff00,
6230 + ETHCFSA1_cfsa2_b = 0,
6231 + ETHCFSA1_cfsa2_m = 0x000000ff,
6232 + ETHCFSA1_cfsa3_b = 8,
6233 + ETHCFSA1_cfsa3_m = 0x0000ff00,
6235 + ETHCFSA2_cfsa0_b = 0,
6236 + ETHCFSA2_cfsa0_m = 0x000000ff,
6237 + ETHCFSA2_cfsa1_b = 8,
6238 + ETHCFSA2_cfsa1_m = 0x0000ff00,
6241 + ETHMAC1_re_m = 0x00000001,
6242 + ETHMAC1_paf_b = 1,
6243 + ETHMAC1_paf_m = 0x00000002,
6244 + ETHMAC1_rfc_b = 2,
6245 + ETHMAC1_rfc_m = 0x00000004,
6246 + ETHMAC1_tfc_b = 3,
6247 + ETHMAC1_tfc_m = 0x00000008,
6249 + ETHMAC1_lb_m = 0x00000010,
6250 + ETHMAC1_mr_b = 31,
6251 + ETHMAC1_mr_m = 0x80000000,
6254 + ETHMAC2_fd_m = 0x00000001,
6255 + ETHMAC2_flc_b = 1,
6256 + ETHMAC2_flc_m = 0x00000002,
6257 + ETHMAC2_hfe_b = 2,
6258 + ETHMAC2_hfe_m = 0x00000004,
6260 + ETHMAC2_dc_m = 0x00000008,
6261 + ETHMAC2_cen_b = 4,
6262 + ETHMAC2_cen_m = 0x00000010,
6264 + ETHMAC2_pe_m = 0x00000020,
6265 + ETHMAC2_vpe_b = 6,
6266 + ETHMAC2_vpe_m = 0x00000040,
6267 + ETHMAC2_ape_b = 7,
6268 + ETHMAC2_ape_m = 0x00000080,
6269 + ETHMAC2_ppe_b = 8,
6270 + ETHMAC2_ppe_m = 0x00000100,
6271 + ETHMAC2_lpe_b = 9,
6272 + ETHMAC2_lpe_m = 0x00000200,
6273 + ETHMAC2_nb_b = 12,
6274 + ETHMAC2_nb_m = 0x00001000,
6275 + ETHMAC2_bp_b = 13,
6276 + ETHMAC2_bp_m = 0x00002000,
6277 + ETHMAC2_ed_b = 14,
6278 + ETHMAC2_ed_m = 0x00004000,
6280 + ETHIPGT_ipgt_b = 0,
6281 + ETHIPGT_ipgt_m = 0x0000007f,
6283 + ETHIPGR_ipgr2_b = 0,
6284 + ETHIPGR_ipgr2_m = 0x0000007f,
6285 + ETHIPGR_ipgr1_b = 8,
6286 + ETHIPGR_ipgr1_m = 0x00007f00,
6288 + ETHCLRT_maxret_b = 0,
6289 + ETHCLRT_maxret_m = 0x0000000f,
6290 + ETHCLRT_colwin_b = 8,
6291 + ETHCLRT_colwin_m = 0x00003f00,
6293 + ETHMAXF_maxf_b = 0,
6294 + ETHMAXF_maxf_m = 0x0000ffff,
6296 + ETHMTEST_tb_b = 2,
6297 + ETHMTEST_tb_m = 0x00000004,
6300 + ETHMCP_div_m = 0x000000ff,
6302 + MIIMCFG_rsv_b = 0,
6303 + MIIMCFG_rsv_m = 0x0000000c,
6306 + MIIMCMD_rd_m = 0x00000001,
6307 + MIIMCMD_scn_b = 1,
6308 + MIIMCMD_scn_m = 0x00000002,
6310 + MIIMADDR_regaddr_b = 0,
6311 + MIIMADDR_regaddr_m = 0x0000001f,
6312 + MIIMADDR_phyaddr_b = 8,
6313 + MIIMADDR_phyaddr_m = 0x00001f00,
6315 + MIIMWTD_wdata_b = 0,
6316 + MIIMWTD_wdata_m = 0x0000ffff,
6318 + MIIMRDD_rdata_b = 0,
6319 + MIIMRDD_rdata_m = 0x0000ffff,
6321 + MIIMIND_bsy_b = 0,
6322 + MIIMIND_bsy_m = 0x00000001,
6323 + MIIMIND_scn_b = 1,
6324 + MIIMIND_scn_m = 0x00000002,
6326 + MIIMIND_nv_m = 0x00000004,
6331 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
6336 + ETHRX_fd_m = 0x00000001,
6338 + ETHRX_ld_m = 0x00000002,
6340 + ETHRX_rok_m = 0x00000004,
6342 + ETHRX_fm_m = 0x00000008,
6344 + ETHRX_mp_m = 0x00000010,
6346 + ETHRX_bp_m = 0x00000020,
6348 + ETHRX_vlt_m = 0x00000040,
6350 + ETHRX_cf_m = 0x00000080,
6352 + ETHRX_ovr_m = 0x00000100,
6354 + ETHRX_crc_m = 0x00000200,
6356 + ETHRX_cv_m = 0x00000400,
6358 + ETHRX_db_m = 0x00000800,
6360 + ETHRX_le_m = 0x00001000,
6362 + ETHRX_lor_m = 0x00002000,
6364 + ETHRX_ces_m = 0x00004000,
6365 + ETHRX_length_b = 16,
6366 + ETHRX_length_m = 0xffff0000,
6369 + ETHTX_fd_m = 0x00000001,
6371 + ETHTX_ld_m = 0x00000002,
6373 + ETHTX_oen_m = 0x00000004,
6375 + ETHTX_pen_m = 0x00000008,
6377 + ETHTX_cen_m = 0x00000010,
6379 + ETHTX_hen_m = 0x00000020,
6381 + ETHTX_tok_m = 0x00000040,
6383 + ETHTX_mp_m = 0x00000080,
6385 + ETHTX_bp_m = 0x00000100,
6387 + ETHTX_und_m = 0x00000200,
6389 + ETHTX_of_m = 0x00000400,
6391 + ETHTX_ed_m = 0x00000800,
6393 + ETHTX_ec_m = 0x00001000,
6395 + ETHTX_lc_m = 0x00002000,
6397 + ETHTX_td_m = 0x00004000,
6399 + ETHTX_crc_m = 0x00008000,
6401 + ETHTX_le_m = 0x00010000,
6403 + ETHTX_cc_m = 0x001E0000,
6406 +#endif // __IDT_ETH_H__
6411 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
6412 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h 1970-01-01 01:00:00.000000000 +0100
6413 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_eth_v.h 2006-01-10 00:32:33.000000000 +0100
6415 +/**************************************************************************
6417 + * BRIEF MODULE DESCRIPTION
6418 + * Ethernet register definition
6420 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6422 + * This program is free software; you can redistribute it and/or modify it
6423 + * under the terms of the GNU General Public License as published by the
6424 + * Free Software Foundation; either version 2 of the License, or (at your
6425 + * option) any later version.
6427 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6428 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6429 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6430 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6431 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6432 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6433 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6434 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6435 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6436 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6438 + * You should have received a copy of the GNU General Public License along
6439 + * with this program; if not, write to the Free Software Foundation, Inc.,
6440 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6443 + **************************************************************************
6444 + * May 2004 rkt, neb.
6450 + **************************************************************************
6453 +#ifndef __IDT_ETH_V_H__
6454 +#define __IDT_ETH_V_H__
6456 +#include <asm/idt-boards/rc32434/rc32434_eth.h>
6458 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
6459 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
6460 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
6461 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
6462 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
6463 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
6464 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
6465 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
6466 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
6467 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
6468 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
6470 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
6472 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
6473 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
6474 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
6475 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
6476 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
6477 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
6478 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
6479 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
6480 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
6481 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
6482 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
6483 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
6484 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
6485 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
6486 +#endif // __IDT_ETH_V_H__
6492 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
6493 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h 1970-01-01 01:00:00.000000000 +0100
6494 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_gpio.h 2006-01-10 00:32:33.000000000 +0100
6496 +/**************************************************************************
6498 + * BRIEF MODULE DESCRIPTION
6499 + * GPIO register definition
6501 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6503 + * This program is free software; you can redistribute it and/or modify it
6504 + * under the terms of the GNU General Public License as published by the
6505 + * Free Software Foundation; either version 2 of the License, or (at your
6506 + * option) any later version.
6508 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6509 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6510 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6511 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6512 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6513 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6514 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6515 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6516 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6517 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6519 + * You should have received a copy of the GNU General Public License along
6520 + * with this program; if not, write to the Free Software Foundation, Inc.,
6521 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6524 + **************************************************************************
6525 + * May 2004 rkt, neb.
6531 + **************************************************************************
6534 +#ifndef __IDT_GPIO_H__
6535 +#define __IDT_GPIO_H__
6539 + GPIO0_PhysicalAddress = 0x18050000,
6540 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
6542 + GPIO0_VirtualAddress = 0xb8050000,
6543 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
6548 + u32 gpiofunc; /* GPIO Function Register
6549 + * gpiofunc[x]==0 bit = gpio
6550 + * func[x]==1 bit = altfunc
6552 + u32 gpiocfg; /* GPIO Configuration Register
6553 + * gpiocfg[x]==0 bit = input
6554 + * gpiocfg[x]==1 bit = output
6556 + u32 gpiod; /* GPIO Data Register
6557 + * gpiod[x] read/write gpio pinX status
6559 + u32 gpioilevel; /* GPIO Interrupt Status Register
6560 + * interrupt level (see gpioistat)
6562 + u32 gpioistat; /* Gpio Interrupt Status Register
6563 + * istat[x] = (gpiod[x] == level[x])
6564 + * cleared in ISR (STICKY bits)
6566 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
6567 +} volatile * GPIO_t ;
6571 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
6572 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
6573 + GPIO_input_v = 0, // gpiocfg use pin as input.
6574 + GPIO_output_v = 1, // gpiocfg use pin as output.
6576 + GPIO_pin0_m = 0x00000001,
6578 + GPIO_pin1_m = 0x00000002,
6580 + GPIO_pin2_m = 0x00000004,
6582 + GPIO_pin3_m = 0x00000008,
6584 + GPIO_pin4_m = 0x00000010,
6586 + GPIO_pin5_m = 0x00000020,
6588 + GPIO_pin6_m = 0x00000040,
6590 + GPIO_pin7_m = 0x00000080,
6592 + GPIO_pin8_m = 0x00000100,
6594 + GPIO_pin9_m = 0x00000200,
6595 + GPIO_pin10_b = 10,
6596 + GPIO_pin10_m = 0x00000400,
6597 + GPIO_pin11_b = 11,
6598 + GPIO_pin11_m = 0x00000800,
6599 + GPIO_pin12_b = 12,
6600 + GPIO_pin12_m = 0x00001000,
6601 + GPIO_pin13_b = 13,
6602 + GPIO_pin13_m = 0x00002000,
6604 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
6606 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
6607 + GPIO_u0sout_m = GPIO_pin0_m,
6608 + GPIO_u0sout_cfg_v = GPIO_output_v,
6609 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
6610 + GPIO_u0sinp_m = GPIO_pin1_m,
6611 + GPIO_u0sinp_cfg_v = GPIO_input_v,
6612 + GPIO_u0rtsn_b = GPIO_pin2_b, // UART 0 req. to send.
6613 + GPIO_u0rtsn_m = GPIO_pin2_m,
6614 + GPIO_u0rtsn_cfg_v = GPIO_output_v,
6615 + GPIO_u0ctsn_b = GPIO_pin3_b, // UART 0 clear to send.
6616 + GPIO_u0ctsn_m = GPIO_pin3_m,
6617 + GPIO_u0ctsn_cfg_v = GPIO_input_v,
6619 + GPIO_maddr22_b = GPIO_pin4_b, // M&P bus bit 22.
6620 + GPIO_maddr22_m = GPIO_pin4_m,
6621 + GPIO_maddr22_cfg_v = GPIO_output_v,
6623 + GPIO_maddr23_b = GPIO_pin5_b, // M&P bus bit 23.
6624 + GPIO_maddr23_m = GPIO_pin5_m,
6625 + GPIO_maddr23_cfg_v = GPIO_output_v,
6627 + GPIO_maddr24_b = GPIO_pin6_b, // M&P bus bit 24.
6628 + GPIO_maddr24_m = GPIO_pin6_m,
6629 + GPIO_maddr24_cfg_v = GPIO_output_v,
6631 + GPIO_maddr25_b = GPIO_pin7_b, // M&P bus bit 25.
6632 + GPIO_maddr25_m = GPIO_pin7_m,
6633 + GPIO_maddr25_cfg_v = GPIO_output_v,
6635 + GPIO_cpudmadebug_b = GPIO_pin8_b, // CPU or DMA debug pin
6636 + GPIO_cpudmadebug_m = GPIO_pin8_m,
6637 + GPIO_cpudmadebug_cfg_v = GPIO_output_v,
6639 + GPIO_pcireq4_b = GPIO_pin9_b, // PCI Request 4
6640 + GPIO_pcireq4_m = GPIO_pin9_m,
6641 + GPIO_pcireq4_cfg_v = GPIO_input_v,
6643 + GPIO_pcigrant4_b = GPIO_pin10_b, // PCI Grant 4
6644 + GPIO_pcigrant4_m = GPIO_pin10_m,
6645 + GPIO_pcigrant4_cfg_v = GPIO_output_v,
6647 + GPIO_pcireq5_b = GPIO_pin11_b, // PCI Request 5
6648 + GPIO_pcireq5_m = GPIO_pin11_m,
6649 + GPIO_pcireq5_cfg_v = GPIO_input_v,
6651 + GPIO_pcigrant5_b = GPIO_pin12_b, // PCI Grant 5
6652 + GPIO_pcigrant5_m = GPIO_pin12_m,
6653 + GPIO_pcigrant5_cfg_v = GPIO_output_v,
6655 + GPIO_pcimuintn_b = GPIO_pin13_b, // PCI messaging int.
6656 + GPIO_pcimuintn_m = GPIO_pin13_m,
6657 + GPIO_pcimuintn_cfg_v = GPIO_output_v,
6661 +#endif // __IDT_GPIO_H__
6663 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
6664 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434.h 1970-01-01 01:00:00.000000000 +0100
6665 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434.h 2006-01-10 00:32:33.000000000 +0100
6667 + /**************************************************************************
6669 + * BRIEF MODULE DESCRIPTION
6670 + * Definitions for IDT RC32434 CPU
6672 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6674 + * This program is free software; you can redistribute it and/or modify it
6675 + * under the terms of the GNU General Public License as published by the
6676 + * Free Software Foundation; either version 2 of the License, or (at your
6677 + * option) any later version.
6679 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6680 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6681 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6682 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6683 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6684 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6685 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6686 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6687 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6688 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6690 + * You should have received a copy of the GNU General Public License along
6691 + * with this program; if not, write to the Free Software Foundation, Inc.,
6692 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6695 + **************************************************************************
6696 + * May 2004 rkt, neb.
6702 + **************************************************************************
6705 +#ifndef _RC32434_H_
6706 +#define _RC32434_H_
6708 +#include <linux/config.h>
6709 +#include <linux/delay.h>
6710 +#include <asm/io.h>
6711 +#include <asm/idt-boards/rc32434/rc32434_timer.h>
6713 +#define RC32434_REG_BASE 0x18000000
6716 +#define interrupt ((volatile INT_t ) INT0_VirtualAddress)
6717 +#define idt_timer ((volatile TIM_t) TIM0_VirtualAddress)
6718 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
6720 +#define IDT_CLOCK_MULT 2
6721 +#define MIPS_CPU_TIMER_IRQ 7
6722 +/* Interrupt Controller */
6723 +#define IC_GROUP0_PEND (RC32434_REG_BASE + 0x38000)
6724 +#define IC_GROUP0_MASK (RC32434_REG_BASE + 0x38008)
6725 +#define IC_GROUP_OFFSET 0x0C
6726 +#define RTC_BASE 0xBA001FF0
6728 +#define NUM_INTR_GROUPS 5
6731 +#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
6732 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) /* GRP3 IRQ numbers start here */
6733 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) /* GRP4 IRQ numbers start here */
6734 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) /* GRP5 IRQ numbers start here */
6735 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
6739 +#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58003)
6740 +#define EB434_UART1_BASE (0x19800003)
6744 +#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58000)
6745 +#define EB434_UART1_BASE (0x19800000)
6749 +#define RC32434_UART0_IRQ GROUP3_IRQ_BASE + 0
6750 +#define EB434_UART1_IRQ GROUP4_IRQ_BASE + 11
6752 +#define RC32434_NR_IRQS (GROUP4_IRQ_BASE + 32)
6754 +/* cpu pipeline flush */
6755 +static inline void rc32434_sync(void)
6757 + __asm__ volatile ("sync");
6760 +static inline void rc32434_sync_udelay(int us)
6762 + __asm__ volatile ("sync");
6766 +static inline void rc32434_sync_delay(int ms)
6768 + __asm__ volatile ("sync");
6775 + * Macros to access internal RC32434 registers. No byte
6776 + * swapping should be done when accessing the internal
6780 +#define rc32434_readb __raw_readb
6781 +#define rc32434_readw __raw_readw
6782 +#define rc32434_readl __raw_readl
6784 +#define rc32434_writeb __raw_writeb
6785 +#define rc32434_writew __raw_writew
6786 +#define rc32434_writel __raw_writel
6789 +static inline u8 rc32434_readb(unsigned long pa)
6791 + return *((volatile u8 *)KSEG1ADDR(pa));
6793 +static inline u16 rc32434_readw(unsigned long pa)
6795 + return *((volatile u16 *)KSEG1ADDR(pa));
6797 +static inline u32 rc32434_readl(unsigned long pa)
6799 + return *((volatile u32 *)KSEG1ADDR(pa));
6801 +static inline void rc32434_writeb(u8 val, unsigned long pa)
6803 + *((volatile u8 *)KSEG1ADDR(pa)) = val;
6805 +static inline void rc32434_writew(u16 val, unsigned long pa)
6807 + *((volatile u16 *)KSEG1ADDR(pa)) = val;
6809 +static inline void rc32434_writel(u32 val, unsigned long pa)
6811 + *((volatile u32 *)KSEG1ADDR(pa)) = val;
6818 + * C access to CLZ and CLO instructions
6819 + * (count leading zeroes/ones).
6821 +static inline int rc32434_clz(unsigned long val)
6824 + __asm__ volatile (
6825 + ".set\tnoreorder\n\t"
6827 + ".set\tmips32\n\t"
6837 +static inline int rc32434_clo(unsigned long val)
6840 + __asm__ volatile (
6841 + ".set\tnoreorder\n\t"
6843 + ".set\tmips32\n\t"
6853 +#endif /* _RC32434_H_ */
6866 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
6867 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_integ.h 1970-01-01 01:00:00.000000000 +0100
6868 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_integ.h 2006-01-10 00:32:33.000000000 +0100
6870 +/**************************************************************************
6872 + * BRIEF MODULE DESCRIPTION
6873 + * System Integrity register definition
6875 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6877 + * This program is free software; you can redistribute it and/or modify it
6878 + * under the terms of the GNU General Public License as published by the
6879 + * Free Software Foundation; either version 2 of the License, or (at your
6880 + * option) any later version.
6882 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6883 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6884 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6885 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6886 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6887 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6888 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6889 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6890 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6891 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6893 + * You should have received a copy of the GNU General Public License along
6894 + * with this program; if not, write to the Free Software Foundation, Inc.,
6895 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6898 + **************************************************************************
6899 + * May 2004 rkt, neb
6905 + **************************************************************************
6908 +#ifndef __IDT_INTEG_H__
6909 +#define __IDT_INTEG_H__
6913 + INTEG0_PhysicalAddress = 0x18030000,
6914 + INTEG_PhysicalAddress = INTEG0_PhysicalAddress, // Default
6916 + INTEG0_VirtualAddress = 0xB8030000,
6917 + INTEG_VirtualAddress = INTEG0_VirtualAddress, // Default
6920 +// if you are looking for CEA, try rst.h
6923 + u32 filler [0xc] ; // 0x30 bytes unused.
6924 + u32 errcs ; // sticky use ERRCS_
6925 + u32 wtcount ; // Watchdog timer count reg.
6926 + u32 wtcompare ; // Watchdog timer timeout value.
6927 + u32 wtc ; // Watchdog timer control. use WTC_
6928 +} volatile *INTEG_t ;
6932 + ERRCS_wto_b = 0, // In INTEG_t -> errcs
6933 + ERRCS_wto_m = 0x00000001,
6934 + ERRCS_wne_b = 1, // In INTEG_t -> errcs
6935 + ERRCS_wne_m = 0x00000002,
6936 + ERRCS_ucw_b = 2, // In INTEG_t -> errcs
6937 + ERRCS_ucw_m = 0x00000004,
6938 + ERRCS_ucr_b = 3, // In INTEG_t -> errcs
6939 + ERRCS_ucr_m = 0x00000008,
6940 + ERRCS_upw_b = 4, // In INTEG_t -> errcs
6941 + ERRCS_upw_m = 0x00000010,
6942 + ERRCS_upr_b = 5, // In INTEG_t -> errcs
6943 + ERRCS_upr_m = 0x00000020,
6944 + ERRCS_udw_b = 6, // In INTEG_t -> errcs
6945 + ERRCS_udw_m = 0x00000040,
6946 + ERRCS_udr_b = 7, // In INTEG_t -> errcs
6947 + ERRCS_udr_m = 0x00000080,
6948 + ERRCS_sae_b = 8, // In INTEG_t -> errcs
6949 + ERRCS_sae_m = 0x00000100,
6950 + ERRCS_wre_b = 9, // In INTEG_t -> errcs
6951 + ERRCS_wre_m = 0x00000200,
6953 + WTC_en_b = 0, // In INTEG_t -> wtc
6954 + WTC_en_m = 0x00000001,
6955 + WTC_to_b = 1, // In INTEG_t -> wtc
6956 + WTC_to_m = 0x00000002,
6959 +#endif // __IDT_INTEG_H__
6960 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
6961 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_int.h 1970-01-01 01:00:00.000000000 +0100
6962 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_int.h 2006-01-10 00:32:33.000000000 +0100
6964 +/**************************************************************************
6966 + * BRIEF MODULE DESCRIPTION
6967 + * Interrupt Controller register definition.
6969 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
6971 + * This program is free software; you can redistribute it and/or modify it
6972 + * under the terms of the GNU General Public License as published by the
6973 + * Free Software Foundation; either version 2 of the License, or (at your
6974 + * option) any later version.
6976 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
6977 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6978 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
6979 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
6980 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
6981 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6982 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
6983 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6984 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
6985 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6987 + * You should have received a copy of the GNU General Public License along
6988 + * with this program; if not, write to the Free Software Foundation, Inc.,
6989 + * 675 Mass Ave, Cambridge, MA 02139, USA.
6992 + **************************************************************************
6993 + * May 2004 rkt, neb.
6999 + **************************************************************************
7002 +#ifndef __IDT_INT_H__
7003 +#define __IDT_INT_H__
7007 + INT0_PhysicalAddress = 0x18038000,
7008 + INT_PhysicalAddress = INT0_PhysicalAddress, // Default
7010 + INT0_VirtualAddress = 0xB8038000,
7011 + INT_VirtualAddress = INT0_VirtualAddress, // Default
7016 + u32 ipend ; //Pending interrupts. use INT?_
7017 + u32 itest ; //Test bits. use INT?_
7018 + u32 imask ; //Interrupt disabled when set. use INT?_
7023 + IPEND2 = 0, // HW 2 interrupt to core. use INT2_
7024 + IPEND3 = 1, // HW 3 interrupt to core. use INT3_
7025 + IPEND4 = 2, // HW 4 interrupt to core. use INT4_
7026 + IPEND5 = 3, // HW 5 interrupt to core. use INT5_
7027 + IPEND6 = 4, // HW 6 interrupt to core. use INT6_
7029 + IPEND_count, // must be last (used in loops)
7030 + IPEND_min = IPEND2 // min IPEND (used in loops)
7033 +typedef struct INTC_s
7035 + struct INT_s i [IPEND_count] ;// use i[IPEND?] = INT?_
7036 + u32 nmips ; // use NMIPS_
7037 +} volatile *INT_t ;
7041 + INT2_timer0_b = 0,
7042 + INT2_timer0_m = 0x00000001,
7043 + INT2_timer1_b = 1,
7044 + INT2_timer1_m = 0x00000002,
7045 + INT2_timer2_b = 2,
7046 + INT2_timer2_m = 0x00000004,
7047 + INT2_refresh_b = 3,
7048 + INT2_refresh_m = 0x00000008,
7049 + INT2_watchdogTimeout_b = 4,
7050 + INT2_watchdogTimeout_m = 0x00000010,
7051 + INT2_undecodedCpuWrite_b = 5,
7052 + INT2_undecodedCpuWrite_m = 0x00000020,
7053 + INT2_undecodedCpuRead_b = 6,
7054 + INT2_undecodedCpuRead_m = 0x00000040,
7055 + INT2_undecodedPciWrite_b = 7,
7056 + INT2_undecodedPciWrite_m = 0x00000080,
7057 + INT2_undecodedPciRead_b = 8,
7058 + INT2_undecodedPciRead_m = 0x00000100,
7059 + INT2_undecodedDmaWrite_b = 9,
7060 + INT2_undecodedDmaWrite_m = 0x00000200,
7061 + INT2_undecodedDmaRead_b = 10,
7062 + INT2_undecodedDmaRead_m = 0x00000400,
7063 + INT2_ipBusSlaveAckError_b = 11,
7064 + INT2_ipBusSlaveAckError_m = 0x00000800,
7066 + INT3_dmaChannel0_b = 0,
7067 + INT3_dmaChannel0_m = 0x00000001,
7068 + INT3_dmaChannel1_b = 1,
7069 + INT3_dmaChannel1_m = 0x00000002,
7070 + INT3_dmaChannel2_b = 2,
7071 + INT3_dmaChannel2_m = 0x00000004,
7072 + INT3_dmaChannel3_b = 3,
7073 + INT3_dmaChannel3_m = 0x00000008,
7074 + INT3_dmaChannel4_b = 4,
7075 + INT3_dmaChannel4_m = 0x00000010,
7076 + INT3_dmaChannel5_b = 5,
7077 + INT3_dmaChannel5_m = 0x00000020,
7079 + INT5_uartGeneral0_b = 0,
7080 + INT5_uartGeneral0_m = 0x00000001,
7081 + INT5_uartTxrdy0_b = 1,
7082 + INT5_uartTxrdy0_m = 0x00000002,
7083 + INT5_uartRxrdy0_b = 2,
7084 + INT5_uartRxrdy0_m = 0x00000004,
7086 + INT5_pci_m = 0x00000008,
7087 + INT5_pciDecoupled_b = 4,
7088 + INT5_pciDecoupled_m = 0x00000010,
7090 + INT5_spi_m = 0x00000020,
7091 + INT5_deviceDecoupled_b = 6,
7092 + INT5_deviceDecoupled_m = 0x00000040,
7093 + INT5_eth0Ovr_b = 9,
7094 + INT5_eth0Ovr_m = 0x00000200,
7095 + INT5_eth0Und_b = 10,
7096 + INT5_eth0Und_m = 0x00000400,
7097 + INT5_eth0Pfd_b = 11,
7098 + INT5_eth0Pfd_m = 0x00000800,
7099 + INT5_nvram_b = 12,
7100 + INT5_nvram_m = 0x00001000,
7103 + INT6_gpio0_m = 0x00000001,
7105 + INT6_gpio1_m = 0x00000002,
7107 + INT6_gpio2_m = 0x00000004,
7109 + INT6_gpio3_m = 0x00000008,
7111 + INT6_gpio4_m = 0x00000010,
7113 + INT6_gpio5_m = 0x00000020,
7115 + INT6_gpio6_m = 0x00000040,
7117 + INT6_gpio7_m = 0x00000080,
7119 + INT6_gpio8_m = 0x00000100,
7121 + INT6_gpio9_m = 0x00000200,
7122 + INT6_gpio10_b = 10,
7123 + INT6_gpio10_m = 0x00000400,
7124 + INT6_gpio11_b = 11,
7125 + INT6_gpio11_m = 0x00000800,
7126 + INT6_gpio12_b = 12,
7127 + INT6_gpio12_m = 0x00001000,
7128 + INT6_gpio13_b = 13,
7129 + INT6_gpio13_m = 0x00002000,
7132 + NMIPS_gpio_m = 0x00000001,
7135 +#endif // __IDT_INT_H__
7138 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
7139 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h 1970-01-01 01:00:00.000000000 +0100
7140 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_iparb.h 2006-01-10 00:32:33.000000000 +0100
7142 +/**************************************************************************
7144 + * BRIEF MODULE DESCRIPTION
7145 + * IP Arbiter register definitions
7147 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7149 + * This program is free software; you can redistribute it and/or modify it
7150 + * under the terms of the GNU General Public License as published by the
7151 + * Free Software Foundation; either version 2 of the License, or (at your
7152 + * option) any later version.
7154 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7155 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7156 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7157 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7158 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7159 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7160 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7161 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7162 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7163 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7165 + * You should have received a copy of the GNU General Public License along
7166 + * with this program; if not, write to the Free Software Foundation, Inc.,
7167 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7170 + **************************************************************************
7171 + * May 2004 rkt,neb
7177 + **************************************************************************
7180 +#ifndef __IDT_IPARB_H__
7181 +#define __IDT_IPARB_H__
7185 + IPARB0_PhysicalAddress = 0x18048000,
7186 + IPARB_PhysicalAddress = IPARB0_PhysicalAddress, // Default
7188 + IPARB0_VirtualAddress = 0xB8048000,
7189 + IPARB_VirtualAddress = IPARB0_VirtualAddress, // Default
7194 + IPABMXC_ethernet0Receive = 0,
7195 + IPABMXC_ethernet0Transmit = 1,
7196 + IPABMXC_memoryToHoldFifo = 2,
7197 + IPABMXC_holdFifoToMemory = 3,
7198 + IPABMXC_pciToMemory = 4,
7199 + IPABMXC_memoryToPci = 5,
7200 + IPABMXC_pciTarget = 6,
7201 + IPABMXC_pciTargetStart = 7,
7202 + IPABMXC_cpuToIpBus = 8,
7204 + IPABMXC_Count, // Must be last in list !
7205 + IPABMXC_Min = IPABMXC_ethernet0Receive,
7207 + IPAPXC_PriorityCount = 4, // 3-highest, 0-lowest.
7212 + u32 ipapc [IPAPXC_PriorityCount] ; // ipapc[IPAPXC_] = IPAPC_
7213 + u32 ipabmc [IPABMXC_Count] ; // ipabmc[IPABMXC_] = IPABMC_
7214 + u32 ipac ; // use IPAC_
7215 + u32 ipaitcc; // use IPAITCC_
7217 +} volatile * IPARB_t ;
7222 + IPAC_dp_m = 0x00000001,
7224 + IPAC_dep_m = 0x00000002,
7226 + IPAC_drm_m = 0x00000004,
7228 + IPAC_dwm_m = 0x00000008,
7230 + IPAC_msk_m = 0x00000010,
7233 + IPAPC_ptc_m = 0x00003fff,
7235 + IPAPC_mf_m = 0x00004000,
7236 + IPAPC_cptc_b = 16,
7237 + IPAPC_cptc_m = 0x3fff0000,
7240 + IPAITCC_itcc, = 0x000001ff,
7243 + IPABMC_mtc_m = 0x00000fff,
7245 + IPABMC_p_m = 0x00003000,
7246 + IPABMC_msk_b = 14,
7247 + IPABMC_msk_m = 0x00004000,
7248 + IPABMC_cmtc_b = 16,
7249 + IPABMC_cmtc_m = 0x0fff0000,
7252 +#endif // __IDT_IPARB_H__
7253 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
7254 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_pci.h 1970-01-01 01:00:00.000000000 +0100
7255 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_pci.h 2006-01-10 00:32:33.000000000 +0100
7257 +/**************************************************************************
7259 + * BRIEF MODULE DESCRIPTION
7260 + * PCI register definitio
7262 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7264 + * This program is free software; you can redistribute it and/or modify it
7265 + * under the terms of the GNU General Public License as published by the
7266 + * Free Software Foundation; either version 2 of the License, or (at your
7267 + * option) any later version.
7269 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7270 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7271 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7272 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7273 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7274 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7275 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7276 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7277 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7278 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7280 + * You should have received a copy of the GNU General Public License along
7281 + * with this program; if not, write to the Free Software Foundation, Inc.,
7282 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7285 + **************************************************************************
7286 + * May 2004 rkt, neb.
7292 + **************************************************************************
7295 +#ifndef __IDT_PCI_H__
7296 +#define __IDT_PCI_H__
7300 + PCI0_PhysicalAddress = 0x18080000,
7301 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
7303 + PCI0_VirtualAddress = 0xB8080000,
7304 + PCI_VirtualAddress = PCI0_VirtualAddress,
7309 + PCI_LbaCount = 4, // Local base addresses.
7314 + u32 a ; // Address.
7315 + u32 c ; // Control.
7316 + u32 m ; // mapping.
7326 + PCI_Map_s pcilba [PCI_LbaCount] ;
7334 +} volatile *PCI_t ;
7336 +// PCI messaging unit.
7343 + u32 pciim [PCIM_Count] ;
7344 + u32 pciom [PCIM_Count] ;
7351 +} volatile *PCIM_t ;
7353 +/*******************************************************************************
7355 + * PCI Control Register
7357 + ******************************************************************************/
7361 + PCIC_en_m = 0x00000001,
7363 + PCIC_tnr_m = 0x00000002,
7365 + PCIC_sce_m = 0x00000004,
7367 + PCIC_ien_m = 0x00000008,
7369 + PCIC_aaa_m = 0x00000010,
7371 + PCIC_eap_m = 0x00000020,
7373 + PCIC_pcim_m = 0x000001c0,
7374 + PCIC_pcim_disabled_v = 0,
7375 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
7376 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
7377 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
7378 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
7379 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
7380 + PCIC_pcim_reserved6_v = 6,
7381 + PCIC_pcim_reserved7_v = 7,
7383 + PCIC_igm_m = 0x00000200,
7386 +/*******************************************************************************
7388 + * PCI Status Register
7390 + ******************************************************************************/
7393 + PCIS_eed_m = 0x00000001,
7395 + PCIS_wr_m = 0x00000002,
7397 + PCIS_nmi_m = 0x00000004,
7399 + PCIS_ii_m = 0x00000008,
7401 + PCIS_cwe_m = 0x00000010,
7403 + PCIS_cre_m = 0x00000020,
7405 + PCIS_mdpe_m = 0x00000040,
7407 + PCIS_sta_m = 0x00000080,
7409 + PCIS_rta_m = 0x00000100,
7411 + PCIS_rma_m = 0x00000200,
7413 + PCIS_sse_m = 0x00000400,
7415 + PCIS_ose_m = 0x00000800,
7417 + PCIS_pe_m = 0x00001000,
7419 + PCIS_tae_m = 0x00002000,
7421 + PCIS_rle_m = 0x00004000,
7423 + PCIS_bme_m = 0x00008000,
7425 + PCIS_prd_m = 0x00010000,
7427 + PCIS_rip_m = 0x00020000,
7430 +/*******************************************************************************
7432 + * PCI Status Mask Register
7434 + ******************************************************************************/
7437 + PCISM_eed_m = 0x00000001,
7439 + PCISM_wr_m = 0x00000002,
7441 + PCISM_nmi_m = 0x00000004,
7443 + PCISM_ii_m = 0x00000008,
7445 + PCISM_cwe_m = 0x00000010,
7447 + PCISM_cre_m = 0x00000020,
7449 + PCISM_mdpe_m = 0x00000040,
7451 + PCISM_sta_m = 0x00000080,
7453 + PCISM_rta_m = 0x00000100,
7455 + PCISM_rma_m = 0x00000200,
7457 + PCISM_sse_m = 0x00000400,
7459 + PCISM_ose_m = 0x00000800,
7461 + PCISM_pe_m = 0x00001000,
7463 + PCISM_tae_m = 0x00002000,
7465 + PCISM_rle_m = 0x00004000,
7467 + PCISM_bme_m = 0x00008000,
7469 + PCISM_prd_m = 0x00010000,
7471 + PCISM_rip_m = 0x00020000,
7474 +/*******************************************************************************
7476 + * PCI Configuration Address Register
7478 + ******************************************************************************/
7480 + PCICFGA_reg_b = 2,
7481 + PCICFGA_reg_m = 0x000000fc,
7482 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
7483 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
7484 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
7485 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
7486 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
7487 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
7488 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
7489 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
7490 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
7491 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
7492 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
7493 + PCICFGA_reg_pba0m_v = 0x48>>2,
7494 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
7495 + PCICFGA_reg_pba1m_v = 0x50>>2,
7496 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
7497 + PCICFGA_reg_pba2m_v = 0x58>>2,
7498 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
7499 + PCICFGA_reg_pba3m_v = 0x60>>2,
7500 + PCICFGA_reg_pmgt_v = 0x64>>2,
7501 + PCICFGA_func_b = 8,
7502 + PCICFGA_func_m = 0x00000700,
7503 + PCICFGA_dev_b = 11,
7504 + PCICFGA_dev_m = 0x0000f800,
7505 + PCICFGA_dev_internal_v = 0,
7506 + PCICFGA_bus_b = 16,
7507 + PCICFGA_bus_m = 0x00ff0000,
7508 + PCICFGA_bus_type0_v = 0, //local bus
7509 + PCICFGA_en_b = 31, // read only
7510 + PCICFGA_en_m = 0x80000000,
7514 + PCFGID_vendor_b = 0,
7515 + PCFGID_vendor_m = 0x0000ffff,
7516 + PCFGID_vendor_IDT_v = 0x111d,
7517 + PCFGID_device_b = 16,
7518 + PCFGID_device_m = 0xffff0000,
7519 + PCFGID_device_Korinade_v = 0x0214,
7521 + PCFG04_command_ioena_b = 1,
7522 + PCFG04_command_ioena_m = 0x00000001,
7523 + PCFG04_command_memena_b = 2,
7524 + PCFG04_command_memena_m = 0x00000002,
7525 + PCFG04_command_bmena_b = 3,
7526 + PCFG04_command_bmena_m = 0x00000004,
7527 + PCFG04_command_mwinv_b = 5,
7528 + PCFG04_command_mwinv_m = 0x00000010,
7529 + PCFG04_command_parena_b = 7,
7530 + PCFG04_command_parena_m = 0x00000040,
7531 + PCFG04_command_serrena_b = 9,
7532 + PCFG04_command_serrena_m = 0x00000100,
7533 + PCFG04_command_fastbbena_b = 10,
7534 + PCFG04_command_fastbbena_m = 0x00000200,
7535 + PCFG04_status_b = 16,
7536 + PCFG04_status_m = 0xffff0000,
7537 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
7538 + PCFG04_status_66MHz_m = 0x00200000,
7539 + PCFG04_status_fbb_b = 23,
7540 + PCFG04_status_fbb_m = 0x00800000,
7541 + PCFG04_status_mdpe_b = 24,
7542 + PCFG04_status_mdpe_m = 0x01000000,
7543 + PCFG04_status_dst_b = 25,
7544 + PCFG04_status_dst_m = 0x06000000,
7545 + PCFG04_status_sta_b = 27,
7546 + PCFG04_status_sta_m = 0x08000000,
7547 + PCFG04_status_rta_b = 28,
7548 + PCFG04_status_rta_m = 0x10000000,
7549 + PCFG04_status_rma_b = 29,
7550 + PCFG04_status_rma_m = 0x20000000,
7551 + PCFG04_status_sse_b = 30,
7552 + PCFG04_status_sse_m = 0x40000000,
7553 + PCFG04_status_pe_b = 31,
7554 + PCFG04_status_pe_m = 0x40000000,
7556 + PCFG08_revId_b = 0,
7557 + PCFG08_revId_m = 0x000000ff,
7558 + PCFG08_classCode_b = 0,
7559 + PCFG08_classCode_m = 0xffffff00,
7560 + PCFG08_classCode_bridge_v = 06,
7561 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
7562 + PCFG0C_cacheline_b = 0,
7563 + PCFG0C_cacheline_m = 0x000000ff,
7564 + PCFG0C_masterLatency_b = 8,
7565 + PCFG0C_masterLatency_m = 0x0000ff00,
7566 + PCFG0C_headerType_b = 16,
7567 + PCFG0C_headerType_m = 0x00ff0000,
7568 + PCFG0C_bist_b = 24,
7569 + PCFG0C_bist_m = 0xff000000,
7572 + PCIPBA_msi_m = 0x00000001,
7574 + PCIPBA_p_m = 0x00000004,
7575 + PCIPBA_baddr_b = 8,
7576 + PCIPBA_baddr_m = 0xffffff00,
7578 + PCFGSS_vendorId_b = 0,
7579 + PCFGSS_vendorId_m = 0x0000ffff,
7581 + PCFGSS_id_m = 0xffff0000,
7583 + PCFG3C_interruptLine_b = 0,
7584 + PCFG3C_interruptLine_m = 0x000000ff,
7585 + PCFG3C_interruptPin_b = 8,
7586 + PCFG3C_interruptPin_m = 0x0000ff00,
7587 + PCFG3C_minGrant_b = 16,
7588 + PCFG3C_minGrant_m = 0x00ff0000,
7589 + PCFG3C_maxLat_b = 24,
7590 + PCFG3C_maxLat_m = 0xff000000,
7592 + PCIPBAC_msi_b = 0,
7593 + PCIPBAC_msi_m = 0x00000001,
7595 + PCIPBAC_p_m = 0x00000002,
7596 + PCIPBAC_size_b = 2,
7597 + PCIPBAC_size_m = 0x0000007c,
7599 + PCIPBAC_sb_m = 0x00000080,
7601 + PCIPBAC_pp_m = 0x00000100,
7603 + PCIPBAC_mr_m = 0x00000600,
7604 + PCIPBAC_mr_read_v =0, //no prefetching
7605 + PCIPBAC_mr_readLine_v =1,
7606 + PCIPBAC_mr_readMult_v =2,
7607 + PCIPBAC_mrl_b = 11,
7608 + PCIPBAC_mrl_m = 0x00000800,
7609 + PCIPBAC_mrm_b = 12,
7610 + PCIPBAC_mrm_m = 0x00001000,
7611 + PCIPBAC_trp_b = 13,
7612 + PCIPBAC_trp_m = 0x00002000,
7614 + PCFG40_trdyTimeout_b = 0,
7615 + PCFG40_trdyTimeout_m = 0x000000ff,
7616 + PCFG40_retryLim_b = 8,
7617 + PCFG40_retryLim_m = 0x0000ff00,
7620 +/*******************************************************************************
7622 + * PCI Local Base Address [0|1|2|3] Register
7624 + ******************************************************************************/
7626 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
7627 + PCILBA_baddr_m = 0xffffff00,
7629 +/*******************************************************************************
7631 + * PCI Local Base Address Control Register
7633 + ******************************************************************************/
7635 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
7636 + PCILBAC_msi_m = 0x00000001,
7637 + PCILBAC_msi_mem_v = 0,
7638 + PCILBAC_msi_io_v = 1,
7639 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
7640 + PCILBAC_size_m = 0x0000007c,
7641 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
7642 + PCILBAC_sb_m = 0x00000080,
7643 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
7644 + PCILBAC_rt_m = 0x00000100,
7645 + PCILBAC_rt_noprefetch_v = 0, // mem read
7646 + PCILBAC_rt_prefetch_v = 1, // mem readline
7649 +/*******************************************************************************
7651 + * PCI Local Base Address [0|1|2|3] Mapping Register
7653 + ******************************************************************************/
7655 + PCILBAM_maddr_b = 8,
7656 + PCILBAM_maddr_m = 0xffffff00,
7659 +/*******************************************************************************
7661 + * PCI Decoupled Access Control Register
7663 + ******************************************************************************/
7666 + PCIDAC_den_m = 0x00000001,
7669 +/*******************************************************************************
7671 + * PCI Decoupled Access Status Register
7673 + ******************************************************************************/
7676 + PCIDAS_d_m = 0x00000001,
7678 + PCIDAS_b_m = 0x00000002,
7680 + PCIDAS_e_m = 0x00000004,
7682 + PCIDAS_ofe_m = 0x00000008,
7684 + PCIDAS_off_m = 0x00000010,
7686 + PCIDAS_ife_m = 0x00000020,
7688 + PCIDAS_iff_m = 0x00000040,
7691 +/*******************************************************************************
7693 + * PCI DMA Channel 8 Configuration Register
7695 + ******************************************************************************/
7698 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
7699 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
7700 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
7701 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
7704 +/*******************************************************************************
7706 + * PCI DMA Channel 9 Configuration Register
7708 + ******************************************************************************/
7711 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
7712 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
7715 +/*******************************************************************************
7717 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
7719 + ******************************************************************************/
7721 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
7722 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
7723 + // These are for reads (DMA channel 8)
7724 + PCIDMAD_devcmd_mr_v = 0, //memory read
7725 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
7726 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
7727 + PCIDMAD_devcmd_ior_v = 3, //I/O read
7728 + // These are for writes (DMA channel 9)
7729 + PCIDMAD_devcmd_mw_v = 0, //memory write
7730 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
7731 + PCIDMAD_devcmd_iow_v = 3, //I/O write
7733 + // Swap byte field applies to both DMA channel 8 and 9
7734 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
7735 + PCIDMAD_sb_m = 0x01000000, // swap byte field
7739 +/*******************************************************************************
7741 + * PCI Target Control Register
7743 + ******************************************************************************/
7746 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
7747 + PCITC_rtimer_m = 0x000000ff,
7748 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
7749 + PCITC_dtimer_m = 0x0000ff00,
7750 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
7751 + PCITC_rdr_m = 0x00040000,
7752 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
7753 + PCITC_ddt_m = 0x00080000,
7755 +/*******************************************************************************
7757 + * PCI messaging unit [applies to both inbound and outbound registers ]
7759 + ******************************************************************************/
7762 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7763 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
7764 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7765 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
7766 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
7767 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
7775 +#define PCI_MSG_VirtualAddress 0xB8088010
7776 +#define rc32434_pci ((volatile PCI_t) PCI0_VirtualAddress)
7777 +#define rc32434_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
7779 +#define PCIM_SHFT 0x6
7780 +#define PCIM_BIT_LEN 0x7
7781 +#define PCIM_H_EA 0x3
7782 +#define PCIM_H_IA_FIX 0x4
7783 +#define PCIM_H_IA_RR 0x5
7785 +#define PCI_ADDR_START 0x13000000
7788 +#define PCI_ADDR_START 0x50000000
7790 +#define CPUTOPCI_MEM_WIN 0x02000000
7791 +#define CPUTOPCI_IO_WIN 0x00100000
7792 +#define PCILBA_SIZE_SHFT 2
7793 +#define PCILBA_SIZE_MASK 0x1F
7794 +#define SIZE_256MB 0x1C
7795 +#define SIZE_128MB 0x1B
7796 +#define SIZE_64MB 0x1A
7797 +#define SIZE_32MB 0x19
7798 +#define SIZE_16MB 0x18
7799 +#define SIZE_4MB 0x16
7800 +#define SIZE_2MB 0x15
7801 +#define SIZE_1MB 0x14
7802 +#define KORINA_CONFIG0_ADDR 0x80000000
7803 +#define KORINA_CONFIG1_ADDR 0x80000004
7804 +#define KORINA_CONFIG2_ADDR 0x80000008
7805 +#define KORINA_CONFIG3_ADDR 0x8000000C
7806 +#define KORINA_CONFIG4_ADDR 0x80000010
7807 +#define KORINA_CONFIG5_ADDR 0x80000014
7808 +#define KORINA_CONFIG6_ADDR 0x80000018
7809 +#define KORINA_CONFIG7_ADDR 0x8000001C
7810 +#define KORINA_CONFIG8_ADDR 0x80000020
7811 +#define KORINA_CONFIG9_ADDR 0x80000024
7812 +#define KORINA_CONFIG10_ADDR 0x80000028
7813 +#define KORINA_CONFIG11_ADDR 0x8000002C
7814 +#define KORINA_CONFIG12_ADDR 0x80000030
7815 +#define KORINA_CONFIG13_ADDR 0x80000034
7816 +#define KORINA_CONFIG14_ADDR 0x80000038
7817 +#define KORINA_CONFIG15_ADDR 0x8000003C
7818 +#define KORINA_CONFIG16_ADDR 0x80000040
7819 +#define KORINA_CONFIG17_ADDR 0x80000044
7820 +#define KORINA_CONFIG18_ADDR 0x80000048
7821 +#define KORINA_CONFIG19_ADDR 0x8000004C
7822 +#define KORINA_CONFIG20_ADDR 0x80000050
7823 +#define KORINA_CONFIG21_ADDR 0x80000054
7824 +#define KORINA_CONFIG22_ADDR 0x80000058
7825 +#define KORINA_CONFIG23_ADDR 0x8000005C
7826 +#define KORINA_CONFIG24_ADDR 0x80000060
7827 +#define KORINA_CONFIG25_ADDR 0x80000064
7828 +#define KORINA_CMD (PCFG04_command_ioena_m | \
7829 + PCFG04_command_memena_m | \
7830 + PCFG04_command_bmena_m | \
7831 + PCFG04_command_mwinv_m | \
7832 + PCFG04_command_parena_m | \
7833 + PCFG04_command_serrena_m )
7835 +#define KORINA_STAT (PCFG04_status_mdpe_m | \
7836 + PCFG04_status_sta_m | \
7837 + PCFG04_status_rta_m | \
7838 + PCFG04_status_rma_m | \
7839 + PCFG04_status_sse_m | \
7840 + PCFG04_status_pe_m)
7842 +#define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
7844 +#define KORINA_REVID 0
7845 +#define KORINA_CLASS_CODE 0
7846 +#define KORINA_CNFG2 ((KORINA_CLASS_CODE<<8) | \
7849 +#define KORINA_CACHE_LINE_SIZE 4
7850 +#define KORINA_MASTER_LAT 0x3c
7851 +#define KORINA_HEADER_TYPE 0
7852 +#define KORINA_BIST 0
7854 +#define KORINA_CNFG3 ((KORINA_BIST << 24) | \
7855 + (KORINA_HEADER_TYPE<<16) | \
7856 + (KORINA_MASTER_LAT<<8) | \
7857 + KORINA_CACHE_LINE_SIZE )
7859 +#define KORINA_BAR0 0x00000008 /* 128 MB Memory */
7860 +#define KORINA_BAR1 0x18800001 /* 1 MB IO */
7861 +#define KORINA_BAR2 0x18000001 /* 2 MB IO window for Korina
7862 + internal Registers */
7863 +#define KORINA_BAR3 0x48000008 /* Spare 128 MB Memory */
7865 +#define KORINA_CNFG4 KORINA_BAR0
7866 +#define KORINA_CNFG5 KORINA_BAR1
7867 +#define KORINA_CNFG6 KORINA_BAR2
7868 +#define KORINA_CNFG7 KORINA_BAR3
7870 +#define KORINA_SUBSYS_VENDOR_ID 0x011d
7871 +#define KORINA_SUBSYSTEM_ID 0x0214
7872 +#define KORINA_CNFG8 0
7873 +#define KORINA_CNFG9 0
7874 +#define KORINA_CNFG10 0
7875 +#define KORINA_CNFG11 ((KORINA_SUBSYS_VENDOR_ID<<16) | \
7876 + KORINA_SUBSYSTEM_ID)
7877 +#define KORINA_INT_LINE 1
7878 +#define KORINA_INT_PIN 1
7879 +#define KORINA_MIN_GNT 8
7880 +#define KORINA_MAX_LAT 0x38
7881 +#define KORINA_CNFG12 0
7882 +#define KORINA_CNFG13 0
7883 +#define KORINA_CNFG14 0
7884 +#define KORINA_CNFG15 ((KORINA_MAX_LAT<<24) | \
7885 + (KORINA_MIN_GNT<<16) | \
7886 + (KORINA_INT_PIN<<8) | \
7888 +#define KORINA_RETRY_LIMIT 0x80
7889 +#define KORINA_TRDY_LIMIT 0x80
7890 +#define KORINA_CNFG16 ((KORINA_RETRY_LIMIT<<8) | \
7891 + KORINA_TRDY_LIMIT)
7892 +#define PCI_PBAxC_R 0x0
7893 +#define PCI_PBAxC_RL 0x1
7894 +#define PCI_PBAxC_RM 0x2
7895 +#define SIZE_SHFT 2
7897 +#if defined(__MIPSEB__)
7898 +#define KORINA_PBA0C ( PCIPBAC_mrl_m | PCIPBAC_sb_m | \
7899 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
7901 + (SIZE_128MB<<SIZE_SHFT) | \
7904 +#define KORINA_PBA0C ( PCIPBAC_mrl_m | \
7905 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
7907 + (SIZE_128MB<<SIZE_SHFT) | \
7910 +#define KORINA_CNFG17 KORINA_PBA0C
7911 +#define KORINA_PBA0M 0x0
7912 +#define KORINA_CNFG18 KORINA_PBA0M
7914 +#if defined(__MIPSEB__)
7915 +#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
7918 +#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | \
7921 +#define KORINA_CNFG19 KORINA_PBA1C
7922 +#define KORINA_PBA1M 0x0
7923 +#define KORINA_CNFG20 KORINA_PBA1M
7925 +#if defined(__MIPSEB__)
7926 +#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
7929 +#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | \
7932 +#define KORINA_CNFG21 KORINA_PBA2C
7933 +#define KORINA_PBA2M 0x18000000
7934 +#define KORINA_CNFG22 KORINA_PBA2M
7935 +#define KORINA_PBA3C 0
7936 +#define KORINA_CNFG23 KORINA_PBA3C
7937 +#define KORINA_PBA3M 0
7938 +#define KORINA_CNFG24 KORINA_PBA3M
7942 +#define PCITC_DTIMER_VAL 8
7943 +#define PCITC_RTIMER_VAL 0x10
7948 +#endif // __IDT_PCI_H__
7952 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
7953 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_rst.h 1970-01-01 01:00:00.000000000 +0100
7954 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_rst.h 2006-01-10 00:32:33.000000000 +0100
7956 +/**************************************************************************
7958 + * BRIEF MODULE DESCRIPTION
7959 + * Reset register definitions.
7961 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
7963 + * This program is free software; you can redistribute it and/or modify it
7964 + * under the terms of the GNU General Public License as published by the
7965 + * Free Software Foundation; either version 2 of the License, or (at your
7966 + * option) any later version.
7968 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7969 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
7970 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
7971 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
7972 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
7973 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7974 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
7975 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7976 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
7977 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7979 + * You should have received a copy of the GNU General Public License along
7980 + * with this program; if not, write to the Free Software Foundation, Inc.,
7981 + * 675 Mass Ave, Cambridge, MA 02139, USA.
7984 + **************************************************************************
7985 + * May 2004 rkt, neb.
7991 + **************************************************************************
7994 +#ifndef __IDT_RST_H__
7995 +#define __IDT_RST_H__
7999 + RST0_PhysicalAddress = 0x18000000,
8000 + RST_PhysicalAddress = RST0_PhysicalAddress, // Default
8002 + RST0_VirtualAddress = 0xb8000000,
8003 + RST_VirtualAddress = RST0_VirtualAddress, // Default
8006 +typedef struct RST_s
8008 + u32 filler [0x0006] ;
8010 + u32 filler2 [0x2000-8] ; // Pad out to offset 0x8000
8014 +} volatile * RST_t ;
8019 + SYSID_rev_m = 0x000000ff,
8021 + SYSID_imp_m = 0x000fff00,
8022 + SYSID_vendor_b = 8,
8023 + SYSID_vendor_m = 0xfff00000,
8026 + BCV_pll_m = 0x0000000f,
8027 + BCV_pll_PLLBypass_v = 0x0, // PCLK=1*CLK.
8028 + BCV_pll_Mul3_v = 0x1, // PCLK=3*CLK.
8029 + BCV_pll_Mul4_v = 0x2, // PCLK=4*CLK.
8030 + BCV_pll_SlowMul5_v = 0x3, // PCLK=5*CLK.
8031 + BCV_pll_Mul5_v = 0x4, // PCLK=5*CLK.
8032 + BCV_pll_SlowMul6_v = 0x5, // PCLK=6*CLK.
8033 + BCV_pll_Mul6_v = 0x6, // PCLK=6*CLK.
8034 + BCV_pll_Mul8_v = 0x7, // PCLK=8*CLK.
8035 + BCV_pll_Mul10_v = 0x8, // PCLK=10*CLK.
8036 + BCV_pll_Res9_v = 0x9,
8037 + BCV_pll_Res10_v = 0xa,
8038 + BCV_pll_Res11_v = 0xb,
8039 + BCV_pll_Res12_v = 0xc,
8040 + BCV_pll_Res13_v = 0xd,
8041 + BCV_pll_Res14_v = 0xe,
8042 + BCV_pll_Res15_v = 0xf,
8044 + BCV_clkDiv_m = 0x00000030,
8045 + BCV_clkDiv_Div1_v = 0x0,
8046 + BCV_clkDiv_Div2_v = 0x1,
8047 + BCV_clkDiv_Div4_v = 0x2,
8048 + BCV_clkDiv_Res3_v = 0x3,
8049 + BCV_bigEndian_b = 6,
8050 + BCV_bigEndian_m = 0x00000040,
8051 + BCV_resetFast_b = 7,
8052 + BCV_resetFast_m = 0x00000080,
8053 + BCV_pciMode_b = 8,
8054 + BCV_pciMode_m = 0x00000700,
8055 + BCV_pciMode_disabled_v = 0, // PCI is disabled.
8056 + BCV_pciMode_tnr_v = 1, // satellite Target Not Ready.
8057 + BCV_pciMode_suspended_v = 2, // satellite with suspended CPU.
8058 + BCV_pciMode_external_v = 3, // host, external arbiter.
8059 + BCV_pciMode_fixed_v = 4, // host, fixed priority arbiter.
8060 + BCV_pciMode_roundRobin_v= 5, // host, round robin arbiter.
8061 + BCV_pciMode_res6_v = 6,
8062 + BCV_pciMode_res7_v = 7,
8063 + BCV_watchDisable_b = 11,
8064 + BCV_watchDisable_m = 0x00000800,
8066 + BCV_res12_m = 0x00001000,
8068 + BCV_res13_m = 0x00002000,
8070 + BCV_res14_m = 0x00004000,
8072 + BCV_res15_m = 0x00008000,
8074 +#endif // __IDT_RST_H__
8075 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
8076 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_spi.h 1970-01-01 01:00:00.000000000 +0100
8077 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_spi.h 2006-01-10 00:32:33.000000000 +0100
8079 +/**************************************************************************
8081 + * BRIEF MODULE DESCRIPTION
8082 + * Serial Peripheral Interface register definitions.
8084 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8086 + * This program is free software; you can redistribute it and/or modify it
8087 + * under the terms of the GNU General Public License as published by the
8088 + * Free Software Foundation; either version 2 of the License, or (at your
8089 + * option) any later version.
8091 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8092 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8093 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8094 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8095 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8096 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8097 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8098 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8099 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8100 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8102 + * You should have received a copy of the GNU General Public License along
8103 + * with this program; if not, write to the Free Software Foundation, Inc.,
8104 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8107 + **************************************************************************
8108 + * May 2004 rkt, neb.
8114 + **************************************************************************
8117 +#ifndef __IDT_SPI_H__
8118 +#define __IDT_SPI_H__
8122 + SPI0_PhysicalAddress = 0x18070000,
8123 + SPI_PhysicalAddress = SPI0_PhysicalAddress,
8125 + SPI0_VirtualAddress = 0xB8070000,
8126 + SPI_VirtualAddress = SPI0_VirtualAddress,
8131 + u32 spcp ; // prescalar. 0=off, * spiClk = sysClk/(2*(spcp+1)*SPR)
8132 + u32 spc ; // spi control reg use SPC_
8133 + u32 sps ; // spi status reg use SPS_
8134 + u32 spd ; // spi data reg use SPD_
8135 + u32 siofunc ; // serial IO function use SIOFUNC_
8136 + u32 siocfg ; // serial IO config use SIOCFG_
8137 + u32 siod; // serial IO data use SIOD_
8138 +} volatile *SPI_t ;
8143 + SPCP_div_m = 0x000000ff,
8145 + SPC_spr_m = 0x00000003,
8146 + SPC_spr_div2_v = 0,
8147 + SPC_spr_div4_v = 1,
8148 + SPC_spr_div16_v = 2,
8149 + SPC_spr_div32_v = 3,
8151 + SPC_cpha_m = 0x00000004,
8153 + SPC_cpol_m = 0x00000008,
8155 + SPC_mstr_m = 0x00000010,
8157 + SPC_spe_m = 0x00000040,
8159 + SPC_spie_m = 0x00000080,
8162 + SPS_modf_m = 0x00000010,
8164 + SPS_wcol_m = 0x00000040,
8166 + SPS_spif_m = 0x00000070,
8169 + SPD_data_m = 0x000000ff,
8171 + SIOFUNC_sdo_b = 0,
8172 + SIOFUNC_sdo_m = 0x00000001,
8173 + SIOFUNC_sdi_b = 1,
8174 + SIOFUNC_sdi_m = 0x00000002,
8175 + SIOFUNC_sck_b = 2,
8176 + SIOFUNC_sck_m = 0x00000004,
8177 + SIOFUNC_pci_b = 3,
8178 + SIOFUNC_pci_m = 0x00000008,
8181 + SIOCFG_sdo_m = 0x00000001,
8183 + SIOCFG_sdi_m = 0x00000002,
8185 + SIOCFG_sck_m = 0x00000004,
8187 + SIOCFG_pci_m = 0x00000008,
8190 + SIOD_sdo_m = 0x00000001,
8192 + SIOD_sdi_m = 0x00000002,
8194 + SIOD_sck_m = 0x00000004,
8196 + SIOD_pci_m = 0x00000008,
8198 +#endif // __IDT_SPI_H__
8199 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
8200 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_timer.h 1970-01-01 01:00:00.000000000 +0100
8201 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_timer.h 2006-01-10 00:32:33.000000000 +0100
8203 +/**************************************************************************
8205 + * BRIEF MODULE DESCRIPTION
8206 + * Definitions for timer registers
8208 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8210 + * This program is free software; you can redistribute it and/or modify it
8211 + * under the terms of the GNU General Public License as published by the
8212 + * Free Software Foundation; either version 2 of the License, or (at your
8213 + * option) any later version.
8215 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8216 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8217 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8218 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8219 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8220 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8221 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8222 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8223 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8224 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8226 + * You should have received a copy of the GNU General Public License along
8227 + * with this program; if not, write to the Free Software Foundation, Inc.,
8228 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8231 + **************************************************************************
8232 + * May 2004 rkt,neb.
8238 + **************************************************************************
8241 +#ifndef __IDT_TIM_H__
8242 +#define __IDT_TIM_H__
8246 + TIM0_PhysicalAddress = 0x18028000,
8247 + TIM_PhysicalAddress = TIM0_PhysicalAddress, // Default
8249 + TIM0_VirtualAddress = 0xb8028000,
8250 + TIM_VirtualAddress = TIM0_VirtualAddress, // Default
8262 + u32 ctc ; //use CTC_
8265 +typedef struct TIM_s
8267 + struct TIM_CNTR_s tim [TIM_Count] ;
8268 + u32 rcount ; //use RCOUNT_
8269 + u32 rcompare ; //use RCOMPARE_
8270 + u32 rtc ; //use RTC_
8271 +} volatile * TIM_t ;
8276 + CTC_en_m = 0x00000001,
8278 + CTC_to_m = 0x00000002,
8280 + RCOUNT_count_b = 0,
8281 + RCOUNT_count_m = 0x0000ffff,
8282 + RCOMPARE_compare_b = 0,
8283 + RCOMPARE_compare_m = 0x0000ffff,
8285 + RTC_ce_m = 0x00000001,
8287 + RTC_to_m = 0x00000002,
8289 + RTC_rqe_m = 0x00000004,
8292 +#endif // __IDT_TIM_H__
8294 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
8295 --- linux-2.6.15/include/asm-mips/idt-boards/rc32434/rc32434_uart.h 1970-01-01 01:00:00.000000000 +0100
8296 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32434/rc32434_uart.h 2006-01-10 00:32:33.000000000 +0100
8298 +/**************************************************************************
8300 + * BRIEF MODULE DESCRIPTION
8301 + * UART register definitions
8303 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8305 + * This program is free software; you can redistribute it and/or modify it
8306 + * under the terms of the GNU General Public License as published by the
8307 + * Free Software Foundation; either version 2 of the License, or (at your
8308 + * option) any later version.
8310 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8311 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8312 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8313 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8314 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8315 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8316 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8317 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8318 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8319 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8321 + * You should have received a copy of the GNU General Public License along
8322 + * with this program; if not, write to the Free Software Foundation, Inc.,
8323 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8326 + **************************************************************************
8327 + * May 2004 rkt, neb.
8333 + **************************************************************************
8336 +#ifndef __IDT_UART_H__
8337 +#define __IDT_UART_H__
8341 + UART0_PhysicalAddress = 0x1c000000,
8342 + UART_PhysicalAddress = UART0_PhysicalAddress, // Default
8344 + UART0_VirtualAddress = 0xbc000000,
8345 + UART_VirtualAddress = UART0_VirtualAddress, // Default
8349 + * Register definitions are in bytes so we can handle endian problems.
8352 +typedef struct UART_s
8356 + u32 const uartrb ; // 0x00 - DLAB=0, read.
8357 + u32 uartth ; // 0x00 - DLAB=0, write.
8358 + u32 uartdll ; // 0x00 - DLAB=1, read/write.
8363 + u32 uartie ; // 0x04 - DLAB=0, read/write.
8364 + u32 uartdlh ; // 0x04 - DLAB=1, read/write.
8368 + u32 const uartii ; // 0x08 - DLAB=0, read.
8369 + u32 uartfc ; // 0x08 - DLAB=0, write.
8372 + u32 uartlc ; // 0x0c
8373 + u32 uartmc ; // 0x10
8374 + u32 uartls ; // 0x14
8375 + u32 uartms ; // 0x18
8376 + u32 uarts ; // 0x1c
8377 +} volatile *UART_t ;
8379 +// Reset registers.
8380 +typedef u32 volatile *UARTRR_t ;
8385 + UARTIE_rda_m = 0x00000001,
8387 + UARTIE_the_m = 0x00000002,
8389 + UARTIE_rls_m = 0x00000004,
8391 + UARTIE_ems_m = 0x00000008,
8394 + UARTII_pi_m = 0x00000001,
8396 + UARTII_iid_m = 0x0000000e,
8397 + UARTII_iid_ms_v = 0, // Modem stat-CTS,DSR,RI or DCD.
8398 + UARTII_iid_thre_v = 1, // Trans. Holding Reg. empty.
8399 + UARTII_iid_rda_v = 2, // Receive data available
8400 + UARTII_iid_rls_v = 3, // Overrun, parity, etc, error.
8401 + UARTII_iid_res4_v = 4, // reserved.
8402 + UARTII_iid_res5_v = 5, // reserved.
8403 + UARTII_iid_cto_v = 6, // Character timeout.
8404 + UARTII_iid_res7_v = 7, // reserved.
8407 + UARTFC_en_m = 0x00000001,
8409 + UARTFC_rr_m = 0x00000002,
8411 + UARTFC_tr_m = 0x00000004,
8413 + UARTFC_dms_m = 0x00000008,
8415 + UARTFC_rt_m = 0x000000c0,
8416 + UARTFC_rt_1Byte_v = 0,
8417 + UARTFC_rt_4Byte_v = 1,
8418 + UARTFC_rt_8Byte_v = 2,
8419 + UARTFC_rt_14Byte_v = 3,
8422 + UARTLC_wls_m = 0x00000003,
8423 + UARTLC_wls_5Bits_v = 0,
8424 + UARTLC_wls_6Bits_v = 1,
8425 + UARTLC_wls_7Bits_v = 2,
8426 + UARTLC_wls_8Bits_v = 3,
8428 + UARTLC_stb_m = 0x00000004,
8430 + UARTLC_pen_m = 0x00000008,
8432 + UARTLC_eps_m = 0x00000010,
8434 + UARTLC_sp_m = 0x00000020,
8436 + UARTLC_sb_m = 0x00000040,
8437 + UARTLC_dlab_b = 7,
8438 + UARTLC_dlab_m = 0x00000080,
8441 + UARTMC_dtr_m = 0x00000001,
8443 + UARTMC_rts_m = 0x00000002,
8445 + UARTMC_o1_m = 0x00000004,
8447 + UARTMC_o2_m = 0x00000008,
8449 + UARTMC_lp_m = 0x00000010,
8452 + UARTLS_dr_m = 0x00000001,
8454 + UARTLS_oe_m = 0x00000002,
8456 + UARTLS_pe_m = 0x00000004,
8458 + UARTLS_fe_m = 0x00000008,
8460 + UARTLS_bi_m = 0x00000010,
8462 + UARTLS_thr_m = 0x00000020,
8464 + UARTLS_te_m = 0x00000040,
8466 + UARTLS_rfe_m = 0x00000080,
8468 + UARTMS_dcts_b = 0,
8469 + UARTMS_dcts_m = 0x00000001,
8470 + UARTMS_ddsr_b = 1,
8471 + UARTMS_ddsr_m = 0x00000002,
8472 + UARTMS_teri_b = 2,
8473 + UARTMS_teri_m = 0x00000004,
8474 + UARTMS_ddcd_b = 3,
8475 + UARTMS_ddcd_m = 0x00000008,
8477 + UARTMS_cts_m = 0x00000010,
8479 + UARTMS_dsr_m = 0x00000020,
8481 + UARTMS_ri_m = 0x00000040,
8483 + UARTMS_dcd_m = 0x00000080,
8486 +#endif // __IDT_UART_H__
8487 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
8488 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_dma.h 1970-01-01 01:00:00.000000000 +0100
8489 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_dma.h 2006-01-10 00:32:33.000000000 +0100
8491 +/**************************************************************************
8493 + * BRIEF MODULE DESCRIPTION
8494 + * Register definitions for IDT RC32438 DMA.
8496 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8498 + * This program is free software; you can redistribute it and/or modify it
8499 + * under the terms of the GNU General Public License as published by the
8500 + * Free Software Foundation; either version 2 of the License, or (at your
8501 + * option) any later version.
8503 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8504 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8505 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8506 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8507 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8508 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8509 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8510 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8511 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8512 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8514 + * You should have received a copy of the GNU General Public License along
8515 + * with this program; if not, write to the Free Software Foundation, Inc.,
8516 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8519 + **************************************************************************
8520 + * May 2004 P. Sadik.
8526 + **************************************************************************
8528 +#ifndef __IDT_RC32438_DMA_H__
8529 +#define __IDT_RC32438_DMA_H__
8532 + DMA0_PhysicalAddress = 0x18040000,
8533 + DMA_PhysicalAddress = DMA0_PhysicalAddress, // Default
8535 + DMA0_VirtualAddress = 0xb8040000,
8536 + DMA_VirtualAddress = DMA0_VirtualAddress, // Default
8540 + * DMA descriptor (in physical memory).
8543 +typedef struct DMAD_s
8545 + u32 control ; // Control. use DMAD_*
8546 + u32 ca ; // Current Address.
8547 + u32 devcs ; // Device control and status.
8548 + u32 link ; // Next descriptor in chain.
8549 +} volatile *DMAD_t ;
8553 + DMAD_size = sizeof (struct DMAD_s),
8554 + DMAD_count_b = 0, // in DMAD_t -> control
8555 + DMAD_count_m = 0x0003ffff, // in DMAD_t -> control
8556 + DMAD_ds_b = 20, // in DMAD_t -> control
8557 + DMAD_ds_m = 0x00300000, // in DMAD_t -> control
8558 + DMAD_ds_extToMem0_v = 0,
8559 + DMAD_ds_memToExt0_v = 1,
8560 + DMAD_ds_extToMem1_v = 0,
8561 + DMAD_ds_memToExt1_v = 1,
8562 + DMAD_ds_ethRcv0_v = 0,
8563 + DMAD_ds_ethXmt0_v = 0,
8564 + DMAD_ds_ethRcv1_v = 0,
8565 + DMAD_ds_ethXmt2_v = 0,
8566 + DMAD_ds_memToFifo_v = 0,
8567 + DMAD_ds_fifoToMem_v = 0,
8568 + DMAD_ds_rng_de_v = 1,//randomNumberGenerator on LC/DE
8569 + DMAD_ds_pciToMem_v = 0,
8570 + DMAD_ds_memToPci_v = 0,
8571 + DMAD_ds_securityInput_v = 0,
8572 + DMAD_ds_securityOutput_v = 0,
8573 + DMAD_ds_rng_se_v = 0,//randomNumberGenerator on SE
8575 + DMAD_devcmd_b = 22, // in DMAD_t -> control
8576 + DMAD_devcmd_m = 0x01c00000, // in DMAD_t -> control
8577 + DMAD_devcmd_byte_v = 0, //memory-to-memory
8578 + DMAD_devcmd_halfword_v = 1, //memory-to-memory
8579 + DMAD_devcmd_word_v = 2, //memory-to-memory
8580 + DMAD_devcmd_2words_v = 3, //memory-to-memory
8581 + DMAD_devcmd_4words_v = 4, //memory-to-memory
8582 + DMAD_devcmd_6words_v = 5, //memory-to-memory
8583 + DMAD_devcmd_8words_v = 6, //memory-to-memory
8584 + DMAD_devcmd_16words_v = 7, //memory-to-memory
8585 + DMAD_cof_b = 25, // chain on finished
8586 + DMAD_cof_m = 0x02000000, //
8587 + DMAD_cod_b = 26, // chain on done
8588 + DMAD_cod_m = 0x04000000, //
8589 + DMAD_iof_b = 27, // interrupt on finished
8590 + DMAD_iof_m = 0x08000000, //
8591 + DMAD_iod_b = 28, // interrupt on done
8592 + DMAD_iod_m = 0x10000000, //
8593 + DMAD_t_b = 29, // terminated
8594 + DMAD_t_m = 0x20000000, //
8595 + DMAD_d_b = 30, // done
8596 + DMAD_d_m = 0x40000000, //
8597 + DMAD_f_b = 31, // finished
8598 + DMAD_f_m = 0x80000000, //
8602 + * DMA register (within Internal Register Map).
8607 + u32 dmac ; // Control.
8608 + u32 dmas ; // Status.
8609 + u32 dmasm ; // Mask.
8610 + u32 dmadptr ; // Descriptor pointer.
8611 + u32 dmandptr ; // Next descriptor pointer.
8614 +typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
8616 +//DMA_Channels use DMACH_count instead
8620 + DMAC_run_b = 0, //
8621 + DMAC_run_m = 0x00000001, //
8622 + DMAC_dm_b = 1, // done mask
8623 + DMAC_dm_m = 0x00000002, //
8624 + DMAC_mode_b = 2, //
8625 + DMAC_mode_m = 0x0000000c, //
8626 + DMAC_mode_auto_v = 0,
8627 + DMAC_mode_burst_v = 1,
8628 + DMAC_mode_transfer_v = 2, //usually used
8629 + DMAC_mode_reserved_v = 3,
8631 + DMAC_a_m = 0x00000010, //
8633 + DMAS_f_b = 0, // finished (sticky)
8634 + DMAS_f_m = 0x00000001, //
8635 + DMAS_d_b = 1, // done (sticky)
8636 + DMAS_d_m = 0x00000002, //
8637 + DMAS_c_b = 2, // chain (sticky)
8638 + DMAS_c_m = 0x00000004, //
8639 + DMAS_e_b = 3, // error (sticky)
8640 + DMAS_e_m = 0x00000008, //
8641 + DMAS_h_b = 4, // halt (sticky)
8642 + DMAS_h_m = 0x00000010, //
8644 + DMASM_f_b = 0, // finished (1=mask)
8645 + DMASM_f_m = 0x00000001, //
8646 + DMASM_d_b = 1, // done (1=mask)
8647 + DMASM_d_m = 0x00000002, //
8648 + DMASM_c_b = 2, // chain (1=mask)
8649 + DMASM_c_m = 0x00000004, //
8650 + DMASM_e_b = 3, // error (1=mask)
8651 + DMASM_e_m = 0x00000008, //
8652 + DMASM_h_b = 4, // halt (1=mask)
8653 + DMASM_h_m = 0x00000010, //
8657 + * DMA channel definitions
8662 + DMACH_extToMem0 = 0,
8663 + DMACH_memToExt0 = 0,
8664 + DMACH_extToMem1 = 1,
8665 + DMACH_memToExt1 = 1,
8666 + DMACH_ethRcv0 = 2,
8667 + DMACH_ethXmt0 = 3,
8668 + DMACH_ethRcv1 = 4,
8669 + DMACH_ethXmt2 = 5,
8670 + DMACH_memToFifo = 6,
8671 + DMACH_fifoToMem = 7,
8672 + DMACH_rng_de = 7,//randomNumberGenerator on LC/DE
8673 + DMACH_pciToMem = 8,
8674 + DMACH_memToPci = 9,
8675 + DMACH_securityInput = 10,
8676 + DMACH_securityOutput = 11,
8677 + DMACH_rng_se = 12, //randomNumberGenerator on SE
8679 + DMACH_count //must be last
8683 +typedef struct DMAC_s
8685 + struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
8686 +} volatile *DMA_t ;
8690 + * External DMA parameters
8695 + DMADEVCMD_ts_b = 0, // ts field in devcmd
8696 + DMADEVCMD_ts_m = 0x00000007, // ts field in devcmd
8697 + DMADEVCMD_ts_byte_v = 0,
8698 + DMADEVCMD_ts_halfword_v = 1,
8699 + DMADEVCMD_ts_word_v = 2,
8700 + DMADEVCMD_ts_2word_v = 3,
8701 + DMADEVCMD_ts_4word_v = 4,
8702 + DMADEVCMD_ts_6word_v = 5,
8703 + DMADEVCMD_ts_8word_v = 6,
8704 + DMADEVCMD_ts_16word_v = 7
8708 +#if 1 // aws - Compatibility.
8709 +# define EXTDMA_ts_b DMADEVCMD_ts_b
8710 +# define EXTDMA_ts_m DMADEVCMD_ts_m
8711 +# define EXTDMA_ts_byte_v DMADEVCMD_ts_byte_v
8712 +# define EXTDMA_ts_halfword_v DMADEVCMD_ts_halfword_v
8713 +# define EXTDMA_ts_word_v DMADEVCMD_ts_word_v
8714 +# define EXTDMA_ts_2word_v DMADEVCMD_ts_2word_v
8715 +# define EXTDMA_ts_4word_v DMADEVCMD_ts_4word_v
8716 +# define EXTDMA_ts_6word_v DMADEVCMD_ts_6word_v
8717 +# define EXTDMA_ts_8word_v DMADEVCMD_ts_8word_v
8718 +# define EXTDMA_ts_16word_v DMADEVCMD_ts_16word_v
8719 +#endif // aws - Compatibility.
8721 +#endif //__IDT_RC32438_DMA_H__
8722 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
8723 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h 1970-01-01 01:00:00.000000000 +0100
8724 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_dma_v.h 2006-01-10 00:32:33.000000000 +0100
8726 +/**************************************************************************
8728 + * BRIEF MODULE DESCRIPTION
8729 + * DMA operations for IDT RC32438.
8731 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8733 + * This program is free software; you can redistribute it and/or modify it
8734 + * under the terms of the GNU General Public License as published by the
8735 + * Free Software Foundation; either version 2 of the License, or (at your
8736 + * option) any later version.
8738 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8739 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8740 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8741 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8742 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8743 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8744 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8745 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8746 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8747 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8749 + * You should have received a copy of the GNU General Public License along
8750 + * with this program; if not, write to the Free Software Foundation, Inc.,
8751 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8754 + **************************************************************************
8755 + * May 2004 P. Sadik.
8761 + **************************************************************************
8764 +#ifndef __IDT_RC32438_DMA_V_H__
8765 +#define __IDT_RC32438_DMA_V_H__
8766 +#include <asm/idt-boards/rc32438/rc32438_dma.h>
8768 +#define DMA_CHAN_OFFSET 0x14
8769 +#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
8770 +#define DMA_COUNT(count) \
8771 + ((count) & DMAD_count_m)
8773 +#define DMA_HALT_TIMEOUT 500
8776 +static inline int rc32438_halt_dma(DMA_Chan_t ch)
8779 + if (rc32438_readl(&ch->dmac) & DMAC_run_m) {
8780 + rc32438_writel(0, &ch->dmac);
8782 + for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
8783 + if (rc32438_readl(&ch->dmas) & DMAS_h_m) {
8784 + rc32438_writel(0, &ch->dmas);
8791 + return timeout ? 0 : 1;
8797 +static inline void rc32438_start_dma(DMA_Chan_t ch, u32 dma_addr)
8799 + rc32438_writel(0, &ch->dmandptr);
8800 + rc32438_writel(dma_addr, &ch->dmadptr);
8803 +static inline void rc32438_chain_dma(DMA_Chan_t ch, u32 dma_addr)
8805 + rc32438_writel(dma_addr, &ch->dmandptr);
8807 +#endif //__IDT_RC32438_DMA_V_H__
8808 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
8809 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_eth.h 1970-01-01 01:00:00.000000000 +0100
8810 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_eth.h 2006-01-10 00:32:33.000000000 +0100
8812 +/**************************************************************************
8814 + * BRIEF MODULE DESCRIPTION
8815 + * Definitions for IDT EB438 ethernet
8817 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
8819 + * This program is free software; you can redistribute it and/or modify it
8820 + * under the terms of the GNU General Public License as published by the
8821 + * Free Software Foundation; either version 2 of the License, or (at your
8822 + * option) any later version.
8824 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8825 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8826 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
8827 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
8828 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
8829 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8830 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8831 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8832 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8833 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8835 + * You should have received a copy of the GNU General Public License along
8836 + * with this program; if not, write to the Free Software Foundation, Inc.,
8837 + * 675 Mass Ave, Cambridge, MA 02139, USA.
8840 + **************************************************************************
8841 + * May 2004 P. Sadik.
8847 + **************************************************************************
8850 +#ifndef __IDT_RC32438_ETH_H__
8851 +#define __IDT_RC32438_ETH_H__
8854 + ETH0_PhysicalAddress = 0x18058000,
8855 + ETH_PhysicalAddress = ETH0_PhysicalAddress, // Default
8857 + ETH0_VirtualAddress = 0xb8058000,
8858 + ETH_VirtualAddress = ETH0_VirtualAddress, // Default
8859 + ETH1_PhysicalAddress = 0x18060000,
8860 + ETH1_VirtualAddress = 0xb8060000, // Default
8870 + u32 ethu0 [4] ; // Reserved.
8873 + u32 eth_u1 [10] ; // Reserved.
8875 + u32 eth_u2 [42] ; // Reserved.
8890 + u32 eth_u9 [50] ; // Reserved.
8897 + u32 eth_u10 ; // Reserved.
8905 + u32 eth_u11 ; // Reserved.
8906 + u32 eth_u12 ; // Reserved.
8914 + ETHINTFC_en_b = 0,
8915 + ETHINTFC_en_m = 0x00000001,
8916 + ETHINTFC_its_b = 1,
8917 + ETHINTFC_its_m = 0x00000002,
8918 + ETHINTFC_rip_b = 2,
8919 + ETHINTFC_rip_m = 0x00000004,
8920 + ETHINTFC_jam_b = 3,
8921 + ETHINTFC_jam_m = 0x00000008,
8922 + ETHINTFC_ovr_b = 4,
8923 + ETHINTFC_ovr_m = 0x00000010,
8924 + ETHINTFC_und_b = 5,
8925 + ETHINTFC_und_m = 0x00000020,
8927 + ETHFIFOTT_tth_b = 0,
8928 + ETHFIFOTT_tth_m = 0x0000007f,
8931 + ETHARC_pro_m = 0x00000001,
8933 + ETHARC_am_m = 0x00000002,
8935 + ETHARC_afm_m = 0x00000004,
8937 + ETHARC_ab_m = 0x00000008,
8939 + ETHSAL_byte5_b = 0,
8940 + ETHSAL_byte5_m = 0x000000ff,
8941 + ETHSAL_byte4_b = 8,
8942 + ETHSAL_byte4_m = 0x0000ff00,
8943 + ETHSAL_byte3_b = 16,
8944 + ETHSAL_byte3_m = 0x00ff0000,
8945 + ETHSAL_byte2_b = 24,
8946 + ETHSAL_byte2_m = 0xff000000,
8948 + ETHSAH_byte1_b = 0,
8949 + ETHSAH_byte1_m = 0x000000ff,
8950 + ETHSAH_byte0_b = 8,
8951 + ETHSAH_byte0_m = 0x0000ff00,
8954 + ETHGPF_ptv_m = 0x0000ffff,
8957 + ETHPFS_pfd_m = 0x00000001,
8959 + ETHCFSA0_cfsa4_b = 0,
8960 + ETHCFSA0_cfsa4_m = 0x000000ff,
8961 + ETHCFSA0_cfsa5_b = 8,
8962 + ETHCFSA0_cfsa5_m = 0x0000ff00,
8964 + ETHCFSA1_cfsa2_b = 0,
8965 + ETHCFSA1_cfsa2_m = 0x000000ff,
8966 + ETHCFSA1_cfsa3_b = 8,
8967 + ETHCFSA1_cfsa3_m = 0x0000ff00,
8969 + ETHCFSA2_cfsa0_b = 0,
8970 + ETHCFSA2_cfsa0_m = 0x000000ff,
8971 + ETHCFSA2_cfsa1_b = 8,
8972 + ETHCFSA2_cfsa1_m = 0x0000ff00,
8975 + ETHMAC1_re_m = 0x00000001,
8976 + ETHMAC1_paf_b = 1,
8977 + ETHMAC1_paf_m = 0x00000002,
8978 + ETHMAC1_rfc_b = 2,
8979 + ETHMAC1_rfc_m = 0x00000004,
8980 + ETHMAC1_tfc_b = 3,
8981 + ETHMAC1_tfc_m = 0x00000008,
8983 + ETHMAC1_lb_m = 0x00000010,
8984 + ETHMAC1_mr_b = 31,
8985 + ETHMAC1_mr_m = 0x80000000,
8988 + ETHMAC2_fd_m = 0x00000001,
8989 + ETHMAC2_flc_b = 1,
8990 + ETHMAC2_flc_m = 0x00000002,
8991 + ETHMAC2_hfe_b = 2,
8992 + ETHMAC2_hfe_m = 0x00000004,
8994 + ETHMAC2_dc_m = 0x00000008,
8995 + ETHMAC2_cen_b = 4,
8996 + ETHMAC2_cen_m = 0x00000010,
8998 + ETHMAC2_pe_m = 0x00000020,
8999 + ETHMAC2_vpe_b = 6,
9000 + ETHMAC2_vpe_m = 0x00000040,
9001 + ETHMAC2_ape_b = 7,
9002 + ETHMAC2_ape_m = 0x00000080,
9003 + ETHMAC2_ppe_b = 8,
9004 + ETHMAC2_ppe_m = 0x00000100,
9005 + ETHMAC2_lpe_b = 9,
9006 + ETHMAC2_lpe_m = 0x00000200,
9007 + ETHMAC2_nb_b = 12,
9008 + ETHMAC2_nb_m = 0x00001000,
9009 + ETHMAC2_bp_b = 13,
9010 + ETHMAC2_bp_m = 0x00002000,
9011 + ETHMAC2_ed_b = 14,
9012 + ETHMAC2_ed_m = 0x00004000,
9014 + ETHIPGT_ipgt_b = 0,
9015 + ETHIPGT_ipgt_m = 0x0000007f,
9017 + ETHIPGR_ipgr2_b = 0,
9018 + ETHIPGR_ipgr2_m = 0x0000007f,
9019 + ETHIPGR_ipgr1_b = 8,
9020 + ETHIPGR_ipgr1_m = 0x00007f00,
9022 + ETHCLRT_maxret_b = 0,
9023 + ETHCLRT_maxret_m = 0x0000000f,
9024 + ETHCLRT_colwin_b = 8,
9025 + ETHCLRT_colwin_m = 0x00003f00,
9027 + ETHMAXF_maxf_b = 0,
9028 + ETHMAXF_maxf_m = 0x0000ffff,
9030 + ETHMTEST_tb_b = 2,
9031 + ETHMTEST_tb_m = 0x00000004,
9034 + ETHMCP_div_m = 0x000000ff,
9036 + MIIMCFG_rsv_b = 0,
9037 + MIIMCFG_rsv_m = 0x0000000c,
9040 + MIIMCMD_rd_m = 0x00000001,
9041 + MIIMCMD_scn_b = 1,
9042 + MIIMCMD_scn_m = 0x00000002,
9044 + MIIMADDR_regaddr_b = 0,
9045 + MIIMADDR_regaddr_m = 0x0000001f,
9046 + MIIMADDR_phyaddr_b = 8,
9047 + MIIMADDR_phyaddr_m = 0x00001f00,
9049 + MIIMWTD_wdata_b = 0,
9050 + MIIMWTD_wdata_m = 0x0000ffff,
9052 + MIIMRDD_rdata_b = 0,
9053 + MIIMRDD_rdata_m = 0x0000ffff,
9055 + MIIMIND_bsy_b = 0,
9056 + MIIMIND_bsy_m = 0x00000001,
9057 + MIIMIND_scn_b = 1,
9058 + MIIMIND_scn_m = 0x00000002,
9060 + MIIMIND_nv_m = 0x00000004,
9065 + * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
9070 + ETHRX_fd_m = 0x00000001,
9072 + ETHRX_ld_m = 0x00000002,
9074 + ETHRX_rok_m = 0x00000004,
9076 + ETHRX_fm_m = 0x00000008,
9078 + ETHRX_mp_m = 0x00000010,
9080 + ETHRX_bp_m = 0x00000020,
9082 + ETHRX_vlt_m = 0x00000040,
9084 + ETHRX_cf_m = 0x00000080,
9086 + ETHRX_ovr_m = 0x00000100,
9088 + ETHRX_crc_m = 0x00000200,
9090 + ETHRX_cv_m = 0x00000400,
9092 + ETHRX_db_m = 0x00000800,
9094 + ETHRX_le_m = 0x00001000,
9096 + ETHRX_lor_m = 0x00002000,
9098 + ETHRX_ces_m = 0x00004000,
9099 + ETHRX_length_b = 16,
9100 + ETHRX_length_m = 0xffff0000,
9103 + ETHTX_fd_m = 0x00000001,
9105 + ETHTX_ld_m = 0x00000002,
9107 + ETHTX_oen_m = 0x00000004,
9109 + ETHTX_pen_m = 0x00000008,
9111 + ETHTX_cen_m = 0x00000010,
9113 + ETHTX_hen_m = 0x00000020,
9115 + ETHTX_tok_m = 0x00000040,
9117 + ETHTX_mp_m = 0x00000080,
9119 + ETHTX_bp_m = 0x00000100,
9121 + ETHTX_und_m = 0x00000200,
9123 + ETHTX_of_m = 0x00000400,
9125 + ETHTX_ed_m = 0x00000800,
9127 + ETHTX_ec_m = 0x00001000,
9129 + ETHTX_lc_m = 0x00002000,
9131 + ETHTX_td_m = 0x00004000,
9133 + ETHTX_crc_m = 0x00008000,
9135 + ETHTX_le_m = 0x00010000,
9137 + ETHTX_cc_m = 0x001E0000,
9139 +#endif //__IDT_RC32438_ETH_H__
9140 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
9141 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h 1970-01-01 01:00:00.000000000 +0100
9142 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_eth_v.h 2006-01-10 00:32:33.000000000 +0100
9144 +/**************************************************************************
9146 + * BRIEF MODULE DESCRIPTION
9147 + * macros for IDT EB438 ethernet
9149 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9151 + * This program is free software; you can redistribute it and/or modify it
9152 + * under the terms of the GNU General Public License as published by the
9153 + * Free Software Foundation; either version 2 of the License, or (at your
9154 + * option) any later version.
9156 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9157 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9158 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9159 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9160 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9161 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9162 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9163 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9164 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9165 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9167 + * You should have received a copy of the GNU General Public License along
9168 + * with this program; if not, write to the Free Software Foundation, Inc.,
9169 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9172 + **************************************************************************
9173 + * May 2004 P. Sadik.
9179 + **************************************************************************
9182 +#ifndef __IDT_RC32438_ETH_V_H__
9183 +#define __IDT_RC32438_ETH_V_H__
9184 +#include <asm/idt-boards/rc32438/rc32438_eth.h>
9186 +#define IS_TX_TOK(X) (((X) & (1<<ETHTX_tok_b)) >> ETHTX_tok_b ) /* Transmit Okay */
9187 +#define IS_TX_MP(X) (((X) & (1<<ETHTX_mp_b)) >> ETHTX_mp_b ) /* Multicast */
9188 +#define IS_TX_BP(X) (((X) & (1<<ETHTX_bp_b)) >> ETHTX_bp_b ) /* Broadcast */
9189 +#define IS_TX_UND_ERR(X) (((X) & (1<<ETHTX_und_b)) >> ETHTX_und_b ) /* Transmit FIFO Underflow */
9190 +#define IS_TX_OF_ERR(X) (((X) & (1<<ETHTX_of_b)) >> ETHTX_of_b ) /* Oversized frame */
9191 +#define IS_TX_ED_ERR(X) (((X) & (1<<ETHTX_ed_b)) >> ETHTX_ed_b ) /* Excessive deferral */
9192 +#define IS_TX_EC_ERR(X) (((X) & (1<<ETHTX_ec_b)) >> ETHTX_ec_b) /* Excessive collisions */
9193 +#define IS_TX_LC_ERR(X) (((X) & (1<<ETHTX_lc_b)) >> ETHTX_lc_b ) /* Late Collision */
9194 +#define IS_TX_TD_ERR(X) (((X) & (1<<ETHTX_td_b)) >> ETHTX_td_b ) /* Transmit deferred*/
9195 +#define IS_TX_CRC_ERR(X) (((X) & (1<<ETHTX_crc_b)) >> ETHTX_crc_b ) /* CRC Error */
9196 +#define IS_TX_LE_ERR(X) (((X) & (1<<ETHTX_le_b)) >> ETHTX_le_b ) /* Length Error */
9198 +#define TX_COLLISION_COUNT(X) (((X) & ETHTX_cc_m)>>ETHTX_cc_b) /* Collision Count */
9200 +#define IS_RCV_ROK(X) (((X) & (1<<ETHRX_rok_b)) >> ETHRX_rok_b) /* Receive Okay */
9201 +#define IS_RCV_FM(X) (((X) & (1<<ETHRX_fm_b)) >> ETHRX_fm_b) /* Is Filter Match */
9202 +#define IS_RCV_MP(X) (((X) & (1<<ETHRX_mp_b)) >> ETHRX_mp_b) /* Is it MP */
9203 +#define IS_RCV_BP(X) (((X) & (1<<ETHRX_bp_b)) >> ETHRX_bp_b) /* Is it BP */
9204 +#define IS_RCV_VLT(X) (((X) & (1<<ETHRX_vlt_b)) >> ETHRX_vlt_b) /* VLAN Tag Detect */
9205 +#define IS_RCV_CF(X) (((X) & (1<<ETHRX_cf_b)) >> ETHRX_cf_b) /* Control Frame */
9206 +#define IS_RCV_OVR_ERR(X) (((X) & (1<<ETHRX_ovr_b)) >> ETHRX_ovr_b) /* Receive Overflow */
9207 +#define IS_RCV_CRC_ERR(X) (((X) & (1<<ETHRX_crc_b)) >> ETHRX_crc_b) /* CRC Error */
9208 +#define IS_RCV_CV_ERR(X) (((X) & (1<<ETHRX_cv_b)) >> ETHRX_cv_b) /* Code Violation */
9209 +#define IS_RCV_DB_ERR(X) (((X) & (1<<ETHRX_db_b)) >> ETHRX_db_b) /* Dribble Bits */
9210 +#define IS_RCV_LE_ERR(X) (((X) & (1<<ETHRX_le_b)) >> ETHRX_le_b) /* Length error */
9211 +#define IS_RCV_LOR_ERR(X) (((X) & (1<<ETHRX_lor_b)) >> ETHRX_lor_b) /* Length Out of Range */
9212 +#define IS_RCV_CES_ERR(X) (((X) & (1<<ETHRX_ces_b)) >> ETHRX_ces_b) /* Preamble error */
9213 +#define RCVPKT_LENGTH(X) (((X) & ETHRX_length_m) >> ETHRX_length_b) /* Length of the received packet */
9215 +#endif //__IDT_RC32438_ETH_V_H__
9216 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
9217 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h 1970-01-01 01:00:00.000000000 +0100
9218 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_gpio.h 2006-01-10 00:32:33.000000000 +0100
9220 +/**************************************************************************
9222 + * BRIEF MODULE DESCRIPTION
9223 + * Definitions for IDT RC32438 GPIO.
9225 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9227 + * This program is free software; you can redistribute it and/or modify it
9228 + * under the terms of the GNU General Public License as published by the
9229 + * Free Software Foundation; either version 2 of the License, or (at your
9230 + * option) any later version.
9232 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9233 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9234 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9235 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9236 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9237 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9238 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9239 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9240 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9241 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9243 + * You should have received a copy of the GNU General Public License along
9244 + * with this program; if not, write to the Free Software Foundation, Inc.,
9245 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9248 + **************************************************************************
9249 + * May 2004 P. Sadik.
9255 + **************************************************************************
9257 +#ifndef __IDT_RC32438_GPIO_H__
9258 +#define __IDT_RC32438_GPIO_H__
9261 + GPIO0_PhysicalAddress = 0x18048000,
9262 + GPIO_PhysicalAddress = GPIO0_PhysicalAddress, // Default
9264 + GPIO0_VirtualAddress = 0xb8048000,
9265 + GPIO_VirtualAddress = GPIO0_VirtualAddress, // Default
9270 + u32 gpiofunc; /* GPIO Function Register
9271 + * gpiofunc[x]==0 bit = gpio
9272 + * func[x]==1 bit = altfunc
9274 + u32 gpiocfg; /* GPIO Configuration Register
9275 + * gpiocfg[x]==0 bit = input
9276 + * gpiocfg[x]==1 bit = output
9278 + u32 gpiod; /* GPIO Data Register
9279 + * gpiod[x] read/write gpio pinX status
9281 + u32 gpioilevel; /* GPIO Interrupt Status Register
9282 + * interrupt level (see gpioistat)
9284 + u32 gpioistat; /* Gpio Interrupt Status Register
9285 + * istat[x] = (gpiod[x] == level[x])
9286 + * cleared in ISR (STICKY bits)
9288 + u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
9289 +} volatile * GPIO_t ;
9293 + GPIO_gpio_v = 0, // gpiofunc use pin as GPIO.
9294 + GPIO_alt_v = 1, // gpiofunc use pin as alt.
9295 + GPIO_input_v = 0, // gpiocfg use pin as input.
9296 + GPIO_output_v = 1, // gpiocfg use pin as output.
9298 + GPIO_pin0_m = 0x00000001,
9300 + GPIO_pin1_m = 0x00000002,
9302 + GPIO_pin2_m = 0x00000004,
9304 + GPIO_pin3_m = 0x00000008,
9306 + GPIO_pin4_m = 0x00000010,
9308 + GPIO_pin5_m = 0x00000020,
9310 + GPIO_pin6_m = 0x00000040,
9312 + GPIO_pin7_m = 0x00000080,
9314 + GPIO_pin8_m = 0x00000100,
9316 + GPIO_pin9_m = 0x00000200,
9317 + GPIO_pin10_b = 10,
9318 + GPIO_pin10_m = 0x00000400,
9319 + GPIO_pin11_b = 11,
9320 + GPIO_pin11_m = 0x00000800,
9321 + GPIO_pin12_b = 12,
9322 + GPIO_pin12_m = 0x00001000,
9323 + GPIO_pin13_b = 13,
9324 + GPIO_pin13_m = 0x00002000,
9325 + GPIO_pin14_b = 14,
9326 + GPIO_pin14_m = 0x00004000,
9327 + GPIO_pin15_b = 15,
9328 + GPIO_pin15_m = 0x00008000,
9329 + GPIO_pin16_b = 16,
9330 + GPIO_pin16_m = 0x00010000,
9331 + GPIO_pin17_b = 17,
9332 + GPIO_pin17_m = 0x00020000,
9333 + GPIO_pin18_b = 18,
9334 + GPIO_pin18_m = 0x00040000,
9335 + GPIO_pin19_b = 19,
9336 + GPIO_pin19_m = 0x00080000,
9337 + GPIO_pin20_b = 20,
9338 + GPIO_pin20_m = 0x00100000,
9339 + GPIO_pin21_b = 21,
9340 + GPIO_pin21_m = 0x00200000,
9341 + GPIO_pin22_b = 22,
9342 + GPIO_pin22_m = 0x00400000,
9343 + GPIO_pin23_b = 23,
9344 + GPIO_pin23_m = 0x00800000,
9345 + GPIO_pin24_b = 24,
9346 + GPIO_pin24_m = 0x01000000,
9347 + GPIO_pin25_b = 25,
9348 + GPIO_pin25_m = 0x02000000,
9349 + GPIO_pin26_b = 26,
9350 + GPIO_pin26_m = 0x04000000,
9351 + GPIO_pin27_b = 27,
9352 + GPIO_pin27_m = 0x08000000,
9353 + GPIO_pin28_b = 28,
9354 + GPIO_pin28_m = 0x10000000,
9355 + GPIO_pin29_b = 29,
9356 + GPIO_pin29_m = 0x20000000,
9357 + GPIO_pin30_b = 30,
9358 + GPIO_pin30_m = 0x40000000,
9359 + GPIO_pin31_b = 31,
9360 + GPIO_pin31_m = 0x80000000,
9362 +// Alternate function pins. Corrsponding gpiofunc bit set to GPIO_alt_v.
9364 + GPIO_u0sout_b = GPIO_pin0_b, // UART 0 serial out.
9365 + GPIO_u0sout_m = GPIO_pin0_m,
9366 + GPIO_u0sout_cfg_v = GPIO_output_v,
9367 + GPIO_u0sinp_b = GPIO_pin1_b, // UART 0 serial in.
9368 + GPIO_u0sinp_m = GPIO_pin1_m,
9369 + GPIO_u0sinp_cfg_v = GPIO_input_v,
9370 + GPIO_u0rin_b = GPIO_pin2_b, // UART 0 ring indic.
9371 + GPIO_u0rin_m = GPIO_pin2_m,
9372 + GPIO_u0rin_cfg_v = GPIO_input_v,
9373 + GPIO_u0dcdn_b = GPIO_pin3_b, // UART 0 data carr.det.
9374 + GPIO_u0dcdn_m = GPIO_pin3_m,
9375 + GPIO_u0dcdn_cfg_v = GPIO_input_v,
9376 + GPIO_u0dtrn_b = GPIO_pin4_b, // UART 0 data term rdy.
9377 + GPIO_u0dtrn_m = GPIO_pin4_m,
9378 + GPIO_u0dtrn_cfg_v = GPIO_output_v,
9379 + GPIO_u0dsrn_b = GPIO_pin5_b, // UART 0 data set rdy.
9380 + GPIO_u0dsrn_m = GPIO_pin5_m,
9381 + GPIO_u0dsrn_cfg_v = GPIO_input_v,
9382 + GPIO_u0rtsn_b = GPIO_pin6_b, // UART 0 req. to send.
9383 + GPIO_u0rtsn_m = GPIO_pin6_m,
9384 + GPIO_u0rtsn_cfg_v = GPIO_output_v,
9385 + GPIO_u0ctsn_b = GPIO_pin7_b, // UART 0 clear to send.
9386 + GPIO_u0ctsn_m = GPIO_pin7_m,
9387 + GPIO_u0ctsn_cfg_v = GPIO_input_v,
9389 + GPIO_u1sout_b = GPIO_pin8_b, // UART 1 serial out.
9390 + GPIO_u1sout_m = GPIO_pin8_m,
9391 + GPIO_u1sout_cfg_v = GPIO_output_v,
9392 + GPIO_u1sinp_b = GPIO_pin9_b, // UART 1 serial in.
9393 + GPIO_u1sinp_m = GPIO_pin9_m,
9394 + GPIO_u1sinp_cfg_v = GPIO_input_v,
9395 + GPIO_u1dtrn_b = GPIO_pin10_b, // UART 1 data term rdy.
9396 + GPIO_u1dtrn_m = GPIO_pin10_m,
9397 + GPIO_u1dtrn_cfg_v = GPIO_output_v,
9398 + GPIO_u1dsrn_b = GPIO_pin11_b, // UART 1 data set rdy.
9399 + GPIO_u1dsrn_m = GPIO_pin11_m,
9400 + GPIO_u1dsrn_cfg_v = GPIO_input_v,
9401 + GPIO_u1rtsn_b = GPIO_pin12_b, // UART 1 req. to send.
9402 + GPIO_u1rtsn_m = GPIO_pin12_m,
9403 + GPIO_u1rtsn_cfg_v = GPIO_output_v,
9404 + GPIO_u1ctsn_b = GPIO_pin13_b, // UART 1 clear to send.
9405 + GPIO_u1ctsn_m = GPIO_pin13_m,
9406 + GPIO_u1ctsn_cfg_v = GPIO_input_v,
9408 + GPIO_dmareqn0_b = GPIO_pin14_b, // Ext. DMA 0 request
9409 + GPIO_dmareqn0_m = GPIO_pin14_m,
9410 + GPIO_dmareqn0_cfg_v = GPIO_input_v,
9412 + GPIO_dmareqn1_b = GPIO_pin15_b, // Ext. DMA 1 request
9413 + GPIO_dmareqn1_m = GPIO_pin15_m,
9414 + GPIO_dmareqn1_cfg_v = GPIO_input_v,
9416 + GPIO_dmadonen0_b = GPIO_pin16_b, // Ext. DMA 0 done
9417 + GPIO_dmadonen0_m = GPIO_pin16_m,
9418 + GPIO_dmadonen0_cfg_v = GPIO_input_v,
9420 + GPIO_dmadonen1_b = GPIO_pin17_b, // Ext. DMA 1 done
9421 + GPIO_dmadonen1_m = GPIO_pin17_m,
9422 + GPIO_dmadonen1_cfg_v = GPIO_input_v,
9424 + GPIO_dmafinn0_b = GPIO_pin18_b, // Ext. DMA 0 finished
9425 + GPIO_dmafinn0_m = GPIO_pin18_m,
9426 + GPIO_dmafinn0_cfg_v = GPIO_output_v,
9428 + GPIO_dmafinn1_b = GPIO_pin19_b, // Ext. DMA 1 finished
9429 + GPIO_dmafinn1_m = GPIO_pin19_m,
9430 + GPIO_dmafinn1_cfg_v = GPIO_output_v,
9432 + GPIO_maddr22_b = GPIO_pin20_b, // M&P bus bit 22.
9433 + GPIO_maddr22_m = GPIO_pin20_m,
9434 + GPIO_maddr22_cfg_v = GPIO_output_v,
9436 + GPIO_maddr23_b = GPIO_pin21_b, // M&P bus bit 23.
9437 + GPIO_maddr23_m = GPIO_pin21_m,
9438 + GPIO_maddr23_cfg_v = GPIO_output_v,
9440 + GPIO_maddr24_b = GPIO_pin22_b, // M&P bus bit 24.
9441 + GPIO_maddr24_m = GPIO_pin22_m,
9442 + GPIO_maddr24_cfg_v = GPIO_output_v,
9444 + GPIO_maddr25_b = GPIO_pin23_b, // M&P bus bit 25.
9445 + GPIO_maddr25_m = GPIO_pin23_m,
9446 + GPIO_maddr25_cfg_v = GPIO_output_v,
9448 + GPIO_afspare6_b = GPIO_pin24_b, // reserved.
9449 + GPIO_afspare6_m = GPIO_pin24_m,
9450 + GPIO_afspare6_cfg_v = GPIO_input_v,
9451 + GPIO_afspare5_b = GPIO_pin25_b, // reserved.
9452 + GPIO_afspare5_m = GPIO_pin25_m,
9453 + GPIO_afspare5_cfg_v = GPIO_input_v,
9454 + GPIO_afspare4_b = GPIO_pin26_b, // reserved.
9455 + GPIO_afspare4_m = GPIO_pin26_m,
9456 + GPIO_afspare4_cfg_v = GPIO_input_v,
9457 + GPIO_afspare3_b = GPIO_pin27_b, // reserved.
9458 + GPIO_afspare3_m = GPIO_pin27_m,
9459 + GPIO_afspare3_cfg_v = GPIO_input_v,
9460 + GPIO_afspare2_b = GPIO_pin28_b, // reserved.
9461 + GPIO_afspare2_m = GPIO_pin28_m,
9462 + GPIO_afspare2_cfg_v = GPIO_input_v,
9463 + GPIO_afspare1_b = GPIO_pin29_b, // reserved.
9464 + GPIO_afspare1_m = GPIO_pin29_m,
9465 + GPIO_afspare1_cfg_v = GPIO_input_v,
9467 + GPIO_pcimuintn_b = GPIO_pin30_b, // PCI messaging int.
9468 + GPIO_pcimuintn_m = GPIO_pin30_m,
9469 + GPIO_pcimuintn_cfg_v = GPIO_output_v,
9471 + GPIO_rngclk_b = GPIO_pin31_b, // RNG external clock
9472 + GPIO_rngclk_m = GPIO_pin31_m,
9473 + GPIO_rncclk_cfg_v = GPIO_input_v,
9476 +#endif //__IDT_RC32438_GPIO_H__
9477 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
9478 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438.h 1970-01-01 01:00:00.000000000 +0100
9479 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438.h 2006-01-10 00:32:33.000000000 +0100
9481 +/**************************************************************************
9483 + * BRIEF MODULE DESCRIPTION
9484 + * Definitions for IDT RC32438 CPU.
9486 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9488 + * This program is free software; you can redistribute it and/or modify it
9489 + * under the terms of the GNU General Public License as published by the
9490 + * Free Software Foundation; either version 2 of the License, or (at your
9491 + * option) any later version.
9493 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9494 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9495 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9496 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9497 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9498 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9499 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9500 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9501 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9502 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9504 + * You should have received a copy of the GNU General Public License along
9505 + * with this program; if not, write to the Free Software Foundation, Inc.,
9506 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9509 + **************************************************************************
9510 + * May 2004 P. Sadik.
9516 + **************************************************************************
9519 +#ifndef __IDT_RC32438_H__
9520 +#define __IDT_RC32438_H__
9521 +#include <linux/config.h>
9522 +#include <linux/delay.h>
9523 +#include <asm/io.h>
9524 +#include <asm/idt-boards/rc32438/rc32438_timer.h>
9526 +#define RC32438_REG_BASE 0x18000000
9528 +#define interrupt ((volatile INT_t ) INT0_VirtualAddress)
9529 +#define idttimer ((volatile TIM_t) TIM0_VirtualAddress)
9530 +#define idt_gpio ((volatile GPIO_t) GPIO0_VirtualAddress)
9532 +#define IDT_CLOCK_MULT 2
9533 +#define MIPS_CPU_TIMER_IRQ 7
9534 +/* Interrupt Controller */
9535 +#define IC_GROUP0_PEND (RC32438_REG_BASE + 0x38000)
9536 +#define IC_GROUP0_MASK (RC32438_REG_BASE + 0x38008)
9537 +#define IC_GROUP_OFFSET 0x0C
9538 +#define RTC_BASE 0xAC0801FF0
9540 +#define NUM_INTR_GROUPS 5
9543 +#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
9544 +#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32) /* GRP3 IRQ numbers start here */
9545 +#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32) /* GRP4 IRQ numbers start here */
9546 +#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32) /* GRP5 IRQ numbers start here */
9547 +#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
9550 +#define RC32438_UART0_BASE (RC32438_REG_BASE + 0x50003)
9551 +#define RC32438_UART1_BASE (RC32438_REG_BASE + 0x50023)
9553 +#define RC32438_UART0_BASE (RC32438_REG_BASE + 0x50000)
9554 +#define RC32438_UART1_BASE (RC32438_REG_BASE + 0x50020)
9557 +#define RC32438_UART0_IRQ GROUP3_IRQ_BASE + 0
9558 +#define RC32438_UART1_IRQ GROUP3_IRQ_BASE + 3
9560 +#define RC32438_NR_IRQS (GROUP4_IRQ_BASE + 32)
9564 +/* cpu pipeline flush */
9565 +static inline void rc32438_sync(void)
9567 + __asm__ volatile ("sync");
9570 +static inline void rc32438_sync_udelay(int us)
9572 + __asm__ volatile ("sync");
9576 +static inline void rc32438_sync_delay(int ms)
9578 + __asm__ volatile ("sync");
9583 + * Macros to access internal RC32438 registers. No byte
9584 + * swapping should be done when accessing the internal
9588 +#define rc32438_readb __raw_readb
9589 +#define rc32438_readw __raw_readw
9590 +#define rc32438_readl __raw_readl
9592 +#define rc32438_writeb __raw_writeb
9593 +#define rc32438_writew __raw_writew
9594 +#define rc32438_writel __raw_writel
9597 + * C access to CLZ and CLO instructions
9598 + * (count leading zeroes/ones).
9600 +static inline int rc32438_clz(unsigned long val)
9603 + __asm__ volatile (
9604 + ".set\tnoreorder\n\t"
9606 + ".set\tmips32\n\t"
9616 +static inline int rc32438_clo(unsigned long val)
9619 + __asm__ volatile (
9620 + ".set\tnoreorder\n\t"
9622 + ".set\tmips32\n\t"
9632 +#endif //__IDT_RC32438_H__
9633 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
9634 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_pci.h 1970-01-01 01:00:00.000000000 +0100
9635 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_pci.h 2006-01-10 00:32:33.000000000 +0100
9637 +/**************************************************************************
9639 + * BRIEF MODULE DESCRIPTION
9640 + * Definitions for IDT RC32438 PCI.
9642 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
9644 + * This program is free software; you can redistribute it and/or modify it
9645 + * under the terms of the GNU General Public License as published by the
9646 + * Free Software Foundation; either version 2 of the License, or (at your
9647 + * option) any later version.
9649 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
9650 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9651 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
9652 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
9653 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
9654 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9655 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9656 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9657 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9658 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9660 + * You should have received a copy of the GNU General Public License along
9661 + * with this program; if not, write to the Free Software Foundation, Inc.,
9662 + * 675 Mass Ave, Cambridge, MA 02139, USA.
9665 + **************************************************************************
9666 + * May 2004 P. Sadik
9672 + **************************************************************************
9677 + PCI0_PhysicalAddress = 0x18080000,
9678 + PCI_PhysicalAddress = PCI0_PhysicalAddress,
9680 + PCI0_VirtualAddress = 0xb8080000,
9681 + PCI_VirtualAddress = PCI0_VirtualAddress,
9686 + PCI_LbaCount = 4, // Local base addresses.
9691 + u32 a ; // Address.
9692 + u32 c ; // Control.
9693 + u32 m ; // mapping.
9703 + PCI_Map_s pcilba [PCI_LbaCount] ;
9711 +} volatile *PCI_t ;
9713 +// PCI messaging unit.
9720 + u32 pciim [PCIM_Count] ;
9721 + u32 pciom [PCIM_Count] ;
9728 +} volatile *PCIM_t ;
9730 +/*******************************************************************************
9732 + * PCI Control Register
9734 + ******************************************************************************/
9738 + PCIC_en_m = 0x00000001,
9740 + PCIC_tnr_m = 0x00000002,
9742 + PCIC_sce_m = 0x00000004,
9744 + PCIC_ien_m = 0x00000008,
9746 + PCIC_aaa_m = 0x00000010,
9748 + PCIC_eap_m = 0x00000020,
9750 + PCIC_pcim_m = 0x000001c0,
9751 + PCIC_pcim_disabled_v = 0,
9752 + PCIC_pcim_tnr_v = 1, // Satellite - target not ready
9753 + PCIC_pcim_suspend_v = 2, // Satellite - suspended CPU.
9754 + PCIC_pcim_extern_v = 3, // Host - external arbiter.
9755 + PCIC_pcim_fixed_v = 4, // Host - fixed priority arb.
9756 + PCIC_pcim_roundrobin_v = 5, // Host - round robin priority.
9757 + PCIC_pcim_reserved6_v = 6,
9758 + PCIC_pcim_reserved7_v = 7,
9760 + PCIC_igm_m = 0x00000200,
9763 +/*******************************************************************************
9765 + * PCI Status Register
9767 + ******************************************************************************/
9770 + PCIS_eed_m = 0x00000001,
9772 + PCIS_wr_m = 0x00000002,
9774 + PCIS_nmi_m = 0x00000004,
9776 + PCIS_ii_m = 0x00000008,
9778 + PCIS_cwe_m = 0x00000010,
9780 + PCIS_cre_m = 0x00000020,
9782 + PCIS_mdpe_m = 0x00000040,
9784 + PCIS_sta_m = 0x00000080,
9786 + PCIS_rta_m = 0x00000100,
9788 + PCIS_rma_m = 0x00000200,
9790 + PCIS_sse_m = 0x00000400,
9792 + PCIS_ose_m = 0x00000800,
9794 + PCIS_pe_m = 0x00001000,
9796 + PCIS_tae_m = 0x00002000,
9798 + PCIS_rle_m = 0x00004000,
9800 + PCIS_bme_m = 0x00008000,
9802 + PCIS_prd_m = 0x00010000,
9804 + PCIS_rip_m = 0x00020000,
9807 +/*******************************************************************************
9809 + * PCI Status Mask Register
9811 + ******************************************************************************/
9814 + PCISM_eed_m = 0x00000001,
9816 + PCISM_wr_m = 0x00000002,
9818 + PCISM_nmi_m = 0x00000004,
9820 + PCISM_ii_m = 0x00000008,
9822 + PCISM_cwe_m = 0x00000010,
9824 + PCISM_cre_m = 0x00000020,
9826 + PCISM_mdpe_m = 0x00000040,
9828 + PCISM_sta_m = 0x00000080,
9830 + PCISM_rta_m = 0x00000100,
9832 + PCISM_rma_m = 0x00000200,
9834 + PCISM_sse_m = 0x00000400,
9836 + PCISM_ose_m = 0x00000800,
9838 + PCISM_pe_m = 0x00001000,
9840 + PCISM_tae_m = 0x00002000,
9842 + PCISM_rle_m = 0x00004000,
9844 + PCISM_bme_m = 0x00008000,
9846 + PCISM_prd_m = 0x00010000,
9848 + PCISM_rip_m = 0x00020000,
9851 +/*******************************************************************************
9853 + * PCI Configuration Address Register
9855 + ******************************************************************************/
9857 + PCICFGA_reg_b = 2,
9858 + PCICFGA_reg_m = 0x000000fc,
9859 + PCICFGA_reg_id_v = 0x00>>2, //use PCFGID_
9860 + PCICFGA_reg_04_v = 0x04>>2, //use PCFG04_
9861 + PCICFGA_reg_08_v = 0x08>>2, //use PCFG08_
9862 + PCICFGA_reg_0C_v = 0x0C>>2, //use PCFG0C_
9863 + PCICFGA_reg_pba0_v = 0x10>>2, //use PCIPBA_
9864 + PCICFGA_reg_pba1_v = 0x14>>2, //use PCIPBA_
9865 + PCICFGA_reg_pba2_v = 0x18>>2, //use PCIPBA_
9866 + PCICFGA_reg_pba3_v = 0x1c>>2, //use PCIPBA_
9867 + PCICFGA_reg_subsystem_v = 0x2c>>2, //use PCFGSS_
9868 + PCICFGA_reg_3C_v = 0x3C>>2, //use PCFG3C_
9869 + PCICFGA_reg_pba0c_v = 0x44>>2, //use PCIPBAC_
9870 + PCICFGA_reg_pba0m_v = 0x48>>2,
9871 + PCICFGA_reg_pba1c_v = 0x4c>>2, //use PCIPBAC_
9872 + PCICFGA_reg_pba1m_v = 0x50>>2,
9873 + PCICFGA_reg_pba2c_v = 0x54>>2, //use PCIPBAC_
9874 + PCICFGA_reg_pba2m_v = 0x58>>2,
9875 + PCICFGA_reg_pba3c_v = 0x5c>>2, //use PCIPBAC_
9876 + PCICFGA_reg_pba3m_v = 0x60>>2,
9877 + PCICFGA_reg_pmgt_v = 0x64>>2,
9878 + PCICFGA_func_b = 8,
9879 + PCICFGA_func_m = 0x00000700,
9880 + PCICFGA_dev_b = 11,
9881 + PCICFGA_dev_m = 0x0000f800,
9882 + PCICFGA_dev_internal_v = 0,
9883 + PCICFGA_bus_b = 16,
9884 + PCICFGA_bus_m = 0x00ff0000,
9885 + PCICFGA_bus_type0_v = 0, //local bus
9886 + PCICFGA_en_b = 31, // read only
9887 + PCICFGA_en_m = 0x80000000,
9891 + PCFGID_vendor_b = 0,
9892 + PCFGID_vendor_m = 0x0000ffff,
9893 + PCFGID_vendor_IDT_v = 0x111d,
9894 + PCFGID_device_b = 16,
9895 + PCFGID_device_m = 0xffff0000,
9896 + PCFGID_device_Acaciade_v = 0x0207,
9898 + PCFG04_command_ioena_b = 1,
9899 + PCFG04_command_ioena_m = 0x00000001,
9900 + PCFG04_command_memena_b = 2,
9901 + PCFG04_command_memena_m = 0x00000002,
9902 + PCFG04_command_bmena_b = 3,
9903 + PCFG04_command_bmena_m = 0x00000004,
9904 + PCFG04_command_mwinv_b = 5,
9905 + PCFG04_command_mwinv_m = 0x00000010,
9906 + PCFG04_command_parena_b = 7,
9907 + PCFG04_command_parena_m = 0x00000040,
9908 + PCFG04_command_serrena_b = 9,
9909 + PCFG04_command_serrena_m = 0x00000100,
9910 + PCFG04_command_fastbbena_b = 10,
9911 + PCFG04_command_fastbbena_m = 0x00000200,
9912 + PCFG04_status_b = 16,
9913 + PCFG04_status_m = 0xffff0000,
9914 + PCFG04_status_66MHz_b = 21, // 66 MHz enable
9915 + PCFG04_status_66MHz_m = 0x00200000,
9916 + PCFG04_status_fbb_b = 23,
9917 + PCFG04_status_fbb_m = 0x00800000,
9918 + PCFG04_status_mdpe_b = 24,
9919 + PCFG04_status_mdpe_m = 0x01000000,
9920 + PCFG04_status_dst_b = 25,
9921 + PCFG04_status_dst_m = 0x06000000,
9922 + PCFG04_status_sta_b = 27,
9923 + PCFG04_status_sta_m = 0x08000000,
9924 + PCFG04_status_rta_b = 28,
9925 + PCFG04_status_rta_m = 0x10000000,
9926 + PCFG04_status_rma_b = 29,
9927 + PCFG04_status_rma_m = 0x20000000,
9928 + PCFG04_status_sse_b = 30,
9929 + PCFG04_status_sse_m = 0x40000000,
9930 + PCFG04_status_pe_b = 31,
9931 + PCFG04_status_pe_m = 0x40000000,
9933 + PCFG08_revId_b = 0,
9934 + PCFG08_revId_m = 0x000000ff,
9935 + PCFG08_classCode_b = 0,
9936 + PCFG08_classCode_m = 0xffffff00,
9937 + PCFG08_classCode_bridge_v = 06,
9938 + PCFG08_classCode_proc_v = 0x0b3000, // processor-MIPS
9939 + PCFG0C_cacheline_b = 0,
9940 + PCFG0C_cacheline_m = 0x000000ff,
9941 + PCFG0C_masterLatency_b = 8,
9942 + PCFG0C_masterLatency_m = 0x0000ff00,
9943 + PCFG0C_headerType_b = 16,
9944 + PCFG0C_headerType_m = 0x00ff0000,
9945 + PCFG0C_bist_b = 24,
9946 + PCFG0C_bist_m = 0xff000000,
9949 + PCIPBA_msi_m = 0x00000001,
9951 + PCIPBA_p_m = 0x00000004,
9952 + PCIPBA_baddr_b = 8,
9953 + PCIPBA_baddr_m = 0xffffff00,
9955 + PCFGSS_vendorId_b = 0,
9956 + PCFGSS_vendorId_m = 0x0000ffff,
9958 + PCFGSS_id_m = 0xffff0000,
9960 + PCFG3C_interruptLine_b = 0,
9961 + PCFG3C_interruptLine_m = 0x000000ff,
9962 + PCFG3C_interruptPin_b = 8,
9963 + PCFG3C_interruptPin_m = 0x0000ff00,
9964 + PCFG3C_minGrant_b = 16,
9965 + PCFG3C_minGrant_m = 0x00ff0000,
9966 + PCFG3C_maxLat_b = 24,
9967 + PCFG3C_maxLat_m = 0xff000000,
9969 + PCIPBAC_msi_b = 0,
9970 + PCIPBAC_msi_m = 0x00000001,
9972 + PCIPBAC_p_m = 0x00000002,
9973 + PCIPBAC_size_b = 2,
9974 + PCIPBAC_size_m = 0x0000007c,
9976 + PCIPBAC_sb_m = 0x00000080,
9978 + PCIPBAC_pp_m = 0x00000100,
9980 + PCIPBAC_mr_m = 0x00000600,
9981 + PCIPBAC_mr_read_v =0, //no prefetching
9982 + PCIPBAC_mr_readLine_v =1,
9983 + PCIPBAC_mr_readMult_v =2,
9984 + PCIPBAC_mrl_b = 11,
9985 + PCIPBAC_mrl_m = 0x00000800,
9986 + PCIPBAC_mrm_b = 12,
9987 + PCIPBAC_mrm_m = 0x00001000,
9988 + PCIPBAC_trp_b = 13,
9989 + PCIPBAC_trp_m = 0x00002000,
9991 + PCFG40_trdyTimeout_b = 0,
9992 + PCFG40_trdyTimeout_m = 0x000000ff,
9993 + PCFG40_retryLim_b = 8,
9994 + PCFG40_retryLim_m = 0x0000ff00,
9997 +/*******************************************************************************
9999 + * PCI Local Base Address [0|1|2|3] Register
10001 + ******************************************************************************/
10003 + PCILBA_baddr_b = 0, // In PCI_t -> pcilba [] .a
10004 + PCILBA_baddr_m = 0xffffff00,
10006 +/*******************************************************************************
10008 + * PCI Local Base Address Control Register
10010 + ******************************************************************************/
10012 + PCILBAC_msi_b = 0, // In pPci->pcilba[i].c
10013 + PCILBAC_msi_m = 0x00000001,
10014 + PCILBAC_msi_mem_v = 0,
10015 + PCILBAC_msi_io_v = 1,
10016 + PCILBAC_size_b = 2, // In pPci->pcilba[i].c
10017 + PCILBAC_size_m = 0x0000007c,
10018 + PCILBAC_sb_b = 7, // In pPci->pcilba[i].c
10019 + PCILBAC_sb_m = 0x00000080,
10020 + PCILBAC_rt_b = 8, // In pPci->pcilba[i].c
10021 + PCILBAC_rt_m = 0x00000100,
10022 + PCILBAC_rt_noprefetch_v = 0, // mem read
10023 + PCILBAC_rt_prefetch_v = 1, // mem readline
10026 +/*******************************************************************************
10028 + * PCI Local Base Address [0|1|2|3] Mapping Register
10030 + ******************************************************************************/
10032 + PCILBAM_maddr_b = 8,
10033 + PCILBAM_maddr_m = 0xffffff00,
10036 +/*******************************************************************************
10038 + * PCI Decoupled Access Control Register
10040 + ******************************************************************************/
10042 + PCIDAC_den_b = 0,
10043 + PCIDAC_den_m = 0x00000001,
10046 +/*******************************************************************************
10048 + * PCI Decoupled Access Status Register
10050 + ******************************************************************************/
10053 + PCIDAS_d_m = 0x00000001,
10055 + PCIDAS_b_m = 0x00000002,
10057 + PCIDAS_e_m = 0x00000004,
10058 + PCIDAS_ofe_b = 3,
10059 + PCIDAS_ofe_m = 0x00000008,
10060 + PCIDAS_off_b = 4,
10061 + PCIDAS_off_m = 0x00000010,
10062 + PCIDAS_ife_b = 5,
10063 + PCIDAS_ife_m = 0x00000020,
10064 + PCIDAS_iff_b = 6,
10065 + PCIDAS_iff_m = 0x00000040,
10068 +/*******************************************************************************
10070 + * PCI DMA Channel 8 Configuration Register
10072 + ******************************************************************************/
10075 + PCIDMA8C_mbs_b = 0, // Maximum Burst Size.
10076 + PCIDMA8C_mbs_m = 0x00000fff, // { pcidma8c }
10077 + PCIDMA8C_our_b = 12, // Optimize Unaligned Burst Reads.
10078 + PCIDMA8C_our_m = 0x00001000, // { pcidma8c }
10081 +/*******************************************************************************
10083 + * PCI DMA Channel 9 Configuration Register
10085 + ******************************************************************************/
10088 + PCIDMA9C_mbs_b = 0, // Maximum Burst Size.
10089 + PCIDMA9C_mbs_m = 0x00000fff, // { pcidma9c }
10092 +/*******************************************************************************
10094 + * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
10096 + ******************************************************************************/
10098 + PCIDMAD_pt_b = 22, // in DEVCMD field (descriptor)
10099 + PCIDMAD_pt_m = 0x00c00000, // preferred transaction field
10100 + // These are for reads (DMA channel 8)
10101 + PCIDMAD_devcmd_mr_v = 0, //memory read
10102 + PCIDMAD_devcmd_mrl_v = 1, //memory read line
10103 + PCIDMAD_devcmd_mrm_v = 2, //memory read multiple
10104 + PCIDMAD_devcmd_ior_v = 3, //I/O read
10105 + // These are for writes (DMA channel 9)
10106 + PCIDMAD_devcmd_mw_v = 0, //memory write
10107 + PCIDMAD_devcmd_mwi_v = 1, //memory write invalidate
10108 + PCIDMAD_devcmd_iow_v = 3, //I/O write
10110 + // Swap byte field applies to both DMA channel 8 and 9
10111 + PCIDMAD_sb_b = 24, // in DEVCMD field (descriptor)
10112 + PCIDMAD_sb_m = 0x01000000, // swap byte field
10116 +/*******************************************************************************
10118 + * PCI Target Control Register
10120 + ******************************************************************************/
10123 + PCITC_rtimer_b = 0, // In PCITC_t -> pcitc
10124 + PCITC_rtimer_m = 0x000000ff,
10125 + PCITC_dtimer_b = 8, // In PCITC_t -> pcitc
10126 + PCITC_dtimer_m = 0x0000ff00,
10127 + PCITC_rdr_b = 18, // In PCITC_t -> pcitc
10128 + PCITC_rdr_m = 0x00040000,
10129 + PCITC_ddt_b = 19, // In PCITC_t -> pcitc
10130 + PCITC_ddt_m = 0x00080000,
10132 +/*******************************************************************************
10134 + * PCI messaging unit [applies to both inbound and outbound registers ]
10136 + ******************************************************************************/
10139 + PCIM_m0_b = 0, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10140 + PCIM_m0_m = 0x00000001, // inbound or outbound message 0
10141 + PCIM_m1_b = 1, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10142 + PCIM_m1_m = 0x00000002, // inbound or outbound message 1
10143 + PCIM_db_b = 2, // In PCIM_t -> {pci{iic,iim,ioic,ioim}}
10144 + PCIM_db_m = 0x00000004, // inbound or outbound doorbell
10147 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
10148 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h 1970-01-01 01:00:00.000000000 +0100
10149 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_pci_v.h 2006-01-10 00:32:33.000000000 +0100
10151 +/**************************************************************************
10153 + * BRIEF MODULE DESCRIPTION
10154 + * Definitions for IDT RC32438 PCI setup.
10156 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10158 + * This program is free software; you can redistribute it and/or modify it
10159 + * under the terms of the GNU General Public License as published by the
10160 + * Free Software Foundation; either version 2 of the License, or (at your
10161 + * option) any later version.
10163 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10164 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10165 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10166 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10167 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10168 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10169 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10170 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10171 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10172 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10174 + * You should have received a copy of the GNU General Public License along
10175 + * with this program; if not, write to the Free Software Foundation, Inc.,
10176 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10179 + **************************************************************************
10180 + * May 2004 P. Sadik
10182 + * Initial Release
10186 + **************************************************************************
10189 +#define PCI_MSG_VirtualAddress 0xB8088010
10190 +#define rc32438_pci ((volatile PCI_t) PCI0_VirtualAddress)
10191 +#define rc32438_pci_msg ((volatile PCIM_t) PCI_MSG_VirtualAddress)
10193 +#define PCIM_SHFT 0x6
10194 +#define PCIM_BIT_LEN 0x7
10195 +#define PCIM_H_EA 0x3
10196 +#define PCIM_H_IA_FIX 0x4
10197 +#define PCIM_H_IA_RR 0x5
10199 +#define PCI_ADDR_START 0x50000000
10201 +#define CPUTOPCI_MEM_WIN 0x02000000
10202 +#define CPUTOPCI_IO_WIN 0x00100000
10203 +#define PCILBA_SIZE_SHFT 2
10204 +#define PCILBA_SIZE_MASK 0x1F
10205 +#define SIZE_256MB 0x1C
10206 +#define SIZE_128MB 0x1B
10207 +#define SIZE_64MB 0x1A
10208 +#define SIZE_32MB 0x19
10209 +#define SIZE_16MB 0x18
10210 +#define SIZE_4MB 0x16
10211 +#define SIZE_2MB 0x15
10212 +#define SIZE_1MB 0x14
10213 +#define ACACIA_CONFIG0_ADDR 0x80000000
10214 +#define ACACIA_CONFIG1_ADDR 0x80000004
10215 +#define ACACIA_CONFIG2_ADDR 0x80000008
10216 +#define ACACIA_CONFIG3_ADDR 0x8000000C
10217 +#define ACACIA_CONFIG4_ADDR 0x80000010
10218 +#define ACACIA_CONFIG5_ADDR 0x80000014
10219 +#define ACACIA_CONFIG6_ADDR 0x80000018
10220 +#define ACACIA_CONFIG7_ADDR 0x8000001C
10221 +#define ACACIA_CONFIG8_ADDR 0x80000020
10222 +#define ACACIA_CONFIG9_ADDR 0x80000024
10223 +#define ACACIA_CONFIG10_ADDR 0x80000028
10224 +#define ACACIA_CONFIG11_ADDR 0x8000002C
10225 +#define ACACIA_CONFIG12_ADDR 0x80000030
10226 +#define ACACIA_CONFIG13_ADDR 0x80000034
10227 +#define ACACIA_CONFIG14_ADDR 0x80000038
10228 +#define ACACIA_CONFIG15_ADDR 0x8000003C
10229 +#define ACACIA_CONFIG16_ADDR 0x80000040
10230 +#define ACACIA_CONFIG17_ADDR 0x80000044
10231 +#define ACACIA_CONFIG18_ADDR 0x80000048
10232 +#define ACACIA_CONFIG19_ADDR 0x8000004C
10233 +#define ACACIA_CONFIG20_ADDR 0x80000050
10234 +#define ACACIA_CONFIG21_ADDR 0x80000054
10235 +#define ACACIA_CONFIG22_ADDR 0x80000058
10236 +#define ACACIA_CONFIG23_ADDR 0x8000005C
10237 +#define ACACIA_CONFIG24_ADDR 0x80000060
10238 +#define ACACIA_CONFIG25_ADDR 0x80000064
10239 +#define ACACIA_CMD (PCFG04_command_ioena_m | \
10240 + PCFG04_command_memena_m | \
10241 + PCFG04_command_bmena_m | \
10242 + PCFG04_command_mwinv_m | \
10243 + PCFG04_command_parena_m | \
10244 + PCFG04_command_serrena_m )
10246 +#define ACACIA_STAT (PCFG04_status_mdpe_m | \
10247 + PCFG04_status_sta_m | \
10248 + PCFG04_status_rta_m | \
10249 + PCFG04_status_rma_m | \
10250 + PCFG04_status_sse_m | \
10251 + PCFG04_status_pe_m)
10253 +#define ACACIA_CNFG1 ((ACACIA_STAT<<16)|ACACIA_CMD)
10255 +#define ACACIA_REVID 0
10256 +#define ACACIA_CLASS_CODE 0
10257 +#define ACACIA_CNFG2 ((ACACIA_CLASS_CODE<<8) | \
10260 +#define ACACIA_CACHE_LINE_SIZE 4
10261 +#define ACACIA_MASTER_LAT 0x3c
10262 +#define ACACIA_HEADER_TYPE 0
10263 +#define ACACIA_BIST 0
10265 +#define ACACIA_CNFG3 ((ACACIA_BIST << 24) | \
10266 + (ACACIA_HEADER_TYPE<<16) | \
10267 + (ACACIA_MASTER_LAT<<8) | \
10268 + ACACIA_CACHE_LINE_SIZE )
10270 +#define ACACIA_BAR0 0x00000008 /* 128 MB Memory */
10271 +#define ACACIA_BAR1 0x18800001 /* 1 MB IO */
10272 +#define ACACIA_BAR2 0x18000001 /* 2 MB IO window for Acacia
10273 + internal Registers */
10274 +#define ACACIA_BAR3 0x48000008 /* Spare 128 MB Memory */
10276 +#define ACACIA_CNFG4 ACACIA_BAR0
10277 +#define ACACIA_CNFG5 ACACIA_BAR1
10278 +#define ACACIA_CNFG6 ACACIA_BAR2
10279 +#define ACACIA_CNFG7 ACACIA_BAR3
10281 +#define ACACIA_SUBSYS_VENDOR_ID 0
10282 +#define ACACIA_SUBSYSTEM_ID 0
10283 +#define ACACIA_CNFG8 0
10284 +#define ACACIA_CNFG9 0
10285 +#define ACACIA_CNFG10 0
10286 +#define ACACIA_CNFG11 ((ACACIA_SUBSYS_VENDOR_ID<<16) | \
10287 + ACACIA_SUBSYSTEM_ID)
10288 +#define ACACIA_INT_LINE 1
10289 +#define ACACIA_INT_PIN 1
10290 +#define ACACIA_MIN_GNT 8
10291 +#define ACACIA_MAX_LAT 0x38
10292 +#define ACACIA_CNFG12 0
10293 +#define ACACIA_CNFG13 0
10294 +#define ACACIA_CNFG14 0
10295 +#define ACACIA_CNFG15 ((ACACIA_MAX_LAT<<24) | \
10296 + (ACACIA_MIN_GNT<<16) | \
10297 + (ACACIA_INT_PIN<<8) | \
10299 +#define ACACIA_RETRY_LIMIT 0x80
10300 +#define ACACIA_TRDY_LIMIT 0x80
10301 +#define ACACIA_CNFG16 ((ACACIA_RETRY_LIMIT<<8) | \
10302 + ACACIA_TRDY_LIMIT)
10303 +#define PCI_PBAxC_R 0x0
10304 +#define PCI_PBAxC_RL 0x1
10305 +#define PCI_PBAxC_RM 0x2
10306 +#define SIZE_SHFT 2
10308 +#define ACACIA_PBA0C ( PCIPBAC_mrl_m | PCIPBAC_sb_m | \
10309 + ((PCI_PBAxC_RM &0x3) << PCIPBAC_mr_b) | \
10311 + (SIZE_128MB<<SIZE_SHFT) | \
10314 +#define ACACIA_CNFG17 ACACIA_PBA0C
10315 +#define ACACIA_PBA0M 0x0
10316 +#define ACACIA_CNFG18 ACACIA_PBA0M
10318 +#define ACACIA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
10321 +#define ACACIA_CNFG19 ACACIA_PBA1C
10322 +#define ACACIA_PBA1M 0x0
10323 +#define ACACIA_CNFG20 ACACIA_PBA1M
10325 +#define ACACIA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCIPBAC_sb_m | \
10328 +#define ACACIA_CNFG21 ACACIA_PBA2C
10329 +#define ACACIA_PBA2M 0x18000000
10330 +#define ACACIA_CNFG22 ACACIA_PBA2M
10331 +#define ACACIA_PBA3C 0
10332 +#define ACACIA_CNFG23 ACACIA_PBA3C
10333 +#define ACACIA_PBA3M 0
10334 +#define ACACIA_CNFG24 ACACIA_PBA3M
10338 +#define PCITC_DTIMER_VAL 8
10339 +#define PCITC_RTIMER_VAL 0x10
10341 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
10342 --- linux-2.6.15/include/asm-mips/idt-boards/rc32438/rc32438_timer.h 1970-01-01 01:00:00.000000000 +0100
10343 +++ linux-2.6.15-openwrt/include/asm-mips/idt-boards/rc32438/rc32438_timer.h 2006-01-10 00:32:33.000000000 +0100
10345 +/**************************************************************************
10347 + * BRIEF MODULE DESCRIPTION
10348 + * Timer register definition IDT RC32438 CPU.
10350 + * Copyright 2004 IDT Inc. (rischelp@idt.com)
10352 + * This program is free software; you can redistribute it and/or modify it
10353 + * under the terms of the GNU General Public License as published by the
10354 + * Free Software Foundation; either version 2 of the License, or (at your
10355 + * option) any later version.
10357 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10358 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
10359 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10360 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
10361 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
10362 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
10363 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
10364 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10365 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
10366 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10368 + * You should have received a copy of the GNU General Public License along
10369 + * with this program; if not, write to the Free Software Foundation, Inc.,
10370 + * 675 Mass Ave, Cambridge, MA 02139, USA.
10373 + **************************************************************************
10374 + * May 2004 P. Sadik.
10376 + * Initial Release
10380 + **************************************************************************
10383 +#ifndef __IDT_RC32438_TIM_H__
10384 +#define __IDT_RC32438_TIM_H__
10388 + TIM0_PhysicalAddress = 0x18028000,
10389 + TIM_PhysicalAddress = TIM0_PhysicalAddress, // Default
10391 + TIM0_VirtualAddress = 0xb8028000,
10392 + TIM_VirtualAddress = TIM0_VirtualAddress, // Default
10404 + u32 ctc ; //use CTC_
10407 +typedef struct TIM_s
10409 + struct TIM_CNTR_s tim [TIM_Count] ;
10410 + u32 rcount ; //use RCOUNT_
10411 + u32 rcompare ; //use RCOMPARE_
10412 + u32 rtc ; //use RTC_
10413 +} volatile * TIM_t ;
10418 + CTC_en_m = 0x00000001,
10420 + CTC_to_m = 0x00000002,
10422 + RCOUNT_count_b = 0,
10423 + RCOUNT_count_m = 0x0000ffff,
10424 + RCOMPARE_compare_b = 0,
10425 + RCOMPARE_compare_m = 0x0000ffff,
10427 + RTC_ce_m = 0x00000001,
10429 + RTC_to_m = 0x00000002,
10431 + RTC_rqe_m = 0x00000004,
10434 +#endif //__IDT_RC32438_TIM_H__
10436 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
10437 --- linux-2.6.15/include/asm-mips/mach-generic/irq.h 2006-01-03 04:21:10.000000000 +0100
10438 +++ linux-2.6.15-openwrt/include/asm-mips/mach-generic/irq.h 2006-01-10 00:32:33.000000000 +0100
10440 #ifndef __ASM_MACH_GENERIC_IRQ_H
10441 #define __ASM_MACH_GENERIC_IRQ_H
10443 -#define NR_IRQS 128
10444 +#define NR_IRQS 256
10446 #endif /* __ASM_MACH_GENERIC_IRQ_H */
10447 diff -Nur linux-2.6.15/include/linux/init.h linux-2.6.15-openwrt/include/linux/init.h
10448 --- linux-2.6.15/include/linux/init.h 2006-01-03 04:21:10.000000000 +0100
10449 +++ linux-2.6.15-openwrt/include/linux/init.h 2006-01-10 00:32:33.000000000 +0100
10451 static initcall_t __initcall_##fn __attribute_used__ \
10452 __attribute__((__section__(".initcall" level ".init"))) = fn
10454 +#define early_initcall(fn) __define_initcall(".early1",fn)
10456 #define core_initcall(fn) __define_initcall("1",fn)
10457 #define postcore_initcall(fn) __define_initcall("2",fn)
10458 #define arch_initcall(fn) __define_initcall("3",fn)
10459 diff -Nur linux-2.6.15/include/linux/kernel.h linux-2.6.15-openwrt/include/linux/kernel.h
10460 --- linux-2.6.15/include/linux/kernel.h 2006-01-03 04:21:10.000000000 +0100
10461 +++ linux-2.6.15-openwrt/include/linux/kernel.h 2006-01-10 00:32:33.000000000 +0100
10462 @@ -307,6 +307,7 @@
10465 /* Force a compilation error if condition is true */
10466 +extern void BUILD_BUG(void);
10467 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
10469 #ifdef CONFIG_SYSCTL
10470 diff -Nur linux-2.6.15/Makefile linux-2.6.15-openwrt/Makefile
10471 --- linux-2.6.15/Makefile 2006-01-03 04:21:10.000000000 +0100
10472 +++ linux-2.6.15-openwrt/Makefile 2006-01-10 00:32:33.000000000 +0100
10473 @@ -166,10 +166,7 @@
10474 # then ARCH is assigned, getting whatever value it gets normally, and
10475 # SUBARCH is subsequently ignored.
10477 -SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
10478 - -e s/arm.*/arm/ -e s/sa110/arm/ \
10479 - -e s/s390x/s390/ -e s/parisc64/parisc/ \
10480 - -e s/ppc64/powerpc/ )
10483 # Cross compiling and selecting different set of gcc/bin-utils
10484 # ---------------------------------------------------------------------------
10485 diff -Nur linux-2.6.15/drivers/net/natsemi.c linux-2.6.15-openwrt/drivers/net/natsemi.c
10486 --- linux-2.6.15/drivers/net/natsemi.c 2006-01-02 19:21:10.000000000 -0800
10487 +++ linux-2.6.15-openwrt/drivers/net/natsemi.c 2006-01-10 07:29:49.581994000 -0800
10488 @@ -771,6 +771,49 @@
10489 static int netdev_get_eeprom(struct net_device *dev, u8 *buf);
10490 static struct ethtool_ops ethtool_ops;
10492 +#ifdef CONFIG_MACH_ARUBA
10494 +#include <linux/ctype.h>
10497 +#define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args)
10500 +static int parse_mac_addr(struct net_device *dev, char* macstr)
10503 + unsigned char result, value;
10505 + for (i=0; i<6; i++) {
10507 + if (i != 5 && *(macstr+2) != ':') {
10508 + ERR("invalid mac address format: %d %c\n",
10512 + for (j=0; j<2; j++) {
10513 + if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
10514 + toupper(*macstr)-'A'+10) < 16) {
10515 + result = result*16 + value;
10519 + ERR("invalid mac address "
10520 + "character: %c\n", *macstr);
10526 + dev->dev_addr[i] = result;
10529 + dev->dev_addr[5]++;
10535 static inline void __iomem *ns_ioaddr(struct net_device *dev)
10537 return (void __iomem *) dev->base_addr;
10538 @@ -859,6 +902,7 @@
10542 +#ifndef CONFIG_MACH_ARUBA
10543 /* Work around the dropped serial bit. */
10544 prev_eedata = eeprom_read(ioaddr, 6);
10545 for (i = 0; i < 3; i++) {
10546 @@ -867,6 +911,19 @@
10547 dev->dev_addr[i*2+1] = eedata >> 7;
10548 prev_eedata = eedata;
10553 + unsigned char def_mac[6] = {00, 0x0b, 0x86, 0xba, 0xdb, 0xad};
10554 + extern char *getenv(char *e);
10555 + memset(mac, 0, 32);
10556 + memcpy(mac, getenv("ethaddr"), 17);
10557 + if (parse_mac_addr(dev, mac)){
10558 + printk("%s: MAC address not found\n", __func__);
10559 + memcpy(dev->dev_addr, def_mac, 6);
10564 dev->base_addr = (unsigned long __force) ioaddr;
10566 diff -Nur linux-2.6.15/drivers/net/Makefile linux-2.6.15-openwrt/drivers/net/Makefile
10567 --- linux-2.6.15/drivers/net/Makefile 2006-01-13 09:19:55.000000000 -0800
10568 +++ linux-2.6.15-openwrt/drivers/net/Makefile 2006-01-09 20:44:10.378339000 -0800
10571 obj-$(CONFIG_OAKNET) += oaknet.o 8390.o
10573 +obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
10574 obj-$(CONFIG_DGRS) += dgrs.o
10575 obj-$(CONFIG_VORTEX) += 3c59x.o
10576 obj-$(CONFIG_TYPHOON) += typhoon.o
10577 @@ -190,7 +189,6 @@
10578 obj-$(CONFIG_SMC91X) += smc91x.o
10579 obj-$(CONFIG_DM9000) += dm9000.o
10580 obj-$(CONFIG_FEC_8XX) += fec_8xx/
10581 -obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
10583 obj-$(CONFIG_ARM) += arm/
10584 obj-$(CONFIG_DEV_APPLETALK) += appletalk/