On 13/09/19 23:28, Grygorii Strashko wrote: > > > On 12/09/2019 19:33, Sam Protsenko wrote: >> Hi Stefan, >> >> On Thu, Sep 12, 2019 at 5:38 PM Stefan Roese <s...@denx.de> wrote: >>> >>> Hi Sam, >>> >>> On 12.09.19 15:45, Sam Protsenko wrote: >>>> Hi Suniel, >>>> >>>> After transition to DM WDT, watchdog timer on BeagleBone Black resets >>>> the board after 1 minute or so. I'm using this defconfig: [1]. After >>>> disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't >>>> reset. I guess it might be happening on other boards using >>>> CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in >>>> U-Boot shell (=>) and waiting for 1 minute. >>>> >>>> Do you know by chance why it might be happening, or maybe some fix >>>> already exists? >>>> >>>> Thanks! >>>> >>>> [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/ >>> >>> So you have enabled the watchdog and should see something like this >>> upon bootup: >>> >>> WDT: Started without servicing (60s timeout) >>> >>> Is this correct? Then you need to enable the U-Boot internal WDT >>> servicing by enabling CONFIG_WATCHDOG as well, as this will >>> result in the internal U-Boot servicing of the watchdog. Then >>> you should see this upon bootup and no reset will appear in >>> U-Boot: >>> >>> WDT: Started with servicing (60s timeout) >>> >> >> I'm seeing this ("with servicing") line, and CONFIG_WATCHDOG is >> already enabled in am335x_evm_defconfig. So I think it's an issue, >> which *probably* appeared when watchdog drivers were converted to >> Driver Model (this defconfig is using CONFIG_WDT + CONFIG_WDT_OMAP3 >> options). Any clues what can be wrong? >> >>> Does this help? > It seems logic of hw_watchdog_reset() and omap3_wdt_reset() is different. > Pay attention at wdt_trgr_pattern.
Didn't do anything different. It was just a replication of hw_watchdog_reset() logic into omap3_wdt_reset(). in hw_watchdog_reset: a global variable "wdt_trgr_pattern" is assigned a value and written into register static unsigned int wdt_trgr_pattern = 0x1234; wdt_trgr_pattern = ~wdt_trgr_pattern; writel(wdt_trgr_pattern, &wdt->wdtwtgr); in omap3_wdt_reset: as per DM, all glob var's must be part of drivers private structure so initialised priv->wdt_trgr_pattern = 0x1234; and then written into register priv->wdt_trgr_pattern = ~(priv->wdt_trgr_pattern); writel(priv->wdt_trgr_pattern, &priv->regs->wdtwtgr); > > It seems that > priv->wdt_trgr_pattern = 0x1234; > need to be moved in omap3_wdt_probe() As per my understanding the above change will not make any difference, because its just initialization of the variable. should be ready before its use. > Please go through this pastebin link, at my end, omap3_wdt_reset() happens at regular intervals, where ever it is triggered. (print messages are inserted in omap3_wdt_reset) https://pastebin.ubuntu.com/p/WvS9PZb45p/ The target doesn't restart. Thanks Suniel _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot