Current ESP32 clock system is mixed with RTC labeling/registers,
but it doesn't implement a real-time clock (RTC) driver.
To avoid confusion and allow adding a proper RTC driver later,
this commit renames the existing RTC interface to CLOCK and make
it as a subsystem without any peripheral attached to it.
This better reflects its actual purpose as a general clock controller.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Enables sleep mode (PM3) on RW61x. The driver
re-enables the wdt on wake-up based on the previous
configuration. Note that the wdt counter value always
resets to the max window value on wake-up
Signed-off-by: Alex Rodriguez <alejandro.rodriguezlimon@nxp.com>
This commit changes clock property of watchdog to optional and updates
driver according to this change.
Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
Drivers update to use shared interrupt allocator for Xtensa
and RISCV devices.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add support for the STM32WB0 series to the existing STM32 driver for
Independent Watchdog peripheral.
NOTE: this commit only includes basic support for the watchdog.
STM32WB0 specificities such as the different possible clock sources, LSI
frequency measurement or window support are left for future implementation.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Reset the watchdog back to the initial state before enabling the
expiry interrupt. This prevents the watchdog expiring immediately if
there is a long gap between `wdt_install_timeout` and `wdt_setup`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
default watchdog initialization disable counting in EM1, EM2 and EM3
modes. If user use the WDT_OPT_PAUSE_IN_SLEEP flag via the watchdog api,
all 3 EM modes must take this flag into account to avoid wdt count
being frozen if we don't want to.
Signed-off-by: Adrien MARTIN <adrienmar@kickmaker.net>
The correct procedure to reload the T0 timer is:
1. Load TWDT0 register with the new value or write 1 to RST bit in
T0CSR register to load the old value.
2. Wait until RST bit in T0CSR register becomes 1.
3. Wait until RST bit in T0CSR register becomes 0.
The current watchdog driver misses step 2.
Fix the issue in this commit.
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Introduce sam4l watchdog configuration. This entry is necessary to
select proper watchdog configuration at board init due to #83429.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
In order to ensure that watchdog channels are freed in proper
driver state, synchronization in form of simple loop needs
to be added after stopping. In no irq variant, it is already done
on nrfx level. NRFY function can be replaced by NRFX one in
the future.
Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
Move the instance pointer, which is a constant value, into a dedicated
config structure. At the same time, remove the type casting macros as
this pattern has been removed from the tree for some years now.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The STM32 IWDG is a single channel watchdog, and therefore should be
returning `-ENOMEM` when a user attempt to install additional timeouts,
instead of overwriting previous values.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Add a non-configurable option which drivers can select to indicate that
they do not support callbacks on watchdog expiry.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The watchdog register configuration of RP2350 differs from that
of RP2040, so we make fit that.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Use shell_device_get_binding() instead of device_get_binding() so that
we get the device based on its name and in addition by its label.
Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
Add watchdog driver for npm2100 pmic.
This pmic has one timer that can be used for multiple functions,
including a watchdog that can reset or power-cycle connected devices.
Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
Rename "nxp,kinetis-wdog32" compatible to "nxp,wdog32" to remove the
device family from its name.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Enable the early WakeUp Interrupt at init, once the WWDG instance
is correclty cloked. Else deadlock can occur.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
allows use of touch_sensor, rtc_counter, and wdt simultaneously by enabling
ESP_INTR_FLAG_SHARED when calling esp_intr_alloc()
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Cast variable to uint64_t to ensure the multiplication is
performed using 64-bit arithmetic. Resolves static code
analysis warning from Coverity.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Remove all entries that as not being used.
This also update hal to re-enable warning flags
as such as -Wno-unused-variable.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Move some STM32 drivers related Kconfig symbols from `config`
to `menuconfig` when driver options depends on these symbols.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Add checks to return value of esp_intr_alloc to avoid drivers init
returning 0 when interrupt allocation fails.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>