[U-Boot] [PATCH] Kconfig: Convert CONFIG_IMX_WATCHDOG to Kconfig

2018-10-25 Thread Xiaoliang Yang
Move this option to Kconfig and tidy up the config file of eight
boards which use it.

Signed-off-by: Xiaoliang Yang 
---
 configs/aristainetos2_defconfig   |1 +
 configs/aristainetos2b_defconfig  |1 +
 configs/aristainetos_defconfig|1 +
 configs/dh_imx6_defconfig |1 +
 configs/display5_defconfig|1 +
 configs/display5_factory_defconfig|1 +
 configs/ge_bx50v3_defconfig   |1 +
 configs/kp_imx6q_tpc_defconfig|1 +
 configs/mx53ppd_defconfig |1 +
 configs/tqma6s_wru4_mmc_defconfig |1 +
 configs/warp_defconfig|1 +
 drivers/watchdog/Kconfig  |7 +++
 include/configs/aristainetos-common.h |3 ---
 include/configs/dh_imx6.h |2 --
 include/configs/display5.h|2 --
 include/configs/ge_bx50v3.h   |2 --
 include/configs/kp_imx6q_tpc.h|2 --
 include/configs/mx53ppd.h |2 --
 include/configs/tqma6_wru4.h  |2 --
 include/configs/warp.h|2 --
 scripts/config_whitelist.txt  |1 -
 21 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/configs/aristainetos2_defconfig b/configs/aristainetos2_defconfig
index 5044a59..c55e39c 100644
--- a/configs/aristainetos2_defconfig
+++ b/configs/aristainetos2_defconfig
@@ -50,4 +50,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/aristainetos2b_defconfig b/configs/aristainetos2b_defconfig
index 6641382..95c3063 100644
--- a/configs/aristainetos2b_defconfig
+++ b/configs/aristainetos2b_defconfig
@@ -50,4 +50,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/aristainetos_defconfig b/configs/aristainetos_defconfig
index 6a31ee6..4082b12 100644
--- a/configs/aristainetos_defconfig
+++ b/configs/aristainetos_defconfig
@@ -49,4 +49,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/dh_imx6_defconfig b/configs/dh_imx6_defconfig
index 2cb7164..92b2377 100644
--- a/configs/dh_imx6_defconfig
+++ b/configs/dh_imx6_defconfig
@@ -59,4 +59,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/display5_defconfig b/configs/display5_defconfig
index 697138e..ab5ec59 100644
--- a/configs/display5_defconfig
+++ b/configs/display5_defconfig
@@ -75,3 +75,4 @@ CONFIG_MII=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
+CONFIG_IMX_WATCHDOG=y
diff --git a/configs/display5_factory_defconfig 
b/configs/display5_factory_defconfig
index 5962b64..5d1c746 100644
--- a/configs/display5_factory_defconfig
+++ b/configs/display5_factory_defconfig
@@ -82,4 +82,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
 CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/ge_bx50v3_defconfig b/configs/ge_bx50v3_defconfig
index 729377d..c907779 100644
--- a/configs/ge_bx50v3_defconfig
+++ b/configs/ge_bx50v3_defconfig
@@ -41,5 +41,6 @@ CONFIG_CMD_E1000=y
 CONFIG_MII=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
 # CONFIG_EFI_LOADER is not set
diff --git a/configs/kp_imx6q_tpc_defconfig b/configs/kp_imx6q_tpc_defconfig
index 84ca1ce..5ebbe1d 100644
--- a/configs/kp_imx6q_tpc_defconfig
+++ b/configs/kp_imx6q_tpc_defconfig
@@ -40,4 +40,5 @@ CONFIG_MII=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
index 7be5c04..34328fd 100644
--- a/configs/mx53ppd_defconfig
+++ b/configs/mx53ppd_defconfig
@@ -37,4 +37,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/tqma6s_wru4_mmc_defconfig 
b/configs/tqma6s_wru4_mmc_defconfig
index df4c87e..c1be704 100644
--- a/configs/tqma6s_wru4_mmc_defconfig
+++ b/configs/tqma6s_wru4_mmc_defconfig
@@ -65,4 +65,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_SMSC95XX=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/warp_defconfig b/configs/warp_defconfig
index 6a9c91e..63eee27 100644
--- a/configs/warp_defconfig
+++ b/configs/warp_defconfig
@@ -37,4 +37,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index d5dbc80..988c702 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -117,4 +117,11

[U-Boot] [PATCH v2 2/2] watchdog: imx: add config to disable wdog reset

2018-10-18 Thread Xiaoliang Yang
Add Kconfig option WATCHDOG_RESET_DISABLE to disable watchdog reset
in imx_watchdog driver, so that the watchdog will not be fed in
u-boot if CONFIG_WATCHDOG_RESET_DISABLE is enabled.

