/* * Platform dependent support for SGI SN1 * * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License * as published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Further, this software is distributed without any warranty that it is * free of the rightful claim of any third person regarding infringement * or the like. Any license provided herein, whether implied or * otherwise, applies only to this software file. Patent licenses, if * any, provided herein do not apply to combinations of this program with * other software, or any other product whatsoever. * * You should have received a copy of the GNU General Public * License along with this program; if not, write the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, * Mountain View, CA 94043, or: * * http://www.sgi.com * * For further information regarding this notice, see: * * http://oss.sgi.com/projects/GenInfo/NoticeExplan */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef ajmtestintr #include #include #endif /* ajmtestintr */ #include #include #include #include #include #include #include int irq_to_bit_pos(int irq); static unsigned int sn_startup_irq(unsigned int irq) { return(0); } static void sn_shutdown_irq(unsigned int irq) { } static void sn_disable_irq(unsigned int irq) { } static void sn_enable_irq(unsigned int irq) { } static void sn_ack_irq(unsigned int irq) { #ifdef CONFIG_IA64_SGI_SN1 int bit = -1; unsigned long long intpend_val; int subnode; #endif #ifdef CONFIG_IA64_SGI_SN2 unsigned long event_occurred, mask = 0; #endif int nasid; irq = irq & 0xff; nasid = smp_physical_node_id(); #ifdef CONFIG_IA64_SGI_SN1 subnode = cpuid_to_subnode(smp_processor_id()); if (irq == SGI_UART_IRQ) { intpend_val = REMOTE_HUB_PI_L(nasid, subnode, PI_INT_PEND0); if (intpend_val & (1L<> 8; irq = irq & 0xff; return(_sn_irq_desc[cpu] + irq); } u8 sn_irq_to_vector(u8 irq) { return(irq & 0xff); } int gsi_to_vector(u32 irq) { return irq & 0xff; } int gsi_to_irq(u32 irq) { return irq & 0xff; } unsigned int sn_local_vector_to_irq(u8 vector) { return (CPU_VECTOR_TO_IRQ(smp_processor_id(), vector)); } void *kmalloc(size_t, int); void sn_irq_init (void) { int i; irq_desc_t *base_desc = _irq_desc; for (i=IA64_FIRST_DEVICE_VECTOR; i 118) bit = 118; #ifdef CONFIG_IA64_SGI_SN1 if (bit >= GFX_INTR_A && bit <= CC_PEND_B) { return SGI_UART_IRQ; } #endif return bit + BIT_TO_IRQ; } int irq_to_bit_pos(int irq) { #define IRQ_TO_BIT 64 int bit = irq - IRQ_TO_BIT; return bit; } #ifdef ajmtestintr #include struct timer_list intr_test_timer = TIMER_INITIALIZER(NULL, 0, 0); int intr_test_icount[NR_IRQS]; struct intr_test_reg_struct { pcibr_soft_t pcibr_soft; int slot; }; struct intr_test_reg_struct intr_test_registered[NR_IRQS]; void intr_test_handle_timer(unsigned long data) { int i; bridge_t *bridge; for (i=0;ibs_intr[intr_test_registered[i].slot].bsi_xtalk_intr; /* send interrupt */ bridge = pcibr_soft->bs_base; bridge->b_force_always[intr_test_registered[i].slot].intr = 1; } } del_timer(&intr_test_timer); intr_test_timer.expires = jiffies + HZ/100; add_timer(&intr_test_timer); } void intr_test_set_timer(void) { intr_test_timer.expires = jiffies + HZ/100; intr_test_timer.function = intr_test_handle_timer; add_timer(&intr_test_timer); } void intr_test_register_irq(int irq, pcibr_soft_t pcibr_soft, int slot) { irq = irq & 0xff; intr_test_registered[irq].pcibr_soft = pcibr_soft; intr_test_registered[irq].slot = slot; } void intr_test_handle_intr(int irq, void *junk, struct pt_regs *morejunk) { intr_test_icount[irq]++; printk("RECEIVED %d INTERRUPTS ON IRQ %d\n",intr_test_icount[irq], irq); } #endif /* ajmtestintr */