Guard the neorv32_uart_config_get() function to avoid compilation warning
with CONFIG_UART_USE_RUNTIME_CONFIGURE=n.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Fixes a regression caused by: 88830a3b
The ns16550 driver should handle possibility of
clock_control_on being a stub (i.e. returning ENOSYS)
Signed-off-by: Dominik Lau <dlau@antmicro.com>
Add serial driver support for RZ/N2L
Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
- For MCUX LPUART driver, added support to control RTS line
High/Low from other driver/app code.
- This control is required to wakeup other device which is
in sleep and configured its wakeup-source as UART-CTS line.
Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
Setting frame size and endianess is now supported in UARTE HAL,
so these settings must have default values configured
to avoid compiler warnings about uninitialized fields.
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
Rename the driver from uart_native_posix to uart_native_pty.
Including renaming the DTS compatible, and kconfig options, deprecating
the old ones.
And refactor the driver, generalizing it, so we can have any number of
instances.
Note that, unfortunately generalizing to N instances cannot be done
without a degree of backwards compatibility breakage: This driver was
born with all its configuration and selection of the instances based on
kconfig.
When the driver was made to use DT, it was done in a way that required
both DT and kconfig needing to manually coherently enable the 2nd UART.
This has now been fixed, which it means only DT is used to decide how
many instances are avaliable, and UART_NATIVE_POSIX_PORT_1_ENABLE is
just ignored.
Including:
* Deprecate UART_NATIVE_WAIT_PTS_READY_ENABLE: the options is always on
now as it has no practical drawbacks.
* Deprecate UART_NATIVE_POSIX_PORT_1_ENABLE: DTS intanciation defines it
being available now.
* Rename a few functions and in general shorten pseudo-tty/pseudo-
terminal to PTY instead of PTTY.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Update the NEORV32 SoC, peripheral drivers, and board to support NEORV32
v1.11.1. Notable changes include:
- Optional RISC-V ISA Kconfigs are now selected on the board level.
- Peripheral registers are now automatically reset in hardware, no need for
software initialization code.
- The NEORV32 GPIO controller now supports 32 pins, not 64. Interrupt
support will be submitted in a separate PR.
- Default board configuration has 64k RAM and is clocked at 18 MHz.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Adds one RX thread per instance. Previously, only one global RX thread was
used resulting in crashes due to the thread instance being overwritten by
other instances.
Signed-off-by: Nils Ruf <nils.ruf@endress.com>
Since the RA2L1 uses the macro "ICU_EVENT" instead of
"ELC_EVENT" (which is currently used) to input into
the IELSR register, the ek_ra2l1 board cannot assign
any interrupts for any driver.
This commit aim to correct the Event macro to input correct
value for IELSR register on all the Renesas SoC by using
"BSP_PRV_IELS_ENUM" macro.
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
Previously, 'USART_WCH_IRQ_HANDLER' used 'DT_INST_IRQ(index, priority)',
which incorrectly referenced 'index' instead of 'idx'. This issue went
undetected because 'IRQ_CONNECT' drops the priority value on all boards
supported by this driver.
Fix by using 'DT_INST_IRQ(idx, priority)'.
Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
Add a new Kconfig symbol (UART_SILABS_USART_ASYNC) to enable the async
API for the Silabs USART driver.
It is needed because the symbol (UART_ASYNC_API) is shared between uart
driver. In the case that you have multiple UART drivers enabled,
condition to enable async API for different uart driver may differ.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
Since the callback can be executed from either software or a hardware
interrupt, it's possible for multiple instances of the callback function
to run concurrently. That should not happen and can be particularly
problematic on SMP systems. This commit adds a spinlock to prevent
concurrent execution.
This addresses a Twister CI failure discovered in #85539.
Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
TX status macro is different for MAX32650 SoC.
The common macro is added to the hal.
This commit changes the tx status macro with
the common one.
Signed-off-by: Yasin Ustuner <Yasin.Ustuner@analog.com>
When using the interrupt UART API, it is expected that the driver will
call the callback function repeatedly while TX interrupt is enabled.
However that is not necessarily the case with the FIFO is enabled.
If the application calls uart_fifo_fill() each time with only one byte
of data, the TX interrupt will never trigger. This is because the 1/8 TX
interrupt trigger threshold is never reached. For this reason, the
callback function should be called multiple times from software as
needed.
Fixeszephyrproject-rtos/zephyr#85479
Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
Make use of pm_device_driver_init to perform driver initialization.
Implement PM suspend and resume, which performs the following actions:
* Enables/disables the USART
* Gates the USART clock
* Configures USART pins
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Reuse the same peripheral init function between init and the
runtime configure API. Remove redundant enable calls, the init
function enables the USART internally.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Currently, ns16550 allows the user to specify a clock attribute in the
Device Tree. This node is use to retrieve the internal frequency of the
hardware block.
However, ns16550 expects the clock is already initialised and it doesn't
try to enable it. Let's fix that issue.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
This is necessary to suppress CMake build warning due to no source file
defined for drivers__serial.
Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
The gecko_uart.c driver supports both `silabs,gecko_uart` and
`silabs,gecko_usart` compat strings, however `PM_DEVICE_DT_INST_DEFINE()`
was missing when defining `uart` type instances. The
efm32wg_stk3800/efm32wg990f256 platform enables by default one
`gecko_uart` DT node and no `gecko_usart` nodes. This results in the
following build warning/error:
uart_gecko.c:673:12: warning: 'uart_gecko_pm_action' defined but not used
Add the missing call to `PM_DEVICE_DT_INST_DEFINE()`.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Fast instance in nrf54h (uart120) can generate a spurious RXTO event
some time after RXTO event that indicates that RX path is disabled.
The time when event is generated depends on baudrate and when slower
baudrates are used peripheral is disabled on time to not notice it
in the test but with higher baudates issue become visible. In order
to avoid spurious interrupt, RXTO interrupt is disabled during RXTO
event handling and enabled when RX is enabled. This workaround is
applied only for fast instance to avoid unnecessary register
accesses for slower instances.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
nrf54x devices have UARTE instance capable of using baudrate higher
than 1M. Higher baudrates does not have predefined values for
BAUDRATE register. A formula can be used to calculate BAUDRATE
value that shall be used for desired baudrate. Add UARTE_ANY_HIGH_SPEED
macro which is set when high speed is enabled (uart00 in nrf54lx or
uart120 in nrf54h20). For high speed instance use formula for getting
value that shall be written to BAUDRATE register.
When runtime configuration is not used then same formula is used to
calculate fixed BAUDRATE value.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
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>
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>
Fixes a multitude of Kconfigs that wrongly appear on devices
where support is literally impossible
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
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>
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>
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>
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>
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>
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>