Commit graph

1933 commits

Author SHA1 Message Date
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
Hao Luo
1f95b06c95 drivers: uart: ambiq: fix incorrect uart tx ready status
This commit fixes incorrect uart tx ready status

Signed-off-by: Hao Luo <hluo@ambiq.com>
2025-09-11 09:55:05 +02:00
Khoa Nguyen
db981f65e9 drivers: Add assign event for current core for all Renesas drivers
Add assign event for current core for all Renesas drivers

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-09-11 09:53:13 +02:00
Aditi Bhaskar
2d854b3e50 Drivers: UART pdl-based driver bug fixed
- Resolved failure in uart_basic_api test (rx now handled)
 - Fixed interrupt mask configuration in uart-pdl driver
 - Removed redundant irq handling functions

Signed-off-by: Aditi Bhaskar <aditi.bhaskar@infineon.com>
2025-09-10 22:43:32 -04:00
Mickael Bosch
bfea9cf94f drivers: serial: stm32: fix non-LP UARTs with PM
Re-configure the registers if they re erased because of a STOP2 low power
mode.

Return the error code when re-initializing the UART after a STANDBY low
power mode.

Fix few typos and comments.

Run clang format on uart_stm32_pm_action()

Signed-off-by: Mickael Bosch <mickael.bosch@linux.com>
2025-09-03 17:05:17 +02:00
Benjamin Cabé
0132ea07fb doc: fix spelling errors tree-wide
fix some spelling errors in code comments and Kconfig helps

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Gerson Fernando Budke
6bdd63fe93 drivers: serial: sam0: Fix rx ready
The uart_sam0_irg_rx_ready() function always returns true, even if
interrupt is disabled. This happens because the function do not
evaluate if the interrupt is enable of not. This fixes the issue
by adding the missing check.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2025-09-01 16:56:36 +01:00
Aksel Skauge Mellbye
b83267dba0 drivers: serial: silabs_usart: Fix configure error cases
Enable uart_elementary test and fix edge cases where the
configure function did not return the appropriate error code
when given invalid parity or flow control parameters.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-08-28 00:40:11 +02:00
Raffael Rostagno
d1ecc51dcd drivers: uart: esp32h2: Add support
Add UART support for ESP32-H2.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-08-26 22:07:36 +02:00
Kamil Krzyżanowski
db15de5274 drivers: serial: stm32: fix race condition when both APIs enabled
Fix a bug where if CONFIG_UART_ASYNC_API was enabled in the config, the
interrupt flags would get cleared after the interrupt driven API callback
finished executing, causing data loss if data happened to arrive after the
callback but before the flags were cleared.

Signed-off-by: Kamil Krzyżanowski <kamnxt@kamnxt.com>
2025-08-22 16:51:17 +02:00
Krzysztof Chruściński
5e838284ab drivers: serial: nrfx_uarte: Add support for device deinit
Add device deinit function. Support is optional as it is not widely
used and it enables pinctrl sleep state so it impacts memory footprint.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-08-22 12:35:42 +02:00
Jake Greaves
ba4bb91b1b drivers: serial: STM32U5 series lpuart
Allow LPUART to function and wakeup the device from STOP modes

Signed-off-by: Jake Greaves <jake.greaves@analog.com>
2025-08-21 17:13:36 +02:00
Camille BAUD
eab94972ed drivers: uart: Update bflb uart driver for BL70x
BL70x almost equal BL60x here

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-08-20 16:30:48 +02:00
Tim Pambor
120f5a073c serial: uart_native_pty: IRQ support
Add support for the interrupt-driven API. Interrupts are
emulated using a polling thread.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-08-19 19:14:21 +02:00
Jackson Farley
bfdfa2086f serial: Add error checking and interrupt support on mspm0 driver
It is now possible to enable CONFIG_UART_INTERRUPT_DRIVEN for mspm0
uart driver.

Signed-off-by: Jackson Farley <j-farley@ti.com>
Co-authored-by: Hans Binderup <habi@bang-olufsen.dk>
2025-08-19 19:13:34 +02:00
Joel Guittet
3e3ceeae49 drivers: serial: add uart-bitbang support
Initial support for uart bitbang driver.

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
2025-08-19 19:13:19 +02:00
Sri Surya
acdf69be17 drivers: serial: pl011: Add support for Ambiq Apollo2 SoC UART
Added UART Support for Apollo2 SOC and cleanup.

