Commit graph

1,992 commits

Author SHA1 Message Date
Krzysztof Chruściński
1573be5e9f drivers: serial: nrfx_uarte: Rename FAST to FAST_PD
Rename UARTE_ANY_FAST to UARTE_ANY_FAST_PD. There are 2 types of
'fast' UARTE instances. In nrf54h20 instance uart120 is in fast
power domain that requires additional power and clock management
of that domain. In nrf54lx fast uart00 instance does not require
that. Add _PD to indicate fast power domain.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-02-03 11:17:31 +01:00
Ajay Neeli
b7d13ea6ca serial: xilinx: uartlite: update irq_enable to use DT_INST_IRQN_BY_IDX
Update the irq_enable macro to use the DT_INST_IRQN_BY_IDX helper.

This ensures proper handling of IRQ numbers in systems with multi-level
interrupt configurations.

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
2025-02-03 09:05:19 +01:00
Martin Hoff
2594eae6f1 drivers: uart: silabs: revert pm deletion for usart_gecko
Revert delete of the uart_gecko_pm_action function.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-01-31 19:51:27 +01:00
Jamie McCrae
560db8509a drivers: kconfig: Fix bleeding options
Fixes a multitude of Kconfigs that wrongly appear on devices
where support is literally impossible

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-01-31 11:50:12 +01:00
Nazar Palamar
fb1c9c880f drivers: serial: CAT1 UART driver: add ASYNC_API functionality
Add ASYNC_API functionality

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2025-01-30 02:00:50 +01:00
Peter Johanson
484fb29f5f drivers: serial: Pico PIO UART wait for initial high
Adjust the PIO assemble for the UART RX to wait for the line
to initially be high before starting the wrap loop and wait
for a low start bit.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2025-01-27 21:03:48 +01:00
Pieter De Gendt
f1c4760304 drivers: Update APIs to use DEVICE_API macro
Some drivers APIs were not wrapped using the DEVICE_API macro.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-01-24 01:15:19 +01:00
Yishai Jaffe
12240a9058 shell: uart: add write command
Added a command to write to a uart device.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2025-01-23 16:30:39 +01:00
Yishai Jaffe
1709731c5c shell: uart: fixed indentation
Fixed indentation to match line above.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2025-01-23 16:30:39 +01:00
Xudong Zheng
020cb79d27 drivers: serial: nrfx_uarte: move DEPRECATED_UART_NRFX_UARTE_LEGACY_SHIM
The Kconfig option should be defined alongside
UART_NRFX_UARTE_LEGACY_SHIM for clarity.

Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2025-01-23 08:26:33 +01:00
Martin Hoff
576e475558 driver: serial: silabs: Change PM Device definition order
Change the definition order of the PM Device to fix the build error.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-01-22 15:50:14 +01:00
Paul Wedeck
fda64760ba drivers: uart_wch: Fix compiler warning
This commit removes an unused variable.

Signed-off-by: Paul Wedeck <paulwedeck@gmail.com>
2025-01-21 19:30:53 +01:00
Martin Hoff
1318f1543c driver: serial: split silabs series 2 and series 0/1 boards usart driver
Split the USART driver into separate implementations for Silabs Series 2
and Series 0/1 boards. This change improves maintainability (especially
with the support of pin-ctrl and clock-ctrl on series 2 boards).

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-01-21 19:29:25 +01:00
Sven Ginka
a89b81b110 drivers: serial: sy1xx add support for pinctrl
Add pin ctrl to the serial driver.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-01-21 19:29:14 +01:00
Declan Snyder
d02c48ee8d uart_mcux_lpuart: LPFlexcomm inst based determine
Since some platforms may have some lpuart that are wrapped in lpflexcomm
and some that are not, then change the init code to determine how to
connect the interrupt on an instance basis.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-01-21 19:28:01 +01:00
Tahsin Mutlugun
2d59b75d69 drivers: serial: uart_max32: Use cache to workaround DMA limitation
When using asynchronous API, transfer will fail if the source buffer is
located in a region that cannot be accessed by DMA. This could happen
when a buffer is declared const, and placed in flash memory, for
example.

Workaround this problem by loading the data into a set of temporary
caches before passing them to DMA.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-01-21 09:13:34 +01:00
Tahsin Mutlugun
50596320d4 drivers: serial: uart_max32: Add async mode support
This commit adds asynchronous mode support to MAX32 UART driver. Each
direction uses a single DMA channel that is assigned in devicetree
configuration.

Asynchronous mode also depends on interrupts to refresh receive
timeouts.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-01-21 09:13:34 +01:00
Nhut Nguyen
5a65c861a7 drivers: serial: Add interrupt-driven API support for RZ/G3S
This commit is to support UART interrupt-driven API for Renesas RZ/G3S.

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2025-01-21 09:12:15 +01:00
Jun Lin
2615ec879e driver: serial/uart: npcx: disable rx interrupt at init
In the application, after the sysjump, the RX interrupt might remain
enabled. During initialization, once the IRQ is enabled, the RX
interrupt could be triggered if there is any traffic on the RX line,
potentially causing an interrupt storm.

This change disables the UART RX interrupt at the driver initialization
to prevent this issue from occurring.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2025-01-21 07:07:47 +01:00
Yishai Jaffe
f36b7cfe36 drivers: serial: uart_gecko: add runtime configuration
Added support for runtime configuration of the baudrate

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2025-01-16 22:38:15 +01:00
Yishai Jaffe
1cbd13cd0e drivers: serial: uart_gecko: support uart_cfg options
Adde usage of uart_cfg struct and support its options of parity, data
bits, and start bits

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2025-01-16 22:38:15 +01:00
Yishai Jaffe
d5c0d7acdd drivers: serial: gecko: add new driver UART communication via EUSART
Added a new driver to support UART communication via EUSART.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2025-01-16 22:37:40 +01:00
Yishai Jaffe
0df6736bb9 drivers: serial: define default values for basic options
Defined default values for baudrate, parity, stop bits, and data bits.
This removes complexity and obfuscation from the code.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2025-01-15 19:04:56 +01:00
Nazar Palamar
415cc17c54 drivers: ifx_cat1: Updates to support latest version of HAL/PDL
- Refactoring to support latest versions of HAL/PDL

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2025-01-14 20:49:14 +01:00
Gerson Fernando Budke
ea7922195b clocks: atmel: sam0: Fix gclk and mclk clock bindings
The Atmel SAM0 SoC enable peripherals clocks in distinct places: PM and
MCLK. The old devices had defined the peripheral clock enable bit at PM.
On the newer devices this was extracted on a dedicated memory section
called Master Clock (MCLK). This change excludes the dedicated bindings
in favor of a generic approach that cover all cases.

Now the clocks properties is complemented by the atmel,assigned-clocks
property. It gives the liberty to user to customize the clock source
from a generic clock or configure the direct connections.

All peripherals drivers were reworked with the newer solution.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2025-01-14 20:49:03 +01:00
Krzysztof Chruściński
70118c06a5 drivers: serial: nrfx_uarte: Deprecate non-legacy shim
Some time ago a new shim for nRF UARTE was added (uart_nrfx_uarte2.c)
which used nrfx_uarte.c driver underneath. It was supposed to support
nrf54x platforms. However, later on legacy driver (uart_nrfx_uarte.c)
was extended to support nrf54x platforms and it takes less code size,
has better performance and more features. Shim uart_nrfx_uarte2 will
no longer be supported. As new shim is the default and there is a
Kconfig to pick the legacy shim (CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=y)
it cannot be deprecated in the normal way. Additional Kconfig option
is created (DEPRECATED_UART_NRFX_UARTE_LEGACY_SHIM) which is enabled
if CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=n and it selects DEPRECATED.
A warning was also added to the CMakeLists.txt.

Patch removes use CONFIG_UART_NRFX_UARTE_LEGACY_SHIM in tests.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-01-14 13:23:32 +01:00
Scott Worley
cbf867ff2c drivers: serial: mec5: Microchip MEC5 UART serial driver
We add a serial UART driver for Microchip MEC5 HAL based chips.
The driver supports polling, interrupts, and runtime configuration
features. Power management will be implemented in a future PR.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2025-01-10 18:58:58 +01:00
Fabrice DJIATSA
450e63ea7a drivers: serial: add circular mode in uart driver
the following implementations are added:
- set cyclic variable to handle circular/normal mode :
  enable dest/source_reload_en variable to set CIRC bit to 1 for RX or TX.
