Skip to content

Commit

Permalink
ARM: S3C24XX: Add FIQ IRQ routing support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Dooks authored and Ben Dooks committed Aug 14, 2009
1 parent 9b71de4 commit 229fd8f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
13 changes: 13 additions & 0 deletions arch/arm/plat-s3c24xx/include/plat/fiq.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* linux/include/asm-arm/plat-s3c24xx/fiq.h
*
* Copyright (c) 2009 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* Header file for S3C24XX CPU FIQ support
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

extern int s3c24xx_set_fiq(unsigned int irq, bool on);
36 changes: 36 additions & 0 deletions arch/arm/plat-s3c24xx/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,38 @@ s3c_irq_demux_extint4t7(unsigned int irq,
}
}

#ifdef CONFIG_FIQ
/**
* s3c24xx_set_fiq - set the FIQ routing
* @irq: IRQ number to route to FIQ on processor.
* @on: Whether to route @irq to the FIQ, or to remove the FIQ routing.
*
* Change the state of the IRQ to FIQ routing depending on @irq and @on. If
* @on is true, the @irq is checked to see if it can be routed and the
* interrupt controller updated to route the IRQ. If @on is false, the FIQ
* routing is cleared, regardless of which @irq is specified.
*/
int s3c24xx_set_fiq(unsigned int irq, bool on)
{
u32 intmod;
unsigned offs;

if (on) {
offs = irq - FIQ_START;
if (offs > 31)
return -EINVAL;

intmod = 1 << offs;
} else {
intmod = 0;
}

__raw_writel(intmod, S3C2410_INTMOD);
return 0;
}
#endif


/* s3c24xx_init_irq
*
* Initialise S3C2410 IRQ system
Expand All @@ -505,6 +537,10 @@ void __init s3c24xx_init_irq(void)
int irqno;
int i;

#ifdef CONFIG_FIQ
init_FIQ();
#endif

irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");

/* first, clear all interrupts pending... */
Expand Down

0 comments on commit 229fd8f

Please sign in to comment.