Commit graph

425 commits

Author SHA1 Message Date
Fin Maaß
f775ab4975 drivers: watchdog: litex: add litex watchdog
this adds a driver for the litex watchdog.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-08-19 10:02:01 -04:00
Neil Chen
fd7139e9da drivers: watchdog/usb: Update CONFIG_SOC_SERIES_MCXNX4X name
Change CONFIG_SOC_SERIES_MCXNX4X name to CONFIG_SOC_SERIES_MCXNX

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-08-15 10:15:12 +01:00
Furkan Akkiz
a6ae4f9221 drivers: watchdog: Add watchdog driver for MAX32xxx MCUs
Added watchdog driver for MAX32xxx MCUs

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
Co-authored-by: Mert Vatansever <Mert.Vatansever@analog.com>
Co-authored-by: Sadik Ozer <sadik.ozer@analog.com>
2024-08-11 19:18:56 -05:00
Manuel Argüelles
b8928dfc3f drivers: watchdog: convert NXP SWT to native driver
Convert NXP SWT watchdog driver to a native driver and extend the
SWT supported functionalities and configuration options.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-08-03 05:58:46 -05:00
Pieter De Gendt
ad63ca284e kconfig: replace known integer constants with variables
Make the intent of the value clear and avoid invalid ranges with typos.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-27 20:49:15 +03:00
Jordan Yates
063d2ff6ec watchdog: cmsdk_apb: only support a single channel
The CMSDK watchdog hardware only supports a single timeout channel.
Return the documented error if more than one timeout is requested to be
installed.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-10 14:39:36 +02:00
Jordan Yates
9138763430 watchdog: cmsdk_apb: validate timeout window
Validate the maximum timeout window, as required by the API tests.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-10 14:39:36 +02:00
Jordan Yates
74f3b587fc watchdog: cmsdk_apb: fix period calculation
The previous calculation was multiplying the timeout in milliseconds
by the clock frequency, giving a cycle count 1000x larger than it should
be.

Fix the calculation and rename `reload_s` to `reload_cycles`, as the
cycle count is what this actually contains.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-10 14:39:36 +02:00
Kevin Wang
6cb8956a08 drivers: watchdog: Refine the atcwdt200 driver's code.
Remove the reset vector setting from driver layer,
the reset vector is more suitable to be set at the board layer.

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
2024-07-09 17:21:28 -04:00
Jordan Yates
0010dec4f0 watchdog: wdt_nrfx: don't zero init static
Don't zero initialise the static data structure, as statics are
explicitly initialised to 0 per the C standard, and checkpatch normally
complains about the pattern.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-08 09:25:24 +02:00
Jordan Yates
23afa2124f watchdog: wdt_nrfx: install return error if enabled
Return the documented error if `wdt_install_timeout` is called after
`wdt_setup`, instead of triggering the state assertion inside of
`nrfx_wdt_channel_alloc`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-08 09:25:24 +02:00
Jordan Yates
7fe440121f watchdog: wdt_nrfx: feed return error when not enabled
Return an error code if `wdt_feed` is called before `wdt_setup`, instead
of triggering the state assertion inside of `nrfx_wdt_channel_feed`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-08 09:25:24 +02:00
Raffael Rostagno
909f7922d6 drivers: watchdog: Added support to C6
Added support to watchdog timer to ESP32C6

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-06-14 18:51:46 -04:00
Francois Ramu
24ff13e92c drivers: watchdog: stm32 wdg driver support stm32H7RS serie
Add the stm32h7rs serie to the stm32 WDG driver

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-14 11:13:54 +02:00
Daniel Leung
db9d3134c5 kernel: mm: rename Z_MEM_PHYS/VIRT_ADDR to K_MEM_*
This is part of a series to move memory management functions
away from the z_ namespace and into its own namespace. Also
make documentation available via doxygen.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-06-12 21:13:26 -04:00
Lucas Tamborrino
aa692309bf drivers: wdt: espressif: Add 32K Xtal Watchdog
This WDT is responsible for monitoring the external
32.728 Hz crystal connected to pins XTAL_32K_P and
XTAL_32K_N. If an oscillation failure is detected
the hardware automatically switch to RTC_RC_SLOW
clock source and triggers an interrupt.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-05-30 16:52:37 -05:00
Yong Cong Sin
bbe5e1e6eb build: namespace the generated headers with zephyr/
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Andrzej Głąbek
7abb9d7593 drivers: watchdog: Allow WDT_DISABLE_AT_BOOT only when supported
Introduce a hidden Kconfig option named HAS_WDT_DISABLE_AT_BOOT and
allow users to enable WDT_DISABLE_AT_BOOT only when that hidden option
is selected by a watchdog driver, i.e. disabling at boot is supported.
Select this new hidden option for all existing watchdog drivers that
refer to WDT_DISABLE_AT_BOOT.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-05-27 08:40:16 -07:00
Jun Lin
c864024c32 driver: watchdog: npcx: support longer watchdog timeout
In the current driver, the longest time of the watchdog timeout is ~8
seconds because the pre-scalar is fixed at 32 (WDCP=5). This commit
removes this limitation by dynamically calculating the pre-scalar
according to the watchdog timeout setting from the API.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2024-05-21 11:15:04 +01:00
Hao Luo
35aae8b5c1 drivers: watchdog: Add support for Apollo3 SoCs watchdog
This commit adds support for the watchdog which
can be found in Apollo3 SoCs

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-05-20 20:50:26 -04:00
Sebastian Głąb
319a8867ef drivers: watchdog: wdt_nrfx.c: Unistall timeouts in wdt_disable()
According to API description, wdt_disable() shall
automatically uninstall all timeouts.
https://docs.zephyrproject.org/latest/hardware/peripherals/watchdog.html

