diff mbox series

[v2] spl: watchdog: introduce SPL_HW_WATCHDOG

Message ID 20230823120021.50146-1-oleksandr.suvorov@foundries.io
State Changes Requested
Delegated to: Stefan Roese
Headers show
Series [v2] spl: watchdog: introduce SPL_HW_WATCHDOG | expand

Commit Message

Oleksandr Suvorov Aug. 23, 2023, noon UTC
Add SPL_HW_WATCHDOG Kconfig symbol which can be used to enable
non-WDT hardware watchdog in SPL.

Co-developed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
---

Changes in v2:
- remove mistakenly included unwanted changes

 common/spl/Kconfig        | 1 -
 drivers/Makefile          | 1 +
 drivers/sysreset/Kconfig  | 6 ++++++
 drivers/sysreset/Makefile | 2 +-
 drivers/watchdog/Kconfig  | 4 ++++
 5 files changed, 12 insertions(+), 2 deletions(-)

Comments

Tom Rini Aug. 23, 2023, 2:43 p.m. UTC | #1
On Wed, Aug 23, 2023 at 03:00:14PM +0300, Oleksandr Suvorov wrote:

> Add SPL_HW_WATCHDOG Kconfig symbol which can be used to enable
> non-WDT hardware watchdog in SPL.
> 
> Co-developed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
> ---
> 
> Changes in v2:
> - remove mistakenly included unwanted changes
> 
>  common/spl/Kconfig        | 1 -
>  drivers/Makefile          | 1 +
>  drivers/sysreset/Kconfig  | 6 ++++++
>  drivers/sysreset/Makefile | 2 +-
>  drivers/watchdog/Kconfig  | 4 ++++
>  5 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index c5dd476db58..07d9dac29bd 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -1351,7 +1351,6 @@ config SPL_THERMAL
>  
>  config SPL_WATCHDOG
>  	bool "Support watchdog drivers"
> -	imply SPL_WDT if !HW_WATCHDOG

Taking out an imply here probably breaks or at least changes boards.
What exactly are the conditions you need to change  here?
Stefan Roese Aug. 24, 2023, 11:24 a.m. UTC | #2
On 8/23/23 14:00, Oleksandr Suvorov wrote:
> Add SPL_HW_WATCHDOG Kconfig symbol which can be used to enable
> non-WDT hardware watchdog in SPL.

Hmmm, my hope / plan was to completely drop HW_WATCHDOG at some point.
It's some old relict and if I don't miss something completely, it's more
a "normal" watchdog that needs to get triggered very early in most
cases (PowerPC etc). So adding some more *_HW_WATCHDOG stuff does not
sound appealing to me.

Could you perhaps investigate a bit, if your HW_WATCHDOG use case can
be converted to the "normal" watchdog support instead?

Thanks,
Stefan

