Commit 52edbcc8 authored by Sudhakar Rajashekhara's avatar Sudhakar Rajashekhara Committed by Kevin Hilman

ARM: DaVinci: interrupt priorities assignment for dm646x

Interrupt priorities assignment for dm646x.
Signed-off-by: default avatarSudhakar Rajashekhara <sudhakar.raj@ti.com>
parent 7520ace8
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include <linux/io.h> #include <linux/io.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/cpu.h>
#include <asm/io.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#define IRQ_BIT(irq) ((irq) & 0x1f) #define IRQ_BIT(irq) ((irq) & 0x1f)
...@@ -40,6 +42,8 @@ ...@@ -40,6 +42,8 @@
#define IRQ_INTPRI0_REG_OFFSET 0x0030 #define IRQ_INTPRI0_REG_OFFSET 0x0030
#define IRQ_INTPRI7_REG_OFFSET 0x004C #define IRQ_INTPRI7_REG_OFFSET 0x004C
const u8 *davinci_def_priorities;
static inline unsigned int davinci_irq_readl(int offset) static inline unsigned int davinci_irq_readl(int offset)
{ {
return davinci_readl(DAVINCI_ARM_INTC_BASE + offset); return davinci_readl(DAVINCI_ARM_INTC_BASE + offset);
...@@ -108,9 +112,8 @@ static struct irq_chip davinci_irq_chip_0 = { ...@@ -108,9 +112,8 @@ static struct irq_chip davinci_irq_chip_0 = {
.unmask = davinci_unmask_irq, .unmask = davinci_unmask_irq,
}; };
/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */ /* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
static const u8 default_priorities[DAVINCI_N_AINTC_IRQ] __initdata = { static const u8 dm644x_default_priorities[DAVINCI_N_AINTC_IRQ] __initdata = {
[IRQ_VDINT0] = 2, [IRQ_VDINT0] = 2,
[IRQ_VDINT1] = 6, [IRQ_VDINT1] = 6,
[IRQ_VDINT2] = 6, [IRQ_VDINT2] = 6,
...@@ -177,11 +180,82 @@ static const u8 default_priorities[DAVINCI_N_AINTC_IRQ] __initdata = { ...@@ -177,11 +180,82 @@ static const u8 default_priorities[DAVINCI_N_AINTC_IRQ] __initdata = {
[IRQ_EMUINT] = 7, [IRQ_EMUINT] = 7,
}; };
static const u8 dm646x_default_priorities[DAVINCI_N_AINTC_IRQ] = {
[IRQ_DM646X_VP_VERTINT0] = 7,
[IRQ_DM646X_VP_VERTINT1] = 7,
[IRQ_DM646X_VP_VERTINT2] = 7,
[IRQ_DM646X_VP_VERTINT3] = 7,
[IRQ_DM646X_VP_ERRINT] = 7,
[IRQ_DM646X_RESERVED_1] = 7,
[IRQ_DM646X_RESERVED_2] = 7,
[IRQ_DM646X_WDINT] = 7,
[IRQ_DM646X_CRGENINT0] = 7,
[IRQ_DM646X_CRGENINT1] = 7,
[IRQ_DM646X_TSIFINT0] = 7,
[IRQ_DM646X_TSIFINT1] = 7,
[IRQ_DM646X_VDCEINT] = 7,
[IRQ_DM646X_USBINT] = 7,
[IRQ_DM646X_USBDMAINT] = 7,
[IRQ_DM646X_PCIINT] = 7,
[IRQ_CCINT0] = 7, /* dma */
[IRQ_CCERRINT] = 7, /* dma */
[IRQ_TCERRINT0] = 7, /* dma */
[IRQ_TCERRINT] = 7, /* dma */
[IRQ_DM646X_TCERRINT2] = 7,
[IRQ_DM646X_TCERRINT3] = 7,
[IRQ_DM646X_IDE] = 7,
[IRQ_DM646X_HPIINT] = 7,
[IRQ_DM646X_EMACRXTHINT] = 7,
[IRQ_DM646X_EMACRXINT] = 7,
[IRQ_DM646X_EMACTXINT] = 7,
[IRQ_DM646X_EMACMISCINT] = 7,
[IRQ_DM646X_MCASP0TXINT] = 7,
[IRQ_DM646X_MCASP0RXINT] = 7,
[IRQ_AEMIFINT] = 7,
[IRQ_DM646X_RESERVED_3] = 7,
[IRQ_DM646X_MCASP1TXINT] = 7, /* clockevent */
[IRQ_TINT0_TINT34] = 7, /* clocksource */
[IRQ_TINT1_TINT12] = 7, /* DSP timer */
[IRQ_TINT1_TINT34] = 7, /* system tick */
[IRQ_PWMINT0] = 7,
[IRQ_PWMINT1] = 7,
[IRQ_DM646X_VLQINT] = 7,
[IRQ_I2C] = 7,
[IRQ_UARTINT0] = 7,
[IRQ_UARTINT1] = 7,
[IRQ_DM646X_UARTINT2] = 7,
[IRQ_DM646X_SPINT0] = 7,
[IRQ_DM646X_SPINT1] = 7,
[IRQ_DM646X_DSP2ARMINT] = 7,
[IRQ_DM646X_RESERVED_4] = 7,
[IRQ_DM646X_PSCINT] = 7,
[IRQ_DM646X_GPIO0] = 7,
[IRQ_DM646X_GPIO1] = 7,
[IRQ_DM646X_GPIO2] = 7,
[IRQ_DM646X_GPIO3] = 7,
[IRQ_DM646X_GPIO4] = 7,
[IRQ_DM646X_GPIO5] = 7,
[IRQ_DM646X_GPIO6] = 7,
[IRQ_DM646X_GPIO7] = 7,
[IRQ_DM646X_GPIOBNK0] = 7,
[IRQ_DM646X_GPIOBNK1] = 7,
[IRQ_DM646X_GPIOBNK2] = 7,
[IRQ_DM646X_DDRINT] = 7,
[IRQ_DM646X_AEMIFINT] = 7,
[IRQ_COMMTX] = 7,
[IRQ_COMMRX] = 7,
[IRQ_EMUINT] = 7,
};
/* ARM Interrupt Controller Initialization */ /* ARM Interrupt Controller Initialization */
void __init davinci_irq_init(void) void __init davinci_irq_init(void)
{ {
unsigned i; unsigned i;
const u8 *priority = default_priorities;
if (cpu_is_davinci_dm644x())
davinci_def_priorities = dm644x_default_priorities;
else if (cpu_is_davinci_dm646x())
davinci_def_priorities = dm646x_default_priorities;
/* Clear all interrupt requests */ /* Clear all interrupt requests */
davinci_irq_writel(~0x0, FIQ_REG0_OFFSET); davinci_irq_writel(~0x0, FIQ_REG0_OFFSET);
...@@ -209,8 +283,8 @@ void __init davinci_irq_init(void) ...@@ -209,8 +283,8 @@ void __init davinci_irq_init(void)
unsigned j; unsigned j;
u32 pri; u32 pri;
for (j = 0, pri = 0; j < 32; j += 4, priority++) for (j = 0, pri = 0; j < 32; j += 4, davinci_def_priorities++)
pri |= (*priority & 0x07) << j; pri |= (*davinci_def_priorities & 0x07) << j;
davinci_irq_writel(pri, i); davinci_irq_writel(pri, i);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment