[12/15] include: rk3399: Disable watchdog in TPL

Message ID 20190729074711.16988-13-jagan@amarulasolutions.com
State New
Headers show
Series
  • rk3399: Add redundant boot support
Related show

Commit Message

Jagan Teki July 29, 2019, 7:47 a.m. UTC
Disable watchdog for TPL, since there is no support it.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 include/configs/rk3399_common.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Kever Yang Aug. 5, 2019, 12:43 p.m. UTC | #1
On 2019/7/29 下午3:47, Jagan Teki wrote:
> Disable watchdog for TPL, since there is no support it.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>   include/configs/rk3399_common.h | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
> index 8df0180284..67b48e03ba 100644
> --- a/include/configs/rk3399_common.h
> +++ b/include/configs/rk3399_common.h
> @@ -46,6 +46,11 @@
>   #define CONFIG_SYS_SDRAM_BASE		0
>   #define SDRAM_MAX_SIZE			0xf8000000
>   
> +#ifdef CONFIG_TPL_BUILD
> +# undef CONFIG_WDT
> +# undef CONFIG_WATCHDOG
> +#endif


It will be better to use CONFIG_${SPL_TPL}WDT in watchdog Makefile,

because all the SoC needs treat this driver separate in TPL/SPL/U-Boot 
proper.


Thanks,

- Kever

> +
>   #ifndef CONFIG_SPL_BUILD
>   
>   #define ENV_MEM_LAYOUT_SETTINGS \
Jagan Teki Aug. 25, 2019, 8:14 p.m. UTC | #2
On Mon, Aug 5, 2019 at 6:13 PM Kever Yang <kever.yang@rock-chips.com> wrote:
>
>
> On 2019/7/29 下午3:47, Jagan Teki wrote:
> > Disable watchdog for TPL, since there is no support it.
> >
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > ---
> >   include/configs/rk3399_common.h | 5 +++++
> >   1 file changed, 5 insertions(+)
> >
> > diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
> > index 8df0180284..67b48e03ba 100644
> > --- a/include/configs/rk3399_common.h
> > +++ b/include/configs/rk3399_common.h
> > @@ -46,6 +46,11 @@
> >   #define CONFIG_SYS_SDRAM_BASE               0
> >   #define SDRAM_MAX_SIZE                      0xf8000000
> >
> > +#ifdef CONFIG_TPL_BUILD
> > +# undef CONFIG_WDT
> > +# undef CONFIG_WATCHDOG
> > +#endif
>
>
> It will be better to use CONFIG_${SPL_TPL}WDT in watchdog Makefile,
>
> because all the SoC needs treat this driver separate in TPL/SPL/U-Boot
> proper.

Enabling TPL (via DM or so) cannot be an optimal solutions as of now,
since if it continuously resetting we need to take boot switch based
on bootcount, ie possible with SPL and U-Boot proper now. Making a
boot switch to TPL might increase code size, so will check this
decision later based on the requirement.
Kever Yang Aug. 26, 2019, 1:34 a.m. UTC | #3
Jagan,

On 2019/8/26 上午4:14, Jagan Teki wrote:
> On Mon, Aug 5, 2019 at 6:13 PM Kever Yang <kever.yang@rock-chips.com> wrote:
>>
>> On 2019/7/29 下午3:47, Jagan Teki wrote:
>>> Disable watchdog for TPL, since there is no support it.
>>>
>>> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>>> ---
>>>    include/configs/rk3399_common.h | 5 +++++
>>>    1 file changed, 5 insertions(+)
>>>
>>> diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
>>> index 8df0180284..67b48e03ba 100644
>>> --- a/include/configs/rk3399_common.h
>>> +++ b/include/configs/rk3399_common.h
>>> @@ -46,6 +46,11 @@
>>>    #define CONFIG_SYS_SDRAM_BASE               0
>>>    #define SDRAM_MAX_SIZE                      0xf8000000
>>>
>>> +#ifdef CONFIG_TPL_BUILD
>>> +# undef CONFIG_WDT
>>> +# undef CONFIG_WATCHDOG
>>> +#endif
>>
>> It will be better to use CONFIG_${SPL_TPL}WDT in watchdog Makefile,
>>
>> because all the SoC needs treat this driver separate in TPL/SPL/U-Boot
>> proper.
> Enabling TPL (via DM or so) cannot be an optimal solutions as of now,


I'm not suggesting enable WDT in TPL, but only about how the WDT module 
is enabled in Makefile system;

If useing CONFIG_${SPL_TPL}WDT in Makefile, then the WDT is not enabled 
in TPL if there is no

CONFIG_TPL_WDT, so you don't have to write the 'undef ...' code for 
CONFIG_TPL_BUILD.


Thanks,

- Kever

> since if it continuously resetting we need to take boot switch based
> on bootcount, ie possible with SPL and U-Boot proper now. Making a
> boot switch to TPL might increase code size, so will check this
> decision later based on the requirement.
>

Patch

diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
index 8df0180284..67b48e03ba 100644
--- a/include/configs/rk3399_common.h
+++ b/include/configs/rk3399_common.h
@@ -46,6 +46,11 @@ 
 #define CONFIG_SYS_SDRAM_BASE		0
 #define SDRAM_MAX_SIZE			0xf8000000
 
+#ifdef CONFIG_TPL_BUILD
+# undef CONFIG_WDT
+# undef CONFIG_WATCHDOG
+#endif
+
 #ifndef CONFIG_SPL_BUILD
 
 #define ENV_MEM_LAYOUT_SETTINGS \