Skip to content

Commit 81b8390

Browse files
quytranpzznashif
authored andcommitted
soc: renesas: Add initial support for RA4E2 soc
Initial commit to support Renesas RA4E2 SoC Signed-off-by: Quy Tran <[email protected]>
1 parent 9ea4cb9 commit 81b8390

File tree

10 files changed

+564
-0
lines changed

10 files changed

+564
-0
lines changed
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/clock/ra_clock.h>
8+
#include <arm/renesas/ra/ra4/ra4-cm33-common.dtsi>
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+
flash-controller@407e0000 {
28+
reg = <0x407e0000 0x10000>;
29+
#address-cells = <1>;
30+
#size-cells = <1>;
31+
flash0: flash@0 {
32+
compatible = "soc-nv-flash";
33+
reg = <0x0 DT_SIZE_K(128)>;
34+
};
35+
};
36+
37+
id_code: id_code@100a120 {
38+
compatible = "zephyr,memory-region";
39+
reg = <0x0100a120 0x10>;
40+
zephyr,memory-region = "ID_CODE";
41+
status = "okay";
42+
};
43+
};
44+
45+
clocks: clocks {
46+
xtal: clock-xtal {
47+
compatible = "renesas,ra-cgc-external-clock";
48+
clock-frequency = <DT_FREQ_M(20)>;
49+
#clock-cells = <0>;
50+
status = "disabled";
51+
};
52+
53+
hoco: clock-hoco {
54+
compatible = "fixed-clock";
55+
clock-frequency = <DT_FREQ_M(20)>;
56+
#clock-cells = <0>;
57+
};
58+
59+
moco: clock-moco {
60+
compatible = "fixed-clock";
61+
clock-frequency = <DT_FREQ_M(8)>;
62+
#clock-cells = <0>;
63+
};
64+
65+
loco: clock-loco {
66+
compatible = "fixed-clock";
67+
clock-frequency = <32768>;
68+
#clock-cells = <0>;
69+
};
70+
71+
subclk: clock-subclk {
72+
compatible = "renesas,ra-cgc-subclk";
73+
clock-frequency = <32768>;
74+
#clock-cells = <0>;
75+
status = "disabled";
76+
};
77+
78+
pll: pll {
79+
compatible = "renesas,ra-cgc-pll";
80+
#clock-cells = <0>;
81+
82+
/* PLL */
83+
source = <RA_PLL_SOURCE_MAIN_OSC>;
84+
div = <RA_PLL_DIV_1>;
85+
mul = <10 0>;
86+
freq = <DT_FREQ_M(200)>;
87+
status = "disabled";
88+
};
89+
90+
pclkblock: pclkblock {
91+
compatible = "renesas,ra-cgc-pclk-block";
92+
#clock-cells = <0>;
93+
sysclock-src = <RA_CLOCK_SOURCE_PLL>;
94+
status = "okay";
95+
96+
iclk: iclk {
97+
compatible = "renesas,ra-cgc-pclk";
98+
clk_div = <RA_SYS_CLOCK_DIV_2>;
99+
#clock-cells = <2>;
100+
status = "okay";
101+
};
102+
103+
pclka: pclka {
104+
compatible = "renesas,ra-cgc-pclk";
105+
clk_div = <RA_SYS_CLOCK_DIV_2>;
106+
#clock-cells = <2>;
107+
status = "okay";
108+
};
109+
110+
pclkb: pclkb {
111+
compatible = "renesas,ra-cgc-pclk";
112+
clk_div = <RA_SYS_CLOCK_DIV_4>;
113+
#clock-cells = <2>;
114+
status = "okay";
115+
};
116+
117+
pclkc: pclkc {
118+
compatible = "renesas,ra-cgc-pclk";
119+
clk_div = <RA_SYS_CLOCK_DIV_4>;
120+
#clock-cells = <2>;
121+
status = "okay";
122+
};
123+
124+
pclkd: pclkd {
125+
compatible = "renesas,ra-cgc-pclk";
126+
clk_div = <RA_SYS_CLOCK_DIV_2>;
127+
#clock-cells = <2>;
128+
status = "okay";
129+
};
130+
131+
fclk: fclk {
132+
compatible = "renesas,ra-cgc-pclk";
133+
clk_div = <RA_SYS_CLOCK_DIV_4>;
134+
#clock-cells = <2>;
135+
status = "okay";
136+
};
137+
138+
clkout: clkout {
139+
compatible = "renesas,ra-cgc-pclk";
140+
#clock-cells = <2>;
141+
status = "disabled";
142+
};
143+
144+
uclk: uclk {
145+
compatible = "renesas,ra-cgc-pclk";
146+
#clock-cells = <2>;
147+
status = "disabled";
148+
};
149+
150+
canfdclk: canfdclk {
151+
compatible = "renesas,ra-cgc-pclk";
152+
#clock-cells = <2>;
153+
status = "disabled";
154+
};
155+
156+
i3cclk: i3cclk {
157+
compatible = "renesas,ra-cgc-pclk";
158+
#clock-cells = <2>;
159+
status = "disabled";
160+
};
161+
162+
cecclk: cecclk {
163+
compatible = "renesas,ra-cgc-pclk";
164+
#clock-cells = <2>;
165+
status = "disabled";
166+
};
167+
};
168+
};
169+
};
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <arm/armv8-m.dtsi>
9+
#include <zephyr/dt-bindings/pinctrl/renesas/pinctrl-ra.h>
10+
#include <freq.h>
11+
12+
/ {
13+
cpus {
14+
#address-cells = <1>;
15+
#size-cells = <0>;
16+
17+
cpu@0 {
18+
device_type = "cpu";
19+
compatible = "arm,cortex-m33";
20+
reg = <0>;
21+
#address-cells = <1>;
22+
#size-cells = <1>;
23+
24+
mpu: mpu@e000ed90 {
25+
compatible = "arm,armv8m-mpu";
26+
reg = <0xe000ed90 0x40>;
27+
};
28+
};
29+
};
30+
31+
soc {
32+
interrupt-parent = <&nvic>;
33+
34+
system: system@4001e000 {
35+
compatible = "renesas,ra-system";
36+
reg = <0x4001e000 0x1000>;
37+
status = "okay";
38+
};
39+
40+
flash-controller@407e0000 {
41+
reg = <0x407e0000 0x10000>;
42+
#address-cells = <1>;
43+
#size-cells = <1>;
44+
};
45+
46+
ioport0: gpio@40080000 {
47+
compatible = "renesas,ra-gpio-ioport";
48+
reg = <0x40080000 0x20>;
49+
port = <0>;
50+
gpio-controller;
51+
#gpio-cells = <2>;
52+
ngpios = <16>;
53+
status = "disabled";
54+
};
55+
56+
ioport1: gpio@40080020 {
57+
compatible = "renesas,ra-gpio-ioport";
58+
reg = <0x40080020 0x20>;
59+
port = <1>;
60+
gpio-controller;
61+
#gpio-cells = <2>;
62+
ngpios = <16>;
63+
status = "disabled";
64+
};
65+
66+
ioport2: gpio@40080040 {
67+
compatible = "renesas,ra-gpio-ioport";
68+
reg = <0x40080040 0x20>;
69+
port = <2>;
70+
gpio-controller;
71+
#gpio-cells = <2>;
72+
ngpios = <16>;
73+
status = "disabled";
74+
};
75+
76+
ioport3: gpio@40080060 {
77+
compatible = "renesas,ra-gpio-ioport";
78+
reg = <0x40080060 0x20>;
79+
port = <3>;
80+
gpio-controller;
81+
#gpio-cells = <2>;
82+
ngpios = <16>;
83+
status = "disabled";
84+
};
85+
86+
ioport4: gpio@40080080 {
87+
compatible = "renesas,ra-gpio-ioport";
88+
reg = <0x40080080 0x20>;
89+
port = <4>;
90+
gpio-controller;
91+
#gpio-cells = <2>;
92+
ngpios = <16>;
93+
status = "disabled";
94+
};
95+
96+
ioport5: gpio@400800a0 {
97+
compatible = "renesas,ra-gpio-ioport";
98+
reg = <0x400800a0 0x20>;
99+
port = <5>;
100+
gpio-controller;
101+
#gpio-cells = <2>;
102+
ngpios = <16>;
103+
status = "disabled";
104+
};
105+
106+
pinctrl: pin-controller@40080800 {
107+
compatible = "renesas,ra-pinctrl-pfs";
108+
reg = <0x40080800 0x3c0>;
109+
status = "okay";
110+
};
111+
112+
sci0: sci0@40118000 {
113+
compatible = "renesas,ra-sci";
114+
interrupts = <0 1>, <1 1>, <2 1>, <3 1>;
115+
interrupt-names = "rxi", "txi", "tei", "eri";
116+
reg = <0x40118000 0x100>;
117+
clocks = <&pclka MSTPB 31>;
118+
status = "disabled";
119+
uart {
120+
compatible = "renesas,ra-sci-uart";
121+
channel = <0>;
122+
status = "disabled";
123+
};
124+
};
125+
126+
sci9: sci9@40118900 {
127+
compatible = "renesas,ra-sci";
128+
interrupts = <36 1>, <37 1>, <38 1>, <39 1>;
129+
interrupt-names = "rxi", "txi", "tei", "eri";
130+
reg = <0x40118900 0x100>;
131+
clocks = <&pclka MSTPB 22>;
132+
status = "disabled";
133+
uart {
134+
compatible = "renesas,ra-sci-uart";
135+
channel = <9>;
136+
status = "disabled";
137+
};
138+
};
139+
140+
option_setting_ofs: option_setting_ofs@100a100 {
141+
compatible = "zephyr,memory-region";
142+
reg = <0x0100a100 0x18>;
143+
zephyr,memory-region = "OPTION_SETTING_OFS";
144+
status = "okay";
145+
};
146+
147+
option_setting_sas: option_setting_sas@100a134 {
148+
compatible = "zephyr,memory-region";
149+
reg = <0x0100a134 0xcc>;
150+
zephyr,memory-region = "OPTION_SETTING_SAS";
151+
status = "okay";
152+
};
153+
154+
option_setting_s: option_setting_s@100a200 {
155+
compatible = "zephyr,memory-region";
156+
reg = <0x0100a200 0x100>;
157+
zephyr,memory-region = "OPTION_SETTING_S";
158+
status = "okay";
159+
};
160+
};
161+
};
162+
163+
&nvic {
164+
arm,num-irq-priority-bits = <4>;
165+
};
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/ra4e2/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_RA4E2
5+
select ARM
6+
select CPU_HAS_ARM_MPU
7+
select CPU_CORTEX_M33
8+
select HAS_RENESAS_RA_FSP
9+
select CPU_CORTEX_M_HAS_DWT
10+
select ARMV8_M_DSP
11+
select CPU_HAS_FPU
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_RA4E2
5+
6+
config NUM_IRQS
7+
default 96
8+
9+
config PINCTRL
10+
default y
11+
12+
endif # SOC_SERIES_RA4E2

soc/renesas/ra/ra4e2/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_RA4E2
5+
bool
6+
select SOC_FAMILY_RENESAS_RA
7+
help
8+
Renesas RA4E2 series
9+
10+
config SOC_R7FA4E2B93CFM
11+
bool
12+
select SOC_SERIES_RA4E2
13+
help
14+
R7FA4E2B93CFM
15+
16+
config SOC_SERIES
17+
default "ra4e2" if SOC_SERIES_RA4E2
18+
19+
config SOC
20+
default "r7fa4e2b93cfm" if SOC_R7FA4E2B93CFM

0 commit comments

Comments
 (0)