Commit graph

1871 commits

Author SHA1 Message Date
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
Pieter De Gendt
29c9b91340 drivers: serial: Place API into iterable section
Add wrapper DEVICE_API macro to all uart_driver_api instances.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-02 22:08:56 +00:00
Pieter De Gendt
84a3d1fd9f drivers: serial: uart_native: Do not change API at runtime
The UART API is known at compile time based on Kconfig options.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-02 22:08:56 +00:00
McAtee Maxwell
3024392d35 SOC: Remove config PINCTRL from xmc4xxx soc
- Move selection of CONFIG_PINCTRL from soc to individual
	  drivers
	- in accordance with issue #78619

Signed-off-by: McAtee Maxwell <maxwell.mcatee@infineon.com>
2024-12-02 22:05:16 +00:00
Rafał Kuźnia
ec1f662dc9 drivers: serial: nrfx_uarte: Fix endtx-stoptx property check
The UART_xyz_ENHANCED_POLL_OUT Kconfig was using an outdated property
for checking whether the peripheral has the endtx->stoptx short. The
property is now updated.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-12-02 18:18:39 +01:00
Flavio Ceolin
11aeddbbfa serial: uart_hostlink: Use __noinline macro
Use Zephy's toolchain definition instead of re-define here.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2024-11-30 01:04:11 +01:00
Alberto Escolar Piedras
fedda6d25c drivers serial nrfx: Apply workaround also for bsim targets
Or more precisely, do not remove the workaround for them.
The current HW models are accurate enough in this area for the
workaround to work properly.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-29 15:30:11 +01:00
Gerard Marull-Paretas
4f6de0169c drivers: microchip xec: select PINCTRL
All drivers using the pinctrl API must select the PINCTRL option.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-29 05:41:53 +01:00
Johan Hedberg
4053529658 drivers: serial: gecko: Add PINCTRL dependency
This driver should use PINCTRL also on Series 2 boards.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-11-26 15:42:02 -05:00
01a9061d67 drivers: add the ch32v00x usart driver
This commit adds the usart driver for WCH CH32V003.

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
Krzysztof Chruściński
13ed9e4210 drivers: serial: nrfx_uarte: Fix runtime PM for interrupt driven API
TX part of interrupt driven API was not calling PM device runtime
API. Additionally, when txstopped occurred after poll out it was
not handled correctly.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-26 10:36:21 +00:00
TOKITA Hiroshi
88149afff7 soc: raspberrypi: Drop PINCTRL from Kconfig.defconfig
The `Kconfig.defconfig` is not good place for put `select PINCTRL`.
Drop `select PINCTL` from `Kconfig.defconfig` and add it at each
driver's Kconfig.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-25 14:42:01 +01:00
Aymeric Aillet
d41ce536c5 drivers: rcar: Select CONFIG_PINCTRL
Select PINCTRL for drivers: pwm, sdhc, serial

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2024-11-22 17:41:02 +01:00
Krzysztof Chruściński
760bba6d24 drivers: serial: nrfx_uarte: Fix pin retention
b6d45423c6 Added support for pin retention but it was added
only to the case when device PM is used. There is another mode
in which UARTE is disabled when idle (low power mode) and in
that case pin retention must also be added.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-21 20:12:13 +01:00
cyliang tw
355d032baa boards: nuvoton: numaker: Drop PINCTRL from board defconfig
To remove CONFIG_PINCTRL from board side for numaker boards.
The Drivers using Pinctrl should be turning Pinctrl on
instead of the responsibility of the board.

Fixes #78619

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2024-11-20 08:23:58 -05:00
TOKITA Hiroshi
183273ed3f dts: arm: renesas: ra4: Use renesas,ra-cgc-pclkblock driver
Switch the clock controller driver to renesas,ra-cgc-pclkblock
which can be used with FSP.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
Rafał Kuźnia
e18410944e modules: hal_nordic: add NRFX_GPPI config
The nrfx_gppi module is an abstraction over nrfx_ppi and nrfx_dppi
drivers. It now has a Kconfig option that is separate from nrfx_dppi and
by default it enables all PPI/DPPI instances, if available.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-11-19 09:53:10 -05:00
Pisit Sawangvonganan
3a6e36d548 drivers: serial: stm32: make poll-out function to pass data by value
Passing data by value is more efficient in this context. As such,
revise `poll_out_fn` and `uart_stm32_poll_out_visitor` to accept
the `out` argument by value instead of by address.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-18 19:30:17 -05:00
Ryan McClelland
36772a8889 drivers: serial: cdns: fix interrupt driven uart
The tx fifo empty interrupt is a edge driven interrupt, so if it
is already empty then and the interrupt is enabled, it will not
fire so the isr needs to be triggered manually for the callback.

This also removes the unnecessary interrupt locking in the isr and
removes the receiver timeout interrupt.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-16 15:26:24 -05:00
Ian Morris
44477ad732 drivers: serial: fix renesas ra8 sci_b uart hardware flow control enable
Fixed typo in Renesas RA8 SCI_B UART configuration that was preventing
hardware flow control from being enabled.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-11-16 15:23:24 -05:00
Sven Ginka
fe4215462d soc: sensry: udma, pad renaming
Before that fix the names for UDMA could be misleading.
With that fix the namespace is clear and easy to follow.
Same applies for peripheral addresses and pad config.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2024-11-16 15:06:43 -05:00
Krzysztof Chruściński
ed5ce47437 drivers: serial: nrfx_uarte: Fix RX path without low power modes
RX FIFO flushing on RXTO event should only be performed when
UARTE peripheral might be disable during inactivity and that
happens when low power modes is enabled or when device runtime
PM is used. Flushing was incrementing flush_cnt which was not
used (flushed data is not copied to the next buffer) which
was causing data loss and invalid RX data length reporting.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-16 14:55:43 -05:00