[U-Boot] [PATCH] bcm2835_wdt: support for the BCM2835/2836 watchdog

Paolo Pisati p.pisati at gmail.com
Fri Feb 10 15:18:37 UTC 2017


On Fri, Jan 27, 2017 at 04:20:10PM +0000, Brüns, Stefan wrote:
> > ...
> > +
> >  __efi_runtime_data struct bcm2835_wdog_regs *wdog_regs =
> >  	(struct bcm2835_wdog_regs *)BCM2835_WDOG_PHYSADDR;
> > 
> > -void __efi_runtime reset_cpu(ulong addr)
> > +void __efi_runtime reset_cpu(ulong ticks)
> >  {
> > -	uint32_t rstc;
> > +	uint32_t rstc, timeout;
> > +
> > +	if (ticks == 0) {
> > +		hw_watchdog_disable();
> > +		timeout = RESET_TIMEOUT;
> 
> This is wrong. The efi runtime reset function calls this as reset_cpu(0), and 
> then tries to call hw_watchdog_disable, which is not marked as __efi_runtime.

Ok.
 
> Actually, I can see no reason the watchdog setup piggybacks on the reset_cpu 
> funtion.

Because there's a window after reset_cpu() is called but before real reset happens,
and if hw_watchdog_reset() is called in between, it breaks the reset procedure.

There must be a mechanism for reset_cpu() to disable the watchdog driver so it
won't interfere.

> 
> I think the rule is no new CONFIG_xxx options, but appropriate options in 
> KConfig.

I'll send a V2.
-- 
bye,
p.


More information about the U-Boot mailing list