Repository navigation
Conversation
dgarske
force-pushed
the
versal_wdt
branch
2 times, most recently
from
October 16, 2026 18:32
779d608 to
94c7157
Compare
dgarske
marked this pull request as ready for review
October 16, 2026 18:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A Versal design that arms a system watchdog from its
.cdoneeds the bootloader to service it and settle it before the OS - U-Boot'swdt_stop_all()role. wolfBoot had no reference to the block.WATCHDOG=1now arms, refreshes and stops the SWDT/WWDT, in window or generic mode.WATCHDOG_BASEpicks the instance (FPD by default),WATCHDOG_TIMEOUT_MSandWATCHDOG_CLK_HZsize the window, andWATCHDOG_HANDOFF=1hands it to the OS still armed instead of stopping it.WATCHDOGis promoted from aCFLAGS_EXTRAdefine to a config variable; the old spelling still works.Three interlocks shape the driver: a refresh or a disable is only honored in the open (second) window and is otherwise a bad event the hardware ignores,
FCR[WDP]blocks clearingWEN, and every window-register write needsMWR[MWC]opened first. So wolfBoot reprograms the timer with no closed window, making its own refreshes always legal, and brings a CDO-armed timer down through the same stop path before reconfiguring it. WithoutWATCHDOGthe block is neither read nor written: a read of a block a PDI left in reset can abort at EL2.wolfBoot_watchdog_feed()was reached only from the hash and flash-update loops, so the disk read, the gzip inflate and the SDHCI PIO block loop now call it too. All compile out withoutWATCHDOG.ZD 20634
Testing
Validated on a VMK180 on the LPD instance, the one this board's PDI releases: armed, refreshed across a signed image load from SD and its hash, stopped before the handoff - confirmed by reading the enable bit back from the application - and handed over armed under
WATCHDOG_HANDOFF=1. A control pair with refreshing disabled reproduces the expiry.0xFD4D0000(FPD) is the default and the same code path with a different base, but this board holds it in reset, so it is not hardware-validated.