Skip to content

Commit 0877b3a

Browse files
soburihenrikbrixandersen
authored andcommitted
soc: renesas: ra: Add RA2A1 SoC support
Add Support for Renesas RA2A1 SoC. Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent 6b6c433 commit 0877b3a

File tree

15 files changed

+638
-0
lines changed

15 files changed

+638
-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 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <arm/renesas/ra/ra2/r7fa2a1xh.dtsi>
8+
9+
/ {
10+
soc {
11+
flash-controller@407e0000 {
12+
flash0: flash@0 {
13+
compatible = "soc-nv-flash";
14+
reg = <0x00000000 DT_SIZE_K(256)>;
15+
};
16+
flash1: flash@40100000 {
17+
compatible = "soc-nv-flash";
18+
reg = <0x40100000 DT_SIZE_K(8)>;
19+
};
20+
};
21+
};
22+
};
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
* Copyright (c) 2024 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <arm/renesas/ra/ra2/ra2xx.dtsi>
8+
#include <zephyr/dt-bindings/clock/ra_clock.h>
9+
10+
/delete-node/ &sci2;
11+
/delete-node/ &sci3;
12+
/delete-node/ &ioport6;
13+
/delete-node/ &ioport7;
14+
/delete-node/ &ioport8;
15+
16+
/ {
17+
soc {
18+
sram0: memory@20000000 {
19+
compatible = "mmio-sram";
20+
reg = <0x20000000 DT_SIZE_K(32)>;
21+
};
22+
};
23+
24+
clocks: clocks {
25+
xtal: clock-xtal {
26+
compatible = "renesas,ra-cgc-external-clock";
27+
clock-frequency = <DT_FREQ_M(12)>;
28+
#clock-cells = <0>;
29+
status = "disabled";
30+
};
31+
32+
hoco: clock-hoco {
33+
compatible = "fixed-clock";
34+
clock-frequency = <DT_FREQ_M(48)>;
35+
#clock-cells = <0>;
36+
};
37+
38+
moco: clock-moco {
39+
compatible = "fixed-clock";
40+
clock-frequency = <DT_FREQ_M(8)>;
41+
#clock-cells = <0>;
42+
};
43+
44+
loco: clock-loco {
45+
compatible = "fixed-clock";
46+
clock-frequency = <32768>;
47+
#clock-cells = <0>;
48+
};
49+
50+
subclk: clock-subclk {
51+
compatible = "renesas,ra-cgc-subclk";
52+
clock-frequency = <32768>;
53+
#clock-cells = <0>;
54+
status = "disabled";
55+
};
56+
57+
pclkblock: pclkblock {
58+
compatible = "renesas,ra-cgc-pclk-block";
59+
#clock-cells = <0>;
60+
sysclock-src = <RA_CLOCK_SOURCE_HOCO>;
61+
status = "okay";
62+
63+
iclk: iclk {
64+
compatible = "renesas,ra-cgc-pclk";
65+
clk_div = <RA_SYS_CLOCK_DIV_1>;
66+
#clock-cells = <2>;
67+
status = "okay";
68+
};
69+
70+
pclkb: pclkb {
71+
compatible = "renesas,ra-cgc-pclk";
72+
clk_div = <RA_SYS_CLOCK_DIV_2>;
73+
#clock-cells = <2>;
74+
status = "okay";
75+
};
76+
77+
pclkd: pclkd {
78+
compatible = "renesas,ra-cgc-pclk";
79+
clk_div = <RA_SYS_CLOCK_DIV_1>;
80+
#clock-cells = <2>;
81+
status = "okay";
82+
};
83+
84+
fclk: fclk {
85+
compatible = "renesas,ra-cgc-pclk";
86+
clk_div = <RA_SYS_CLOCK_DIV_1>;
87+
#clock-cells = <2>;
88+
status = "okay";
89+
};
90+
91+
clkout: clkout {
92+
compatible = "renesas,ra-cgc-pclk";
93+
#clock-cells = <2>;
94+
status = "disabled";
95+
};
96+
97+
98+
sdadcclk: sdadcclk {
99+
compatible = "renesas,ra-cgc-pclk";
100+
#clock-cells = <2>;
101+
status = "disabled";
102+
};
103+
};
104+
};
105+
};