Signed-off-by: Xiaoliang Yang 
---
 arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 |2 ++
 drivers/watchdog/Kconfig   |6 ++
 drivers/watchdog/imx_watchdog.c|2 ++
 3 files changed, 10 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 9176546..9583bf7 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
+++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
@@ -17,3 +17,5 @@ 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 1
+Set CONFIG_WATCHDOG_RESET_DISABLE to disable reset watchdog, so that the
+watchdog will not be fed in u-boot.
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index d545b3e..d5dbc80 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -11,6 +11,12 @@ config WATCHDOG
 config HW_WATCHDOG
bool
 
+config WATCHDOG_RESET_DISABLE
+   bool "Disable reset watchdog"
+   help
+  Disable reset watchdog, which can let WATCHDOG_RESET invalid, so
+  that the watchdog will not be fed in u-boot.
+
 config BCM2835_WDT
bool "Enable BCM2835/2836 watchdog driver"
select HW_WATCHDOG
diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index ddcf474..14cc618 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -16,10 +16,12 @@
 #ifdef CONFIG_IMX_WATCHDOG
 void hw_watchdog_reset(void)
 {
+#ifndef CONFIG_WATCHDOG_RESET_DISABLE
struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
 
writew(0x, >wsr);
writew(0x, >wsr);
+#endif /* CONFIG_WATCHDOG_RESET_DISABLE*/
 }
 
 void hw_watchdog_init(void)
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2018-10-18 Thread Xiaoliang Yang
Support watchdog driver for fsl-lsch2. It's disabled in default.
If you want to use it, please enable CONFIG_IMX_WATCHDOG.
Define CONFIG_WATCHDOG_TIMEOUT_MSECS to set watchdog timeout.

Signed-off-by: Xiaoliang Yang 
---
v1->v2: Remove LSCH3 config from imx-watchdog.c, because it only
support LSCH2 platforms.
Use Kconfig option IMX_WATCHDOG to introduce how to use
watchdog driver in README.lsch2.
---
 arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 |9 +
 drivers/watchdog/Makefile  |2 ++
 drivers/watchdog/imx_watchdog.c|7 +++
 3 files changed, 18 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..9176546 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
+++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
@@ -8,3 +8,12 @@ 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 LSCH2. The driver is disabled in default.
+You can enable it by setting CONFIG_IMX_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 1
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 08406ca..19c631b 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), mx25 mx31 mx35 mx5 mx6 mx7 vf610))
 obj-y += imx_watchdog.o
+else
+obj-$(CONFIG_IMX_WATCHDOG) += imx_watchdog.o
 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..ddcf474 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -8,6 +8,9 @@
 #include 
 #include 
 #include 
+#ifdef CONFIG_FSL_LSCH2
+#include 
+#endif
 #include 
 
 #ifdef CONFIG_IMX_WATCHDOG
@@ -33,8 +36,12 @@ void hw_watchdog_init(void)
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000
 #endif
timeout = (CONFIG_WATCHDOG_TIMEOUT_MSECS / 500) - 1;
+#ifdef CONFIG_FSL_LSCH2
+   writew((WCR_WDA | WCR_SRS | WCR_WDE) << 8 | timeout, >wcr);
+#else
writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS |
WCR_WDA | SET_WCR_WT(timeout), >wcr);
+#endif /* CONFIG_FSL_LSCH2*/
hw_watchdog_reset();
 }
 #endif
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] Kconfig: Convert CONFIG_IMX_WATCHDOG to Kconfig

2018-10-18 Thread Xiaoliang Yang
Move this option to Kconfig and tidy up the config file of eight
boards which use it.

Signed-off-by: Xiaoliang Yang 
---
 configs/aristainetos2_defconfig   |1 +
 configs/aristainetos2b_defconfig  |1 +
 configs/aristainetos_defconfig|1 +
 configs/dh_imx6_defconfig |1 +
 configs/display5_defconfig|1 +
 configs/display5_factory_defconfig|1 +
 configs/ge_bx50v3_defconfig   |1 +
 configs/kp_imx6q_tpc_defconfig|1 +
 configs/mx53ppd_defconfig |1 +
 configs/tqma6s_wru4_mmc_defconfig |1 +
 configs/warp_defconfig|1 +
 drivers/watchdog/Kconfig  |7 +++
 include/configs/aristainetos-common.h |3 ---
 include/configs/dh_imx6.h |2 --
 include/configs/display5.h|2 --
 include/configs/ge_bx50v3.h   |2 --
 include/configs/kp_imx6q_tpc.h|2 --
 include/configs/mx53ppd.h |2 --
 include/configs/tqma6_wru4.h  |2 --
 include/configs/warp.h|2 --
 scripts/config_whitelist.txt  |1 -
 21 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/configs/aristainetos2_defconfig b/configs/aristainetos2_defconfig
