aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Dooks <ben@simtec.co.uk>2009-08-03 12:26:57 -0400
committerBen Dooks <ben-linux@fluff.org>2009-08-13 20:13:28 -0400
commit229fd8ffba57dfaea59078b9144371369ffdb0a3 (patch)
tree4332e1d442d7db803574154d5443d2016d442347
parent9b71de49b030ad8fd4d13d38571b5c42dc9ed8dd (diff)
ARM: S3C24XX: Add FIQ IRQ routing support
Add support for routing an IRQ from the normal ARM IRQ mechanism to the FIQ input of the processor. Note, also fix a bug where the init_FIQ() function has not been called when CONFIG_FIQ is enabled. Signed-off-by; Ben Dooks <ben@simtec.co.uk> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/fiq.h13
-rw-r--r--arch/arm/plat-s3c24xx/irq.c36
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
13extern 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 */
507int 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... */