> Co-developed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
> ---
> 
> Changes in v2:
> - remove mistakenly included unwanted changes
> 
>   common/spl/Kconfig        | 1 -
>   drivers/Makefile          | 1 +
>   drivers/sysreset/Kconfig  | 6 ++++++
>   drivers/sysreset/Makefile | 2 +-
>   drivers/watchdog/Kconfig  | 4 ++++
>   5 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index c5dd476db58..07d9dac29bd 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -1351,7 +1351,6 @@ config SPL_THERMAL
>   
>   config SPL_WATCHDOG
>   	bool "Support watchdog drivers"
> -	imply SPL_WDT if !HW_WATCHDOG
>   	help
>   	  Enable support for watchdog drivers in SPL. A watchdog is
>   	  typically a hardware peripheral which can reset the system when it
> diff --git a/drivers/Makefile b/drivers/Makefile
> index efc2a4afb24..2eb8ec0a894 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -62,6 +62,7 @@ obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
>   obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
>   obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/udc/
>   obj-$(CONFIG_SPL_WATCHDOG) += watchdog/
> +obj-$(CONFIG_SPL_HW_WATCHDOG) += watchdog/
>   obj-$(CONFIG_SPL_USB_HOST) += usb/host/
>   obj-$(CONFIG_SPL_SATA) += ata/ scsi/
>   obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
> diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
> index bdbe2a95364..0d21673e402 100644
> --- a/drivers/sysreset/Kconfig
> +++ b/drivers/sysreset/Kconfig
> @@ -157,6 +157,12 @@ config SYSRESET_WATCHDOG
>   	help
>   	  Reboot support for generic watchdog reset.
>   
> +config SPL_SYSRESET_WATCHDOG
> +	bool "Enable support for watchdog reboot driver in SPL mode"
> +	select SPL_WDT
> +	help
> +	  Reboot support for generic watchdog reset in SPL mode.
> +
>   config SYSRESET_WATCHDOG_AUTO
>   	bool "Automatically register first watchdog with sysreset"
>   	depends on SYSRESET_WATCHDOG
> diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
> index 40c876764af..e5a7fc07a81 100644
> --- a/drivers/sysreset/Makefile
> +++ b/drivers/sysreset/Makefile
> @@ -18,7 +18,7 @@ obj-$(CONFIG_SYSRESET_SOCFPGA) += sysreset_socfpga.o
>   obj-$(CONFIG_SYSRESET_SOCFPGA_SOC64) += sysreset_socfpga_soc64.o
>   obj-$(CONFIG_SYSRESET_TI_SCI) += sysreset-ti-sci.o
>   obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
> -obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
> +obj-$(CONFIG_$(SPL_)SYSRESET_WATCHDOG) += sysreset_watchdog.o
>   obj-$(CONFIG_SYSRESET_RESETCTL) += sysreset_resetctl.o
>   obj-$(CONFIG_$(SPL_TPL_)SYSRESET_AT91) += sysreset_at91.o
>   obj-$(CONFIG_$(SPL_TPL_)SYSRESET_X86) += sysreset_x86.o
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 07fc4940e91..d696a04fc18 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -39,9 +39,13 @@ config WATCHDOG_TIMEOUT_MSECS
>   config HW_WATCHDOG
>   	bool
>   
> +config SPL_HW_WATCHDOG
> +	bool
> +
>   config IMX_WATCHDOG
>   	bool "Enable Watchdog Timer support for IMX and LSCH2 of NXP"
>   	select HW_WATCHDOG if !WDT
> +	select SPL_HW_WATCHDOG if !SPL_WDT
>   	help
>   	  Select this to enable the IMX and LSCH2 of Layerscape watchdog
>   	  driver.

Viele Grüße,
Stefan Roese
Oleksandr Suvorov Aug. 28, 2023, 1:23 p.m. UTC | #3
Hi Stefan,

On Thu, Aug 24, 2023 at 2:24 PM Stefan Roese <sr@denx.de> wrote:
>
> On 8/23/23 14:00, Oleksandr Suvorov wrote:
> > Add SPL_HW_WATCHDOG Kconfig symbol which can be used to enable
> > non-WDT hardware watchdog in SPL.
>
> Hmmm, my hope / plan was to completely drop HW_WATCHDOG at some point.
> It's some old relict and if I don't miss something completely, it's more
> a "normal" watchdog that needs to get triggered very early in most
> cases (PowerPC etc).

Oh, it's a good approach, thanks.

> So adding some more *_HW_WATCHDOG stuff does not sound appealing to me.
> Could you perhaps investigate a bit, if your HW_WATCHDOG use case can
> be converted to the "normal" watchdog support instead?

We just need to be able to exclude a hardware watchdog from SPL to
save some memory.
So I resign this patch and we'll wait for your work and then revise
what we have again.

> Thanks,
> Stefan

Cheers,
Oleksandr

