1/*
2 * Copyright (c) 2024 Renesas Electronics Corporation
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6/dts-v1/;
7
8#include <renesas/ra/ra6/r7fa6e2bb3cfm.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
13#include "ek_ra6e2-pinctrl.dtsi"
14
15/ {
16	model = "Renesas EK-RA6E2";
17	compatible = "renesas,ra6e2", "renesas,ra";
18
19	chosen {
20		zephyr,sram = &sram0;
21		zephyr,flash = &flash0;
22		zephyr,console = &uart0;
23		zephyr,shell-uart = &uart0;
24		zephyr,canbus = &canfd0;
25		zephyr,entropy = &trng;
26	};
27
28	leds {
29		compatible = "gpio-leds";
30		led1: led1 {
31			gpios = <&ioport2 7 GPIO_ACTIVE_HIGH>;
32			label = "LED1";
33		};
34		led2: led2 {
35			gpios = <&ioport4 0 GPIO_ACTIVE_HIGH>;
36			label = "LED2";
37		};
38		led3: led3 {
39			gpios = <&ioport1 13 GPIO_ACTIVE_HIGH>;
40			label = "LED3";
41		};
42	};
43
44	buttons {
45		compatible = "gpio-keys";
46		button0: s1 {
47			gpios = <&ioport0 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
48			label = "Push button switch 1";
49			zephyr,code = <INPUT_KEY_0>;
50		};
51		button1: s2 {
52			gpios = <&ioport3 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
53			label = "Push button switch 2";
54			zephyr,code = <INPUT_KEY_1>;
55		};
56	};
57
58	aliases {
59		led0 = &led1;
60		sw0 = &button0;
61		sw1 = &button1;
62	};
63};
64
65&sci0 {
66	pinctrl-0 = <&sci0_default>;
67	pinctrl-names = "default";
68	status = "okay";
69	uart0: uart {
70		current-speed = <115200>;
71		status = "okay";
72	};
73};
74
75&ioport0 {
76	status = "okay";
77};
78
79&ioport1 {
80	status = "okay";
81};
82
83&spi0 {
84	pinctrl-0 = <&spi0_default>;
85	pinctrl-names = "default";
86	status = "okay";
87};
88
89&ioport2 {
90	status = "okay";
91};
92
93&ioport3 {
94	status = "okay";
95};
96
97&ioport4 {
98	status = "okay";
99};
100
101&flash0 {
102	partitions {
103		compatible = "fixed-partitions";
104		#address-cells = <1>;
105		#size-cells = <1>;
106
107		boot_partition: partition@0 {
108			label = "application";
109			reg = <0x00000000 DT_SIZE_K(128)>;
110		};
111
112		storage_partition: partition@20000 {
113			label = "storage";
114			reg = <0x20000 DT_SIZE_K(128)>;
115		};
116	};
117};
118
119&xtal {
120	clock-frequency = <DT_FREQ_M(20)>;
121	mosel = <0>;
122	#clock-cells = <0>;
123	status = "okay";
124};
125
126&subclk {
127	status = "okay";
128};
129
130&pll {
131	clocks = <&xtal>;
132	div = <1>;
133	mul = <10 0>;
134	status = "okay";
135};
136
137&canfdclk {
138	clocks = <&pll>;
139	div = <8>;
140	status = "okay";
141};
142
143&canfd_global {
144	status = "okay";
145	canfd0 {
146		pinctrl-0 = <&canfd0_default>;
147		pinctrl-names = "default";
148		rx-max-filters = <16>;
149		status = "okay";
150
151		can-transceiver {
152			max-bitrate = <5000000>;
153		};
154	};
155};
156
157&adc0 {
158	status = "okay";
159	pinctrl-0 = <&adc0_default>;
160	pinctrl-names = "default";
161};
162
163&port_irq9 {
164	interrupts = <4 12>;
165	status = "okay";
166};
167
168&port_irq10 {
169	interrupts = <5 12>;
170	status = "okay";
171};
172
173&pwm1 {
174	pinctrl-0 = <&pwm1_default>;
175	pinctrl-names = "default";
176	interrupts = <63 1>, <64 1>;
177	interrupt-names = "gtioca", "overflow";
178	divider = <RA_PWM_SOURCE_DIV_256>;
179	status = "okay";
180};
181
182&trng {
183	status ="okay";
184};
185