]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
watchdog: versal: Add support for expire now
authorAshok Reddy Soma <ashok.reddy.soma@xilinx.com>
Tue, 28 Sep 2021 06:01:59 +0000 (11:31 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 30 Sep 2021 10:30:38 +0000 (12:30 +0200)
Wdt expire command makes the wdt to count least possible ticks(1)
and expires immediately. Add expire_now option to the xlnx_wwdt_ops
and implement it by calling xlnx_wwdt_start() with minimum possible
count(1).

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1632808919-8600-3-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/watchdog/xilinx_wwdt.c

index d8b2ae72483b5d25873673c06f4c33db6b4ff4d6..d582e3cc8f41fd41e3b95550b249cba2480e2f0b 100644 (file)
@@ -144,6 +144,11 @@ static int xlnx_wwdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
        return 0;
 }
 
+static int xlnx_wwdt_expire_now(struct udevice *dev, ulong flags)
+{
+       return xlnx_wwdt_start(dev, XWT_WWDT_CNT_MIN, flags);
+}
+
 static int xlnx_wwdt_probe(struct udevice *dev)
 {
        int ret;
@@ -182,6 +187,7 @@ static const struct wdt_ops xlnx_wwdt_ops = {
        .start = xlnx_wwdt_start,
        .reset = xlnx_wwdt_reset,
        .stop = xlnx_wwdt_stop,
+       .expire_now = xlnx_wwdt_expire_now,
 };
 
 static const struct udevice_id xlnx_wwdt_ids[] = {