1 /* asm/arch-cpe/irq.h */
3 #ifndef __ASM_ARCH_IRQ_H__
4 #define __ASM_ARCH_IRQ_H__
6 #include <asm/hardware.h>
8 #include <asm/mach/irq.h>
9 #include <asm/arch/irqs.h>
10 #include <asm/arch/ftpci.h>
11 #include <asm/arch/cpe/cpe.h>
13 extern void cpe_mask_irq(unsigned int irq
);
14 extern void cpe_unmask_irq(unsigned int irq
);
15 extern void cpe_mask_ack_irq(unsigned int irq
);
16 extern void cpe_clear_irq(unsigned int intNum
);
17 extern void cpe_int_init(void);
19 #if 1 // add by Victor Yu. 05-17-2005
20 extern struct irqchip cpe_irq_chip
;
21 #include <linux/interrupt.h>
24 static inline void irq_init_irq(void)
32 for (irq
= 0; irq
< NR_IRQS
; irq
++) {
33 set_irq_chip(irq
, &cpe_irq_chip
);
34 set_irq_handler(irq
, do_level_IRQ
);
35 set_irq_flags(irq
, IRQF_VALID
);
39 static inline int fixup_irq(int irq
)
41 #ifdef CONFIG_ARCH_CPE
45 if( irq
== IRQ_EXT_A321
) {
46 status
=*(volatile unsigned int *)(CPE_A321_IC_VA_BASE
+IRQ_STATUS_REG
);
47 if( status
& (1<<(IRQ_A321_PCI
-CPE_A321_IRQ_START
)) ) { //pci irq
49 switch ( ftpci_get_irq() ) {
50 case 0: return VIRQ_PCI_A
;
51 case 1: return VIRQ_PCI_B
;
52 case 2: return VIRQ_PCI_C
;
53 case 3: return VIRQ_PCI_D
;
56 for( i
=0; i
<32 ;i
++ ) {
57 if ( status
& (1<<i
) )
58 return (i
+CPE_A321_IRQ_START
);
63 #endif // CONFIG_ARCH_CPE
65 #ifdef CONFIG_ARCH_MOXACPU
67 if ( irq
== IRQ_PCI
) {
68 switch ( ftpci_get_irq() ) {
69 case 0: return VIRQ_PCI_A
;
70 case 1: return VIRQ_PCI_B
;
71 case 2: return VIRQ_PCI_C
;
72 case 3: return VIRQ_PCI_D
;
76 #endif // CONFIG_ARCH_MOXACPU
81 #endif /* __ASM_ARCH_IRQ_H__ */