index 5044a59..c55e39c 100644
--- a/configs/aristainetos2_defconfig
+++ b/configs/aristainetos2_defconfig
@@ -50,4 +50,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/aristainetos2b_defconfig b/configs/aristainetos2b_defconfig
index 6641382..95c3063 100644
--- a/configs/aristainetos2b_defconfig
+++ b/configs/aristainetos2b_defconfig
@@ -50,4 +50,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/aristainetos_defconfig b/configs/aristainetos_defconfig
index 6a31ee6..4082b12 100644
--- a/configs/aristainetos_defconfig
+++ b/configs/aristainetos_defconfig
@@ -49,4 +49,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/dh_imx6_defconfig b/configs/dh_imx6_defconfig
index 2cb7164..92b2377 100644
--- a/configs/dh_imx6_defconfig
+++ b/configs/dh_imx6_defconfig
@@ -59,4 +59,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/display5_defconfig b/configs/display5_defconfig
index 697138e..ab5ec59 100644
--- a/configs/display5_defconfig
+++ b/configs/display5_defconfig
@@ -75,3 +75,4 @@ CONFIG_MII=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
+CONFIG_IMX_WATCHDOG=y
diff --git a/configs/display5_factory_defconfig 
b/configs/display5_factory_defconfig
index 5962b64..5d1c746 100644
--- a/configs/display5_factory_defconfig
+++ b/configs/display5_factory_defconfig
@@ -82,4 +82,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
 CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/ge_bx50v3_defconfig b/configs/ge_bx50v3_defconfig
index 729377d..c907779 100644
--- a/configs/ge_bx50v3_defconfig
+++ b/configs/ge_bx50v3_defconfig
@@ -41,5 +41,6 @@ CONFIG_CMD_E1000=y
 CONFIG_MII=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
 # CONFIG_EFI_LOADER is not set
diff --git a/configs/kp_imx6q_tpc_defconfig b/configs/kp_imx6q_tpc_defconfig
index 84ca1ce..5ebbe1d 100644
--- a/configs/kp_imx6q_tpc_defconfig
+++ b/configs/kp_imx6q_tpc_defconfig
@@ -40,4 +40,5 @@ CONFIG_MII=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
index 7be5c04..34328fd 100644
--- a/configs/mx53ppd_defconfig
+++ b/configs/mx53ppd_defconfig
@@ -37,4 +37,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/tqma6s_wru4_mmc_defconfig 
b/configs/tqma6s_wru4_mmc_defconfig
index df4c87e..c1be704 100644
--- a/configs/tqma6s_wru4_mmc_defconfig
+++ b/configs/tqma6s_wru4_mmc_defconfig
@@ -65,4 +65,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_SMSC95XX=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/warp_defconfig b/configs/warp_defconfig
index 6a9c91e..63eee27 100644
--- a/configs/warp_defconfig
+++ b/configs/warp_defconfig
@@ -37,4 +37,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OF_LIBFDT=y
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index d545b3e..02f4e1e 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -111,4 +111,11

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

2018-10-17 Thread Xiaoliang Yang
Hi York,

The old version of this patch is: http://patchwork.ozlabs.org/patch/918957/
There is a little mistake about LSCH3 not support for imx-watchdog in old 
version patch, I have fixed it.
If there is a need to rewrite CONFIG_IMX_WATCHDOG to Kconfig file, I will pull 
a new patch to do this. It doesn't affect this patch.

Regards,
Xiaoliang Yang

-Original Message-
From: Xiaoliang Yang  
Sent: 2018年10月17日 10:54
To: Xiaoliang Yang ; York Sun ; 
u-boot@lists.denx.de
Subject: [PATCH 1/2] watchdog: driver support for fsl-lsch2

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 
---
 arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 |9 +
 drivers/watchdog/Makefile  |2 ++
 drivers/watchdog/imx_watchdog.c|7 +++
 3 files changed, 18 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..5682fe5 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
+++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
@@ -8,3 +8,12 @@ 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 LSCH2. Watchdog driver is disabled in 
+default, please set CONFIG_IMX_WATCHDOG and CONFIG_HW_WATCHDOG to enable it.
+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 1
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 
08406ca..19c631b 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), 
mx25 mx31 mx35 mx5 mx6 mx7 vf610))  obj-y += imx_watchdog.o
+else
+obj-$(CONFIG_IMX_WATCHDOG) += imx_watchdog.o
 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..ddcf474 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -8,6 +8,9 @@
 #include 
 #include 
 #include 
+#ifdef CONFIG_FSL_LSCH2
+#include 
+#endif
 #include 
 
 #ifdef CONFIG_IMX_WATCHDOG
