Commit graph

1,992 commits

Author SHA1 Message Date
Martin Hoff
6366bd63af drivers: serial: silabs: fix eusart driver with xg22 soc
This commit introduces a compatibility layer for older EUSART hardware
that lacks the RXTO interrupt. It fix the test uart_async_api when using
xg22 soc.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-10-31 22:40:49 +02:00
Martin Hoff
504eb7d39e drivers: serial: silabs: fix eusart driver when parity param is nok
When running uart_elementary on the xg22 SoC, some tests are failing due
to the lack of checks inside the configuration function. This patch adds
a check for the parity parameter.
I've also noticed an error in the ISR function where we check all the
ISR flags and not only the enabled ones. It has no impact but needs to be
changed in order to be accurate.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-10-31 22:40:49 +02:00
Wojciech Slenska
0468c5fb42 drivers: serial: stm32: don't disable DMA in circular mode
When cyclic mode is enabled, do not disable RX.
This mode ensures continuous availability of RX buffers.

Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
2025-10-31 10:21:47 -04:00
Krzysztof Chruściński
9d017467cc drivers: serial: Remove deprecated uart_nrfx_uarte2 driver
Use of uart_nrfx_uarte2 driver was deprecated before 4.1 release
and now can be removed.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-10-24 13:20:07 -04:00
Khaoula Bidani
ba35b4d076 driver: uart: stm32: Disable UART DMA before shutdown
Use LL_USART_DisableDMAReq_RX to disable UART RX DMA requests.
This should be called before entering shutdown mode.

Force to use UART_STM32U5_ERRATA_DMAT_LOWPOWER
when POWEROFF is selected. This ensure the system to shut down
properly instead of hanging due to DMA staying active.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
Signed-off-by: Julien Racki <julien.racki-ext@st.com>
2025-10-24 09:01:50 -07:00
Guillaume Gautier
124448582f drivers: stm32: replace READ_REG HAL macro by stm32_reg_read
For all STM32 drivers and SoC, replace the READ_REG macro and the
LL_xxx_ReadReg functions (defined in the STM32 HAL) by
stm32_reg_read defined in Zephyr.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-10-24 08:58:25 -07:00
Bjarki Arge Andreasen
306c3d483e drivers: nrf: remove handling of cross domain pins
Remove the handling of cross domain pins from nrf drivers. To use
cross domain in tests, force on constlat and disable power domains
for the test.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-10-24 11:33:28 +02:00
Bjarki Arge Andreasen
beacd7c181 dts: drivers: nordic: nrf54h: Don't manage clocks from drivers
Clocks are requested automatically by hardware on the nRF54H.

Remove additional handling from device drivers, and disable
the now unmanaged clocks in the devicetree.

Updates:
  - can_nrf
  - counter_nrfx_timer
  - uart_nrfx_uarte
  - spi_nrfx_spim
  - spi_nrfx_spis

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-10-23 18:06:30 +02:00
Kamil Krzyżanowski
0a047679fe drivers: serial: stm32: don't allow async TX on a suspended UART
Return an error if trying to send data using a suspended UART,
instead of blocking, possibly forever, for a transmission that will never
succeed.

Signed-off-by: Kamil Krzyżanowski <kamnxt@kamnxt.com>
2025-10-23 18:03:49 +02:00
Qingsong Gou
039389187f drivers: clock_control: fix sf32lb clock_control typo
fix a sf3232lb_clock_is_ready_dt typo

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2025-10-23 17:53:25 +02:00
Martin Hoff
45179f895c drivers: serial: silabs: Fix uart tx abort at high baudrate
At high baudrate when using async api of the uart, the abort
function in not giving the right informations since we're stopping
the dma after getting the status of it. It makes the uart_async_api test
failed on high baudrate.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-10-22 15:03:23 +02:00
Martin Hoff
6ef3ea4080 drivers: serial: silabs: Correction of dma/peripheral isr exec order
This patch correct a bug where the uart/eusart tx callback might be
triggered before the dma complete callback at high baudrate when using
async transfer.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-10-22 15:03:23 +02:00
Quy Tran
a570b0564f drivers: serial: Support PM device for serial driver
Support PM for serial driver of Renesas RX

Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
2025-10-22 15:59:01 +03:00
Aksel Skauge Mellbye
440755bd9e soc: silabs: Move Kconfig symbols for HAL selection to HAL
The Kconfig symbols for selecting HAL content should be part
of the HAL module integration, not defined by the SoC. Split the
symbols between the Series 0/1 Gecko HAL and Series 2 SiSDK HAL
when moving them.

For now, the Series 0/1 HAL symbols retain their name, while new
names consistent with the symbols already defined in the module
integration layer are used for the Series 2 HAL.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-10-22 09:03:15 +02:00
Sunil Abraham
ecc9f6ce71 drivers: uart: microchip/g1: add more functionality
Add more functionality in uart driver.
Implement interrupt API.

