1/*
2 * Copyright (c) 2020 Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/h7/stm32h745Xi_m7.dtsi>
9#include "nucleo_h745zi_q.dtsi"
10
11/*
12 * WARNING:
13 * Possible pin conflicts: The pins PA2 and PB13 may conflict on selection of
14 * ETH_STM32_HAL, since they are used in ST Zio or ST morpho connectors. To
15 * avoid conflicting states the jumpers JP6 and JP7 must be in ON state.
16 */
17
18/ {
19	model = "STMicroelectronics STM32H745ZI-Q-NUCLEO board";
20	compatible = "st,stm32h745zi-q-nucleo";
21
22	/* HW resources belonging to CM7 */
23	chosen {
24		zephyr,console = &usart3;
25		zephyr,shell-uart = &usart3;
26		zephyr,dtcm = &dtcm;
27		zephyr,sram = &sram0;
28		zephyr,flash = &flash0;
29		zephyr,canbus = &fdcan1;
30	};
31
32	pwmleds {
33		compatible = "pwm-leds";
34
35		red_pwm_led: red_pwm_led {
36			pwms = <&pwm12 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
37			label = "User LD3 - PWM12";
38		};
39	};
40
41	aliases {
42		led0 = &green_led;
43		pwm-led0 = &red_pwm_led;
44		sw0 = &user_button;
45	};
46};
47
48&clk_lsi {
49	status = "okay";
50};
51
52&clk_hsi48 {
53	status = "okay";
54};
55
56&clk_hse {
57	hse-bypass;
58	clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
59	status = "okay";
60};
61
62&pll {
63	div-m = <1>;
64	mul-n = <120>;
65	div-p = <2>;
66	div-q = <8>;
67	div-r = <2>;
68	clocks = <&clk_hse>;
69	status = "okay";
70};
71
72&rcc {
73	clocks = <&pll>;
74	clock-frequency = <DT_FREQ_M(480)>;
75};
76
77&lpuart1 {
78	pinctrl-0 = <&lpuart1_tx_pb6 &lpuart1_rx_pb7>;
79	pinctrl-names = "default";
80	current-speed = <115200>;
81	status = "okay";
82};
83
84&usart3 {
85	pinctrl-0 = <&usart3_tx_pd8 &usart3_rx_pd9>;
86	pinctrl-names = "default";
87	current-speed = <115200>;
88	status = "okay";
89};
90
91&rtc {
92	clocks = <&rcc STM32_CLOCK(APB4, 16)>,
93		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
94	status = "okay";
95};
96
97&i2c1 {
98	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
99	pinctrl-names = "default";
100	status = "okay";
101	clock-frequency = <I2C_BITRATE_FAST>;
102};
103
104&timers12 {
105	st,prescaler = <10000>;
106	status = "okay";
107
108	pwm12: pwm {
109		status = "okay";
110		pinctrl-0 = <&tim12_ch1_pb14>;
111		pinctrl-names = "default";
112	};
113};
114
115&mac {
116	status = "okay";
117	pinctrl-0 = <&eth_ref_clk_pa1
118		     &eth_crs_dv_pa7
119		     &eth_rxd0_pc4
120		     &eth_rxd1_pc5
121		     &eth_tx_en_pg11
122		     &eth_txd0_pg13
123		     &eth_txd1_pb13>;
124	pinctrl-names = "default";
125	phy-connection-type = "rmii";
126	phy-handle = <&eth_phy>;
127};
128
129&mdio {
130	status = "okay";
131	pinctrl-0 = <&eth_mdio_pa2 &eth_mdc_pc1>;
132	pinctrl-names = "default";
133
134	eth_phy: ethernet-phy@0 {
135		compatible = "ethernet-phy";
136		reg = <0x00>;
137	};
138};
139
140&rng {
141	status = "okay";
142};
143
144&spi1 {
145	pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pb5>;
146	pinctrl-names = "default";
147	cs-gpios = <&gpiod 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
148	status = "okay";
149};
150
151zephyr_udc0: &usbotg_fs {
152	pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
153	pinctrl-names = "default";
154	status = "okay";
155};
156
157&fdcan1 {
158	pinctrl-0 = <&fdcan1_rx_pd0 &fdcan1_tx_pd1>;
159	/* HSE will be used by default. Uncomment below to enable APB1.2 120MHz clock */
160	/*
161	 * clocks = <&rcc STM32_CLOCK(APB1_2, 8)>,
162	 *	   <&rcc STM32_SRC_PLL1_Q FDCAN_SEL(1)>;
163	 */
164	pinctrl-names = "default";
165	status = "okay";
166};
167