diff options
author | viresh kumar <viresh.kumar@st.com> | 2010-05-03 04:24:30 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-04 11:54:54 -0400 |
commit | 4c18e77f718cdda33363132127db4df795eadbd9 (patch) | |
tree | bbecdc08f487246049bb6d0c212d338a9056597a /arch/arm/mach-spear3xx/spear320.c | |
parent | ff37f6e5910c4fd7ad42063d89c0687def665941 (diff) |
ARM: 6091/1: ST SPEAr: Adding support for shared irq layer
Multiple peripherals in SPEAr share common hardware interrupt lines.
This patch adds support for a shared irq layer, which registers hardware
irqs by itself and exposes virtual irq numbers to peripherals.
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-spear3xx/spear320.c')
-rw-r--r-- | arch/arm/mach-spear3xx/spear320.c | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/arch/arm/mach-spear3xx/spear320.c b/arch/arm/mach-spear3xx/spear320.c index 2cedf5eb9ec9..6a1219549369 100644 --- a/arch/arm/mach-spear3xx/spear320.c +++ b/arch/arm/mach-spear3xx/spear320.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/irq.h> | 15 | #include <asm/irq.h> |
16 | #include <mach/generic.h> | 16 | #include <mach/generic.h> |
17 | #include <mach/spear.h> | 17 | #include <mach/spear.h> |
18 | #include <plat/shirq.h> | ||
18 | 19 | ||
19 | /* pad multiplexing support */ | 20 | /* pad multiplexing support */ |
20 | /* muxing registers */ | 21 | /* muxing registers */ |
@@ -385,11 +386,160 @@ struct pmx_driver pmx_driver = { | |||
385 | 386 | ||
386 | /* Add spear320 specific devices here */ | 387 | /* Add spear320 specific devices here */ |
387 | 388 | ||
389 | /* spear3xx shared irq */ | ||
390 | struct shirq_dev_config shirq_ras1_config[] = { | ||
391 | { | ||
392 | .virq = VIRQ_EMI, | ||
393 | .status_mask = EMI_IRQ_MASK, | ||
394 | .clear_mask = EMI_IRQ_MASK, | ||
395 | }, { | ||
396 | .virq = VIRQ_CLCD, | ||
397 | .status_mask = CLCD_IRQ_MASK, | ||
398 | .clear_mask = CLCD_IRQ_MASK, | ||
399 | }, { | ||
400 | .virq = VIRQ_SPP, | ||
401 | .status_mask = SPP_IRQ_MASK, | ||
402 | .clear_mask = SPP_IRQ_MASK, | ||
403 | }, | ||
404 | }; | ||
405 | |||
406 | struct spear_shirq shirq_ras1 = { | ||
407 | .irq = IRQ_GEN_RAS_1, | ||
408 | .dev_config = shirq_ras1_config, | ||
409 | .dev_count = ARRAY_SIZE(shirq_ras1_config), | ||
410 | .regs = { | ||
411 | .enb_reg = -1, | ||
412 | .status_reg = INT_STS_MASK_REG, | ||
413 | .status_reg_mask = SHIRQ_RAS1_MASK, | ||
414 | .clear_reg = INT_CLR_MASK_REG, | ||
415 | .reset_to_clear = 1, | ||
416 | }, | ||
417 | }; | ||
418 | |||
419 | struct shirq_dev_config shirq_ras3_config[] = { | ||
420 | { | ||
421 | .virq = VIRQ_PLGPIO, | ||
422 | .enb_mask = GPIO_IRQ_MASK, | ||
423 | .status_mask = GPIO_IRQ_MASK, | ||
424 | .clear_mask = GPIO_IRQ_MASK, | ||
425 | }, { | ||
426 | .virq = VIRQ_I2S_PLAY, | ||
427 | .enb_mask = I2S_PLAY_IRQ_MASK, | ||
428 | .status_mask = I2S_PLAY_IRQ_MASK, | ||
429 | .clear_mask = I2S_PLAY_IRQ_MASK, | ||
430 | }, { | ||
431 | .virq = VIRQ_I2S_REC, | ||
432 | .enb_mask = I2S_REC_IRQ_MASK, | ||
433 | .status_mask = I2S_REC_IRQ_MASK, | ||
434 | .clear_mask = I2S_REC_IRQ_MASK, | ||
435 | }, | ||
436 | }; | ||
437 | |||
438 | struct spear_shirq shirq_ras3 = { | ||
439 | .irq = IRQ_GEN_RAS_3, | ||
440 | .dev_config = shirq_ras3_config, | ||
441 | .dev_count = ARRAY_SIZE(shirq_ras3_config), | ||
442 | .regs = { | ||
443 | .enb_reg = INT_ENB_MASK_REG, | ||
444 | .reset_to_enb = 1, | ||
445 | .status_reg = INT_STS_MASK_REG, | ||
446 | .status_reg_mask = SHIRQ_RAS3_MASK, | ||
447 | .clear_reg = INT_CLR_MASK_REG, | ||
448 | .reset_to_clear = 1, | ||
449 | }, | ||
450 | }; | ||
451 | |||
452 | struct shirq_dev_config shirq_intrcomm_ras_config[] = { | ||
453 | { | ||
454 | .virq = VIRQ_CANU, | ||
455 | .status_mask = CAN_U_IRQ_MASK, | ||
456 | .clear_mask = CAN_U_IRQ_MASK, | ||
457 | }, { | ||
458 | .virq = VIRQ_CANL, | ||
459 | .status_mask = CAN_L_IRQ_MASK, | ||
460 | .clear_mask = CAN_L_IRQ_MASK, | ||
461 | }, { | ||
462 | .virq = VIRQ_UART1, | ||
463 | .status_mask = UART1_IRQ_MASK, | ||
464 | .clear_mask = UART1_IRQ_MASK, | ||
465 | }, { | ||
466 | .virq = VIRQ_UART2, | ||
467 | .status_mask = UART2_IRQ_MASK, | ||
468 | .clear_mask = UART2_IRQ_MASK, | ||
469 | }, { | ||
470 | .virq = VIRQ_SSP1, | ||
471 | .status_mask = SSP1_IRQ_MASK, | ||
472 | .clear_mask = SSP1_IRQ_MASK, | ||
473 | }, { | ||
474 | .virq = VIRQ_SSP2, | ||
475 | .status_mask = SSP2_IRQ_MASK, | ||
476 | .clear_mask = SSP2_IRQ_MASK, | ||
477 | }, { | ||
478 | .virq = VIRQ_SMII0, | ||
479 | .status_mask = SMII0_IRQ_MASK, | ||
480 | .clear_mask = SMII0_IRQ_MASK, | ||
481 | }, { | ||
482 | .virq = VIRQ_MII1_SMII1, | ||
483 | .status_mask = MII1_SMII1_IRQ_MASK, | ||
484 | .clear_mask = MII1_SMII1_IRQ_MASK, | ||
485 | }, { | ||
486 | .virq = VIRQ_WAKEUP_SMII0, | ||
487 | .status_mask = WAKEUP_SMII0_IRQ_MASK, | ||
488 | .clear_mask = WAKEUP_SMII0_IRQ_MASK, | ||
489 | }, { | ||
490 | .virq = VIRQ_WAKEUP_MII1_SMII1, | ||
491 | .status_mask = WAKEUP_MII1_SMII1_IRQ_MASK, | ||
492 | .clear_mask = WAKEUP_MII1_SMII1_IRQ_MASK, | ||
493 | }, { | ||
494 | .virq = VIRQ_I2C, | ||
495 | .status_mask = I2C1_IRQ_MASK, | ||
496 | .clear_mask = I2C1_IRQ_MASK, | ||
497 | }, | ||
498 | }; | ||
499 | |||
500 | struct spear_shirq shirq_intrcomm_ras = { | ||
501 | .irq = IRQ_INTRCOMM_RAS_ARM, | ||
502 | .dev_config = shirq_intrcomm_ras_config, | ||
503 | .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config), | ||
504 | .regs = { | ||
505 | .enb_reg = -1, | ||
506 | .status_reg = INT_STS_MASK_REG, | ||
507 | .status_reg_mask = SHIRQ_INTRCOMM_RAS_MASK, | ||
508 | .clear_reg = INT_CLR_MASK_REG, | ||
509 | .reset_to_clear = 1, | ||
510 | }, | ||
511 | }; | ||
512 | |||
388 | /* spear320 routines */ | 513 | /* spear320 routines */ |
389 | void __init spear320_init(void) | 514 | void __init spear320_init(void) |
390 | { | 515 | { |
516 | void __iomem *base; | ||
517 | int ret = 0; | ||
518 | |||
391 | /* call spear3xx family common init function */ | 519 | /* call spear3xx family common init function */ |
392 | spear3xx_init(); | 520 | spear3xx_init(); |
521 | |||
522 | /* shared irq registeration */ | ||
523 | base = ioremap(SPEAR320_SOC_CONFIG_BASE, SPEAR320_SOC_CONFIG_SIZE); | ||
524 | if (base) { | ||
525 | /* shirq 1 */ | ||
526 | shirq_ras1.regs.base = base; | ||
527 | ret = spear_shirq_register(&shirq_ras1); | ||
528 | if (ret) | ||
529 | printk(KERN_ERR "Error registering Shared IRQ 1\n"); | ||
530 | |||
531 | /* shirq 3 */ | ||
532 | shirq_ras3.regs.base = base; | ||
533 | ret = spear_shirq_register(&shirq_ras3); | ||
534 | if (ret) | ||
535 | printk(KERN_ERR "Error registering Shared IRQ 3\n"); | ||
536 | |||
537 | /* shirq 4 */ | ||
538 | shirq_intrcomm_ras.regs.base = base; | ||
539 | ret = spear_shirq_register(&shirq_intrcomm_ras); | ||
540 | if (ret) | ||
541 | printk(KERN_ERR "Error registering Shared IRQ 4\n"); | ||
542 | } | ||
393 | } | 543 | } |
394 | 544 | ||
395 | void spear320_pmx_init(void) | 545 | void spear320_pmx_init(void) |