diff options
Diffstat (limited to 'arch/mips/au1000/pb1200/irqmap.c')
-rw-r--r-- | arch/mips/au1000/pb1200/irqmap.c | 66 |
1 files changed, 30 insertions, 36 deletions
diff --git a/arch/mips/au1000/pb1200/irqmap.c b/arch/mips/au1000/pb1200/irqmap.c index e61eb8e0b76b..2a505ad8715b 100644 --- a/arch/mips/au1000/pb1200/irqmap.c +++ b/arch/mips/au1000/pb1200/irqmap.c | |||
@@ -39,25 +39,25 @@ | |||
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | 41 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { |
42 | { AU1000_GPIO_7, INTC_INT_LOW_LEVEL, 0 }, // This is exteranl interrupt cascade | 42 | /* This is external interrupt cascade */ |
43 | { AU1000_GPIO_7, INTC_INT_LOW_LEVEL, 0 }, | ||
43 | }; | 44 | }; |
44 | 45 | ||
45 | int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); | 46 | int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); |
46 | 47 | ||
47 | /* | 48 | /* |
48 | * Support for External interrupts on the PbAu1200 Development platform. | 49 | * Support for External interrupts on the Pb1200 Development platform. |
49 | */ | 50 | */ |
50 | static volatile int pb1200_cascade_en=0; | 51 | static volatile int pb1200_cascade_en; |
51 | 52 | ||
52 | irqreturn_t pb1200_cascade_handler( int irq, void *dev_id) | 53 | irqreturn_t pb1200_cascade_handler(int irq, void *dev_id) |
53 | { | 54 | { |
54 | unsigned short bisr = bcsr->int_status; | 55 | unsigned short bisr = bcsr->int_status; |
55 | int extirq_nr = 0; | 56 | int extirq_nr = 0; |
56 | 57 | ||
57 | /* Clear all the edge interrupts. This has no effect on level */ | 58 | /* Clear all the edge interrupts. This has no effect on level. */ |
58 | bcsr->int_status = bisr; | 59 | bcsr->int_status = bisr; |
59 | for( ; bisr; bisr &= (bisr-1) ) | 60 | for ( ; bisr; bisr &= bisr - 1) { |
60 | { | ||
61 | extirq_nr = PB1200_INT_BEGIN + __ffs(bisr); | 61 | extirq_nr = PB1200_INT_BEGIN + __ffs(bisr); |
62 | /* Ack and dispatch IRQ */ | 62 | /* Ack and dispatch IRQ */ |
63 | do_IRQ(extirq_nr); | 63 | do_IRQ(extirq_nr); |
@@ -68,26 +68,20 @@ irqreturn_t pb1200_cascade_handler( int irq, void *dev_id) | |||
68 | 68 | ||
69 | inline void pb1200_enable_irq(unsigned int irq_nr) | 69 | inline void pb1200_enable_irq(unsigned int irq_nr) |
70 | { | 70 | { |
71 | bcsr->intset_mask = 1<<(irq_nr - PB1200_INT_BEGIN); | 71 | bcsr->intset_mask = 1 << (irq_nr - PB1200_INT_BEGIN); |
72 | bcsr->intset = 1<<(irq_nr - PB1200_INT_BEGIN); | 72 | bcsr->intset = 1 << (irq_nr - PB1200_INT_BEGIN); |
73 | } | 73 | } |
74 | 74 | ||
75 | inline void pb1200_disable_irq(unsigned int irq_nr) | 75 | inline void pb1200_disable_irq(unsigned int irq_nr) |
76 | { | 76 | { |
77 | bcsr->intclr_mask = 1<<(irq_nr - PB1200_INT_BEGIN); | 77 | bcsr->intclr_mask = 1 << (irq_nr - PB1200_INT_BEGIN); |
78 | bcsr->intclr = 1<<(irq_nr - PB1200_INT_BEGIN); | 78 | bcsr->intclr = 1 << (irq_nr - PB1200_INT_BEGIN); |
79 | } | 79 | } |
80 | 80 | ||
81 | static unsigned int pb1200_setup_cascade(void) | 81 | static unsigned int pb1200_setup_cascade(void) |
82 | { | 82 | { |
83 | int err; | 83 | return request_irq(AU1000_GPIO_7, &pb1200_cascade_handler, |
84 | 84 | 0, "Pb1200 Cascade", &pb1200_cascade_handler); | |
85 | err = request_irq(AU1000_GPIO_7, &pb1200_cascade_handler, | ||
86 | 0, "Pb1200 Cascade", &pb1200_cascade_handler); | ||
87 | if (err) | ||
88 | return err; | ||
89 | |||
90 | return 0; | ||
91 | } | 85 | } |
92 | 86 | ||
93 | static unsigned int pb1200_startup_irq(unsigned int irq) | 87 | static unsigned int pb1200_startup_irq(unsigned int irq) |
@@ -132,23 +126,23 @@ void _board_init_irq(void) | |||
132 | unsigned int irq; | 126 | unsigned int irq; |
133 | 127 | ||
134 | #ifdef CONFIG_MIPS_PB1200 | 128 | #ifdef CONFIG_MIPS_PB1200 |
135 | /* We have a problem with CPLD rev3. Enable a workaround */ | 129 | /* We have a problem with CPLD rev 3. */ |
136 | if (((bcsr->whoami & BCSR_WHOAMI_CPLD) >> 4) <= 3) { | 130 | if (((bcsr->whoami & BCSR_WHOAMI_CPLD) >> 4) <= 3) { |
137 | printk("\nWARNING!!!\n"); | 131 | printk(KERN_ERR "WARNING!!!\n"); |
138 | printk("\nWARNING!!!\n"); | 132 | printk(KERN_ERR "WARNING!!!\n"); |
139 | printk("\nWARNING!!!\n"); | 133 | printk(KERN_ERR "WARNING!!!\n"); |
140 | printk("\nWARNING!!!\n"); | 134 | printk(KERN_ERR "WARNING!!!\n"); |
141 | printk("\nWARNING!!!\n"); | 135 | printk(KERN_ERR "WARNING!!!\n"); |
142 | printk("\nWARNING!!!\n"); | 136 | printk(KERN_ERR "WARNING!!!\n"); |
143 | printk("Pb1200 must be at CPLD rev4. Please have Pb1200\n"); | 137 | printk(KERN_ERR "Pb1200 must be at CPLD rev 4. Please have Pb1200\n"); |
144 | printk("updated to latest revision. This software will not\n"); | 138 | printk(KERN_ERR "updated to latest revision. This software will\n"); |
145 | printk("work on anything less than CPLD rev4\n"); | 139 | printk(KERN_ERR "not work on anything less than CPLD rev 4.\n"); |
146 | printk("\nWARNING!!!\n"); | 140 | printk(KERN_ERR "WARNING!!!\n"); |
147 | printk("\nWARNING!!!\n"); | 141 | printk(KERN_ERR "WARNING!!!\n"); |
148 | printk("\nWARNING!!!\n"); | 142 | printk(KERN_ERR "WARNING!!!\n"); |
149 | printk("\nWARNING!!!\n"); | 143 | printk(KERN_ERR "WARNING!!!\n"); |
150 | printk("\nWARNING!!!\n"); | 144 | printk(KERN_ERR "WARNING!!!\n"); |
151 | printk("\nWARNING!!!\n"); | 145 | printk(KERN_ERR "WARNING!!!\n"); |
152 | panic("Game over. Your score is 0."); | 146 | panic("Game over. Your score is 0."); |
153 | } | 147 | } |
154 | #endif | 148 | #endif |
@@ -161,6 +155,6 @@ void _board_init_irq(void) | |||
161 | 155 | ||
162 | /* | 156 | /* |
163 | * GPIO_7 can not be hooked here, so it is hooked upon first | 157 | * GPIO_7 can not be hooked here, so it is hooked upon first |
164 | * request of any source attached to the cascade | 158 | * request of any source attached to the cascade. |
165 | */ | 159 | */ |
166 | } | 160 | } |