Commit graph

2,167 commits

Author SHA1 Message Date
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
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