Skip to content

Commit ab9d137

Browse files
duynguyenxaquytranpzz
authored andcommitted
soc: renesas: Add initial support for RA6E2 SOC
Initial support for Renesas RA6E2 SOC Signed-off-by: Duy Phuong Hoang. Nguyen <[email protected]> Signed-off-by: Quy Tran <[email protected]>
1 parent d64d5b5 commit ab9d137

File tree

10 files changed

+415
-0
lines changed

10 files changed

+415
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <arm/renesas/ra/ra6/r7fa6e2bx.dtsi>
8+
9+
/ {
10+
soc {
11+
flash-controller@407e0000 {
12+
reg = <0x407e0000 0x10000>;
13+
#address-cells = <1>;
14+
#size-cells = <1>;
15+
16+
flash0: flash@0 {
17+
compatible = "soc-nv-flash";
18+
reg = <0x0 DT_SIZE_K(256)>;
19+
};
20+
};
21+
};
22+
};
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <arm/renesas/ra/ra6/ra6-cm33-common.dtsi>
8+
#include <zephyr/dt-bindings/clock/ra_clock.h>
9+
10+
/ {
11+
soc {
12+
sram0: memory@20000000 {
13+
compatible = "mmio-sram";
14+
reg = <0x20000000 DT_SIZE_K(40)>;
15+
};
16+
17+
ioport8: gpio@40080100 {
18+
compatible = "renesas,ra-gpio-ioport";
19+
reg = <0x40080100 0x20>;
20+
port = <8>;
21+
gpio-controller;
22+
#gpio-cells = <2>;
23+
ngpios = <16>;
24+
status = "disabled";
25+
};
26+
27+
id_code: id_code@100a120 {
28+
compatible = "zephyr,memory-region";
29+
reg = <0x0100a120 0x10>;
30+
zephyr,memory-region = "ID_CODE";
31+
status = "okay";
32+
};
33+
};
34+
35+
clocks: clocks {
36+
xtal: clock-xtal {
37+
compatible = "renesas,ra-cgc-external-clock";
38+
clock-frequency = <DT_FREQ_M(20)>;
39+
#clock-cells = <0>;
40+
status = "disabled";
41+
};
42+
43+
hoco: clock-hoco {
44+
compatible = "fixed-clock";
45+
clock-frequency = <DT_FREQ_M(20)>;
46+
#clock-cells = <0>;
47+
};
48+
49+
moco: clock-moco {
50+
compatible = "fixed-clock";
51+
clock-frequency = <DT_FREQ_M(8)>;
52+
#clock-cells = <0>;
53+
};
54+
55+
loco: clock-loco {
56+
compatible = "fixed-clock";
57+
clock-frequency = <32768>;
58+
#clock-cells = <0>;
59+
};
60+
61+
subclk: clock-subclk {
62+
compatible = "renesas,ra-cgc-subclk";
63+
clock-frequency = <32768>;
64+
#clock-cells = <0>;
65+
status = "disabled";
66+
};
67+
68+
pll: pll {
69+
compatible = "renesas,ra-cgc-pll";
70+
#clock-cells = <0>;
71+
72+
/* PLL */
73+
source = <RA_PLL_SOURCE_MAIN_OSC>;
74+
div = <RA_PLL_DIV_1>;
75+
mul = <10 0>;
76+
status = "disabled";
77+
};
78+
79+
pclkblock: pclkblock {
80+
compatible = "renesas,ra-cgc-pclk-block";
81+
#clock-cells = <0>;
82+
sysclock-src = <RA_CLOCK_SOURCE_PLL>;
83+
status = "okay";
84+
85+
iclk: iclk {
86+
compatible = "renesas,ra-cgc-pclk";
87+
clk_div = <RA_SYS_CLOCK_DIV_1>;
88+
#clock-cells = <2>;
89+
status = "okay";
90+
};
91+
92+
pclka: pclka {
93+
compatible = "renesas,ra-cgc-pclk";
94+
clk_div = <RA_SYS_CLOCK_DIV_2>;
95+
#clock-cells = <2>;
96+
status = "okay";
97+
};
98+
99+
pclkb: pclkb {
100+
compatible = "renesas,ra-cgc-pclk";
101+
clk_div = <RA_SYS_CLOCK_DIV_4>;
102+
#clock-cells = <2>;
103+
status = "okay";
104+
};
105+
106+
pclkc: pclkc {
107+
compatible = "renesas,ra-cgc-pclk";
108+
clk_div = <RA_SYS_CLOCK_DIV_4>;
109+
#clock-cells = <2>;
110+
status = "okay";
111+
};
112+
113+
pclkd: pclkd {
114+
compatible = "renesas,ra-cgc-pclk";
115+
clk_div = <RA_SYS_CLOCK_DIV_2>;
116+
#clock-cells = <2>;
117+
status = "okay";
118+
};
119+
120+
fclk: fclk {
121+
compatible = "renesas,ra-cgc-pclk";
122+
clk_div = <RA_SYS_CLOCK_DIV_4>;
123+
#clock-cells = <2>;
124+
status = "okay";
125+
};
126+
127+
clkout: clkout {
128+
compatible = "renesas,ra-cgc-pclk";
129+
#clock-cells = <2>;
130+
status = "disabled";
131+
};
132+
133+
uclk: uclk {
134+
compatible = "renesas,ra-cgc-pclk";
135+
#clock-cells = <2>;
136+
status = "disabled";
137+
};
138+
139+
canfdclk: canfdclk {
140+
compatible = "renesas,ra-cgc-pclk";
141+
#clock-cells = <2>;
142+
status = "disabled";
143+
};
144+
145+
cecclk: cecclk {
146+
compatible = "renesas,ra-cgc-pclk";
147+
#clock-cells = <2>;
148+
status = "disabled";
149+
};
150+
151+
i3cclk: i3cclk {
152+
compatible = "renesas,ra-cgc-pclk";
153+
#clock-cells = <2>;
154+
status = "disabled";
155+
};
156+
};
157+
};
158+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_include_directories(.)
5+
6+
zephyr_sources(
7+
soc.c
8+
)
9+
10+
zephyr_linker_sources(SECTIONS sections.ld)
11+
12+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")

soc/renesas/ra/ra6e2/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_RA6E2
5+
select ARM
6+
select CPU_CORTEX_M33
7+
select CPU_HAS_ARM_MPU
8+
select HAS_RENESAS_RA_FSP
9+
select CPU_CORTEX_M_HAS_DWT
10+
select CPU_HAS_FPU
11+
select ARMV8_M_DSP
12+
select FPU
13+
select HAS_SWO
14+
select XIP
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_SERIES_RA6E2
5+
6+
config NUM_IRQS
7+
default 96
8+
9+
config PINCTRL
10+
default y
11+
12+
endif # SOC_SERIES_RA6E2

soc/renesas/ra/ra6e2/Kconfig.soc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_RA6E2
5+
bool
6+
select SOC_FAMILY_RENESAS_RA
7+
help
8+
Renesas RA6E2 series
9+
10+
config SOC_R7FA6E2BB3CFM
11+
bool
12+
select SOC_SERIES_RA6E2
13+
help
14+
R7FA6E2BB3CFM
15+
16+
config SOC_SERIES
17+
default "ra6e2" if SOC_SERIES_RA6E2
18+
19+
config SOC
20+
default "r7fa6e2bb3cfm" if SOC_R7FA6E2BB3CFM

soc/renesas/ra/ra6e2/sections.ld

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
.code_in_ram :
8+
{
9+
. = ALIGN(4);
10+
__Code_In_RAM_Start = .;
11+
KEEP(*(.code_in_ram*))
12+
__Code_In_RAM_End = .;
13+
} > RAMABLE_REGION
14+
15+
SECTION_DATA_PROLOGUE(.fsp_dtc_vector_table,(NOLOAD),)
16+
{
17+
/* If DTC is used, put the DTC vector table at the start of SRAM.
18+
This avoids memory holes due to 1K alignment required by it. */
19+
*(.fsp_dtc_vector_table)
20+
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
21+
22+
SECTION_PROLOGUE(.option_setting_ofs,,)
23+
{
24+
__OPTION_SETTING_OFS_Start = .;
25+
KEEP(*(.option_setting_ofs0))
26+
. = __OPTION_SETTING_OFS_Start + 0x04;
27+
KEEP(*(.option_setting_ofs2))
28+
. = __OPTION_SETTING_OFS_Start + 0x10;
29+
KEEP(*(.option_setting_dualsel))
30+
__OPTION_SETTING_OFS_End = .;
31+
} GROUP_LINK_IN(OPTION_SETTING_OFS) = 0xFF
32+
33+
SECTION_PROLOGUE(.option_setting_sas,,)
34+
{
35+
__OPTION_SETTING_SAS_Start = .;
36+
KEEP(*(.option_setting_sas))
37+
__OPTION_SETTING_SAS_End = .;
38+
} GROUP_LINK_IN(OPTION_SETTING_SAS) = 0xFF
39+
40+
SECTION_PROLOGUE(.option_setting_s,,)
41+
{
42+
__OPTION_SETTING_S_Start = .;
43+
KEEP(*(.option_setting_ofs1_sec))
44+
. = __OPTION_SETTING_S_Start + 0x04;
45+
KEEP(*(.option_setting_ofs3_sec))
46+
. = __OPTION_SETTING_S_Start + 0x10;
47+
KEEP(*(.option_setting_banksel_sec))
48+
. = __OPTION_SETTING_S_Start + 0x40;
49+
KEEP(*(.option_setting_bps_sec0))
50+
. = __OPTION_SETTING_S_Start + 0x44;
51+
KEEP(*(.option_setting_bps_sec1))
52+
. = __OPTION_SETTING_S_Start + 0x48;
53+
KEEP(*(.option_setting_bps_sec2))
54+
. = __OPTION_SETTING_S_Start + 0x4C;
55+
KEEP(*(.option_setting_bps_sec3))
56+
. = __OPTION_SETTING_S_Start + 0x60;
57+
KEEP(*(.option_setting_pbps_sec0))
58+
. = __OPTION_SETTING_S_Start + 0x64;
59+
KEEP(*(.option_setting_pbps_sec1))
60+
. = __OPTION_SETTING_S_Start + 0x68;
61+
KEEP(*(.option_setting_pbps_sec2))
62+
. = __OPTION_SETTING_S_Start + 0x6C;
63+
KEEP(*(.option_setting_pbps_sec3))
64+
. = __OPTION_SETTING_S_Start + 0x80;
65+
KEEP(*(.option_setting_ofs1_sel))
66+
. = __OPTION_SETTING_S_Start + 0x84;
67+
KEEP(*(.option_setting_ofs3_sel))
68+
. = __OPTION_SETTING_S_Start + 0x90;
69+
KEEP(*(.option_setting_banksel_sel))
70+
. = __OPTION_SETTING_S_Start + 0xC0;
71+
KEEP(*(.option_setting_bps_sel0))
72+
. = __OPTION_SETTING_S_Start + 0xC4;
73+
KEEP(*(.option_setting_bps_sel1))
74+
. = __OPTION_SETTING_S_Start + 0xC8;
75+
KEEP(*(.option_setting_bps_sel2))
76+
. = __OPTION_SETTING_S_Start + 0xCC;
77+
KEEP(*(.option_setting_bps_sel3))
78+
__OPTION_SETTING_S_End = .;
79+
} GROUP_LINK_IN(OPTION_SETTING_S) = 0xFF
80+
81+
SECTION_PROLOGUE(.id_code,,)
82+
{
83+
KEEP(*(.id_code*))
84+
} GROUP_LINK_IN(ID_CODE)

0 commit comments

Comments
 (0)