[U-Boot] [PATCH v2 2/2] arm: at91: wdt: Convert watchdog config to Kconfig
Prasanthi Chellakumar
Prasanthi.Chellakumar at microchip.com
Mon Sep 17 16:12:01 UTC 2018
Convert "CONFIG_AT91SAM9_WATCHDOG" to new "CONFIG_WDT_AT91"
Kconfig option to support driver model and device tree.
Signed-off-by: Prasanthi Chellakumar <prasanthi.chellakumar at microchip.com>
---
README | 3 ---
arch/arm/dts/at91sam9260-smartweb.dts | 1 +
arch/arm/dts/at91sam9g20-taurus.dts | 1 +
arch/arm/mach-at91/spl.c | 2 +-
arch/arm/mach-at91/spl_at91.c | 2 +-
arch/arm/mach-at91/spl_atmel.c | 2 +-
common/board_f.c | 2 +-
configs/picosam9g45_defconfig | 2 ++
configs/smartweb_defconfig | 2 ++
configs/taurus_defconfig | 2 ++
doc/README.at91 | 2 +-
doc/README.watchdog | 2 +-
include/configs/picosam9g45.h | 4 ----
include/configs/smartweb.h | 7 -------
include/configs/taurus.h | 7 -------
scripts/config_whitelist.txt | 2 --
16 files changed, 14 insertions(+), 29 deletions(-)
diff --git a/README b/README
index 09822a3..07b2be1 100644
--- a/README
+++ b/README
@@ -802,9 +802,6 @@ The following options need to be configured:
SoC, then define this variable and provide board
specific code for the "hw_watchdog_reset" function.
- CONFIG_AT91_HW_WDT_TIMEOUT
- specify the timeout in seconds. default 2 seconds.
-
- Real-Time Clock:
When CONFIG_CMD_DATE is selected, the type of the RTC
diff --git a/arch/arm/dts/at91sam9260-smartweb.dts b/arch/arm/dts/at91sam9260-smartweb.dts
index e59781b..a22de2d 100644
--- a/arch/arm/dts/at91sam9260-smartweb.dts
+++ b/arch/arm/dts/at91sam9260-smartweb.dts
@@ -89,6 +89,7 @@
};
watchdog at fffffd40 {
+ timeout-sec = <15>;
status = "okay";
};
diff --git a/arch/arm/dts/at91sam9g20-taurus.dts b/arch/arm/dts/at91sam9g20-taurus.dts
index 7931c0a..cee228b 100644
--- a/arch/arm/dts/at91sam9g20-taurus.dts
+++ b/arch/arm/dts/at91sam9g20-taurus.dts
@@ -98,6 +98,7 @@
};
watchdog at fffffd40 {
+ timeout-sec = <15>;
status = "okay";
};
diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c
index 8bfb2a4..6da6d41 100644
--- a/arch/arm/mach-at91/spl.c
+++ b/arch/arm/mach-at91/spl.c
@@ -11,7 +11,7 @@
#include <asm/arch/clk.h>
#include <spl.h>
-#if !defined(CONFIG_AT91SAM9_WATCHDOG)
+#if !defined(CONFIG_WDT_AT91)
void at91_disable_wdt(void)
{
struct at91_wdt *wdt = (struct at91_wdt *)ATMEL_BASE_WDT;
diff --git a/arch/arm/mach-at91/spl_at91.c b/arch/arm/mach-at91/spl_at91.c
index 8c36804..23ebaa9 100644
--- a/arch/arm/mach-at91/spl_at91.c
+++ b/arch/arm/mach-at91/spl_at91.c
@@ -76,7 +76,7 @@ void __weak spl_board_init(void)
void board_init_f(ulong dummy)
{
lowlevel_clock_init();
-#if !defined(CONFIG_AT91SAM9_WATCHDOG)
+#if !defined(CONFIG_WDT_AT91)
at91_disable_wdt();
#endif
diff --git a/arch/arm/mach-at91/spl_atmel.c b/arch/arm/mach-at91/spl_atmel.c
index 597ff8c..ef745c9 100644
--- a/arch/arm/mach-at91/spl_atmel.c
+++ b/arch/arm/mach-at91/spl_atmel.c
@@ -98,7 +98,7 @@ void board_init_f(ulong dummy)
configure_2nd_sram_as_l2_cache();
#endif
-#if !defined(CONFIG_AT91SAM9_WATCHDOG)
+#if !defined(CONFIG_WDT_AT91)
/* disable watchdog */
at91_disable_wdt();
#endif
diff --git a/common/board_f.c b/common/board_f.c
index 88d7700..9c0487f 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -89,7 +89,7 @@ static int init_func_watchdog_init(void)
{
# if defined(CONFIG_HW_WATCHDOG) && \
(defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || \
- defined(CONFIG_SH) || defined(CONFIG_AT91SAM9_WATCHDOG) || \
+ defined(CONFIG_SH) || \
defined(CONFIG_DESIGNWARE_WATCHDOG) || \
defined(CONFIG_IMX_WATCHDOG))
hw_watchdog_init();
diff --git a/configs/picosam9g45_defconfig b/configs/picosam9g45_defconfig
index 0b6234f..28bb6df 100644
--- a/configs/picosam9g45_defconfig
+++ b/configs/picosam9g45_defconfig
@@ -39,3 +39,5 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_LCD=y
CONFIG_OF_LIBFDT=y
+CONFIG_WDT=y
+CONFIG_WDT_AT91=y
diff --git a/configs/smartweb_defconfig b/configs/smartweb_defconfig
index b0bb18a..0bda9ad 100644
--- a/configs/smartweb_defconfig
+++ b/configs/smartweb_defconfig
@@ -60,3 +60,5 @@ CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_MCS7830=y
CONFIG_SPL_TINY_MEMSET=y
# CONFIG_EFI_LOADER is not set
+CONFIG_WDT=y
+CONFIG_WDT_AT91=y
diff --git a/configs/taurus_defconfig b/configs/taurus_defconfig
index bafd8ab..fc4ac4a 100644
--- a/configs/taurus_defconfig
+++ b/configs/taurus_defconfig
@@ -62,3 +62,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0908
CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_USE_TINY_PRINTF=y
+CONFIG_WDT=y
+CONFIG_WDT_AT91=y
diff --git a/doc/README.at91 b/doc/README.at91
index 6741213..39dd563 100644
--- a/doc/README.at91
+++ b/doc/README.at91
@@ -171,4 +171,4 @@ III. Watchdog support
your code (make sure not to disable it in AT91Bootstrap for instance).
In the U-Boot configuration, the AT91 watchdog support is enabled using
- the CONFIG_AT91SAM9_WATCHDOG and CONFIG_HW_WATCHDOG options.
+ the CONFIG_WDT and CONFIG_WDT_AT91 options.
diff --git a/doc/README.watchdog b/doc/README.watchdog
index 7097c87..f23c923 100644
--- a/doc/README.watchdog
+++ b/doc/README.watchdog
@@ -14,7 +14,7 @@ CONFIG_WATCHDOG_TIMEOUT_MSECS
If not given, will default to maximum timeout. This would
be 128000 msec for i.mx31/35/5x/6x.
-CONFIG_AT91SAM9_WATCHDOG
+CONFIG_WDT_AT91
Available for AT91SAM9 to service the watchdog.
CONFIG_FTWDT010_WATCHDOG
diff --git a/include/configs/picosam9g45.h b/include/configs/picosam9g45.h
index 0b240e7..c2882e6 100644
--- a/include/configs/picosam9g45.h
+++ b/include/configs/picosam9g45.h
@@ -57,10 +57,6 @@
*/
#define CONFIG_BOOTP_BOOTFILESIZE
-/* Enable the watchdog */
-#define CONFIG_AT91SAM9_WATCHDOG
-#define CONFIG_HW_WATCHDOG
-
/*
* Command line configuration.
*/
diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h
index 114b87e..28af575 100644
--- a/include/configs/smartweb.h
+++ b/include/configs/smartweb.h
@@ -112,13 +112,6 @@
"root=/dev/nfs ip=dhcp nfsroot=${serverip}:/srv/nfs/rootfs; " \
"dhcp"
-/* Enable the watchdog */
-#define CONFIG_AT91SAM9_WATCHDOG
-#if !defined(CONFIG_SPL_BUILD)
-#define CONFIG_HW_WATCHDOG
-#endif
-#define CONFIG_AT91_HW_WDT_TIMEOUT 15
-
#if !defined(CONFIG_SPL_BUILD)
/* USB configuration */
#define CONFIG_USB_ATMEL
diff --git a/include/configs/taurus.h b/include/configs/taurus.h
index 4fdb0dd..f283ab7 100644
--- a/include/configs/taurus.h
+++ b/include/configs/taurus.h
@@ -85,13 +85,6 @@
#define CONFIG_RMII
#define CONFIG_AT91_WANTS_COMMON_PHY
-#define CONFIG_AT91SAM9_WATCHDOG
-#define CONFIG_AT91_HW_WDT_TIMEOUT 15
-#if !defined(CONFIG_SPL_BUILD)
-/* Enable the watchdog */
-#define CONFIG_HW_WATCHDOG
-#endif
-
/* USB */
#if defined(CONFIG_BOARD_TAURUS)
#define CONFIG_USB_ATMEL
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 30c79a6..ee29013 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -82,11 +82,9 @@ CONFIG_AT91SAM9G20EK_2MMC
CONFIG_AT91SAM9G45EKES
CONFIG_AT91SAM9G45_LCD_BASE
CONFIG_AT91SAM9M10G45EK
-CONFIG_AT91SAM9_WATCHDOG
CONFIG_AT91_CAN
CONFIG_AT91_EFLASH
CONFIG_AT91_GPIO_PULLUP
-CONFIG_AT91_HW_WDT_TIMEOUT
CONFIG_AT91_LED
CONFIG_AT91_WANTS_COMMON_PHY
CONFIG_ATAPI
--
2.7.4
More information about the U-Boot
mailing list