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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>