Commit e61a4ff1 authored by Pali Rohár's avatar Pali Rohár Committed by Lokesh Vutla
Browse files

Nokia RX-51: Enable CONFIG_WDT to remove deprecation warning



Also convert CONFIG_HW_WATCHDOG to CONFIG_WATCHDOG.
Signed-off-by: default avatarPali Roh?r <pali@kernel.org>
Signed-off-by: Lokesh Vutla's avatarLokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210309201915.16586-1-pali@kernel.org
parent ce7ad573
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <env.h> #include <env.h>
#include <init.h> #include <init.h>
#include <watchdog.h> #include <watchdog.h>
#include <wdt.h>
#include <malloc.h> #include <malloc.h>
#include <twl4030.h> #include <twl4030.h>
#include <i2c.h> #include <i2c.h>
...@@ -487,20 +488,20 @@ static unsigned long int twl_wd_time; /* last time of watchdog reset */ ...@@ -487,20 +488,20 @@ static unsigned long int twl_wd_time; /* last time of watchdog reset */
static unsigned long int twl_i2c_lock; static unsigned long int twl_i2c_lock;
/* /*
* Routine: hw_watchdog_reset * Routine: rx51_watchdog_reset
* Description: Reset timeout of twl4030 watchdog. * Description: Reset timeout of twl4030 watchdog.
*/ */
void hw_watchdog_reset(void) static int rx51_watchdog_reset(struct udevice *dev)
{ {
u8 timeout = 0; u8 timeout = 0;
/* do not reset watchdog too often - max every 4s */ /* do not reset watchdog too often - max every 4s */
if (get_timer(twl_wd_time) < 4 * CONFIG_SYS_HZ) if (get_timer(twl_wd_time) < 4 * CONFIG_SYS_HZ)
return; return 0;
/* localy lock twl4030 i2c bus */ /* localy lock twl4030 i2c bus */
if (test_and_set_bit(0, &twl_i2c_lock)) if (test_and_set_bit(0, &twl_i2c_lock))
return; return 0;
/* read actual watchdog timeout */ /* read actual watchdog timeout */
twl4030_i2c_read_u8(TWL4030_CHIP_PM_RECEIVER, twl4030_i2c_read_u8(TWL4030_CHIP_PM_RECEIVER,
...@@ -517,8 +518,32 @@ void hw_watchdog_reset(void) ...@@ -517,8 +518,32 @@ void hw_watchdog_reset(void)
/* localy unlock twl4030 i2c bus */ /* localy unlock twl4030 i2c bus */
test_and_clear_bit(0, &twl_i2c_lock); test_and_clear_bit(0, &twl_i2c_lock);
return 0;
}
static int rx51_watchdog_start(struct udevice *dev, u64 timeout_ms, ulong flags)
{
return 0;
} }
static int rx51_watchdog_probe(struct udevice *dev)
{
return 0;
}
static const struct wdt_ops rx51_watchdog_ops = {
.start = rx51_watchdog_start,
.reset = rx51_watchdog_reset,
};
U_BOOT_DRIVER(rx51_watchdog) = {
.name = "rx51_watchdog",
.id = UCLASS_WDT,
.ops = &rx51_watchdog_ops,
.probe = rx51_watchdog_probe,
};
/* /*
* TWL4030 keypad handler for cfb_console * TWL4030 keypad handler for cfb_console
*/ */
...@@ -722,3 +747,7 @@ U_BOOT_DRVINFOS(rx51_i2c) = { ...@@ -722,3 +747,7 @@ U_BOOT_DRVINFOS(rx51_i2c) = {
{ "i2c_omap", &rx51_i2c[1] }, { "i2c_omap", &rx51_i2c[1] },
{ "i2c_omap", &rx51_i2c[2] }, { "i2c_omap", &rx51_i2c[2] },
}; };
U_BOOT_DRVINFOS(rx51_watchdog) = {
{ "rx51_watchdog" },
};
...@@ -67,4 +67,6 @@ CONFIG_CFB_CONSOLE=y ...@@ -67,4 +67,6 @@ CONFIG_CFB_CONSOLE=y
CONFIG_CFB_CONSOLE_ANSI=y CONFIG_CFB_CONSOLE_ANSI=y
# CONFIG_VGA_AS_SINGLE_DEVICE is not set # CONFIG_VGA_AS_SINGLE_DEVICE is not set
CONFIG_SPLASH_SCREEN=y CONFIG_SPLASH_SCREEN=y
CONFIG_WATCHDOG_TIMEOUT_MSECS=31000
CONFIG_WDT=y
# CONFIG_GZIP is not set # CONFIG_GZIP is not set
...@@ -85,9 +85,6 @@ ...@@ -85,9 +85,6 @@
#define CONFIG_SYS_ONENAND_BASE ONENAND_MAP #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
/* Watchdog support */
#define CONFIG_HW_WATCHDOG
/* /*
* Framebuffer * Framebuffer
*/ */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment