Skip to content

Commit f93f801

Browse files
thenguyenyfnashif
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 ee4613a commit f93f801

File tree

12 files changed

+1490
-144
lines changed

12 files changed

+1490
-144
lines changed

boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
*/
55

66
&pinctrl {
7-
sci0_default: sci0_default {
7+
sci9_default: sci9_default {
88
group1 {
99
/* tx */
10-
psels = <RA_PSEL(RA_PSEL_SCI_0, 6, 9)>;
10+
psels = <RA_PSEL(RA_PSEL_SCI_9, 10, 14)>;
1111
drive-strength = "medium";
1212
};
1313
group2 {
1414
/* rx */
15-
psels = <RA_PSEL(RA_PSEL_SCI_0, 6, 10)>;
15+
psels = <RA_PSEL(RA_PSEL_SCI_9, 10, 15)>;
1616
};
1717
};
1818
};

boards/renesas/ek_ra8m1/ek_ra8m1.dts

Lines changed: 18 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 = &uart9;
21+
zephyr,shell-uart = &uart9;
2022
};
2123

2224
leds {
@@ -64,6 +66,12 @@
6466
status = "okay";
6567
};
6668

69+
&sciclk {
70+
clk_src = <RA_CLOCK_SOURCE_PLL1P>;
71+
clk_div = <RA_SCI_CLOCK_DIV_4>;
72+
status = "okay";
73+
};
74+
6775
&ioport1 {
6876
status = "okay";
6977
};
@@ -75,3 +83,13 @@
7583
&ioport6 {
7684
status = "okay";
7785
};
86+
87+
&sci9 {
88+
pinctrl-0 = <&sci9_default>;
89+
pinctrl-names = "default";
90+
status = "okay";
91+
uart9: uart {
92+
current-speed = <115200>;
93+
status = "okay";
94+
};
95+
};

drivers/serial/CMakeLists.txt

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

8181
if(CONFIG_UART_NATIVE_POSIX)

drivers/serial/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,6 @@ rsource "Kconfig.ene"
278278

279279
rsource "Kconfig.rzt2m"
280280

281+
source "drivers/serial/Kconfig.renesas_ra8"
282+
281283
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 "RA SCI_B UART FIFO usage enable"
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)