Implement missing wdt_disable() functionality:
- disable WDT RR channels;
- remove callback from timeout channels;
- set data->m_allocated_channels to zero.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-05-15 15:34:38 +01:00
Sebastian Głąb
2f17c46fb1 drivers: wdt: nrf: Add WDT instances that exist in nrf54h20
Add WDT instances no. 010, 011, 131, 132.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-05-09 15:44:40 +02:00
Francois Ramu
f9d04d0958 drivers: watchdog stm32 independent wdg when enable at boot
When the CONFIG_WDT_DISABLE_AT_BOOT is not set, the iwdg
should be configured by iwdg_stm32_install_timeout
and started by iwdg_stm32_setup

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-04-30 14:31:43 -04:00
Emilio Benavente
dbd1da973b dts: arm: nxp: nxp_mcxn94x: Added watchdog node
Added the dts node for the
wdt watchdog and updated the
clock frequency.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-04-04 23:58:01 +03:00
Steven Chang
e44c0987b9 driver: watchdog: prevent floating point usage
Prevent the use of floating point operations

Signed-off-by: Steven Chang <steven@ene.com.tw>
2024-04-03 21:12:17 +01:00
Declan Snyder
e336c644be drivers: wdt_mcux_wwdt: Support RW
Support RW soc series in wwdt driver

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-03-20 16:19:12 +00:00
Sebastian Głąb
7ffafd9b64 drivers: watchdog: wdt_nrfx.c: Fix error code value
Align driver implementation to the watchdog driver API.
https://docs.zephyrproject.org/latest/hardware/peripherals/watchdog.html

int wdt_disable(const struct device *dev)
shall return:
    0 – If successful.
    -EFAULT – If watchdog instance is not enabled.
    -EPERM – If watchdog can not be disabled directly by application code.
    -errno – In case of any other failure.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-03-19 18:00:24 -05:00
YunZe Li
8c19142278 drivers: watchdog: fix wdt_counter_setup option checking condition
The expression (options & WDT_OPT_PAUSE_IN_SLEEP) is duplicated. Fix it
by replacing the second one with (options &WDT_OPT_PAUSE_HALTED_BY_DBG).