@@ -33,8 +36,12 @@ void hw_watchdog_init(void)  #define 
CONFIG_WATCHDOG_TIMEOUT_MSECS 128000  #endif
timeout = (CONFIG_WATCHDOG_TIMEOUT_MSECS / 500) - 1;
+#ifdef CONFIG_FSL_LSCH2
+   writew((WCR_WDA | WCR_SRS | WCR_WDE) << 8 | timeout, >wcr); 
+#else
writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS |
WCR_WDA | SET_WCR_WT(timeout), >wcr);
+#endif /* CONFIG_FSL_LSCH2*/
hw_watchdog_reset();
 }
 #endif
--
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] watchdog: imx: add config to disable wdog reset

2018-10-16 Thread Xiaoliang Yang
Add Kconfig support for CONFIG_WATCHDOG_RESET_DISABLE, use this config
to disable watchdog reset in imx_watchdog driver, so that the watchdog
will not be fed in u-boot.

Signed-off-by: Xiaoliang Yang 
---
 arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 |2 ++
 drivers/watchdog/Kconfig   |6 ++
 drivers/watchdog/imx_watchdog.c|2 ++
 3 files changed, 10 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 5682fe5..0357249 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
+++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
@@ -17,3 +17,5 @@ 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 1
+Set CONFIG_WATCHDOG_RESET_DISABLE to disable reset watchdog, so that the
+watchdog will not be fed in u-boot.
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index d545b3e..b06c544 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -111,4 +111,10 @@ config XILINX_TB_WATCHDOG
   Select this to enable Xilinx Axi watchdog timer, which can be found 
on some
   Xilinx Microblaze Platforms.
 
+config WATCHDOG_RESET_DISABLE
+   bool "Disable reset watchdog"
+   help
+  Disable reset watchdog, which can let WATCHDOG_RESET invalid, so
+  that the watchdog will not be fed in u-boot.
+
 endmenu
diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index ddcf474..14cc618 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -16,10 +16,12 @@
 #ifdef CONFIG_IMX_WATCHDOG
 void hw_watchdog_reset(void)
 {
+#ifndef CONFIG_WATCHDOG_RESET_DISABLE
struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
 
writew(0x, >wsr);
writew(0x, >wsr);
+#endif /* CONFIG_WATCHDOG_RESET_DISABLE*/
 }
 
 void hw_watchdog_init(void)
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2018-10-16 Thread Xiaoliang Yang
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 
---
 arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 |9 +
 drivers/watchdog/Makefile  |2 ++
 drivers/watchdog/imx_watchdog.c|7 +++
 3 files changed, 18 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..5682fe5 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
+++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
@@ -8,3 +8,12 @@ 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 LSCH2. Watchdog driver is disabled in default,
+please set CONFIG_IMX_WATCHDOG and CONFIG_HW_WATCHDOG to enable it.
+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 1
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 08406ca..19c631b 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), mx25 mx31 mx35 mx5 mx6 mx7 vf610))
 obj-y += imx_watchdog.o
+else
+obj-$(CONFIG_IMX_WATCHDOG) += imx_watchdog.o
 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..ddcf474 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -8,6 +8,9 @@
 #include 
 #include 
 #include 
+#ifdef CONFIG_FSL_LSCH2
+#include 
+#endif
 #include 
 
 #ifdef CONFIG_IMX_WATCHDOG
@@ -33,8 +36,12 @@ void hw_watchdog_init(void)
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000
 #endif
timeout = (CONFIG_WATCHDOG_TIMEOUT_MSECS / 500) - 1;
+#ifdef CONFIG_FSL_LSCH2
+   writew((WCR_WDA | WCR_SRS | WCR_WDE) << 8 | timeout, >wcr);
+#else
writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS |
WCR_WDA | SET_WCR_WT(timeout), >wcr);
+#endif /* CONFIG_FSL_LSCH2*/
hw_watchdog_reset();
 }
 #endif
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2018-06-01 Thread Xiaoliang Yang
v1 -> v2:
Because of imx_watchdog.c driver not supports all layerscape SoCs, change to 
build imx_watchdog.o only when enable IMX_WATCHDOG for fsl-lsch2 SoCs.
Add IMX_WATCHDOG in drivers/watchdog/Kconfig.
Changes in v2:
drivers/watchdog/Kconfig   |6 ++
drivers/watchdog/Makefile  |2 ++


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 2/2] watchdog: Kconfig: add config to disable wdog reset

2018-06-01 Thread Xiaoliang Yang
Add Kconfig support for CONFIG_WATCHDOG_RESET_DISABLE, use this config
to disable watchdog reset in imx_watchdog driver, so that the watchdog
will not be fed in u-boot.

