1/*
2 * Copyright (c) 2025 Arduino SA
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6/dts-v1/;
7
8#include <renesas/ra/ra6/r7fa6m5bh3cfc.dtsi>
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/input/input-event-codes.h>
11#include <zephyr/dt-bindings/adc/adc.h>
12#include <zephyr/dt-bindings/pwm/pwm.h>
13
14#include "arduino_portenta_c33-pinctrl.dtsi"
15
16/ {
17	model = "Arduino Portenta C33";
18	compatible = "renesas,ra6m5", "renesas,ra";
19
20	chosen {
21		zephyr,sram = &sram0;
22		zephyr,flash-controller = &flash1;
23		zephyr,code-partition = &code_partition;
24		zephyr,flash = &flash0;
25		zephyr,console = &uart9;
26		zephyr,shell-uart = &uart9;
27		zephyr,entropy = &trng;
28		zephyr,bt-hci = &bt_hci_uart;
29	};
30
31	leds {
32		compatible = "gpio-leds";
33
34		led1: led1 {
35			gpios = <&ioport1 7 GPIO_ACTIVE_LOW>;
36			label = "LEDR";
37		};
38
39		led2: led2 {
40			gpios = <&ioport4 0 GPIO_ACTIVE_HIGH>;
41			label = "LEDG";
42		};
43
44		led3: led3 {
45			gpios = <&ioport8 0 GPIO_ACTIVE_HIGH>;
46			label = "LEDB";
47		};
48	};
49
50	download-esp32 {
51		compatible = "regulator-fixed";
52		regulator-name = "download_esp32";
53		enable-gpios = <&ioport8 3 GPIO_ACTIVE_HIGH>;
54		regulator-boot-on;
55	};
56
57	aliases {
58		led0 = &led1;
59	};
60};
61
62&sci9 {
63	pinctrl-0 = <&sci9_default>;
64	pinctrl-names = "default";
65	status = "okay";
66
67	uart9: uart {
68		current-speed = <115200>;
69		status = "okay";
70	};
71};
72
73&sci8 {
74	pinctrl-0 = <&sci8_default>;
75	pinctrl-names = "default";
76	status = "okay";
77
78	uart8: uart {
79		current-speed = <921600>;
80		status = "okay";
81		hw-flow-control;
82
83		bt_hci_uart: bt_hci_uart {
84			compatible = "zephyr,bt-hci-uart";
85			status = "okay";
86
87			esp32 {
88				compatible = "renesas,bt-hci-da1453x";
89				status = "okay";
90				reset-gpios = <&ioport8 4 GPIO_ACTIVE_LOW>;
91				reset-assert-duration-ms = <100>;
92				boot-duration-ms = <2000>;
93			};
94		};
95	};
96};
97
98&option_setting_ofs0 {
99	status = "disabled";
100};
101
102&option_setting_dualsel {
103	status = "disabled";
104};
105
106&option_setting_ofs1_sec {
107	status = "disabled";
108};
109
110&option_setting_banksel_sec {
111	status = "disabled";
112};
113
114&option_setting_bps_sec {
115	status = "disabled";
116};
117
118&option_setting_pbps_sec {
119	status = "disabled";
120};
121
122&option_setting_ofs1_sel {
123	status = "disabled";
124};
125
126&option_setting_banksel_sel {
127	status = "disabled";
128};
129
130&option_setting_bps_sel {
131	status = "disabled";
132};
133
134&iic0 {
135	status = "okay";
136	#address-cells = <1>;
137	#size-cells = <0>;
138	interrupts = <87 1>, <88 1>, <89 1>, <90 1>;
139	interrupt-names = "rxi", "txi", "tei", "eri";
140	clock-frequency = <DT_FREQ_M(1)>;
141	pinctrl-0 = <&iic0_default>;
142	pinctrl-names = "default";
143};
144
145&iic1 {
146	status = "okay";
147	#address-cells = <1>;
148	#size-cells = <0>;
149	interrupts = <91 1>, <92 1>, <93 1>, <94 1>;
150	interrupt-names = "rxi", "txi", "tei", "eri";
151	clock-frequency = <DT_FREQ_M(1)>;
152	pinctrl-0 = <&iic1_default>;
153	pinctrl-names = "default";
154};
155
156&spi1 {
157	status = "okay";
158	pinctrl-0 = <&spi1_default>;
159	pinctrl-names = "default";
160	clock-frequency = <DT_FREQ_M(5)>;
161	cs-gpios = <&ioport1 3 GPIO_ACTIVE_LOW>,
162		   <&ioport1 4 GPIO_ACTIVE_LOW>;
163
164	esp_hosted@1 {
165		status = "ok";
166		compatible = "espressif,esp-hosted";
167		reg = <0x1>;
168		spi-max-frequency = <DT_FREQ_M(5)>;
169		reset-gpios = <&ioport8 4 GPIO_ACTIVE_HIGH>;
170		handshake-gpios = <&ioport8 6 GPIO_ACTIVE_HIGH>;
171		dataready-gpios = <&ioport8 3 GPIO_ACTIVE_HIGH>;
172	};
173};
174
175&ioport0 {
176	status = "okay";
177};
178
179&ioport1 {
180	status = "okay";
181};
182
183&ioport2 {
184	status = "okay";
185};
186
187&ioport3 {
188	status = "okay";
189};
190
191&ioport4 {
192	status = "okay";
193};
194
195&ioport5 {
196	status = "okay";
197};
198
199&ioport6 {
200	status = "okay";
201};
202
203&ioport7 {
204	status = "okay";
205};
206
207&ioport8 {
208	status = "okay";
209};
210
211&ioport9 {
212	status = "okay";
213};
214
215&ioporta {
216	status = "okay";
217};
218
219&ioportb {
220	status = "okay";
221};
222
223&xtal {
224	clock-frequency = <DT_FREQ_M(24)>;
225	mosel = <0>;
226	#clock-cells = <0>;
227	status = "okay";
228};
229
230&subclk {
231	status = "okay";
232};
233
234&pll {
235	clocks = <&xtal>;
236	div = <3>;
237	mul = <25 0>;
238	status = "okay";
239};
240
241&usbhs {
242	pinctrl-0 = <&usbhs_default>;
243	pinctrl-names = "default";
244	maximum-speed = "high-speed";
245	status = "okay";
246
247	zephyr_udc0: udc {
248		status = "okay";
249
250		board_cdc_acm_uart: board_cdc_acm_uart {
251			compatible = "zephyr,cdc-acm-uart";
252		};
253	};
254};
255
256&usbhs_phy {
257	phys-clock-src = "xtal";
258};
259
260&adc0 {
261	status = "okay";
262	pinctrl-0 = <&adc0_default>;
263	pinctrl-names = "default";
264};
265
266&port_irq9 {
267	interrupts = <41 12>;
268	status = "okay";
269};
270
271&port_irq10 {
272	interrupts = <42 12>;
273	status = "okay";
274};
275
276&pwm1 {
277	pinctrl-0 = <&pwm1_default>;
278	pinctrl-names = "default";
279	interrupts = <63 1>, <64 1>;
280	interrupt-names = "gtioca", "overflow";
281	status = "okay";
282};
283
284&flash0 {
285	partitions {
286		compatible = "fixed-partitions";
287		#address-cells = <1>;
288		#size-cells = <1>;
289
290		boot_partition: partition@0 {
291			label = "mcuboot";
292			reg = <0x00000000 DT_SIZE_K(64)>;
293			read-only;
294		};
295
296		code_partition: partition@10000 {
297			label = "image-0";
298			reg = <0x00010000 (DT_SIZE_M(2) - DT_SIZE_K(64))>;
299		};
300	};
301};
302
303&flash1 {
304	partitions {
305		compatible = "fixed-partitions";
306		#address-cells = <1>;
307		#size-cells = <1>;
308
309		storage_partition: partition@0 {
310			label = "storage";
311			reg = <0X0 DT_SIZE_K(8)>;
312		};
313	};
314};
315
316&trng {
317	status = "okay";
318};
319
320&eth {
321	local-mac-address = [74 90 50 B0 5D E9];
322	status = "okay";
323	phy-handle = <&phy>;
324};
325
326&mdio {
327	pinctrl-0 = <&ether_default>;
328	pinctrl-names = "default";
329	status = "okay";
330
331	phy: ethernet-phy@0 {
332		compatible = "ethernet-phy";
333		reg = <0>;
334		status = "okay";
335	};
336};
337
338&pwm6 {
339	pinctrl-0 = <&pwm6_default>;
340	pinctrl-names = "default";
341	interrupts = <63 1>, <64 1>;
342	interrupt-names = "gtioca", "overflow";
343	status = "okay";
344
345	eth_clock: pwmclock {
346		status = "okay";
347		compatible = "pwm-clock";
348		clock-frequency = <DT_FREQ_M(25)>;
349		#clock-cells = <1>;
350		pwms = <&pwm6 1 PWM_KHZ(25000) PWM_POLARITY_NORMAL>;
351	};
352};
353
354#include "arduino_mkr_connector.dtsi"
355