Signed-off-by: YunZe Li <yzli.cs@realtek.com>
2024-03-15 13:06:51 +01:00
Steven Chang
5c354ca055 drivers: watchdog: initial device driver for ENE KB1200
Add watchdog driver for ENE KB1200

Signed-off-by: Steven Chang <steven@ene.com.tw>
2024-03-15 09:39:48 +00:00
Sebastian Głąb
3c2b68eb61 drivers: watchdog: wdt_nrfx.c Fix channel id check in wdt_feed()
A Bug in the watchdog driver code allows an unconfigured
WDT timer channel to be feed.

The first configured WDT timer channel has an id of zero.
At this point, data->m_allocated_channels is equal to one.
The condition of the if statement is invalid and allows
channel one to be feed.

Change the test condition from greater to greater-or-equal.
Add check if channel id is less than zero.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-03-14 11:02:19 -05:00
cyliang tw
7cb3f47ae9 drivers: watchdog: support Nuvoton numaker WWDT
Add Nuvoton numaker series window watchdog feature.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2024-03-03 18:58:46 +01:00
cyliang tw
37696829a9 drivers: watchdog: andes atcwdt200 remove soc.h
soc\riscv\andes_v5\ae350\soc.h was empty and deleted,so revise
 wdt_andes_atcwdt200.c to resolve
 'fatal error: soc.h: No such file or directory'.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2024-01-26 12:36:16 +01:00
Jakub Zymelka
ade49f081d modules: hal_nordic: nrfx: update API version to 3.2.0
Updated API version enables multi-instance GPIOTE driver.
Additionally obsolete symbol that was used to specify
API version in the past was removed.
Affected drivers have been adjusted and appropriate changes
in affected files have been made.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-01-08 11:19:37 +01:00
Andrei-Edward Popa
5f927cfc3b drivers: watchdog: Changed how to get xtal frequency for Raspberry Pi Pico
Changed how to get xtal frequency for Raspberry Pi Pico

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
Adrian Bonislawski
53df6efeb6 watchdog: intel_adsp: fix num cpus
This will allow to init watchdog on HW's supporting different
number of cpus and watchdogs based on runtime arch_num_cpus

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2023-11-29 11:42:15 -05:00
Adam Wojasinski
e654cb65b8 drivers: watchdog: wdt_nrfx: Add support for new instances
Add support for WDT30, WDT31, and WDT130

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-11-29 13:12:42 +01:00
Balsundar Ponnusamy
ffffab6ba6 drivers: watchdog: wdt_dw: resetting CPU or SoC is not configurable
specific to platform, watchdog reset line can be connected either to
CPU, SOC or none of the entity. These resets cannot be configured from the
application. So added a warning message when application configures this
option

Signed-off-by: Balsundar Ponnusamy <balsundar.ponnusamy@intel.com>
2023-11-27 20:00:29 +01:00
Balsundar Ponnusamy
f0330892b6 drivers: watchdog: wdt_dw: add watchdog disable at boot and pause by debug
added support for watchdog enable/disable at boot

Pausing watchdog timer when CPU is halted by the debugger and
pausing watchdog timer when CPU is in sleep state is not
configurable through application, so added warning log with return success

Signed-off-by: Balsundar Ponnusamy <balsundar.ponnusamy@intel.com>
2023-11-27 20:00:29 +01:00
Balsundar Ponnusamy
ba3a71eda7 drivers: watchdog: wdt_dw: support for resetting watchdog
add support for resetting watchdog IP through reset manager driver

Signed-off-by: Balsundar Ponnusamy <balsundar.ponnusamy@intel.com>
2023-11-27 20:00:29 +01:00
Balsundar Ponnusamy
63b666ac0a drivers: watchdog: wdt_dw: get clock rate from clock manager
added support for getting clock rate at runtime from clock manager

Signed-off-by: Balsundar Ponnusamy <balsundar.ponnusamy@intel.com>
2023-11-27 20:00:29 +01:00
Balsundar Ponnusamy
a89768cec4 drivers: watchdog: wdt_dw: bug fix and modify conditional macro check
clearing interrupt flag will not assert the system reset as per IP spec,
so interrupt flag should not be cleared in isr

