cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP1 u-boot watchdog driver clamps to a maximum of 32 seconds

dfoley
Associate

Looking at the u-boot driver (drivers/watchdog/stm32mp_wdt.c), it seems to hard code the prescaler to /256.
There is no warning if the maximum timeout is set. The linux driver seems to handle values up to the maximum of 131 seconds. Is there some reason u-boot needs to do this when the hardware supports longer timeouts ?

 

static int stm32mp_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
{
	struct stm32mp_wdt_priv *priv = dev_get_priv(dev);
	int reload;
	u32 val;
	int ret;

	/* Prescaler fixed to 256 */
	reload = timeout_ms * priv->wdt_clk_rate / 256;
	if (reload > RLR_MAX + 1)
		/* Force to max watchdog counter reload value */
		reload = RLR_MAX + 1;
	else if (!reload)
		/* Force to min watchdog counter reload value */
		reload = priv->wdt_clk_rate / 256;
...

 

 

 

 

0 REPLIES 0