This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Start Watchdog in am335x in idle mode of u-boot and kernel



Hi,


I am using ti-processor-sdk-linux-am335x-evm-01.00.00.00-Linux-x86-Install.bin. In uboot and kernel i have activated omap watchdog.

It works successfully when my board is hang in any situation in uboot.But in the case of uboot when i stops execution and stay at uboot console by pressing any key while booting watchdog not restarts board.

Also in the case of kernel watchdog restarts board only if /dev/watchdog port is opened from application. My question is if kernel gets hang at any point on execution it should restart board. By default how can i keep watchdog timer enabled from kernel.

Thanks in advance.

Regards,

Nilesh

  • Hi,

    I will forward this to the software team.
  • Hi Biser,

    Any update from software team regarding this?

    For kernel when omap_wdt_probe  function is called at booting time then watchdog gets disabled though i comment out omap_wdt_disable from that function. After debugging it seems to me that when "watchdog_register_device(omap_wdt)" function is called from omap_wdt_probe then it disables watchdog. It only gets active after /dev/watchdog port is opened. what can be done to keep watchdog active from kernel.

    Also please give guidance for posted uboot watchdog question in the same chain.

    Thanks in advance.


    Regards,

    Nilesh

  • Hi Nilesh,

    When you register/enable the watchdog from kernel space, make sure you enable the WDOG_ACTIVE bit (status field in the watchdog_device struct).
    You can find detailed explanation of watchdog kernel apis in Documentation/watchdog/watchdog-kernel-api.txt

    User space apis are described in Documentation/watchdog/watchdog-api.txt

    An example on how to use watchdog through user space application can be found in Documentation/watchdog/src/watchdog-test.c or watchdog-simple.c.

    Best Regards,
    Yordan
  • Hi Yordan,

    I have tried as you said in below manner before "watchdog_register_device(omap_wdt);"

    printk("Line = %d, Status = %d\n",__LINE__,omap_wdt->status );
    omap_wdt->status|=1;
    printk("Line = %d, Status = %d\n",__LINE__,omap_wdt->status );

    so first it shows status 0 means not active. Then i did it 1 and then registered watchdog device. But still not works. Any other solution is with you that i can try?

    Thanks in advance.

    Regards,
    Nilesh
  • Hi Yordan,

    Any update on this that i can try?


    Regards,

    Nilesh

  • Hi Yordan,

    I get resolved it by doing following thing.

    As my watchdog started by MLO was get disabled after registering omap watchdog driver by kernel and kernel starts watchdog after opening /dev/watchdog. By default at the time of probing /dev/watchdog port was not opened so to open it i added

    omap_wdt_start(omap_wdt);  just previously to return in function static int omap_wdt_probe(struct platform_device *pdev) located at driver/watchdog/omap_wdt.c

    Thanks for your support.

    Regards,

    Nilesh