Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Xilinx Window Watchdog driver #86430

Closed
wants to merge 2 commits into from

Conversation

Harini-T
Copy link

Xilinx Window Watchdog driver uses window watchdog mode.
Window watchdog timer(WWDT) contains closed(first) and open(second) window with 32bit width each. Write to the watchdog timer within predefined window periods of time. This means a period that is not too soon and a period that is not too late. The WWDT has to be restarted within the open window time.
If the software tries to restart WWDT outside of open window time period, it generates a SoC reset.

Harini T added 2 commits February 27, 2025 21:41
Xilinx Window Watchdog Timer IP uses window mode.
Window watchdog timer(WWDT) contains closed(first) and open(second)
window with 32 bit width each. Write to the watchdog timer within
predefined window periods of time. This means a period that is not too
soon and a period that is not too late.

The WWDT error interrupts (IRQs) occur when the watchdog timer is not
serviced within the predefined window periods. These IRQs are routed to
the Processing System Manager (PSM) error accumulator module. The PSM is
responsible for managing power and system-level errors, generating a
System on Chip (SoC) reset when a WWDT error occurs. The system reset
event is signaled as a system error for the PSM firmware to handle and a
reset output signal to the MIO/EMIO.

Signed-off-by: Harini T <[email protected]>
Xilinx Window Watchdog driver uses window watchdog mode. Window watchdog
timer(WWDT) contains closed(first) and open(second) window with 32bit
width each. Write to the watchdog timer within predefined window periods
of time. This means a period that is not too soon and a period that is
not too late. The WWDT has to be restarted within the open window time.
If the software tries to restart WWDT outside of open window time
period, it generates a SoC reset.

Signed-off-by: Harini T <[email protected]>
Copy link

Hello @Harini-T, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

return ret;
}

static int wdt_xilinx_wwdt_install_timeout(const struct device *dev,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, a minor query. I see that there is no callback registered and no interrupt available after timeout. When the closed window time is given some time by the user, how will the user understand that the window is open, so that they can clear the timer.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ghostMan-pac,

I see that there is no callback registered and no interrupt available after timeout.
The WWDT error interrupts (IRQs) occur when the watchdog timer is not serviced within the predefined window periods. These IRQs are routed to the Processing System Manager (PSM) error accumulator module. The PSM is responsible for managing power and system-level errors, generating a System on Chip (SoC) reset when a WWDT error occurs. The system reset event is signaled as a system error for the PSM firmware to handle and a reset output signal to the MIO/EMIO. Refer DT-Bindings.

When the closed window time is given some time by the user, how will the user understand that the window is open, so that they can clear the timer.
In general, the feed operation is independent of whether the window is open or closed. During configuration, the user specifies the closed window value. If the user attempts to ping during the closed window, the driver will produce an error. Once the wdt is in second window, the feed works.

Consider an example in which window.max is set to 10 seconds and window.min is set to 5 seconds. If the user tries to feed/ping every 4 seconds, the first ping will not be allowed by driver as application tries to ping in first window. The next feed after 4 seconds (at 8th second) will be allowed by driver to restart the timer.

Please refer

for (int i = 0; i < WDT_FEED_TRIES; ++i) {
printk("Feeding watchdog...\n");
wdt_feed(wdt, wdt_channel_id);
k_sleep(K_MSEC(WDG_FEED_INTERVAL));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Harini-T for the detailed explanation. I have seen another watchdog peripheral which will reset the board, if pinged within the closed window state. That is why I asked whether there is any option for the peripheral to indicate to the user whether the window is opened or not. It seems your watchdog does not take the drastic measure of resetting the board, if the pinging is early (before window open).

@Harini-T
Copy link
Author

Harini-T commented Mar 3, 2025

Creating new PR with different branch: #86565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants