1// SPDX-License-Identifier: GPL-2.0+
2/dts-v1/;
3#include "aspeed-g5.dtsi"
4#include <dt-bindings/gpio/aspeed-gpio.h>
5#include <dt-bindings/leds/common.h>
6
7/ {
8	model = "Asrock Rack X570D4U BMC";
9	compatible = "asrock,x570d4u-bmc", "aspeed,ast2500";
10
11	aliases {
12		i2c40 = &i2c4mux0ch0;
13		i2c41 = &i2c4mux0ch1;
14		i2c42 = &i2c4mux0ch2;
15		i2c43 = &i2c4mux0ch3;
16	};
17
18	chosen {
19		stdout-path = &uart5;
20	};
21
22	memory@80000000 {
23		reg = <0x80000000 0x20000000>;
24	};
25
26	reserved-memory {
27		#address-cells = <1>;
28		#size-cells = <1>;
29		ranges;
30
31		pci_memory: region@9a000000 {
32			no-map;
33			reg = <0x9a000000 0x00010000>; /* 64K */
34		};
35
36		video_engine_memory: jpegbuffer {
37			size = <0x02800000>;	/* 40M */
38			alignment = <0x01000000>;
39			compatible = "shared-dma-pool";
40			reusable;
41		};
42
43		gfx_memory: framebuffer {
44			size = <0x01000000>;
45			alignment = <0x01000000>;
46			compatible = "shared-dma-pool";
47			reusable;
48		};
49	};
50
51	leds {
52		compatible = "gpio-leds";
53
54		led-0 {
55			/* led-heartbeat-n */
56			gpios = <&gpio ASPEED_GPIO(H, 6) GPIO_ACTIVE_LOW>;
57			color = <LED_COLOR_ID_GREEN>;
58			function = LED_FUNCTION_HEARTBEAT;
59			linux,default-trigger = "timer";
60		};
61
62		led-1 {
63			/* led-fault-n */
64			gpios = <&gpio ASPEED_GPIO(Z, 2) GPIO_ACTIVE_LOW>;
65			color = <LED_COLOR_ID_AMBER>;
66			function = LED_FUNCTION_FAULT;
67			panic-indicator;
68		};
69	};
70
71	iio-hwmon {
72		compatible = "iio-hwmon";
73		io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>, <&adc 4>,
74			<&adc 5>, <&adc 6>, <&adc 7>, <&adc 8>, <&adc 9>,
75			<&adc 10>, <&adc 11>, <&adc 12>;
76	};
77};
78
79&gpio {
80	status = "okay";
81	gpio-line-names =
82	/*A0-A3*/       "status-locatorled-n",                    "",                      "button-nmi-n",          "",
83	/*A4-A7*/       "",                                       "",                      "",                      "",
84	/*B0-B3*/       "input-bios-post-cmplt-n",                "",                      "",                      "",
85	/*B4-B7*/       "",                                       "",                      "",                      "",
86	/*C0-C3*/       "",                                       "",                      "",                      "",
87	/*C4-C7*/       "",                                       "",                      "control-locatorbutton", "",
88	/*D0-D3*/       "button-power",                           "control-power",         "button-reset",          "control-reset",
89	/*D4-D7*/       "",                                       "",                      "",                      "",
90	/*E0-E3*/       "",                                       "",                      "",                      "",
91	/*E4-E7*/       "",                                       "",                      "",                      "",
92	/*F0-F3*/       "",                                       "",                      "",                      "",
93	/*F4-F7*/       "",                                       "",                      "",                      "",
94	/*G0-G3*/       "output-rtc-battery-voltage-read-enable", "input-id0",             "input-id1",             "input-id2",
95	/*G4-G7*/       "input-alert1-n",                         "input-alert2-n",        "input-alert3-n",        "",
96	/*H0-H3*/       "",                                       "",                      "",                      "",
97	/*H4-H7*/       "input-mfg",                              "",                      "led-heartbeat-n",       "input-caseopen",
98	/*I0-I3*/       "",                                       "",                      "",                      "",
99	/*I4-I7*/       "",                                       "",                      "",                      "",
100	/*J0-J3*/       "output-bmc-ready",                       "",                      "",                      "",
101	/*J4-J7*/       "",                                       "",                      "",                      "",
102	/*K0-K3*/       "",                                       "",                      "",                      "",
103	/*K4-K7*/       "",                                       "",                      "",                      "",
104	/*L0-L3*/       "",                                       "",                      "",                      "",
105	/*L4-L7*/       "",                                       "",                      "",                      "",
106	/*M0-M3*/       "",                                       "",                      "",                      "",
107	/*M4-M7*/       "",                                       "",                      "",                      "",
108	/*N0-N3*/       "",                                       "",                      "",                      "",
109	/*N4-N7*/       "",                                       "",                      "",                      "",
110	/*O0-O3*/       "",                                       "",                      "",                      "",
111	/*O4-O7*/       "",                                       "",                      "",                      "",
112	/*P0-P3*/       "",                                       "",                      "",                      "",
113	/*P4-P7*/       "",                                       "",                      "",                      "",
114	/*Q0-Q3*/       "",                                       "",                      "",                      "",
115	/*Q4-Q7*/       "",                                       "",                      "",                      "",
116	/*R0-R3*/       "",                                       "",                      "",                      "",
117	/*R4-R7*/       "",                                       "",                      "",                      "",
118	/*S0-S3*/       "input-bmc-pchhot-n",                     "",                      "",                      "",
119	/*S4-S7*/       "",                                       "",                      "",                      "",
120	/*T0-T3*/       "",                                       "",                      "",                      "",
121	/*T4-T7*/       "",                                       "",                      "",                      "",
122	/*U0-U3*/       "",                                       "",                      "",                      "",
123	/*U4-U7*/       "",                                       "",                      "",                      "",
124	/*V0-V3*/       "",                                       "",                      "",                      "",
125	/*V4-V7*/       "",                                       "",                      "",                      "",
126	/*W0-W3*/       "",                                       "",                      "",                      "",
127	/*W4-W7*/       "",                                       "",                      "",                      "",
128	/*X0-X3*/       "",                                       "",                      "",                      "",
129	/*X4-X7*/       "",                                       "",                      "",                      "",
130	/*Y0-Y3*/       "",                                       "",                      "",                      "",
131	/*Y4-Y7*/       "",                                       "",                      "",                      "",
132	/*Z0-Z3*/       "",                                       "",                      "led-fault-n",           "output-bmc-throttle-n",
133	/*Z4-Z7*/       "",                                       "",                      "",                      "",
134	/*AA0-AA3*/     "input-cpu1-thermtrip-latch-n",           "",                      "input-cpu1-prochot-n",  "",
135	/*AA4-AC7*/     "",                                       "",                      "",                      "",
136	/*AB0-AB3*/     "",                                       "",                      "",                      "",
137	/*AB4-AC7*/     "",                                       "",                      "",                      "",
138	/*AC0-AC3*/     "",                                       "",                      "",                      "",
139	/*AC4-AC7*/     "",                                       "",                      "",                      "";
140};
141
142&fmc {
143	status = "okay";
144	flash@0 {
145		status = "okay";
146		label = "bmc";
147		m25p,fast-read;
148		spi-max-frequency = <10000000>;
149#include "openbmc-flash-layout-64.dtsi"
150	};
151};
152
153&uart5 {
154	status = "okay";
155};
156
157&vuart {
158	status = "okay";
159};
160
161&mac0 {
162	status = "okay";
163	pinctrl-names = "default";
164	pinctrl-0 = <&pinctrl_rgmii1_default &pinctrl_mdio1_default>;
165
166	nvmem-cells = <&eth0_macaddress>;
167	nvmem-cell-names = "mac-address";
168};
169
170&mac1 {
171	status = "okay";
172	pinctrl-names = "default";
173	pinctrl-0 = <&pinctrl_rmii2_default &pinctrl_mdio2_default>;
174	use-ncsi;
175
176	nvmem-cells = <&eth1_macaddress>;
177	nvmem-cell-names = "mac-address";
178};
179
180&i2c0 {
181	/* SMBus on auxiliary panel header (AUX_PANEL1) */
182	status = "okay";
183};
184
185&i2c1 {
186	status = "okay";
187
188	w83773g@4c {
189		compatible = "nuvoton,w83773g";
190		reg = <0x4c>;
191	};
192};
193
194&i2c2 {
195	/* PSU SMBus (PSU_SMB1) */
196	status = "okay";
197};
198
199&i2c3 {
200	status = "okay";
201};
202
203&i2c4 {
204	status = "okay";
205
206	i2c-mux@70 {
207		compatible = "nxp,pca9545";
208		reg = <0x70>;
209		#address-cells = <1>;
210		#size-cells = <0>;
211
212		i2c4mux0ch0: i2c@0 {
213			/* SMBus on PCI express 16x slot */
214			#address-cells = <1>;
215			#size-cells = <0>;
216			reg = <0>;
217		};
218
219		i2c4mux0ch1: i2c@1 {
220			/* SMBus on PCI express 8x slot */
221			#address-cells = <1>;
222			#size-cells = <0>;
223			reg = <1>;
224		};
225
226		i2c4mux0ch2: i2c@2 {
227			/* Unknown */
228			#address-cells = <1>;
229			#size-cells = <0>;
230			reg = <2>;
231		};
232
233		i2c4mux0ch3: i2c@3 {
234			/* SMBus on PCI express 1x slot */
235			#address-cells = <1>;
236			#size-cells = <0>;
237			reg = <3>;
238		};
239	};
240};
241
242&i2c5 {
243	status = "okay";
244};
245
246&i2c7 {
247	/* FRU and SPD EEPROM SMBus */
248	status = "okay";
249
250	eeprom@57 {
251		compatible = "st,24c128", "atmel,24c128";
252		reg = <0x57>;
253		pagesize = <16>;
254		#address-cells = <1>;
255		#size-cells = <1>;
256
257		eth0_macaddress: macaddress@3f80 {
258			reg = <0x3f80 6>;
259		};
260
261		eth1_macaddress: macaddress@3f88 {
262			reg = <0x3f88 6>;
263		};
264	};
265};
266
267&gfx {
268	status = "okay";
269};
270
271&pinctrl {
272	aspeed,external-nodes = <&gfx &lhc>;
273};
274
275&vhub {
276	status = "okay";
277};
278
279&ehci1 {
280	status = "okay";
281};
282
283&uhci {
284	status = "okay";
285};
286
287&kcs3 {
288	aspeed,lpc-io-reg = <0xca2>;
289	status = "okay";
290};
291
292&lpc_ctrl {
293	status = "okay";
294};
295
296&lpc_snoop {
297	status = "okay";
298	snoop-ports = <0x80>;
299};
300
301&p2a {
302	status = "okay";
303	memory-region = <&pci_memory>;
304};
305
306&video {
307	status = "okay";
308	memory-region = <&video_engine_memory>;
309};
310
311&pwm_tacho {
312	status = "okay";
313	pinctrl-names = "default";
314	pinctrl-0 = <&pinctrl_pwm0_default
315				&pinctrl_pwm1_default
316				&pinctrl_pwm2_default
317				&pinctrl_pwm3_default
318				&pinctrl_pwm4_default
319				&pinctrl_pwm5_default>;
320
321	fan@0 {
322		/* FAN1 (4-pin) */
323		reg = <0x00>;
324		aspeed,fan-tach-ch = /bits/ 8 <0x00>;
325	};
326
327	fan@1 {
328		/* FAN2 (4-pin) */
329		reg = <0x01>;
330		aspeed,fan-tach-ch = /bits/ 8 <0x01>;
331	};
332
333	fan@2 {
334		/* FAN3 (4-pin) */
335		reg = <0x02>;
336		aspeed,fan-tach-ch = /bits/ 8 <0x02>;
337	};
338
339	fan@3 {
340		/* FAN4 (6-pin) */
341		reg = <0x03>;
342		aspeed,fan-tach-ch = /bits/ 8 <0x04 0x0b>;
343	};
344
345	fan@4 {
346		/* FAN6 (6-pin) */
347		reg = <0x04>;
348		aspeed,fan-tach-ch = /bits/ 8 <0x06 0x0d>;
349	};
350
351	fan@5 {
352		/* FAN5 (6-pin) */
353		reg = <0x05>;
354		aspeed,fan-tach-ch = /bits/ 8 <0x05 0x0c>;
355	};
356};
357
358&adc {
359	status = "okay";
360	pinctrl-names = "default";
361	pinctrl-0 = <&pinctrl_adc0_default
362				&pinctrl_adc1_default
363				&pinctrl_adc2_default
364				&pinctrl_adc3_default
365				&pinctrl_adc4_default
366				&pinctrl_adc5_default
367				&pinctrl_adc6_default
368				&pinctrl_adc7_default
369				&pinctrl_adc8_default
370				&pinctrl_adc9_default
371				&pinctrl_adc10_default
372				&pinctrl_adc11_default
373				&pinctrl_adc12_default
374				&pinctrl_adc13_default
375				&pinctrl_adc14_default
376				&pinctrl_adc15_default>;
377};
378