>
> > Co-developed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> > Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> > Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
> > ---
> >
> > Changes in v2:
> > - remove mistakenly included unwanted changes
> >
> >   common/spl/Kconfig        | 1 -
> >   drivers/Makefile          | 1 +
> >   drivers/sysreset/Kconfig  | 6 ++++++
> >   drivers/sysreset/Makefile | 2 +-
> >   drivers/watchdog/Kconfig  | 4 ++++
> >   5 files changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> > index c5dd476db58..07d9dac29bd 100644
> > --- a/common/spl/Kconfig
> > +++ b/common/spl/Kconfig
> > @@ -1351,7 +1351,6 @@ config SPL_THERMAL
> >
> >   config SPL_WATCHDOG
> >       bool "Support watchdog drivers"
> > -     imply SPL_WDT if !HW_WATCHDOG
> >       help
> >         Enable support for watchdog drivers in SPL. A watchdog is
> >         typically a hardware peripheral which can reset the system when it
> > diff --git a/drivers/Makefile b/drivers/Makefile
> > index efc2a4afb24..2eb8ec0a894 100644
> > --- a/drivers/Makefile
> > +++ b/drivers/Makefile
> > @@ -62,6 +62,7 @@ obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
> >   obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
> >   obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/udc/
> >   obj-$(CONFIG_SPL_WATCHDOG) += watchdog/
> > +obj-$(CONFIG_SPL_HW_WATCHDOG) += watchdog/
> >   obj-$(CONFIG_SPL_USB_HOST) += usb/host/
> >   obj-$(CONFIG_SPL_SATA) += ata/ scsi/
> >   obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
> > diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
> > index bdbe2a95364..0d21673e402 100644
> > --- a/drivers/sysreset/Kconfig
> > +++ b/drivers/sysreset/Kconfig
> > @@ -157,6 +157,12 @@ config SYSRESET_WATCHDOG
> >       help
> >         Reboot support for generic watchdog reset.
> >
> > +config SPL_SYSRESET_WATCHDOG
> > +     bool "Enable support for watchdog reboot driver in SPL mode"
> > +     select SPL_WDT
> > +     help
> > +       Reboot support for generic watchdog reset in SPL mode.
> > +
> >   config SYSRESET_WATCHDOG_AUTO
> >       bool "Automatically register first watchdog with sysreset"
> >       depends on SYSRESET_WATCHDOG
> > diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
> > index 40c876764af..e5a7fc07a81 100644
> > --- a/drivers/sysreset/Makefile
> > +++ b/drivers/sysreset/Makefile
> > @@ -18,7 +18,7 @@ obj-$(CONFIG_SYSRESET_SOCFPGA) += sysreset_socfpga.o
> >   obj-$(CONFIG_SYSRESET_SOCFPGA_SOC64) += sysreset_socfpga_soc64.o
> >   obj-$(CONFIG_SYSRESET_TI_SCI) += sysreset-ti-sci.o
> >   obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
> > -obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
> > +obj-$(CONFIG_$(SPL_)SYSRESET_WATCHDOG) += sysreset_watchdog.o
> >   obj-$(CONFIG_SYSRESET_RESETCTL) += sysreset_resetctl.o
> >   obj-$(CONFIG_$(SPL_TPL_)SYSRESET_AT91) += sysreset_at91.o
> >   obj-$(CONFIG_$(SPL_TPL_)SYSRESET_X86) += sysreset_x86.o
> > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> > index 07fc4940e91..d696a04fc18 100644
> > --- a/drivers/watchdog/Kconfig
> > +++ b/drivers/watchdog/Kconfig
> > @@ -39,9 +39,13 @@ config WATCHDOG_TIMEOUT_MSECS
> >   config HW_WATCHDOG
> >       bool
> >
> > +config SPL_HW_WATCHDOG
> > +     bool
> > +
> >   config IMX_WATCHDOG
> >       bool "Enable Watchdog Timer support for IMX and LSCH2 of NXP"
> >       select HW_WATCHDOG if !WDT
> > +     select SPL_HW_WATCHDOG if !SPL_WDT
> >       help
> >         Select this to enable the IMX and LSCH2 of Layerscape watchdog
> >         driver.
>
> Viele Grüße,
> Stefan Roese
>
> --
> DENX Software Engineering GmbH,      Managing Director: Erika Unter
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
Stefan Roese Aug. 28, 2023, 2:30 p.m. UTC | #4
Hi Oleksandr,

