Again, found that when come to set vect irq 7, do additional data flush fix my problem, here is the patch
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index e971043..850ce58 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1451,6 +1451,9 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ *w = (*w & 0xffff0000) | (((u32)handler >> 16) & 0xffff);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ w = (u32 *)(b + ori_offset);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ *w = (*w & 0xffff0000) | ((u32)handler & 0xffff);
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ /* FIXME: need flash data cache, for timer irq */
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (n == 7)
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ flush_data_cache_page((unsigned int)b);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ local_flush_icache_range((unsigned long)b,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ (unsigned long)(b+handler_len));
ÂÂÂÂÂÂÂ }
Dennis
On Mon, Dec 27, 2010 at 11:56 PM, Dennis.Yxun <dennis.yxun@xxxxxxxxx> wrote:
HI Annop:ÂÂThanks for your reply.ÂÂActually, I think I've already done those two pointyou mentioned here.ÂÂI checked my .config file, it includeÂÂCONFIG_CEVT_R4K_LIB=yÂÂCONFIG_CEVT_R4K=yÂÂCONFIG_CSRC_R4K_LIB=yÂÂCONFIG_CSRC_R4K=yfor the get_c0_compare_intI've already implemented, see my attached time.cunsigned int __cpuinit get_c0_compare_int(void){ÂÂ Â Â Âif (cpu_has_vint)ÂÂ Â Â Â Â Â Â Âset_vi_handler(cp0_compare_irq, mips_timer_dispatch0);ÂÂ Â Â Âmips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;ÂÂ Â Â Âreturn mips_cpu_timer_irq;}c0_compare_irq = 7and MIPS_CPU_IRQ_BASE = 0so mips_cpu_timer_irq = 7should be the same as your mailDennisOn Mon, Dec 27, 2010 at 11:20 PM, Anoop P.A. <Anoop_P.A@xxxxxxxxxxxxxx> wrote:
Hi Dennis,
You may not have to do this ugly hack. Since your cpu is 24kc you should be able to re-use r4k timer library. Select r4k timer from your Kconfig
[code]
   Âselect CEVT_R4K
   Âselect CSRC_R4K
To point your timer interrupt you can add get_c0_compare_int function to your platform init code
[code]
unsigned int __cpuinit get_c0_compare_int(void)
{
return 7;
}
Thanks
Anoop
________________________________
From: linux-mips-bounce@xxxxxxxxxxxxxx on behalf of Dennis.Yxun
Sent: Mon 12/27/2010 7:30 PM
To: linux-mips@xxxxxxxxxxxxxx
Subject: Re: Problem About Vectored interrupt
HI:
 Here is my patch which hacked set_vi_srs_handler, with this I could successfully bring timer(compare/counter),
 But I still not reach the root problem,
Could someone shine some lights on me.
 Thanks
Dennis
On Mon, Dec 27, 2010 at 4:40 PM, Dennis.Yxun <dennis.yxun@xxxxxxxxx> wrote:
   ÂHI ALL:
     ÂI'm try to porting kernel-2.6.36 to one mips24kc board, seems it can't bind vectored irq 7 to timer interrupt.
   ÂThe hardware wired IP7 to timer interrupt (CP0 compare/counter interrupt)
     ÂI implemented my own time.c, use set_vi_handler to map cp0_compare_irq(value: 7) to mips_timer_dispatch,
    but weird problem, it didn't successfully map to mips_timer_dispatch, but print out "Caught unexpected vectored interrupt."
   Âwhich means it still use " static asmlinkage void do_default_vi(void)" Â[1]
     My question is : why first call to "set_vi_srs_handler" successfully mapped to vectored irq7 [2]
   Âbut later is fail[3], see my attached file, bad_kernel.txt
   ÂDennis
   Â[1] arch/mips/kernel/traps.c 1339
   Â[2] arch/mips/kernel/traps.c Â1436, when addr == NULL
   Â[3] my attached file time.c get_c0_compare_int