1/*
2 * Copyright (c) 2020 Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6/dts-v1/;
7#include <st/h7/stm32h723Xg.dtsi>
8#include <st/h7/stm32h723zgtx-pinctrl.dtsi>
9#include "arduino_r3_connector.dtsi"
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/*
13 * WARNING:
14 * JP6 and SB72 must be ON when using Ethernet.
15 */
16
17/ {
18	model = "STMicroelectronics STM32H723ZG-NUCLEO board";
19	compatible = "st,stm32h723zg-nucleo";
20
21	chosen {
22		zephyr,console = &usart3;
23		zephyr,shell-uart = &usart3;
24		zephyr,dtcm = &dtcm;
25		zephyr,sram = &sram0;
26		zephyr,flash = &flash0;
27		zephyr,canbus = &fdcan1;
28	};
29
30	leds: leds {
31		compatible = "gpio-leds";
32
33		green_led: led_0 {
34			gpios = <&gpiob 0 GPIO_ACTIVE_HIGH>;
35			label = "User LD1";
36		};
37
38		yellow_led: led_1 {
39			gpios = <&gpioe 1 GPIO_ACTIVE_HIGH>;
40			label = "User LD2";
41		};
42
43		red_led: led_2 {
44			gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>;
45			label = "User LD3";
46		};
47	};
48
49	pwmleds {
50		compatible = "pwm-leds";
51
52		red_pwm_led: red_pwm_led {
53			pwms = <&pwm12 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
54			label = "User LD3 - PWM12";
55		};
56	};
57
58	gpio_keys {
59		compatible = "gpio-keys";
60
61		user_button: button_0 {
62			label = "User";
63			gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
64			zephyr,code = <INPUT_KEY_0>;
65		};
66	};
67
68	aliases {
69		led0 = &green_led;
70		led1 = &yellow_led;
71		led2 = &red_led;
72		pwm-led0 = &red_pwm_led;
73		sw0 = &user_button;
74	};
75};
76
77&clk_lsi {
78	status = "okay";
79};
80
81&clk_hsi48 {
82	status = "okay";
83};
84
85&clk_hse {
86	hse-bypass;
87	clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
88	status = "okay";
89};
90
91&clk_lse {
92	status = "okay";
93};
94
95&pll {
96	div-m = <4>;
97	mul-n = <275>;
98	div-p = <1>;
99	div-q = <4>;
100	div-r = <2>;
101	clocks = <&clk_hse>;
102	status = "okay";
103};
104
105&pll2 {
106	div-m = <1>;
107	mul-n = <10>;
108	div-p = <1>;
109	div-q = <1>;
110	div-r = <1>;
111	clocks = <&clk_hse>;
112	status = "okay";
113};
114
115&rcc {
116	clocks = <&pll>;
117	clock-frequency = <DT_FREQ_M(550)>;
118	d1cpre = <1>;
119	hpre = <2>;    /* HCLK: 275   MHz */
120	d1ppre = <2>;  /* APB1: 137.5 MHz */
121	d2ppre1 = <2>; /* APB2: 137.5 MHz */
122	d2ppre2 = <2>; /* APB3: 137.5 MHz */
123	d3ppre = <2>;  /* APB4: 137.5 MHz */
124};
125
126&lpuart1 {
127	pinctrl-0 = <&lpuart1_tx_pb6 &lpuart1_rx_pb7>;
128	pinctrl-names = "default";
129	current-speed = <115200>;
130	status = "okay";
131};
132
133&usart3 {
134	pinctrl-0 = <&usart3_tx_pd8 &usart3_rx_pd9>;
135	pinctrl-names = "default";
136	current-speed = <115200>;
137	status = "okay";
138};
139
140&usart2 {
141	pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pd6>;
142	pinctrl-names = "default";
143	current-speed = <115200>;
144	status = "okay";
145};
146
147&rtc {
148	clocks = <&rcc STM32_CLOCK(APB4, 16)>,
149		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
150	status = "okay";
151};
152
153&spi1 {
154	status = "okay";
155	pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pb5>;
156	pinctrl-names = "default";
157	cs-gpios = <&gpiod 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
158};
159
160&i2c1 {
161	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
162	pinctrl-names = "default";
163	status = "okay";
164	clock-frequency = <I2C_BITRATE_FAST>;
165};
166
167&backup_sram {
168	status = "okay";
169};
170
171&timers12 {
172	st,prescaler = <10000>;
173	status = "okay";
174
175	pwm12: pwm {
176		status = "okay";
177		pinctrl-0 = <&tim12_ch1_pb14>;
178		pinctrl-names = "default";
179	};
180};
181
182&mac {
183	status = "okay";
184	pinctrl-0 = <&eth_ref_clk_pa1
185		     &eth_crs_dv_pa7
186		     &eth_rxd0_pc4
187		     &eth_rxd1_pc5
188		     &eth_tx_en_pg11
189		     &eth_txd0_pg13
190		     &eth_txd1_pb13>;
191	pinctrl-names = "default";
192	phy-connection-type = "rmii";
193	phy-handle = <&eth_phy>;
194};
195
196&mdio {
197	status = "okay";
198	pinctrl-0 = <&eth_mdio_pa2 &eth_mdc_pc1>;
199	pinctrl-names = "default";
200
201	eth_phy: ethernet-phy@0 {
202		compatible = "ethernet-phy";
203		reg = <0>;
204	};
205};
206
207zephyr_udc0: &usbotg_hs {
208	pinctrl-0 = <&usb_otg_hs_dm_pa11 &usb_otg_hs_dp_pa12>;
209	pinctrl-names = "default";
210	status = "okay";
211};
212
213&rng {
214	status = "okay";
215};
216
217&fdcan1 {
218	pinctrl-0 = <&fdcan1_rx_pd0 &fdcan1_tx_pd1>;
219	pinctrl-names = "default";
220	clocks = <&rcc STM32_CLOCK(APB1_2, 8)>,
221		 <&rcc STM32_SRC_PLL2_Q FDCAN_SEL(2)>;
222	status = "okay";
223};
224