Commit graph

2,140 commits

Author SHA1 Message Date
Thomas Decker
6efbec10fb drivers: serial: uart_stm32: make ptr to clock device const
The pointer to the clock device can be const, as it does never change at
runtime. This moves the const struct device *clock from data to config
struct and initializes it inside the init macro. The __uart_stm32_get_clock
function is no longer needed and removed.

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
2026-01-09 07:57:04 -06:00
Fabin V Martin
67ddf8db30 drivers: uart: microchip: sercom g1: DMA selection for async mode
Allow user to select DMA in the application.

Signed-off-by: Fabin V Martin <Fabinv.Martin@microchip.com>
2026-01-09 10:41:23 +01:00
Muhammad Waleed Badar
f31516d461 drivers: uart: pl011: fix poll_in function
RSR handling is already implemented in pl011_err_check(), which is the
appropriate place to detect, and report receive error conditions.

This also aligns poll_in() behavior with pl011_fifo_read(), which reads
and delivers characters without returning RSR status to the caller.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-01-07 14:52:10 -06:00
Daniel Fladerer
a4f75ba4bd drivers: serial: uart_mcux_iuart: Adjust FIFO fill behavior for TX
Until now transmission FIFO was not used.
With this chamge the FIFO will be filled up, until it is full.

Signed-off-by: Daniel Fladerer <d.fladerer@gmx.de>
2026-01-06 13:37:54 +00:00
Thinh Le Cong
23892b038f drivers: serial: fix IAR warning Pe1072 about declaration after a label
Fix Pe1072 warning (declaration after case label) by wrapping with braces

Signed-off-by: Thinh Le Cong <thinh.le.xr@bp.renesas.com>
2026-01-04 14:11:51 +01:00
Alberto Escolar Piedras
a2f45762f1 arch posix: cleanup NATIVE_APPLICATION support remnants
NO_POSIX_CHEATS was a macro used to avoid including the content of a
header (`posix_cheats.h`) which allowed building applications in the
POSIX architecture without the native simulator, avoiding collisions
between some embedded symbols and those from the host C library.

Support for this way of building, and this header and macro were
removed in e150ffb92c, but these users
were forgotten. This was harmless, but let's just clean it up now.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-01-03 10:19:34 +01:00
Qingsong Gou
98742f1b07 drivers: serial: sf32lb: add uart async API support
add uart async API support for sf32lb

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2025-12-31 11:00:08 +00:00
Qingsong Gou
355c2f42e8 drivers: serial: sf32lb: add config_get and configure
Add config_get and configure APIs support

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2025-12-29 13:05:41 +01:00
Fabin V Martin
cf8d97ab39 drivers: uart: microchip: sercom g1: Add DMA support
The current driver implementation only support pooling and
synchronous operations. By adding DMA support the driver will
be able to operate in asynchronous mode which helps to improve
CPU usage and save power.

Signed-off-by: Fabin V Martin <Fabinv.Martin@microchip.com>
2025-12-26 10:14:22 -06:00
Benjamin Cabé
af171d4d3b drivers: uart: fix incorrect handler check in uart_configure syscall
The z_vrfy_uart_configure function was incorrectly checking for the
existence of the 'config_get' handler instead of 'configure'.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-12-22 14:50:23 +01:00
zjian zhang
14e396a3b1 drivers: serial: add amebad loguart support
loguart driver support for amebad

Signed-off-by: zjian zhang <zjian_zhang@realsil.com.cn>
2025-12-22 14:45:39 +01:00
Hou Zhiqiang
03699e24fc drivers: serial: mcux_lpuart: add clock enablement
Add the clock emablement in the LPUART driver to avoid
depending on the default enablement settings.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2025-12-20 09:19:19 +01:00
Benjamin Cabé
e861b2681d drivers: dts: ti: fix typo in "Texas Instruments" company name
s/Texas Instrument/Texas Instruments/g

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-12-18 18:52:58 +00:00
Robert Cheng
5e1d28b49c drivers: serial: focaltech: add ft9001 serial driver
Add the UART driver for the FocalTech FT9001 SoC.

