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