Commit graph zephyr/drivers/serial
Author SHA1 Message Date
Miguel Gazquez
3d797110e6 drivers: serial: uart_esp32: use dev instead of data->uart_dev
Pass the function argument `dev` to the async callback instead of
`data->uart_dev`. The pointers are identical, but `dev` is already
available in this context, so it's clearer to use it directly.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2026-03-19 16:59:36 +01:00
Francois Ramu
f7b1c8e2b9 drivers: serial: stm32: update driver for stm32 hal2
Add abstraction function to check the TX/RX fifo flags and enable/disable,
and redefine a few macros (like stop bits or data width) for STM32 HAL2.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2026-03-19 11:39:33 +00:00
William Markezana
d547042bf9 drivers: bflb: extend shared drivers with BL70XL SoC support
Add CONFIG_SOC_SERIES_BL70XL to preprocessor conditionals across
existing Bouffalo Lab drivers that share register-compatible code
paths with BL60x/BL70x:

- cache: L1C flush-enable workaround applies to BL70XL
- flash: XIP address defines, L1C wrap, QPI JEDEC ID support
- gpio: BL70XL includes, fix BIT() usage for pin set/clear
- i2c: clock source calculation
- serial: UART clock divider, guard UART1 (BL70XL has only UART0)
- spi: GLB address and FIFO size, clock calculation
- syscon: efuse SAHB clock selection
- input: IR receiver pin mapping and clock divider

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-03-18 17:40:26 -05:00
Jacob Wienecke
b5af9747c8 serial: mcux_flexcomm: apply pinctrl in PM
Apply PINCTRL_STATE_SLEEP on suspend and PINCTRL_STATE_DEFAULT on resume
so that pin configuration is updated for low power modes.

Previously the suspend and resume actions were empty, leaving pins in
their active configuration during sleep. On SoCs like RW6xx where pad
control registers survive low power modes, this allos boards to define
sleep pinctrl states with appropriate pull or drive setting s to minimize
leakage.

Signed-off-by: Jacob Wienecke <jacob.wienecke@nxp.com>
2026-03-18 11:03:32 +09:00
Ayush Singh
c1e14900b0 drivers: serial: Add RPMSG UART
A lot of BeagleBoard.org boards contain SOCs with co-processors such as
M4F in AM62x (PocketBeagle 2 [0]), R5s in AM67A (BeagleY-AI [1]). In such
targets, the application is normally loaded by the Linux host using
remoteproc.

There have been some out of tree patches to have micropython and other
Zephyr applications output to allow having a console without requiring
manual connections. This patch attempts to provide a more concrete and
upstream way to have that functionality.

The implementation uses existing rpmsg service subsystem.

Only implemented poll_out

Tested on PocketBeagle 2 M4F core.

[0]: https://docs.zephyrproject.org/latest/boards/beagle/pocketbeagle_2/doc/index.html
[1]: https://docs.zephyrproject.org/latest/boards/beagle/beagley_ai/doc/index.html

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2026-03-16 18:58:35 -05:00
Marco Widmer
5abd0035f2 drivers: serial: cmsdk_apb: lock irqs when writing the ctrl register
Enabling and disabling interrupts may happen concurrently from thread
and interrupt context. Add locks to synchronize the access to the ctrl
register.

This was observed to improve the stability of the zephyr,bt-hci-uart
driver when used with the cmsdk_apb uart driver.

Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
2026-03-13 14:43:17 +01:00
Marco Widmer
c73c1cb476 drivers: serial: cmsdk_apb: rework interrupt "priming"
Similar to the TX interrupt, the RX interrupt is also an edge interrupt
that only fires when a new bytes is received. When enabling the RX
interrupt, data may be already present in the RX FIFO. Call the
interrupt handler manually to start processing.

Also check if calling the interrupt handler is really required.

Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
2026-03-13 14:43:17 +01:00
Marco Widmer
fd801f8a0c drivers: serial: cmsdk_apb: fix irq_is_pending when interrupts disabled
irq_is_pending should not return 1 when interrupts are disabled through
irq_XX_disable. Check the interrupt enable bit before returning.

Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
2026-03-13 14:43:17 +01:00
Sylvio Alves
c64a74e711 espressif: adapt to hal_espressif IDF master sync
Adapt all Espressif SoC and driver code to the updated
hal_espressif module synced with IDF master branch.

Main changes:
- clock control: delegate peripheral clock gating to HAL
  layer using new clock/reset APIs
- SPI/GDMA: adapt to restructured DMA HAL with new channel
  allocation and configuration interfaces
- ethernet: add RMII clock configuration and PHY management
- GPIO: simplify using direct HAL function calls
- flash: adapt to updated SPI flash HAL interfaces
- linker scripts: update IRAM/DRAM mappings for new HAL
  object files
- DTS: fix ESP32-S2 PSRAM dcache1 address to match actual
  MMU mapping region (0x3f800000 DRAM1 instead of 0x3f500000
  DPORT which lacks 8-bit access capability)
- west.yml: update hal_espressif revision

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-03-13 11:38:18 +01:00
Raffael Rostagno
5250dc705a drivers: uart: esp32: Add device PM
Add device PM to ESP32 UART driver.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-03-10 15:09:30 +01:00
Nhut Nguyen
ddef67d4ae drivers: serial: renesas: Add support for RZ/T2H, N2H
Update serial driver to support Renesas RZ/T2H, N2H

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-03-10 09:33:25 +01:00
Yuzhuo Liu
3c46baa1a2 drivers: serial: add rtl8752h serial driver
Add rtl8752h series in bee serial driver.

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-03-09 15:03:48 -05:00
Merin George
563ec38fc6 drivers: serial: infineon: updated hardware flow control support
Update the Infineon PDL UART driver to support Zephyr's standard
UART hardware flow control configuration.

Flow control is now derived from uart_config.flow_control allowing
applications to enable RTS/CTS using the generic UART API and
devicetree settings

configure the RTS rx fifo trigger level when flow control is enabled

Signed-off-by: Merin George <merin.george@infineon.com>
2026-03-06 09:57:43 +01:00
Yassine El Aissaoui
f66677833f drivers: mcux_lpuart: Handle STANDBY PM state in state-lock functions
STANDBY state can place the peripheral into a
low‑power state, and transitioning to it before
a TX transmission completes may cause data loss

Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2026-03-05 04:41:25 +01:00
Keith Packard
bbb6e78229 drivers/serial: Add missing declarations in uart_max32.c
When UART_INTERRUPT_DRIVE, PM and UART_CONSOLE_INPUT_EXPIRED are all
defined the driver uses the device flags without the necessary declaratoins
or fetching the hardware register.

Signed-off-by: Keith Packard <keithp@keithp.com>
2026-03-04 14:28:47 +00:00
Hoang Nguyen
e42c9ac45c drivers: serial: Add support for Renesas RZ/G3E
Add serial driver support for Renesas RZ/G3E

Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-03-03 13:28:32 +01:00
Fabin V Martin
20630ff455 drivers: uart: microchip: sercom g1: code improvements
Some naming changes and removed redundant code.

Signed-off-by: Fabin V Martin <Fabinv.Martin@microchip.com>
2026-03-02 11:00:26 +01:00
Khoa Tran
dc4e092830 drivers: serial: Initial SAU UART driver support for Renesas RA0 series
Initial SAU UART driver support for Renesas RA0 series

Signed-off-by: Khoa Tran <khoa.tran.yj@bp.renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2026-03-02 10:48:45 +01:00
Pete Johanson
4f1956a130 drivers: serial: More complete TX errata fix for MAX32
Some MAX32 targets may fail to raise TX half/almost empty interrupts,
so add an optional workaround for those scenarios to ensure no missed
TX completion when using the interrupt API.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-02-27 21:09:31 +00:00
Ayush Singh
f5e5e5f4f1 serial: cc13xx_cc26xx: Fix TX interrupt
In cc13xx_cc26xx, the TX interrupt seems to be generated once initially on
enable and subsequently, when buffer goes from full to empty (since we are
operating in 1-byte buffer mode).

Due to this, if the TX interrupt is cleared in the configure function, a
new TX interrupt will not be generated untill we transition from a full to
empty buffer, even though the buffer itself is empty.

When using Zephyr Interrupt-driven UART API, one first needs to enable TX
interrupts `uart_irq_tx_enable()`, and then write data from the interrupt
callback, after checking `uart_irq_tx_ready()`. In case of cc13xx_cc26xx,
calling `uart_irq_tx_enable()` unmasks the TX interrupt, however, it will
not generate a new TX interrupt. Thus the callback will not be called
unless we first write something to the uart (using polling-API), causing a
transition in buffer state.

According to TI docs, writing 1 byte to the buffer will also clear the
TX interrupt, so it does not make sense to try clearing the interrupt
manulally in `configure` function.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2026-02-27 07:58:45 +01:00
Brett Peterson
cd4e2c88c0 drivers: serial: uart update for dma
Updating UART driver to work with recent dma driver changes.

Signed-off-by: Brett Peterson <brett.peterson@infineon.com>
2026-02-26 21:24:20 +00:00
Quy Tran
e35a33a298 drivers: serial: Add support for group interrupt in the serial driver
Apply the grp irq support in serial driver for MCB-RX26T

Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
2026-02-25 13:02:41 +01:00
Tahsin Mutlugun
a36ab08276 drivers: serial: uart_max32: Add runtime power management support
Refactor MAX32 UART driver to use pm_device_driver_init so that the
device is moved to the appropriate power state expected by the system
during initialization.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2026-02-24 13:52:15 +01:00
Tahsin Mutlugun
7d2396d876 drivers: serial: uart_max32: Add PM policy constraints
Add PM policy constraints so that UART driver can prevent the system
going to sleep before all characters are sent or received.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2026-02-24 13:52:15 +01:00
Michal Smola
f5c65899dc drivers: nxp: Allow usage of clocks without subsystem name
Several NXP drivers require clock control subsystem name definition in
Devicetree. It prevents usage of clock control without subsystem such
as fixed-clock. fixed-clock can be used for early SoC enablement when
complete clock controller is not available or not required.
Allow optional usage of clock control without subsystem by using 0 as
subsystem name if the name is not defined in devicetree. Add the option
for port, i2c, spi and serial drivers.

Signed-off-by: Michal Smola <michal.smola@nxp.com>
2026-02-23 16:59:01 +00:00
Fiona Behrens
e4068f8757 soc: nuvoton m48x: use numaker reset driver for uart
Use the numaker reset driver for the reset in the numicro uart driver.

Signed-off-by: Fiona Behrens <me@kloenk.dev>
2026-02-23 08:48:43 +01:00
Fabin V Martin
4f95b4d152 drivers: uart: microchip: sercom g1: refactor code
Changes added to make g1 driver to be used across multiple
SoC's and also avoids use of multiple SOC symbols in the
source file for selecting between the similar but differently
named macros and reg definitions across multiple DFP's.

Signed-off-by: Fabin V Martin <Fabinv.Martin@microchip.com>
2026-02-20 10:31:08 -08:00
Pete Johanson
9a175efbe6 drivers: serial: Disable async support on MAX32 RV32
MAX32 RV32 core DMA support is still a WIP, so disable async API for now
there.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-02-20 07:03:31 +01:00
Yuzhuo Liu
3cf997ed6c drivers: serial: add realtek bee serial driver
Add realtek bee serial driver.

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-02-17 15:22:38 +00:00
Mathieu Choplain
a11688fab5 drivers: *: stm32: don't check if clock device is ready
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-02-13 18:59:16 +00:00
Elmo Lan
a4465cfe28 drivers: uart: ns16550: clear TX and RX FIFOs when initial
Clear the TX and RX FIFOs to ensure a clean state.
Without this reset, residual data or incomplete
characters from a previous session or the bootloader could remain
in the hardware buffers.

Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
2026-02-13 18:56:41 +00:00
Krzysztof Chruściński
245cd21b0d drivers: serial: nrfx_uarte: Fix wrong endif use
Preprocess endif should be before return so that uarte_periph_enable
returns always when asynchronous API is used. It leads to faulty
behavior in certain configurations.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-02-13 13:55:53 +01:00
Nikodem Kastelik
3171e65045 drivers: gppi: cleanup some resources before conn alloc
Some of the peripherals might be used in the bootloader
and not cleaned up properly for the next image in the boot chain.
Ensure that affected registers are always cleaned up before use.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2026-02-12 14:26:44 +00:00
Tim Pambor
2bef40ef78 drivers: serial: uart_shell: avoid utilization of C23 extension
Fix warnings reported by clang about the use of a C23 extension about
usage of a label at the end of a compound statement.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-02-11 15:04:40 -06:00
Rob Barnes
da79ce7c80 drivers: serial: stm32: fix C23 extension usage in uart_stm32_dma_rx_flush
Moving the declaration of half_pos out of the switch case to avoid
C23 extensions that cause build failures in some environments.

BUG=None
TEST=None

Signed-off-by: Rob Barnes <robbarnes@google.com>
2026-02-11 15:03:49 -06:00
Krzysztof Chruściński
44bbc13394 drivers: serial: nrfx_uarte: Handle unexpected RXTO events
In some cases UARTE peripheral is generating RXTO events together with
ENDRX events. Those events are unexpected and should not be handled.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-02-09 15:59:02 +01:00
Krzysztof Chruściński
13e4b7a3ff Revert "drivers: serial: nrfx_uarte: Workaround for spurious RXTO during restart"
This reverts commit c58ae7467b.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-02-09 15:59:02 +01:00
Ayush Singh
27ee07a66c drivers: serial: ns16550: Enable interrupts only if defined
It is possible that some uart devices ns16550 do not support interrupts.
As an example, using main domain uarts from mcu domain m4f core in AM62
processors does not support uarts.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2026-02-06 08:53:07 -06:00
Muhammad Waleed Badar
0bb2943334 drivers: uart: add pinctrl support for bcm2711 aux uart
Add pinctrl support to the bcm2711 aux UART driver to allow
uart pin configuration via the pinctrl driver.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-02-06 08:52:07 -06:00
Hau Ho
36be3745de drivers: serial: Support serial driver for RX140 SoC
Modify driver code to adapt with RX140 SoC

