blob: 3ffd83e9a862ec063f895afdadd073d1700974f1 [file] [log] [blame]
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001From 33d8f45c8f14e9e0d7add7d2804ed76c7d7fd0c2 Mon Sep 17 00:00:00 2001
2From: Emekcan Aras <emekcan.aras@arm.com>
3Date: Sat, 25 Feb 2023 09:04:38 +0000
4Subject: [PATCH 1/7] Platform: corstone1000: Add watchdog_reset_timer
5
6From: Mohamed Omar Asaker <mohamed.omarasaker@arm.com>
7
8Implement watchdog_reset_timer
9
10Upstream-Status: Submitted [https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/20552]
11Signed-off-by: Mohamed Omar Asaker <mohamed.omarasaker@arm.com>
12Change-Id: I2684ca54f9a456b22efcbcd364abef3537d4c91f
13---
14 .../arm/corstone1000/Native_Driver/watchdog.c | 17 +++++++++++++++++
15 1 file changed, 17 insertions(+)
16
17diff --git a/platform/ext/target/arm/corstone1000/Native_Driver/watchdog.c b/platform/ext/target/arm/corstone1000/Native_Driver/watchdog.c
18index 4e024a3b1..f6e182194 100644
19--- a/platform/ext/target/arm/corstone1000/Native_Driver/watchdog.c
20+++ b/platform/ext/target/arm/corstone1000/Native_Driver/watchdog.c
21@@ -80,6 +80,23 @@ int corstone1000_watchdog_init()
22 return ARM_DRIVER_OK;
23 }
24
25+/**
26+ * \brief Reset the Secure Enclave & SoC Watchdog's.
27+ *
28+ * \returns ARM Driver return code.
29+ */
30+int corstone1000_watchdog_reset_timer() {
31+ /* Unlock, clear and lock the watchdog timer */
32+ arm_watchdog_unlock(&SE_WD_DEV);
33+ arm_watchdog_clear_interrupt_and_refresh_counter(&SE_WD_DEV);
34+ arm_watchdog_lock(&SE_WD_DEV);
35+ /* Unlock, clear and lock the watchdog timer */
36+ arm_watchdog_unlock(&SOC_WD_DEV);
37+ arm_watchdog_clear_interrupt_and_refresh_counter(&SOC_WD_DEV);
38+ arm_watchdog_lock(&SOC_WD_DEV);
39+ return ARM_DRIVER_OK;
40+}
41+
42 /*
43 * Secure Host Watchdog WS1 Handler
44 * efi_reset_system from the host triggers "Secure
45--
462.17.1
47