Skip to content

Commit

Permalink
boot: zephyr: moonlight watchdogs
Browse files Browse the repository at this point in the history
adding WATCHDOG_FEED support for WDT30 and WDT31

Signed-off-by: Mateusz Michalek <[email protected]>
  • Loading branch information
michalek-no authored and nvlsianpu committed Jan 10, 2024
1 parent b994ba2 commit c3a72e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions boot/zephyr/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) 2017-2020 Linaro Limited
# Copyright (c) 2020 Arm Limited
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down Expand Up @@ -665,6 +666,8 @@ config BOOT_WATCHDOG_FEED
imply NRFX_WDT if SOC_FAMILY_NRF
imply NRFX_WDT0 if SOC_FAMILY_NRF
imply NRFX_WDT1 if SOC_FAMILY_NRF
imply NRFX_WDT30 if SOC_FAMILY_NRF
imply NRFX_WDT31 if SOC_FAMILY_NRF
help
Enables implementation of MCUBOOT_WATCHDOG_FEED() macro which is
used to feed watchdog while doing time consuming operations.
Expand Down
16 changes: 14 additions & 2 deletions boot/zephyr/include/mcuboot_config/mcuboot_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,21 @@
#elif defined(CONFIG_NRFX_WDT0)
#define MCUBOOT_WATCHDOG_FEED() \
FEED_WDT_INST(0);
#else /* defined(CONFIG_NRFX_WDT0) && defined(CONFIG_NRFX_WDT1) */
#elif defined(CONFIG_NRFX_WDT30) && defined(CONFIG_NRFX_WDT31)
#define MCUBOOT_WATCHDOG_FEED() \
do { \
FEED_WDT_INST(30); \
FEED_WDT_INST(31); \
} while (0)
#elif defined(CONFIG_NRFX_WDT30)
#define MCUBOOT_WATCHDOG_FEED() \
FEED_WDT_INST(30);
#elif defined(CONFIG_NRFX_WDT31)
#define MCUBOOT_WATCHDOG_FEED() \
FEED_WDT_INST(31);
#else
#error "No NRFX WDT instances enabled"
#endif /* defined(CONFIG_NRFX_WDT0) && defined(CONFIG_NRFX_WDT1) */
#endif

#elif DT_NODE_HAS_STATUS(DT_ALIAS(watchdog0), okay) /* CONFIG_NRFX_WDT */
#include <zephyr/device.h>
Expand Down

0 comments on commit c3a72e9

Please sign in to comment.