Commit graph

1,975 commits

Author SHA1 Message Date
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
Declan Snyder
a6836866b1 drivers: lpuart: Dont say we support async without DMA
The dma has to be enabled on the platform in order for ASYNC API to
work. This can be indicated by whether or not any LPUART node has the
`dmas` property set.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-09-20 11:11:09 +02:00
Mahesh Mahadevan
efe34d04d2 drivers: nxp: Use a MACRO to enable Wakeup signals
Switch to using the new NXP_ENABLE_WAKEUP_SIGNAL and
NXP_DISABLE_WAKEUP_SIGNAL macros to avoid adding
platform specific calls in the Zephyr drivers.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-09-20 11:09:00 +02:00
Gerard Marull-Paretas
e3e2a40895 drivers: serial: sf32lb: add basic driver
Just basic driver with poll-in/out capability.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2025-09-19 16:34:15 +02:00
Benjamin Cabé
27fa721632 drivers: serial: opentitan: remove bogus depends on clause
CONFIG_SERIAL_SUPPORT_INTERRUPT is a Kconfig option that is supposed to
be selected by serial drivers that support interrupts. This commit
removes a bogus "depends on !SERIAL_SUPPORT_INTERRUPT" which does not
make sense and causes some tests to fail.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-19 08:06:42 +02:00
Julien Panis
c625853b19 drivers: serial: cc23x0: Add power management
Add PM support to cc23x0 UART module.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2025-09-18 13:47:56 -04:00
Hau Ho
48decca1fc drivers: serial: Update serial driver to support RX26T
- Update serial driver for RX26T support. This MCU using grp interrupt
feature (not supported yet), so need to add some marcos to enable
support.
- Change the struct st_sci0 to use a common sci iodefine struct as
st_sci

Signed-off-by: Hau Ho <hau.ho.xc@bp.renesas.com>
Signed-off-by: Phi Tran <phi.tran.jg@bp.renesas.com>
2025-09-18 15:40:34 +01:00
Martin Hoff
4c2bc42f7b drivers: serial: silabs: Change poll_out function to blocking mode
Since the UART API explicitly states that the poll_out function needs
to block until the character is sent, change the mechanism and add
a busy-wait loop to ensure transmission completion before proceeding.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-09-18 09:46:49 +01:00
Martin Hoff
c37ffd396b drivers: serial: silabs: Update ISR to check for DMA device presence
Since the symbol CONFIG_UART_ASYNC_API is shared between EUSART and USART
drivers, it creates a scenario where EUSART can have
CONFIG_UART_SILABS_USART_ASYNC=y but with no DMA device declared for it
in the DTS (because we only want async API for the USART driver).
We handled this case by disabling async transfer when the DMA
device is null, but when we activate CONFIG_PM, we have a hard fault due
to null pointer dereference in the ISR.
This bug was only discovered today when trying to enable CONFIG_PM over the
uart_async_api test, which led to a hard fault in the ISR. This occurs
because we only enable interrupts when the PM is enabled in the "poll_out"
function to put the PM lock back.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-09-18 09:46:49 +01:00
Devin Jaenicke
ba42b5db21 drivers: serial: silabs: fix to allow euart to function on bgm220s
The efr32xg22 series does not support the same async operations as other
efr32 series chips. This change allows the eusart driver to function.

Signed-off-by: Devin Jaenicke <devinjaenicke@glassboard.com>
2025-09-17 11:16:17 +01:00
Pete Johanson
f51ba58dfd drivers: serial: Fix TX of single byte on MAX32.
MAX32 UART's "almost empty" fires when the FIFO gets down to one byte, but
when sending just one byte, no interrupt is raised, resulting in stalled
TX. Use a timer to ensure the ISR is invoked and TX processing continues in
that scenario.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2025-09-12 14:22:55 -04:00
Fin Maaß
d2988fc91f drivers: serial: litex: trivial changes
some trivial changes

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-12 13:18:30 +02:00
Fin Maaß
cf3701ccad drivers: serial: litex: only clear rx pending if needed
only clear rx pending if needed

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-12 13:18:30 +02:00
Fin Maaß
b97a0b174a drivers: serial: litex: fix set pending in uart_litex_fifo_fill function
fix set pending in uart_litex_fifo_fill function

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-12 13:18:30 +02:00
Fin Maaß
d245529329 drivers: serial: litex: remove unneeded soft irq
remove unneeded soft irq, as disabeled irqs
will still be registered, but just not propagated
to the cpu until it is enabled again.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-12 13:18:30 +02:00
Samuel Coleman
8cc80069a7 drivers: serial: stm32: expand DMAT errata test.
I manually checked the errata sheets for all STM32Hxx/STM32Uxx parts to
confirm the defect's presence or absence. It appears to have been resolved
in silicon on newer parts (e.g., STM32U3xx family), so hopefully this test
will not need grow further (knock on wood).

Co-authored-by: Nicolas Zuluaga <nicolas.zuluaga@rbr-global.com>
Signed-off-by: Samuel Coleman <samuel.coleman@rbr-global.com>
2025-09-12 08:19:25 +01:00
Jakub Klimczak
f7d8688a35 drivers: serial: Add UART VIRTIO Console
Add a UART driver for the VIRTIO console device.
This driver has support for both polling- and interrupt-based i/o,
as well as interacting with up to 32 console ports (disabled by
default). Based on the Xen HVC driver.
Tested with the console subsystem sample programs. Aside from
enabling CONFIG_PCIE, setting CONFIG_HEAP_MEM_POOL_SIZE to a
high enough value (for example 100000) is necessary -- as is done
in the virtiofs sample.

Signed-off-by: Jakub Klimczak <jklimczak@internships.antmicro.com>
2025-09-11 06:26:02 -04:00
Hao Luo
53e28e0de2 driver: uart: ambiq: need to wait for IO stable after resume
Add a short delay to wait for IO stable when resume from sleep
to prevent printing gibberish.

Signed-off-by: Hao Luo <hluo@ambiq.com>
2025-09-11 09:55:05 +02:00