1// SPDX-License-Identifier: GPL-2.0-or-later
2// Copyright 2023 IBM Corp.
3
4&fsim0 {
5	status = "okay";
6
7	#address-cells = <2>;
8	#size-cells = <0>;
9
10	cfam-reset-gpios = <&gpio0 ASPEED_GPIO(Q, 0) GPIO_ACTIVE_HIGH>;
11
12	cfam@0,0 {
13		reg = <0 0>;
14		#address-cells = <1>;
15		#size-cells = <1>;
16		chip-id = <0>;
17
18		scom@1000 {
19			compatible = "ibm,fsi2pib";
20			reg = <0x1000 0x400>;
21		};
22
23		i2c@1800 {
24			compatible = "ibm,fsi-i2c-master";
25			reg = <0x1800 0x400>;
26			#address-cells = <1>;
27			#size-cells = <0>;
28
29			cfam0_i2c0: i2c-bus@0 {
30				#address-cells = <1>;
31				#size-cells = <0>;
32				reg = <0>;	/* OMI01 */
33			};
34
35			cfam0_i2c1: i2c-bus@1 {
36				#address-cells = <1>;
37				#size-cells = <0>;
38				reg = <1>;	/* OMI23 */
39			};
40
41			cfam0_i2c10: i2c-bus@a {
42				#address-cells = <1>;
43				#size-cells = <0>;
44				reg = <10>;	/* OP3A */
45			};
46
47			cfam0_i2c11: i2c-bus@b {
48				#address-cells = <1>;
49				#size-cells = <0>;
50				reg = <11>;	/* OP3B */
51			};
52
53			cfam0_i2c12: i2c-bus@c {
54				#address-cells = <1>;
55				#size-cells = <0>;
56				reg = <12>;	/* OP4A */
57			};
58
59			cfam0_i2c13: i2c-bus@d {
60				#address-cells = <1>;
61				#size-cells = <0>;
62				reg = <13>;	/* OP4B */
63			};
64
65			cfam0_i2c14: i2c-bus@e {
66				#address-cells = <1>;
67				#size-cells = <0>;
68				reg = <14>;	/* OP5A */
69			};
70
71			cfam0_i2c15: i2c-bus@f {
72				#address-cells = <1>;
73				#size-cells = <0>;
74				reg = <15>;	/* OP5B */
75			};
76		};
77
78		fsi2spi@1c00 {
79			compatible = "ibm,fsi2spi";
80			reg = <0x1c00 0x400>;
81			#address-cells = <1>;
82			#size-cells = <0>;
83
84			cfam0_spi0: spi@0 {
85				reg = <0x0>;
86				#address-cells = <1>;
87				#size-cells = <0>;
88
89				eeprom@0 {
90					at25,byte-len = <0x80000>;
91					at25,addr-mode = <4>;
92					at25,page-size = <256>;
93
94					compatible = "atmel,at25";
95					reg = <0>;
96					spi-max-frequency = <1000000>;
97				};
98			};
99
100			cfam0_spi1: spi@20 {
101				reg = <0x20>;
102				#address-cells = <1>;
103				#size-cells = <0>;
104
105				eeprom@0 {
106					at25,byte-len = <0x80000>;
107					at25,addr-mode = <4>;
108					at25,page-size = <256>;
109
110					compatible = "atmel,at25";
111					reg = <0>;
112					spi-max-frequency = <1000000>;
113				};
114			};
115
116			cfam0_spi2: spi@40 {
117				reg = <0x40>;
118				compatible =  "ibm,fsi2spi";
119				#address-cells = <1>;
120				#size-cells = <0>;
121
122				eeprom@0 {
123					at25,byte-len = <0x80000>;
124					at25,addr-mode = <4>;
125					at25,page-size = <256>;
126
127					compatible = "atmel,at25";
128					reg = <0>;
129					spi-max-frequency = <1000000>;
130				};
131			};
132
133			cfam0_spi3: spi@60 {
134				reg = <0x60>;
135				compatible =  "ibm,fsi2spi";
136				#address-cells = <1>;
137				#size-cells = <0>;
138
139				eeprom@0 {
140					at25,byte-len = <0x80000>;
141					at25,addr-mode = <4>;
142					at25,page-size = <256>;
143
144					compatible = "atmel,at25";
145					reg = <0>;
146					spi-max-frequency = <1000000>;
147				};
148			};
149		};
150
151		sbefifo@2400 {
152			compatible = "ibm,p9-sbefifo";
153			reg = <0x2400 0x400>;
154			#address-cells = <1>;
155			#size-cells = <0>;
156
157			fsi_occ0: occ {
158				compatible = "ibm,p10-occ";
159
160				occ-hwmon {
161					compatible = "ibm,p10-occ-hwmon";
162					ibm,no-poll-on-init;
163				};
164			};
165		};
166
167		fsi_hub0: hub@3400 {
168			#interrupt-cells = <1>;
169			compatible = "fsi-master-hub";
170			reg = <0x3400 0x400>;
171			#address-cells = <2>;
172			#size-cells = <0>;
173			interrupt-controller;
174		};
175	};
176};
177
178&fsi_hub0 {
179	cfam@1,0 {
180		reg = <1 0>;
181		#address-cells = <1>;
182		#size-cells = <1>;
183		chip-id = <1>;
184
185		scom@1000 {
186			compatible = "ibm,fsi2pib";
187			reg = <0x1000 0x400>;
188		};
189
190		i2c@1800 {
191			compatible = "ibm,fsi-i2c-master";
192			reg = <0x1800 0x400>;
193			#address-cells = <1>;
194			#size-cells = <0>;
195
196			cfam1_i2c2: i2c-bus@2 {
197				#address-cells = <1>;
198				#size-cells = <0>;
199				reg = <2>;	/* OMI45 */
200			};
201
202			cfam1_i2c3: i2c-bus@3 {
203				#address-cells = <1>;
204				#size-cells = <0>;
205				reg = <3>;	/* OMI67 */
206			};
207
208			cfam1_i2c10: i2c-bus@a {
209				#address-cells = <1>;
210				#size-cells = <0>;
211				reg = <10>;	/* OP3A */
212			};
213
214			cfam1_i2c11: i2c-bus@b {
215				#address-cells = <1>;
216				#size-cells = <0>;
217				reg = <11>;	/* OP3B */
218			};
219
220			cfam1_i2c14: i2c-bus@e {
221				#address-cells = <1>;
222				#size-cells = <0>;
223				reg = <14>;	/* OP5A */
224			};
225
226			cfam1_i2c15: i2c-bus@f {
227				#address-cells = <1>;
228				#size-cells = <0>;
229				reg = <15>;	/* OP5B */
230			};
231
232			cfam1_i2c16: i2c-bus@10 {
233				#address-cells = <1>;
234				#size-cells = <0>;
235				reg = <16>;	/* OP6A */
236			};
237
238			cfam1_i2c17: i2c-bus@11 {
239				#address-cells = <1>;
240				#size-cells = <0>;
241				reg = <17>;	/* OP6B */
242			};
243		};
244
245		fsi2spi@1c00 {
246			compatible = "ibm,fsi2spi";
247			reg = <0x1c00 0x400>;
248			#address-cells = <1>;
249			#size-cells = <0>;
250
251			cfam1_spi0: spi@0 {
252				reg = <0x0>;
253				#address-cells = <1>;
254				#size-cells = <0>;
255
256				eeprom@0 {
257					at25,byte-len = <0x80000>;
258					at25,addr-mode = <4>;
259					at25,page-size = <256>;
260
261					compatible = "atmel,at25";
262					reg = <0>;
263					spi-max-frequency = <1000000>;
264				};
265			};
266
267			cfam1_spi1: spi@20 {
268				reg = <0x20>;
269				#address-cells = <1>;
270				#size-cells = <0>;
271
272				eeprom@0 {
273					at25,byte-len = <0x80000>;
274					at25,addr-mode = <4>;
275					at25,page-size = <256>;
276
277					compatible = "atmel,at25";
278					reg = <0>;
279					spi-max-frequency = <1000000>;
280				};
281			};
282
283			cfam1_spi2: spi@40 {
284				reg = <0x40>;
285				compatible =  "ibm,fsi2spi";
286				#address-cells = <1>;
287				#size-cells = <0>;
288
289				eeprom@0 {
290					at25,byte-len = <0x80000>;
291					at25,addr-mode = <4>;
292					at25,page-size = <256>;
293
294					compatible = "atmel,at25";
295					reg = <0>;
296					spi-max-frequency = <1000000>;
297				};
298			};
299
300			cfam1_spi3: spi@60 {
301				reg = <0x60>;
302				compatible =  "ibm,fsi2spi";
303				#address-cells = <1>;
304				#size-cells = <0>;
305
306				eeprom@0 {
307					at25,byte-len = <0x80000>;
308					at25,addr-mode = <4>;
309					at25,page-size = <256>;
310
311					compatible = "atmel,at25";
312					reg = <0>;
313					spi-max-frequency = <1000000>;
314				};
315			};
316		};
317
318		sbefifo@2400 {
319			compatible = "ibm,p9-sbefifo";
320			reg = <0x2400 0x400>;
321			#address-cells = <1>;
322			#size-cells = <0>;
323
324			fsi_occ1: occ {
325				compatible = "ibm,p10-occ";
326
327				occ-hwmon {
328					compatible = "ibm,p10-occ-hwmon";
329					ibm,no-poll-on-init;
330				};
331			};
332		};
333
334		fsi_hub1: hub@3400 {
335			compatible = "fsi-master-hub";
336			reg = <0x3400 0x400>;
337			#address-cells = <2>;
338			#size-cells = <0>;
339
340			no-scan-on-init;
341		};
342	};
343};
344
345/* Legacy OCC numbering (to get rid of when userspace is fixed) */
346&fsi_occ0 {
347	reg = <1>;
348};
349
350&fsi_occ1 {
351	reg = <2>;
352};
353
354/ {
355	aliases {
356		i2c100 = &cfam0_i2c0;
357		i2c101 = &cfam0_i2c1;
358		i2c110 = &cfam0_i2c10;
359		i2c111 = &cfam0_i2c11;
360		i2c112 = &cfam0_i2c12;
361		i2c113 = &cfam0_i2c13;
362		i2c114 = &cfam0_i2c14;
363		i2c115 = &cfam0_i2c15;
364		i2c202 = &cfam1_i2c2;
365		i2c203 = &cfam1_i2c3;
366		i2c210 = &cfam1_i2c10;
367		i2c211 = &cfam1_i2c11;
368		i2c214 = &cfam1_i2c14;
369		i2c215 = &cfam1_i2c15;
370		i2c216 = &cfam1_i2c16;
371		i2c217 = &cfam1_i2c17;
372
373		spi10 = &cfam0_spi0;
374		spi11 = &cfam0_spi1;
375		spi12 = &cfam0_spi2;
376		spi13 = &cfam0_spi3;
377		spi20 = &cfam1_spi0;
378		spi21 = &cfam1_spi1;
379		spi22 = &cfam1_spi2;
380		spi23 = &cfam1_spi3;
381	};
382};
383