- DMA_STATUS_COMPLETE(0), DMA_STATUS_BLOCK(1) macros to handle half
 and full irq
- add ASYNC_UART_STATUS_TIMEOUT(3)  macro to work with  default mode
- add status input in uart_stm32_dma_rx_flush function  to handle
 async events depending on the  mode we are in.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
co-authored-by: Cyril Fougeray <cyril.fougeray@worldcoin.org>
2025-01-10 11:58:18 +01:00
Lin Yu-Cheng
a3c0b03915 driver: serial: Add UART driver initial version of RTS5912.
Add UART driver for Realtek RTS5912.

Signed-off-by: Lin Yu-Cheng <lin_yu_cheng@realtek.com>
2025-01-10 11:58:02 +01:00
Dong Wang
6ab5c00336 drivers: sedi: Update device definition macros to use DT_INST variants
Updated various device definition macros to use the DT_INST variants for
consistency and improved readability.

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2025-01-08 19:10:52 +01:00
Krzysztof Chruściński
e9f9cc605a drivers: serial: nrfx_uarte: Request hsfll clock for fast instance
Request fast global domain to run at 320 MHz during fast UARTE
activity. As request is asynchronous it cannot be called from
an ISR. Due to complexity to handle that without device runtime
power management a requirement is added so that if fast UARTE
is used device runtime PM must be enabled. Clock is request
and released in PM resume and suspended actions which in case
of fast UARTE are only called from thread context.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-01-08 19:09:57 +01:00
WenBin Zhang
59b1bb2059 driver: Add uart_emul work queue thread name
Add thread names to make debugging easier.

Signed-off-by: WenBin Zhang <freey7955@gmail.com>
2025-01-08 01:29:39 +01:00
Jilay Pandya
da241fe722 drivers: serial: uart_async_to_irq.c check if baudrate is not zero
assert if baudrate is not zero in order to avoid division by zero error

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-01-07 00:26:56 +01:00
TOKITA Hiroshi
afd16b9e07 drivers: serial: pl011: Enable PINCTRL conjuction with dt prop 'pinctrl-0'
If there is a pinctrl-0 property, PINCTRL will be enabled in
conjunction with it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-01-07 00:26:37 +01:00
Paul Wedeck
7405a25b58 drivers: uart_wch: add interrupt-driven device bindings
Currently, the uart_wch driver only supports the polling API.
This patch introduces bindings for the interrupt-driven API.

Signed-off-by: Paul Wedeck <paulwedeck@gmail.com>
2025-01-06 22:36:20 +01:00
Yishai Jaffe
6ba0563fe2 shell: uart: added shell command
Added shell command for UART. Currently only able to set baudrate and
flow control.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2025-01-06 20:34:52 +01:00
Krzysztof Chruściński
19526795c6 drivers: serial: nrfx_uarte: Fix low power mode for interrupt driven API
Low power mode for non-asynchronous API case is only available when
RX is not used (RX pin is not defined). In that case TX starting
function was using uarte_enable_locked() which tracks if UARTE is
used by TX or RX and TXSTOPPED interrupt was disabling UARTE
unconditionally. Because of that following attempt to TX start
was assuming that UARTE is already enabled when it was disabled.
Fixing it by using uarte_disable_locked function in TXSTOPPED
handling.

