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.

Linux/AM5718: WDTimer stops at kernel start

Part Number: AM5718


Tool/software: Linux

Hello,

I would like to implement following scheme using OMAP watchdog timer:

 - U-Boot starts watchdog timer with timeout 10s

 - U-Boot boots Linux Kernel

 - Linux Kernel watchdog driver uses already started watchdog timer & prolongs it when necessary

I have a problem: somehow watchdog timer started at U-Boot becomes stopped when execution come to linux watchdog driver.

How I can find at which stage of linux booting watchdog times stops?

How I can prevent stopping of watchdog timer during linux boot?

Thanks in advance.

  • Hi Alexey,

    I will have a look on this and come back to you shortly.

    Best regards,
    Pavel
  • Alexey,

    Seems like linux kernel is stopping/disabling the watchdog u-boot config. Please refer to the below e2e threads for details:

    e2e.ti.com/.../287281
    e2e.ti.com/.../495092

    wiki.dave.eu/.../Deploying_Embedded_Linux_Systems

    Regards,
    Pavel
  • Pavel,

    Thank you for the links.

    First link prompts me right direction. I end up with following patch on linux kernel:

    diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c
    index ff0a68c..405f3b8 100644
    --- a/arch/arm/mach-omap2/wd_timer.c
    +++ b/arch/arm/mach-omap2/wd_timer.c
    @@ -78,29 +78,9 @@ int omap2_wd_timer_disable(struct omap_hwmod *oh)
      */
     int omap2_wd_timer_reset(struct omap_hwmod *oh)
     {
    -       int c = 0;
    -
    -       /* Write to the SOFTRESET bit */
    -       omap_hwmod_softreset(oh);
    -
    -       /* Poll on RESETDONE bit */
    -       omap_test_timeout((omap_hwmod_read(oh,
    -                                          oh->class->sysc->syss_offs)
    -                          & SYSS_RESETDONE_MASK),
    -                         MAX_MODULE_SOFTRESET_WAIT, c);
    -
    -       if (oh->class->sysc->srst_udelay)
    -               udelay(oh->class->sysc->srst_udelay);
    -
    -       if (c == MAX_MODULE_SOFTRESET_WAIT)
    -               pr_warn("%s: %s: softreset failed (waited %d usec)\n",
    -                       __func__, oh->name, MAX_MODULE_SOFTRESET_WAIT);
    -       else
    -               pr_debug("%s: %s: softreset in %d usec\n", __func__,
    -                        oh->name, c);
    -
    -       return (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT :
    -               omap2_wd_timer_disable(oh);
    +       /* all code was removed out because we ran watchdog at u-boot
    +          and expect that watchdog driver takes control when loaded */
    +       return 0;
     }
    

    This just don't let disable watchdog at linux startup code.