Skip to content

Commit c54c789

Browse files
thenguyenyfduynguyenxa
authored andcommitted
driver: serial: Add serial driver support for Renesas RA8 devices
Add implementation of sci_b_uart for Renesas RA device Signed-off-by: The Thanh. Nguyen <[email protected]>
1 parent f876d38 commit c54c789

File tree

11 files changed

+1448
-114
lines changed

11 files changed

+1448
-114
lines changed

boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,40 @@
1717
psels = <RA_PSEL(RA_PSEL_SCI_0, 6, 10)>;
1818
};
1919
};
20+
21+
sci2_default: sci2_default {
22+
group1 {
23+
/* tx */
24+
psels = <RA_PSEL(RA_PSEL_SCI_2, 10, 3)>;
25+
drive-strength = "medium";
26+
};
27+
group2 {
28+
/* rx */
29+
psels = <RA_PSEL(RA_PSEL_SCI_2, 10, 2)>;
30+
};
31+
};
32+
33+
sci3_default: sci3_default {
34+
group1 {
35+
/* tx */
36+
psels = <RA_PSEL(RA_PSEL_SCI_3, 3, 10)>;
37+
drive-strength = "medium";
38+
};
39+
group2 {
40+
/* rx */
41+
psels = <RA_PSEL(RA_PSEL_SCI_3, 3, 9)>;
42+
};
43+
};
44+
45+
sci9_default: sci9_default {
46+
group1 {
47+
/* tx */
48+
psels = <RA_PSEL(RA_PSEL_SCI_9, 10, 14)>;
49+
drive-strength = "medium";
50+
};
51+
group2 {
52+
/* rx */
53+
psels = <RA_PSEL(RA_PSEL_SCI_9, 10, 15)>;
54+
};
55+
};
2056
};

boards/renesas/ek_ra8m1/ek_ra8m1.dts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
chosen {
1818
zephyr,sram = &sram0;
1919
zephyr,flash = &flash0;
20+
zephyr,console = &sci9;
21+
zephyr,shell-uart = &sci9;
2022
};
2123

2224
leds {
@@ -56,3 +58,10 @@
5658
&gpio6 {
5759
status = "okay";
5860
};
61+
62+
&sci9 {
63+
current-speed = <115200>;
64+
pinctrl-0 = <&sci9_default>;
65+
pinctrl-names = "default";
66+
status = "okay";
67+
};

drivers/serial/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ zephyr_library_sources_ifdef(CONFIG_UART_INTEL_LW uart_intel_lw.c)
7474
zephyr_library_sources_ifdef(CONFIG_UART_RENESAS_RA uart_renesas_ra.c)
7575
zephyr_library_sources_ifdef(CONFIG_UART_ENE_KB1200 uart_ene_kb1200.c)
7676
zephyr_library_sources_ifdef(CONFIG_UART_RZT2M uart_rzt2m.c)
77-
77+
zephyr_library_sources_ifdef(CONFIG_UART_RA8_SCI_B uart_renesas_ra8_sci_b.c)
7878
zephyr_library_sources_ifdef(CONFIG_USERSPACE uart_handlers.c)
7979

8080
if(CONFIG_UART_NATIVE_POSIX)

drivers/serial/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,4 +276,6 @@ source "drivers/serial/Kconfig.ene"
276276

277277
source "drivers/serial/Kconfig.rzt2m"
278278

279+
source "drivers/serial/Kconfig.renesas_ra8"
280+
279281
endif # SERIAL

drivers/serial/Kconfig.renesas_ra

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Copyright (c) 2023 TOKITA Hiroshi <[email protected]>
2-
# Copyright (c) 2024 Renesas Electronics Corporation
32
# SPDX-License-Identifier: Apache-2.0
43

54
config UART_RENESAS_RA

drivers/serial/Kconfig.renesas_ra8

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config UART_RA8_SCI_B
5+
bool "Renesas RA SCI_B UART"
6+
default y
7+
depends on DT_HAS_RENESAS_RA8_UART_SCI_B_ENABLED
8+
select SERIAL_HAS_DRIVER
9+
select SERIAL_SUPPORT_INTERRUPT
10+
select SERIAL_SUPPORT_ASYNC
11+
select USE_RA_FSP_SCI_B_UART
12+
select USE_RA_FSP_DTC if UART_ASYNC_API
13+
help
14+
Enable Renesas RA SCI_B UART Driver.
15+
16+
if UART_RA8_SCI_B && (UART_INTERRUPT_DRIVEN || UART_ASYNC_API)
17+
18+
config UART_RA_SCI_B_UART_FIFO_ENABLE
19+
bool "Enable RA SCI_B UART FIFO"
20+
default y if UART_INTERRUPT_DRIVEN
21+
default n if UART_ASYNC_API
22+
help
23+
Enable RA SCI_B FIFO
24+
25+
endif

0 commit comments

Comments
 (0)