plat/arm: introduce wrapper functions to setup secure watchdog
The BL1 stage setup code for ARM platforms sets up the SP805 watchdog
controller as the secure watchdog. But not all ARM platforms use SP805
as the secure watchdog controller.
So introduce two new ARM platform code specific wrapper functions to
start and stop the secure watchdog. These functions then replace the
calls to SP805 driver in common BL1 setup code. All the ARM platforms
implement these wrapper functions by either calling into SP805 driver
or the SBSA watchdog driver.
Change-Id: I1a9a11b124cf3fac2a84f22ca40acd440a441257
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
diff --git a/plat/arm/common/arm_bl1_setup.c b/plat/arm/common/arm_bl1_setup.c
index 1e9edef..8e0c046 100644
--- a/plat/arm/common/arm_bl1_setup.c
+++ b/plat/arm/common/arm_bl1_setup.c
@@ -11,7 +11,6 @@
#include <arch.h>
#include <bl1/bl1.h>
#include <common/bl_common.h>
-#include <drivers/arm/sp805.h>
#include <lib/utils.h>
#include <lib/xlat_tables/xlat_tables_compat.h>
#include <plat/arm/common/plat_arm.h>
@@ -67,7 +66,7 @@
#if !ARM_DISABLE_TRUSTED_WDOG
/* Enable watchdog */
- sp805_start(ARM_SP805_TWDG_BASE, ARM_TWDG_LOAD_VAL);
+ plat_arm_secure_wdt_start();
#endif
/* Initialize the console to provide early debug support */
@@ -172,7 +171,7 @@
{
#if !ARM_DISABLE_TRUSTED_WDOG
/* Disable watchdog before leaving BL1 */
- sp805_stop(ARM_SP805_TWDG_BASE);
+ plat_arm_secure_wdt_stop();
#endif
#ifdef EL3_PAYLOAD_BASE