[U-Boot] [PATCH v2 1/2]: common: Add a watchdog CLI command
Prafulla Wadaskar
prafulla at marvell.com
Thu Oct 29 09:29:36 CET 2009
> -----Original Message-----
> From: Simon Kagstrom [mailto:simon.kagstrom at netinsight.net]
> Sent: Thursday, October 29, 2009 1:39 PM
> To: U-Boot ML; Prafulla Wadaskar; Wolfgang Denk
> Subject: [PATCH v2 1/2]: common: Add a watchdog CLI command
>
> A watchdog command to enable the watchdog with a timeout from the CLI
> can sometimes be useful. Add that. This also adds a common API for
> enabling watchdogs. The API is simple:
>
> int watchdog_enable(unsigned int timeout);
>
> the timeout range vary depending on hardware, and the driver should
> return a negative value if the call failed.
>
> Signed-off-by: Simon Kagstrom <simon.kagstrom at netinsight.net>
> ---
> ChangeLog:
> v2:
> * Passing zero as timeout is invalid (Prafulla)
> * Add return value from watchdog_enable(), negative means
> failure (Prafulla, Wolfgang)
> * Remove watchdog_disable() (Wolfgang)
> * Use weak default function for watchdog_enable() (Wolfgang)
> * Provide friendly and helpful printouts when invalid
> parameters are
> passed to the CLI command
>
...snip..
> index 10d8904..47e867b 100644
> --- a/common/main.c
> +++ b/common/main.c
> @@ -1446,3 +1446,10 @@ int do_run (cmd_tbl_t * cmdtp, int
> flag, int argc, char *argv[])
> return 0;
> }
> #endif
> +
> +
One small cosmetic change,
Additional line inserted here, pls remove it.
Otherwise ack.
Regards..
Prafulla . .
> +inline int __watchdog_enable(unsigned int timeout_secs)
> +{
> + return -1;
> +}
> +int watchdog_enable(unsigned int timeout_secs)
> __attribute__((weak, alias("__watchdog_enable")));
> diff --git a/include/watchdog.h b/include/watchdog.h
> index 9265be9..74c2bda 100644
> --- a/include/watchdog.h
> +++ b/include/watchdog.h
> @@ -70,6 +70,8 @@
> #endif /* CONFIG_WATCHDOG && !__ASSEMBLY__ */
> #endif /* CONFIG_HW_WATCHDOG */
>
> +extern int watchdog_enable(unsigned int timeout_secs);
> +
> /*
> * Prototypes from $(CPU)/cpu.c.
> */
> --
> 1.6.0.4
>
>
More information about the U-Boot
mailing list