/* * * BRIEF MODULE DESCRIPTION * SOC32101 SOC SOC interrupt/setup routines. * * Copyright 2000,2001 MontaVista Software Inc. * Author: MontaVista Software, Inc. * ppopov@mvista.com or source@mvista.com * * Part of this file was derived from Carsten Langgaard's * arch/mips/ite-boards/generic/init.c. * * Carsten Langgaard, carstenl@mips.com * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int printf_raw(const char *fmt, ...); #undef DEBUG_IRQ #ifdef DEBUG_IRQ /* note: prints function name for you */ #define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args) #else #define DPRINTK(fmt, args...) #endif #ifdef CONFIG_REMOTE_DEBUG extern void breakpoint(void); #endif /* revisit */ #define EXT_IRQ0_TO_IP 2 /* IP 2 */ #define EXT_IRQ5_TO_IP 7 /* IP 7 */ #define ALLINTS_NOTIMER (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4) void disable_soc_soc_irq(struct irq_data *d); void enable_soc_soc_irq(struct irq_data *d); extern void set_debug_traps(void); extern void mips_timer_interrupt(int irq, struct pt_regs *regs); extern asmlinkage void soc_soc_IRQ(void); static struct soc_soc_intc_regs volatile *soc_soc_hw0_icregs = (struct soc_soc_intc_regs volatile *)(KSEG1ADDR(SOC_SOC_INTC_BASE)); void disable_soc_soc_irq(struct irq_data *d) { #if 0 int irq = d->irq; DPRINTK("disable_soc_soc_irq %d\n", irq); soc_soc_hw0_icregs->int_en &= ~(1 << irq); #endif } void enable_soc_soc_irq(struct irq_data *d) { #if 0 int irq = d->irq; DPRINTK("enable_soc_soc_irq %d\n", irq); soc_soc_hw0_icregs->int_en |= (1 << irq); #endif } static unsigned int startup_soc_soc_irq(struct irq_data *d) { enable_soc_soc_irq(d); return 0; } #define shutdown_soc_soc_irq disable_soc_soc_irq #define mask_and_ack_soc_soc_irq disable_soc_soc_irq static void end_soc_soc_irq(struct irq_data *d) { int irq = d->irq; // if (!(irq_to_desc(irq)->istate & IRQS_PENDING)){ soc_soc_hw0_icregs->int_clr |= 1 << irq; //if(irqint_isr; if (intstatus & INT_LCD) //0 { irq += SOC_SOC_LCD_IRQ; } else if (intstatus & INT_MAC1) //1 { irq += SOC_SOC_MAC1_IRQ; } else if (intstatus & INT_MAC2) //2 { irq += SOC_SOC_MAC2_IRQ; } else if (intstatus & INT_AC97) //3 { irq += SOC_SOC_AC97_IRQ; } else if (intstatus & INT_SPI) //8 { irq += SOC_SOC_SPI_IRQ; } else if (intstatus & INT_UART0) //11 { irq += SOC_SOC_UART0_IRQ; } else if (intstatus & INT_UART1) //12 { irq += SOC_SOC_UART1_IRQ; } else if (intstatus & INT_KBD) //9 { irq += SOC_SOC_KBD_IRQ; } else if (intstatus & INT_MOUSE) //10 { irq += SOC_SOC_MOUSE_IRQ; } //------------------------------------------------------------------------------ else if((soc_soc_hw0_icregs->int_en && (1<int_en&&(1<