Commit graph

355 commits

Author SHA1 Message Date
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
Anas Nashif 1a9de05767 syscall: rename Z_SYSCALL_DRIVER_ -> K_SYSCALL_DRIVER_
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
Anas Nashif 4e396174ce kernel: move syscall_handler.h to internal include directory
Move the syscall_handler.h header, used internally only to a dedicated
internal folder that should not be used outside of Zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Benedikt Schmidt a03f1010b8 drivers: fix thread function signatures
Fix thread function signatures to avoid stack corruption on thread exit.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-10-30 12:24:34 +01:00
Andriy Gelman d0961756a6 drivers: watchdog: Add xmc4xxx support
Adds watchdog support for Infineon xmc4xxx MCUs.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-10-27 12:58:07 -05:00
Bartosz Bilas 66f5fce68f drivers: mfd: gpio: adjust init priority
Take into account the SPI bus init priorirty
that can be used for MFD drivers.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2023-10-26 09:50:31 +02:00
Manuel Argüelles ca3310145f drivers: select nocache only when supported
NOCACHE_MEMORY depends on ARCH_HAS_NOCACHE_MEMORY_SUPPORT, so
don't try to select the symbol if not supported.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-26 15:09:51 +02:00
Andrei Emeltchenko 11f0e59d19 drivers: wdt_tco: Use DT_DRV_COMPAT interface
DT_DRV_COMPAT was unused for this driver. To get a node identifier
DT_NODELABEL() macro was used. Refactor to use the correct interfaces
using instance number 0.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-09-25 16:41:42 +02:00
Manuel Argüelles be08ce18d0 wdt: nxp_s32: use clock control APIs
Use clock control API to retrieve the module's frequency and
update the boards using it to provide the source clocks.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-22 09:24:32 +02:00
Huifeng Zhang 2c22e83dfb include: arch: arm: Remove aarch32 directory
This commit follows the parent commit work.

This commit introduces the following major changes.

  1. Move all directories and files in 'include/zephyr/arch/arm/aarch32'
    to the 'include/zephyr/arch/arm' directory.

  2. Change the path string which is influenced by the changement 1.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-09-13 10:08:05 +01:00
Declan Snyder dbbdd3c6cf drivers: wdt_mcux_wwdt: Fix warning callback
Warning callback by default is configured to happen
at the same time as reset, which results in unexpected
behavior from the point of view of Zephyr API. Return
-ENOTSUP from install_timeout if trying to set up
callback with 0 warning time, and add kconfig to configure
the warning time.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-09-13 09:16:33 +02:00
Benjamin Lemouzy a7135a6c3a drivers: watchdog: wdt_mcux_imx_wdog: add pinctrl support
i.MX RT SoC have some pins related to the watchdog.
For example, iomuxc_gpio_ad_b0_15_wdog1_rst_b_deb allows WDOG1_RST_B_DEB
signal to be used as reset source for i.MX RT10xx boards.

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
2023-08-31 20:19:33 +02:00
Fabio Baltieri 529798a1b2 drivers: watchdog: atcwdt200: fix shadow variable build error
Fix a shadow variable build error:

wdt_andes_atcwdt200.c:112:49: warning: declaration of 'counter_dev'
shadows a global declaration [-Wshadow]
  112 | static void wdt_counter_cb(const struct device *counter_dev,
      uint8_t chan_id, |
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ wdt_andes_atcwdt200.c:95:35: note:
shadowed declaration is here
   95 | static const struct device *const counter_dev = |
      ^~~~~~~~~~~

Make the outer variable more specific rather than the local one.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-28 16:00:00 +02:00
Fabio Baltieri 420d9563a4 drivers: watchdog_shell: fix compiler error
Fix wdt_shell.c:54:13: error: implicit declaration of function 'strtoul'

Tested with west build -p -b nrf52dk_nrf52832 samples/drivers/watchdog
-DCONFIG_SHELL=y.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-22 10:49:05 +01:00
Benjamin Lemouzy d4e33c5708 drivers: watchdog: add WDT shell commands
Add shell commands to setup, disable, install timeout and feed a
watchdog device.
These commands reflect watchdog API.

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
2023-08-21 15:01:30 -05:00
Ritwika Dey 739788143f driver: watchdog: wdt_ifx_cat1: masking added
Masking is added so that WDT is not invoked multiple times

Signed-off-by: Ritwika Dey <Ritwika.Dey@infineon.com>
2023-08-16 20:42:45 +02:00
Mateusz Sierszulski 171285140c drivers: watchdog: Add Ambiq wdt driver
This commits add watchdog driver for Apollo4 SoCs

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2023-08-16 13:03:33 +02:00
Manuel Arguelles 3d36af15fa drivers: watchdog: support NXP FS26 watchdog
Introduce support for NXP FS26 SBC watchdog. Both Challenger and
Simple watchdog types are supported. Only watchdog functionalities of
the device are supported and any other monitoring feature is either not
supported or disabled.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-08-01 09:51:16 +02:00
Marek Matej 6b57b3b786 soc: xtensa,riscv: esp32xx: refactor folder structure
Refactor the ESP32 target SOCs together with
all related boards. Most braking changes includes:

- changing the CONFIG_SOC_ESP32* to refer to
  the actual soc line (esp32,esp32s2,esp32s3,esp32c3)
- replacing CONFIG_SOC with the CONFIG_SOC_SERIES
- creating CONFIG_SOC_FAMILY_ESP32 to embrace all
  the ESP32 across all used architectures
- introducing CONFIG_SOC_PART_NUMBER_* to
  provide a SOC model config
- introducing the 'common' folder to hide all
  commonly used configs and files.
- updating west.yml to reflect previous changes in hal

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-07-25 18:12:33 +02:00
Andrzej Głąbek 481963489e drivers: wdt_nrfx: Clean up driver instantiation
- use CONFIG_HAS_HW_NRF_* symbols consistently in nRF multi-instance
  drivers when creating particular driver instances
- remove unnecessary hidden Kconfig options that indicated the type of
  peripheral to be used by a given instance (e.g. SPI, SPIM, or SPIS)
  and enabled proper nrfx driver instance; instead, use one option per
  peripheral type and include the corresponding shim driver flavor into
  compilation basing on that option (not the one that enables the nrfx
  driver as it was incorrectly done so far in some cases)

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-07-25 13:41:51 +02:00
Andy Sinclair 910d43805b drivers: watchdog: npm1300: Added watchdog driver
Added watchdog driver for nPM1300

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-07-12 14:36:56 +02:00