1// SPDX-License-Identifier: GPL-2.0+
2/dts-v1/;
3
4#include "aspeed-g5.dtsi"
5#include <dt-bindings/gpio/aspeed-gpio.h>
6#include <dt-bindings/i2c/i2c.h>
7#include <dt-bindings/interrupt-controller/irq.h>
8
9/{
10	model = "ASRock SPC621D8HM3 BMC";
11	compatible = "asrock,spc621d8hm3-bmc", "aspeed,ast2500";
12
13	aliases {
14		serial4 = &uart5;
15
16		i2c20 = &i2c1mux0ch0;
17		i2c21 = &i2c1mux0ch1;
18	};
19
20	chosen {
21		stdout-path = &uart5;
22		bootargs = "console=tty0 console=ttyS4,115200 earlycon";
23	};
24
25	memory@80000000 {
26		reg = <0x80000000 0x20000000>;
27	};
28
29	leds {
30		compatible = "gpio-leds";
31
32		heartbeat {
33			gpios = <&gpio ASPEED_GPIO(H, 6) GPIO_ACTIVE_LOW>;
34			linux,default-trigger = "timer";
35		};
36
37		system-fault {
38			gpios = <&gpio ASPEED_GPIO(Z, 2) GPIO_ACTIVE_LOW>;
39			panic-indicator;
40		};
41	};
42
43	iio-hwmon {
44		compatible = "iio-hwmon";
45		io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
46			<&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>,
47			<&adc 8>, <&adc 9>, <&adc 10>, <&adc 11>,
48			<&adc 12>, <&adc 13>, <&adc 14>, <&adc 15>;
49	};
50};
51
52&fmc {
53	status = "okay";
54	flash@0 {
55		status = "okay";
56		m25p,fast-read;
57		label = "bmc";
58		spi-max-frequency = <50000000>; /* 50 MHz */
59#include "openbmc-flash-layout-64.dtsi"
60	};
61};
62
63&spi1 {
64	status = "okay";
65	pinctrl-names = "default";
66	pinctrl-0 = <&pinctrl_spi1_default>;
67	flash@0 {
68		status = "okay";
69		label = "bios";
70		m25p,fast-read;
71		spi-max-frequency = <17000000>; /* 17 MHz */
72	};
73};
74
75&uart5 {
76	status = "okay";
77};
78
79&vuart {
80	status = "okay";
81	aspeed,lpc-io-reg = <0x2f8>;
82	aspeed,lpc-interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
83};
84
85&mac0 {
86	status = "okay";
87
88	pinctrl-names = "default";
89	pinctrl-0 = <&pinctrl_rgmii1_default &pinctrl_mdio1_default>;
90
91	nvmem-cells = <&eth0_macaddress>;
92	nvmem-cell-names = "mac-address";
93};
94
95&i2c0 {
96	status = "okay";
97};
98
99&i2c1 {
100	status = "okay";
101
102	/* hardware monitor/thermal sensor */
103	temperature-sensor@29 {
104		compatible = "nuvoton,nct7802";
105		reg = <0x29>;
106	};
107
108	/* motherboard temp sensor (TMP1, near BMC) */
109	temperature-sensor@4c {
110		compatible = "nuvoton,w83773g";
111		reg = <0x4c>;
112	};
113
114	/* motherboard FRU eeprom */
115	eeprom@50 {
116		compatible = "st,24c128", "atmel,24c128";
117		reg = <0x50>;
118		pagesize = <16>;
119
120		nvmem-layout {
121			compatible = "fixed-layout";
122			#address-cells = <1>;
123			#size-cells = <1>;
124
125			eth0_macaddress: macaddress@3f80 {
126				reg = <0x3f80 6>;
127			};
128		};
129	};
130
131	/* M.2 slot smbus mux */
132	i2c-mux@71 {
133		compatible = "nxp,pca9545";
134		reg = <0x71>;
135		#address-cells = <1>;
136		#size-cells = <0>;
137
138		i2c1mux0ch0: i2c@0 {
139			#address-cells = <1>;
140			#size-cells = <0>;
141			reg = <0>;
142		};
143
144		i2c1mux0ch1: i2c@1 {
145			#address-cells = <1>;
146			#size-cells = <0>;
147			reg = <1>;
148		};
149	};
150};
151
152&i2c2 {
153	status = "okay";
154};
155
156&i2c3 {
157	status = "okay";
158};
159
160&i2c4 {
161	status = "okay";
162};
163
164&i2c5 {
165	status = "okay";
166};
167
168&i2c6 {
169	status = "okay";
170};
171
172&i2c7 {
173	status = "okay";
174};
175
176&i2c8 {
177	status = "okay";
178};
179
180&i2c9 {
181	status = "okay";
182};
183
184&i2c10 {
185	status = "okay";
186};
187
188&i2c11 {
189	status = "okay";
190};
191
192&i2c12 {
193	status = "okay";
194};
195
196&i2c13 {
197	status = "okay";
198};
199
200&video {
201	status = "okay";
202};
203
204&vhub {
205	status = "okay";
206};
207
208&lpc_ctrl {
209	status = "okay";
210};
211
212&lpc_snoop {
213	status = "okay";
214	snoop-ports = <0x80>;
215};
216
217&kcs3 {
218	status = "okay";
219	aspeed,lpc-io-reg = <0xca2>;
220};
221
222&peci0 {
223	status = "okay";
224};
225
226&pwm_tacho {
227	status = "okay";
228	pinctrl-names = "default";
229	pinctrl-0 = <&pinctrl_pwm0_default
230		&pinctrl_pwm2_default
231		&pinctrl_pwm3_default
232		&pinctrl_pwm4_default>;
233
234	fan@0 {
235		reg = <0x00>;
236		aspeed,fan-tach-ch = /bits/ 8 <0x00>;
237	};
238
239	fan@2 {
240		reg = <0x02>;
241		aspeed,fan-tach-ch = /bits/ 8 <0x02>;
242	};
243
244	fan@3 {
245		reg = <0x03>;
246		aspeed,fan-tach-ch = /bits/ 8 <0x03>;
247	};
248
249	fan@4 {
250		reg = <0x04>;
251		aspeed,fan-tach-ch = /bits/ 8 <0x04>;
252	};
253};
254
255&gpio {
256	status = "okay";
257	gpio-line-names =
258		/*  A */ "LOCATORLED_STATUS_N", "LOCATORBTN_N",
259			"BMC_READY_N", "FM_SPD_DDRCPU_LVLSHFT_EN",
260			"", "", "", "",
261		/*  B */ "NODE_ID_1", "NODE_ID_2", "PSU_FAN_FAIL_N", "",
262			"", "", "", "GPIO_RST",
263		/*  C */ "", "", "", "", "", "", "", "",
264		/*  D */ "FP_PWR_BTN_MUX_N", "FM_BMC_PWRBTN_OUT_N",
265			"FP_RST_BTN_N", "RST_BMC_RSTBTN_OUT_N",
266			"NMI_BTN_N", "BMC_NMI",
267			"", "",
268		/*  E */ "", "", "", "FM_ME_RCVR_N", "", "", "", "",
269		/*  F */ "BMC_SMB_SEL_N", "FM_CPU2_DISABLE_COD_N",
270			"FM_REMOTE_DEBUG_BMC_EN", "FM_CPU_ERR0_LVT3_EN",
271			"FM_CPU_ERR1_LVT3_EN", "FM_CPU_ERR2_LVT3_EN",
272			"FM_MEM_THERM_EVENT_CPU1_LVT3_N", "FM_MEM_THERM_EVENT_CPU2_LVT3_N",
273		/*  G */ "HWM_BAT_EN", "", "BMC_PHYRST_N", "FM_BIOS_SPI_BMC_CTRL",
274			"BMC_ALERT1_N", "BMC_ALERT2_N", "BMC_ALERT3_N", "IRQ_SML0_ALERT_N",
275		/*  H */ "BMC_SMB_PRESENT_1_N", "FM_PCH_CORE_VID_0", "FM_PCH_CORE_VID_1", "",
276			"FM_MFG_MODE", "BMC_RTCRST", "BMC_HB_LED_N", "BMC_CASEOPEN",
277		/*  I */ "IRQ_PVDDQ_ABCD_CPU1_VRHOT_LVC3_N", "IRQ_PVDDQ_ABCD_CPU2_VRHOT_LVC3_N",
278			"IRQ_PVDDQ_EFGH_CPU1_VRHOT_LVC3_N", "IRQ_PVDDQ_EFGH_CPU2_VRHOT_LVC3_N",
279			"", "", "", "",
280		/*  J */ "", "", "", "", "", "", "", "",
281		/*  K */ "", "", "", "", "", "", "", "",
282		/*  L */ "", "", "", "", "", "", "", "",
283		/*  M */ "FM_PVCCIN_CPU1_PWR_IN_ALERT_N", "FM_PVCCIN_CPU2_PWR_IN_ALERT_N",
284			"IRQ_PVCCIN_CPU1_VRHOT_LVC3_N", "IRQ_PVCCIN_CPU2_VRHOT_LVC3_N",
285			"FM_CPU1_PROCHOT_BMC_LVC3_N", "",
286			"FM_CPU1_MEMHOT_OUT_N", "FM_CPU2_MEMHOT_OUT_N",
287		/*  N */ "", "", "", "", "", "", "", "",
288		/*  O */ "", "", "", "", "", "", "", "",
289		/*  P */ "", "", "", "", "", "", "", "",
290		/*  Q */ "", "", "", "", "", "", "RST_GLB_RST_WARN_N", "PCIE_WAKE_N",
291		/*  R */ "", "", "FM_BMC_SUSACK_N", "FM_BMC_EUP_LOT6_N",
292			"", "FM_BMC_PCH_SCI_LPC_N", "", "",
293		/*  S */ "FM_DBP_PRESENT_N", "FM_CPU2_SKTOCC_LCT3_N",
294			"FM_CPU1_FIVR_FAULT_LVT3", "FM_CPU2_FIVR_FAULT_LVT3",
295			 "", "", "", "",
296		/*  T */ "", "", "", "", "", "", "", "",
297		/*  U */ "", "", "", "", "", "", "", "",
298		/*  V */ "", "", "", "", "", "", "", "",
299		/*  W */ "", "", "", "", "", "", "", "",
300		/*  X */ "", "", "", "", "", "", "", "",
301		/*  Y */ "FM_SLPS3_N", "FM_SLPS4_N", "", "FM_BMC_ONCTL_N_PLD",
302			"", "", "", "",
303		/*  Z */ "FM_CPU_MSMI_CATERR_LVT3_N", "", "SYSTEM_FAULT_LED_N", "BMC_THROTTLE_N",
304			"", "", "", "",
305		/* AA */ "FM_CPU1_THERMTRIP_LATCH_LVT3_N", "FM_CPU2_THERMTRIP_LATCH_LVT3_N",
306			"FM_BIOS_POST_COMPLT_N", "DBP_BMC_SYSPWROK",
307			"", "IRQ_SML0_ALERT_MUX_N",
308			"IRQ_SMI_ACTIVE_N", "IRQ_NMI_EVENT_N",
309		/* AB */ "FM_PCH_BMC_THERMTRIP_N", "PWRGD_SYS_PWROK",
310			"ME_OVERRIDE", "IRQ_BMC_PCH_SMI_LPC_N",
311			"", "", "", "",
312		/* AC */ "", "", "", "", "", "", "", "";
313};
314
315&adc {
316	status = "okay";
317	pinctrl-names = "default";
318	pinctrl-0 = <&pinctrl_adc0_default /* 3VSB */
319		&pinctrl_adc1_default	   /* 5VSB */
320		&pinctrl_adc2_default	   /* CPU1 */
321		&pinctrl_adc3_default	   /* NC */
322		&pinctrl_adc4_default	   /* VCCMABCD */
323		&pinctrl_adc5_default	   /* VCCMEFGH */
324		&pinctrl_adc6_default	   /* NC */
325		&pinctrl_adc7_default	   /* NC */
326		&pinctrl_adc8_default	   /* PVNN_PCH */
327		&pinctrl_adc9_default	   /* 1P05PCH */
328		&pinctrl_adc10_default	   /* 1P8PCH */
329		&pinctrl_adc11_default	   /* BAT */
330		&pinctrl_adc12_default	   /* 3V */
331		&pinctrl_adc13_default	   /* 5V */
332		&pinctrl_adc14_default	   /* 12V */
333		&pinctrl_adc15_default>;   /* GND */
334};
335