[U-Boot] Watchdog and u-boot command prompt

Wolfgang Denk wd at denx.de
Mon Jan 12 20:13:49 CET 2009


Dear Sachin,

In message <73FA539107892C4C8C7A5ACA10C161C85BE0E3 at MX2.AlphionCorp.local> you wrote:
> 
> I have enabled 'watchdog' in u-boot using flag 'CONFIG_WATCHDOG'.
> I wonder how the 'watchdog' gets reset when the cursor is waiting for
> user input.
>  
> As per my understanding the 'WATCHDOG_RESET()' gets called in
> 'readline()' prior calling 'getc()'.
> In our case, the 'getc()' has been mapped to 'serial_getc_dev()'  of
> 'cpu/ppc4xx/serial.c'.

There is no such file in U-Boot.

> The code of 'serial_getc_dev()'  executes in continous loop till user
> presses a key.
> The good thing is that the boad doesn't get reboot even if user doesn't
> enter any key.
> In 'serial_getc_dev()', I don't see any call to reset the watchdog  .

Hmmm... I don't know where you are looking. You say this is on ppc4xx,
so I check "cpu/ppc4xx/4xx_uart.c" - and what do I see?

480 int serial_getc_dev (unsigned long base)
481 {
482         unsigned char status = 0;
483 
484         while (1) {
485 #if defined(CONFIG_HW_WATCHDOG)
486                 WATCHDOG_RESET ();      /* Reset HW Watchdog, if needed */
487 #endif  /* CONFIG_HW_WATCHDOG */
488 
489                 status = in_8((u8 *)base + UART_LSR);
...

Looks pretty much as if it  was  an  explicit  call  to  trigger  the
watchdog...

> Can you help me to find out the how Watchdog is taken care (gets reset)
> whicle executing a infinite loop (if user doesn't press any key) ? 
> ( Note: I am not using 'CONFIG_HW_WATCHDOG' flag)

You are not? Hmmm... What makes you think you are using a watchdog then?

Which sort of watchdog device is used on your board?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I don't want to be young again, I just don't want to get any older.


More information about the U-Boot mailing list