Commit Graph

317 Commits

Author SHA1 Message Date
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
Mulin Chao 2cf3caa11c driver: wdt: npcx: add WDT_OPT_PAUSE_HALTED_BY_DBG support.
This CL adds WDT_OPT_PAUSE_HALTED_BY_DBG support by enabling freeze mode.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2023-07-07 09:19:50 +02:00
Kevin Wang a9955d3e17 drivers: watchdog: Add Andestech ATCWDT200 driver.
Support the Andes atcwdt200 watchdog driver.

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
2023-06-29 10:13:05 +00:00
Daniel Leung 26ecaba4af drivers: syscalls: use zephyr_syscall_header
This adds a few line use zephyr_syscall_header() to include
headers containing syscall function prototypes.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-06-17 07:57:45 -04:00
Tyler Ng 06ef4f6f66 drivers: watchdog: Add the OpenTitan watchdog driver
The OpenTitan watchdog driver is a watchdog driver that can be configured
with two stages: a watchdog "bark", which generates an interrupt, and a
watchdog "bite", which resets the system. The two-stage watchdog can be
enabled by setting CONFIG_WDT_MULTISTAGE=y. Otherwise, the driver
functions as a single-stage watchdog.

A callback function may be set for the bark interrupt through the
wdt setup interface, but will only be used if the two-stage watchdog is
enabled. It must be configured for the first watchdog stage.

The driver controls only the watchdog portion of the OpenTitan AON timer.

Signed-off-by: Tyler Ng <tkng@rivosinc.com>
2023-05-26 09:45:25 -04:00
Sreeram Tatapudi d9e4f8fa1d drivers: watchdog: Driver for Infineon watchdog
Initial version of the driver for Infineon CAT1 devices

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2023-05-24 19:42:50 -04:00
Gerard Marull-Paretas 9c340776ff drivers: watchdog: npm6001: select MFD and adjust init priority
Make sure MFD driver for nPM6001 gets built, and, that watchdog driver
comes later in the init sequence.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-24 19:39:55 -04:00
Robert Hancock e57bab59ff drivers: watchdog: add Xilinx AXI Timebase WDT driver
Add a driver for the Xilinx AXI Timebase WDT logic core. This can be
instantiated on various Xilinx FPGA-based platforms such as the
Digilent Arty, although it is not part of the default image used with
the Zephyr board configuration.

The driver can also optionally implement the HWINFO API to allow
determining whether the last system reset was initiated by the WDT.
Since this is a standalone IP core which could be used a variety of
configurations, this support is optional in case the system/SoC it is
used with already implements this support.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2023-05-19 16:14:24 +02:00
Mulin Chao 9da9c90639 intc: miwu: npcx: improve interrupt latency of miwu input events
To reduce the interrupt latency of MIWU events, the driver prepares a
dedicated callback function item list for each MIWU group in this PR. We
needn't check the MIWU table and group of the event in ISR. And the
maximum item number of each list is also limited to 8. After applying
this PR, the interrupt latency reduces to ~10us consistently.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2023-05-17 09:48:54 +02:00
Adam Wojasinski aafa4ba18e drivers: watchdog: wdt_nrfx: Align behaviour parameter
New nrfx release replaces `nrf_wdt_behaviour_t` type
to `nrf_wdt_behaviour_mask_t` enumerator. As a result function
setting behaviour accepts `uint32_t` bitmask of behaviour.

This commit aligns symbols used in SHIM to the ones introduced
with the nrfx release.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-05-05 11:47:53 +02:00
Johan Hedberg 02655e5b15 drivers: wdt_tco: Change init level from PRE_KERNEL_1 to POST_KERNEL
All other watchdog drivers also use POST_KERNEL, and it seems on some
platforms where the TCO watchdog is used not all dependencies are yet set
up by the PRE_KERNEL_1 level.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-04-20 11:15:12 -04:00
Thomas Stranger 77d2490164 arch: arm: core: aarch32: rename z_NmiHandlerSet
rename the function that sets the handler for the nmi.
It should be namespaced and not camel-case:
z_NmiHandlerSet to z_arm_nmi_set_handler

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2023-04-12 08:59:36 +02:00
Gerard Marull-Paretas 0ebe14beb4 sys: util: migrate all files to DIV_ROUND_UP
ceiling_fraction is deprecated, use DIV_ROUND_UP.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-11 12:00:37 +02:00
Pawel Czarnecki 3c44d380e4 drivers: watchdog: gecko: enable watchdog clock
This clock signal needs to be enabled after it was selected.

Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
2023-04-05 12:48:24 +00:00
Pieter De Gendt 6b532ff43e treewide: Update clock control API usage
Replace all (clock_control_subsys_t *) casts with (clock_control_subsys_t)

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2023-04-05 10:55:46 +02:00
Adrian Warecki 600e7b7f21 wdt: wdt_intel_adsp: Remove unused variable
In the intel_adsp_wdt_isr function was an unused dev_config variable.
The variable was removed. This was caught by the sof CI.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-03-30 11:29:33 -04:00
Adrian Warecki ea405eb49e drivers: wdt: Add wdt_intel_adsp driver
Added a new watchdog driver which can handle a multiple wdt_dw instances
and can control the pause signal.

