From: Bradley D. L. <br...@us...> - 2001-11-04 16:02:55
|
Update of /cvsroot/linux-mips/linux/arch/mips/philips/nino In directory usw-pr-cvs1:/tmp/cvs-serv15502/arch/mips/philips/nino Modified Files: Makefile int-handler.S irq.c kgdb.c power.c prom.c setup.c time.c Log Message: Please correct me if I'm wrong, but I think oss has the latest Nino stuff. Index: Makefile =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 2001/10/27 20:29:40 1.5 +++ Makefile 2001/11/04 16:02:52 1.6 @@ -22,6 +22,12 @@ obj-$(CONFIG_REMOTE_DEBUG) += kgdb.o +obj-$(CONFIG_BLK_DEV_INITRD) += ramdisk.o + +ramdisk.o: + $(MAKE) -C ramdisk + mv ramdisk/ramdisk.o ramdisk.o + clean: rm -f *.o Index: int-handler.S =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/int-handler.S,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- int-handler.S 2001/10/31 18:29:07 1.3 +++ int-handler.S 2001/11/04 16:02:52 1.4 @@ -1,14 +1,9 @@ /* - * arch/mips/philips/nino/int-handler.S + * int-handler.S: Interrupt exception dispatch code for Philips Nino * * Copyright (C) 2001 Steven J. Hill (sj...@re...) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Interrupt exception dispatch code for Philips Nino */ + #include <asm/asm.h> #include <asm/mipsregs.h> #include <asm/regdef.h> @@ -18,16 +13,26 @@ * Here is the table of interrupts for the Philips Nino * which uses the Philips PR31700/Toshiba TMPR3912 core. * - * MIPS IRQ Description - * -------- -------------------------------- - * 0 SW0 interrupt (unused) - * 1 SW1 interrupt (unused) - * 2 - * 3 - * 4 PR31700 low priority interrupts - * 5 - * 6 PR31700 high priority interrupts - * 7 + * MIPS IRQ PR31700 IRQ Source + * -------- ----------- ------ + * 0 1 Sound, LCD, telecom + * 1 2 UARTA & UARTB + * 2 3 MFIO (positive edge) + * 3 4 MFIO (negative edge) + * 4 5 Timers, power management + * 5 6 High priority interrupts + * + * We handle the IRQ according to the priorities below: + * + * Highest ---- High priority interrupts + * UARTA & UARTB + * Timers, power management + * Sound, LCD, telecom + * Multi-function IO (positive edge) + * Lowest ---- Multi-function IO (negative edge) + * + * then we just return, if multiple IRQs are pending then + * we will just take another exception, big deal. */ .text @@ -38,29 +43,40 @@ SAVE_ALL CLI .set at - mfc0 s0, CP0_CAUSE # determine cause + mfc0 s0, CP0_CAUSE # get irq mask - andi a0, s0, CAUSEF_IP6 + /* Check for IRQ4 */ + andi a0, s0, C_IRQ4 beq a0, zero, 1f - andi a0, s0, CAUSEF_IP4 # delay slot + andi a0, s0, C_IRQ2 # delay slot, check for IRQ2 + + /* High priority interrupt */ move a0, sp - jal irq6_dispatch + jal irq4_dispatch nop # delay slot + j ret_from_irq nop # delay slot 1: + /* Check for IRQ2 */ beq a0, zero, 1f nop # delay slot + + /* UART interrupt of some sort */ move a0, sp - jal irq4_dispatch + jal irq2_dispatch nop # delay slot + j ret_from_irq nop # delay slot 1: /* We should never get here */ move a0, sp - j irq_bad + jal irq_bad + nop + + j ret_from_irq nop END(ninoIRQ) Index: irq.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/irq.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- irq.c 2001/10/31 18:29:07 1.5 +++ irq.c 2001/11/04 16:02:52 1.6 @@ -1,13 +1,7 @@ /* - * arch/mips/philips/nino/irq.c + * include/arch/mips/philips/nino/irq.c * * Copyright (C) 2001 Steven J. Hill (sj...@re...) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Interrupt service routines for Philips Nino */ #include <linux/init.h> #include <linux/sched.h> @@ -19,7 +13,7 @@ extern asmlinkage void do_IRQ(int irq, struct pt_regs *regs); -static void enable_irq6(unsigned int irq) +static void enable_irq4(unsigned int irq) { if(irq == 0) { IntEnable5 |= INT5_PERIODICINT; @@ -27,14 +21,14 @@ } } -static unsigned int startup_irq6(unsigned int irq) +static unsigned int startup_irq4(unsigned int irq) { - enable_irq6(irq); + enable_irq4(irq); return 0; /* Never anything pending */ } -static void disable_irq6(unsigned int irq) +static void disable_irq4(unsigned int irq) { if(irq == 0) { IntEnable6 &= ~INT6_PERIODICINT; @@ -43,27 +37,27 @@ } } -#define shutdown_irq6 disable_irq6 -#define mask_and_ack_irq6 disable_irq6 +#define shutdown_irq4 disable_irq4 +#define mask_and_ack_irq4 disable_irq4 -static void end_irq6(unsigned int irq) +static void end_irq4(unsigned int irq) { if(!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) - enable_irq6(irq); + enable_irq4(irq); } -static struct hw_interrupt_type irq6_type = { +static struct hw_interrupt_type irq4_type = { "MIPS", - startup_irq6, - shutdown_irq6, - enable_irq6, - disable_irq6, - mask_and_ack_irq6, - end_irq6, + startup_irq4, + shutdown_irq4, + enable_irq4, + disable_irq4, + mask_and_ack_irq4, + end_irq4, NULL }; -void irq6_dispatch(struct pt_regs *regs) +void irq4_dispatch(struct pt_regs *regs) { int irq = -1; @@ -74,7 +68,8 @@ /* if irq == -1, then the interrupt has already been cleared */ if(irq == -1) { - panic("No handler installed for MIPS IRQ6\n"); + printk("IRQ6 Status Register = 0x%08lx\n", IntStatus6); + goto end; } done: @@ -84,59 +79,68 @@ return; } -static void enable_irq4(unsigned int irq) +static void enable_irq2(unsigned int irq) { set_cp0_status(STATUSF_IP4); - if(irq == 2) { + if(irq == 2 || irq == 3) { IntClear2 = 0xffffffff; - IntEnable2 |= 0x07c00000; + IntEnable2 = 0xfffff000; } } -static unsigned int startup_irq4(unsigned int irq) +static unsigned int startup_irq2(unsigned int irq) { - enable_irq4(irq); + enable_irq2(irq); return 0; /* Never anything pending */ } -static void disable_irq4(unsigned int irq) +static void disable_irq2(unsigned int irq) { clear_cp0_status(STATUSF_IP4); } -#define shutdown_irq4 disable_irq4 -#define mask_and_ack_irq4 disable_irq4 +#define shutdown_irq2 disable_irq2 +#define mask_and_ack_irq2 disable_irq2 -static void end_irq4(unsigned int irq) +static void end_irq2(unsigned int irq) { if(!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) - enable_irq4(irq); + enable_irq2(irq); } -static struct hw_interrupt_type irq4_type = { +static struct hw_interrupt_type irq2_type = { "MIPS", - startup_irq4, - shutdown_irq4, - enable_irq4, - disable_irq4, - mask_and_ack_irq4, - end_irq4, + startup_irq2, + shutdown_irq2, + enable_irq2, + disable_irq2, + mask_and_ack_irq2, + end_irq2, NULL }; -void irq4_dispatch(struct pt_regs *regs) +void irq2_dispatch(struct pt_regs *regs) { int irq = -1; - if(IntStatus2 & 0x07c00000) { + if(IntStatus2 & 0xfffff000) { irq = 2; goto done; } + if(IntStatus2 & 0xfffff000) { + irq = 3; + goto done; + } /* if irq == -1, then the interrupt has already been cleared */ if (irq == -1) { - panic("No handler installed for MIPS IRQ4\n"); + printk("EEK\n"); + IntClear1 = 0xffffffff; + IntClear3 = 0xffffffff; + IntClear4 = 0xffffffff; + IntClear5 = 0xffffffff; + goto end; } done: @@ -186,10 +190,10 @@ /* Initialize IRQ action handlers */ for (i = 0; i < 16; i++) { hw_irq_controller *handler = NULL; - if (i == 0 || i == 3) - handler = &irq6_type; - else if (i == 2) + if (i == 0) handler = &irq4_type; + else if (i > 1 && i < 4) + handler = &irq2_type; else handler = NULL; @@ -205,8 +209,8 @@ /* Enable high priority interrupts */ IntEnable6 = (INT6_GLOBALEN | 0xffff); - /* Enable all interrupts */ - change_cp0_status(ST0_IM, ALLINTS); + /* Enable interrupts */ + change_cp0_status(ST0_IM, IE_IRQ2 | IE_IRQ4); } void (*irq_setup)(void); Index: kgdb.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/kgdb.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- kgdb.c 2001/10/31 18:29:07 1.2 +++ kgdb.c 2001/11/04 16:02:52 1.3 @@ -1,5 +1,5 @@ /* - * arch/mips/philips/nino/kgdb.c + * linux/arch/mips/philips/nino/kgdb.c * * Copyright (C) 2001 Steven J. Hill (sj...@re...) * @@ -7,7 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * Kernel debugging for the Philips Nino + * Kernel debugging on the Philips Nino. */ #include <asm/system.h> #include <asm/tx3912.h> Index: power.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/power.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- power.c 2001/10/31 18:29:07 1.2 +++ power.c 2001/11/04 16:02:52 1.3 @@ -1,5 +1,5 @@ /* - * arch/mips/philips/nino/power.c + * linux/arch/mips/philips/nino/power.c * * Copyright (C) 2000 Jim Pick <ji...@ji...> * Copyright (C) 2001 Steven J. Hill (sj...@re...) @@ -8,7 +8,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * Power management routines for the Philips Nino + * Power management routines on the Philips Nino. */ #include <asm/tx3912.h> Index: prom.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/prom.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- prom.c 2001/10/31 18:29:08 1.3 +++ prom.c 2001/11/04 16:02:52 1.4 @@ -1,5 +1,5 @@ /* - * arch/mips/philips/nino/prom.c + * linux/arch/mips/philips/nino/prom.c * * Copyright (C) 2001 Steven J. Hill (sj...@re...) * @@ -7,7 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * Early initialization code for the Philips Nino + * Early initialization code for the Philips Nino. */ #include <linux/config.h> #include <linux/init.h> Index: setup.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/setup.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- setup.c 2001/10/31 18:29:08 1.4 +++ setup.c 2001/11/04 16:02:52 1.5 @@ -1,5 +1,5 @@ /* - * arch/mips/philips/nino/setup.c + * linux/arch/mips/philips/nino/setup.c * * Copyright (C) 2001 Steven J. Hill (sj...@re...) * @@ -7,7 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * Interrupt and exception initialization for Philips Nino + * Interrupt and exception initialization for Philips Nino. */ #include <linux/init.h> #include <linux/interrupt.h> Index: time.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/time.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- time.c 2001/10/31 18:29:08 1.4 +++ time.c 2001/11/04 16:02:52 1.5 @@ -1,5 +1,5 @@ /* - * arch/mips/philips/nino/time.c + * linux/arch/mips/philips/nino/time.c * * Copyright (C) 1999 Harald Koerfgen * Copyright (C) 2000 Pavel Machek (pa...@su...) @@ -9,7 +9,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * Time handling functinos for Philips Nino + * Time handling functinos for Philips Nino. */ #include <linux/errno.h> #include <linux/init.h> |