Signed-off-by: Xiaoliang Yang 
---
 arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 |3 +++
 drivers/watchdog/Kconfig   |6 ++
 drivers/watchdog/imx_watchdog.c|2 ++
 3 files changed, 11 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 87b91eb..c43a99b 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
+++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
@@ -18,3 +18,6 @@ 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 1
+Use following config to disable reset watchdog, so that the watchdog will
+not be fed in u-boot:
+#define CONFIG_WATCHDOG_RESET_DISABLE
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index a526afd..1958c17 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -109,4 +109,10 @@ config IMX_WATCHDOG
   Select this to enable IMX watchdog timer, which can be found on
   some i.mx and fsl-lsch2 SoCs.
 
+config WATCHDOG_RESET_DISABLE
+   bool "Disable reset watchdog"
+   help
+  Disable reset watchdog, which can let WATCHDOG_RESET invalid, so
+  that the watchdog will not be fed in u-boot.
+
 endmenu
diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index 3ad4e55..6691ee9 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -20,10 +20,12 @@
 #ifdef CONFIG_IMX_WATCHDOG
 void hw_watchdog_reset(void)
 {
+#ifndef CONFIG_WATCHDOG_RESET_DISABLE
struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
 
writew(0x, >wsr);
writew(0x, >wsr);
+#endif /* CONFIG_WATCHDOG_RESET_DISABLE*/
 }
 
 void hw_watchdog_init(void)
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2018-06-01 Thread Xiaoliang Yang
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 
---
 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 1
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
 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 
 #include 
 #include 
+#ifdef CONFIG_FSL_LAYERSCAPE
+#ifdef CONFIG_FSL_LSCH3
+#include 
+#elif defined(CONFIG_FSL_LSCH2)
+#include 
+#endif
+#endif
 #include 
 
 #ifdef CONFIG_IMX_WATCHDOG
@@ -33,8 +40,12 @@ void hw_watchdog_init(void)
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000
 #endif
timeout = (CONFIG_WATCHDOG_TIMEOUT_MSECS / 500) - 1;
+#ifdef CONFIG_FSL_LAYERSCAPE
+   writew((WCR_WDA | WCR_SRS | WCR_WDE) << 8 | timeout, >wcr);
+#else
writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS |
WCR_WDA | SET_WCR_WT(timeout), >wcr);
+#endif /* CONFIG_FSL_LAYERSCAPE*/
hw_watchdog_reset();
 }
 #endif
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] watchdog: driver support for layerscape

2018-06-01 Thread Xiaoliang Yang
Hi York,

I think it's better not to affect the original i.mx SoCs. If not in i.mx SoCs, 
we can enable it by define CONFIG_IMX_WATCHDOG in config file. Or do you think 
it's better to use "select IMX_WATCHDOG" to enable it in default for our LSCH2 
SoCs/platforms?

Here is the patch I have changed:
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile 
> index 86cf94b..ea47ccf 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -7,8 +7,12 @@
> 
>  obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o
>  obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o -ifneq (,$(filter 
> $(SOC), mx31 mx35 mx5 mx6 mx7 vf610 fsl-layerscape))
> +ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610))
>  obj-y += imx_watchdog.o
> +else
> +obj-$(CONFIG_IMX_WATCHDOG) += imx_watchdog.o
>  endif
>

Regards,
Xiaoliang Yang

-Original Message-----
From: York Sun 
Sent: 2018年6月1日 0:03
To: Xiaoliang Yang ; u-boot@lists.denx.de
Subject: Re: [PATCH 1/2] watchdog: driver support for layerscape

Why don't move IMX_WATCHDOG to drivers/watchdog/Kconfig and enabled this
option for the selected SoCs/platforms?

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] watchdog: driver support for layerscape

2018-06-01 Thread Xiaoliang Yang
Hi York,

Sure, thanks for your suggestion. I'll add IMX_WATCHDOG in Kconfig, users can 
enable it for the platforms they needed.
I will push v2 patch later, please help to review it, thanks.

Regards,
Xiaoliang Yang

-Original Message-
From: York Sun 
Sent: 2018年6月1日 11:20
To: Xiaoliang Yang ; u-boot@lists.denx.de
Subject: Re: [PATCH 1/2] watchdog: driver support for layerscape

On 05/31/2018 08:16 PM, Xiaoliang Yang wrote:
> Hi York,
> 
> I think it's better not to affect the original i.mx SoCs. If not in i.mx 
> SoCs, we can enable it by define CONFIG_IMX_WATCHDOG in config file. Or do 
> you think it's better to use "select IMX_WATCHDOG" to enable it in default 
> for our LSCH2 SoCs/platforms?

