[PATCH] powerpc: remove WATCHDOG_RESET call from wait_ticks()

Rasmus Villemoes rasmus.villemoes at prevas.dk
Tue Mar 17 14:38:00 CET 2020

On 17/03/2020 14.21, Christophe Leroy wrote:
> Le 17/03/2020 à 14:07, Rasmus Villemoes a écrit :
>>> In any case it seems to me a board specific redefinition of the
>>> WATCHDOG_RESET macro would be less intrusive and risky than changing
>>> code that has been there since the beginning of time (well, at least
>>> more than 18 years).
>> The point is, we're being told that everything is moving to DM and
>> better convert your board or else..., and nowadays CONFIG_WDT comes with
>> it's own watchdog_reset() which is a rather more complicated beast than
>> the board-specific ones that used to be sprinkled throughout (and
>> out-of) the tree. So yes, for the past 18 years, nothing bad has
>> probably come from doing a WATCHDOG_RESET even deep down in the guts of
>> arch-specific primitives.
> CONFIG_WDT comes with a watchdog_reset() when you defined CONFIG_WATCHDOG.
> For boards like powerpc boards with embedded SOC watchdog that needs to
> be pinged from the very begining, we have CONFIG_HW_WATCHDOG and that's
> compatible with DM. See
> https://gitlab.denx.de/u-boot/u-boot/-/commit/a68256074f4239008c6d5c936bc0f8857f3d1b8a

Yes, but I'm not talking about or using the SOC watchdog. Also, this is
not really about the particular watchdog device at all. It is about what
generic code can expect from the __udelay primitive, which is not
currently that on ppc.

FTR, my watchdog is an external gpio-triggered one. And sure, it's ten
lines of code to make a board-specific watchdog_reset that pokes the
appropriate SOC registers to flip that gpio. But that doesn't really
work when other things, including stuff that goes via the proper DM
channels, uses gpios in the same bank - especially not when the state of
output gpios cannot be read back but must be stored in a shadow register.


More information about the U-Boot mailing list