Signed-off-by: Robert Cheng <robert.cheng@focaltech-electronics.com>
2025-12-18 12:13:19 +00:00
Sylvio Alves
007f4427f3 drivers: serial: esp32: add UHCI SLIP encoding control
Add devicetree properties to control UHCI SLIP encoding/decoding
when using UART with DMA (async API). Both properties default to
disabled to prevent unintended data corruption.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-18 05:35:40 +01:00
Sreeram Tatapudi
0a06f5b91a dts: bindings: Drop cat1 from the infineon binding files
Drop cat1 from the binding files to enable reuse by other
category devices as well.

Fixes #99174

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-12-17 13:58:09 -05:00
Sylvio Alves
f8d2e00a0e includes: remove duplicated entries in zephyr-tree
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.

Duplicates inside different #ifdef branches are preserved
as they may be intentional.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-17 13:57:38 -05:00
Sylvio Alves
443862ddff drivers: uart: esp32: fix async RX byte count from DMA descriptor
In async UART mode with DMA, the RX completion callback was incorrectly
relying on rx_counter which is never updated in DMA mode since data
bypasses the UART FIFO via UHCI+GDMA.

Fix by reading the actual transferred byte count from the DMA
descriptor's length field using gdma_ll_rx_get_success_eof_desc_addr().
Direct LL calls are used because this runs in ISR context where
dma_get_status() is not IRAM-safe.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-17 10:57:52 +02:00
Daniel Leung
9d181c561e serial: uart_bitbang: fix incorrect callback device
When doing the callback, it should pass it the UART device
pointer. So fix that.

Fixes #98229

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-12-17 10:52:33 +02:00
zjian zhang
53bba6df01 drivers: serial: add amebadplus loguart driver
loguart driver for amebadplus

Signed-off-by: zjian zhang <zjian_zhang@realsil.com.cn>
2025-12-15 17:06:38 +00:00
Sylvio Alves
b7b32944fc drivers: espressif: move ISRs into IRAM area
Most of Espressif drivers ISRs are already running in IRAM area, except
those in this PR. Move ISRs accordingly so we avoid any
interrupt miss when cache is disabled.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-15 07:27:10 -05:00
Missael Maciel
726e7b64c2 drivers: uart: save interrupts in PM Action
Removed usart_intenset attribute from conditional compilation
in mcux_flexcomm_data structure since this parameter needs to
be saved/restored independently if the interrupts are enabled
or not based on the PR feedback

Signed-off-by: Missael Maciel <davidmissael.maciel@nxp.com>
2025-12-11 09:19:05 +02:00
Missael Maciel
a84e0b5413 drivers: uart: save interrupts in PM Action
The PM action saves the interrupts enabled using a
global variable called usart_intenset. The problem is
when you have multiple uart instances that have different
configurations, when entering/exiting from a power level,
only one configuration is saved and will be applied to all
uart instances when exiting from a power level. We need to
keep this setting individual for each instance. To do this,
usart_intenset was added as a new element to mcux_flexcomm_data
structure. In this way, each uart instance will keep/restore
each own setting.

Signed-off-by: Missael Maciel <davidmissael.maciel@nxp.com>
2025-12-11 09:19:05 +02:00
Tahsin Mutlugun
15965b266c drivers: serial: uart_max32: Enable TX AE workaround for MAX32657
Extend UART_MAX32_TX_AE_WORKAROUND to also apply when building for
MAX32657.

Without this option, logging output may become fragmented or delayed
because TX interrupts fail to trigger reliably for small chunks of data.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-12-10 17:37:18 +00:00
Tahsin Mutlugun
6c6e8e51bf drivers: serial: uart_max32: Refactor IRQ flag clearing
api_irq_update was clearing TX interrupt flags before the TX interrupt
could be served, breaking synchronization in time-sensitive applications.

Changes:
1. Remove unnecessary MXC_UART_ClearFlags() calls in api_fifo_read() and
   api_irq_update to avoid premature flag clearing; ISR handler already
   clears them after returning from the callback.
2. Replace raw flag checks in irq_is_pending() with more complete
   api_irq_rx_ready() and api_irq_tx_ready().

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-12-10 17:37:18 +00:00
Deepika aerlync
067426ac54 drivers: serial: add Infineon PSOC4 UART support
Add initial implementation of the Infineon PSOC4 UART driver based on the
Peripheral Driver Library (PDL) for PSOC4 (PSoC 4100TP) devices.