Signed-off-by: Sri Surya <srisurya@linumiz.com>
2025-08-19 18:00:41 +02:00
Eden Frosst
0598b2cc81 drivers: serial: stm32: propagate baud rate config failure
The uart_stm32 driver gives no way for a user to
tell if setting a new baud rate was successful.
Propagate error checks up to the API level.

Signed-off-by: Eden Frosst <edenfrosst@gmail.com>
2025-08-18 21:59:59 +02:00
Tim Pambor
e4e5e7adc8 drivers: uart: emul: Fix uninitialized variable errors
Fix compiler errors about variables potentially being used uninitialized.
These are false positives, as the compiler is confused by the
K_SPINLOCK() macro. Explicit initialization avoids these errors.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-08-14 15:49:49 +02:00
Mike J. Chen
4e0e3c990d drivers: dma: dma_mcux_lpc: fix src_inc/dst_inc for block chain
The dma driver was determining src_inc and dst_inc from the
config of the first block buffer and ignoring the config
flags for any additional buffers in the chain, which could
lead to incorrect transfers (e.g. in a multiple rx buffer
case, if the first buffer was to receive to NULL,
but the subsequent buffers were not NULL, the bug
would manifest as all transfers being made with
dst_inc of 0). Change the driver to setup
each dma descriptor according to the addr_adj flag
of each block_buffer.

Add check that peripheral transfers have addr_adj set to
NO_CHANGE instead of assuming it, to help catch errors.

Also now check for invalid addr_adj request of
decrement, which this controller doesn't support.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-08-13 11:08:21 +01:00
Henrik Brix Andersen
1d45e17037 Revert "serial: uart_native_pty: IRQ support"
This reverts commit df1e6f5290.

Fixes: #94425

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-08-12 20:33:02 -04:00
Tim Pambor
df1e6f5290 serial: uart_native_pty: IRQ support
Add support for the interrupt-driven API. Interrupts are
emulated using a polling thread.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-08-12 21:33:00 +02:00
Phi Tran
6966f0a910 drivers: uart: Update sci uart for support RX261
This commit to update sci uart for support RX261

Signed-off-by: Phi Tran <phi.tran.jg@bp.renesas.com>
2025-08-11 12:48:35 +03:00
Sunil Abraham
fe830c5c16 drivers: uart: microchip: add minimal support for sercom uart g1 IPs
Add uart driver with minimal features.
Implement polling receive and transmit functionality.

Signed-off-by: Sunil Abraham <sunil.abraham@microchip.com>
2025-08-08 11:52:35 +03:00
Khoa Nguyen
3aa72e4e9e drivers: Update p_context for all Renesas drivers
The p_context no longer has the const type, so all
Renesas-supported drivers need to be updated accordingly.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-08-08 11:52:13 +03:00
Sreeram Tatapudi
600e86d475 drivers: serial: Adding PDL based UART driver
Adding a basic UART driver based on the PDL API

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-08-04 19:57:57 +01:00
Camille BAUD
bdffc08279 bflb: Make BL60x independant from SDK
Reorganize and update soc folder files for SDK-independance
Reorganize and update hal_bouffalolab files for SDK-independance
Reorganize and update soc dts files for SDK-independance
Update serial and pinctrl driver files for SDK-independance
Update ai_wb2_12f, bl604e_iot_dvk, and dt_bl10_dvk
to new bl60x support
and fixup openocd config of ai_wb2_12f

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-08-01 07:57:36 -04:00
Swift Tian
814ed6803f tests: fix arm_irq_vector_table fail on Ambiq platforms
Fixed build fail since 4c93fcd35b.
Fixed test run fail on Ambiq platforms.
Added Ambiq section in the test.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2025-07-30 07:27:19 -04:00
Bjarki Arge Andreasen
2b0d1ae4d0 soc: nordic: nrf54h: transition from gpd to zephyr pinctrl and pds
Transition nrf54h away from the soc specific gpd
(global power domain) driver which mixed power domains, pinctrl
and gpio pin retention into a non scalable solution, forcing soc
specific logic to bleed into nrf drivers.

