@@ -96,6 +96,7 @@ struct armctrl_ic {
96
96
static struct armctrl_ic intc __read_mostly ;
97
97
static void __exception_irq_entry bcm2835_handle_irq (
98
98
struct pt_regs * regs );
99
+ static void bcm2836_chained_handle_irq (unsigned int irq , struct irq_desc * desc );
99
100
100
101
static void armctrl_mask_irq (struct irq_data * d )
101
102
{
@@ -139,7 +140,8 @@ static const struct irq_domain_ops armctrl_ops = {
139
140
};
140
141
141
142
static int __init armctrl_of_init (struct device_node * node ,
142
- struct device_node * parent )
143
+ struct device_node * parent ,
144
+ bool is_2836 )
143
145
{
144
146
void __iomem * base ;
145
147
int irq , b , i ;
@@ -168,10 +170,34 @@ static int __init armctrl_of_init(struct device_node *node,
168
170
}
169
171
}
170
172
171
- set_handle_irq (bcm2835_handle_irq );
173
+ if (is_2836 ) {
174
+ int parent_irq = irq_of_parse_and_map (node , 0 );
175
+
176
+ if (!parent_irq ) {
177
+ panic ("%s: unable to get parent interrupt.\n" ,
178
+ node -> full_name );
179
+ }
180
+ irq_set_chained_handler (parent_irq , bcm2836_chained_handle_irq );
181
+ } else {
182
+ set_handle_irq (bcm2835_handle_irq );
183
+ }
184
+
172
185
return 0 ;
173
186
}
174
187
188
+ static int __init bcm2835_armctrl_of_init (struct device_node * node ,
189
+ struct device_node * parent )
190
+ {
191
+ return armctrl_of_init (node , parent , false);
192
+ }
193
+
194
+ static int __init bcm2836_armctrl_of_init (struct device_node * node ,
195
+ struct device_node * parent )
196
+ {
197
+ return armctrl_of_init (node , parent , true);
198
+ }
199
+
200
+
175
201
/*
176
202
* Handle each interrupt across the entire interrupt controller. This reads the
177
203
* status register before handling each interrupt, which is necessary given that
@@ -219,4 +245,15 @@ static void __exception_irq_entry bcm2835_handle_irq(
219
245
handle_IRQ (irq_linear_revmap (intc .domain , hwirq ), regs );
220
246
}
221
247
222
- IRQCHIP_DECLARE (bcm2835_armctrl_ic , "brcm,bcm2835-armctrl-ic" , armctrl_of_init );
248
+ static void bcm2836_chained_handle_irq (unsigned int irq , struct irq_desc * desc )
249
+ {
250
+ u32 hwirq ;
251
+
252
+ while ((hwirq = get_next_armctrl_hwirq ()) != ~0 )
253
+ generic_handle_irq (irq_linear_revmap (intc .domain , hwirq ));
254
+ }
255
+
256
+ IRQCHIP_DECLARE (bcm2835_armctrl_ic , "brcm,bcm2835-armctrl-ic" ,
257
+ bcm2835_armctrl_of_init );
258
+ IRQCHIP_DECLARE (bcm2836_armctrl_ic , "brcm,bcm2836-armctrl-ic" ,
259
+ bcm2836_armctrl_of_init );
0 commit comments