aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-06-01 10:40:11 -0400
committerNicolas Ferre <nicolas.ferre@atmel.com>2013-06-21 10:35:26 -0400
commit546c830c90beb7d3e398007715fd1b631c6c060a (patch)
tree3cc13cb4c3adba7026f19a4072b5e58fe99c11d6 /arch/arm
parent133e00116b5bc76110bcc41ded369489209b641f (diff)
ARM: at91: fix at91_extern_irq usage for non-dt boards
Since 4b68520dc0ec96153bc0d87bca5ffba508edfcf ARM: at91: add AIC5 support we allocate the at91_extern_irq. This patch makes it static and stores the non-dt extern irq in the soc structure. It is then possible to use a at91_get_extern_irq() function to get the value for outside of the irq driver. It is useful for passing its value to at91_aic_init(). Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> [nicolas.ferre@atmel.com: rework commit message] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-at91/at91rm9200.c8
-rw-r--r--arch/arm/mach-at91/at91sam9260.c4
-rw-r--r--arch/arm/mach-at91/at91sam9261.c4
-rw-r--r--arch/arm/mach-at91/at91sam9263.c2
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c2
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c2
-rw-r--r--arch/arm/mach-at91/at91x40.c7
-rw-r--r--arch/arm/mach-at91/generic.h2
-rw-r--r--arch/arm/mach-at91/irq.c9
-rw-r--r--arch/arm/mach-at91/pm.c2
-rw-r--r--arch/arm/mach-at91/setup.c2
-rw-r--r--arch/arm/mach-at91/soc.h1
12 files changed, 26 insertions, 19 deletions
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index d193a409bc45..9eb574397ee1 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -332,10 +332,6 @@ static void __init at91rm9200_initialize(void)
332{ 332{
333 arm_pm_idle = at91rm9200_idle; 333 arm_pm_idle = at91rm9200_idle;
334 arm_pm_restart = at91rm9200_restart; 334 arm_pm_restart = at91rm9200_restart;
335 at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
336 | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
337 | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5)
338 | (1 << AT91RM9200_ID_IRQ6);
339 335
340 /* Initialize GPIO subsystem */ 336 /* Initialize GPIO subsystem */
341 at91_gpio_init(at91rm9200_gpio, 337 at91_gpio_init(at91rm9200_gpio,
@@ -388,6 +384,10 @@ static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {
388AT91_SOC_START(at91rm9200) 384AT91_SOC_START(at91rm9200)
389 .map_io = at91rm9200_map_io, 385 .map_io = at91rm9200_map_io,
390 .default_irq_priority = at91rm9200_default_irq_priority, 386 .default_irq_priority = at91rm9200_default_irq_priority,
387 .extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
388 | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
389 | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5)
390 | (1 << AT91RM9200_ID_IRQ6),
391 .ioremap_registers = at91rm9200_ioremap_registers, 391 .ioremap_registers = at91rm9200_ioremap_registers,
392 .register_clocks = at91rm9200_register_clocks, 392 .register_clocks = at91rm9200_register_clocks,
393 .init = at91rm9200_initialize, 393 .init = at91rm9200_initialize,
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index a8ce24538da6..5de6074b4f4f 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -348,8 +348,6 @@ static void __init at91sam9260_initialize(void)
348{ 348{
349 arm_pm_idle = at91sam9_idle; 349 arm_pm_idle = at91sam9_idle;
350 arm_pm_restart = at91sam9_alt_restart; 350 arm_pm_restart = at91sam9_alt_restart;
351 at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
352 | (1 << AT91SAM9260_ID_IRQ2);
353 351
354 /* Register GPIO subsystem */ 352 /* Register GPIO subsystem */
355 at91_gpio_init(at91sam9260_gpio, 3); 353 at91_gpio_init(at91sam9260_gpio, 3);
@@ -400,6 +398,8 @@ static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = {
400AT91_SOC_START(at91sam9260) 398AT91_SOC_START(at91sam9260)
401 .map_io = at91sam9260_map_io, 399 .map_io = at91sam9260_map_io,
402 .default_irq_priority = at91sam9260_default_irq_priority, 400 .default_irq_priority = at91sam9260_default_irq_priority,
401 .extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
402 | (1 << AT91SAM9260_ID_IRQ2),
403 .ioremap_registers = at91sam9260_ioremap_registers, 403 .ioremap_registers = at91sam9260_ioremap_registers,
404 .register_clocks = at91sam9260_register_clocks, 404 .register_clocks = at91sam9260_register_clocks,
405 .init = at91sam9260_initialize, 405 .init = at91sam9260_initialize,
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 25efb5ac30f1..0e0793241ab7 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -290,8 +290,6 @@ static void __init at91sam9261_initialize(void)
290{ 290{
291 arm_pm_idle = at91sam9_idle; 291 arm_pm_idle = at91sam9_idle;
292 arm_pm_restart = at91sam9_alt_restart; 292 arm_pm_restart = at91sam9_alt_restart;
293 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
294 | (1 << AT91SAM9261_ID_IRQ2);
295 293
296 /* Register GPIO subsystem */ 294 /* Register GPIO subsystem */
297 at91_gpio_init(at91sam9261_gpio, 3); 295 at91_gpio_init(at91sam9261_gpio, 3);
@@ -342,6 +340,8 @@ static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {
342AT91_SOC_START(at91sam9261) 340AT91_SOC_START(at91sam9261)
343 .map_io = at91sam9261_map_io, 341 .map_io = at91sam9261_map_io,
344 .default_irq_priority = at91sam9261_default_irq_priority, 342 .default_irq_priority = at91sam9261_default_irq_priority,
343 .extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
344 | (1 << AT91SAM9261_ID_IRQ2),
345 .ioremap_registers = at91sam9261_ioremap_registers, 345 .ioremap_registers = at91sam9261_ioremap_registers,
346 .register_clocks = at91sam9261_register_clocks, 346 .register_clocks = at91sam9261_register_clocks,
347 .init = at91sam9261_initialize, 347 .init = at91sam9261_initialize,
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index f44ffd2105a7..6ce7d1850893 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -327,7 +327,6 @@ static void __init at91sam9263_initialize(void)
327{ 327{
328 arm_pm_idle = at91sam9_idle; 328 arm_pm_idle = at91sam9_idle;
329 arm_pm_restart = at91sam9_alt_restart; 329 arm_pm_restart = at91sam9_alt_restart;
330 at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
331 330
332 /* Register GPIO subsystem */ 331 /* Register GPIO subsystem */
333 at91_gpio_init(at91sam9263_gpio, 5); 332 at91_gpio_init(at91sam9263_gpio, 5);
@@ -378,6 +377,7 @@ static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = {
378AT91_SOC_START(at91sam9263) 377AT91_SOC_START(at91sam9263)
379 .map_io = at91sam9263_map_io, 378 .map_io = at91sam9263_map_io,
380 .default_irq_priority = at91sam9263_default_irq_priority, 379 .default_irq_priority = at91sam9263_default_irq_priority,
380 .extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1),
381 .ioremap_registers = at91sam9263_ioremap_registers, 381 .ioremap_registers = at91sam9263_ioremap_registers,
382 .register_clocks = at91sam9263_register_clocks, 382 .register_clocks = at91sam9263_register_clocks,
383 .init = at91sam9263_initialize, 383 .init = at91sam9263_initialize,
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 8b7fce067652..fda502691686 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -374,7 +374,6 @@ static void __init at91sam9g45_initialize(void)
374{ 374{
375 arm_pm_idle = at91sam9_idle; 375 arm_pm_idle = at91sam9_idle;
376 arm_pm_restart = at91sam9g45_restart; 376 arm_pm_restart = at91sam9g45_restart;
377 at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
378 377
379 /* Register GPIO subsystem */ 378 /* Register GPIO subsystem */
380 at91_gpio_init(at91sam9g45_gpio, 5); 379 at91_gpio_init(at91sam9g45_gpio, 5);
@@ -425,6 +424,7 @@ static unsigned int at91sam9g45_default_irq_priority[NR_AIC_IRQS] __initdata = {
425AT91_SOC_START(at91sam9g45) 424AT91_SOC_START(at91sam9g45)
426 .map_io = at91sam9g45_map_io, 425 .map_io = at91sam9g45_map_io,
427 .default_irq_priority = at91sam9g45_default_irq_priority, 426 .default_irq_priority = at91sam9g45_default_irq_priority,
427 .extern_irq = (1 << AT91SAM9G45_ID_IRQ0),
428 .ioremap_registers = at91sam9g45_ioremap_registers, 428 .ioremap_registers = at91sam9g45_ioremap_registers,
429 .register_clocks = at91sam9g45_register_clocks, 429 .register_clocks = at91sam9g45_register_clocks,
430 .init = at91sam9g45_initialize, 430 .init = at91sam9g45_initialize,
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index f77fae5591bc..d4ec0d9a9872 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -293,7 +293,6 @@ static void __init at91sam9rl_initialize(void)
293{ 293{
294 arm_pm_idle = at91sam9_idle; 294 arm_pm_idle = at91sam9_idle;
295 arm_pm_restart = at91sam9_alt_restart; 295 arm_pm_restart = at91sam9_alt_restart;
296 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
297 296
298 /* Register GPIO subsystem */ 297 /* Register GPIO subsystem */
299 at91_gpio_init(at91sam9rl_gpio, 4); 298 at91_gpio_init(at91sam9rl_gpio, 4);
@@ -344,6 +343,7 @@ static unsigned int at91sam9rl_default_irq_priority[NR_AIC_IRQS] __initdata = {
344AT91_SOC_START(at91sam9rl) 343AT91_SOC_START(at91sam9rl)
345 .map_io = at91sam9rl_map_io, 344 .map_io = at91sam9rl_map_io,
346 .default_irq_priority = at91sam9rl_default_irq_priority, 345 .default_irq_priority = at91sam9rl_default_irq_priority,
346 .extern_irq = (1 << AT91SAM9RL_ID_IRQ0),
347 .ioremap_registers = at91sam9rl_ioremap_registers, 347 .ioremap_registers = at91sam9rl_ioremap_registers,
348 .register_clocks = at91sam9rl_register_clocks, 348 .register_clocks = at91sam9rl_register_clocks,
349 .init = at91sam9rl_initialize, 349 .init = at91sam9rl_initialize,
diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c
index 19ca79396905..bad94b84a46f 100644
--- a/arch/arm/mach-at91/at91x40.c
+++ b/arch/arm/mach-at91/at91x40.c
@@ -55,8 +55,6 @@ static void at91x40_idle(void)
55void __init at91x40_initialize(unsigned long main_clock) 55void __init at91x40_initialize(unsigned long main_clock)
56{ 56{
57 arm_pm_idle = at91x40_idle; 57 arm_pm_idle = at91x40_idle;
58 at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1)
59 | (1 << AT91X40_ID_IRQ2);
60} 58}
61 59
62/* 60/*
@@ -86,9 +84,10 @@ static unsigned int at91x40_default_irq_priority[NR_AIC_IRQS] __initdata = {
86 84
87void __init at91x40_init_interrupts(unsigned int priority[NR_AIC_IRQS]) 85void __init at91x40_init_interrupts(unsigned int priority[NR_AIC_IRQS])
88{ 86{
87 u32 extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1)
88 | (1 << AT91X40_ID_IRQ2);
89 if (!priority) 89 if (!priority)
90 priority = at91x40_default_irq_priority; 90 priority = at91x40_default_irq_priority;
91 91
92 at91_aic_init(priority, at91_extern_irq); 92 at91_aic_init(priority, extern_irq);
93} 93}
94
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 78ab06548658..f6de36aefe85 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -85,4 +85,4 @@ extern void __init at91_gpio_irq_setup(void);
85extern int __init at91_gpio_of_irq_setup(struct device_node *node, 85extern int __init at91_gpio_of_irq_setup(struct device_node *node,
86 struct device_node *parent); 86 struct device_node *parent);
87 87
88extern int at91_extern_irq; 88extern u32 at91_get_extern_irq(void);
diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c
index e0ca59171022..3d192c5aee66 100644
--- a/arch/arm/mach-at91/irq.c
+++ b/arch/arm/mach-at91/irq.c
@@ -232,7 +232,14 @@ static void __maybe_unused at91_aic5_eoi(struct irq_data *d)
232 at91_aic_write(AT91_AIC5_EOICR, 0); 232 at91_aic_write(AT91_AIC5_EOICR, 0);
233} 233}
234 234
235unsigned long *at91_extern_irq; 235static unsigned long *at91_extern_irq;
236
237u32 at91_get_extern_irq(void)
238{
239 if (!at91_extern_irq)
240 return 0;
241 return *at91_extern_irq;
242}
236 243
237#define is_extern_irq(hwirq) test_bit(hwirq, at91_extern_irq) 244#define is_extern_irq(hwirq) test_bit(hwirq, at91_extern_irq)
238 245
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 530db304ec5e..15afb5d9271f 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -212,7 +212,7 @@ static int at91_pm_enter(suspend_state_t state)
212 (at91_pmc_read(AT91_PMC_PCSR) 212 (at91_pmc_read(AT91_PMC_PCSR)
213 | (1 << AT91_ID_FIQ) 213 | (1 << AT91_ID_FIQ)
214 | (1 << AT91_ID_SYS) 214 | (1 << AT91_ID_SYS)
215 | (at91_extern_irq)) 215 | (at91_get_extern_irq()))
216 & at91_aic_read(AT91_AIC_IMR), 216 & at91_aic_read(AT91_AIC_IMR),
217 state); 217 state);
218 218
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 942dc00f1227..b17fbcf4d9e8 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -48,7 +48,7 @@ void __init at91_init_irq_default(void)
48void __init at91_init_interrupts(unsigned int *priority) 48void __init at91_init_interrupts(unsigned int *priority)
49{ 49{
50 /* Initialize the AIC interrupt controller */ 50 /* Initialize the AIC interrupt controller */
51 at91_aic_init(priority, at91_extern_irq); 51 at91_aic_init(priority, at91_boot_soc.extern_irq);
52 52
53 /* Enable GPIO interrupts */ 53 /* Enable GPIO interrupts */
54 at91_gpio_irq_setup(); 54 at91_gpio_irq_setup();
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index 43a225f9e713..a1e1482c6da8 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -6,6 +6,7 @@
6 6
7struct at91_init_soc { 7struct at91_init_soc {
8 int builtin; 8 int builtin;
9 u32 extern_irq;
9 unsigned int *default_irq_priority; 10 unsigned int *default_irq_priority;
10 void (*map_io)(void); 11 void (*map_io)(void);
11 void (*ioremap_registers)(void); 12 void (*ioremap_registers)(void);