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

2010-06-03 Thread Nicolas Ferre
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(1);
  }
 
 if your udelay() implementation isnt calling WATCHDOG_RESET(), it is broken.  
 yes, this is undocumented, but search the mailing archives for examples.

Yes, for sure, udelay() is calling WATCHDOG_RESET().


 i believe the same goes for serial devices and their tstc() function.

True, this is where the problem resides. I will try to modify the
atmel_serial tstc() function.

Best regards,
-- 
Nicolas Ferre

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2010-06-03 Thread Nicolas Ferre
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(1);
  }
 
 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

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2010-06-03 Thread Mike Frysinger
On Thu, Jun 3, 2010 at 1:39 PM, Nicolas Ferre wrote:
 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(1);
              }

 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...

i think you're looking at the multi-serial drivers and not the
cpu-serial drivers ?  i.e. cpu/*/serial.c and such vs drivers/serial/*
?

the former category tends to be more trend setting than the latter.
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2010-05-26 Thread Nicolas Ferre
Watchdog resets were experienced during autoboot delay. Petting the watchdog
during abortboot() function solve the issue.

Signed-off-by: Nicolas Ferre nicolas.fe...@atmel.com
---
 common/main.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/common/main.c b/common/main.c
index f7e7c1c..ea040aa 100644
--- 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(1);
}
 
-- 
1.5.6.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2010-05-26 Thread 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(1);
   }

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.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot