1// SPDX-License-Identifier: GPL-2.0+
2// Copyright (c) 2018 Facebook Inc.
3/dts-v1/;
4
5#include "aspeed-g5.dtsi"
6
7/ {
8	model = "Facebook Backpack CMM BMC";
9	compatible = "facebook,cmm-bmc", "aspeed,ast2500";
10
11	aliases {
12		/*
13		 * Override the default uart aliases to avoid breaking
14		 * the legacy applications.
15		 */
16		serial0 = &uart5;
17		serial1 = &uart1;
18		serial2 = &uart3;
19		serial3 = &uart4;
20
21		/*
22		 * Hardcode the bus number of i2c switches' channels to
23		 * avoid breaking the legacy applications.
24		 */
25		i2c16 = &imux16;
26		i2c17 = &imux17;
27		i2c18 = &imux18;
28		i2c19 = &imux19;
29		i2c20 = &imux20;
30		i2c21 = &imux21;
31		i2c22 = &imux22;
32		i2c23 = &imux23;
33		i2c24 = &imux24;
34		i2c25 = &imux25;
35		i2c26 = &imux26;
36		i2c27 = &imux27;
37		i2c28 = &imux28;
38		i2c29 = &imux29;
39		i2c30 = &imux30;
40		i2c31 = &imux31;
41		i2c32 = &imux32;
42		i2c33 = &imux33;
43		i2c34 = &imux34;
44		i2c35 = &imux35;
45		i2c36 = &imux36;
46		i2c37 = &imux37;
47		i2c38 = &imux38;
48		i2c39 = &imux39;
49	};
50
51	chosen {
52		stdout-path = &uart1;
53		bootargs = "console=ttyS1,9600n8 root=/dev/ram rw earlyprintk";
54	};
55
56	memory@80000000 {
57		reg = <0x80000000 0x20000000>;
58	};
59
60	ast-adc-hwmon {
61		compatible = "iio-hwmon";
62		io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
63			      <&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>;
64	};
65};
66
67&pinctrl {
68	aspeed,external-nodes = <&gfx &lhc>;
69};
70
71/*
72 * Update reset type to "system" (full chip) to fix warm reboot hang issue
73 * when reset type is set to default ("soc", gated by reset mask registers).
74 */
75&wdt1 {
76	status = "okay";
77	aspeed,reset-type = "system";
78};
79
80/*
81 * wdt2 is not used by Backpack CMM.
82 */
83&wdt2 {
84	status = "disabled";
85};
86
87&fmc {
88	status = "okay";
89	flash@0 {
90		status = "okay";
91		m25p,fast-read;
92		label = "bmc";
93#include "facebook-bmc-flash-layout.dtsi"
94	};
95};
96
97&uart1 {
98	status = "okay";
99	pinctrl-names = "default";
100	pinctrl-0 = <&pinctrl_txd1_default
101		     &pinctrl_rxd1_default
102		     &pinctrl_ncts1_default
103		     &pinctrl_ndcd1_default
104		     &pinctrl_ndsr1_default
105		     &pinctrl_ndtr1_default
106		     &pinctrl_nrts1_default>;
107};
108
109&uart3 {
110	status = "okay";
111	pinctrl-names = "default";
112	pinctrl-0 = <&pinctrl_txd3_default
113		     &pinctrl_rxd3_default
114		     &pinctrl_ncts3_default
115		     &pinctrl_ndcd3_default
116		     &pinctrl_nri3_default>;
117};
118
119&uart4 {
120	status = "okay";
121	pinctrl-names = "default";
122	pinctrl-0 = <&pinctrl_txd4_default
123		     &pinctrl_rxd4_default>;
124};
125
126&uart5 {
127	status = "okay";
128};
129
130&mac1 {
131	status = "okay";
132	no-hw-checksum;
133	pinctrl-names = "default";
134	pinctrl-0 = <&pinctrl_rgmii2_default &pinctrl_mdio2_default>;
135};
136
137/*
138 * I2C bus reserved for communication with COM-E.
139 */
140&i2c0 {
141	status = "okay";
142};
143
144/*
145 * I2C bus to Line Cards and Fabric Cards.
146 */
147&i2c1 {
148	status = "okay";
149
150	i2c-switch@77 {
151		compatible = "nxp,pca9548";
152		#address-cells = <1>;
153		#size-cells = <0>;
154		reg = <0x77>;
155
156		imux16: i2c@0 {
157			#address-cells = <1>;
158			#size-cells = <0>;
159			reg = <0>;
160		};
161
162		imux17: i2c@1 {
163			#address-cells = <1>;
164			#size-cells = <0>;
165			reg = <1>;
166		};
167
168		imux18: i2c@2 {
169			#address-cells = <1>;
170			#size-cells = <0>;
171			reg = <2>;
172		};
173
174		imux19: i2c@3 {
175			#address-cells = <1>;
176			#size-cells = <0>;
177			reg = <3>;
178		};
179
180		imux20: i2c@4 {
181			#address-cells = <1>;
182			#size-cells = <0>;
183			reg = <4>;
184		};
185
186		imux21: i2c@5 {
187			#address-cells = <1>;
188			#size-cells = <0>;
189			reg = <5>;
190		};
191
192		imux22: i2c@6 {
193			#address-cells = <1>;
194			#size-cells = <0>;
195			reg = <6>;
196		};
197
198		imux23: i2c@7 {
199			#address-cells = <1>;
200			#size-cells = <0>;
201			reg = <7>;
202		};
203	};
204};
205
206/*
207 * I2C bus to Power Distribution Board.
208 */
209&i2c2 {
210	status = "okay";
211
212	i2c-switch@71 {
213		compatible = "nxp,pca9548";
214		#address-cells = <1>;
215		#size-cells = <0>;
216		reg = <0x71>;
217
218		imux24: i2c@0 {
219			#address-cells = <1>;
220			#size-cells = <0>;
221			reg = <0>;
222		};
223
224		imux25: i2c@1 {
225			#address-cells = <1>;
226			#size-cells = <0>;
227			reg = <1>;
228		};
229
230		imux26: i2c@2 {
231			#address-cells = <1>;
232			#size-cells = <0>;
233			reg = <2>;
234		};
235
236		imux27: i2c@3 {
237			#address-cells = <1>;
238			#size-cells = <0>;
239			reg = <3>;
240		};
241
242		imux28: i2c@4 {
243			#address-cells = <1>;
244			#size-cells = <0>;
245			reg = <4>;
246		};
247
248		imux29: i2c@5 {
249			#address-cells = <1>;
250			#size-cells = <0>;
251			reg = <5>;
252		};
253
254		imux30: i2c@6 {
255			#address-cells = <1>;
256			#size-cells = <0>;
257			reg = <6>;
258		};
259
260		imux31: i2c@7 {
261			#address-cells = <1>;
262			#size-cells = <0>;
263			reg = <7>;
264		};
265	};
266};
267
268/*
269 * I2c bus connected with temperature sensors on CMM.
270 */
271&i2c3 {
272	status = "okay";
273};
274
275/*
276 * I2C bus reserved for communication with COM-E.
277 */
278&i2c4 {
279	status = "okay";
280};
281
282/*
283 * I2c bus connected with ADM1278.
284 */
285&i2c5 {
286	status = "okay";
287};
288
289/*
290 * I2c bus connected with I/O Expander.
291 */
292&i2c6 {
293	status = "okay";
294};
295
296/*
297 * I2c bus connected with I/O Expander and EPROMs.
298 */
299&i2c7 {
300	status = "okay";
301};
302
303/*
304 * I2C bus to Fan Control Board.
305 */
306&i2c8 {
307	status = "okay";
308
309	i2c-switch@77 {
310		compatible = "nxp,pca9548";
311		#address-cells = <1>;
312		#size-cells = <0>;
313		reg = <0x77>;
314
315		imux32: i2c@0 {
316			#address-cells = <1>;
317			#size-cells = <0>;
318			reg = <0>;
319		};
320
321		imux33: i2c@1 {
322			#address-cells = <1>;
323			#size-cells = <0>;
324			reg = <1>;
325		};
326
327		imux34: i2c@2 {
328			#address-cells = <1>;
329			#size-cells = <0>;
330			reg = <2>;
331		};
332
333		imux35: i2c@3 {
334			#address-cells = <1>;
335			#size-cells = <0>;
336			reg = <3>;
337		};
338
339		imux36: i2c@4 {
340			#address-cells = <1>;
341			#size-cells = <0>;
342			reg = <4>;
343		};
344
345		imux37: i2c@5 {
346			#address-cells = <1>;
347			#size-cells = <0>;
348			reg = <5>;
349		};
350
351		imux38: i2c@6 {
352			#address-cells = <1>;
353			#size-cells = <0>;
354			reg = <6>;
355		};
356
357		imux39: i2c@7 {
358			#address-cells = <1>;
359			#size-cells = <0>;
360			reg = <7>;
361		};
362	};
363};
364
365/*
366 * I2C bus to CMM CPLD.
367 */
368&i2c13 {
369	status = "okay";
370};
371
372&adc {
373	status = "okay";
374};
375
376&ehci0 {
377	status = "okay";
378};
379
380&ehci1 {
381	status = "okay";
382};
383