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		green_led: led_0 {
33			gpios = <&gpiob 0 GPIO_ACTIVE_HIGH>;
34			label = "User LD1";
35		};
36		yellow_led: led_1 {
37			gpios = <&gpioe 1 GPIO_ACTIVE_HIGH>;
38			label = "User LD2";
39		};
40		red_led: led_2 {
41			gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>;
42			label = "User LD3";
43		};
44	};
45
46	pwmleds {
47		compatible = "pwm-leds";
48
49		red_pwm_led: red_pwm_led {
50			pwms = <&pwm12 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
51			label = "User LD3 - PWM12";
52		};
53	};
54
55	gpio_keys {
56		compatible = "gpio-keys";
57		user_button: button_0 {
58			label = "User";
59			gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
60			zephyr,code = <INPUT_KEY_0>;
61		};
62	};
63
64	aliases {
65		led0 = &green_led;
66		led1 = &yellow_led;
67		led2 = &red_led;
68		pwm-led0 = &red_pwm_led;
69		sw0 = &user_button;
70	};
71};
72
73&clk_lsi {
74	status = "okay";
75};
76
77&clk_hsi48 {
78	status = "okay";
79};
80
81&clk_hse {
82	hse-bypass;
83	clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
84	status = "okay";
85};
86
87&clk_lse {
88	status = "okay";
89};
90
91&pll {
92	div-m = <4>;
93	mul-n = <275>;
94	div-p = <1>;
95	div-q = <4>;
96	div-r = <2>;
97	clocks = <&clk_hse>;
98	status = "okay";
99};
100
101&pll2 {
102	div-m = <1>;
103	mul-n = <10>;
104	div-p = <1>;
105	div-q = <1>;
106	div-r = <1>;
107	clocks = <&clk_hse>;
108	status = "okay";
109};
110
111&rcc {
112	clocks = <&pll>;
113	clock-frequency = <DT_FREQ_M(550)>;
114	d1cpre = <1>;
115	hpre = <2>;    /* HCLK: 275   MHz */
116	d1ppre = <2>;  /* APB1: 137.5 MHz */
117	d2ppre1 = <2>; /* APB2: 137.5 MHz */
118	d2ppre2 = <2>; /* APB3: 137.5 MHz */
119	d3ppre = <2>;  /* APB4: 137.5 MHz */
120};
121
122&usart3 {
123	pinctrl-0 = <&usart3_tx_pd8 &usart3_rx_pd9>;
124	pinctrl-names = "default";
125	current-speed = <115200>;
126	status = "okay";
127};
128
129&usart2 {
130	pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pd6>;
131	pinctrl-names = "default";
132	current-speed = <115200>;
133	status = "okay";
134};
135
136&rtc {
137	clocks = <&rcc STM32_CLOCK_BUS_APB4 0x00010000>,
138		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
139	status = "okay";
140};
141
142&spi1 {
143	status = "okay";
144	pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pb5>;
145	pinctrl-names = "default";
146	cs-gpios = <&gpiod 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
147};
148
149&i2c1 {
150	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
151	pinctrl-names = "default";
152	status = "okay";
153	clock-frequency = <I2C_BITRATE_FAST>;
154};
155
156&backup_sram {
157	status = "okay";
158};
159
160&timers12 {
161	st,prescaler = <10000>;
162	status = "okay";
163
164	pwm12: pwm {
165		status = "okay";
166		pinctrl-0 = <&tim12_ch1_pb14>;
167		pinctrl-names = "default";
168	};
169};
170
171&mac {
172	status = "okay";
173	pinctrl-0 = <&eth_ref_clk_pa1
174		     &eth_crs_dv_pa7
175		     &eth_rxd0_pc4
176		     &eth_rxd1_pc5
177		     &eth_tx_en_pg11
178		     &eth_txd0_pg13
179		     &eth_txd1_pb13>;
180	pinctrl-names = "default";
181};
182
183&mdio {
184	status = "okay";
185	pinctrl-0 = <&eth_mdio_pa2 &eth_mdc_pc1>;
186	pinctrl-names = "default";
187
188	phy: ethernet-phy@0 {
189		compatible = "ethernet-phy";
190		reg = <0>;
191		status = "okay";
192	};
193};
194
195zephyr_udc0: &usbotg_hs {
196	pinctrl-0 = <&usb_otg_hs_dm_pa11 &usb_otg_hs_dp_pa12>;
197	pinctrl-names = "default";
198	status = "okay";
199};
200
201&rng {
202	status = "okay";
203};
204
205&fdcan1 {
206	pinctrl-0 = <&fdcan1_rx_pd0 &fdcan1_tx_pd1>;
207	pinctrl-names = "default";
208	clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00000100>,
209		 <&rcc STM32_SRC_PLL2_Q FDCAN_SEL(2)>;
210	status = "okay";
211};
212