aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mti-malta
diff options
context:
space:
mode:
authorSteven J. Hill <sjhill@mips.com>2012-08-31 17:05:37 -0400
committerSteven J. Hill <sjhill@mips.com>2012-09-13 16:43:47 -0400
commit0b271f5600b5ae56d331a18da830e33f9fb0acdc (patch)
treed49f4e86e0563aa212545587adacb15170978082 /arch/mips/mti-malta
parentec47b27434eff8ad41e7389efca1e5a6ca8b519a (diff)
MIPS: Make GIC code platform independent.
The GIC interrupt code is used by multiple platforms and the current code was half Malta dependent code. These changes abstract away the platform specific differences. Signed-off-by: Steven J. Hill <sjhill@mips.com>
Diffstat (limited to 'arch/mips/mti-malta')
-rw-r--r--arch/mips/mti-malta/malta-int.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
index 7b13a4caeea4..5222a7cc41e4 100644
--- a/arch/mips/mti-malta/malta-int.c
+++ b/arch/mips/mti-malta/malta-int.c
@@ -747,3 +747,37 @@ int malta_be_handler(struct pt_regs *regs, int is_fixup)
747 747
748 return retval; 748 return retval;
749} 749}
750
751void gic_enable_interrupt(int irq_vec)
752{
753 GIC_SET_INTR_MASK(irq_vec);
754}
755
756void gic_disable_interrupt(int irq_vec)
757{
758 GIC_CLR_INTR_MASK(irq_vec);
759}
760
761void gic_irq_ack(struct irq_data *d)
762{
763 int irq = (d->irq - gic_irq_base);
764
765 GIC_CLR_INTR_MASK(irq);
766
767 if (gic_irq_flags[irq] & GIC_TRIG_EDGE)
768 GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), irq);
769}
770
771void gic_finish_irq(struct irq_data *d)
772{
773 /* Enable interrupts. */
774 GIC_SET_INTR_MASK(d->irq - gic_irq_base);
775}
776
777void __init gic_platform_init(int irqs, struct irq_chip *irq_controller)
778{
779 int i;
780
781 for (i = gic_irq_base; i < (gic_irq_base + irqs); i++)
782 irq_set_chip(i, irq_controller);
783}