1
0
Fork 0
forked from len0rd/rockbox

imx233: enhance icoll with priority and soft IRQ

Change-Id: If9568ab6e11bf933b2cc607e5a86866a975886bc
This commit is contained in:
Amaury Pouly 2014-02-02 04:20:41 +01:00
parent ab5dfd55aa
commit 0ba4c3b078
3 changed files with 38 additions and 1 deletions

View file

@ -518,7 +518,8 @@ bool dbg_hw_info_icoll(void)
for(int i = first_irq, j = 0; i < dbg_irqs_count && j < line_count; i++, j++)
{
struct imx233_icoll_irq_info_t info = imx233_icoll_get_irq_info(dbg_irqs[i].src);
lcd_putsf(0, j, "%s", dbg_irqs[i].name);
static char prio[4] = {'-', '+', '^', '!'};
lcd_putsf(0, j, "%c%s", prio[info.priority & 3], dbg_irqs[i].name);
if(info.enabled || info.freq > 0)
lcd_putsf(10, j, "%d", info.freq);
}

View file

@ -126,6 +126,11 @@ struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src)
info.enabled = BF_RDn(ICOLL_PRIORITYn, src / 4, ENABLEx(src % 4));
#else
info.enabled = BF_RDn(ICOLL_INTERRUPTn, src, ENABLE);
#endif
#if IMX233_SUBTARGET < 3780
info.priority = BF_RDn(ICOLL_PRIORITYn, src / 4, PRIORITYx(src % 4));
#else
info.priority = BF_RDn(ICOLL_INTERRUPTn, src, PRIORITY);
#endif
info.freq = irq_count_old[src];
return info;
@ -165,6 +170,21 @@ void fiq_handler(void)
{
}
void imx233_icoll_force_irq(unsigned src, bool enable)
{
#if IMX233_SUBTARGET < 3780
if(enable)
BF_SETn(ICOLL_PRIORITYn, src / 4, SOFTIRQx(src % 4));
else
BF_CLRn(ICOLL_PRIORITYn, src / 4, SOFTIRQx(src % 4));
#else
if(enable)
BF_SETn(ICOLL_INTERRUPTn, src, SOFTIRQ);
else
BF_CLRn(ICOLL_INTERRUPTn, src, SOFTIRQ);
#endif
}
void imx233_icoll_enable_interrupt(int src, bool enable)
{
#if IMX233_SUBTARGET < 3780
@ -180,6 +200,15 @@ void imx233_icoll_enable_interrupt(int src, bool enable)
#endif
}
void imx233_icoll_set_priority(int src, unsigned prio)
{
#if IMX233_SUBTARGET < 3780
BF_WRn(ICOLL_PRIORITYn, src / 4, PRIORITYx(src % 4), prio);
#else
BF_WRn(ICOLL_INTERRUPTn, src, PRIORITY, prio);
#endif
}
void imx233_icoll_init(void)
{
imx233_reset_block(&HW_ICOLL_CTRL);

View file

@ -62,16 +62,23 @@
#if IMX233_SUBTARGET >= 3600 && IMX233_SUBTARGET < 3780
#define BP_ICOLL_PRIORITYn_ENABLEx(x) (2 + 8 * (x))
#define BM_ICOLL_PRIORITYn_ENABLEx(x) (1 << (2 + 8 * (x)))
#define BP_ICOLL_PRIORITYn_PRIORITYx(x) (0 + 8 * (x))
#define BM_ICOLL_PRIORITYn_PRIORITYx(x) (3 << (0 + 8 * (x)))
#define BP_ICOLL_PRIORITYn_SOFTIRQx(x) (3 + 8 * (x))
#define BM_ICOLL_PRIORITYn_SOFTIRQx(x) (1 << (3 + 8 * (x)))
#endif
struct imx233_icoll_irq_info_t
{
bool enabled;
unsigned freq;
unsigned priority;
};
void imx233_icoll_init(void);
void imx233_icoll_enable_interrupt(int src, bool enable);
void imx233_icoll_set_priority(int src, unsigned prio);
struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src);
void imx233_icoll_force_irq(unsigned src, bool enable);
#endif /* ICOLL_IMX233_H */