My goal is to disable the watchdog in kernel.
The board is db120,the setup file is arch/mips/ath79/mach-db120.c
I found that there is ath79_wdt_drievr in my kernel,the file is drivers/watchdog/ath79_wdt.c
the key function is ath79_wdt_disable() or ath79_wdt_shutdown()...
But I don't know how to use the API, is there anyone can give me instructions ?
I tried my best to write a watchdog_disable() in "arch/mips/ath79/mach-db120.c" ,and call it in db120_setup() but it don't works.
static void watchdog_disable(void)
{
/*variable definition*/
volatile unsigned int *wdt_control_regaddr = NULL;
volatile unsigned int *wdt_timer_regaddr = NULL;
/*register virtual address mapping*/
wdt_control_regaddr = ioremap(0x18060008, sizeof(unsigned int));
wdt_timer_regaddr = ioremap(0x1806000C, sizeof(unsigned int));
/*set control according to the datasheet, set [1:0] to 0x00 , no action when timeout*/
*wdt_control_regaddr &= ~(1 << 0);
*wdt_control_regaddr &= ~(1 << 1);
printk(KERN_INFO"control register:%08x\n",*wdt_control_regaddr); //it pitintked 00000000
printk(KERN_INFO"control register:%08x\n",*wdt_timer_regaddr);//it pitintked 00000000 either, why?????
/*iounmap*/
iounmap((volatile void*)wdt_control_regaddr);
iounmap((volatile void*)wdt_timer_regaddr);
}
(Last edited by banglang.huang on 19 Feb 2013, 04:50)