[U-Boot] [PATCH 1/4 v4] watchdog: Implement generic watchdog_reset() version

Stefan Roese sr at denx.de
Thu Apr 25 07:11:20 UTC 2019


On 12.04.19 11:46, Michal Simek wrote:
> On 12. 04. 19 10:32, Stefan Roese wrote:
>> On 12.04.19 10:22, Michal Simek wrote:
>>> On 11. 04. 19 15:58, Stefan Roese wrote:
>>>> This patch tries to implement a generic watchdog_reset() function that
>>>> can be used by all boards that want to service the watchdog device in
>>>> U-Boot. This watchdog servicing is enabled via CONFIG_WATCHDOG.
>>>>
>>>> Without this approach, new boards or platforms needed to implement a
>>>> board specific version of this functionality, mostly copy'ing the same
>>>> code over and over again into their board or platforms code base.
>>>>
>>>> With this new generic function, the scattered other functions are now
>>>> removed to be replaced by the generic one. The new version also enables
>>>> the configuration of the watchdog timeout via the DT "timeout-sec"
>>>> property (if enabled via CONFIG_OF_CONTROL).
>>>>
>>>> This patch also adds a new flag to the GD flags, to flag that the
>>>> watchdog is ready to use and adds the pointer to the watchdog device
>>>> to the GD. This enables us to remove the global "watchdog_dev"
>>>> variable, which was prone to cause problems because of its potentially
>>>> very early use in watchdog_reset(), even before the BSS is cleared.
>>
>> <snip>
>>
>>> Reviewed-by: Michal Simek <michal.simek at xilinx.com>
>>> Tested-by: Michal Simek <michal.simek at xilinx.com> (on zcu100)
>>>
>>> Maybe at some point we should extend this message to also state that it
>>> is not serviced.
>>>
>>> Something like:
>>> WDT:   Started without servicing (10s timeout)
>>
>> I also have thought about adding this state information to the message.
>> I like your idea. To not "disturb" this series any more, I'll send a
>> follow-up patch for this, once this patchset lands in mainline.
> 
> follow up make sense.

I need to do a v5, since we now have a board with watchdog support in
SPL in mainline (x530) and I need to make a few changes to support this
with the generic approach as well. I'll fold the "with/out servicing"
message into this new version as well. Stay tuned...

Thanks,
Stefan


More information about the U-Boot mailing list