1 diff -urN kernel-base/arch/mips/ar7/ar7/ar7_jump.S kernel-tmp2/arch/mips/ar7/ar7/ar7_jump.S
2 --- kernel-base/arch/mips/ar7/ar7/ar7_jump.S 1970-01-01 01:00:00.000000000 +0100
3 +++ kernel-tmp2/arch/mips/ar7/ar7/ar7_jump.S 2005-07-10 06:40:39.582267168 +0200
7 + * Copyright (C) $Date$ $Author$
9 + * This program is free software; you can redistribute it and/or modify
10 + * it under the terms of the GNU General Public License as published by
11 + * the Free Software Foundation; either version 2 of the License, or
12 + * (at your option) any later version.
14 + * This program is distributed in the hope that it will be useful,
15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 + * GNU General Public License for more details.
19 + * You should have received a copy of the GNU General Public License
20 + * along with this program; if not, write to the Free Software
21 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 +#include <linux/config.h>
26 +#include <linux/threads.h>
29 +#include <asm/cacheops.h>
30 +#include <asm/current.h>
31 +#include <asm/offset.h>
32 +#include <asm/processor.h>
33 +#include <asm/regdef.h>
34 +#include <asm/cachectl.h>
35 +#include <asm/mipsregs.h>
36 +#include <asm/stackframe.h>
43 +/* TLB Miss Vector */
53 + /* Unused TLB Miss Vector */
55 +LEAF(jump_tlb_miss_unused)
61 +END(jump_tlb_miss_unused)
63 + /* Cache Error Vector */
65 +LEAF(jump_cache_error)
71 +END(jump_cache_error)
73 + /* General Exception */
75 +LEAF(jump_general_exception)
81 +END(jump_general_exception)
83 + /* Dedicated Interrupt */
85 +LEAF(jump_dedicated_interrupt)
91 +END(jump_dedicated_interrupt)
94 diff -urN kernel-base/arch/mips/ar7/ar7/ar7_paging.c kernel-tmp2/arch/mips/ar7/ar7/ar7_paging.c
95 --- kernel-base/arch/mips/ar7/ar7/ar7_paging.c 1970-01-01 01:00:00.000000000 +0100
96 +++ kernel-tmp2/arch/mips/ar7/ar7/ar7_paging.c 2005-07-10 07:08:33.725758672 +0200
100 + * This file is subject to the terms and conditions of the GNU General Public
101 + * License. See the file "COPYING" in the main directory of this archive
102 + * for more details.
104 + * Copyright (C) 2002 by Jeff Harrell (jharrell@ti.com)
105 + * Copyright (C) 2002 Texas Instruments, Inc.
110 + * This file takes care of the "memory hole" issue that exists with the standard
111 + * linux kernel and the TI Avalanche ASIC. The Avalanche ASIC requires an offset
112 + * of 0x14000000 due to the ASIC's memory map constraints. This file corrects the
113 + * paging tables so that the only reflect valid memory (i.e. > 0x14000000)
117 +#include <linux/config.h>
118 +#include <linux/signal.h>
119 +#include <linux/sched.h>
120 +#include <linux/kernel.h>
121 +#include <linux/errno.h>
122 +#include <linux/string.h>
123 +#include <linux/types.h>
124 +#include <linux/ptrace.h>
125 +#include <linux/mman.h>
126 +#include <linux/mm.h>
127 +#include <linux/swap.h>
128 +#include <linux/smp.h>
129 +#include <linux/init.h>
130 +#ifdef CONFIG_BLK_DEV_INITRD
131 +#include <linux/blk.h>
132 +#endif /* CONFIG_BLK_DEV_INITRD */
133 +#include <linux/highmem.h>
134 +#include <linux/bootmem.h>
136 +#include <asm/processor.h>
137 +#include <asm/system.h>
138 +#include <asm/uaccess.h>
139 +#include <asm/pgtable.h>
140 +#include <asm/pgalloc.h>
141 +#include <asm/mmu_context.h>
143 +#include <asm/tlb.h>
144 +#include <asm/cpu.h>
146 +#define __MEMORY_START CONFIG_AR7_MEMORY
148 +#ifdef CONFIG_DISCONTIGMEM
149 +pg_data_t discontig_page_data[NR_NODES];
150 +bootmem_data_t discontig_node_bdata[NR_NODES];
153 +static unsigned long totalram_pages;
154 +/* static unsigned long totalhigh_pages; */
156 +#define START_PFN (NODE_DATA(0)->bdata->node_boot_start >> PAGE_SHIFT)
157 +#define MAX_LOW_PFN (NODE_DATA(0)->bdata->node_low_pfn)
159 +#define PFN_UP(x) (((x) + PAGE_SIZE - 1) >> PAGE_SHIFT)
160 +#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
161 +#define PFN_PHYS(x) ((x) << PAGE_SHIFT)
163 +unsigned long bootmap_size;
165 +extern char *prom_getenv(char *envname);
168 + * We have upto 8 empty zeroed pages so we can map one of the right colour
169 + * when needed. This is necessary only on R4000 / R4400 SC and MC versions
170 + * where we have to avoid VCED / VECI exceptions for good performance at
171 + * any price. Since page is never written to after the initialization we
172 + * don't have to care about aliases on other CPUs.
175 +static inline unsigned long setup_zero_pages(void)
177 + unsigned long order, size;
179 + if(current_cpu_data.options & MIPS_CPU_VCE)
184 + empty_zero_page = __get_free_pages(GFP_KERNEL, order);
186 + if (!empty_zero_page)
187 + panic("Oh boy, that early out of memory?");
189 + page = virt_to_page(empty_zero_page);
191 + while (page < virt_to_page(empty_zero_page + (PAGE_SIZE << order))) {
192 + set_bit(PG_reserved, &page->flags);
193 + set_page_count(page, 0);
197 + size = PAGE_SIZE << order;
198 + zero_page_mask = (size - 1) & PAGE_MASK;
199 + memset((void *)empty_zero_page, 0, size);
201 + return 1UL << order;
205 + * paging_init() sets up the page tables
207 + * This routines also unmaps the page at virtual kernel address 0, so
208 + * that we can trap those pesky NULL-reference errors in the kernel.
210 +void __init paging_init(void)
212 + unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
213 + unsigned long low, start_pfn;
215 + /* Initialize the entire pgd. */
216 + pgd_init((unsigned long)swapper_pg_dir);
217 + pgd_init((unsigned long)swapper_pg_dir + PAGE_SIZE / 2);
220 + start_pfn = START_PFN;
221 + // max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
224 + /* Avalanche DMA-able memory 0x14000000+memsize */
226 + zones_size[ZONE_DMA] = low - start_pfn;
228 + free_area_init_node(0, NODE_DATA(0), 0, zones_size, __MEMORY_START, 0);
230 +#ifdef CONFIG_DISCONTIGMEM
231 + zones_size[ZONE_DMA] = __MEMORY_SIZE_2ND >> PAGE_SHIFT;
232 + zones_size[ZONE_NORMAL] = 0;
233 + free_area_init_node(1, NODE_DATA(1), 0, zones_size, __MEMORY_START_2ND, 0);
234 +#endif /* CONFIG_DISCONTIGMEM */
238 +extern char _ftext, _etext, _fdata, _edata, _end;
239 +extern char __init_begin, __init_end;
241 +void __init mem_init(void)
243 + int codesize, reservedpages, datasize, initsize;
246 + max_mapnr = num_physpages = MAX_LOW_PFN - START_PFN;
247 + high_memory = (void *)__va(MAX_LOW_PFN * PAGE_SIZE);
249 + /* free up the memory associated with Adam2 -
250 + * that is the, after the first page that is
251 + * reserved all the way up to the start of the kernel
253 + free_bootmem_node(NODE_DATA(0), (__MEMORY_START+PAGE_SIZE),
254 + (__pa(&_ftext))-(__MEMORY_START+PAGE_SIZE) );
256 + /* this will put all low memory onto the freelists */
257 + totalram_pages += free_all_bootmem_node(NODE_DATA(0));
259 + /* Setup zeroed pages */
260 + totalram_pages -= setup_zero_pages();
263 +#ifdef CONFIG_DISCONTIGMEM
264 + totalram_pages += free_all_bootmem_node(NODE_DATA(1));
267 + for (tmp = 0; tmp < num_physpages; tmp++)
269 + * Only count reserved RAM pages
271 + if (PageReserved(mem_map+tmp))
274 + codesize = (unsigned long) &_etext - (unsigned long) &_ftext;
275 + datasize = (unsigned long) &_edata - (unsigned long) &_fdata;
276 + initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
278 + printk("Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n",
279 + (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
280 + max_mapnr << (PAGE_SHIFT-10),
282 + reservedpages << (PAGE_SHIFT-10),
288 +/* fixes paging routines for avalanche (utilized in /arch/mips/kernel/setup.c) */
290 +void avalanche_bootmem_init(void)
292 + unsigned long start_pfn, max_pfn;
293 + unsigned long max_low_pfn;
294 + unsigned int memsize,memory_end,memory_start;
297 + memsize_str = prom_getenv("memsize");
298 + if (!memsize_str) {
299 + memsize = 0x02000000;
301 + memsize = simple_strtol(memsize_str, NULL, 0);
305 + memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;
306 + memory_end = memory_start + memsize;
309 + * Find the highest memory page fram number we have available
312 + max_pfn = PFN_DOWN(__pa(memory_end));
315 + * Determine the low and high memory ranges
318 + max_low_pfn = max_pfn;
321 + * Partially used pages are not usable - thus we are
322 + * rounding upwards:
325 + start_pfn = PFN_UP(__pa(&_end));
328 + * Find a proper area for the bootmem bitmap. After this
329 + * bootstrap step all allocations (until the page allocator is
330 + * intact) must be done via bootmem_alloc().
333 + bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn,
334 + __MEMORY_START>>PAGE_SHIFT, max_low_pfn);
338 + * Register fully available low RAM pages with the bootmem allocator.
342 + unsigned long curr_pfn, last_pfn, pages;
345 + * We are rounding up the start address of usable memory:
347 + curr_pfn = PFN_UP(__MEMORY_START);
350 + * ... and at the end of the usable range downwards:
352 + last_pfn = PFN_DOWN(__pa(memory_end));
354 + if (last_pfn > max_low_pfn)
355 + last_pfn = max_low_pfn;
357 + pages = last_pfn - curr_pfn;
360 + free_bootmem_node(NODE_DATA(0), PFN_PHYS(curr_pfn),
365 + * Reserve the kernel text and
366 + * Reserve the bootmem bitmap. We do this in two steps (first step
367 + * was init_bootmem()), because this catches the (definitely buggy)
368 + * case of us accidentally initializing the bootmem allocator with
369 + * an invalid RAM area.
371 + reserve_bootmem_node(NODE_DATA(0), __MEMORY_START+PAGE_SIZE,
372 + (PFN_PHYS(start_pfn)+bootmap_size+PAGE_SIZE-1)-__MEMORY_START);
375 + * reserve physical page 0 - it's a special BIOS page on many boxes,
376 + * enabling clean reboots, SMP operation, laptop functions.
378 + reserve_bootmem_node(NODE_DATA(0), __MEMORY_START, PAGE_SIZE);
381 +extern char __init_begin, __init_end;
383 +void free_initmem(void)
385 + unsigned long addr;
386 + // prom_free_prom_memory ();
388 + addr = (unsigned long) &__init_begin;
389 + while (addr < (unsigned long) &__init_end) {
390 + ClearPageReserved(virt_to_page(addr));
391 + set_page_count(virt_to_page(addr), 1);
396 + printk("Freeing unused kernel memory: %dk freed\n",
397 + (&__init_end - &__init_begin) >> 10);
400 +void si_meminfo(struct sysinfo *val)
402 + val->totalram = totalram_pages;
403 + val->sharedram = 0;
404 + val->freeram = nr_free_pages();
405 + val->bufferram = atomic_read(&buffermem_pages);
406 + val->totalhigh = 0;
407 + val->freehigh = nr_free_highpages();
408 + val->mem_unit = PAGE_SIZE;
412 diff -urN kernel-base/arch/mips/ar7/ar7/Makefile kernel-tmp2/arch/mips/ar7/ar7/Makefile
413 --- kernel-base/arch/mips/ar7/ar7/Makefile 1970-01-01 01:00:00.000000000 +0100
414 +++ kernel-tmp2/arch/mips/ar7/ar7/Makefile 2005-07-10 06:40:39.583267016 +0200
417 +# Copyright (C) $Date$ $Author$
419 +# This program is free software; you can redistribute it and/or modify
420 +# it under the terms of the GNU General Public License as published by
421 +# the Free Software Foundation; either version 2 of the License, or
422 +# (at your option) any later version.
424 +# This program is distributed in the hope that it will be useful,
425 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
426 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
427 +# GNU General Public License for more details.
429 +# You should have received a copy of the GNU General Public License
430 +# along with this program; if not, write to the Free Software
431 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
434 + $(CPP) $(AFLAGS) $< -o $*.s
437 + $(CC) $(AFLAGS) -c $< -o $*.o
439 +EXTRA_CFLAGS := -DLITTLE_ENDIAN -D_LINK_KSEG0_
443 +obj-y += ar7_paging.o ar7_jump.o
445 +include $(TOPDIR)/Rules.make
446 diff -urN kernel-base/arch/mips/ar7/cmdline.c kernel-tmp2/arch/mips/ar7/cmdline.c
447 --- kernel-base/arch/mips/ar7/cmdline.c 1970-01-01 01:00:00.000000000 +0100
448 +++ kernel-tmp2/arch/mips/ar7/cmdline.c 2005-07-10 06:40:39.584266864 +0200
451 + * Carsten Langgaard, carstenl@mips.com
452 + * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
454 + * This program is free software; you can distribute it and/or modify it
455 + * under the terms of the GNU General Public License (Version 2) as
456 + * published by the Free Software Foundation.
458 + * This program is distributed in the hope it will be useful, but WITHOUT
459 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
460 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
461 + * for more details.
463 + * You should have received a copy of the GNU General Public License along
464 + * with this program; if not, write to the Free Software Foundation, Inc.,
465 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
467 + * Kernel command line creation using the prom monitor (YAMON) argc/argv.
469 +#include <linux/init.h>
470 +#include <linux/string.h>
472 +#include <asm/bootinfo.h>
474 +extern int prom_argc;
475 +extern int *_prom_argv;
478 + * YAMON (32-bit PROM) pass arguments and environment as 32-bit pointer.
479 + * This macro take care of sign extension.
481 +#define prom_argv(index) ((char *)(((int *)(int)_prom_argv)[(index)]))
483 +char arcs_cmdline[CL_SIZE];
485 +char * __init prom_getcmdline(void)
487 + return &(arcs_cmdline[0]);
491 +void __init prom_init_cmdline(void)
496 + actr = 1; /* Always ignore argv[0] */
498 + cp = &(arcs_cmdline[0]);
499 +#ifdef CONFIG_CMDLINE_BOOL
500 + strcpy(cp, CONFIG_CMDLINE);
501 + cp += strlen(CONFIG_CMDLINE);
504 + while(actr < prom_argc) {
505 + strcpy(cp, prom_argv(actr));
506 + cp += strlen(prom_argv(actr));
510 + if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
514 diff -urN kernel-base/arch/mips/ar7/init.c kernel-tmp2/arch/mips/ar7/init.c
515 --- kernel-base/arch/mips/ar7/init.c 1970-01-01 01:00:00.000000000 +0100
516 +++ kernel-tmp2/arch/mips/ar7/init.c 2005-07-10 06:40:39.584266864 +0200
519 + * Carsten Langgaard, carstenl@mips.com
520 + * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
522 + * This program is free software; you can distribute it and/or modify it
523 + * under the terms of the GNU General Public License (Version 2) as
524 + * published by the Free Software Foundation.
526 + * This program is distributed in the hope it will be useful, but WITHOUT
527 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
528 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
529 + * for more details.
531 + * You should have received a copy of the GNU General Public License along
532 + * with this program; if not, write to the Free Software Foundation, Inc.,
533 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
535 + * PROM library initialisation code.
537 +#include <linux/config.h>
538 +#include <linux/init.h>
539 +#include <linux/string.h>
540 +#include <linux/kernel.h>
541 +#include <linux/module.h>
544 +#include <asm/mips-boards/prom.h>
545 +#include <asm/mips-boards/generic.h>
547 +/* Environment variable */
554 +int *_prom_argv, *_prom_envp;
556 +/* max # of Adam2 environment variables */
557 +#define MAX_ENV_ENTRY 80
559 +static t_env_var local_envp[MAX_ENV_ENTRY];
562 +char *prom_getenv(char *envname)
565 + * Return a pointer to the given environment variable.
566 + * In 64-bit mode: we're using 64-bit pointers, but all pointers
567 + * in the PROM structures are only 32-bit, so we need some
568 + * workarounds, if we are running in 64-bit mode.
571 + t_env_var *env = (t_env_var *) local_envp;
573 + i = strlen(envname);
574 + while (env->name) {
575 + if(strncmp(envname, env->name, i) == 0) {
584 +static inline unsigned char str2hexnum(unsigned char c)
586 + if (c >= '0' && c <= '9')
588 + if (c >= 'a' && c <= 'f')
589 + return c - 'a' + 10;
590 + return 0; /* foo */
593 +static inline void str2eaddr(unsigned char *ea, unsigned char *str)
597 + for (i = 0; i < 6; i++) {
600 + if((*str == '.') || (*str == ':'))
602 + num = str2hexnum(*str++) << 4;
603 + num |= (str2hexnum(*str++));
608 +int get_ethernet_addr(char *ethernet_addr)
612 + ethaddr_str = prom_getenv("ethaddr");
613 + if (!ethaddr_str) {
614 + printk("ethaddr not set in boot prom\n");
617 + str2eaddr(ethernet_addr, ethaddr_str);
619 + if (init_debug > 1) {
621 + printk("get_ethernet_addr: ");
622 + for (i=0; i<5; i++)
623 + printk("%02x:", (unsigned char)*(ethernet_addr+i));
624 + printk("%02x\n", *(ethernet_addr+i));
630 +int __init prom_init(int argc, char **argv, char **envp)
633 + t_env_var *env = (t_env_var *) envp;
636 + _prom_argv = (int *)argv;
637 + _prom_envp = (int *)envp;
639 + /* Copy what we need locally so we are not dependent on
640 + * bootloader RAM. In Adam2, the environment parameters
641 + * are in flash but the table that references them is in
644 + for(i=0; i < MAX_ENV_ENTRY; i++, env++) {
646 + local_envp[i].name = env->name;
647 + local_envp[i].val = env->val;
649 + local_envp[i].name = NULL;
650 + local_envp[i].val = NULL;
654 + set_io_port_base(0);
656 + prom_printf("\nLINUX started...\n");
657 + prom_init_cmdline();
663 +EXPORT_SYMBOL(prom_getenv);
664 diff -urN kernel-base/arch/mips/ar7/irq.c kernel-tmp2/arch/mips/ar7/irq.c
665 --- kernel-base/arch/mips/ar7/irq.c 1970-01-01 01:00:00.000000000 +0100
666 +++ kernel-tmp2/arch/mips/ar7/irq.c 2005-07-10 06:40:39.585266712 +0200
669 + * Nitin Dhingra, iamnd@ti.com
670 + * Copyright (C) 2002 Texas Instruments, Inc. All rights reserved.
672 + * ########################################################################
674 + * This program is free software; you can distribute it and/or modify it
675 + * under the terms of the GNU General Public License (Version 2) as
676 + * published by the Free Software Foundation.
678 + * This program is distributed in the hope it will be useful, but WITHOUT
679 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
680 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
681 + * for more details.
683 + * You should have received a copy of the GNU General Public License along
684 + * with this program; if not, write to the Free Software Foundation, Inc.,
685 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
687 + * ########################################################################
689 + * Routines for generic manipulation of the interrupts found on the Texas
690 + * Instruments avalanche board
694 +#include <linux/config.h>
695 +#include <linux/init.h>
696 +#include <linux/sched.h>
697 +#include <linux/slab.h>
698 +#include <linux/interrupt.h>
699 +#include <linux/kernel_stat.h>
700 +#include <linux/proc_fs.h>
701 +#include <asm/irq.h>
702 +#include <asm/mips-boards/prom.h>
703 +#include <asm/ar7/ar7.h>
704 +#include <asm/ar7/avalanche_intc.h>
705 +#include <asm/gdb-stub.h>
708 +#define shutdown_avalanche_irq disable_avalanche_irq
709 +#define mask_and_ack_avalanche_irq disable_avalanche_irq
711 +static unsigned int startup_avalanche_irq(unsigned int irq);
712 +static void end_avalanche_irq(unsigned int irq);
713 +void enable_avalanche_irq(unsigned int irq_nr);
714 +void disable_avalanche_irq(unsigned int irq_nr);
716 +static struct hw_interrupt_type avalanche_irq_type = {
718 + startup_avalanche_irq,
719 + shutdown_avalanche_irq,
720 + enable_avalanche_irq,
721 + disable_avalanche_irq,
722 + mask_and_ack_avalanche_irq,
727 +irq_desc_t irq_desc_ti[AVALANCHE_INT_END+1] __cacheline_aligned =
728 +{ [0 ... AVALANCHE_INT_END] = { 0, &avalanche_irq_type, NULL, 0, SPIN_LOCK_UNLOCKED}};
731 +unsigned long spurious_count = 0;
733 +struct avalanche_ictrl_regs *avalanche_hw0_icregs; /* Interrupt control regs (primary) */
734 +struct avalanche_exctrl_regs *avalanche_hw0_ecregs; /* Exception control regs (secondary) */
735 +struct avalanche_ipace_regs *avalanche_hw0_ipaceregs;
736 +struct avalanche_channel_int_number *avalanche_hw0_chregs; /* Channel control registers */
738 +extern asmlinkage void mipsIRQ(void);
742 + * The avalanche/MIPS interrupt line numbers are used to represent the
743 + * interrupts within the irqaction arrays. The index notation is
746 + * 0-7 MIPS CPU Exceptions (HW/SW)
747 + * 8-47 Primary Interrupts (Avalanche)
748 + * 48-79 Secondary Interrupts (Avalanche)
753 +static struct irqaction *hw0_irq_action_primary[AVINTNUM(AVALANCHE_INT_END_PRIMARY)] =
755 + NULL, NULL, NULL, NULL,
756 + NULL, NULL, NULL, NULL,
757 + NULL, NULL, NULL, NULL,
758 + NULL, NULL, NULL, NULL,
759 + NULL, NULL, NULL, NULL,
760 + NULL, NULL, NULL, NULL,
761 + NULL, NULL, NULL, NULL,
762 + NULL, NULL, NULL, NULL,
763 + NULL, NULL, NULL, NULL,
764 + NULL, NULL, NULL, NULL
767 +static struct irqaction *hw0_irq_action_secondary[AVINTNUM(AVALANCHE_INT_END_SECONDARY)] =
769 + NULL, NULL, NULL, NULL,
770 + NULL, NULL, NULL, NULL,
771 + NULL, NULL, NULL, NULL,
772 + NULL, NULL, NULL, NULL,
773 + NULL, NULL, NULL, NULL,
774 + NULL, NULL, NULL, NULL,
775 + NULL, NULL, NULL, NULL,
776 + NULL, NULL, NULL, NULL
780 + This remaps interrupts to exist on other channels than the default
781 + channels. essentially we can use the line # as the index for this
786 +static unsigned long line_to_channel[AVINTNUM(AVALANCHE_INT_END_PRIMARY)];
787 +unsigned long uni_secondary_interrupt = 0;
789 +static struct irqaction r4ktimer_action = {
790 + NULL, 0, 0, "R4000 timer/counter", NULL, NULL,
793 +static struct irqaction *irq_action[8] = {
794 + NULL, /* SW int 0 */
795 + NULL, /* SW int 1 */
796 + NULL, /* HW int 0 */
799 + NULL, /* HW int 3 */
800 + NULL, /* HW int 4 */
801 + &r4ktimer_action /* HW int 5 */
804 +static void end_avalanche_irq(unsigned int irq)
806 + if (!(irq_desc_ti[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
807 + enable_avalanche_irq(irq);
810 +void disable_avalanche_irq(unsigned int irq_nr)
812 + unsigned long flags;
813 + unsigned long chan_nr=0;
814 + unsigned long int_bit=0;
816 + if(irq_nr >= AVALANCHE_INT_END)
818 + printk("whee, invalid irq_nr %d\n", irq_nr);
819 + panic("IRQ, you lose...");
822 + save_and_cli(flags);
825 + if(irq_nr < MIPS_EXCEPTION_OFFSET)
827 + /* disable mips exception */
829 + int_bit = read_c0_status() & ~(1 << (8+irq_nr));
830 + change_c0_status(ST0_IM,int_bit);
831 + restore_flags(flags);
835 + /* irq_nr represents the line number for the interrupt. We must
836 + * disable the channel number associated with that line number.
839 + if(irq_nr > AVALANCHE_INT_END_PRIMARY_REG2)
840 + chan_nr = AVINTNUM(irq_nr); /*CHECK THIS ALSO*/
842 + chan_nr = line_to_channel[AVINTNUM(irq_nr)];/* WE NEED A LINE TO CHANNEL MAPPING FUNCTION HERE*/
844 + /* disable the interrupt channel bit */
846 + /* primary interrupt #'s 0-31 */
848 + if(chan_nr <= AVINTNUM(AVALANCHE_INT_END_PRIMARY_REG1))
849 + avalanche_hw0_icregs->intecr1 = (1 << chan_nr);
851 + /* primary interrupt #'s 32-39 */
853 + else if ((chan_nr <= AVINTNUM(AVALANCHE_INT_END_PRIMARY_REG2)) &&
854 + (chan_nr > AVINTNUM(AVALANCHE_INT_END_PRIMARY_REG1)))
855 + avalanche_hw0_icregs->intecr2 = (1 << (chan_nr - AVINTNUM(AVALANCHE_INT_END_SECONDARY)));
857 + else /* secondary interrupt #'s 0-31 */
858 + avalanche_hw0_ecregs->exiecr = (1 << (chan_nr - AVINTNUM(AVALANCHE_INT_END_PRIMARY)));
860 + restore_flags(flags);
863 +void enable_avalanche_irq(unsigned int irq_nr)
865 + unsigned long flags;
866 + unsigned long chan_nr=0;
867 + unsigned long int_bit=0;
869 + if(irq_nr > AVALANCHE_INT_END) {
870 + printk("whee, invalid irq_nr %d\n", irq_nr);
871 + panic("IRQ, you lose...");
874 + save_and_cli(flags);
877 + if(irq_nr < MIPS_EXCEPTION_OFFSET)
879 + /* Enable MIPS exceptions */
880 + int_bit = read_c0_status();
881 + change_c0_status(ST0_IM,int_bit | (1<<(8+irq_nr)));
882 + restore_flags(flags);
886 + /* irq_nr represents the line number for the interrupt. We must
887 + * disable the channel number associated with that line number.
890 + if(irq_nr > AVALANCHE_INT_END_PRIMARY_REG2)
891 + chan_nr = AVINTNUM(irq_nr);
893 + chan_nr = line_to_channel[AVINTNUM(irq_nr)];
895 + /* enable the interrupt channel bit */
897 + /* primary interrupt #'s 0-31 */
898 + if(chan_nr <= AVINTNUM(AVALANCHE_INT_END_PRIMARY_REG1))
899 + avalanche_hw0_icregs->intesr1 = (1 << chan_nr);
901 + /* primary interrupt #'s 32 throuth 39 */
902 + else if ((chan_nr <= AVINTNUM(AVALANCHE_INT_END_PRIMARY_REG2)) &&
903 + (chan_nr > AVINTNUM(AVALANCHE_INT_END_PRIMARY_REG1)))
904 + avalanche_hw0_icregs->intesr2 = (1 << (chan_nr - AVINTNUM(AVALANCHE_INT_END_SECONDARY)));
906 + else /* secondary interrupt #'s 0-31 */
907 + avalanche_hw0_ecregs->exiesr = (1 << (chan_nr - AVINTNUM(AVALANCHE_INT_END_PRIMARY)));
909 + restore_flags(flags);
912 +static unsigned int startup_avalanche_irq(unsigned int irq)
914 + enable_avalanche_irq(irq);
915 + return 0; /* never anything pending */
919 +int get_irq_list(char *buf)
923 + struct irqaction *action;
925 + for (i = 0; i < MIPS_EXCEPTION_OFFSET; i++, num++)
927 + action = irq_action[i];
930 + len += sprintf(buf+len, "%2d: %8d %c %s",
931 + num, kstat.irqs[0][num],
932 + (action->flags & SA_INTERRUPT) ? '+' : ' ',
934 + for (action=action->next; action; action = action->next) {
935 + len += sprintf(buf+len, ",%s %s",
936 + (action->flags & SA_INTERRUPT) ? " +" : "",
939 + len += sprintf(buf+len, " [MIPS interrupt]\n");
943 + for (i = 0; i < AVINTNUM(AVALANCHE_INT_END); i++,num++)
945 + if(i < AVINTNUM(AVALANCHE_INT_END_PRIMARY))
946 + action = hw0_irq_action_primary[i];
948 + action = hw0_irq_action_secondary[i-AVINTNUM(AVALANCHE_INT_END_PRIMARY)];
951 + len += sprintf(buf+len, "%2d: %8d %c %s",
952 + num, kstat.irqs[0][ LNXINTNUM(i) ],
953 + (action->flags & SA_INTERRUPT) ? '+' : ' ',
956 + for (action=action->next; action; action = action->next)
958 + len += sprintf(buf+len, ",%s %s",
959 + (action->flags & SA_INTERRUPT) ? " +" : "",
963 + if(i < AVINTNUM(AVALANCHE_INT_END_PRIMARY))
964 + len += sprintf(buf+len, " [hw0 (Avalanche Primary)]\n");
966 + len += sprintf(buf+len, " [hw0 (Avalanche Secondary)]\n");
973 +int request_irq(unsigned int irq,
974 + void (*handler)(int, void *, struct pt_regs *),
975 + unsigned long irqflags,
976 + const char * devname,
979 + struct irqaction *action;
981 + if (irq > AVALANCHE_INT_END)
986 + action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
990 + action->handler = handler;
991 + action->flags = irqflags;
993 + action->name = devname;
994 + irq_desc_ti[irq].action = action;
995 + action->dev_id = dev_id;
999 + if(irq < MIPS_EXCEPTION_OFFSET)
1001 + irq_action[irq] = action;
1002 + enable_avalanche_irq(irq);
1006 + if(irq < AVALANCHE_INT_END_PRIMARY)
1007 + hw0_irq_action_primary[line_to_channel[AVINTNUM(irq)]] = action;
1009 + hw0_irq_action_secondary[irq - AVALANCHE_INT_END_PRIMARY] = action;
1011 + enable_avalanche_irq(irq);
1016 +void free_irq(unsigned int irq, void *dev_id)
1018 + struct irqaction *action;
1020 + if (irq > AVALANCHE_INT_END) {
1021 + printk("Trying to free IRQ%d\n",irq);
1025 + if(irq < MIPS_EXCEPTION_OFFSET)
1027 + action = irq_action[irq];
1028 + irq_action[irq] = NULL;
1029 + irq_desc_ti[irq].action = NULL;
1030 + disable_avalanche_irq(irq);
1035 + if(irq < AVALANCHE_INT_END_PRIMARY) {
1036 + action = hw0_irq_action_primary[line_to_channel[AVINTNUM(irq)]];
1037 + hw0_irq_action_primary[line_to_channel[AVINTNUM(irq)]] = NULL;
1038 + irq_desc_ti[irq].action = NULL;
1041 + action = hw0_irq_action_secondary[irq - AVALANCHE_INT_END_PRIMARY];
1042 + hw0_irq_action_secondary[irq - AVALANCHE_INT_END_PRIMARY] = NULL;
1043 + irq_desc_ti[irq].action = NULL;
1046 + disable_avalanche_irq(irq);
1051 +extern void breakpoint(void);
1052 +extern int remote_debug;
1055 +//void init_IRQ(void) __init;
1056 +void __init init_IRQ(void)
1060 + avalanche_hw0_icregs = (struct avalanche_ictrl_regs *)AVALANCHE_ICTRL_REGS_BASE;
1061 + avalanche_hw0_ecregs = (struct avalanche_exctrl_regs *)AVALANCHE_ECTRL_REGS_BASE;
1062 + avalanche_hw0_ipaceregs = (struct avalanche_ipace_regs *)AVALANCHE_IPACE_REGS_BASE;
1063 + avalanche_hw0_chregs = (struct avalanche_channel_int_number *)AVALANCHE_CHCTRL_REGS_BASE;
1065 + /* Disable interrupts and clear pending
1068 + avalanche_hw0_icregs->intecr1 = 0xffffffff; /* disable interrupts 0:31 */
1069 + avalanche_hw0_icregs->intcr1 = 0xffffffff; /* clear interrupts 0:31 */
1070 + avalanche_hw0_icregs->intecr2 = 0xff; /* disable interrupts 32:39 */
1071 + avalanche_hw0_icregs->intcr2 = 0xff; /* clear interrupts 32:39 */
1072 + avalanche_hw0_ecregs->exiecr = 0xffffffff; /* disable secondary interrupts 0:31 */
1073 + avalanche_hw0_ecregs->excr = 0xffffffff; /* clear secondary interrupts 0:31 */
1076 + /* Channel to line mapping, Line to Channel mapping */
1078 + for(i = 0; i < 40; i++)
1079 + avalanche_int_set(i,i);
1081 + /* Now safe to set the exception vector. */
1082 + set_except_vector(0, mipsIRQ);
1084 + /* Setup the IRQ description array. These will be mapped
1085 + * as flat interrupts numbers. The mapping is as follows
1087 + * 0-7 MIPS CPU Exceptions (HW/SW)
1088 + * 8-46 Primary Interrupts (Avalanche)
1089 + * 47-78 Secondary Interrupts (Avalanche)
1092 + for (i = 0; i <= AVALANCHE_INT_END; i++)
1094 + irq_desc_ti[i].status = IRQ_DISABLED;
1095 + irq_desc_ti[i].action = 0;
1096 + irq_desc_ti[i].depth = 1;
1097 + irq_desc_ti[i].handler = &avalanche_irq_type;
1103 + set_debug_traps();
1110 +void avalanche_hw0_irqdispatch(struct pt_regs *regs)
1112 + struct irqaction *action;
1113 + int irq, cpu = smp_processor_id();
1114 + unsigned long int_line_number,status;
1115 + int i,secondary = 0;
1118 + int_line_number = ((avalanche_hw0_icregs->pintir >> 16) & 0x3F);
1119 + chan_nr = ((avalanche_hw0_icregs->pintir) & 0x3F);
1124 + if( chan_nr != uni_secondary_interrupt)
1125 + avalanche_hw0_icregs->intcr1 = (1<<chan_nr);
1129 + if((chan_nr < 40) && (chan_nr > 31))
1131 + avalanche_hw0_icregs->intcr2 = (1<<(chan_nr-AVINTNUM(AVALANCHE_INT_END_SECONDARY)));
1135 + /* If the Priority Interrupt Index Register returns 40 then no
1136 + * interrupts are pending
1142 + if(chan_nr == uni_secondary_interrupt)
1144 + status = avalanche_hw0_ecregs->exsr;
1145 + for(i=0; i < AVINTNUM(AVALANCHE_INT_END_SECONDARY); i++)
1147 + if (status & 1<<i)
1149 + /* clear secondary interrupt */
1150 + avalanche_hw0_ecregs->excr = 1 << i;
1157 + /* clear the universal secondary interrupt */
1158 + avalanche_hw0_icregs->intcr1 = 1 << uni_secondary_interrupt;
1164 + /* Suraj Add code to clear secondary interrupt */
1167 + action = hw0_irq_action_secondary[irq];
1169 + action = hw0_irq_action_primary[irq];
1171 + /* if action == NULL, then we don't have a handler for the irq */
1173 + if ( action == NULL ) {
1174 + printk("No handler for hw0 irq: %i\n", irq);
1178 + irq_enter(cpu,irq);
1181 + kstat.irqs[0][(irq + AVINTNUM(AVALANCHE_INT_END_PRIMARY)) + 8]++;
1182 + action->handler((irq + AVALANCHE_INT_END_PRIMARY), action->dev_id, regs);
1186 + kstat.irqs[0][irq + 8]++;
1187 + action->handler(LNXINTNUM(irq), action->dev_id, regs);
1190 + irq_exit(cpu,irq);
1192 + if(softirq_pending(cpu))
1198 +void avalanche_int_set(int channel, int line)
1203 + avalanche_hw0_chregs->cintnr0 = line;
1206 + avalanche_hw0_chregs->cintnr1 = line;
1209 + avalanche_hw0_chregs->cintnr2 = line;
1212 + avalanche_hw0_chregs->cintnr3 = line;
1215 + avalanche_hw0_chregs->cintnr4 = line;
1218 + avalanche_hw0_chregs->cintnr5 = line;
1221 + avalanche_hw0_chregs->cintnr6 = line;
1224 + avalanche_hw0_chregs->cintnr7 = line;
1227 + avalanche_hw0_chregs->cintnr8 = line;
1230 + avalanche_hw0_chregs->cintnr9 = line;
1233 + avalanche_hw0_chregs->cintnr10 = line;
1236 + avalanche_hw0_chregs->cintnr11 = line;
1239 + avalanche_hw0_chregs->cintnr12 = line;
1242 + avalanche_hw0_chregs->cintnr13 = line;
1245 + avalanche_hw0_chregs->cintnr14 = line;
1248 + avalanche_hw0_chregs->cintnr15 = line;
1251 + avalanche_hw0_chregs->cintnr16 = line;
1254 + avalanche_hw0_chregs->cintnr17 = line;
1257 + avalanche_hw0_chregs->cintnr18 = line;
1260 + avalanche_hw0_chregs->cintnr19 = line;
1263 + avalanche_hw0_chregs->cintnr20 = line;
1266 + avalanche_hw0_chregs->cintnr21 = line;
1269 + avalanche_hw0_chregs->cintnr22 = line;
1272 + avalanche_hw0_chregs->cintnr23 = line;
1275 + avalanche_hw0_chregs->cintnr24 = line;
1278 + avalanche_hw0_chregs->cintnr25 = line;
1281 + avalanche_hw0_chregs->cintnr26 = line;
1284 + avalanche_hw0_chregs->cintnr27 = line;
1287 + avalanche_hw0_chregs->cintnr28 = line;
1290 + avalanche_hw0_chregs->cintnr29 = line;
1293 + avalanche_hw0_chregs->cintnr30 = line;
1296 + avalanche_hw0_chregs->cintnr31 = line;
1299 + avalanche_hw0_chregs->cintnr32 = line;
1302 + avalanche_hw0_chregs->cintnr33 = line;
1305 + avalanche_hw0_chregs->cintnr34 = line;
1308 + avalanche_hw0_chregs->cintnr35 = line;
1311 + avalanche_hw0_chregs->cintnr36 = line;
1314 + avalanche_hw0_chregs->cintnr37 = line;
1317 + avalanche_hw0_chregs->cintnr38 = line;
1320 + avalanche_hw0_chregs->cintnr39 = line;
1323 + printk("Error: Unknown Avalanche interrupt channel\n");
1326 + line_to_channel[line] = channel; /* Suraj check */
1328 + if (channel == UNIFIED_SECONDARY_INTERRUPT)
1329 + uni_secondary_interrupt = line;
1332 diff -urN kernel-base/arch/mips/ar7/Makefile kernel-tmp2/arch/mips/ar7/Makefile
1333 --- kernel-base/arch/mips/ar7/Makefile 1970-01-01 01:00:00.000000000 +0100
1334 +++ kernel-tmp2/arch/mips/ar7/Makefile 2005-07-10 06:40:39.586266560 +0200
1337 +# Copyright (C) $Date$ $Author$
1339 +# This program is free software; you can redistribute it and/or modify
1340 +# it under the terms of the GNU General Public License as published by
1341 +# the Free Software Foundation; either version 2 of the License, or
1342 +# (at your option) any later version.
1344 +# This program is distributed in the hope that it will be useful,
1345 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1346 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1347 +# GNU General Public License for more details.
1349 +# You should have received a copy of the GNU General Public License
1350 +# along with this program; if not, write to the Free Software
1351 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1354 + $(CPP) $(AFLAGS) $< -o $*.s
1357 + $(CC) $(AFLAGS) -c $< -o $*.o
1361 +export-objs := init.o
1362 +obj-y := setup.o irq.o mipsIRQ.o reset.o init.o memory.o printf.o cmdline.o time.o
1364 +include $(TOPDIR)/Rules.make
1365 diff -urN kernel-base/arch/mips/ar7/memory.c kernel-tmp2/arch/mips/ar7/memory.c
1366 --- kernel-base/arch/mips/ar7/memory.c 1970-01-01 01:00:00.000000000 +0100
1367 +++ kernel-tmp2/arch/mips/ar7/memory.c 2005-07-10 06:40:39.586266560 +0200
1370 + * Carsten Langgaard, carstenl@mips.com
1371 + * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
1373 + * ########################################################################
1375 + * This program is free software; you can distribute it and/or modify it
1376 + * under the terms of the GNU General Public License (Version 2) as
1377 + * published by the Free Software Foundation.
1379 + * This program is distributed in the hope it will be useful, but WITHOUT
1380 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1381 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1382 + * for more details.
1384 + * You should have received a copy of the GNU General Public License along
1385 + * with this program; if not, write to the Free Software Foundation, Inc.,
1386 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1388 + * ########################################################################
1390 + * PROM library functions for acquiring/using memory descriptors given to
1391 + * us from the YAMON.
1394 +#include <linux/config.h>
1395 +#include <linux/init.h>
1396 +#include <linux/mm.h>
1397 +#include <linux/bootmem.h>
1399 +#include <asm/bootinfo.h>
1400 +#include <asm/page.h>
1401 +#include <asm/mips-boards/prom.h>
1402 +#include <asm/ar7/ar7.h>
1404 +enum yamon_memtypes {
1409 +struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS];
1411 +/* References to section boundaries */
1414 +#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
1417 +struct prom_pmemblock * __init prom_getmdesc(void)
1419 + char *memsize_str;
1420 + unsigned int memsize;
1422 + memsize_str = prom_getenv("memsize");
1423 + if (!memsize_str) {
1424 + memsize = 0x02000000;
1426 + memsize = simple_strtol(memsize_str, NULL, 0);
1429 + memset(mdesc, 0, sizeof(mdesc));
1431 + mdesc[0].type = yamon_dontuse;
1432 + mdesc[0].base = 0x00000000;
1433 + mdesc[0].size = CONFIG_AR7_MEMORY;
1435 + mdesc[1].type = yamon_prom;
1436 + mdesc[1].base = CONFIG_AR7_MEMORY;
1437 + mdesc[1].size = 0x00020000;
1439 + mdesc[2].type = yamon_free;
1440 + mdesc[2].base = CONFIG_AR7_MEMORY + 0x00020000;
1441 + mdesc[2].size = (memsize + CONFIG_AR7_MEMORY) - mdesc[2].base;
1446 +static int __init prom_memtype_classify (unsigned int type)
1450 + return BOOT_MEM_RAM;
1452 + return BOOT_MEM_ROM_DATA;
1454 + return BOOT_MEM_RESERVED;
1458 +void __init prom_meminit(void)
1460 + struct prom_pmemblock *p;
1462 + p = prom_getmdesc();
1466 + unsigned long base, size;
1468 + type = prom_memtype_classify (p->type);
1472 + add_memory_region(base, size, type);
1477 +void __init prom_free_prom_memory (void)
1480 + unsigned long freed = 0;
1481 + unsigned long addr;
1483 + for (i = 0; i < boot_mem_map.nr_map; i++) {
1484 + if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA)
1487 + addr = boot_mem_map.map[i].addr;
1488 + while (addr < boot_mem_map.map[i].addr
1489 + + boot_mem_map.map[i].size) {
1490 + ClearPageReserved(virt_to_page(__va(addr)));
1491 + set_page_count(virt_to_page(__va(addr)), 1);
1492 + free_page((unsigned long)__va(addr));
1493 + addr += PAGE_SIZE;
1494 + freed += PAGE_SIZE;
1497 + printk("Freeing prom memory: %ldkb freed\n", freed >> 10);
1499 diff -urN kernel-base/arch/mips/ar7/mipsIRQ.S kernel-tmp2/arch/mips/ar7/mipsIRQ.S
1500 --- kernel-base/arch/mips/ar7/mipsIRQ.S 1970-01-01 01:00:00.000000000 +0100
1501 +++ kernel-tmp2/arch/mips/ar7/mipsIRQ.S 2005-07-10 06:40:39.587266408 +0200
1504 + * Carsten Langgaard, carstenl@mips.com
1505 + * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved.
1507 + * ########################################################################
1509 + * This program is free software; you can distribute it and/or modify it
1510 + * under the terms of the GNU General Public License (Version 2) as
1511 + * published by the Free Software Foundation.
1513 + * This program is distributed in the hope it will be useful, but WITHOUT
1514 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1515 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1516 + * for more details.
1518 + * You should have received a copy of the GNU General Public License along
1519 + * with this program; if not, write to the Free Software Foundation, Inc.,
1520 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1522 + * ########################################################################
1524 + * Interrupt exception dispatch code.
1527 +#include <linux/config.h>
1529 +#include <asm/asm.h>
1530 +#include <asm/mipsregs.h>
1531 +#include <asm/regdef.h>
1532 +#include <asm/stackframe.h>
1534 +/* A lot of complication here is taken away because:
1536 + * 1) We handle one interrupt and return, sitting in a loop and moving across
1537 + * all the pending IRQ bits in the cause register is _NOT_ the answer, the
1538 + * common case is one pending IRQ so optimize in that direction.
1540 + * 2) We need not check against bits in the status register IRQ mask, that
1541 + * would make this routine slow as hell.
1543 + * 3) Linux only thinks in terms of all IRQs on or all IRQs off, nothing in
1544 + * between like BSD spl() brain-damage.
1546 + * Furthermore, the IRQs on the MIPS board look basically (barring software
1547 + * IRQs which we don't use at all and all external interrupt sources are
1548 + * combined together on hardware interrupt 0 (MIPS IRQ 2)) like:
1552 + * 0 Software (ignored)
1553 + * 1 Software (ignored)
1554 + * 2 Combined hardware interrupt (hw0)
1555 + * 3 Hardware (ignored)
1556 + * 4 Hardware (ignored)
1557 + * 5 Hardware (ignored)
1558 + * 6 Hardware (ignored)
1559 + * 7 R4k timer (what we use)
1561 + * Note: On the SEAD board thing are a little bit different.
1562 + * Here IRQ 2 (hw0) is wired to the UART0 and IRQ 3 (hw1) is wired
1565 + * We handle the IRQ according to _our_ priority which is:
1567 + * Highest ---- R4k Timer
1568 + * Lowest ---- Combined hardware interrupt
1570 + * then we just return, if multiple IRQs are pending then we will just take
1571 + * another exception, big deal.
1578 +NESTED(mipsIRQ, PT_SIZE, sp)
1583 + mfc0 s0, CP0_CAUSE # get irq bits
1585 + /* First we check for r4k counter/timer IRQ. */
1586 + andi a0, s0, CAUSEF_IP7
1588 + andi a0, s0, CAUSEF_IP2 # delay slot, check hw0 interrupt
1590 + /* Wheee, a timer interrupt. */
1592 + jal ar7_timer_interrupt
1599 + beq a0, zero, 1f # delay slot, check hw3 interrupt
1602 + /* Wheee, combined hardware level zero interrupt. */
1603 + jal avalanche_hw0_irqdispatch
1604 + move a0, sp # delay slot
1611 + * Here by mistake? This is possible, what can happen is that by the
1612 + * time we take the exception the IRQ pin goes low, so just leave if
1613 + * this is the case.
1616 + PRINT("Got interrupt: c0_cause = %08x\n")
1618 + PRINT("c0_epc = %08x\n")
1623 diff -urN kernel-base/arch/mips/ar7/printf.c kernel-tmp2/arch/mips/ar7/printf.c
1624 --- kernel-base/arch/mips/ar7/printf.c 1970-01-01 01:00:00.000000000 +0100
1625 +++ kernel-tmp2/arch/mips/ar7/printf.c 2005-07-10 06:40:39.587266408 +0200
1628 + * Carsten Langgaard, carstenl@mips.com
1629 + * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
1631 + * This program is free software; you can distribute it and/or modify it
1632 + * under the terms of the GNU General Public License (Version 2) as
1633 + * published by the Free Software Foundation.
1635 + * This program is distributed in the hope it will be useful, but WITHOUT
1636 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1637 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1638 + * for more details.
1640 + * You should have received a copy of the GNU General Public License along
1641 + * with this program; if not, write to the Free Software Foundation, Inc.,
1642 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1644 + * Putting things on the screen/serial line using Adam2 facilities.
1647 +#include <linux/config.h>
1648 +#include <linux/init.h>
1649 +#include <linux/kernel.h>
1650 +#include <linux/serial_reg.h>
1651 +#include <linux/spinlock.h>
1652 +#include <asm/io.h>
1653 +#include <asm/serial.h>
1654 +#include <asm/addrspace.h>
1655 +#include <asm/ar7/ar7.h>
1657 +#define AVALANCHE_YAMON_FUNCTION_BASE (KSEG1ADDR(0x10000500))
1658 +#define AVALANCHE_YAMON_PROM_PRINT_COUNT_ADDR (AVALANCHE_YAMON_FUNCTION_BASE + 0x4) /* print_count function */
1660 +static char ppbuf[1024];
1662 +void (*prom_print_str)(unsigned int out, char *s, int len);
1664 +void prom_printf(char *fmt, ...) __init;
1665 +void prom_printf(char *fmt, ...)
1669 + prom_print_str = (void *)*(unsigned int *)AVALANCHE_YAMON_PROM_PRINT_COUNT_ADDR;
1671 + va_start(args, fmt);
1672 + vsprintf(ppbuf, fmt, args);
1673 + len = strlen(ppbuf);
1675 + prom_print_str(1, ppbuf, len);
1681 diff -urN kernel-base/arch/mips/ar7/reset.c kernel-tmp2/arch/mips/ar7/reset.c
1682 --- kernel-base/arch/mips/ar7/reset.c 1970-01-01 01:00:00.000000000 +0100
1683 +++ kernel-tmp2/arch/mips/ar7/reset.c 2005-07-10 06:40:39.587266408 +0200
1686 + * Carsten Langgaard, carstenl@mips.com
1687 + * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
1689 + * ########################################################################
1691 + * This program is free software; you can distribute it and/or modify it
1692 + * under the terms of the GNU General Public License (Version 2) as
1693 + * published by the Free Software Foundation.
1695 + * This program is distributed in the hope it will be useful, but WITHOUT
1696 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1697 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1698 + * for more details.
1700 + * You should have received a copy of the GNU General Public License along
1701 + * with this program; if not, write to the Free Software Foundation, Inc.,
1702 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1704 + * ########################################################################
1706 + * Reset the MIPS boards.
1709 +#include <linux/config.h>
1711 +#include <asm/reboot.h>
1712 +#include <asm/mips-boards/generic.h>
1714 +static void ar7_machine_restart(char *command);
1715 +static void ar7_machine_halt(void);
1716 +static void ar7_machine_power_off(void);
1718 +static void ar7_machine_restart(char *command)
1723 +static void ar7_machine_halt(void)
1728 +static void ar7_machine_power_off(void)
1733 +void ar7_reboot_setup(void)
1735 + _machine_restart = ar7_machine_restart;
1736 + _machine_halt = ar7_machine_halt;
1737 + _machine_power_off = ar7_machine_power_off;
1739 diff -urN kernel-base/arch/mips/ar7/setup.c kernel-tmp2/arch/mips/ar7/setup.c
1740 --- kernel-base/arch/mips/ar7/setup.c 1970-01-01 01:00:00.000000000 +0100
1741 +++ kernel-tmp2/arch/mips/ar7/setup.c 2005-07-10 06:40:39.588266256 +0200
1744 + * Carsten Langgaard, carstenl@mips.com
1745 + * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
1747 + * This program is free software; you can distribute it and/or modify it
1748 + * under the terms of the GNU General Public License (Version 2) as
1749 + * published by the Free Software Foundation.
1751 + * This program is distributed in the hope it will be useful, but WITHOUT
1752 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1753 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1754 + * for more details.
1756 + * You should have received a copy of the GNU General Public License along
1757 + * with this program; if not, write to the Free Software Foundation, Inc.,
1758 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1760 +#include <linux/config.h>
1761 +#include <linux/init.h>
1762 +#include <linux/sched.h>
1763 +#include <linux/mc146818rtc.h>
1764 +#include <linux/ioport.h>
1766 +#include <asm/cpu.h>
1767 +#include <asm/bootinfo.h>
1768 +#include <asm/irq.h>
1769 +#include <asm/mips-boards/generic.h>
1770 +#include <asm/mips-boards/prom.h>
1772 +#include <asm/dma.h>
1773 +#include <asm/time.h>
1774 +#include <asm/traps.h>
1777 +extern void rs_kgdb_hook(int);
1778 +int remote_debug = 0;
1781 +extern struct rtc_ops no_rtc_ops;
1783 +extern void ar7_reboot_setup(void);
1785 +extern void ar7_time_init(void);
1786 +extern void ar7_timer_setup(struct irqaction *irq);
1788 +const char *get_system_type(void)
1790 + return "Texas Instruments AR7";
1793 +void __init ar7_setup(void)
1796 + int rs_putDebugChar(char);
1797 + char rs_getDebugChar(void);
1798 + extern int (*generic_putDebugChar)(char);
1799 + extern char (*generic_getDebugChar)(void);
1802 +#ifdef CONFIG_SERIAL_CONSOLE
1803 + argptr = prom_getcmdline();
1804 + if ((argptr = strstr(argptr, "console=")) == NULL) {
1809 + s = prom_getenv("modetty0");
1810 + strcpy(console, "38400");
1813 + while (s[i] >= '0' && s[i] <= '9')
1817 + strncpy(console, s, i);
1822 + argptr = prom_getcmdline();
1823 + strcat(argptr, " console=ttyS0,");
1824 + strcat(argptr, console);
1829 + argptr = prom_getcmdline();
1830 + if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) {
1832 + argptr += strlen("kgdb=ttyS");
1833 + if (*argptr != '0' && *argptr != '1')
1834 + printk("KGDB: Uknown serial line /dev/ttyS%c, "
1835 + "falling back to /dev/ttyS1\n", *argptr);
1836 + line = *argptr == '0' ? 0 : 1;
1837 + printk("KGDB: Using serial line /dev/ttyS%d for session\n",
1840 + rs_kgdb_hook(line);
1841 + generic_putDebugChar = rs_putDebugChar;
1842 + generic_getDebugChar = rs_getDebugChar;
1844 + prom_printf("KGDB: Using serial line /dev/ttyS%d for session, "
1845 + "please connect your debugger\n", line ? 1 : 0);
1848 + /* Breakpoints are in init_IRQ() */
1852 + argptr = prom_getcmdline();
1853 + if ((argptr = strstr(argptr, "nofpu")) != NULL)
1854 + cpu_data[0].options &= ~MIPS_CPU_FPU;
1856 + rtc_ops = &no_rtc_ops;
1858 + ar7_reboot_setup();
1860 + board_time_init = ar7_time_init;
1861 + board_timer_setup = ar7_timer_setup;
1863 diff -urN kernel-base/arch/mips/ar7/time.c kernel-tmp2/arch/mips/ar7/time.c
1864 --- kernel-base/arch/mips/ar7/time.c 1970-01-01 01:00:00.000000000 +0100
1865 +++ kernel-tmp2/arch/mips/ar7/time.c 2005-07-10 06:40:39.588266256 +0200
1868 + * Carsten Langgaard, carstenl@mips.com
1869 + * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
1871 + * ########################################################################
1873 + * This program is free software; you can distribute it and/or modify it
1874 + * under the terms of the GNU General Public License (Version 2) as
1875 + * published by the Free Software Foundation.
1877 + * This program is distributed in the hope it will be useful, but WITHOUT
1878 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1879 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1880 + * for more details.
1882 + * You should have received a copy of the GNU General Public License along
1883 + * with this program; if not, write to the Free Software Foundation, Inc.,
1884 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1886 + * ########################################################################
1888 + * Setting up the clock on the MIPS boards.
1892 +#include <linux/types.h>
1893 +#include <linux/config.h>
1894 +#include <linux/init.h>
1895 +#include <linux/kernel_stat.h>
1896 +#include <linux/sched.h>
1897 +#include <linux/spinlock.h>
1899 +#include <asm/mipsregs.h>
1900 +#include <asm/ptrace.h>
1901 +#include <asm/hardirq.h>
1902 +#include <asm/div64.h>
1904 +#include <linux/interrupt.h>
1905 +#include <linux/mc146818rtc.h>
1906 +#include <linux/timex.h>
1908 +#include <asm/mips-boards/generic.h>
1909 +#include <asm/mips-boards/prom.h>
1910 +#include <asm/ar7/ar7.h>
1912 +extern asmlinkage void mipsIRQ(void);
1914 +static unsigned long r4k_offset; /* Amount to increment compare reg each time */
1915 +static unsigned long r4k_cur; /* What counter should be at next timer irq */
1917 +#define MIPS_CPU_TIMER_IRQ 7
1918 +#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
1920 +static inline void ack_r4ktimer(unsigned long newval)
1922 + write_c0_compare(newval);
1925 +void ar7_timer_interrupt(struct pt_regs *regs)
1927 + int cpu = smp_processor_id();
1929 + irq_enter(cpu, MIPS_CPU_TIMER_IRQ);
1931 + if (r4k_offset == 0)
1935 + kstat.irqs[cpu][MIPS_CPU_TIMER_IRQ]++;
1937 + r4k_cur += r4k_offset;
1938 + ack_r4ktimer(r4k_cur);
1940 + } while (((unsigned long)read_c0_count()
1941 + - r4k_cur) < 0x7fffffff);
1943 + irq_exit(cpu, MIPS_CPU_TIMER_IRQ);
1945 + if (softirq_pending(cpu))
1955 + * Figure out the r4k offset, the amount to increment the compare
1956 + * register for each time tick.
1958 +static unsigned long __init cal_r4koff(void)
1960 + return ((CONFIG_AR7_CPU_FREQUENCY*500000)/HZ);
1963 +void __init ar7_time_init(void)
1965 + unsigned long flags;
1966 + unsigned int est_freq;
1968 + set_except_vector(0, mipsIRQ);
1969 + write_c0_count(0);
1971 + printk("calculating r4koff... ");
1972 + r4k_offset = cal_r4koff();
1973 + printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);
1975 + est_freq = 2*r4k_offset*HZ;
1976 + est_freq += 5000; /* round */
1977 + est_freq -= est_freq%10000;
1978 + printk("CPU frequency %d.%02d MHz\n", est_freq/1000000,
1979 + (est_freq%1000000)*100/1000000);
1982 +void __init ar7_timer_setup(struct irqaction *irq)
1984 + /* we are using the cpu counter for timer interrupts */
1985 + irq->handler = no_action; /* we use our own handler */
1986 + setup_irq(MIPS_CPU_TIMER_IRQ, irq);
1988 + r4k_cur = (read_c0_count() + r4k_offset);
1989 + write_c0_compare(r4k_cur);
1990 + set_c0_status(ALLINTS);
1992 diff -urN kernel-base/arch/mips/config-shared.in kernel-tmp2/arch/mips/config-shared.in
1993 --- kernel-base/arch/mips/config-shared.in 2005-07-10 03:00:44.784181376 +0200
1994 +++ kernel-tmp2/arch/mips/config-shared.in 2005-07-10 06:40:39.589266104 +0200
1996 mainmenu_option next_comment
1997 comment 'Machine selection'
1998 dep_bool 'Support for Acer PICA 1 chipset (EXPERIMENTAL)' CONFIG_ACER_PICA_61 $CONFIG_EXPERIMENTAL
1999 +dep_bool 'Support for Texas Instruments AR7 (EXPERIMENTAL)' CONFIG_AR7 $CONFIG_MIPS32 $CONFIG_EXPERIMENTAL
2000 +if [ "$CONFIG_AR7" = "y" ]; then
2001 + choice 'Texas Instruments Reference Platform' \
2002 + "AR7DB CONFIG_AR7DB \
2003 + AR7RD CONFIG_AR7RD \
2004 + AR7WRD CONFIG_AR7WRD" AR7DB
2005 + int 'Texas Instruments AR7 CPU Frequency' CONFIG_AR7_CPU_FREQUENCY 150
2006 + int 'Texas Instruments AR7 System Frequency' CONFIG_AR7_SYS_FREQUENCY 125
2007 + hex 'Texas Instruments AR7 SDRAM Start' CONFIG_AR7_MEMORY 0x14000000
2009 dep_bool 'Support for Alchemy Bosporus board' CONFIG_MIPS_BOSPORUS $CONFIG_MIPS32
2010 dep_bool 'Support for FIC Multimedia Player board' CONFIG_MIPS_FICMMP $CONFIG_MIPS32
2011 dep_bool 'Support for Alchemy Mirage board' CONFIG_MIPS_MIRAGE $CONFIG_MIPS32
2012 @@ -239,6 +249,11 @@
2013 define_bool CONFIG_NONCOHERENT_IO y
2014 define_bool CONFIG_PC_KEYB y
2016 +if [ "$CONFIG_AR7" = "y" ]; then
2017 + define_bool CONFIG_NONCOHERENT_IO y
2018 + define_bool CONFIG_SWAP_IO_SPACE y
2019 + define_bool CONFIG_AR7_PAGING y
2021 if [ "$CONFIG_CASIO_E55" = "y" ]; then
2022 define_bool CONFIG_IRQ_CPU y
2023 define_bool CONFIG_NONCOHERENT_IO y
2025 mainmenu_option next_comment
2026 comment 'General setup'
2027 if [ "$CONFIG_ACER_PICA_61" = "y" -o \
2028 + "$CONFIG_AR7" = "y" -o \
2029 "$CONFIG_CASIO_E55" = "y" -o \
2030 "$CONFIG_DDB5074" = "y" -o \
2031 "$CONFIG_DDB5476" = "y" -o \
2033 bool 'Networking support' CONFIG_NET
2035 if [ "$CONFIG_ACER_PICA_61" = "y" -o \
2036 + "$CONFIG_AR7" = "y" -o \
2037 "$CONFIG_CASIO_E55" = "y" -o \
2038 "$CONFIG_DECSTATION" = "y" -o \
2039 "$CONFIG_IBM_WORKPAD" = "y" -o \
2040 diff -urN kernel-base/arch/mips/kernel/irq.c kernel-tmp2/arch/mips/kernel/irq.c
2041 --- kernel-base/arch/mips/kernel/irq.c 2005-07-10 03:00:44.784181376 +0200
2042 +++ kernel-tmp2/arch/mips/kernel/irq.c 2005-07-10 06:40:39.589266104 +0200
2044 * Generic, controller-independent functions:
2048 int get_irq_list(char *buf)
2052 p += sprintf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
2058 int global_irq_holder = NO_PROC_ID;
2064 int request_irq(unsigned int irq,
2065 void (*handler)(int, void *, struct pt_regs *),
2066 unsigned long irqflags,
2074 * free_irq - free an interrupt
2080 void free_irq(unsigned int irq, void *dev_id)
2090 * IRQ autodetection code..
2091 diff -urN kernel-base/arch/mips/kernel/setup.c kernel-tmp2/arch/mips/kernel/setup.c
2092 --- kernel-base/arch/mips/kernel/setup.c 2005-07-10 03:00:44.785181224 +0200
2093 +++ kernel-tmp2/arch/mips/kernel/setup.c 2005-07-10 06:40:39.590265952 +0200
2095 unsigned long isa_slot_offset;
2096 EXPORT_SYMBOL(isa_slot_offset);
2098 +extern void avalanche_bootmem_init(void);
2099 extern void SetUpBootInfo(void);
2100 extern void load_mmu(void);
2101 extern asmlinkage void start_kernel(void);
2103 #endif /* CONFIG_BLK_DEV_INITRD */
2105 /* Find the highest page frame number we have available. */
2106 +#ifdef CONFIG_AR7_PAGING
2107 + avalanche_bootmem_init();
2110 first_usable_pfn = -1UL;
2111 for (i = 0; i < boot_mem_map.nr_map; i++) {
2113 /* Reserve the bootmap memory. */
2114 reserve_bootmem(PFN_PHYS(first_usable_pfn), bootmap_size);
2117 #ifdef CONFIG_BLK_DEV_INITRD
2118 /* Board specific code should have set up initrd_start and initrd_end */
2119 ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
2121 void hp_setup(void);
2122 void au1x00_setup(void);
2123 void frame_info_init(void);
2124 + void ar7_setup(void);
2127 #if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_FD_MODULE)
2128 @@ -691,6 +697,11 @@
2129 pmc_yosemite_setup();
2133 + case MACH_GROUP_UNKNOWN:
2138 panic("Unsupported architecture");
2140 diff -urN kernel-base/arch/mips/kernel/traps.c kernel-tmp2/arch/mips/kernel/traps.c
2141 --- kernel-base/arch/mips/kernel/traps.c 2005-07-10 03:00:44.786181072 +0200
2142 +++ kernel-tmp2/arch/mips/kernel/traps.c 2005-07-10 06:40:39.591265800 +0200
2144 #include <asm/uaccess.h>
2145 #include <asm/mmu_context.h>
2148 +#include <asm/ar7/ar7.h>
2151 extern asmlinkage void handle_mod(void);
2152 extern asmlinkage void handle_tlbl(void);
2153 extern asmlinkage void handle_tlbs(void);
2154 @@ -869,9 +873,15 @@
2156 exception_handlers[n] = handler;
2157 if (n == 0 && cpu_has_divec) {
2159 + *(volatile u32 *)(AVALANCHE_VECS_KSEG0+0x200) = 0x08000000 |
2160 + (0x03ffffff & (handler >> 2));
2161 + flush_icache_range(AVALANCHE_VECS_KSEG0+0x200, AVALANCHE_VECS_KSEG0 + 0x204);
2163 *(volatile u32 *)(KSEG0+0x200) = 0x08000000 |
2164 (0x03ffffff & (handler >> 2));
2165 flush_icache_range(KSEG0+0x200, KSEG0 + 0x204);
2168 return (void *)old_handler;
2170 @@ -920,14 +930,46 @@
2171 void __init trap_init(void)
2173 extern char except_vec1_generic;
2174 + extern char except_vec2_generic;
2175 extern char except_vec3_generic, except_vec3_r4000;
2176 extern char except_vec_ejtag_debug;
2177 extern char except_vec4;
2181 + extern char jump_tlb_miss, jump_tlb_miss_unused;
2182 + extern char jump_cache_error,jump_general_exception;
2183 + extern char jump_dedicated_interrupt;
2184 + clear_c0_status(ST0_BEV);
2187 /* Copy the generic exception handler code to it's final destination. */
2188 memcpy((void *)(KSEG0 + 0x80), &except_vec1_generic, 0x80);
2189 + memcpy((void *)(KSEG0 + 0x100), &except_vec2_generic, 0x80);
2190 + memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80);
2192 + memcpy((void *)(KSEG0 + 0x0), &jump_tlb_miss, 0x80);
2193 + memcpy((void *)(KSEG0 + 0x80), &jump_tlb_miss_unused, 0x80);
2194 + memcpy((void *)(KSEG0 + 0x100), &jump_cache_error, 0x80);
2195 + memcpy((void *)(KSEG0 + 0x180), &jump_general_exception, 0x80);
2196 + memcpy((void *)(KSEG0 + 0x200), &jump_dedicated_interrupt, 0x80);
2199 + memcpy((void *)(AVALANCHE_VECS_KSEG0 + 0x80), &except_vec1_generic, 0x80);
2200 + memcpy((void *)(AVALANCHE_VECS_KSEG0 + 0x100), &except_vec2_generic, 0x80);
2201 + memcpy((void *)(AVALANCHE_VECS_KSEG0 + 0x180), &except_vec3_generic, 0x80);
2202 + flush_icache_range(AVALANCHE_VECS_KSEG0, AVALANCHE_VECS_KSEG0 + 0x200);
2204 + memcpy((void *)(KSEG0 + 0x0), &jump_tlb_miss, 0x80);
2205 + memcpy((void *)(KSEG0 + 0x80), &jump_tlb_miss_unused, 0x80);
2206 + memcpy((void *)(KSEG0 + 0x100), &jump_cache_error, 0x80);
2207 + memcpy((void *)(KSEG0 + 0x180), &jump_general_exception, 0x80);
2208 + memcpy((void *)(KSEG0 + 0x200), &jump_dedicated_interrupt, 0x80);
2210 + memcpy((void *)(KSEG0 + 0x80), &except_vec1_generic, 0x80);
2212 + flush_icache_range(KSEG0 + 0x80, KSEG0 + 0x200);
2215 * Setup default vectors
2217 @@ -951,8 +993,12 @@
2218 * Some MIPS CPUs have a dedicated interrupt vector which reduces the
2219 * interrupt processing overhead. Use it where available.
2222 + memcpy((void *)(AVALANCHE_VECS_KSEG0 + 0x200), &except_vec4, 8);
2225 memcpy((void *)(KSEG0 + 0x200), &except_vec4, 8);
2229 * Some CPUs can enable/disable for cache parity detection, but does
2230 @@ -991,12 +1037,17 @@
2232 set_except_vector(24, handle_mcheck);
2234 +memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80);
2236 + memcpy((void *)(AVALANCHE_VECS_KSEG0 + 0x180), &except_vec3_generic, 0x80);
2239 memcpy((void *)(KSEG0 + 0x180), &except_vec3_r4000, 0x80);
2240 else if (cpu_has_4kex)
2241 memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80);
2243 memcpy((void *)(KSEG0 + 0x080), &except_vec3_generic, 0x80);
2246 if (current_cpu_data.cputype == CPU_R6000 ||
2247 current_cpu_data.cputype == CPU_R6000A) {
2248 @@ -1023,7 +1074,11 @@
2249 if (board_nmi_handler_setup)
2250 board_nmi_handler_setup();
2253 + flush_icache_range(AVALANCHE_VECS_KSEG0, AVALANCHE_VECS_KSEG0 + 0x200);
2255 flush_icache_range(KSEG0, KSEG0 + 0x400);
2258 per_cpu_trap_init();
2260 diff -urN kernel-base/arch/mips/lib/promlib.c kernel-tmp2/arch/mips/lib/promlib.c
2261 --- kernel-base/arch/mips/lib/promlib.c 2005-07-10 03:00:44.786181072 +0200
2262 +++ kernel-tmp2/arch/mips/lib/promlib.c 2005-07-10 06:40:39.591265800 +0200
2266 #include <linux/kernel.h>
2273 diff -urN kernel-base/arch/mips/Makefile kernel-tmp2/arch/mips/Makefile
2274 --- kernel-base/arch/mips/Makefile 2005-07-10 03:00:44.786181072 +0200
2275 +++ kernel-tmp2/arch/mips/Makefile 2005-07-10 06:40:39.591265800 +0200
2276 @@ -369,6 +369,16 @@
2280 +# Texas Instruments AR7
2284 +LIBS += arch/mips/ar7/ar7.o arch/mips/ar7/ar7/ar7.o
2285 +SUBDIRS += arch/mips/ar7 arch/mips/ar7/ar7
2286 +LOADADDR += 0x94020000
2292 ifdef CONFIG_DECSTATION
2293 diff -urN kernel-base/arch/mips/mm/init.c kernel-tmp2/arch/mips/mm/init.c
2294 --- kernel-base/arch/mips/mm/init.c 2005-07-10 03:00:44.787180920 +0200
2295 +++ kernel-tmp2/arch/mips/mm/init.c 2005-07-10 07:09:29.914216728 +0200
2298 mmu_gather_t mmu_gathers[NR_CPUS];
2299 unsigned long highstart_pfn, highend_pfn;
2300 +#ifndef CONFIG_AR7_PAGING
2301 static unsigned long totalram_pages;
2302 static unsigned long totalhigh_pages;
2305 void pgd_init(unsigned long page)
2311 +#ifndef CONFIG_AR7_PAGING
2312 void __init paging_init(void)
2314 unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
2317 free_area_init(zones_size);
2321 #define PFN_UP(x) (((x) + PAGE_SIZE - 1) >> PAGE_SHIFT)
2322 #define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
2327 +#ifndef CONFIG_AR7_PAGING
2328 void __init mem_init(void)
2330 unsigned long codesize, reservedpages, datasize, initsize;
2333 (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)));
2337 #ifdef CONFIG_BLK_DEV_INITRD
2338 void free_initrd_mem(unsigned long start, unsigned long end)
2343 +#ifndef CONFIG_AR7_PAGING
2344 extern char __init_begin, __init_end;
2345 extern void prom_free_prom_memory(void) __init;
2352 prom_free_prom_memory ();
2355 addr = (unsigned long) &__init_begin;
2356 while (addr < (unsigned long) &__init_end) {
2362 diff -urN kernel-base/arch/mips/mm/tlb-r4k.c kernel-tmp2/arch/mips/mm/tlb-r4k.c
2363 --- kernel-base/arch/mips/mm/tlb-r4k.c 2005-07-10 03:00:44.787180920 +0200
2364 +++ kernel-tmp2/arch/mips/mm/tlb-r4k.c 2005-07-10 06:40:39.592265648 +0200
2366 #include <asm/pgtable.h>
2367 #include <asm/system.h>
2370 +#include <asm/ar7/ar7.h>
2373 extern char except_vec0_nevada, except_vec0_r4000, except_vec0_r4600;
2375 /* CP0 hazard avoidance. */
2376 @@ -375,7 +379,12 @@
2377 else if (current_cpu_data.cputype == CPU_R4600)
2378 memcpy((void *)KSEG0, &except_vec0_r4600, 0x80);
2381 + memcpy((void *)AVALANCHE_VECS_KSEG0, &except_vec0_r4000, 0x80);
2382 + flush_icache_range(AVALANCHE_VECS_KSEG0, AVALANCHE_VECS_KSEG0 + 0x80);
2384 memcpy((void *)KSEG0, &except_vec0_r4000, 0x80);
2385 flush_icache_range(KSEG0, KSEG0 + 0x80);
2389 diff -urN kernel-base/drivers/char/serial.c kernel-tmp2/drivers/char/serial.c
2390 --- kernel-base/drivers/char/serial.c 2005-07-10 03:00:44.789180616 +0200
2391 +++ kernel-tmp2/drivers/char/serial.c 2005-07-10 06:42:02.902600552 +0200
2392 @@ -419,7 +419,40 @@
2396 -#if defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_SEAD)
2397 +#if defined(CONFIG_AR7)
2399 +static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
2401 + return (inb(info->port + (offset * 4)) & 0xff);
2405 +static _INLINE_ unsigned int serial_inp(struct async_struct *info, int offset)
2407 +#ifdef CONFIG_SERIAL_NOPAUSE_IO
2408 + return (inb(info->port + (offset * 4)) & 0xff);
2410 + return (inb_p(info->port + (offset * 4)) & 0xff);
2414 +static _INLINE_ void serial_out(struct async_struct *info, int offset, int value)
2416 + outb(value, info->port + (offset * 4));
2420 +static _INLINE_ void serial_outp(struct async_struct *info, int offset,
2423 +#ifdef CONFIG_SERIAL_NOPAUSE_IO
2424 + outb(value, info->port + (offset * 4));
2426 + outb_p(value, info->port + (offset * 4));
2430 +#elif defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_SEAD)
2432 #include <asm/mips-boards/atlas.h>
2434 @@ -478,8 +511,10 @@
2435 * needed for certain old 386 machines, I've left these #define's
2439 #define serial_inp(info, offset) serial_in(info, offset)
2440 #define serial_outp(info, offset, value) serial_out(info, offset, value)
2445 @@ -1728,7 +1763,16 @@
2446 /* Special case since 134 is really 134.5 */
2447 quot = (2*baud_base / 269);
2450 + quot = (CONFIG_AR7_SYS_FREQUENCY*500000) / baud;
2451 + //quot = get_avalanche_vbus_freq() / baud;
2457 quot = baud_base / baud;
2460 /* If the quotient is zero refuse the change */
2461 if (!quot && old_termios) {
2462 @@ -5552,8 +5596,10 @@
2463 state->irq = irq_cannonicalize(state->irq);
2465 state->io_type = SERIAL_IO_HUB6;
2467 if (state->port && check_region(state->port,8))
2471 if ((state->flags & ASYNC_BOOT_ONLYMCA) && !MCA_bus)
2473 @@ -6009,7 +6055,16 @@
2474 info->io_type = state->io_type;
2475 info->iomem_base = state->iomem_base;
2476 info->iomem_reg_shift = state->iomem_reg_shift;
2478 + //quot = get_avalanche_vbus_freq() / baud;
2479 + quot = (CONFIG_AR7_SYS_FREQUENCY*500000) / baud;
2485 quot = state->baud_base / baud;
2487 cval = cflag & (CSIZE | CSTOPB);
2488 #if defined(__powerpc__) || defined(__alpha__)
2490 diff -urN kernel-base/include/asm-mips/ar7/ar7.h kernel-tmp2/include/asm-mips/ar7/ar7.h
2491 --- kernel-base/include/asm-mips/ar7/ar7.h 1970-01-01 01:00:00.000000000 +0100
2492 +++ kernel-tmp2/include/asm-mips/ar7/ar7.h 2005-07-10 06:40:39.622261088 +0200
2496 + * Copyright (C) $Date$ $Author$
2498 + * This program is free software; you can redistribute it and/or modify
2499 + * it under the terms of the GNU General Public License as published by
2500 + * the Free Software Foundation; either version 2 of the License, or
2501 + * (at your option) any later version.
2503 + * This program is distributed in the hope that it will be useful,
2504 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2505 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2506 + * GNU General Public License for more details.
2508 + * You should have received a copy of the GNU General Public License
2509 + * along with this program; if not, write to the Free Software
2510 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2517 +#include <asm/addrspace.h>
2518 +#include <linux/config.h>
2520 +#define AVALANCHE_VECS_KSEG0 (KSEG0ADDR(CONFIG_AR7_MEMORY))
2522 +#define AR7_UART0_REGS_BASE (KSEG1ADDR(0x08610E00))
2523 +#define AR7_UART1_REGS_BASE (KSEG1ADDR(0x08610E00))
2524 +#define AR7_BASE_BAUD ( 3686400 / 16 )
2527 diff -urN kernel-base/include/asm-mips/ar7/avalanche_intc.h kernel-tmp2/include/asm-mips/ar7/avalanche_intc.h
2528 --- kernel-base/include/asm-mips/ar7/avalanche_intc.h 1970-01-01 01:00:00.000000000 +0100
2529 +++ kernel-tmp2/include/asm-mips/ar7/avalanche_intc.h 2005-07-10 06:40:39.622261088 +0200
2532 + * Nitin Dhingra, iamnd@ti.com
2533 + * Copyright (C) 2000 Texas Instruments Inc.
2536 + * ########################################################################
2538 + * This program is free software; you can distribute it and/or modify it
2539 + * under the terms of the GNU General Public License (Version 2) as
2540 + * published by the Free Software Foundation.
2542 + * This program is distributed in the hope it will be useful, but WITHOUT
2543 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2544 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2545 + * for more details.
2547 + * You should have received a copy of the GNU General Public License along
2548 + * with this program; if not, write to the Free Software Foundation, Inc.,
2549 + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
2551 + * ########################################################################
2553 + * Defines of the Sead board specific address-MAP, registers, etc.
2556 +#ifndef _AVALANCHE_INTC_H
2557 +#define _AVALANCHE_INTC_H
2559 +#define MIPS_EXCEPTION_OFFSET 8
2561 +/******************************************************************************
2562 + Avalanche Interrupt number
2563 +******************************************************************************/
2564 +#define AVINTNUM(x) ((x) - MIPS_EXCEPTION_OFFSET)
2566 +/*******************************************************************************
2567 +*Linux Interrupt number
2568 +*******************************************************************************/
2569 +#define LNXINTNUM(x)((x) + MIPS_EXCEPTION_OFFSET)
2573 +#define AVALANCHE_INT_END_PRIMARY (40 + MIPS_EXCEPTION_OFFSET)
2574 +#define AVALANCHE_INT_END_SECONDARY (32 + MIPS_EXCEPTION_OFFSET)
2576 +#define AVALANCHE_INT_END_PRIMARY_REG1 (31 + MIPS_EXCEPTION_OFFSET)
2577 +#define AVALANCHE_INT_END_PRIMARY_REG2 (39 + MIPS_EXCEPTION_OFFSET)
2580 +#define AVALANCHE_INT_END (AVINTNUM(AVALANCHE_INT_END_PRIMARY) + \
2581 + AVINTNUM(AVALANCHE_INT_END_SECONDARY) \
2582 + + MIPS_EXCEPTION_OFFSET - 1) /* Suraj, check */
2586 + * Avalanche interrupt controller register base (primary)
2588 +#define KSEG1_BASE 0xA0000000
2589 +#define KSEG_INV_MASK 0x1FFFFFFF /* Inverted mask for kseg address */
2590 +#define PHYS_ADDR(addr) ((addr) & KSEG_INV_MASK)
2591 +#define PHYS_TO_K1(addr) (PHYS_ADDR(addr)|KSEG1_BASE)
2593 +#define AVALANCHE_ICTRL_REGS_BASE KSEG1ADDR(0x08612400)// AVALANCHE_INTC_BASE
2595 +/******************************************************************************
2596 + * Avalanche exception controller register base (secondary)
2597 + ******************************************************************************/
2598 +#define AVALANCHE_ECTRL_REGS_BASE (AVALANCHE_ICTRL_REGS_BASE + 0x80)
2601 +/******************************************************************************
2602 + * Avalanche Interrupt pacing register base (secondary)
2603 + ******************************************************************************/
2604 +#define AVALANCHE_IPACE_REGS_BASE (AVALANCHE_ICTRL_REGS_BASE + 0xA0)
2608 +/******************************************************************************
2609 + * Avalanche Interrupt Channel Control register base
2610 + *****************************************************************************/
2611 +#define AVALANCHE_CHCTRL_REGS_BASE (AVALANCHE_ICTRL_REGS_BASE + 0x200)
2614 +struct avalanche_ictrl_regs /* Avalanche Interrupt control registers */
2616 + volatile unsigned long intsr1; /* Interrupt Status/Set Register 1 0x00 */
2617 + volatile unsigned long intsr2; /* Interrupt Status/Set Register 2 0x04 */
2618 + volatile unsigned long unused1; /*0x08 */
2619 + volatile unsigned long unused2; /*0x0C */
2620 + volatile unsigned long intcr1; /* Interrupt Clear Register 1 0x10 */
2621 + volatile unsigned long intcr2; /* Interrupt Clear Register 2 0x14 */
2622 + volatile unsigned long unused3; /*0x18 */
2623 + volatile unsigned long unused4; /*0x1C */
2624 + volatile unsigned long intesr1; /* Interrupt Enable (Set) Register 1 0x20 */
2625 + volatile unsigned long intesr2; /* Interrupt Enable (Set) Register 2 0x24 */
2626 + volatile unsigned long unused5; /*0x28 */
2627 + volatile unsigned long unused6; /*0x2C */
2628 + volatile unsigned long intecr1; /* Interrupt Enable Clear Register 1 0x30 */
2629 + volatile unsigned long intecr2; /* Interrupt Enable Clear Register 2 0x34 */
2630 + volatile unsigned long unused7; /* 0x38 */
2631 + volatile unsigned long unused8; /* 0x3c */
2632 + volatile unsigned long pintir; /* Priority Interrupt Index Register 0x40 */
2633 + volatile unsigned long intmsr; /* Priority Interrupt Mask Index Reg 0x44 */
2634 + volatile unsigned long unused9; /* 0x48 */
2635 + volatile unsigned long unused10; /* 0x4C */
2636 + volatile unsigned long intpolr1; /* Interrupt Polarity Mask register 10x50 */
2637 + volatile unsigned long intpolr2; /* Interrupt Polarity Mask register 20x54 */
2638 + volatile unsigned long unused11; /* 0x58 */
2639 + volatile unsigned long unused12; /*0x5C */
2640 + volatile unsigned long inttypr1; /* Interrupt Type Mask register 10x60 */
2641 + volatile unsigned long inttypr2; /* Interrupt Type Mask register 20x64 */
2644 +struct avalanche_exctrl_regs /* Avalanche Exception control registers */
2646 + volatile unsigned long exsr; /* Exceptions Status/Set register 0x80 */
2647 + volatile unsigned long reserved; /*0x84 */
2648 + volatile unsigned long excr; /* Exceptions Clear Register 0x88 */
2649 + volatile unsigned long reserved1; /*0x8c */
2650 + volatile unsigned long exiesr; /* Exceptions Interrupt Enable (set) 0x90 */
2651 + volatile unsigned long reserved2; /*0x94 */
2652 + volatile unsigned long exiecr; /* Exceptions Interrupt Enable(clear)0x98 */
2654 +struct avalanche_ipace_regs
2657 + volatile unsigned long ipacep; /* Interrupt pacing register 0xa0 */
2658 + volatile unsigned long ipacemap; /*Interrupt Pacing Map Register 0xa4 */
2659 + volatile unsigned long ipacemax; /*Interrupt Pacing Max Register 0xa8 */
2661 +struct avalanche_channel_int_number
2663 + volatile unsigned long cintnr0; /* Channel Interrupt Number Register0x200 */
2664 + volatile unsigned long cintnr1; /* Channel Interrupt Number Register0x204 */
2665 + volatile unsigned long cintnr2; /* Channel Interrupt Number Register0x208 */
2666 + volatile unsigned long cintnr3; /* Channel Interrupt Number Register0x20C */
2667 + volatile unsigned long cintnr4; /* Channel Interrupt Number Register0x210 */
2668 + volatile unsigned long cintnr5; /* Channel Interrupt Number Register0x214 */
2669 + volatile unsigned long cintnr6; /* Channel Interrupt Number Register0x218 */
2670 + volatile unsigned long cintnr7; /* Channel Interrupt Number Register0x21C */
2671 + volatile unsigned long cintnr8; /* Channel Interrupt Number Register0x220 */
2672 + volatile unsigned long cintnr9; /* Channel Interrupt Number Register0x224 */
2673 + volatile unsigned long cintnr10; /* Channel Interrupt Number Register0x228 */
2674 + volatile unsigned long cintnr11; /* Channel Interrupt Number Register0x22C */
2675 + volatile unsigned long cintnr12; /* Channel Interrupt Number Register0x230 */
2676 + volatile unsigned long cintnr13; /* Channel Interrupt Number Register0x234 */
2677 + volatile unsigned long cintnr14; /* Channel Interrupt Number Register0x238 */
2678 + volatile unsigned long cintnr15; /* Channel Interrupt Number Register0x23C */
2679 + volatile unsigned long cintnr16; /* Channel Interrupt Number Register0x240 */
2680 + volatile unsigned long cintnr17; /* Channel Interrupt Number Register0x244 */
2681 + volatile unsigned long cintnr18; /* Channel Interrupt Number Register0x248 */
2682 + volatile unsigned long cintnr19; /* Channel Interrupt Number Register0x24C */
2683 + volatile unsigned long cintnr20; /* Channel Interrupt Number Register0x250 */
2684 + volatile unsigned long cintnr21; /* Channel Interrupt Number Register0x254 */
2685 + volatile unsigned long cintnr22; /* Channel Interrupt Number Register0x358 */
2686 + volatile unsigned long cintnr23; /* Channel Interrupt Number Register0x35C */
2687 + volatile unsigned long cintnr24; /* Channel Interrupt Number Register0x260 */
2688 + volatile unsigned long cintnr25; /* Channel Interrupt Number Register0x264 */
2689 + volatile unsigned long cintnr26; /* Channel Interrupt Number Register0x268 */
2690 + volatile unsigned long cintnr27; /* Channel Interrupt Number Register0x26C */
2691 + volatile unsigned long cintnr28; /* Channel Interrupt Number Register0x270 */
2692 + volatile unsigned long cintnr29; /* Channel Interrupt Number Register0x274 */
2693 + volatile unsigned long cintnr30; /* Channel Interrupt Number Register0x278 */
2694 + volatile unsigned long cintnr31; /* Channel Interrupt Number Register0x27C */
2695 + volatile unsigned long cintnr32; /* Channel Interrupt Number Register0x280 */
2696 + volatile unsigned long cintnr33; /* Channel Interrupt Number Register0x284 */
2697 + volatile unsigned long cintnr34; /* Channel Interrupt Number Register0x288 */
2698 + volatile unsigned long cintnr35; /* Channel Interrupt Number Register0x28C */
2699 + volatile unsigned long cintnr36; /* Channel Interrupt Number Register0x290 */
2700 + volatile unsigned long cintnr37; /* Channel Interrupt Number Register0x294 */
2701 + volatile unsigned long cintnr38; /* Channel Interrupt Number Register0x298 */
2702 + volatile unsigned long cintnr39; /* Channel Interrupt Number Register0x29C */
2705 +struct avalanche_interrupt_line_to_channel
2707 + unsigned long int_line0; /* Start of primary interrupts */
2708 + unsigned long int_line1;
2709 + unsigned long int_line2;
2710 + unsigned long int_line3;
2711 + unsigned long int_line4;
2712 + unsigned long int_line5;
2713 + unsigned long int_line6;
2714 + unsigned long int_line7;
2715 + unsigned long int_line8;
2716 + unsigned long int_line9;
2717 + unsigned long int_line10;
2718 + unsigned long int_line11;
2719 + unsigned long int_line12;
2720 + unsigned long int_line13;
2721 + unsigned long int_line14;
2722 + unsigned long int_line15;
2723 + unsigned long int_line16;
2724 + unsigned long int_line17;
2725 + unsigned long int_line18;
2726 + unsigned long int_line19;
2727 + unsigned long int_line20;
2728 + unsigned long int_line21;
2729 + unsigned long int_line22;
2730 + unsigned long int_line23;
2731 + unsigned long int_line24;
2732 + unsigned long int_line25;
2733 + unsigned long int_line26;
2734 + unsigned long int_line27;
2735 + unsigned long int_line28;
2736 + unsigned long int_line29;
2737 + unsigned long int_line30;
2738 + unsigned long int_line31;
2739 + unsigned long int_line32;
2740 + unsigned long int_line33;
2741 + unsigned long int_line34;
2742 + unsigned long int_line35;
2743 + unsigned long int_line36;
2744 + unsigned long int_line37;
2745 + unsigned long int_line38;
2746 + unsigned long int_line39;
2750 +/* Interrupt Line #'s (Sangam peripherals) */
2752 +/*------------------------------*/
2753 +/* Sangam primary interrupts */
2754 +/*------------------------------*/
2756 +#define UNIFIED_SECONDARY_INTERRUPT 0
2757 +#define AVALANCHE_EXT_INT_0 1
2758 +#define AVALANCHE_EXT_INT_1 2
2759 +/* Line #3 Reserved */
2760 +/* Line #4 Reserved */
2761 +#define AVALANCHE_TIMER_0_INT 5
2762 +#define AVALANCHE_TIMER_1_INT 6
2763 +#define AVALANCHE_UART0_INT 7
2764 +#define AVALANCHE_UART1_INT 8
2765 +#define AVALANCHE_PDMA_INT0 9
2766 +#define AVALANCHE_PDMA_INT1 10
2767 +/* Line #11 Reserved */
2768 +/* Line #12 Reserved */
2769 +/* Line #13 Reserved */
2770 +/* Line #14 Reserved */
2771 +#define AVALANCHE_ATM_SAR_INT 15
2772 +/* Line #16 Reserved */
2773 +/* Line #17 Reserved */
2774 +/* Line #18 Reserved */
2775 +#define AVALANCHE_MAC0_INT 19
2776 +/* Line #20 Reserved */
2777 +#define AVALANCHE_VLYNQ0_INT 21
2778 +#define AVALANCHE_CODEC_WAKE_INT 22
2779 +/* Line #23 Reserved */
2780 +#define AVALANCHE_USB_INT 24
2781 +#define AVALANCHE_VLYNQ1_INT 25
2782 +/* Line #26 Reserved */
2783 +/* Line #27 Reserved */
2784 +#define AVALANCHE_MAC1_INT 28
2785 +#define AVALANCHE_I2CM_INT 29
2786 +#define AVALANCHE_PDMA_INT2 30
2787 +#define AVALANCHE_PDMA_INT3 31
2788 +/* Line #32 Reserved */
2789 +/* Line #33 Reserved */
2790 +/* Line #34 Reserved */
2791 +/* Line #35 Reserved */
2792 +/* Line #36 Reserved */
2793 +#define AVALANCHE_VDMA_VT_RX_INT 37
2794 +#define AVALANCHE_VDMA_VT_TX_INT 38
2795 +#define AVALANCHE_ADSLSS_INT 39
2797 +/*-----------------------------------*/
2798 +/* Sangam Secondary Interrupts */
2799 +/*-----------------------------------*/
2800 +#define PRIMARY_INTS 40
2802 +#define EMIF_INT (7 + PRIMARY_INTS)
2805 +extern void avalanche_int_set(int channel, int line);
2808 +#endif /* _AVALANCHE_INTC_H */
2809 diff -urN kernel-base/include/asm-mips/ar7/if_port.h kernel-tmp2/include/asm-mips/ar7/if_port.h
2810 --- kernel-base/include/asm-mips/ar7/if_port.h 1970-01-01 01:00:00.000000000 +0100
2811 +++ kernel-tmp2/include/asm-mips/ar7/if_port.h 2005-07-10 06:40:39.623260936 +0200
2813 +/*******************************************************************************
2814 + * FILE PURPOSE: Interface port id Header file
2815 + *******************************************************************************
2816 + * FILE NAME: if_port.h
2818 + * DESCRIPTION: Header file carrying information about port ids of interfaces
2821 + * (C) Copyright 2003, Texas Instruments, Inc
2822 + ******************************************************************************/
2823 +#ifndef _IF_PORT_H_
2824 +#define _IF_PORT_H_
2826 +#define AVALANCHE_CPMAC_LOW_PORT_ID 0
2827 +#define AVALANCHE_CPMAC_HIGH_PORT_ID 1
2828 +#define AVALANCHE_USB_PORT_ID 2
2829 +#define AVALANCHE_WLAN_PORT_ID 3
2832 +#define AVALANCHE_MARVELL_BASE_PORT_ID 4
2834 +/* The marvell ports occupy port ids from 4 to 8 */
2835 +/* so the next port id number should start at 9 */
2838 +#endif /* _IF_PORT_H_ */
2839 diff -urN kernel-base/include/asm-mips/ar7/sangam_boards.h kernel-tmp2/include/asm-mips/ar7/sangam_boards.h
2840 --- kernel-base/include/asm-mips/ar7/sangam_boards.h 1970-01-01 01:00:00.000000000 +0100
2841 +++ kernel-tmp2/include/asm-mips/ar7/sangam_boards.h 2005-07-10 06:40:39.623260936 +0200
2843 +#ifndef _SANGAM_BOARDS_H
2844 +#define _SANGAM_BOARDS_H
2846 +// Let us define board specific information here.
2849 +#if defined(CONFIG_AR7DB)
2851 +#define AFECLK_FREQ 35328000
2852 +#define REFCLK_FREQ 25000000
2853 +#define OSC3_FREQ 24000000
2854 +#define AVALANCHE_LOW_CPMAC_PHY_MASK 0x80000000
2855 +#define AVALANCHE_HIGH_CPMAC_PHY_MASK 0x55555555
2856 +#define AVALANCHE_LOW_CPMAC_MDIX_MASK 0x80000000
2861 +#if defined(CONFIG_AR7RD)
2862 +#define AFECLK_FREQ 35328000
2863 +#define REFCLK_FREQ 25000000
2864 +#define OSC3_FREQ 24000000
2865 +#define AVALANCHE_LOW_CPMAC_PHY_MASK 0x80000000
2866 +#define AVALANCHE_HIGH_CPMAC_PHY_MASK 0x2
2867 +#define AVALANCHE_LOW_CPMAC_MDIX_MASK 0x80000000
2871 +#if defined(CONFIG_AR7WI)
2872 +#define AFECLK_FREQ 35328000
2873 +#define REFCLK_FREQ 25000000
2874 +#define OSC3_FREQ 24000000
2875 +#define AVALANCHE_LOW_CPMAC_PHY_MASK 0x80000000
2876 +#define AVALANCHE_HIGH_CPMAC_PHY_MASK 0x2
2877 +#define AVALANCHE_LOW_CPMAC_MDIX_MASK 0x80000000
2881 +#if defined(CONFIG_AR7V)
2882 +#define AFECLK_FREQ 35328000
2883 +#define REFCLK_FREQ 25000000
2884 +#define OSC3_FREQ 24000000
2885 +#define AVALANCHE_LOW_CPMAC_PHY_MASK 0x80000000
2886 +#define AVALANCHE_HIGH_CPMAC_PHY_MASK 0x2
2887 +#define AVALANCHE_LOW_CPMAC_MDIX_MASK 0x80000000
2891 +#if defined(CONFIG_AR7WRD)
2892 +#define AFECLK_FREQ 35328000
2893 +#define REFCLK_FREQ 25000000
2894 +#define OSC3_FREQ 24000000
2895 +#define AVALANCHE_LOW_CPMAC_PHY_MASK 0x80000000
2896 +#define AVALANCHE_HIGH_CPMAC_PHY_MASK 0x00010000
2897 +#define AVALANCHE_LOW_CPMAC_MDIX_MASK 0x80000000
2901 +#if defined(CONFIG_AR7VWI)
2902 +#define AFECLK_FREQ 35328000
2903 +#define REFCLK_FREQ 25000000
2904 +#define OSC3_FREQ 24000000
2905 +#define AVALANCHE_LOW_CPMAC_PHY_MASK 0x80000000
2906 +#define AVALANCHE_HIGH_CPMAC_PHY_MASK 0x00010000
2907 +#define AVALANCHE_LOW_CPMAC_MDIX_MASK 0x80000000
2911 +#if defined CONFIG_SEAD2
2912 +#define AVALANCHE_LOW_CPMAC_PHY_MASK 0xAAAAAAAA
2913 +#define AVALANCHE_HIGH_CPMAC_PHY_MASK 0x55555555
2914 +#define AVALANCHE_LOW_CPMAC_MDIX_MASK 0
2915 +#include <asm/mips-boards/sead.h>
2920 diff -urN kernel-base/include/asm-mips/ar7/sangam.h kernel-tmp2/include/asm-mips/ar7/sangam.h
2921 --- kernel-base/include/asm-mips/ar7/sangam.h 1970-01-01 01:00:00.000000000 +0100
2922 +++ kernel-tmp2/include/asm-mips/ar7/sangam.h 2005-07-10 06:40:39.624260784 +0200
2927 +#include <linux/config.h>
2928 +#include <asm/addrspace.h>
2930 +/*----------------------------------------------------
2931 + * Sangam's Module Base Addresses
2932 + *--------------------------------------------------*/
2933 +#define AVALANCHE_ADSL_SUB_SYS_MEM_BASE (KSEG1ADDR(0x01000000)) /* AVALANCHE ADSL Mem Base */
2934 +#define AVALANCHE_BROADBAND_INTERFACE__BASE (KSEG1ADDR(0x02000000)) /* AVALANCHE BBIF */
2935 +#define AVALANCHE_ATM_SAR_BASE (KSEG1ADDR(0x03000000)) /* AVALANCHE ATM SAR */
2936 +#define AVALANCHE_USB_SLAVE_BASE (KSEG1ADDR(0x03400000)) /* AVALANCHE USB SLAVE */
2937 +#define AVALANCHE_LOW_VLYNQ_MEM_MAP_BASE (KSEG1ADDR(0x04000000)) /* AVALANCHE VLYNQ 0 Mem map */
2938 +#define AVALANCHE_LOW_CPMAC_BASE (KSEG1ADDR(0x08610000)) /* AVALANCHE CPMAC 0 */
2939 +#define AVALANCHE_EMIF_CONTROL_BASE (KSEG1ADDR(0x08610800)) /* AVALANCHE EMIF */
2940 +#define AVALANCHE_GPIO_BASE (KSEG1ADDR(0x08610900)) /* AVALANCHE GPIO */
2941 +#define AVALANCHE_CLOCK_CONTROL_BASE (KSEG1ADDR(0x08610A00)) /* AVALANCHE Clock Control */
2942 +#define AVALANCHE_WATCHDOG_TIMER_BASE (KSEG1ADDR(0x08610B00)) /* AVALANCHE Watch Dog Timer */
2943 +#define AVALANCHE_TIMER0_BASE (KSEG1ADDR(0x08610C00)) /* AVALANCHE Timer 1 */
2944 +#define AVALANCHE_TIMER1_BASE (KSEG1ADDR(0x08610D00)) /* AVALANCHE Timer 2 */
2945 +#define AVALANCHE_UART0_REGS_BASE (KSEG1ADDR(0x08610E00)) /* AVALANCHE UART 0 */
2946 +#define AVALANCHE_UART1_REGS_BASE (KSEG1ADDR(0x08610F00)) /* AVALANCHE UART 0 */
2947 +#define AVALANCHE_I2C_BASE (KSEG1ADDR(0x08611000)) /* AVALANCHE I2C */
2948 +#define AVALANCHE_USB_SLAVE_CONTROL_BASE (KSEG1ADDR(0x08611200)) /* AVALANCHE USB DMA */
2949 +#define AVALANCHE_MCDMA0_CTRL_BASE (KSEG1ADDR(0x08611400)) /* AVALANCHE MC DMA 0 (channels 0-3) */
2950 +#define AVALANCHE_RESET_CONTROL_BASE (KSEG1ADDR(0x08611600)) /* AVALANCHE Reset Control */
2951 +#define AVALANCHE_BIST_CONTROL_BASE (KSEG1ADDR(0x08611700)) /* AVALANCHE BIST Control */
2952 +#define AVALANCHE_LOW_VLYNQ_CONTROL_BASE (KSEG1ADDR(0x08611800)) /* AVALANCHE VLYNQ0 Control */
2953 +#define AVALANCHE_DEVICE_CONFIG_LATCH_BASE (KSEG1ADDR(0x08611A00)) /* AVALANCHE Device Config Latch */
2954 +#define AVALANCHE_HIGH_VLYNQ_CONTROL_BASE (KSEG1ADDR(0x08611C00)) /* AVALANCHE VLYNQ1 Control */
2955 +#define AVALANCHE_MDIO_BASE (KSEG1ADDR(0x08611E00)) /* AVALANCHE MDIO */
2956 +#define AVALANCHE_FSER_BASE (KSEG1ADDR(0x08612000)) /* AVALANCHE FSER base */
2957 +#define AVALANCHE_INTC_BASE (KSEG1ADDR(0x08612400)) /* AVALANCHE INTC */
2958 +#define AVALANCHE_HIGH_CPMAC_BASE (KSEG1ADDR(0x08612800)) /* AVALANCHE CPMAC 1 */
2959 +#define AVALANCHE_HIGH_VLYNQ_MEM_MAP_BASE (KSEG1ADDR(0x0C000000)) /* AVALANCHE VLYNQ 1 Mem map */
2961 +#define AVALANCHE_SDRAM_BASE 0x14000000UL
2964 +/*----------------------------------------------------
2965 + * Sangam Interrupt Map (Primary Interrupts)
2966 + *--------------------------------------------------*/
2968 +#define AVALANCHE_UNIFIED_SECONDARY_INT 0
2969 +#define AVALANCHE_EXT_INT_0 1
2970 +#define AVALANCHE_EXT_INT_1 2
2971 +/* Line# 3 to 4 are reserved */
2972 +#define AVALANCHE_TIMER_0_INT 5
2973 +#define AVALANCHE_TIMER_1_INT 6
2974 +#define AVALANCHE_UART0_INT 7
2975 +#define AVALANCHE_UART1_INT 8
2976 +#define AVALANCHE_DMA_INT0 9
2977 +#define AVALANCHE_DMA_INT1 10
2978 +/* Line# 11 to 14 are reserved */
2979 +#define AVALANCHE_ATM_SAR_INT 15
2980 +/* Line# 16 to 18 are reserved */
2981 +#define AVALANCHE_LOW_CPMAC_INT 19
2982 +/* Line# 20 is reserved */
2983 +#define AVALANCHE_LOW_VLYNQ_INT 21
2984 +#define AVALANCHE_CODEC_WAKEUP_INT 22
2985 +/* Line# 23 is reserved */
2986 +#define AVALANCHE_USB_SLAVE_INT 24
2987 +#define AVALANCHE_HIGH_VLYNQ_INT 25
2988 +/* Line# 26 to 27 are reserved */
2989 +#define AVALANCHE_UNIFIED_PHY_INT 28
2990 +#define AVALANCHE_I2C_INT 29
2991 +#define AVALANCHE_DMA_INT2 30
2992 +#define AVALANCHE_DMA_INT3 31
2993 +/* Line# 32 is reserved */
2994 +#define AVALANCHE_HIGH_CPMAC_INT 33
2995 +/* Line# 34 to 36 is reserved */
2996 +#define AVALANCHE_VDMA_VT_RX_INT 37
2997 +#define AVALANCHE_VDMA_VT_TX_INT 38
2998 +#define AVALANCHE_ADSL_SUB_SYSTEM_INT 39
3001 +#define AVALANCHE_EMIF_INT 47
3005 +/*-----------------------------------------------------------
3006 + * Sangam's Reset Bits
3007 + *---------------------------------------------------------*/
3009 +#define AVALANCHE_UART0_RESET_BIT 0
3010 +#define AVALANCHE_UART1_RESET_BIT 1
3011 +#define AVALANCHE_I2C_RESET_BIT 2
3012 +#define AVALANCHE_TIMER0_RESET_BIT 3
3013 +#define AVALANCHE_TIMER1_RESET_BIT 4
3014 +/* Reset bit 5 is reserved. */
3015 +#define AVALANCHE_GPIO_RESET_BIT 6
3016 +#define AVALANCHE_ADSL_SUB_SYS_RESET_BIT 7
3017 +#define AVALANCHE_USB_SLAVE_RESET_BIT 8
3018 +#define AVALANCHE_ATM_SAR_RESET_BIT 9
3019 +/* Reset bit 10 is reserved. */
3020 +#define AVALANCHE_VDMA_VT_RESET_BIT 11
3021 +#define AVALANCHE_FSER_RESET_BIT 12
3022 +/* Reset bit 13 to 15 are reserved */
3023 +#define AVALANCHE_HIGH_VLYNQ_RESET_BIT 16
3024 +#define AVALANCHE_LOW_CPMAC_RESET_BIT 17
3025 +#define AVALANCHE_MCDMA_RESET_BIT 18
3026 +#define AVALANCHE_BIST_RESET_BIT 19
3027 +#define AVALANCHE_LOW_VLYNQ_RESET_BIT 20
3028 +#define AVALANCHE_HIGH_CPMAC_RESET_BIT 21
3029 +#define AVALANCHE_MDIO_RESET_BIT 22
3030 +#define AVALANCHE_ADSL_SUB_SYS_DSP_RESET_BIT 23
3031 +/* Reset bit 24 to 25 are reserved */
3032 +#define AVALANCHE_LOW_EPHY_RESET_BIT 26
3033 +/* Reset bit 27 to 31 are reserved */
3036 +#define AVALANCHE_POWER_MODULE_USBSP 0
3037 +#define AVALANCHE_POWER_MODULE_WDTP 1
3038 +#define AVALANCHE_POWER_MODULE_UT0P 2
3039 +#define AVALANCHE_POWER_MODULE_UT1P 3
3040 +#define AVALANCHE_POWER_MODULE_IICP 4
3041 +#define AVALANCHE_POWER_MODULE_VDMAP 5
3042 +#define AVALANCHE_POWER_MODULE_GPIOP 6
3043 +#define AVALANCHE_POWER_MODULE_VLYNQ1P 7
3044 +#define AVALANCHE_POWER_MODULE_SARP 8
3045 +#define AVALANCHE_POWER_MODULE_ADSLP 9
3046 +#define AVALANCHE_POWER_MODULE_EMIFP 10
3047 +#define AVALANCHE_POWER_MODULE_ADSPP 12
3048 +#define AVALANCHE_POWER_MODULE_RAMP 13
3049 +#define AVALANCHE_POWER_MODULE_ROMP 14
3050 +#define AVALANCHE_POWER_MODULE_DMAP 15
3051 +#define AVALANCHE_POWER_MODULE_BISTP 16
3052 +#define AVALANCHE_POWER_MODULE_TIMER0P 18
3053 +#define AVALANCHE_POWER_MODULE_TIMER1P 19
3054 +#define AVALANCHE_POWER_MODULE_EMAC0P 20
3055 +#define AVALANCHE_POWER_MODULE_EMAC1P 22
3056 +#define AVALANCHE_POWER_MODULE_EPHYP 24
3057 +#define AVALANCHE_POWER_MODULE_VLYNQ0P 27
3064 + * Sangam board vectors
3067 +#define AVALANCHE_VECS (KSEG1ADDR(AVALANCHE_SDRAM_BASE))
3068 +#define AVALANCHE_VECS_KSEG0 (KSEG0ADDR(AVALANCHE_SDRAM_BASE))
3070 +/*-----------------------------------------------------------------------------
3071 + * Sangam's system register.
3073 + *---------------------------------------------------------------------------*/
3074 +#define AVALANCHE_DCL_BOOTCR (KSEG1ADDR(0x08611A00))
3075 +#define AVALANCHE_EMIF_SDRAM_CFG (AVALANCHE_EMIF_CONTROL_BASE + 0x8)
3076 +#define AVALANCHE_RST_CTRL_PRCR (KSEG1ADDR(0x08611600))
3077 +#define AVALANCHE_RST_CTRL_SWRCR (KSEG1ADDR(0x08611604))
3078 +#define AVALANCHE_RST_CTRL_RSR (KSEG1ADDR(0x08611600))
3080 +#define AVALANCHE_POWER_CTRL_PDCR (KSEG1ADDR(0x08610A00))
3081 +#define AVALANCHE_WAKEUP_CTRL_WKCR (KSEG1ADDR(0x08610A0C))
3083 +#define AVALANCHE_GPIO_DATA_IN (AVALANCHE_GPIO_BASE + 0x0)
3084 +#define AVALANCHE_GPIO_DATA_OUT (AVALANCHE_GPIO_BASE + 0x4)
3085 +#define AVALANCHE_GPIO_DIR (AVALANCHE_GPIO_BASE + 0x8)
3086 +#define AVALANCHE_GPIO_ENBL (AVALANCHE_GPIO_BASE + 0xC)
3087 +#define AVALANCHE_CVR (AVALANCHE_GPIO_BASE + 0x14)
3090 + * Yamon Prom print address.
3092 +#define AVALANCHE_YAMON_FUNCTION_BASE (KSEG1ADDR(0x10000500))
3093 +#define AVALANCHE_YAMON_PROM_PRINT_COUNT_ADDR (AVALANCHE_YAMON_FUNCTION_BASE + 0x4) /* print_count function */
3094 +#define AVALANCHE_YAMON_PROM_PRINT_ADDR (AVALANCHE_YAMON_FUNCTION_BASE + 0x34)
3096 +#define AVALANCHE_BASE_BAUD ( 3686400 / 16 )
3098 +#define AVALANCHE_GPIO_PIN_COUNT 32
3099 +#define AVALANCHE_GPIO_OFF_MAP {0xF34FFFC0}
3101 +#include "sangam_boards.h"
3103 +#endif /*_SANGAM_H_ */
3104 diff -urN kernel-base/include/asm-mips/io.h kernel-tmp2/include/asm-mips/io.h
3105 --- kernel-base/include/asm-mips/io.h 2005-07-10 03:00:44.797179400 +0200
3106 +++ kernel-tmp2/include/asm-mips/io.h 2005-07-10 06:40:39.624260784 +0200
3108 #ifdef CONFIG_64BIT_PHYS_ADDR
3109 #define page_to_phys(page) ((u64)(page - mem_map) << PAGE_SHIFT)
3111 +#ifdef CONFIG_AR7_PAGING
3112 +#define page_to_phys(page) (((page - mem_map) << PAGE_SHIFT) + CONFIG_AR7_MEMORY)
3114 #define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
3118 #define IO_SPACE_LIMIT 0xffff
3120 diff -urN kernel-base/include/asm-mips/irq.h kernel-tmp2/include/asm-mips/irq.h
3121 --- kernel-base/include/asm-mips/irq.h 2005-07-10 03:00:44.798179248 +0200
3122 +++ kernel-tmp2/include/asm-mips/irq.h 2005-07-10 06:40:39.624260784 +0200
3124 #include <linux/config.h>
3125 #include <linux/linkage.h>
3128 +#include <asm/ar7/avalanche_intc.h>
3129 +#define NR_IRQS AVALANCHE_INT_END + 1
3131 #define NR_IRQS 128 /* Largest number of ints of all machines. */
3135 static inline int irq_cannonicalize(int irq)
3136 diff -urN kernel-base/include/asm-mips/page.h kernel-tmp2/include/asm-mips/page.h
3137 --- kernel-base/include/asm-mips/page.h 2005-07-10 03:00:44.798179248 +0200
3138 +++ kernel-tmp2/include/asm-mips/page.h 2005-07-10 06:40:39.625260632 +0200
3139 @@ -129,7 +129,11 @@
3141 #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
3142 #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
3143 +#ifdef CONFIG_AR7_PAGING
3144 +#define virt_to_page(kaddr) phys_to_page(__pa(kaddr))
3146 #define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT))
3148 #define VALID_PAGE(page) ((page - mem_map) < max_mapnr)
3150 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
3151 diff -urN kernel-base/include/asm-mips/pgtable-32.h kernel-tmp2/include/asm-mips/pgtable-32.h
3152 --- kernel-base/include/asm-mips/pgtable-32.h 2005-07-10 03:00:44.798179248 +0200
3153 +++ kernel-tmp2/include/asm-mips/pgtable-32.h 2005-07-10 06:40:39.625260632 +0200
3154 @@ -108,7 +108,18 @@
3155 * and a page entry and page directory to the page they refer to.
3158 -#ifdef CONFIG_CPU_VR41XX
3159 +#if defined(CONFIG_AR7_PAGING)
3160 +#define mk_pte(page, pgprot) \
3164 + pte_val(__pte) = ((phys_t)(page - mem_map) << (PAGE_SHIFT) | \
3165 + CONFIG_AR7_MEMORY) | \
3166 + pgprot_val(pgprot); \
3170 +#elif defined(CONFIG_CPU_VR41XX)
3171 #define mk_pte(page, pgprot) \
3179 static inline pte_t mk_pte_phys(phys_t physpage, pgprot_t pgprot)
3181 #ifdef CONFIG_CPU_VR41XX
3182 @@ -175,7 +187,10 @@
3183 set_pte(ptep, __pte(0));
3186 -#ifdef CONFIG_CPU_VR41XX
3187 +#if defined(CONFIG_AR7_PAGING)
3188 +#define phys_to_page(phys) (mem_map + (((phys)-CONFIG_AR7_MEMORY) >> PAGE_SHIFT))
3189 +#define pte_page(x) phys_to_page(pte_val(x))
3190 +#elif defined(CONFIG_CPU_VR41XX)
3191 #define pte_page(x) (mem_map+((unsigned long)(((x).pte_low >> (PAGE_SHIFT+2)))))
3192 #define __mk_pte(page_nr,pgprot) __pte(((page_nr) << (PAGE_SHIFT+2)) | pgprot_val(pgprot))
3194 diff -urN kernel-base/include/asm-mips/serial.h kernel-tmp2/include/asm-mips/serial.h
3195 --- kernel-base/include/asm-mips/serial.h 2005-07-10 03:00:44.799179096 +0200
3196 +++ kernel-tmp2/include/asm-mips/serial.h 2005-07-10 06:40:39.625260632 +0200
3199 #define C_P(card,port) (((card)<<6|(port)<<3) + 1)
3202 +#include <asm/ar7/ar7.h>
3203 +#define AR7_SERIAL_PORT_DEFNS \
3204 + { 0, AR7_BASE_BAUD, AR7_UART0_REGS_BASE, LNXINTNUM(AVALANCHE_UART0_INT), STD_COM_FLAGS }, \
3205 + { 0, AR7_BASE_BAUD, AR7_UART1_REGS_BASE, LNXINTNUM(AVALANCHE_UART1_INT), STD_COM_FLAGS },
3207 +#define AR7_SERIAL_PORT_DEFNS
3210 #ifdef CONFIG_MIPS_JAZZ
3211 #define _JAZZ_SERIAL_INIT(int, base) \
3212 { .baud_base = JAZZ_BASE_BAUD, .irq = int, .flags = STD_COM_FLAGS, \
3216 #define SERIAL_PORT_DFNS \
3217 + AR7_SERIAL_PORT_DEFNS \
3218 ATLAS_SERIAL_PORT_DEFNS \
3219 AU1000_SERIAL_PORT_DEFNS \
3220 COBALT_SERIAL_PORT_DEFNS \
3221 diff -urN kernel-base/Makefile kernel-tmp2/Makefile
3222 --- kernel-base/Makefile 2005-07-10 03:00:44.799179096 +0200
3223 +++ kernel-tmp2/Makefile 2005-07-10 06:40:39.626260480 +0200
3226 CPPFLAGS := -D__KERNEL__ -I$(HPATH)
3228 -CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
3229 +CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
3230 -fno-strict-aliasing -fno-common
3231 ifndef CONFIG_FRAME_POINTER
3232 CFLAGS += -fomit-frame-pointer