Features:
- UART transmit and receive using PDL SCB UART APIs
- Configurable baud rate, parity, stop bits, and data bits from devicetree
- Pinctrl integration for TX/RX pins
- Support for Zephyr console and shell subsystems
- Build-time validation for UART configuration parameters

Signed-off-by: Dharun krithik k <dharunkrithik@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
Signed-off-by: Deepika aerlync <deepika@aerlync.com>
2025-12-10 15:46:35 +00:00
Jacky Lee
3b38d6cc71 drivers: serial: ns16550: Fix TX IRQ not triggered when FIFO is empty
When uart_ns16550_irq_tx_enable() is called and the TX FIFO is already
empty, no new interrupt is generated, causing data transmission to stall
in some cases. This patch introduces a workaround to simulate an ISR
callback if the FIFO is empty when enabling the TX IRQ.

Signed-off-by: Jacky Lee <jacky.lee@egistec.com>
2025-12-09 14:55:35 -05:00
Thomas Decker
69a6f24821 drivers: serial: uart_stm32: Fix typo in LOG_ERR string
Change "Could not enable (LP)UART clock" to "[...] disable [...]" when
clock_control_off() fails.

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
2025-12-08 09:34:35 -05:00
Sreeram Tatapudi
5ecf248ba3 drivers: infineon: Drop cat1 from the files names
Drop cat1 from the file names to enable reuse by other
category devices as well

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-12-07 21:19:38 -05:00
Kevin Chan
203c655343 Drivers: Serial: Add PDL based UART Async. for PSE84 and PSC3
- add UART Async. driver code
- Remove references to cat1-uart-pdl from devicetree references

Signed-off-by: Kevin Chan <kevin.chan3@infineon.com>
2025-12-04 17:12:23 -05:00
Mathieu Choplain
4aa5e95135 drivers: uart: stm32: configure proper DMA burst length
The burst length unit is bytes, not number of transfers. This had not been
an issue since the DMA driver historically ignored the values, but has now
become one since they are used and (most importantly for us) validated.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-04 05:23:02 -05:00
Adrien Lessard
87d52f4993 drivers: serial: stm32: fix locked pm state
When not using the async API, the rx_woken flag can be set but cannot be
cleared, leading to an indefinitely locked pm state. This commit
prevents the flag from being set when not using the async API.

Signed-off-by: Adrien Lessard <adrien.lessard.42@gmail.com>
2025-12-02 18:40:58 -05:00
Ryan McClelland
cdfecb6354 drivers: serial: cdns: fix race conditon under heavy uart load
There can be a race conditon where another interrupt fires while it
is in the callback, but then the interrupt is cleared towards the
end of the interrupt. Clear the interrupts it intends to service
at the beginning of the ISR.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-12-01 08:26:56 +01:00
Nikodem Kastelik
ad1e5ac253 nordic: update and align to nrfx 4.0.1
New nrfx release contains major rework of nrfx drivers
instantiation making it easier to integrate with dts nodes.
Now, nrfx driver instances can no longer be `const`
because they contain driver runtime state.
Additionally, all nrfx drivers return `errno` error codes
instead of deprecated `nrfx_err_t`.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2025-11-27 14:45:17 +01:00
Andrzej Głąbek
15dabaa595 drivers: uart_nrfx_uarte: Fix runtime device PM for interrupt driven API
Add missing getting/putting of the device when the RX interrupt is
enabled/disabled. Also fix enabling and disabling of the TX interrupt
so that the device is got/put only if the interrupt wasn't already
enabled/disabled and device PM reference counting is done correctly.

This fixes `console_getchar()` that would hang when used with
`CONFIG_PM_DEVICE_RUNTIME=y`.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2025-11-26 11:06:18 +00:00
Etienne Carriere
a2a9541cea drivers: serial: stm32: simplify ISR handlers definition
Simplify interrupt handler helper macros by removing
STM32_UART_IRQ_HANDLER_DECL(), using STM32_UART_IRQ_HANDLER() only
renamed STM32_UART_IRQ_HANDLER_DEFINE() and aggregating where the
macro and STM32_UART_IRQ_HANDLER_FUNC() macro are defined.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-11-26 11:03:50 +00:00
Etienne Carriere
8001b3c343 drivers: serial: stm32: clean indentation in instance init macros
Clean indentation in local macros used to define UART instances.
Remove extra line escape ending CONFIG_UART_ASYNC_API() macro value.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-11-26 11:03:50 +00:00
Tomasz Bursztyka
bda00b3770 drivers: uart: Add configure/config_get API support for mspm0 driver
It is thus possible to enable CONFIG_UART_USE_RUNTIME_CONFIGURE for
this driver and re-configure a uart device at runtime.

