diff options
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/fiq.h | 13 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/irq.c | 36 |
2 files changed, 49 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c24xx/include/plat/fiq.h b/arch/arm/plat-s3c24xx/include/plat/fiq.h new file mode 100644 index 000000000000..8521b8372c5f --- /dev/null +++ b/arch/arm/plat-s3c24xx/include/plat/fiq.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/fiq.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for S3C24XX CPU FIQ support | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | extern int s3c24xx_set_fiq(unsigned int irq, bool on); | ||
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c index 958737775ad2..d02f5f02045e 100644 --- a/arch/arm/plat-s3c24xx/irq.c +++ b/arch/arm/plat-s3c24xx/irq.c | |||
@@ -493,6 +493,38 @@ s3c_irq_demux_extint4t7(unsigned int irq, | |||
493 | } | 493 | } |
494 | } | 494 | } |
495 | 495 | ||
496 | #ifdef CONFIG_FIQ | ||
497 | /** | ||
498 | * s3c24xx_set_fiq - set the FIQ routing | ||
499 | * @irq: IRQ number to route to FIQ on processor. | ||
500 | * @on: Whether to route @irq to the FIQ, or to remove the FIQ routing. | ||
501 | * | ||
502 | * Change the state of the IRQ to FIQ routing depending on @irq and @on. If | ||
503 | * @on is true, the @irq is checked to see if it can be routed and the | ||
504 | * interrupt controller updated to route the IRQ. If @on is false, the FIQ | ||
505 | * routing is cleared, regardless of which @irq is specified. | ||
506 | */ | ||
507 | int s3c24xx_set_fiq(unsigned int irq, bool on) | ||
508 | { | ||
509 | u32 intmod; | ||
510 | unsigned offs; | ||
511 | |||
512 | if (on) { | ||
513 | offs = irq - FIQ_START; | ||
514 | if (offs > 31) | ||
515 | return -EINVAL; | ||
516 | |||
517 | intmod = 1 << offs; | ||
518 | } else { | ||
519 | intmod = 0; | ||
520 | } | ||
521 | |||
522 | __raw_writel(intmod, S3C2410_INTMOD); | ||
523 | return 0; | ||
524 | } | ||
525 | #endif | ||
526 | |||
527 | |||
496 | /* s3c24xx_init_irq | 528 | /* s3c24xx_init_irq |
497 | * | 529 | * |
498 | * Initialise S3C2410 IRQ system | 530 | * Initialise S3C2410 IRQ system |
@@ -505,6 +537,10 @@ void __init s3c24xx_init_irq(void) | |||
505 | int irqno; | 537 | int irqno; |
506 | int i; | 538 | int i; |
507 | 539 | ||
540 | #ifdef CONFIG_FIQ | ||
541 | init_FIQ(); | ||
542 | #endif | ||
543 | |||
508 | irqdbf("s3c2410_init_irq: clearing interrupt status flags\n"); | 544 | irqdbf("s3c2410_init_irq: clearing interrupt status flags\n"); |
509 | 545 | ||
510 | /* first, clear all interrupts pending... */ | 546 | /* first, clear all interrupts pending... */ |