The mlt platform has three designware watchdogs, one for each core.
I decided to create a separate intel watchdog driver for the following
reasons:

1. All three devices share the same interrupt number. Each watchdog reports
an interrupt to the core to which it has been assigned. The same interrupt
number cannot be used by multiple devices in the device tree. So, it would
be assigned to only one device. The other dw watchdog devices would use
this assignment, even though it would not be described for them in the dt.
The interrupt handler function in dw watchdog checks the interrupt flag.
If the interrupt was connected to the first watchdog, and the second or
third watchdog signal an interrupt, the interrupt handler of the first
device would ignore it because it would not have set the interrupt flag.
The watchdog device don't knows anything about the existence of the others
devices.

2. The designware watchdog only supports a hardware pause signal. It cannot
be paused programmatically. On the mtl platform, there is a separate group
of control registers for all per-core watchdogs. There are GPIO-like
registers that allows control of a hardware pause signal for subordinate
watchdogs. This separate block is shared by all three watchdogs.

3. The base addresses of the subordinate watchdogs are read from the
aforementioned control registers. As a result, in the device tree we have
only one base address for the intel watchdog, which points to the pause
control registers and containing the base addresses of the subordinate
devices.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-03-29 09:45:49 -04:00
Adrian Warecki 1d964d8fba wdt: dw: Extraction of common functions from the wdt_dw driver
Functions that can be used by other wdt_dw based drivers have been moved to
wdt_dw_common.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-03-29 09:45:49 -04:00
Henrik Brix Andersen c41dd36de2 drivers: kconfig: unify menuconfig title strings
Unify the drivers/*/Kconfig menuconfig title strings to the format
"<class> [(acronym)] [bus] drivers".

Including both the full name of the driver class and an acronym makes
menuconfig more user friendly as some of the acronyms are less well-known
than others. It also improves Kconfig search, both via menuconfig and via
the generated Kconfig documentation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-28 15:06:06 +02:00
Johan Hedberg 2fe4a4a218 drivers: watchdog: Add Intel TCO Watchdog driver
This adds a basic Intel TCO watchdog driver. The driver doesn't support
windowed timeouts (a non-zero window.min value) or callbacks. The driver
currently assumes TCO version 6, which can be found e.g. on Elkhart Lake
and Raptor Lake platforms. The driver also expects the TCOBA base
address to be specified through DTS, rather than doing runtime lookup
(using e.g. ACPI or PCIe).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-03-22 11:38:59 +01:00
Jeppe Odgaard 4d57f64193 drivers: watchdog: Add TI TPS382x driver
Add support for the TI TPS382x series. The IC has an input pin which
should be toggled by the processor and a output pin which should be
connected to the RESET input of the processor. The timeout is not
configurable.

This device can be used by devices which does not have any internal
hardware watchdog device.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2023-03-21 09:35:58 +01:00
Benjamin Björnsson b308d83d45 drivers: watchdog: add watchdog support on STM32C0-series
Add support for independent watchdog and window watchdog
on the STM32C0-series.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-03-20 10:19:29 +00:00
Ben Lauret 70c6befa88 drivers: watchdog: implement Smartbond watchdog driver
This patch adds watchdog driver for Renesas Smartbond SOCs.

Co-authored-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>

Signed-off-by: Ben Lauret <ben.lauret.wm@renesas.com>
2023-03-03 11:02:37 +01:00
Adrian Warecki 9af2789cad watchdog: dw: Fixed interrupt configuration
An invalid macro name was used to check whether the watchdog device has
configured interrupts. As a result, the interrupt were never configured.
This issue has been fixed.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-02-20 06:53:06 -05:00
Adrian Warecki f230a887da drivers: watchdog: Add a new driver for Synopsys DesignWare watchdog
This commit adds a base version of the driver for Synopsys DesignWare
watchdog.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-02-19 20:42:52 -05:00
Stancu Florin 236084df70 drivers: ti: cc13xx/cc26xx: implement watchdog timer
New Zephyr WDT driver for TI CC13xx/CC26xx family.
Supports interrupts & MCU soft reset on timeout.

Signed-off-by: Stancu Florin <niflostancu@gmail.com>
2023-01-31 16:08:00 -05:00
Francois Ramu 842a6ba02d drivers: watchdog: stm32 iwdt enable and update during setup
To follow the IWDG configuration sequence, the timeout install is
just preparing the reload and prescaler parameters.
Then during the iwdg setup the watchdog is enabled and configured
at the same time.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-01-30 15:05:39 +00:00
Marcin Jabrzyk 61916c69dd drivers: watchdog: Fix RP2040 watchdog load time
RP2040 requires watchdog load time in us, but Zephyr
watchdog window values are in ms. Make sure that it is
adjusted to hardware requirements.

Signed-off-by: Marcin Jabrzyk <marcin.jabrzyk@gmail.com>
2023-01-24 19:01:34 -08:00
Wojciech Slenska fdae56dc6a drivers: watchdog: stm32 iwdg: max prescaler value
In some stm32 MUCs maximum prescaler value can be 1024.

Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
2023-01-20 16:11:39 +01:00
Mateusz Sierszulski 5744709c9c drivers: watchdog: Enable Gecko wdt driver efr32bg_sltb010a
This commit enables the Gecko Watchdog Timer driver on the
efr32bg_sltb010 board.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2023-01-20 12:22:56 +01:00
Francois Ramu 9400de333e drivers: watchdog: stm32 iwdg starts with wdt_setup()
the watchdog is enabled by the wdt_setup()
coming after the wdt_install_timeout.
Due to PR #44972, the code did not follow that.
This PR fixes the correct other in the sequence.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-01-18 09:56:14 +01:00
Patryk Duda 09277d44e3 drivers: watchdog: Make SOC reset as an option in counter watchdog
When using watchdog which doesn't support callbacks (e.g. STM32 IWDG)
it's very useful to have counter based watchdog with shorter timeout.
This way we can gather useful information before IWDG resets SOC.

In above case it's usually not desired to reset SOC when counter
watchdog is triggerd, because we can lose information about reset cause.
For example, STM32 can determine if the reset was caused by watchdog.

Another use case for counter watchdog without SOC reset is to detect
slow code paths.

Signed-off-by: Patryk Duda <pdk@semihalf.com>
2023-01-09 10:15:33 +01:00
Quang Bui Trong 17d86aed80 drivers: watchdog: add support for NXP S32 S32ZE
Add driver shim for the NXP S32 SWT module.

Signed-off-by: Quang Bui Trong <quang.buitrong@nxp.com>
2022-12-27 10:36:42 +01:00
Pawel Czarnecki 5c3ce5a21f drivers: watchdog: silabs: include zephyr/irq.h
Add missing include

Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
2022-12-20 22:50:19 +01:00
Gerard Marull-Paretas 4de1d9a591 drivers: watchdog: npm6001: initial version
Driver for the watchdog embedded in the nPM6001 PMIC.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-22 11:05:19 +01:00
Gerard Marull-Paretas 17c5696f71 include: add missing zephyr/sys_clock.h
Some files were using definitions from sys_clock.h, e.g. MSEC_PER_SEC
without including the header.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-20 22:52:09 +09:00
Gerard Marull-Paretas 178bdc4afc include: add missing zephyr/irq.h include
Change automated searching for files using "IRQ_CONNECT()" API not
including <zephyr/irq.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-17 22:57:39 +09:00
Keith Short 2f2c0176e5 include: fix includes for IT8xxx2 SoC
Fix missing includes for IT8xxx2 drivers.

Signed-off-by: Keith Short <keithshort@google.com>
2022-10-12 16:10:05 -04:00
Keith Short fbdc34e0b1 include: fix includes for NPCX drivers
Add include of kernel.h for drivers using Kernel APIs.

Signed-off-by: Keith Short <keithshort@google.com>
2022-10-12 16:10:05 -04:00