[U-Boot] [PATCH] watchdog petting during autoboot delay

Nicolas Ferre nicolas.ferre at atmel.com
Thu Jun 3 19:39:11 CEST 2010


Le 26/05/2010 20:13, Mike Frysinger :
> On Wednesday 26 May 2010 06:34:49 Nicolas Ferre wrote:
>> --- a/common/main.c
>> +++ b/common/main.c
>> @@ -159,6 +159,7 @@ static __inline__ int abortboot(int bootdelay)
>>  	 * when catch up.
>>  	 */
>>  	do {
>> +		WATCHDOG_RESET();	/* Trigger watchdog, if needed */
>>  		if (tstc()) {
>>  			if (presskey_len < presskey_max) {
>>  				presskey [presskey_len ++] = getc();
>> @@ -251,6 +252,7 @@ static __inline__ int abortboot(int bootdelay)
>>  # endif
>>  				break;
>>  			}
>> +			WATCHDOG_RESET();	/* Trigger watchdog, if needed */
>>  			udelay(10000);
>>  		}
> 
> if your udelay() implementation isnt calling WATCHDOG_RESET(), it is broken.  
> yes, this is undocumented, but search the mailing archives for examples.
> 
> i believe the same goes for serial devices and their tstc() function.

Well, after more checking, it seems that resetting the watchdog in tstc
function is not so common: only serial_pl01x.c is doing it. So I guess
that my first addition may be needed for other chips...

Best regards,
-- 
Nicolas Ferre



More information about the U-Boot mailing list