aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/avic.c
diff options
context:
space:
mode:
authorPeter Horton <phorton@bitbox.co.uk>2010-12-06 06:37:38 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2010-12-14 03:54:37 -0500
commitcdc3f10630ecddb7870e087ff9679eef3d7b4e21 (patch)
treebcffe39f52a334e9ad8e56b15843a42e228988da /arch/arm/plat-mxc/avic.c
parent8be9252f7ccde4148e4b203bf64d38ae66b111e4 (diff)
mx51: support FIQ on TZIC, revised
Add support for FIQ on mx51 TZIC TZIC changes tested with FIQ audio on an mx51 board AVIC changes build with mx3_defconfig, not tested Signed-off-by: Peter Horton <phorton@bitbox.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/avic.c')
-rw-r--r--arch/arm/plat-mxc/avic.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/arch/arm/plat-mxc/avic.c b/arch/arm/plat-mxc/avic.c
index 7331f2ace5fe..9a4e8a22dd0a 100644
--- a/arch/arm/plat-mxc/avic.c
+++ b/arch/arm/plat-mxc/avic.c
@@ -24,6 +24,8 @@
24#include <asm/mach/irq.h> 24#include <asm/mach/irq.h>
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26 26
27#include "irq-common.h"
28
27#define AVIC_INTCNTL 0x00 /* int control reg */ 29#define AVIC_INTCNTL 0x00 /* int control reg */
28#define AVIC_NIMASK 0x04 /* int mask reg */ 30#define AVIC_NIMASK 0x04 /* int mask reg */
29#define AVIC_INTENNUM 0x08 /* int enable number reg */ 31#define AVIC_INTENNUM 0x08 /* int enable number reg */
@@ -46,9 +48,9 @@
46 48
47void __iomem *avic_base; 49void __iomem *avic_base;
48 50
49int imx_irq_set_priority(unsigned char irq, unsigned char prio)
50{
51#ifdef CONFIG_MXC_IRQ_PRIOR 51#ifdef CONFIG_MXC_IRQ_PRIOR
52static int avic_irq_set_priority(unsigned char irq, unsigned char prio)
53{
52 unsigned int temp; 54 unsigned int temp;
53 unsigned int mask = 0x0F << irq % 8 * 4; 55 unsigned int mask = 0x0F << irq % 8 * 4;
54 56
@@ -62,14 +64,11 @@ int imx_irq_set_priority(unsigned char irq, unsigned char prio)
62 __raw_writel(temp, avic_base + AVIC_NIPRIORITY(irq / 8)); 64 __raw_writel(temp, avic_base + AVIC_NIPRIORITY(irq / 8));
63 65
64 return 0; 66 return 0;
65#else
66 return -ENOSYS;
67#endif
68} 67}
69EXPORT_SYMBOL(imx_irq_set_priority); 68#endif
70 69
71#ifdef CONFIG_FIQ 70#ifdef CONFIG_FIQ
72int mxc_set_irq_fiq(unsigned int irq, unsigned int type) 71static int avic_set_irq_fiq(unsigned int irq, unsigned int type)
73{ 72{
74 unsigned int irqt; 73 unsigned int irqt;
75 74
@@ -87,7 +86,6 @@ int mxc_set_irq_fiq(unsigned int irq, unsigned int type)
87 86
88 return 0; 87 return 0;
89} 88}
90EXPORT_SYMBOL(mxc_set_irq_fiq);
91#endif /* CONFIG_FIQ */ 89#endif /* CONFIG_FIQ */
92 90
93/* Disable interrupt number "irq" in the AVIC */ 91/* Disable interrupt number "irq" in the AVIC */
@@ -102,10 +100,18 @@ static void mxc_unmask_irq(unsigned int irq)
102 __raw_writel(irq, avic_base + AVIC_INTENNUM); 100 __raw_writel(irq, avic_base + AVIC_INTENNUM);
103} 101}
104 102
105static struct irq_chip mxc_avic_chip = { 103static struct mxc_irq_chip mxc_avic_chip = {
106 .ack = mxc_mask_irq, 104 .base = {
107 .mask = mxc_mask_irq, 105 .ack = mxc_mask_irq,
108 .unmask = mxc_unmask_irq, 106 .mask = mxc_mask_irq,
107 .unmask = mxc_unmask_irq,
108 },
109#ifdef CONFIG_MXC_IRQ_PRIOR
110 .set_priority = avic_irq_set_priority,
111#endif
112#ifdef CONFIG_FIQ
113 .set_irq_fiq = avic_set_irq_fiq,
114#endif
109}; 115};
110 116
111/* 117/*
@@ -133,7 +139,7 @@ void __init mxc_init_irq(void __iomem *irqbase)
133 __raw_writel(0, avic_base + AVIC_INTTYPEH); 139 __raw_writel(0, avic_base + AVIC_INTTYPEH);
134 __raw_writel(0, avic_base + AVIC_INTTYPEL); 140 __raw_writel(0, avic_base + AVIC_INTTYPEL);
135 for (i = 0; i < MXC_INTERNAL_IRQS; i++) { 141 for (i = 0; i < MXC_INTERNAL_IRQS; i++) {
136 set_irq_chip(i, &mxc_avic_chip); 142 set_irq_chip(i, &mxc_avic_chip.base);
137 set_irq_handler(i, handle_level_irq); 143 set_irq_handler(i, handle_level_irq);
138 set_irq_flags(i, IRQF_VALID); 144 set_irq_flags(i, IRQF_VALID);
139 } 145 }