提交 9836ee9f 编写于 作者: F Felipe Balbi 提交者: Tony Lindgren

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: NJason Cooper <jason@lakedaemon.net>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
Signed-off-by: NTony Lindgren <tony@atomide.com>
上级 8bb3b375
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
#define INTCPS_NR_ILR_REGS 128 #define INTCPS_NR_ILR_REGS 128
#define INTCPS_NR_MIR_REGS 3 #define INTCPS_NR_MIR_REGS 3
#define INTC_PROTECTION_ENABLE (1 << 0)
/* /*
* OMAP2 has a number of different interrupt controllers, each interrupt * OMAP2 has a number of different interrupt controllers, each interrupt
* controller is identified as its own "bank". Register definitions are * controller is identified as its own "bank". Register definitions are
...@@ -290,12 +292,28 @@ static int __init omap_init_irq_legacy(u32 base) ...@@ -290,12 +292,28 @@ static int __init omap_init_irq_legacy(u32 base)
return 0; return 0;
} }
static void __init omap_irq_enable_protection(void)
{
u32 reg;
reg = intc_readl(INTC_PROTECTION);
reg |= INTC_PROTECTION_ENABLE;
intc_writel(INTC_PROTECTION, reg);
}
static int __init omap_init_irq(u32 base, struct device_node *node) static int __init omap_init_irq(u32 base, struct device_node *node)
{ {
int ret;
if (node) if (node)
return omap_init_irq_of(node); ret = omap_init_irq_of(node);
else else
return omap_init_irq_legacy(base); ret = omap_init_irq_legacy(base);
if (ret == 0)
omap_irq_enable_protection();
return ret;
} }
static asmlinkage void __exception_irq_entry static asmlinkage void __exception_irq_entry
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册