dts/arm/renesas/ra/ra2/ra2xx.dtsi

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
/*
2+
* Copyright (c) 2024 TOKITA Hiroshi
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 <zephyr/dt-bindings/clock/ra_clock.h>
11+
#include <freq.h>
12+
13+
/ {
14+
cpus {
15+
#address-cells = <1>;
16+
#size-cells = <0>;
17+
18+
cpu@0 {
19+
device_type = "cpu";
20+
compatible = "arm,cortex-m23";
21+
reg = <0>;
22+
};
23+
};
24+
25+
soc {
26+
system: system@4001e000 {
27+
compatible = "renesas,ra-system";
28+
reg = <0x4001e000 0x1000>;
29+
status = "okay";
30+
};
31+
32+
ioport0: gpio@40040000 {
33+
compatible = "renesas,ra-gpio-ioport";
34+
reg = <0x40040000 0x20>;
35+
port = <0>;
36+
gpio-controller;
37+
#gpio-cells = <2>;
38+
ngpios = <16>;
39+
status = "disabled";
40+
};
41+
42+
ioport1: gpio@40040020 {
43+
compatible = "renesas,ra-gpio-ioport";
44+
reg = <0x40040020 0x20>;
45+
port = <1>;
46+
gpio-controller;
47+
#gpio-cells = <2>;
48+
ngpios = <16>;
49+
status = "disabled";
50+
};
51+
52+
ioport2: gpio@40040040 {
53+
compatible = "renesas,ra-gpio-ioport";
54+
reg = <0x40040040 0x20>;
55+
port = <2>;
56+
gpio-controller;
57+
#gpio-cells = <2>;
58+
ngpios = <16>;
59+
status = "disabled";
60+
};
61+
62+
ioport3: gpio@40040060 {
63+
compatible = "renesas,ra-gpio-ioport";
64+
reg = <0x40040060 0x20>;
65+
port = <3>;
66+
gpio-controller;
67+
#gpio-cells = <2>;
68+
ngpios = <16>;
69+
status = "disabled";
70+
};
71+
72+
ioport4: gpio@40040080 {
73+
compatible = "renesas,ra-gpio-ioport";
74+
reg = <0x40040080 0x20>;
75+
port = <4>;
76+
gpio-controller;
77+
#gpio-cells = <2>;
78+
ngpios = <16>;
79+
status = "disabled";
80+
};
81+
82+
ioport5: gpio@400400a0 {
83+
compatible = "renesas,ra-gpio-ioport";
84+
reg = <0x400400a0 0x20>;
85+
port = <5>;
86+
gpio-controller;
87+
#gpio-cells = <2>;
88+
ngpios = <16>;
89+
status = "disabled";
90+
};
91+
92+
ioport6: gpio@400400c0 {
93+
compatible = "renesas,ra-gpio-ioport";
94+
reg = <0x400400c0 0x20>;
95+
port = <6>;
96+
gpio-controller;
97+
#gpio-cells = <2>;
98+
ngpios = <16>;
99+
status = "disabled";
100+
};
101+
102+
ioport7: gpio@400400e0 {
103+
compatible = "renesas,ra-gpio-ioport";
104+
reg = <0x400400e0 0x20>;
105+
port = <7>;
106+
gpio-controller;
107+
#gpio-cells = <2>;
108+
ngpios = <16>;
109+
status = "disabled";
110+
};
111+
112+
ioport8: gpio@40040100 {
113+
compatible = "renesas,ra-gpio-ioport";
114+
reg = <0x40040100 0x20>;
115+
port = <8>;
116+
gpio-controller;
117+
#gpio-cells = <2>;
118+
ngpios = <16>;
119+
status = "disabled";
120+
};
121+
122+
ioport9: gpio@40040120 {
123+
compatible = "renesas,ra-gpio-ioport";
124+
reg = <0x40040120 0x20>;
125+
port = <9>;
126+
gpio-controller;
127+
#gpio-cells = <2>;
128+
ngpios = <16>;
129+
status = "disabled";
130+
};
131+
132+
pinctrl: pin-controller@40040800 {
133+
compatible = "renesas,ra-pinctrl-pfs";
134+
reg = <0x40040800 0x3c0>;
135+
status = "okay";
136+
};
137+
138+
sci0: sci@40070000 {
139+
compatible = "renesas,ra-sci";
140+
interrupts = <4 1>, <5 1>, <6 1>, <7 1>;
141+
interrupt-names = "rxi", "txi", "tei", "eri";
142+
reg = <0x40070000 0x20>;
143+
clocks = <&pclkb MSTPB 31>;
144+
status = "disabled";
145+
uart {
146+
compatible = "renesas,ra-sci-uart";
147+
channel = <0>;
148+
status = "disabled";
149+
};
150+
};
151+
152+
sci1: sci@40070020 {
153+
compatible = "renesas,ra-sci";
154+
interrupts = <8 1>, <9 1>, <10 1>, <11 1>;
155+
interrupt-names = "rxi", "txi", "tei", "eri";
156+
reg = <0x40070020 0x20>;
157+
clocks = <&pclkb MSTPB 30>;
158+
status = "disabled";
159+
uart {
160+
compatible = "renesas,ra-sci-uart";
161+
channel = <1>;
162+
status = "disabled";
163+
};
164+
};
165+
166+
sci2: sci@40070040 {
167+
compatible = "renesas,ra-sci";
168+
interrupts = <12 1>, <13 1>, <14 1>, <15 1>;
169+
interrupt-names = "rxi", "txi", "tei", "eri";
170+
reg = <0x40070040 0x20>;
171+
clocks = <&pclkb MSTPB 29>;
172+
status = "disabled";
173+
uart {
174+
compatible = "renesas,ra-sci-uart";
175+
channel = <2>;
176+
status = "disabled";
177+
};
178+
};
179+
180+
sci3: sci@40070060 {
181+
compatible = "renesas,ra-sci";
182+
interrupts = <16 1>, <17 1>, <18 1>, <19 1>;
183+
interrupt-names = "rxi", "txi", "tei", "eri";
184+
reg = <0x40070060 0x20>;
185+
clocks = <&pclkb MSTPB 28>;
186+
status = "disabled";
187+
uart {
188+
compatible = "renesas,ra-sci-uart";
189+
channel = <3>;
190+
status = "disabled";
191+
};
192+
};
193+
194+
sci9: sci@40070120 {
195+
compatible = "renesas,ra-sci";
196+
interrupts = <24 1>, <25 1>, <26 1>, <27 1>;
197+
interrupt-names = "rxi", "txi", "tei", "eri";
198+
reg = <0x40070120 0x20>;
199+
clocks = <&pclkb MSTPB 22>;
200+
status = "disabled";
201+
uart {
202+
compatible = "renesas,ra-sci-uart";
203+
channel = <9>;
204+
status = "disabled";
205+
};
206+
};
207+
208+
flash-controller@407e0000 {
209+
reg = <0x407e0000 0x10000>;
210+
#address-cells = <1>;
211+
#size-cells = <1>;
212+
};
213+
214+
id_code: id_code@1010018 {
215+
compatible = "zephyr,memory-region";
216+
reg = <0x01010018 0x20>;
217+
zephyr,memory-region = "ID_CODE";
218+
status = "okay";
219+
};
220+
};
221+
};
222+
223+
&nvic {
224+
arm,num-irq-priority-bits = <2>;
225+
};

include/zephyr/dt-bindings/clock/ra_clock.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,17 @@
126126
#define RA_LCD_CLOCK_DIV_6 3
127127
#define RA_LCD_CLOCK_DIV_8 4
128128

129+
/* SDADC clock divider options. */
130+
#define RA_SDADC_CLOCK_DIV_1 0
131+
#define RA_SDADC_CLOCK_DIV_2 1
132+
#define RA_SDADC_CLOCK_DIV_3 2
133+
#define RA_SDADC_CLOCK_DIV_4 3
134+
#define RA_SDADC_CLOCK_DIV_5 4
135+
#define RA_SDADC_CLOCK_DIV_6 5
136+
#define RA_SDADC_CLOCK_DIV_8 6
137+
#define RA_SDADC_CLOCK_DIV_12 7
138+
#define RA_SDADC_CLOCK_DIV_16 8
139+
129140
#define MSTPA 0x40203000
130141
#define MSTPB 0x40203004
131142
#define MSTPC 0x40203008
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2024 TOKITA Hiroshi
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+
zephyr_linker_sources(DATA_SECTIONS data_sections.ld)
12+
zephyr_linker_sources(RAM_SECTIONS ram_sections.ld)
13+
zephyr_linker_sources(ROM_START rom_start.ld)
14+
15+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")

0 commit comments

Comments
 (0)