[U-Boot] [PATCH v2 1/2] watchdog: driver support for fsl-lsch2

York Sun york.sun at nxp.com
Fri Jun 1 14:56:22 UTC 2018


On 06/01/2018 12:37 AM, Xiaoliang Yang wrote:
> Support watchdog driver for fsl-lsch2. If you want to use it,
> please enable CONFIG_IMX_WATCHDOG, and CONFIG_HW_WATCHDOG.
> define CONFIG_WATCHDOG_TIMEOUT_MSECS to set watchdog timeout.
> 
> Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1 at nxp.com>
> ---
>  arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 |   10 ++++++++++
>  drivers/watchdog/Kconfig                           |    6 ++++++
>  drivers/watchdog/Makefile                          |    2 ++
>  drivers/watchdog/imx_watchdog.c                    |   11 +++++++++++
>  4 files changed, 29 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
> index a6ef830..87b91eb 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
> @@ -8,3 +8,13 @@ Freescale LayerScape with Chassis Generation 2
>  
>  This architecture supports Freescale ARMv8 SoCs with Chassis generation 2,
>  for example LS1043A.
> +
> +Watchdog support Overview
> +-------------------
> +Support watchdog driver for Layerscape. Use following configs to enable it:
> +    #define CONFIG_IMX_WATCHDOG
> +    #define CONFIG_HW_WATCHDOG
> +Use following config to set watchdog timeout, if this config is not defined,
> +the default timeout value is 128s which is the maximum. Set 10 seconds for
> +example:
> +    #define CONFIG_WATCHDOG_TIMEOUT_MSECS 10000
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 148c6a0..a526afd 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -103,4 +103,10 @@ config WDT_CDNS
>  	   Select this to enable Cadence watchdog timer, which can be found on some
>  	   Xilinx Microzed Platform.
>  
> +config IMX_WATCHDOG
> +	bool "IMX watchdog timer support"
> +	help
> +	   Select this to enable IMX watchdog timer, which can be found on
> +	   some i.mx and fsl-lsch2 SoCs.
> +
>  endmenu
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index f405f51..159fc11 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -7,6 +7,8 @@ obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o
>  obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
>  ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610))
>  obj-y += imx_watchdog.o
> +else
> +obj-$(CONFIG_IMX_WATCHDOG) += imx_watchdog.o

It is good to see you convert this macro to Kconfig option. But it is
not right to mix these two. You should create a patch before this one to
convert this macro to Kconfig (and remove it from whitelist). It
shouldn't be hard, I only see 7 files defining this macro. Please make
sure you CC maintainers for the Kconfig change.

>  endif
>  obj-$(CONFIG_S5P)               += s5p_wdt.o
>  obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
> diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
> index 3f826d1..3ad4e55 100644
> --- a/drivers/watchdog/imx_watchdog.c
> +++ b/drivers/watchdog/imx_watchdog.c
> @@ -8,6 +8,13 @@
>  #include <asm/io.h>
>  #include <watchdog.h>
>  #include <asm/arch/imx-regs.h>
> +#ifdef CONFIG_FSL_LAYERSCAPE
> +#ifdef CONFIG_FSL_LSCH3
> +#include <asm/arch/immap_lsch3.h>

You said LSCH3 doesn't support this watchdog.

York


More information about the U-Boot mailing list