aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-common
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2012-06-29 06:19:29 -0400
committerBob Liu <lliubbo@gmail.com>2012-07-24 01:39:52 -0400
commite0a593104d43dc98250984daa1b82f964835fcfa (patch)
treeed8202bb9b2ab089871cd9d87c455c97ae496f4f /arch/blackfin/mach-common
parent11b27cb5b97319bae0a1604ddac85b9b08802a7e (diff)
bf60x: sec: Enable sec interrupt source priority configuration.
Customize the SEC interrupt priority array in machine ints-priority.c. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bob Liu <lliubbo@gmail.com>
Diffstat (limited to 'arch/blackfin/mach-common')
-rw-r--r--arch/blackfin/mach-common/ints-priority.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c
index a7e97a3607da..5a109a184021 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -310,6 +310,23 @@ static void bfin_sec_disable(struct irq_data *d)
310 hard_local_irq_restore(flags); 310 hard_local_irq_restore(flags);
311} 311}
312 312
313static void bfin_sec_set_priority(unsigned int sec_int_levels, u8 *sec_int_priority)
314{
315 unsigned long flags = hard_local_irq_save();
316 uint32_t reg_sctl;
317 int i;
318
319 bfin_write_SEC_SCI(0, SEC_CPLVL, sec_int_levels);
320
321 for (i = 0; i < SYS_IRQS - BFIN_IRQ(0); i++) {
322 reg_sctl = bfin_read_SEC_SCTL(i) & ~SEC_SCTL_PRIO;
323 reg_sctl |= sec_int_priority[i] << SEC_SCTL_PRIO_OFFSET;
324 bfin_write_SEC_SCTL(i, reg_sctl);
325 }
326
327 hard_local_irq_restore(flags);
328}
329
313static void bfin_sec_raise_irq(unsigned int sid) 330static void bfin_sec_raise_irq(unsigned int sid)
314{ 331{
315 unsigned long flags = hard_local_irq_save(); 332 unsigned long flags = hard_local_irq_save();
@@ -1534,6 +1551,10 @@ int __init init_arch_irq(void)
1534 1551
1535 printk(KERN_INFO "Configuring Blackfin Priority Driven Interrupts\n"); 1552 printk(KERN_INFO "Configuring Blackfin Priority Driven Interrupts\n");
1536 1553
1554 bfin_sec_set_priority(CONFIG_SEC_IRQ_PRIORITY_LEVELS, sec_int_priority);
1555
1556 bfin_sec_set_priority(CONFIG_SEC_IRQ_PRIORITY_LEVELS, sec_int_priority);
1557
1537 /* Enable interrupts IVG7-15 */ 1558 /* Enable interrupts IVG7-15 */
1538 bfin_irq_flags |= IMASK_IVG15 | 1559 bfin_irq_flags |= IMASK_IVG15 |
1539 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 | 1560 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 |