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-arm/mach/irq.h>
10 #include <asm/arch/ftpci.h>
13 #if 0 // mask by Victor Yu. 03-15-2007
14 extern void cpe_mask_irq(unsigned int irq
);
15 extern void cpe_unmask_irq(unsigned int irq
);
16 extern void cpe_mask_ack_irq(unsigned int irq
);
17 extern void cpe_clear_irq(unsigned int intNum
);
18 extern void cpe_int_init(void);
20 #if 1 // add by Victor Yu. 05-17-2005
21 extern struct irqchip cpe_irq_chip
;
22 #include <linux/interrupt.h>
25 static inline void irq_init_irq(void)
33 #if 1 // add by Victor Yu. 03-15-2007
34 cpe_irq_chip
.ack
= cpe_mask_ack_irq
;
35 cpe_irq_chip
.mask
= cpe_mask_irq
;
36 cpe_irq_chip
.unmask
= cpe_unmask_irq
;
38 for (irq
= 0; irq
< NR_IRQS
; irq
++) {
39 set_irq_chip(irq
, &cpe_irq_chip
);
40 set_irq_handler(irq
, do_level_IRQ
);
41 set_irq_flags(irq
, IRQF_VALID
);
46 static inline int fixup_irq(int irq
)
48 #ifdef CONFIG_ARCH_CPE
52 if( irq
== IRQ_EXT_A321
) {
53 status
=*(volatile unsigned int *)(CPE_A321_IC_VA_BASE
+IRQ_STATUS_REG
);
54 if( status
& (1<<(IRQ_A321_PCI
-CPE_A321_IRQ_START
)) ) { //pci irq
56 switch ( ftpci_get_irq() ) {
57 case 0: return VIRQ_PCI_A
;
58 case 1: return VIRQ_PCI_B
;
59 case 2: return VIRQ_PCI_C
;
60 case 3: return VIRQ_PCI_D
;
63 for( i
=0; i
<32 ;i
++ ) {
64 if ( status
& (1<<i
) )
65 return (i
+CPE_A321_IRQ_START
);
70 #endif // CONFIG_ARCH_CPE
72 #ifdef CONFIG_ARCH_IA240
74 if ( irq
== IRQ_PCI
) {
75 switch ( ftpci_get_irq() ) {
76 case 0: return VIRQ_PCI_A
;
77 case 1: return VIRQ_PCI_B
;
78 case 2: return VIRQ_PCI_C
;
79 case 3: return VIRQ_PCI_D
;
83 #endif // CONFIG_ARCH_IA240
88 #endif /* __ASM_ARCH_IRQ_H__ */