The new solution uses zephyrs PM_DEVICE based power domains to
properly model the hardware layout of device and pin power domains,
and moves pin retention logic out of drivers into pinctrl and
gpio, which are the components which manage pins (pads).

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-07-29 09:03:37 -04:00
Michał Bainczyk
2e06c4ed20 drivers: nrf: add build asserts for memory-regions property
Add build asserts for "memory-regions" property in nrf drivers which is
required on targets with DMM for saadc, pdm, pwm, twim, twim_rtio, twis,
tdm, uarte, spim and spis. On targets where the property is not required
the assertion macro expands to nothing.

Signed-off-by: Michał Bainczyk <michal.bainczyk@nordicsemi.no>
2025-07-28 04:27:25 -04:00
Michał Stasiak
e8dd83b43d drivers: serial: nrfx_uarte: enable cross domain pins for nRF54L15
UARTE20 and UARTE21 instances enable usage of pins on different
port, but require request for constant latency mode. Added
handling of such scenario in the driver. Added testcase
to cover it.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2025-07-25 17:03:11 +01:00
Vytautas Virvičius
358e796374 drivers: serial: native_tty: change init priority
Change init priority from '55' to 'CONFIG_SERIAL_INIT_PRIORITY' to align
with how other serial devices are initialized.

Signed-off-by: Vytautas Virvičius <vytautas@virvicius.dev>
2025-07-25 07:45:19 -04:00
Vytautas Virvičius
e1eaa0e39e drivers: serial: native_tty: config_get support
This commit adds config_get support for native_tty. This is helpful as
some driver code (e.g. u_blox m8) will error out if they can't read the
current configuration.

Signed-off-by: Vytautas Virvičius <vytautas@virvicius.dev>
2025-07-24 02:47:59 -04:00
Fabio Baltieri
ad998d6f36 Revert "driver: serial: uart_ns16550: Add pm support for uart_ns16550 driver"
This reverts commit fd88386a9f, it breaks
uart support on ITE platforms when PM is enabled but PM_RUNTIME is not,
possibly others as well.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-23 17:16:40 +01:00
Jordan Yates
69acc016eb serial: nrfx_uarte: initial pin state to SLEEP
Configure the initial pin state of the UARTE peripheral to SLEEP, not
left uninitialised. This fixes the pin configuration not being set until
the interface is used if `zephyr,pm-device-runtime-auto` is enabled.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-07-21 07:22:38 -04:00
S Mohamed Fiaz
fd88386a9f driver: serial: uart_ns16550: Add pm support for uart_ns16550 driver
This commit enables the pm device runtime driver support
for the uart_ns16550 driver.

Signed-off-by: S Mohamed Fiaz <fiaz.mohamed@silabs.com>
2025-07-19 15:40:59 -04:00
Sylvio Alves
05316bd0ed drivers: uart: esp32: avoid pin re-configuration on uart_configure()
Ensure uart_configure() only updates UART parameters without
reassigning pin configuration. Pin assignment via pinctrl is now
restricted to the initialization procedure, guaranteeing pins are
set only when properly configured.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-07-19 13:23:29 -04:00
Alberto Escolar Piedras
13f1e92037 drivers/serial/TTY & PTTY: Remove NATIVE_APPLICATION support
It is not possible to build anymore in that mode, so we do not
need to support it in this driver cmake files.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-07-19 09:38:15 +02:00
Krzysztof Chruściński
08f14961fe drivers: serial: nrfx_uarte: Improve UART_NRFX_UARTE_ENHANCED_RX dependency
Enhanced RX cannot be used when UART_x_NRF_HW_ASYNC is used so changing
default value to depends on.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-07-17 12:46:31 -10:00
Krzysztof Chruściński
3c9389650e Revert "drivers: serial: nrfx_uarte: Deprecate CONFIG_UART_x_NRF_HW_ASYNC"
This reverts commit 384e940c66.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-07-17 12:46:31 -10:00
Krzysztof Chruściński
eb996924fb drivers: serial: nrfx_uarte: use ifdef instead of IS_ENABLED
In certain configurations timeout field is not present in the
data structure so preprocessor ifdef must be used instead of
compiler check.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-07-17 12:46:31 -10:00
Gaetan Perrot
f52d71c8cf drivers: serial: uart_sedi: Remove unused variable 'mask'
The variable 'mask' was declared but never used in
uart_sedi_line_ctrl_set().

This commit removes it to clean up the code..

No functional changes.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-14 11:18:45 -10:00
Lucas Tamborrino
79f599ace4 drivers: lp uart: fix initialization
Fix initialization after HAL update

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2025-07-10 16:01:11 -05:00