drivers: serial: Initial support for SCI UART

First commit to support serial driver running on r_sci_uart for Renesas
RA devices.

Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
This commit is contained in:
Duy Phuong Hoang. Nguyen 2024-07-18 15:47:26 +07:00 committed by Anas Nashif
parent 922ee61b8d
commit 7060672c37
7 changed files with 1258 additions and 16 deletions

View File

@ -77,6 +77,7 @@ zephyr_library_sources_ifdef(CONFIG_UART_ENE_KB1200 uart_ene_kb1200.c)
zephyr_library_sources_ifdef(CONFIG_UART_RZT2M uart_rzt2m.c)
zephyr_library_sources_ifdef(CONFIG_UART_RA8_SCI_B uart_renesas_ra8_sci_b.c)
zephyr_library_sources_ifdef(CONFIG_USERSPACE uart_handlers.c)
zephyr_library_sources_ifdef(CONFIG_UART_SCI_RA uart_renesas_ra_sci.c)
if(CONFIG_UART_NATIVE_POSIX)
zephyr_library_compile_definitions(NO_POSIX_CHEATS)

View File

@ -1,4 +1,5 @@
# Copyright (c) 2023 TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
# Copyright (c) 2024 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0
config UART_RENESAS_RA
@ -9,3 +10,25 @@ config UART_RENESAS_RA
select SERIAL_SUPPORT_INTERRUPT
help
Enable Renesas RA series UART driver.
config UART_SCI_RA
bool "Renesas RA SCI UART"
default y
depends on DT_HAS_RENESAS_RA_SCI_UART_ENABLED
select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
select SERIAL_SUPPORT_ASYNC
select USE_RA_FSP_SCI_UART
select USE_RA_FSP_DTC if UART_ASYNC_API
help
Enable Renesas RA SCI UART Driver.
if UART_SCI_RA
config UART_RA_SCI_UART_FIFO_ENABLE
bool "RA SCI UART FIFO usage enable"
default y
help
Enable RA SCI FIFO
endif

View File

@ -1038,14 +1038,10 @@ static void uart_ra_sci_b_eri_isr(const struct device *dev)
#define UART_RA_SCI_B_DTC_INIT(index) \
do { \
if (DT_INST_PROP_OR(index, rx_dtc, false)) { \
uart_ra_sci_b_data_##index.fsp_config.p_transfer_rx = \
&uart_ra_sci_b_data_##index.rx_transfer; \
} \
if (DT_INST_PROP_OR(index, tx_dtc, false)) { \
uart_ra_sci_b_data_##index.fsp_config.p_transfer_tx = \
&uart_ra_sci_b_data_##index.tx_transfer; \
} \
uart_ra_sci_b_data_##index.fsp_config.p_transfer_rx = \
&uart_ra_sci_b_data_##index.rx_transfer; \
uart_ra_sci_b_data_##index.fsp_config.p_transfer_tx = \
&uart_ra_sci_b_data_##index.tx_transfer; \
} while (0)
#define UART_RA_SCI_B_ASYNC_INIT(index) \

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
# Copyright (c) 2024 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0
description: Renesas RA SCI UART controller
compatible: "renesas,ra-sci-uart"
include: [uart-controller.yaml, pinctrl-device.yaml]
properties:
channel:
type: int
required: true

View File

@ -11,11 +11,3 @@ properties:
channel:
type: int
required: true
tx-dtc:
type: boolean
description: Enable dtc support for transmit
rx-dtc:
type: boolean
description: Enable dtc support for receive

View File

@ -22,3 +22,8 @@ config USE_RA_FSP_I2C_IIC
bool
help
Enable Renesas RA I2C IIC Master driver
config USE_RA_FSP_SCI_UART
bool
help
Enable RA FSP SCI UART driver