Skip to content

Commit b2b1677

Browse files
michalek-node-nordic
authored andcommitted
[nrf fromtree] boot: zephyr: moonlight watchdogs
adding WATCHDOG_FEED support for WDT30 and WDT31 Signed-off-by: Mateusz Michalek <[email protected]> (cherry picked from commit c3a72e9) Signed-off-by: Andrzej Puzdrowski <[email protected]>
1 parent 55a0f64 commit b2b1677

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

boot/zephyr/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) 2017-2020 Linaro Limited
22
# Copyright (c) 2020 Arm Limited
3+
# Copyright (c) 2023 Nordic Semiconductor ASA
34
#
45
# SPDX-License-Identifier: Apache-2.0
56
#
@@ -651,6 +652,8 @@ config BOOT_WATCHDOG_FEED
651652
imply NRFX_WDT if SOC_FAMILY_NRF
652653
imply NRFX_WDT0 if SOC_FAMILY_NRF
653654
imply NRFX_WDT1 if SOC_FAMILY_NRF
655+
imply NRFX_WDT30 if SOC_FAMILY_NRF
656+
imply NRFX_WDT31 if SOC_FAMILY_NRF
654657
help
655658
Enables implementation of MCUBOOT_WATCHDOG_FEED() macro which is
656659
used to feed watchdog while doing time consuming operations.

boot/zephyr/include/mcuboot_config/mcuboot_config.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,21 @@
324324
#elif defined(CONFIG_NRFX_WDT0)
325325
#define MCUBOOT_WATCHDOG_FEED() \
326326
FEED_WDT_INST(0);
327-
#else /* defined(CONFIG_NRFX_WDT0) && defined(CONFIG_NRFX_WDT1) */
327+
#elif defined(CONFIG_NRFX_WDT30) && defined(CONFIG_NRFX_WDT31)
328+
#define MCUBOOT_WATCHDOG_FEED() \
329+
do { \
330+
FEED_WDT_INST(30); \
331+
FEED_WDT_INST(31); \
332+
} while (0)
333+
#elif defined(CONFIG_NRFX_WDT30)
334+
#define MCUBOOT_WATCHDOG_FEED() \
335+
FEED_WDT_INST(30);
336+
#elif defined(CONFIG_NRFX_WDT31)
337+
#define MCUBOOT_WATCHDOG_FEED() \
338+
FEED_WDT_INST(31);
339+
#else
328340
#error "No NRFX WDT instances enabled"
329-
#endif /* defined(CONFIG_NRFX_WDT0) && defined(CONFIG_NRFX_WDT1) */
341+
#endif
330342

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

0 commit comments

Comments
 (0)