Signed-off-by: Sunil Abraham <sunil.abraham@microchip.com>
2025-10-20 19:18:03 -04:00
Quy Tran
336abc6a78 drivers: serial: add contition for tx_buf_len check in async api
Add condition checking for uart async api of Renesas RX

Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
2025-10-20 11:57:03 +02:00
Stoyan Bogdanov
bc9fce18f2 drivers: serial: cc23x0: Replace incorrect macros
Replace CONFIG_PM with CONFIG_PM_DEVICE to include pm_lock
in cc23x0 UART driver in struct uart_cc23x0_data

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2025-10-16 22:31:52 -04:00
Jun Lin
28434f8003 drivers: uart: npcx: support additional capabilities
This commit adds the following functionality support:
1. More baudrate setting.
2. 7 bit data moded.
3. Tx (CR_SOUT) and Rx (CR_SIN) signal invert.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2025-10-16 17:15:30 +03:00
Max Meidinger
24321d5b98 drivers: serial: virtio_console: fix port adding during poll
Fix an issue where it was not possible to use a console port for
receiving data when the console port was added after receiving was
already requested

Signed-off-by: Max Meidinger <mmeidinger@internships.antmicro.com>
2025-10-15 17:36:48 -04:00
Kevin Gillespie
01ccfb4404 drivers: serial: uart_max32: add power management support.
Add power management support to UART driver.

Signed-off-by: Kevin Gillespie <Kevin.Gillespie@analog.com>
2025-10-15 15:36:42 +03:00
Rémy Dziemiaszko
c34e224a1b drivers: uart_mcux_flexcomm: fix dma rx config
The DMA configurations for TX and RX  were mixed-up
letting the DMA RX channel not fully configured.

This fix correctly configures the DMA RX channel
with DMA_ADDR_ADJ_NO_CHANGE.

Signed-off-by: Rémy Dziemiaszko <remy.dziemiaszko@smile.fr>
2025-10-14 17:27:29 -04:00
Jakub Klimczak
e783292ebd drivers: serial: virtio_console: Remove superfluous spinlocks
Spinlocks in functions virtconsole_control_recv_cb and
virtconsole_send_control_msg were unnecessary since those were called
from virtio_pci_isr or virtio_mmio_isr, which already use spinlocks.

Signed-off-by: Jakub Klimczak <jklimczak@internships.antmicro.com>
2025-10-14 07:44:12 -04:00
Jakub Klimczak
ff19a01868 drivers: serial: virtio_console: Make Kconfig more informative
Add descriptions to the Kconfig file and restructure it slightly.

Signed-off-by: Jakub Klimczak <jklimczak@internships.antmicro.com>
2025-10-14 07:44:12 -04:00
Jakub Klimczak
64b321f72c drivers: serial: virtio_console: Postpone transmission of control messages
There was a bug in the VIRTIO Console driver which could cause a deadlock
by attempting to add buffers to the control-tx virtqueue too fast and
with an infinite timeout.
This commit fixes it by placing messages that couldn't be sent in a FIFO
queue and taking care of them later in a callback function.

Signed-off-by: Jakub Klimczak <jklimczak@internships.antmicro.com>
2025-10-14 07:44:12 -04:00
Phi Tran
889a21d69d drivers: serial: Add DTC support for serial driver and implement Async API
Update serial driver support for RX MCU:
- Add DTC support for SCI UART driver.
- Implementation Async APIs for serial driver.

Signed-off-by: Phi Tran <phi.tran.jg@bp.renesas.com>
2025-10-14 12:53:49 +03:00
Qingsong Gou
ee9843cfe4 drivers: serial: sf32lb: add uart interrupt support
add sf32lb52x uart interrupt support

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2025-10-14 12:53:11 +03:00
McAtee Maxwell
c83c6df512 drivers: uart: update ifx uart_pdl driver for kit_pse84_eval
- update ifx uart driver for kit_pse84_eval board

Signed-off-by: McAtee Maxwell <maxwell.mcatee@infineon.com>
2025-10-10 12:59:33 -04:00
McAtee Maxwell
281e52f6bf drivers: clock_control: add clock_control support for kit_pse84_eval
- add support for kit_pse84_eval board
- refactor infineon,fixed-clock binding
- refactor infineon,fixed-factor binding
- refactor infinein,peri-div binding