Signed-off-by: Hau Ho <hau.ho.xc@bp.renesas.com>
2026-02-06 11:09:14 +01:00
Krzysztof Chruściński
53efd4818c drivers: serial: nrfx_uarte: Fix compilation with deprecated option
Recent changes (6e65fbe585) deprecated Kconfig configuration for
TIMER that is used for bytes counting. In one place code was not
cleared correctly which results in compilation failure when
deprecated symbol is used.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-02-05 13:03:08 +00:00
Benjamin Cabé
1274be64ad drivers: serial: use proper essential type in boolean variables assignments
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-02-05 10:20:22 +00:00
Wilfried Chauveau
0d48949589 drivers: serial: uart_cmsdk: apply clang-format
Following the last change, a clang-format pass is required.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2026-02-04 13:56:48 +01:00
Wilfried Chauveau
f63344cf4f drivers: serial: uart_cmsdk: remove code duplication
This change makes the driver rely on DT_INST_FOREACH_STATUS_OKAY(...)
rather than copy-paste the same code several time.
This also has the advantage of allowing more that 5 instances of this
uart driver.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2026-02-04 13:56:48 +01:00
Bernardo Perez Priego
9ae9d167e3 serial: uart_mchp_xec: fix TX complete status check
Fix the logic in `uart_xec_irq_tx_complete` when evaluating the UART line
status register against the TX-empty mask. The previous condition could
report "TX complete" even when the TX path was not fully empty, which can
cause flush users to loop or make incorrect progress decisions.

This change corrects the comparison against the TX-empty mask so that the
function only reports completion when the hardware indicates the expected
empty state.

Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
2026-02-04 13:53:23 +01:00
Marcelo Roberto Jimenez
ebdbab5b52 drivers: serial: uart_shell.c: Enhance the uart shell
This patch enhances the UART shell by:

- Adding a config command to display the UART configuration;
- Displaying the current configuration when the command misses the last
  parameter (usefull for command line editing).

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2026-02-03 12:12:53 +00:00
Krzysztof Chruściński
6e65fbe585 drivers: serial: nrfx_uarte: Refactor byte counting with TIMER
Some time ago a receiver mode for newer SoCs was introduced. It is
using TIMER to count RX bytes via PPI. Due to changes in the system
behavior it is not the same implementation as the one used on
legacy targets (nRF52x, nRF53x and nRF91x). New implementation is
using the Device Tree to assign a TIMER instance and old feature was
using Kconfig which is now obsolete and error prone since it is
easy to get resource usage conflict is some instances are managed
in Device Tree and some in Kconfig.

As a result to reliably receive data without HWFC user had to use
different configuration depending on the target.

Legacy implementation was using nrfx_timer and new one used HAL.

Patch attempts to align better those two similar but different
implementations by:
- deprecating Kconfig symbols for selecting TIMER instance in favor
  of the Device Tree
- extracting common part like PPI initialization and some control
 block fields
- Using TIMER HAL in both implementations.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-02-03 12:12:41 +00:00
Krzysztof Chruściński
7979d37f42 drivers: serial: nrfx_uarte: Fix short RX buffers handling
Interrupt handler was handling events in a following order:
ENDRX, RXSTARTED, RXTO. This could lead to error if RX buffer
is short then with high baudrate RXSTARTED for the current
buffer could be handled together with ENDRX and in that case
uart_rx_buf_rsp called from RXSTARTED would return error as
reception is already finished due to handled ENDRX.

Reworking the driver to change that order to RXSTARTED, ENDRX,
RXTO.

Additionally, driver is optimize to only check HW events for
enabled interrupts. To achieve that, RX path interrupts are
all disabled then RX is disabled.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-02-03 12:12:41 +00:00
Krzysztof Chruściński
dba9997a50 drivers: serial: nrfx_uarte: Cleanup
Remove parts of implementation which are no longer in use.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-02-03 12:12:41 +00:00
Hoang Nguyen
5a9d20b4ed drivers: serial: renesas: Initialize p_reg in extended configuration
Initialize p_reg with the register base address from devicetree.

Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-02-03 09:29:36 +01:00