Code reordering was required to make uarte_disable_locked()
available earlier.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-01-02 16:03:59 +01:00
Raffael Rostagno
a7e08cc16b drivers: serial: esp32: Standard baudrate on config_get
Return standard baudrate on a uart_config_get call instead of
rough calculated numbers.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-12-19 19:56:06 +01:00
Rafał Kuźnia
6f6402418a drivers: serial: nrfx_uarte: Fix bool endtx-stoptx prop check
The dt_nodelabel_bool_prop must be used to check for a boolean property,
not the dt_nodelabel_has_prop. Using the latter caused the
UART_X_ENHANCED_POLL_OUT condition to be not fulfilled, despite the
fact that the property was not set on nRF52840 and nRF91.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-12-17 17:52:26 +01:00
Bjarki Arge Andreasen
7487eabd33 drivers: serial: nrfx_uarte: rm NRF_GPD_FAST_ACTIVE1 build assert
The assert BUILD_ASSERT(NRF_GPD_FAST_ACTIVE1 == 0); is not correct
given that NRF_GPD_FAST_ACTIVE1 is defined as 1U, and is not used
in the file anyway. Remove the build assert.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-12-17 15:22:37 +01:00
Pieter De Gendt
a0eb112774 drivers: Move device driver APIs into iterable sections
These device driver APIs were merged after the DEVICE_API macro was
introduced.
Cleanup these leftover drivers.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-17 02:02:54 +01:00
Marcio Ribeiro
f0516ead27 drivers: uart: esp32: reset tx fifo during driver init
Resets uart tx fifo during driver initialization to have a well defined
initial condition mainly preventing unwanted characters being sent

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-12-14 01:03:16 +01:00
Nhut Nguyen
c1fb75b616 drivers: serial: Add polling mode support for RZ/G3S
This is the initial commit to support UART driver for Renesas RZ/G3S.
The driver only implements polling API for minimal support.

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Signed-off-by: Binh Nguyen <binh.nguyen.xw@renesas.com>
2024-12-12 11:12:22 +01:00
Manuel Argüelles
f85f8ee88e dts: bindings: rename nxp,kinetis-lpuart compatible
Rename "nxp,kinetis-lpuart" compatible to "nxp,lpuart" to remove the
device family from its name.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-12-11 08:00:30 +01:00
Krzysztof Chruściński
c8d50e4ef1 drivers: serial: nrfx_uarte: Add support for non ISR PM mode
When fast UARTE instance is used (e.g. UARTE120 in nrf54h20), PM actions
are not ISR safe because they include communication over IPC so they can
only be called from the thread context. Extend driver to support both
PM modes. When non ISR mode is used then uart_rx_enable() and uart_tx()
will return error if they are called from ISR and resume operation
would need to be called because device is suspended. On completion,
driver is calling pm_device_runtime_put_async which can be called from
the ISR context.

Additionally, suspending in the TXSTOPPED and RXTO events has been
moved after user callback. It allows to support the case where
uart_rx_enable() or uart_tx() are called from that callback context.
Since suspending is called after returning from the callback it will
not trigger suspend action because API called in the callback context
will increment the usage counter (when pm_device_runtime_get() is
called).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-09 22:05:03 +00:00
Krzysztof Chruściński
384e940c66 drivers: serial: nrfx_uarte: Deprecate CONFIG_UART_x_NRF_HW_ASYNC
Deprecate mode which is using TIMER+(D)PPI for reliable byte counting.
Recently a new approach is added (CONFIG_UART_NRFX_UARTE_ENHANCED_RX)
which supports reliable byte counting without additional HW resource.
This mode is planned to be the only supported RX path mode.

Enhanced RX has slightly different behavior. There are no partial RX
packets (events with non-zero offset). There is UART_RX_BUF_RELEASED
after each UART_RX_RDY event.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-06 12:14:02 +01:00
Ilya Tagunov
4a92220de0 drivers: serial: ns16550: select PINCTRL if necessary
The NS16550 driver may use pinctrl configuration if it's provided
for the nodes.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-12-06 12:13:45 +01:00
Gerard Marull-Paretas
813fc4d6bb drivers: all: cc12xx_cc26xx: select PINCTRL
select PINCTRL when needed instead of relying on board-level options.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-05 15:18:01 +01:00
Gerard Marull-Paretas
f3a125e018 drivers: all: telink-b91: select PINCTRL
Select PINCTRL as needed.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-05 15:17:47 +01:00
Pieter De Gendt
c896dd370e drivers: serial: Move esp32 serial UART API from DRAM to ROM
The API was placed in RAM to support logging stack unwinding, however
device instances are also placed in ROM, so should the API instances.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-02 22:08:56 +00:00