I have write a kernel module, it is as follow, I want it can respond DSP's interrupt.
#define REG_CHIPSIG 0x01C14174
#define REG_CHIPINT_CLEAR 0x01C14178
int i=0;
unsigned int reg_chipsig_clear;
unsigned int reg_chipsig;
static irqreturn_t handler_chipint0(int irq,void *dev_id)
{
//clear interrupt
writel(0x1,reg_chipsig_clear);
//memery interrupt time
i++;
return IRQ_HANDLED;
}
int porc_init(void)
{
int result;
printk("\nporc_init:enter\n");
reg_chipsig=(unsigned int*)ioremap_nocache(REG_CHIPSIG,4);
reg_chipsig_clear=(unsigned int*)ioremap_nocache(REG_CHIPINT_CLEAR,4);
if(request_irq(IRQ_DA8XX_CHIPINT0, handler_chipint0,0,"proc_chipint0",0))
{
printk("porc_init:request handler_chipint0 error\n");
}
printk("\nporc_init:exit\n");
return 0;
}
void porc_exit(void)
{
printk("\nporc_exit:enter\n");
//get time of interrupt
printk("i=%d\n",i);
free_irq(IRQ_DA8XX_CHIPINT0,0);
printk("\nporc_exit:exit\n");
}
MODULE_AUTHOR("test");
MODULE_LICENSE("Dual BSD/GPL");
module_init(porc_init);
module_exit(porc_exit);
But I find that when DSP set bit0 of reg CHIPSIG the ISR will run three times, why?
I use OMAPL138.