On 8/28/23 15:23, Oleksandr Suvorov wrote:
> Hi Stefan,
> 
> On Thu, Aug 24, 2023 at 2:24 PM Stefan Roese <sr@denx.de> wrote:
>>
>> On 8/23/23 14:00, Oleksandr Suvorov wrote:
>>> Add SPL_HW_WATCHDOG Kconfig symbol which can be used to enable
>>> non-WDT hardware watchdog in SPL.
>>
>> Hmmm, my hope / plan was to completely drop HW_WATCHDOG at some point.
>> It's some old relict and if I don't miss something completely, it's more
>> a "normal" watchdog that needs to get triggered very early in most
>> cases (PowerPC etc).
> 
> Oh, it's a good approach, thanks.

Good that we agree. But...

>> So adding some more *_HW_WATCHDOG stuff does not sound appealing to me.
>> Could you perhaps investigate a bit, if your HW_WATCHDOG use case can
>> be converted to the "normal" watchdog support instead?
> 
> We just need to be able to exclude a hardware watchdog from SPL to
> save some memory.

Did you already enable LTO so decrease the image size? Just checking.

> So I resign this patch and we'll wait for your work and then revise
> what we have again.

...but: Actually I don't have any plans to do this rework myself. At
least not short-term. My hope was that someone for the platforms using
this HW_WATCHDOG stuff would jump in here. ;)

Thanks,
Stefan

>> Thanks,
>> Stefan
> 
> Cheers,
> Oleksandr
> 
>>
>>> Co-developed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
>>> Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
>>> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
>>> ---
>>>
>>> Changes in v2:
>>> - remove mistakenly included unwanted changes
>>>
>>>    common/spl/Kconfig        | 1 -
>>>    drivers/Makefile          | 1 +
>>>    drivers/sysreset/Kconfig  | 6 ++++++
>>>    drivers/sysreset/Makefile | 2 +-
>>>    drivers/watchdog/Kconfig  | 4 ++++
>>>    5 files changed, 12 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
>>> index c5dd476db58..07d9dac29bd 100644
>>> --- a/common/spl/Kconfig
>>> +++ b/common/spl/Kconfig
>>> @@ -1351,7 +1351,6 @@ config SPL_THERMAL
>>>
>>>    config SPL_WATCHDOG
>>>        bool "Support watchdog drivers"
>>> -     imply SPL_WDT if !HW_WATCHDOG
>>>        help
>>>          Enable support for watchdog drivers in SPL. A watchdog is
>>>          typically a hardware peripheral which can reset the system when it
>>> diff --git a/drivers/Makefile b/drivers/Makefile
>>> index efc2a4afb24..2eb8ec0a894 100644
>>> --- a/drivers/Makefile
>>> +++ b/drivers/Makefile
>>> @@ -62,6 +62,7 @@ obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
>>>    obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
>>>    obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/udc/
>>>    obj-$(CONFIG_SPL_WATCHDOG) += watchdog/
>>> +obj-$(CONFIG_SPL_HW_WATCHDOG) += watchdog/
>>>    obj-$(CONFIG_SPL_USB_HOST) += usb/host/
>>>    obj-$(CONFIG_SPL_SATA) += ata/ scsi/
>>>    obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
>>> diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
>>> index bdbe2a95364..0d21673e402 100644
>>> --- a/drivers/sysreset/Kconfig
>>> +++ b/drivers/sysreset/Kconfig
>>> @@ -157,6 +157,12 @@ config SYSRESET_WATCHDOG
>>>        help
>>>          Reboot support for generic watchdog reset.
>>>
>>> +config SPL_SYSRESET_WATCHDOG
>>> +     bool "Enable support for watchdog reboot driver in SPL mode"
>>> +     select SPL_WDT
>>> +     help
>>> +       Reboot support for generic watchdog reset in SPL mode.
>>> +
>>>    config SYSRESET_WATCHDOG_AUTO
>>>        bool "Automatically register first watchdog with sysreset"
>>>        depends on SYSRESET_WATCHDOG
>>> diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
>>> index 40c876764af..e5a7fc07a81 100644
>>> --- a/drivers/sysreset/Makefile
>>> +++ b/drivers/sysreset/Makefile
>>> @@ -18,7 +18,7 @@ obj-$(CONFIG_SYSRESET_SOCFPGA) += sysreset_socfpga.o
>>>    obj-$(CONFIG_SYSRESET_SOCFPGA_SOC64) += sysreset_socfpga_soc64.o
>>>    obj-$(CONFIG_SYSRESET_TI_SCI) += sysreset-ti-sci.o
>>>    obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
>>> -obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
>>> +obj-$(CONFIG_$(SPL_)SYSRESET_WATCHDOG) += sysreset_watchdog.o
>>>    obj-$(CONFIG_SYSRESET_RESETCTL) += sysreset_resetctl.o
>>>    obj-$(CONFIG_$(SPL_TPL_)SYSRESET_AT91) += sysreset_at91.o
>>>    obj-$(CONFIG_$(SPL_TPL_)SYSRESET_X86) += sysreset_x86.o
>>> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
>>> index 07fc4940e91..d696a04fc18 100644
>>> --- a/drivers/watchdog/Kconfig
>>> +++ b/drivers/watchdog/Kconfig
>>> @@ -39,9 +39,13 @@ config WATCHDOG_TIMEOUT_MSECS
>>>    config HW_WATCHDOG
>>>        bool
>>>
>>> +config SPL_HW_WATCHDOG
>>> +     bool
>>> +
>>>    config IMX_WATCHDOG
>>>        bool "Enable Watchdog Timer support for IMX and LSCH2 of NXP"
>>>        select HW_WATCHDOG if !WDT
>>> +     select SPL_HW_WATCHDOG if !SPL_WDT
>>>        help
>>>          Select this to enable the IMX and LSCH2 of Layerscape watchdog
>>>          driver.
>>
>> Viele Grüße,
>> Stefan Roese
>>
>> --
>> DENX Software Engineering GmbH,      Managing Director: Erika Unter
>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
> 
> 
> 

