diff mbox

[U-Boot,4/4] udoo: fix watchdog setting

Message ID 1383770684.3741.28.camel@localhost
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Giuseppe Pagano Nov. 6, 2013, 8:44 p.m. UTC
To have watchdog quiet during kernel boot it is necessary to
change gpio wdt trigger direction.


Signed-off-by: Giuseppe Pagano <giuseppe.pagano@seco.com>
Cc: sbabic@denx.de

---

 static struct fsl_esdhc_cfg usdhc_cfg = { USDHC3_BASE_ADDR };

Comments

Stefano Babic Nov. 7, 2013, 8:19 a.m. UTC | #1
Hi Giuseppe,

On 06/11/2013 21:44, Giuseppe Pagano wrote:
> To have watchdog quiet during kernel boot it is necessary to
> change gpio wdt trigger direction.
> 

Sorry, this is not a good explanation. You force a GPIO to drop a
feture, instead of disabling the feature itself. And maybe some other
people want to have this feature enabled.

Which is the timeout for the watchdog ? Why is it hitting too soon ?

Fix should be not done simply removing the effect, but checking the cause.

> 
> Signed-off-by: Giuseppe Pagano <giuseppe.pagano@seco.com>
> Cc: sbabic@denx.de
> 
> ---
> 
> diff -uNr a/board/udoo/udoo.c b/board/udoo/udoo.c
> --- a/board/udoo/udoo.c	2013-11-06 18:47:26.000000000 +0100
> +++ b/board/udoo/udoo.c	2013-11-06 18:54:46.000000000 +0100
> @@ -168,6 +168,7 @@
>         imx_iomux_v3_setup_multiple_pads(wdog_pads,
> ARRAY_SIZE(wdog_pads));
>         gpio_direction_output(WDT_TRG, 0);
>         gpio_direction_output(WDT_EN, 1);
> +	gpio_direction_input(WDT_TRG);

I do not think this a right way to disable a watchdog.

Best regards,
Stefano Babic
Giuseppe Pagano Nov. 7, 2013, 11:49 a.m. UTC | #2
Hi Stefano,

On Thu, 2013-11-07 at 09:19 +0100, Stefano Babic wrote:
> Hi Giuseppe,
> 
> On 06/11/2013 21:44, Giuseppe Pagano wrote:
> > To have watchdog quiet during kernel boot it is necessary to
> > change gpio wdt trigger direction.
> > 
> 
> Sorry, this is not a good explanation. You force a GPIO to drop a
> feture, instead of disabling the feature itself. And maybe some other
> people want to have this feature enabled.
> 
> Which is the timeout for the watchdog ? Why is it hitting too soon ?
> 
> Fix should be not done simply removing the effect, but checking the cause.


I know, my explanation was poor. 
uDoo use APX823-31W5 as watchdog chip. Timeout is about 1.2 seconds. 
To disabled watchdog during kernel boot, WDI pin of that chip needs to
be in "high impedance" state. As far as I known mx6 gpio configuration
does not contemplate tristate, so the option I choose is to set pin as
input and in "high impedance". If wdt gpio is leaved as output che chip
resets.

> 
> Best regards,
> Stefano Babic
> 

Best regards,
Giuseppe Pagano
diff mbox

Patch

diff -uNr a/board/udoo/udoo.c b/board/udoo/udoo.c
--- a/board/udoo/udoo.c	2013-11-06 18:47:26.000000000 +0100
+++ b/board/udoo/udoo.c	2013-11-06 18:54:46.000000000 +0100
@@ -168,6 +168,7 @@ 
        imx_iomux_v3_setup_multiple_pads(wdog_pads,
ARRAY_SIZE(wdog_pads));
        gpio_direction_output(WDT_TRG, 0);
        gpio_direction_output(WDT_EN, 1);
+	gpio_direction_input(WDT_TRG);
 }