1/*
2 * Copyright (c) 2025 STMicroelectronics
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <st/n6/stm32n657X0.dtsi>
8#include <st/n6/stm32n657x0hxq-pinctrl.dtsi>
9#include "arduino_r3_connector.dtsi"
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/ {
13	chosen {
14		zephyr,console = &usart1;
15		zephyr,shell-uart = &usart1;
16		zephyr,sram = &axisram2;
17		zephyr,canbus = &fdcan1;
18	};
19
20	aliases {
21		led0 = &green_led_1;
22	};
23
24	leds: leds {
25		compatible = "gpio-leds";
26
27		green_led_1: led_1 {
28			gpios = <&gpioo 1 GPIO_ACTIVE_HIGH>;
29			label = "User LD1";
30		};
31
32		red_led_1: led_2 {
33			gpios = <&gpiog 10 GPIO_ACTIVE_HIGH>;
34			label = "User LD2";
35		};
36	};
37};
38
39&clk_hsi {
40	hsi-div = <1>;
41	status = "okay";
42};
43
44&pll1 {
45	clocks = <&clk_hsi>;
46	div-m = <4>;
47	mul-n = <75>;
48	div-p1 = <1>;
49	div-p2 = <1>;
50	status = "okay";
51};
52
53&ic1 {
54	pll-src = <1>;
55	ic-div = <2>;
56	status = "okay";
57};
58
59&ic2 {
60	pll-src = <1>;
61	ic-div = <3>;
62	status = "okay";
63};
64
65&ic6 {
66	pll-src = <1>;
67	ic-div = <2>;
68	status = "okay";
69};
70
71&ic11 {
72	pll-src = <1>;
73	ic-div = <3>;
74	status = "okay";
75};
76
77&perck {
78	clocks = <&rcc STM32_SRC_HSI PER_SEL(0)>;
79	status = "okay";
80};
81
82&cpusw {
83	clocks = <&rcc STM32_SRC_IC1 CPU_SEL(3)>;
84	clock-frequency = <DT_FREQ_M(600)>;
85	status = "okay";
86};
87
88&rcc {
89	/* ic2, ic6 & ic11 must all be enabled to set ic2 as SYSCLK */
90	clocks = <&ic2>;
91	clock-frequency = <DT_FREQ_M(400)>;
92	ahb-prescaler = <2>;
93	apb1-prescaler = <1>;
94	apb2-prescaler = <1>;
95	apb4-prescaler = <1>;
96	apb5-prescaler = <1>;
97};
98
99&adc1 {
100	clocks = <&rcc STM32_CLOCK(AHB1, 5)>,
101		 <&rcc STM32_SRC_CKPER ADC12_SEL(1)>;
102	pinctrl-0 = <&adc1_inp10_pa9 &adc1_inp11_pa10>; /* Arduino A1 & A2 */
103	pinctrl-names = "default";
104	vref-mv = <1800>;
105	status = "okay";
106};
107
108&fdcan1 {
109	clocks = <&rcc STM32_CLOCK(APB1_2, 8)>,
110		 <&rcc STM32_SRC_CKPER FDCAN_SEL(1)>;
111	pinctrl-0 = <&fdcan1_rx_pd0 &fdcan1_tx_ph2>;
112	pinctrl-names = "default";
113	status = "okay";
114};
115
116&i2c1 {
117	clocks = <&rcc STM32_CLOCK(APB1, 21)>,
118		 <&rcc STM32_SRC_CKPER I2C1_SEL(1)>;
119	pinctrl-0 = <&i2c1_scl_ph9 &i2c1_sda_pc1>;
120	pinctrl-names = "default";
121	clock-frequency = <I2C_BITRATE_STANDARD>;
122	status = "okay";
123};
124
125&i2c4 {
126	clocks = <&rcc STM32_CLOCK(APB4, 7)>,
127		 <&rcc STM32_SRC_CKPER I2C4_SEL(1)>;
128	pinctrl-0 = <&i2c4_scl_pe13 &i2c4_sda_pe14>;
129	pinctrl-names = "default";
130	clock-frequency = <I2C_BITRATE_STANDARD>;
131	status = "okay";
132};
133
134&spi5 {
135	clocks = <&rcc STM32_CLOCK(APB2, 20)>,
136		 <&rcc STM32_SRC_CKPER SPI5_SEL(1)>;
137	pinctrl-0 = <&spi5_nss_pa3 &spi5_sck_pe15 &spi5_miso_ph8 &spi5_mosi_pg2>;
138	pinctrl-names = "default";
139	status = "okay";
140};
141
142&usart1 {
143	clocks = <&rcc STM32_CLOCK(APB2, 4)>,
144		 <&rcc STM32_SRC_CKPER USART1_SEL(1)>;
145	pinctrl-0 = <&usart1_tx_pe5 &usart1_rx_pe6>;
146	pinctrl-names = "default";
147	current-speed = <115200>;
148	status = "okay";
149};
150
151&usart2 {
152	clocks = <&rcc STM32_CLOCK(APB1, 17)>,
153		 <&rcc STM32_SRC_CKPER USART2_SEL(1)>;
154	pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pf6>;
155	pinctrl-names = "default";
156	current-speed = <115200>;
157	status = "okay";
158};
159