Commit 5c3e4ec4 authored by Jon Hunter's avatar Jon Hunter Committed by Paul Walmsley

ARM: OMAP: Add a timer attribute for timers that can interrupt the DSP

Some instances of the DMTIMER peripheral on OMAP devices have the ability
to interrupt the on-chip DSP in addition to the ARM CPU. Add a DMTIMER
attribute to indicate which timers can interrupt the DSP. By using the
omap_dm_timer_request_by_cap() API, driver will now be able to allocate
a DMTIMER that can interrupt the DSP based upon this attribute and not require
the driver to know which instance has this capability.

DMTIMERs that have the ability to interrupt the DSP on OMAP devices are as
follows ...

- OMAP1 (OMAP5912/16xx/17xx) devices	- All 8 DMTIMERs
- OMAP2/3/4 devices			- DMTIMERs 5-8

Please note that for OMAP3+, timer8 has the ability to interrupt the DSP and
generate a PWM output.
Signed-off-by: default avatarJon Hunter <jon-hunter@ti.com>
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
parent fe47c58b
...@@ -141,7 +141,7 @@ static int __init omap1_dm_timer_init(void) ...@@ -141,7 +141,7 @@ static int __init omap1_dm_timer_init(void)
pdata->set_timer_src = omap1_dm_timer_set_src; pdata->set_timer_src = omap1_dm_timer_set_src;
pdata->timer_capability = OMAP_TIMER_ALWON | pdata->timer_capability = OMAP_TIMER_ALWON |
OMAP_TIMER_NEEDS_RESET; OMAP_TIMER_NEEDS_RESET | OMAP_TIMER_HAS_DSP_IRQ;
ret = platform_device_add_data(pdev, pdata, sizeof(*pdata)); ret = platform_device_add_data(pdev, pdata, sizeof(*pdata));
if (ret) { if (ret) {
......
...@@ -240,6 +240,11 @@ static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = { ...@@ -240,6 +240,11 @@ static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
.timer_capability = OMAP_TIMER_HAS_PWM, .timer_capability = OMAP_TIMER_HAS_PWM,
}; };
/* timers with DSP interrupt dev attribute */
static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = {
.timer_capability = OMAP_TIMER_HAS_DSP_IRQ,
};
/* timer1 */ /* timer1 */
struct omap_hwmod omap2xxx_timer1_hwmod = { struct omap_hwmod omap2xxx_timer1_hwmod = {
...@@ -328,6 +333,7 @@ struct omap_hwmod omap2xxx_timer5_hwmod = { ...@@ -328,6 +333,7 @@ struct omap_hwmod omap2xxx_timer5_hwmod = {
.idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT, .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
}, },
}, },
.dev_attr = &capability_dsp_dev_attr,
.class = &omap2xxx_timer_hwmod_class, .class = &omap2xxx_timer_hwmod_class,
}; };
...@@ -346,6 +352,7 @@ struct omap_hwmod omap2xxx_timer6_hwmod = { ...@@ -346,6 +352,7 @@ struct omap_hwmod omap2xxx_timer6_hwmod = {
.idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT, .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
}, },
}, },
.dev_attr = &capability_dsp_dev_attr,
.class = &omap2xxx_timer_hwmod_class, .class = &omap2xxx_timer_hwmod_class,
}; };
...@@ -364,6 +371,7 @@ struct omap_hwmod omap2xxx_timer7_hwmod = { ...@@ -364,6 +371,7 @@ struct omap_hwmod omap2xxx_timer7_hwmod = {
.idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT, .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
}, },
}, },
.dev_attr = &capability_dsp_dev_attr,
.class = &omap2xxx_timer_hwmod_class, .class = &omap2xxx_timer_hwmod_class,
}; };
...@@ -382,6 +390,7 @@ struct omap_hwmod omap2xxx_timer8_hwmod = { ...@@ -382,6 +390,7 @@ struct omap_hwmod omap2xxx_timer8_hwmod = {
.idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT, .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
}, },
}, },
.dev_attr = &capability_dsp_dev_attr,
.class = &omap2xxx_timer_hwmod_class, .class = &omap2xxx_timer_hwmod_class,
}; };
......
...@@ -171,6 +171,16 @@ static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = { ...@@ -171,6 +171,16 @@ static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
.timer_capability = OMAP_TIMER_HAS_PWM, .timer_capability = OMAP_TIMER_HAS_PWM,
}; };
/* timers with DSP interrupt dev attribute */
static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = {
.timer_capability = OMAP_TIMER_HAS_DSP_IRQ,
};
/* pwm timers with DSP interrupt dev attribute */
static struct omap_timer_capability_dev_attr capability_dsp_pwm_dev_attr = {
.timer_capability = OMAP_TIMER_HAS_DSP_IRQ | OMAP_TIMER_HAS_PWM,
};
/* timer1 */ /* timer1 */
static struct omap_hwmod omap3xxx_timer1_hwmod = { static struct omap_hwmod omap3xxx_timer1_hwmod = {
.name = "timer1", .name = "timer1",
...@@ -254,6 +264,7 @@ static struct omap_hwmod omap3xxx_timer5_hwmod = { ...@@ -254,6 +264,7 @@ static struct omap_hwmod omap3xxx_timer5_hwmod = {
.idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT, .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT,
}, },
}, },
.dev_attr = &capability_dsp_dev_attr,
.class = &omap3xxx_timer_hwmod_class, .class = &omap3xxx_timer_hwmod_class,
}; };
...@@ -271,6 +282,7 @@ static struct omap_hwmod omap3xxx_timer6_hwmod = { ...@@ -271,6 +282,7 @@ static struct omap_hwmod omap3xxx_timer6_hwmod = {
.idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT, .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT,
}, },
}, },
.dev_attr = &capability_dsp_dev_attr,
.class = &omap3xxx_timer_hwmod_class, .class = &omap3xxx_timer_hwmod_class,
}; };
...@@ -288,6 +300,7 @@ static struct omap_hwmod omap3xxx_timer7_hwmod = { ...@@ -288,6 +300,7 @@ static struct omap_hwmod omap3xxx_timer7_hwmod = {
.idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT, .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT,
}, },
}, },
.dev_attr = &capability_dsp_dev_attr,
.class = &omap3xxx_timer_hwmod_class, .class = &omap3xxx_timer_hwmod_class,
}; };
...@@ -305,7 +318,7 @@ static struct omap_hwmod omap3xxx_timer8_hwmod = { ...@@ -305,7 +318,7 @@ static struct omap_hwmod omap3xxx_timer8_hwmod = {
.idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT, .idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT,
}, },
}, },
.dev_attr = &capability_pwm_dev_attr, .dev_attr = &capability_dsp_pwm_dev_attr,
.class = &omap3xxx_timer_hwmod_class, .class = &omap3xxx_timer_hwmod_class,
}; };
......
...@@ -3097,6 +3097,16 @@ static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = { ...@@ -3097,6 +3097,16 @@ static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
.timer_capability = OMAP_TIMER_HAS_PWM, .timer_capability = OMAP_TIMER_HAS_PWM,
}; };
/* timers with DSP interrupt dev attribute */
static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = {
.timer_capability = OMAP_TIMER_HAS_DSP_IRQ,
};
/* pwm timers with DSP interrupt dev attribute */
static struct omap_timer_capability_dev_attr capability_dsp_pwm_dev_attr = {
.timer_capability = OMAP_TIMER_HAS_DSP_IRQ | OMAP_TIMER_HAS_PWM,
};
/* timer1 */ /* timer1 */
static struct omap_hwmod_irq_info omap44xx_timer1_irqs[] = { static struct omap_hwmod_irq_info omap44xx_timer1_irqs[] = {
{ .irq = 37 + OMAP44XX_IRQ_GIC_START }, { .irq = 37 + OMAP44XX_IRQ_GIC_START },
...@@ -3201,6 +3211,7 @@ static struct omap_hwmod omap44xx_timer5_hwmod = { ...@@ -3201,6 +3211,7 @@ static struct omap_hwmod omap44xx_timer5_hwmod = {
.modulemode = MODULEMODE_SWCTRL, .modulemode = MODULEMODE_SWCTRL,
}, },
}, },
.dev_attr = &capability_dsp_dev_attr,
}; };
/* timer6 */ /* timer6 */
...@@ -3223,6 +3234,7 @@ static struct omap_hwmod omap44xx_timer6_hwmod = { ...@@ -3223,6 +3234,7 @@ static struct omap_hwmod omap44xx_timer6_hwmod = {
.modulemode = MODULEMODE_SWCTRL, .modulemode = MODULEMODE_SWCTRL,
}, },
}, },
.dev_attr = &capability_dsp_dev_attr,
}; };
/* timer7 */ /* timer7 */
...@@ -3244,6 +3256,7 @@ static struct omap_hwmod omap44xx_timer7_hwmod = { ...@@ -3244,6 +3256,7 @@ static struct omap_hwmod omap44xx_timer7_hwmod = {
.modulemode = MODULEMODE_SWCTRL, .modulemode = MODULEMODE_SWCTRL,
}, },
}, },
.dev_attr = &capability_dsp_dev_attr,
}; };
/* timer8 */ /* timer8 */
...@@ -3265,7 +3278,7 @@ static struct omap_hwmod omap44xx_timer8_hwmod = { ...@@ -3265,7 +3278,7 @@ static struct omap_hwmod omap44xx_timer8_hwmod = {
.modulemode = MODULEMODE_SWCTRL, .modulemode = MODULEMODE_SWCTRL,
}, },
}, },
.dev_attr = &capability_pwm_dev_attr, .dev_attr = &capability_dsp_pwm_dev_attr,
}; };
/* timer9 */ /* timer9 */
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
#define OMAP_TIMER_ALWON 0x40000000 #define OMAP_TIMER_ALWON 0x40000000
#define OMAP_TIMER_HAS_PWM 0x20000000 #define OMAP_TIMER_HAS_PWM 0x20000000
#define OMAP_TIMER_NEEDS_RESET 0x10000000 #define OMAP_TIMER_NEEDS_RESET 0x10000000
#define OMAP_TIMER_HAS_DSP_IRQ 0x08000000
struct omap_timer_capability_dev_attr { struct omap_timer_capability_dev_attr {
u32 timer_capability; u32 timer_capability;
......
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