It is a trend to use Kconfig instead of CONFIG_ macros. If you don't convert 
today, make sure you make it easy to convert.

If you expect this watchdog to be enabled for all LS2 platforms, you can enable 
it in LS2 config file. Otherwise, only enable it for the platforms you need.

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] watchdog: driver support for layerscape

2018-05-31 Thread Xiaoliang Yang
Thanks York,

This watchdog driver is really not support LSCH3. I'll change the patch like 
following to build the imx_watchdog.c only in LSCH2 of layerscape, do you think 
it's appropriate?

diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 86cf94b..ea47ccf 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -7,8 +7,12 @@

 obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o
 obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
-ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610 fsl-layerscape))
+ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610))
 obj-y += imx_watchdog.o
+else
+ifdef CONFIG_FSL_LSCH2
+obj-$(CONFIG_IMX_WATCHDOG) += imx_watchdog.o
+endif
 endif

Regards,
Xiaoliang Yang

-Original Message-
From: York Sun 
Sent: 2018年5月31日 6:12
To: Xiaoliang Yang ; u-boot@lists.denx.de
Subject: Re: [PATCH 1/2] watchdog: driver support for layerscape

On 05/23/2018 12:52 AM, Xiaoliang Yang wrote:
> Support watchdog driver for layerscape. If you want to use it, please 
> define CONFIG_IMX_WATCHDOG, CONFIG_HW_WATCHDOG, define 
> CONFIG_WATCHDOG_TIMEOUT_MSECS to set watchdog timeout.
> 
> Signed-off-by: Xiaoliang Yang 
> ---
>  arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 |   10 ++
>  drivers/watchdog/Makefile  |2 +-
>  drivers/watchdog/imx_watchdog.c|   11 +++
>  3 files changed, 22 insertions(+), 1 deletions(-)
>

I see compiling error. For example ls2080ardb. Please make sure you test all 
boards.

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] watchdog: driver support for layerscape

2018-05-23 Thread Xiaoliang Yang
Hi york,

Yes, I sent it two days ago, but it's failed to send to u-boot list, so I 
resend it.

Xiaoliang Yang

-Original Message-
From: York Sun 
Sent: 2018年5月24日 6:58
To: Xiaoliang Yang <xiaoliang.yan...@nxp.com>; u-boot@lists.denx.de
Subject: Re: [PATCH 1/2] watchdog: driver support for layerscape

On 05/23/2018 12:52 AM, Xiaoliang Yang wrote:
> Support watchdog driver for layerscape. If you want to use it, please 
> define CONFIG_IMX_WATCHDOG, CONFIG_HW_WATCHDOG, define 
> CONFIG_WATCHDOG_TIMEOUT_MSECS to set watchdog timeout.
> 
> Signed-off-by: Xiaoliang Yang <xiaoliang.yan...@nxp.com>
> ---
>  arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 |   10 ++
>  drivers/watchdog/Makefile  |2 +-
>  drivers/watchdog/imx_watchdog.c|   11 +++
>  3 files changed, 22 insertions(+), 1 deletions(-)
> 

Isn't this the same as you sent two days ago?

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] watchdog: Kconfig: add config to disable wdog reset

2018-05-23 Thread Xiaoliang Yang
Add Kconfig support for CONFIG_WATCHDOG_RESET_DISABLE, use this config
to disable watchdog reset in imx_watchdog driver, so that the watchdog
will not be fed in u-boot.

Signed-off-by: Xiaoliang Yang <xiaoliang.yan...@nxp.com>
---
 arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 |3 +++
 drivers/watchdog/Kconfig   |5 +
 drivers/watchdog/imx_watchdog.c|2 ++
 3 files changed, 10 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 87b91eb..c43a99b 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
+++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
@@ -18,3 +18,6 @@ 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 1
+Use following config to disable reset watchdog, so that the watchdog will
+not be fed in u-boot:
+#define CONFIG_WATCHDOG_RESET_DISABLE
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 148c6a0..f9b3035 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -103,4 +103,9 @@ config WDT_CDNS
   Select this to enable Cadence watchdog timer, which can be found on 
some
   Xilinx Microzed Platform.
 
+config WATCHDOG_RESET_DISABLE
+   bool "Disable reset watchdog"
+   help
+  Disable reset watchdog, which can let WATCHDOG_RESET invalid.
+
 endmenu
diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index 3ad4e55..6691ee9 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -20,10 +20,12 @@
 #ifdef CONFIG_IMX_WATCHDOG
 void hw_watchdog_reset(void)
 {
+#ifndef CONFIG_WATCHDOG_RESET_DISABLE
struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
 
writew(0x, >wsr);
writew(0x, >wsr);
+#endif /* CONFIG_WATCHDOG_RESET_DISABLE*/
 }
 
 void hw_watchdog_init(void)
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/2] watchdog: driver support for layerscape

