Watchdog type is found on e.g. Pearl/Jade Gecko, often
more than 1 is present.
Driver supports timeout and (minimum) window configuration
and reset or timeout interrupt support for now.
Signed-off-by: Oane Kingma <o.kingma@interay.com>
The build infrastructure should not be adding the drivers subdirectory
to the include path. Fix the legacy uses that depended on that
addition.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The build infrastructure should not be adding the drivers subdirectory
to the include path. Fix the legacy uses that depended on that
addition.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Refactors the mcux wdog driver to use generated device tree macros
directly. Removes now unused dts fixup macros from kinetis socs.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
A directive to compile the system call handlers for the
watchdog subsystem was omitted from CMakeLists.txt, causing
the handlers not to be compiled and some issues in the C
file undetected.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit consolidates the meaning of WDT_DISABLE_AT_BOOT option as
"disabling watchdog at Zephyr system startup for the SoCs that enable
the watchdog by default after reset", and makes this default to y in
order to prevent unintentional processor reset by the watchdog when
not explicitly configured and fed by the application.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
wdt_install_timeout() was skipped as it installs an ISR-context
callback handler function. The rest are simple wrappers.
Added myself as the maintainer of the syscall handlers. WDT
subsystem appears to not currently have an owner.
Fixes: #21432
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
When using the EWIF it is a good idea to clear it before enabling the
watchdog. Otherwise, the watchdog callback will be called upon watchdog
enable if EWIF is enabled. This patch fixes this case.
Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
Update the driver to support multiple watchdog instances
and add the corresponding Kconfig options.
Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The watchdog peripheral on SAME5x/SAMD5x MCUs is very simmilar
to the one found on the SAMD2x parts with only a few register
names changed.
Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Now that all watchdog drivers support DTS we can move setting of
HAS_DTS_WDT to the global watchdog symbol instead of per driver.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Replace CONFIG_WDT_0_NAME with DT_ALIAS_WATCHDOG_0_LABEL in samples and
test code. Now that all drivers are DT aware we don't ever set the
Kconfig option.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Move from CONFIG_WDT_0_NAME to DT_INST_0_NXP_KINETIS_WDOG_LABEL as the
way we get the name. Doing this so we can remove CONFIG_WDT_0_NAME
usage.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert driver to use DT_INST_0_ARM_CMSDK_WATCHDOG_LABEL instead of
CONFIG_WDT_0_NAME. This requires we introduce a "label" property in all
the related dts files. Also introduce a standard watchdog alias
('watchdog0') that can be utilized by sample/test code in the future.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Use this short header style in all Kconfig files:
# <description>
# <copyright>
# <license>
...
Also change all <description>s from
# Kconfig[.extension] - Foo-related options
to just
# Foo-related options
It's clear enough that it's about Kconfig.
The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)
git ls-files '*Kconfig*' | \
xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
- Add WDT(0,1) to esp32.dtsi
- Extend the module to be able to use WDT(0,1)
- Some minor refactoring due to usage of device tree
Tests:
- samples/drivers/watchdog
- tests/drivers/watchdog/wdt_basic_api
Note:
- timer module interrupt registers shall be removed when
timer driver implemented.
Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
Defining a symbol with 'menuconfig' just tells the menuconfig to display
any dependent symbols that immediately follow it in a separate menu.
'menuconfig' has no effect on symbol values.
Making a symbol that doesn't have any dependent symbols after it a
'menuconfig' should be avoided, because then you end up with an empty
menu, which is shown as e.g.
[*] Enable foo ---
This is how it would be shown if there were children but they all
happened to be invisible as well.
With a regular 'config', it turns into
[*] Enable foo
Change all pointless 'menuconfig's to 'config's.
See the section on 'menuconfig' on the Kconfig - Tips and Best Practices
page as well.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
iwdg_stm32_install_timeout expects a timeout passed in
milli seconds. As the timeout is defined in micro
seconds in Kconfig.stm32, we need to divide by
USEC_PER_MSEC when CONFIG_IWDG_START_AT_BOOT is
activated because iwdg_stm32_install_timeout makes
the multiplication by USEC_PER_MSEC.
Fixes#18695
Signed-off-by: Philémon Jaermann <p.jaermann@gmail.com>
Such watchdog timer is found on mec1501.
It comes with a support of dbg stall feature and interrupt support.
It does not support multistaging.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The wdog_cmsdk_apb driver used system clock frequency
as a base for timeout calculation. This commit corrects
that by obtaining the needed value from DTS.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
move misc/reboot.h to power/reboot.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move clock_control.h to drivers/clock_control.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move watchdog.h to drivers/watchdog.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move power.h to power/power.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move internal and architecture specific headers from include/drivers to
subfolder for interrupt_controller:
include/drivers/interrupt_controller/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The defines should have had a _0 on them, now that we generate the
proper defines, fixup the cases that used that old scheme.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Found a few annoying typos and figured I better run script and
fix anything it can find, here are the results...
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
- Even one-liner statement if () need { }
- you can coalesce assignment and condition if the later tests the
earlier only.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Basically, all driver file names should start with the driver type as
prefix: wdt_ in case of watchdogs here, and not something custom like
wdog_.
For clarity, wdog_ prefix could be changed to wdt_ in the source code
also but that's a detail and will not be addressed here.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Basically, all driver file names should start with the driver type as
prefix: wdt_ in case of watchdogs here.
Maybe 'iwdg' keyword could be removed entirely, and also in function
names. However that is not the scope of this patch.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The upper limit of the timeout should not be 0.
tests/drivers/watchdog/wdt_basic_api checks for this and fails as the
driver currently only checks that the timout does not exceed the upper
bound.
This also makes it check the lower bound, so that the test passes.
Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Rename reserved function names in drivers/ subdirectory. Update
function macros concatenatenating function names with '##'. As
there is a conflict between the existing gpio_sch_manage_callback()
and _gpio_sch_manage_callback() names, leave the latter unmodified.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
CONFIG_WDT_SAM_DISABLE_AT_BOOT was removed in commit 2e01e86bdc
("drivers: watchdog: wdt_sam: use the generic disable option"), but some
comments still talked about it. Replace it with
CONFIG_WDT_DISABLE_AT_BOOT.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The existing device_set_power_state() API works only in synchronous
mode and this is not desirable for devices(ex: Gyro) which take
longer time (few 100 mSec) to suspend/resume.
To support async mode, a new callback argument is added to the API.
The device drivers can asynchronously suspend/resume and call the
callback function upon completion of the async request.
This commit adds the missing callback parameter to all the drivers
to make it compliant with the new API.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Use the generic option WDT_DISABLE_AT_BOOT instead of the SAM specific
one WDT_SAM_DISABLE_AT_BOOT (note the generic one has been introduced
after the SAM one).
This also have the consequence of changing the default value for yes to
no, fixing the watchdog tests.
Fixes#13290
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
According to the Coverity issue 188890 (github issue #10705)
Fix for overflowed or truncated value count-1U used as return value.
I decided to use a saturating subtract to avoid a vulnerability.
It will always return 0 or bigger value according to the conditions.
Now if count value is 0, function will return 0, not -1 as before.
Signed-off-by: Maksim Masalski <maxxliferobot@gmail.com>