Viele Grüße,
Stefan Roese
Oleksandr Suvorov Aug. 29, 2023, 6:35 a.m. UTC | #5
Hi Stefan,

On Mon, Aug 28, 2023 at 5:30 PM Stefan Roese <sr@denx.de> wrote:
>
> Hi Oleksandr,
>
> On 8/28/23 15:23, Oleksandr Suvorov wrote:
> > Hi Stefan,
> >
> > On Thu, Aug 24, 2023 at 2:24 PM Stefan Roese <sr@denx.de> wrote:
> >>
> >> On 8/23/23 14:00, Oleksandr Suvorov wrote:
> >>> Add SPL_HW_WATCHDOG Kconfig symbol which can be used to enable
> >>> non-WDT hardware watchdog in SPL.
> >>
> >> Hmmm, my hope / plan was to completely drop HW_WATCHDOG at some point.
> >> It's some old relict and if I don't miss something completely, it's more
> >> a "normal" watchdog that needs to get triggered very early in most
> >> cases (PowerPC etc).
> >
> > Oh, it's a good approach, thanks.
>
> Good that we agree. But...
>
> >> So adding some more *_HW_WATCHDOG stuff does not sound appealing to me.
> >> Could you perhaps investigate a bit, if your HW_WATCHDOG use case can
> >> be converted to the "normal" watchdog support instead?
> >
> > We just need to be able to exclude a hardware watchdog from SPL to
> > save some memory.
>
> Did you already enable LTO so decrease the image size? Just checking.

We use SPL->OP-TEE->U-boot booting scheme instead of standard
SPL->U-boot->OP-TEE, so SPL in our distro needs more preparation
than usual :) So LTO helps but doesn't solve a size issue for some SoCs.

> > So I resign this patch and we'll wait for your work and then revise
> > what we have again.
>
> ...but: Actually I don't have any plans to do this rework myself. At
> least not short-term. My hope was that someone for the platforms using
> this HW_WATCHDOG stuff would jump in here. ;)

Got it :) I'm looking into that stuff in a ~month.