2018-05-23 Thread Xiaoliang Yang
Support watchdog driver for layerscape. If you want to use it,
please define CONFIG_IMX_WATCHDOG, CONFIG_HW_WATCHDOG,
define CONFIG_WATCHDOG_TIMEOUT_MSECS to set watchdog timeout.

Signed-off-by: Xiaoliang Yang <xiaoliang.yan...@nxp.com>
---
 arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 |   10 ++
 drivers/watchdog/Makefile  |2 +-
 drivers/watchdog/imx_watchdog.c|   11 +++
 3 files changed, 22 insertions(+), 1 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 1
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index f405f51..4835b27 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -5,7 +5,7 @@
 
 obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o
 obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
-ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610))
+ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610 fsl-layerscape))
 obj-y += imx_watchdog.o
 endif
 obj-$(CONFIG_S5P)   += s5p_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 
 #include 
 #include 
+#ifdef CONFIG_FSL_LAYERSCAPE
+#ifdef CONFIG_FSL_LSCH3
+#include 
+#elif defined(CONFIG_FSL_LSCH2)
+#include 
+#endif
+#endif
 #include 
 
 #ifdef CONFIG_IMX_WATCHDOG
@@ -33,8 +40,12 @@ void hw_watchdog_init(void)
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000
 #endif
timeout = (CONFIG_WATCHDOG_TIMEOUT_MSECS / 500) - 1;
+#ifdef CONFIG_FSL_LAYERSCAPE
+   writew((WCR_WDA | WCR_SRS | WCR_WDE) << 8 | timeout, >wcr);
+#else
writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS |
WCR_WDA | SET_WCR_WT(timeout), >wcr);
+#endif /* CONFIG_FSL_LAYERSCAPE*/
hw_watchdog_reset();
 }
 #endif
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] armv7: LS1021a: enable i-cache in start.S

2016-10-11 Thread Xiaoliang Yang
OK, thanks.

Regards,
Xiaoliang Yang


-Original Message-
From: york sun 
Sent: Sunday, October 09, 2016 1:16 AM
To: Xiaoliang Yang; u-boot@lists.denx.de
Subject: Re: [PATCH] armv7: LS1021a: enable i-cache in start.S

On 09/13/2016 08:48 PM, Xiaoliang Yang wrote:
> Delete CONFIG_SKIP_LOWLEVEL_INIT define in ls1021atwr.h and 
> ls1021aqds.h can let it run cpu_init_cp15 to enable i-cache. First 
> stage of u-boot can run faster after that. There is a description 
> about skip lowlevel init in board/freescale/ls1021atwr/README.
>
> Signed-off-by: Xiaoliang Yang <xiaoliang.y...@nxp.com>
> ---

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] armv7: LS1021a: enable i-cache in start.S

2016-09-13 Thread Xiaoliang Yang
Delete CONFIG_SKIP_LOWLEVEL_INIT define in ls1021atwr.h and
ls1021aqds.h can let it run cpu_init_cp15 to enable i-cache. First
stage of u-boot can run faster after that. There is a description
about skip lowlevel init in board/freescale/ls1021atwr/README.

Signed-off-by: Xiaoliang Yang <xiaoliang.y...@nxp.com>
---
 arch/arm/cpu/armv7/Makefile   | 2 +-
 arch/arm/cpu/armv7/ls102xa/soc.c  | 4 
 board/freescale/ls1021aqds/README | 6 ++
 board/freescale/ls1021atwr/README | 6 ++
 include/configs/ls1021aqds.h  | 1 -
 include/configs/ls1021atwr.h  | 1 -
 6 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 0d4bfbc..c1eeefd 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -12,7 +12,7 @@ obj-y += cache_v7.o cache_v7_asm.o
 obj-y  += cpu.o cp15.o
 obj-y  += syslib.o
 
-ifneq 
($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_MX7)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI)$(CONFIG_ARCH_SOCFPGA),)
+ifneq 
($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_MX7)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI)$(CONFIG_ARCH_SOCFPGA)$(CONFIG_LS102XA),)
 ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y)
 obj-y  += lowlevel_init.o
 endif
diff --git a/arch/arm/cpu/armv7/ls102xa/soc.c b/arch/arm/cpu/armv7/ls102xa/soc.c
index b1b0c71..659a2d0 100644
--- a/arch/arm/cpu/armv7/ls102xa/soc.c
+++ b/arch/arm/cpu/armv7/ls102xa/soc.c
@@ -58,6 +58,10 @@ unsigned int get_soc_major_rev(void)
return major;
 }
 
