1/*
2 * Copyright (c) 2024 zack jiang <1125934312@qq.com>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/h7/stm32h750Xb.dtsi>
9#include <st/h7/stm32h750vbtx-pinctrl.dtsi>
10#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
13
14/ {
15	model = "FANKE FK750M1-VBT6 board";
16	compatible = "fanke,fk750m1-vbt6";
17
18	chosen {
19		zephyr,console = &usart1;
20		zephyr,shell-uart = &usart1;
21		zephyr,sram = &sram0;
22		zephyr,flash = &flash0;
23		zephyr,display = &st7789v_240x240;
24	};
25
26	leds {
27		compatible = "gpio-leds";
28		user_led: led_0 {
29			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
30			label = "User LED";
31		};
32	};
33
34	aliases {
35		led0 = &user_led;
36	};
37
38	mipi_dbi_st7789v_240x240 {
39		compatible = "zephyr,mipi-dbi-spi";
40		spi-dev = <&spi4>;
41		dc-gpios = <&gpioe 15 GPIO_ACTIVE_HIGH>;
42		#address-cells = <1>;
43		#size-cells = <0>;
44
45		st7789v_240x240: st7789v@0 {
46			compatible = "sitronix,st7789v";
47			mipi-max-frequency = <20000000>;
48			reg = <0>;
49			width = <240>;
50			height = <240>;
51			x-offset = <0>;
52			y-offset = <0>;
53			vcom = <0x19>;
54			gctrl = <0x35>;
55			vrhs = <0x12>;
56			vdvs = <0x20>;
57			mdac = <0x00>;
58			gamma = <0x01>;
59			colmod = <0x05>;
60			lcm = <0x2c>;
61			porch-param = [0c 0c 00 33 33];
62			cmd2en-param = [5a 69 02 01];
63			pwctrl1-param = [a4 a1];
64			pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23];
65			nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23];
66			ram-param = [00 F0];
67			rgb-param = [CD 08 14];
68			mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE";
69		};
70	};
71};
72
73&clk_hsi48 {
74	status = "okay";
75};
76
77&clk_hse {
78	clock-frequency = <DT_FREQ_M(25)>;
79	status = "okay";
80};
81
82&pll {
83	div-m = <5>;
84	mul-n = <192>;
85	div-p = <2>;
86	div-q = <4>;
87	div-r = <4>;
88	clocks = <&clk_hse>;
89	status = "okay";
90};
91
92&pll3 {
93	div-m = <5>;
94	mul-n = <192>;
95	div-p = <2>;
96	div-q = <20>;
97	div-r = <99>;
98	clocks = <&clk_hse>;
99	status = "okay";
100};
101
102&rcc {
103	clocks = <&pll>;
104	clock-frequency = <DT_FREQ_M(480)>;
105	d1cpre = <1>;
106	hpre = <2>;
107	d1ppre = <2>;
108	d2ppre1 = <2>;
109	d2ppre2 = <2>;
110	d3ppre = <2>;
111};
112
113&quadspi {
114	pinctrl-0 = <&quadspi_bk1_io0_pd11 &quadspi_bk1_io1_pd12
115		     &quadspi_bk1_io2_pe2 &quadspi_bk1_io3_pd13
116		     &quadspi_clk_pb2 &quadspi_bk1_ncs_pb6>;
117	pinctrl-names = "default";
118	status = "okay";
119
120	/* Winbond external flash */
121	w25q64_qspi: qspi-nor-flash@90000000 {
122		compatible = "st,stm32-qspi-nor";
123		reg = <0x90000000 DT_SIZE_M(64)>; /* 64 Mbits */
124		qspi-max-frequency = <40000000>;
125		status = "okay";
126		spi-bus-width = <4>;
127		writeoc = "PP_1_1_4";
128
129		partitions {
130			compatible = "fixed-partitions";
131			#address-cells = <1>;
132			#size-cells = <1>;
133			storage_partition: partition@0 {
134				label = "storage";
135				reg = <0x00000000 DT_SIZE_M(64)>;
136			};
137		};
138	};
139};
140
141&spi4 {
142	pinctrl-0 = <&spi4_sck_pe12 &spi4_mosi_pe14>;
143	cs-gpios = <&gpioe 11 GPIO_ACTIVE_LOW>;
144	pinctrl-names = "default";
145	status = "okay";
146};
147
148&gpiod {
149	status = "okay";
150
151	lcd_led {
152		gpio-hog;
153		gpios = <15 GPIO_ACTIVE_HIGH>;
154		output-high;
155	};
156};
157
158&usart1 {
159	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
160	pinctrl-names = "default";
161	current-speed = <115200>;
162	status = "okay";
163};
164
165&backup_sram {
166	status = "okay";
167};
168
169&rng {
170	status = "okay";
171};
172