Driver's init function was moved to the bottom of the file for two
reasons: to ease factorization and to follow the common device driver
source structure (usually: the init function is right before the
API structure and the instanciation macros).

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-11-21 10:10:11 +02:00
Jamie McCrae
57263db2e2 drivers: serial: uart_bflb: Fix not guarding deinit function
Fixes an issue with an unused function being defined if
CONFIG_DEVICE_DEINIT_SUPPORT was disabled

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-11-20 17:14:50 +00:00
Yurii Lozynskyi
088536e547 drivers: uart: ifx_cat1: disable async API for SOC_CY8C6244LQI_S4D92
Exclude SOC_CY8C6244LQI_S4D92 from UART async API support due to
hardware limitations, similar to SOC_FAMILY_INFINEON_CAT1C.

Signed-off-by: Yurii Lozynskyi <yurii.lozynskyi@infineon.com>
2025-11-20 16:00:16 +00:00
Jamie McCrae
6a07d96b5f drivers: serial: uart_nrfx_uarte: Fix not guarding deinit function
Fixes an issue with an unused function being defined if
CONFIG_DEVICE_DEINIT_SUPPORT was disabled

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-11-18 08:09:24 -05:00
Pete Johanson
9a55353216 drivers: serial: Apply TX AE interrupt workaround on MAX32655
The workaround for missing the almost-empty interrupt when TX of very small
payloads needs to also be applied for the UART on MAX32655, so default on
that workaround symbol on that target.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2025-11-17 09:15:36 -05:00
Krzysztof Chruściński
9c1fbc8a86 drivers: serial: nrfx: Remove use of UART_NRFX_UARTE_LEGACY_SHIM
Kconfig got removed.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-11-14 16:46:15 +01:00
Krzysztof Chruściński
f1f0b03aea drivers: serial: nrfx_uarte: Add mode with TIMER byte counting
Add mode to be used on UARTE with frame timeout which is using a bounce
buffers and TIMER to count bytes. This mode shall be used to reliably
receive data without HWFC as frame timeout approach is not 100% reliable
because it can loose or corrupt a byte when new byte arrives after
frame timeout is detected but before it is fully handled. This mode is
similar to the one enabled with CONFIG_UART_x_NRF_HW_ASYNC but
additional bounce buffers are used and UARTE is receiving data to
internal buffers and copies data to the user buffer. Legacy apporach
cannot be used because in new SoC DMA attempts to copy data in words
so when byte is received it stays in the DMA internal buffer until
4 bytes are received or end of transfer happens then internal DMA
buffer is flushed.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-11-14 15:24:48 +02:00
Krzysztof Chruściński
9ae8c4edbc drivers: serial: nrfx_uarte: Prepare code for extension
Rearrange code to prepare for upcoming extension that adds special
receive mode.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-11-14 15:24:48 +02:00
Alberto Escolar Piedras
40dc5b17a8 drivers uart_native_pty: Remove deprecated options & binding
In cb53e40ff9
the uart_native_posix driver was renamed to uart_native_pty while
deprecating the old kconfig options and bidning for the 4.2 release.

Let's remove them now.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-11-13 20:45:05 -05:00
Patryk Koscik
1bd934dbba drivers: uart: ambiq: enable driver for apollo4x
Enable Ambiq serial driver for the Apollo4x SoC series.

Signed-off-by: Patryk Koscik <pkoscik@antmicro.com>
2025-11-04 16:53:51 +02:00
Patryk Koscik
0b89d298a1 drivers: uart: ambiq: make driver compatible with apollo4x
This patch makes `uart_ambiq.c` compatible with the Apollo4x SoC series.

Signed-off-by: Patryk Koscik <pkoscik@antmicro.com>
2025-11-04 16:53:51 +02:00
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