+void s_init(void)
+{
+}
+
 int arch_soc_init(void)
 {
struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
diff --git a/board/freescale/ls1021aqds/README 
b/board/freescale/ls1021aqds/README
index c561776..6cf7146 100644
--- a/board/freescale/ls1021aqds/README
+++ b/board/freescale/ls1021aqds/README
@@ -110,3 +110,9 @@ Start Address   End Address Description 
Size
 0x00_7E80_ 0x00_7E80_  IFC - NAND Flash64KB
 0x00_7FB0_ 0x00_7FB0_0FFF  IFC - FPGA  4KB
 0x00_8000_ 0x00__  DRAM1   2GB
+
+LS1021a rev1.0 Soc specific Options/Settings
+
+If the LS1021a Soc is rev1.0, you need modify the configure file.
+Add the following define in include/configs/ls1021aqds.h:
+#define CONFIG_SKIP_LOWLEVEL_INIT
diff --git a/board/freescale/ls1021atwr/README 
b/board/freescale/ls1021atwr/README
index d2821cb..896a659 100644
--- a/board/freescale/ls1021atwr/README
+++ b/board/freescale/ls1021atwr/README
@@ -107,3 +107,9 @@ Start Address   End Address Description 
Size
 0x00_4000_ 0x00_5FFF_  QSPI512MB
 0x00_6000_ 0x00_67FF_  IFC - NOR Flash 128MB
 0x00_8000_ 0x00__  DRAM1   2GB
+
+LS1021a rev1.0 Soc specific Options/Settings
+
+If the LS1021a Soc is rev1.0, you need modify the configure file.
+Add the following define in include/configs/ls1021atwr.h:
+#define CONFIG_SKIP_LOWLEVEL_INIT
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index 105702d..88fb1ff 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -18,7 +18,6 @@
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
-#define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 
 #define CONFIG_DEEP_SLEEP
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 90ae770..7673ccc 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -18,7 +18,6 @@
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
-#define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_DEEP_SLEEP
 #ifdef CONFIG_DEEP_SLEEP
-- 
2.1.0.27.g96db324

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] armv7: ls102xa: add lowlevel init

2016-09-02 Thread Xiaoliang Yang
Hi york,

The silicon bug was existing in V1.0 of SoCs, we have already not supported 
them.


Xiaoliang Yang 


-Original Message-
From: york sun 
Sent: Friday, September 02, 2016 11:24 AM
To: Xiaoliang Yang; u-boot@lists.denx.de
Subject: Re: [PATCH] armv7: ls102xa: add lowlevel init

On 09/01/2016 07:32 PM, Xiaoliang Yang wrote:
> Hi York,
>
> We need enable i-cache in low level in order to improve u-boot running speed.
> We have skipped lowlevel_init because a silicon bug before. (it could 
> not run some instructions in lowlevel_init until DDR init, the bug has 
> already fixed.)

Xiaoliang,

Can you be more specific about the bug? You said it is fixed, how about 
existing SoCs? Will existing SoCs run into any issue with the lowlevel_init?

York

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] armv7: ls102xa: add lowlevel init

2016-09-01 Thread Xiaoliang Yang
Add lowlevel init in ls102xa, and delete the CONFIG_SKIP_LOWLEVEL_INIT
define in ls1021atwr.h

Signed-off-by: Xiaoliang Yang <xiaoliang.y...@nxp.com>
---
 arch/arm/cpu/armv7/Makefile  | 2 +-
 arch/arm/cpu/armv7/ls102xa/soc.c | 4 
 include/configs/ls1021atwr.h | 1 -
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 0d4bfbc..c1eeefd 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -12,7 +12,7 @@ obj-y += cache_v7.o cache_v7_asm.o
 obj-y  += cpu.o cp15.o
 obj-y  += syslib.o
 
-ifneq 
($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_MX7)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI)$(CONFIG_ARCH_SOCFPGA),)
+ifneq 
($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_MX7)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI)$(CONFIG_ARCH_SOCFPGA)$(CONFIG_LS102XA),)
 ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y)
 obj-y  += lowlevel_init.o
 endif
diff --git a/arch/arm/cpu/armv7/ls102xa/soc.c b/arch/arm/cpu/armv7/ls102xa/soc.c
index b1b0c71..659a2d0 100644
--- a/arch/arm/cpu/armv7/ls102xa/soc.c
+++ b/arch/arm/cpu/armv7/ls102xa/soc.c
@@ -58,6 +58,10 @@ unsigned int get_soc_major_rev(void)
return major;
 }
 
+void s_init(void)
+{
+}
+
 int arch_soc_init(void)
 {
struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 2f19950..f62ac7f 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -20,7 +20,6 @@
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
-#define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_DEEP_SLEEP
 #ifdef CONFIG_DEEP_SLEEP
-- 
2.1.0.27.g96db324

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot