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 E3C246D4I BMC";
11	compatible = "asrock,e3c246d4i-bmc", "aspeed,ast2500";
12
13	aliases {
14		serial4 = &uart5;
15	};
16
17	chosen {
18		stdout-path = &uart5;
19		bootargs = "console=tty0 console=ttyS4,115200 earlycon";
20	};
21
22	memory@80000000 {
23		reg = <0x80000000 0x20000000>;
24	};
25
26	leds {
27		compatible = "gpio-leds";
28
29		heartbeat {
30			/* BMC_HB_LED_N */
31			gpios = <&gpio ASPEED_GPIO(H, 6) GPIO_ACTIVE_LOW>;
32			linux,default-trigger = "timer";
33		};
34
35		system-fault {
36			/* SYSTEM_FAULT_LED_N */
37			gpios = <&gpio ASPEED_GPIO(Z, 2) GPIO_ACTIVE_LOW>;
38			panic-indicator;
39		};
40	};
41
42	gpio-keys {
43		compatible = "gpio-keys";
44
45		uid-button {
46			label = "uid-button";
47			gpios = <&gpio ASPEED_GPIO(F, 1) GPIO_ACTIVE_LOW>;
48			linux,code = <ASPEED_GPIO(F, 1)>;
49		};
50	};
51
52	iio-hwmon {
53		compatible = "iio-hwmon";
54		io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>, <&adc 4>,
55			<&adc 5>, <&adc 6>, <&adc 7>, <&adc 8>, <&adc 9>,
56			<&adc 10>, <&adc 11>, <&adc 12>;
57	};
58};
59
60&fmc {
61	status = "okay";
62	flash@0 {
63		status = "okay";
64		m25p,fast-read;
65		label = "bmc";
66		spi-max-frequency = <50000000>; /* 50 MHz */
67#include "openbmc-flash-layout.dtsi"
68	};
69};
70
71&uart5 {
72	status = "okay";
73};
74
75&vuart {
76	status = "okay";
77	aspeed,lpc-io-reg = <0x2f8>;
78	aspeed,lpc-interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
79};
80
81&mac0 {
82	status = "okay";
83
84	pinctrl-names = "default";
85	pinctrl-0 = <&pinctrl_rgmii1_default &pinctrl_mdio1_default>;
86};
87
88&i2c1 {
89	status = "okay";
90
91	/* thermal sensor, one diode run to a disconnected header */
92	w83773g@4c {
93		compatible = "nuvoton,w83773g";
94		reg = <0x4c>;
95	};
96};
97
98&i2c3 {
99	status = "okay";
100
101	/* FRU EEPROM */
102	eeprom@57 {
103		compatible = "st,24c128", "atmel,24c128";
104		reg = <0x57>;
105		pagesize = <16>;
106	};
107};
108
109&video {
110	status = "okay";
111};
112
113&vhub {
114	status = "okay";
115};
116
117&lpc_ctrl {
118	status = "okay";
119};
120
121&lpc_snoop {
122	status = "okay";
123	snoop-ports = <0x80>;
124};
125
126&gpio {
127	status = "okay";
128	gpio-line-names =
129		/*  A */ "BMC_MAC1_INTB", "BMC_MAC2_INTB", "NMI_BTN_N", "BMC_NMI",
130			"", "", "", "",
131		/*  B */ "", "", "", "", "", "IRQ_BMC_PCH_SMI_LPC_N", "", "",
132		/*  C */ "", "", "", "", "", "", "", "",
133		/*  D */ "BMC_PSIN", "BMC_PSOUT", "BMC_RESETCON", "RESETCON",
134			"", "", "", "",
135		/*  E */ "", "", "", "", "", "", "", "",
136		/*  F */ "LOCATORLED_STATUS_N", "LOCATORBTN", "", "",
137			"", "", "BMC_PCH_SCI_LPC", "BMC_NCSI_MUX_CTL",
138		/*  G */ "HWM_BAT_EN", "CHASSIS_ID0", "CHASSIS_ID1", "CHASSIS_ID2",
139			"BMC_ALERT1_N_R", "BMC_ALERT2_N_R", "BMC_ALERT3_N", "SML0ALERT",
140		/*  H */ "FM_ME_RCVR_N", "O_PWROK", "SKL_CNL_R", "D4_DIMM_EVENT_3V_N",
141			"MFG_MODE_N", "BMC_RTCRST", "BMC_HB_LED_N", "BMC_CASEOPEN",
142		/*  I */ "", "", "", "", "", "", "", "",
143		/*  J */ "BMC_READY", "BMC_PCH_BIOS_CS_N", "BMC_SMI", "",
144			"", "", "", "",
145		/*  K */ "", "", "", "", "", "", "", "",
146		/*  L */ "BMC_CTS1", "BMC_DCD1", "BMC_DSR1", "BMC_RI1",
147			"BMC_DTR1", "BMC_RTS1", "BMC_TXD1", "BMC_RXD1",
148		/*  M */ "BMC_LAN0_DIS_N", "BMC_LAN1_DIS_N", "", "",
149			"", "", "", "",
150		/*  N */ "", "", "", "", "", "", "", "",
151		/*  O */ "", "", "", "", "", "", "", "",
152		/*  P */ "", "", "", "", "", "", "", "",
153		/*  Q */ "", "", "", "",
154			"BMC_SBM_PRESENT_1_N", "BMC_SBM_PRESENT_2_N",
155			"BMC_SBM_PRESENT_3_N", "BMC_PCIE_WAKE_N",
156		/*  R */ "", "", "", "", "", "", "", "",
157		/*  S */ "PCHHOT_BMC_N", "", "RSMRST",
158			"", "", "", "", "",
159		/*  T */ "", "", "", "", "", "", "", "",
160		/*  U */ "", "", "", "", "", "", "", "",
161		/*  V */ "", "", "", "", "", "", "", "",
162		/*  W */ "PS_PWROK", /* dummy always-high signal */
163			"", "", "", "", "", "", "",
164		/*  X */ "", "", "", "", "", "", "", "",
165		/*  Y */ "SLP_S3", "SLP_S5", "", "", "", "", "", "",
166		/*  Z */ "CPU_CATERR_BMC_PCH_N", "", "SYSTEM_FAULT_LED_N", "BMC_THROTTLE_N",
167			"", "", "", "",
168		/* AA */ "CPU1_THERMTRIP_LATCH_N", "", "CPU1_PROCHOT_N", "",
169			"", "", "IRQ_SMI_ACTIVE_N", "FM_BIOS_POST_CMPLT_N",
170		/* AB */ "", "", "ME_OVERRIDE", "BMC_DMI_MODIFY",
171			"", "", "", "",
172		/* AC */ "LAD0", "LAD1", "LAD2", "LAD3",
173			"CK_33M_BMC", "LFRAME", "SERIRQ", "S_PLTRST";
174
175	/* Assert BMC_READY so BIOS doesn't sit around waiting for it */
176	bmc-ready {
177		gpio-hog;
178		gpios = <ASPEED_GPIO(J, 0) GPIO_ACTIVE_LOW>;
179		output-high;
180	};
181};
182
183&adc {
184	status = "okay";
185	pinctrl-names = "default";
186	pinctrl-0 = <&pinctrl_adc0_default
187			&pinctrl_adc1_default
188			&pinctrl_adc2_default
189			&pinctrl_adc3_default
190			&pinctrl_adc4_default
191			&pinctrl_adc5_default
192			&pinctrl_adc6_default
193			&pinctrl_adc7_default
194			&pinctrl_adc8_default
195			&pinctrl_adc9_default
196			&pinctrl_adc10_default
197			&pinctrl_adc11_default
198			&pinctrl_adc12_default>;
199};
200
201&kcs3 {
202	status = "okay";
203	aspeed,lpc-io-reg = <0xca2>;
204};
205
206&peci0 {
207	status = "okay";
208};
209