aboutsummaryrefslogtreecommitdiff
path: root/platform/ext
diff options
context:
space:
mode:
authorRaymondNgun <raymond.ngun@infineon.com>2021-06-23 16:47:11 -0700
committerDavid Hu <david.hu@arm.com>2021-07-08 09:56:52 +0200
commit60a02b290f8ebf2f85856485f0c185572726519d (patch)
tree5ce8100e217b7c4b5a17d982957a0e926cae7da8 /platform/ext
parent2249b1148585c6b2f5e9992303886f5f9ef3efec (diff)
downloadtrusted-firmware-m-60a02b290f8ebf2f85856485f0c185572726519d.tar.gz
psoc64: Disable watchdog on boot
Bootloader may enable watchdog. The SPE needs to disable WDG on successful boot. Change-Id: If45c2c182c4f9f2741757951d8ef13966a76d0ca Signed-off-by: Raymond Ngun <raymond.ngun@infineon.com>
Diffstat (limited to 'platform/ext')
-rw-r--r--platform/ext/target/cypress/psoc64/spm_hal.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/platform/ext/target/cypress/psoc64/spm_hal.c b/platform/ext/target/cypress/psoc64/spm_hal.c
index d249c88eda..d7f9549bcd 100644
--- a/platform/ext/target/cypress/psoc64/spm_hal.c
+++ b/platform/ext/target/cypress/psoc64/spm_hal.c
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018-2021, Arm Limited. All rights reserved.
- * Copyright (c) 2019-2020, Cypress Semiconductor Corporation. All rights reserved.
+ * Copyright (c) 2019-2021, Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -25,6 +25,7 @@
#include "cy_device.h"
#include "cy_device_headers.h"
#include "cy_ipc_drv.h"
+#include "cy_p64_watchdog.h"
#include "cy_prot.h"
#include "cy_pra.h"
#include "pc_config.h"
@@ -34,6 +35,19 @@
/* Get address of memory regions to configure MPU */
extern const struct memory_region_limits memory_regions;
+static enum tfm_plat_err_t handle_boot_wdt(void)
+{
+ /* Update watchdog timer to mark successfull start up of the image */
+ LOG_MSG("Checking boot watchdog\r\n");
+ if (cy_p64_wdg_is_enabled()) {
+ cy_p64_wdg_stop();
+ cy_p64_wdg_free();
+ LOG_MSG("Disabled boot watchdog\r\n");
+ }
+
+ return TFM_PLAT_ERR_SUCCESS;
+}
+
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
bool privileged,
const struct platform_data_t *platform_data)
@@ -66,6 +80,9 @@ void tfm_spm_hal_boot_ns_cpu(uintptr_t start_addr)
{
smpu_print_config();
+ /* Reset boot watchdog */
+ handle_boot_wdt();
+
if (cy_access_port_control(CY_CM4_AP, CY_AP_EN) == 0) {
/* The delay is required after Access port was enabled for
* debugger/programmer to connect and set TEST BIT */