aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/irqchip/irq-omap-intc.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2014-09-15 17:15:06 -0400
committerTony Lindgren <tony@atomide.com>2014-09-16 17:45:00 -0400
commit9836ee9f87dc669c8ce2b24ba986600a6977ca8b (patch)
tree37ce853d4508b26a06be474a2d31aab9ffa66849 /drivers/irqchip/irq-omap-intc.c
parent8bb3b375c8837ea73740883a90b1d7719b2653cc (diff)
irqchip: omap-intc: enable IP protection
When PROTECTION bit in enabled in PROTECTION register, INTC's registers are only accessible from privileged mode. Acked-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/irqchip/irq-omap-intc.c')
-rw-r--r--drivers/irqchip/irq-omap-intc.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c
index e97b53539386..7681b1329976 100644
--- a/drivers/irqchip/irq-omap-intc.c
+++ b/drivers/irqchip/irq-omap-intc.c
@@ -51,6 +51,8 @@
51#define INTCPS_NR_ILR_REGS 128 51#define INTCPS_NR_ILR_REGS 128
52#define INTCPS_NR_MIR_REGS 3 52#define INTCPS_NR_MIR_REGS 3
53 53
54#define INTC_PROTECTION_ENABLE (1 << 0)
55
54/* 56/*
55 * OMAP2 has a number of different interrupt controllers, each interrupt 57 * OMAP2 has a number of different interrupt controllers, each interrupt
56 * controller is identified as its own "bank". Register definitions are 58 * controller is identified as its own "bank". Register definitions are
@@ -290,12 +292,28 @@ static int __init omap_init_irq_legacy(u32 base)
290 return 0; 292 return 0;
291} 293}
292 294
295static void __init omap_irq_enable_protection(void)
296{
297 u32 reg;
298
299 reg = intc_readl(INTC_PROTECTION);
300 reg |= INTC_PROTECTION_ENABLE;
301 intc_writel(INTC_PROTECTION, reg);
302}
303
293static int __init omap_init_irq(u32 base, struct device_node *node) 304static int __init omap_init_irq(u32 base, struct device_node *node)
294{ 305{
306 int ret;
307
295 if (node) 308 if (node)
296 return omap_init_irq_of(node); 309 ret = omap_init_irq_of(node);
297 else 310 else
298 return omap_init_irq_legacy(base); 311 ret = omap_init_irq_legacy(base);
312
313 if (ret == 0)
314 omap_irq_enable_protection();
315
316 return ret;
299} 317}
300 318
301static asmlinkage void __exception_irq_entry 319static asmlinkage void __exception_irq_entry