use #if macro check directly with DT_ANY_INST_HAS_PROP_STATUS_OKAY for
interrupt

Signed-off-by: Balsundar Ponnusamy <balsundar.ponnusamy@intel.com>
2023-11-27 20:00:29 +01:00
Balsundar Ponnusamy
e971363648 drivers: watchdog: wdt_dw: use mmio address in RAM
mmu enabled platform needs mapping of physical address ranges to
the virtual address at runtime. So using DEVICE_MMIO_* helper macros to
map physical csr address space to RAM runtime if MMU is enabled

Signed-off-by: Balsundar Ponnusamy <balsundar.ponnusamy@intel.com>
2023-11-27 20:00:29 +01:00
Henrik Brix Andersen
c0c8952739 shell: do not enable subsystem/driver shell modules by default
Do not enable subsystem/driver shell modules by default and stop abusing
CONFIG_SHELL_MINIMAL, which is internal to the shell subsystem, to decide
when to enable a driver shell.

The list of shell modules has grown considerably through the
years. Enabling CONFIG_SHELL for doing e.g. an interactive debug session
leads to a large number of shell modules also being enabled unless
explicitly disabled, which again leads to non-negligible increases in
RAM/ROM usage.

This commit attempts to establish a policy of subsystem/driver shell
modules being disabled by default, requiring the user/application to
explicitly enable only those needed.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-11-20 09:21:40 +01:00
Adam Wojasinski
599bcb1e5d drivers: watchdog: wdt_nrfx: Implement disable API
nRF5340 SoC has `TASK_STOP` this patch implements disabling
watchdog for that SoC and enables allowing WDT to STOP in WDT setup.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-11-17 10:00:53 +01:00
Adam Wojasinski
968916572c drivers: watchdog: wdt_nrfx: Remove config field from config structure
The field config of `nrfx_wdt_config_t` type is redundant in device
config structure. Instead of that local variable is used in the setup
function.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-11-17 10:00:53 +01:00
Henrik Brix Andersen
256adeebd9 Revert "drivers: watchdog: wdt_nrfx: Implement disable API"
This reverts commit 415b6fc945.

This does not even compile as it attempts to do assignment to a read-only
object (config->config.behaviour).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-11-16 19:09:49 +01:00
Adam Wojasinski
415b6fc945 drivers: watchdog: wdt_nrfx: Implement disable API
nRF5340 SoC has `TASK_STOP` this patch implements disabling
watchdog for that SoC.

Changed body of `wdt_nrf_setup()` to utilize `nrfx_wdt_reconfigure()`
driver API.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-11-16 09:27:03 +01:00
Manuel Argüelles
6744d6084d watchdog: nxp_s32: use instance-based DT macros
At present, many of the NXP S32 shim drivers do not make use of
devicetree instance-based macros because the NXP S32 HAL relies on an
index-based approach, requiring knowledge of the peripheral instance
index during both compilation and runtime, and this index might not
align with the devicetree instance index.

The proposed solution in this patch eliminates this limitation by
determining the peripheral instance index during compilation
through macrobatics and defining the driver's ISR within the shim
driver itself.

Note that for some peripheral instances is needed to redefine the
HAL macros of the peripheral base address, since the naming is not
uniform for all instances.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-09 10:20:27 +00:00
Alberto Escolar Piedras
8b456ea2a1 treewide: Replace all uses of CONCAT with _CONCAT
One of the ARM architure files, defined since long ago
CONCAT having the exact same purpose as Zephyr's _CONCAT.
Unfortunately this header is included almost always
and the macro defined in all ARM based platforms,
which seems to have lead to many uses of this macro
instead of _CONCAT.

Fix it by using _CONCAT instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-07 11:55:51 +01:00
Anas Nashif
a08bfeb49c syscall: rename Z_OOPS -> K_OOPS
Rename internal API to not use z_/Z_.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00