-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Conversation
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]>
Hello @Harini-T, and thank you very much for your first pull request to the Zephyr project! |
return ret; | ||
} | ||
|
||
static int wdt_xilinx_wwdt_install_timeout(const struct device *dev, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
zephyr/samples/drivers/watchdog/src/main.c
Lines 136 to 139 in d8edd78
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)); |
There was a problem hiding this comment.
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).
Creating new PR with different branch: #86565 |
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.