> Thanks,
> Stefan
>
> >> Thanks,
> >> Stefan
> >
> > Cheers,
> > Oleksandr
> >
> >>
> >>> Co-developed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> >>> Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
> >>> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
> >>> ---
> >>>
> >>> Changes in v2:
> >>> - remove mistakenly included unwanted changes
> >>>
> >>>    common/spl/Kconfig        | 1 -
> >>>    drivers/Makefile          | 1 +
> >>>    drivers/sysreset/Kconfig  | 6 ++++++
> >>>    drivers/sysreset/Makefile | 2 +-
> >>>    drivers/watchdog/Kconfig  | 4 ++++
> >>>    5 files changed, 12 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> >>> index c5dd476db58..07d9dac29bd 100644
> >>> --- a/common/spl/Kconfig
> >>> +++ b/common/spl/Kconfig
> >>> @@ -1351,7 +1351,6 @@ config SPL_THERMAL
> >>>
> >>>    config SPL_WATCHDOG
> >>>        bool "Support watchdog drivers"
> >>> -     imply SPL_WDT if !HW_WATCHDOG
> >>>        help
> >>>          Enable support for watchdog drivers in SPL. A watchdog is
> >>>          typically a hardware peripheral which can reset the system when it
> >>> diff --git a/drivers/Makefile b/drivers/Makefile
> >>> index efc2a4afb24..2eb8ec0a894 100644
> >>> --- a/drivers/Makefile
> >>> +++ b/drivers/Makefile
> >>> @@ -62,6 +62,7 @@ obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
> >>>    obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
> >>>    obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/udc/
> >>>    obj-$(CONFIG_SPL_WATCHDOG) += watchdog/
> >>> +obj-$(CONFIG_SPL_HW_WATCHDOG) += watchdog/
> >>>    obj-$(CONFIG_SPL_USB_HOST) += usb/host/
> >>>    obj-$(CONFIG_SPL_SATA) += ata/ scsi/
> >>>    obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
> >>> diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
> >>> index bdbe2a95364..0d21673e402 100644
> >>> --- a/drivers/sysreset/Kconfig
> >>> +++ b/drivers/sysreset/Kconfig
> >>> @@ -157,6 +157,12 @@ config SYSRESET_WATCHDOG
> >>>        help
> >>>          Reboot support for generic watchdog reset.
> >>>
> >>> +config SPL_SYSRESET_WATCHDOG
> >>> +     bool "Enable support for watchdog reboot driver in SPL mode"
> >>> +     select SPL_WDT
> >>> +     help
> >>> +       Reboot support for generic watchdog reset in SPL mode.
> >>> +
> >>>    config SYSRESET_WATCHDOG_AUTO
> >>>        bool "Automatically register first watchdog with sysreset"
> >>>        depends on SYSRESET_WATCHDOG
> >>> diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
> >>> index 40c876764af..e5a7fc07a81 100644
> >>> --- a/drivers/sysreset/Makefile
> >>> +++ b/drivers/sysreset/Makefile
> >>> @@ -18,7 +18,7 @@ obj-$(CONFIG_SYSRESET_SOCFPGA) += sysreset_socfpga.o
> >>>    obj-$(CONFIG_SYSRESET_SOCFPGA_SOC64) += sysreset_socfpga_soc64.o
> >>>    obj-$(CONFIG_SYSRESET_TI_SCI) += sysreset-ti-sci.o
> >>>    obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
> >>> -obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
> >>> +obj-$(CONFIG_$(SPL_)SYSRESET_WATCHDOG) += sysreset_watchdog.o
> >>>    obj-$(CONFIG_SYSRESET_RESETCTL) += sysreset_resetctl.o
> >>>    obj-$(CONFIG_$(SPL_TPL_)SYSRESET_AT91) += sysreset_at91.o
> >>>    obj-$(CONFIG_$(SPL_TPL_)SYSRESET_X86) += sysreset_x86.o
> >>> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> >>> index 07fc4940e91..d696a04fc18 100644
> >>> --- a/drivers/watchdog/Kconfig
> >>> +++ b/drivers/watchdog/Kconfig
> >>> @@ -39,9 +39,13 @@ config WATCHDOG_TIMEOUT_MSECS
> >>>    config HW_WATCHDOG
> >>>        bool
> >>>
> >>> +config SPL_HW_WATCHDOG
> >>> +     bool
> >>> +
> >>>    config IMX_WATCHDOG
> >>>        bool "Enable Watchdog Timer support for IMX and LSCH2 of NXP"
> >>>        select HW_WATCHDOG if !WDT
> >>> +     select SPL_HW_WATCHDOG if !SPL_WDT
> >>>        help
> >>>          Select this to enable the IMX and LSCH2 of Layerscape watchdog
> >>>          driver.
> >>
> >> Viele Grüße,
> >> Stefan Roese
> >>
> >> --
> >> DENX Software Engineering GmbH,      Managing Director: Erika Unter
> >> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> >> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
> >
> >
> >
>
> Viele Grüße,
> Stefan Roese
>
> --
> DENX Software Engineering GmbH,      Managing Director: Erika Unter
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
diff mbox series

Patch

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index c5dd476db58..07d9dac29bd 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1351,7 +1351,6 @@  config SPL_THERMAL
 
 config SPL_WATCHDOG
 	bool "Support watchdog drivers"
-	imply SPL_WDT if !HW_WATCHDOG
 	help
 	  Enable support for watchdog drivers in SPL. A watchdog is
 	  typically a hardware peripheral which can reset the system when it
diff --git a/drivers/Makefile b/drivers/Makefile
index efc2a4afb24..2eb8ec0a894 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -62,6 +62,7 @@  obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
 obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
 obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/udc/
 obj-$(CONFIG_SPL_WATCHDOG) += watchdog/
+obj-$(CONFIG_SPL_HW_WATCHDOG) += watchdog/
 obj-$(CONFIG_SPL_USB_HOST) += usb/host/
 obj-$(CONFIG_SPL_SATA) += ata/ scsi/
 obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
index bdbe2a95364..0d21673e402 100644
--- a/drivers/sysreset/Kconfig
+++ b/drivers/sysreset/Kconfig
@@ -157,6 +157,12 @@  config SYSRESET_WATCHDOG
 	help
 	  Reboot support for generic watchdog reset.
 
+config SPL_SYSRESET_WATCHDOG
+	bool "Enable support for watchdog reboot driver in SPL mode"
+	select SPL_WDT
+	help
+	  Reboot support for generic watchdog reset in SPL mode.
+
 config SYSRESET_WATCHDOG_AUTO
 	bool "Automatically register first watchdog with sysreset"
 	depends on SYSRESET_WATCHDOG
diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
index 40c876764af..e5a7fc07a81 100644
--- a/drivers/sysreset/Makefile
+++ b/drivers/sysreset/Makefile
@@ -18,7 +18,7 @@  obj-$(CONFIG_SYSRESET_SOCFPGA) += sysreset_socfpga.o
 obj-$(CONFIG_SYSRESET_SOCFPGA_SOC64) += sysreset_socfpga_soc64.o
 obj-$(CONFIG_SYSRESET_TI_SCI) += sysreset-ti-sci.o
 obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
-obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
+obj-$(CONFIG_$(SPL_)SYSRESET_WATCHDOG) += sysreset_watchdog.o
 obj-$(CONFIG_SYSRESET_RESETCTL) += sysreset_resetctl.o
 obj-$(CONFIG_$(SPL_TPL_)SYSRESET_AT91) += sysreset_at91.o
 obj-$(CONFIG_$(SPL_TPL_)SYSRESET_X86) += sysreset_x86.o
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 07fc4940e91..d696a04fc18 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -39,9 +39,13 @@  config WATCHDOG_TIMEOUT_MSECS
 config HW_WATCHDOG
 	bool
 
+config SPL_HW_WATCHDOG
+	bool
+
 config IMX_WATCHDOG
 	bool "Enable Watchdog Timer support for IMX and LSCH2 of NXP"
 	select HW_WATCHDOG if !WDT
+	select SPL_HW_WATCHDOG if !SPL_WDT
 	help
 	  Select this to enable the IMX and LSCH2 of Layerscape watchdog
 	  driver.