Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 1 | From 33d8f45c8f14e9e0d7add7d2804ed76c7d7fd0c2 Mon Sep 17 00:00:00 2001 |
| 2 | From: Emekcan Aras <emekcan.aras@arm.com> |
| 3 | Date: Sat, 25 Feb 2023 09:04:38 +0000 |
| 4 | Subject: [PATCH 1/7] Platform: corstone1000: Add watchdog_reset_timer |
| 5 | |
| 6 | From: Mohamed Omar Asaker <mohamed.omarasaker@arm.com> |
| 7 | |
| 8 | Implement watchdog_reset_timer |
| 9 | |
| 10 | Upstream-Status: Submitted [https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/20552] |
| 11 | Signed-off-by: Mohamed Omar Asaker <mohamed.omarasaker@arm.com> |
| 12 | Change-Id: I2684ca54f9a456b22efcbcd364abef3537d4c91f |
| 13 | --- |
| 14 | .../arm/corstone1000/Native_Driver/watchdog.c | 17 +++++++++++++++++ |
| 15 | 1 file changed, 17 insertions(+) |
| 16 | |
| 17 | diff --git a/platform/ext/target/arm/corstone1000/Native_Driver/watchdog.c b/platform/ext/target/arm/corstone1000/Native_Driver/watchdog.c |
| 18 | index 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 | -- |
| 46 | 2.17.1 |
| 47 | |