Signed-off-by: McAtee Maxwell <maxwell.mcatee@infineon.com>
2025-10-10 12:59:33 -04:00
Camille BAUD
6430ad458c drivers: serial: increase FIFO threshold for BFLB uart driver
Increases the fifo threshold for tx, should increase speed a bit.

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-10-09 20:35:34 -04:00
Camille BAUD
b20d3432e3 drivers: serial: Improve BFLB UART driver: add runtime configuration
This adds the ability to do runtime configuration of the BFLB
UART driver.

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-10-09 20:35:34 -04:00
Camille BAUD
a7bf03cec5 drivers: serial: Add De-init to bflb uart driver
Allows BFLB uart peripheral to de-init.

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-10-09 20:35:34 -04:00
Bjarki Arge Andreasen
1f294febf2 drivers: serial: nrfx_uarte: Default DIRECT_ISR if MULTITHREADING=n
Default to using DIRECT_ISR if nothreading. This allows the SW ISR
table to be excluded if nothreading.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-10-09 22:56:09 +03:00
Raffael Rostagno
4c55e8f93a drivers: uart: esp32h2: Add ASYNC support
Add ASYNC api support for ESP32-H2.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-10-09 12:36:11 -04:00
Declan Snyder
f56f1967e0 drivers: uart_mcux_lpuart: Handle multiple uart case
Handle the case where there are multiple different kinds of UART on one
platform, the other UART driver select SERIAL_SUPPORT_ASYNC but LPUART
did not, causing build error in LPUART driver. Shield LPUART driver from
this case by introducing driver config to indicate that in fact LPUART
is the one enabling ASYNC.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-08 17:47:00 +03:00
Ali Hozhabri
e4a8b272ec drivers: serial: Enable UART wake-up line in STM32
Enable UART wake-up line in STM32 driver.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-03 21:15:08 -04:00
Alberto Escolar Piedras
d83ebce959 drivers/serial/uart_native_tty: Set TTY to be closed on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Alberto Escolar Piedras
07987cc539 drivers/serial/uart_native_pty: Set PTY to be closed on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Lin Yu-Cheng
2d72d86ba2 serial: rts5912: implement power management
support uart wake up function

Signed-off-by: Lin Yu-Cheng <lin_yu_cheng@realtek.com>
2025-10-02 11:47:32 +03:00
Lin Yu-Cheng
3372459e28 serial: uart_ns16550: add uart_ns16550_get_port() function
For user to get the register address of the device by this function

Signed-off-by: Lin Yu-Cheng <lin_yu_cheng@realtek.com>
2025-10-02 11:47:32 +03:00
Krzysztof Chruściński
7a6c7ea0f9 drivers: serial: nrfx_uarte: Remove redundant pinctrl call
Pinctrl call is redundant as uarte_periph_enable calls it as well.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-10-01 17:12:09 -04:00
Chris Friedt
5dd3bd52c5 drivers: serial: pl011: only declare ambiq pm action when used
The conditions needed to declare `uart_ambiq_pm_action()` in
`uart_pl011_ambiq.h` and the conditions needed to use it in `uart_pl011.c`
differed, which would result in a warning promoted to error during
weekly CI runs.

Ensure that the conditions match to remove the warning / error.

```cpp
if defined(CONFIG_SOC_SERIES_APOLLO3X) || \
  defined(CONFIG_SOC_SERIES_APOLLO5X)
```

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-10-01 08:27:59 +02:00
Fin Maaß
4a69c1b8a8 drivers: serial: litex: add support for rx-fifo-rx-we
add support for rx-fifo-rx-we, whci got added to
LiteX in https://github.com/enjoy-digital/litex/pull/2319

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-30 11:03:15 +02:00
Fin Maaß
a39ab55c9d drivers: serial: litex: only ack tx event, when full
only ack tx event, when full, so we don't
have to fill the fifo with zeros as a workaround.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-30 11:03:15 +02:00
Fin Maaß
087cb96025 drivers: serial: litex: remove redundant rx pending
flushing rx pending already happens in
uart_litex_fifo_read, which should be called
by the callback, so don't do it again, also
it can lead to the drop of chars, as flushing
removes the current entry in the fifo.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-30 11:03:15 +02:00
Pisit Sawangvonganan
601f2fde6e drivers: serial: pl011: reduce device's base address accesses
In several functions, the UART registers are accessed multiple times
through the `get_uart(dev)` inline function. This results in repeated
dereferencing of the device's base address.

This commit caches the UART register struct pointer in a local variable
`uart` at the beginning of each relevant function.

For registers where repeated access is not needed, the value is read once
into a temporary variable. Modifications, if any, are applied to
the temporary copy, and the result is written back once.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-09-27 13:59:43 -04:00
Declan Snyder
1481755acb drivers: uart_mcux_flexcomm: Refactor low power state handle
Refactor low power state handling to not tie to zephyr,disabling-states
and define it's own separate "low power states" property in DT instead.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-09-25 14:18:05 -04:00
Kamil Krzyżanowski
bd344be413 drivers: serial: stm32: use hardware rx timeout interrupt when available
Use the RTO interrupt for RX timeouts when using the async API.
The workqueue based approach is sensitive to load and has a higher latency
than using hardware timeouts.

Signed-off-by: Kamil Krzyżanowski <kamnxt@kamnxt.com>
2025-09-24 09:42:33 +02:00
Kamil Krzyżanowski
50d6eac5a2 drivers: serial: stm32: fix some formatting
Fix some formatting, because the clang-format compliance test was
complaining.

Signed-off-by: Kamil Krzyżanowski <kamnxt@kamnxt.com>
2025-09-24 09:42:33 +02:00
Sai Santhosh Malae
088b59039d drivers: serial: uart_ns16550: Add pm support for uart_ns16550 driver
This commit enables the pm device runtime driver support
for the uart_ns16550 driver (only for devices that have an
associated power domain enabled).

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-09-22 13:27:01 -04:00
Fin Maaß
186bb57b97 drivers: serial: litex: make sure to just disable irq
just disable irq and not plush pending events,
so we don't loose them, when they are enabled
again.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-22 09:51:36 +02:00