master
c 682 lines 26.2 KB
Raw
1 /*
2 * Facebook Catalina
3 *
4 * Copyright 2016 IBM Corp.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9 #include "qemu/osdep.h"
10 #include "qapi/error.h"
11 #include "hw/arm/machines-qom.h"
12 #include "hw/arm/aspeed.h"
13 #include "hw/arm/aspeed_soc.h"
14 #include "hw/i2c/i2c_mux_pca954x.h"
15 #include "hw/gpio/pca9552.h"
16 #include "hw/gpio/pca9554.h"
17 #include "hw/nvram/eeprom_at24c.h"
18 #include "hw/sensor/tmp105.h"
19
20 /* Catalina hardware value */
21 #define CATALINA_BMC_HW_STRAP1 0x00002002
22 #define CATALINA_BMC_HW_STRAP2 0x00000800
23 #define CATALINA_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB)
24
25 #define TYPE_TMP75 TYPE_TMP105
26 #define TYPE_TMP421 "tmp421"
27 #define TYPE_DS1338 "ds1338"
28
29 /*
30 * "BMC Storage Module" FRU data. Generated with frugen.
31 *
32 * {
33 * "board": {
34 * "mfg": "Quanta",
35 * "pname": "BMC Storage Module (QEMU)",
36 * "pn": "00000000000",
37 * "serial": "00000000000000",
38 * "date": "01/12/2025 00:00",
39 * "custom": ["09-100183"]
40 * },
41 * "product": {
42 * "mfg": "Quanta",
43 * "pname": "CI-Catalina",
44 * "pn": "10000000001",
45 * "ver": "MP",
46 * "serial": "10000000000000",
47 * "atag": "QEMU"
48 * }
49 * }
50 */
51 static const uint8_t bsm_eeprom[] = {
52 0x01, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0xf4, 0x01, 0x09, 0x19, 0x8c,
53 0x19, 0xf0, 0xc6, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xd9, 0x42, 0x4d,
54 0x43, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x4d, 0x6f,
55 0x64, 0x75, 0x6c, 0x65, 0x20, 0x28, 0x51, 0x45, 0x4d, 0x55, 0x29, 0x8b,
56 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x89,
57 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x01, 0xc0, 0x87, 0x50,
58 0xd6, 0x44, 0x10, 0x14, 0x61, 0x13, 0xc1, 0x59, 0x01, 0x07, 0x19, 0xc6,
59 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xcb, 0x43, 0x49, 0x2d, 0x43, 0x61,
60 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x61, 0x89, 0x11, 0x04, 0x41, 0x10, 0x04,
61 0x41, 0x10, 0x14, 0x01, 0x82, 0x2d, 0x0c, 0x8b, 0x11, 0x04, 0x41, 0x10,
62 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x83, 0x71, 0xd9, 0xd6, 0xc0,
63 0xc1, 0x00, 0x00, 0x37
64 };
65 static const size_t bsm_eeprom_len = sizeof(bsm_eeprom);
66
67 /*
68 * "Secure Control Module" FRU data. Generated with frugen.
69 *
70 * {
71 * "board": {
72 * "mfg": "Quanta",
73 * "pname": "Catalina SCM MP (QEMU)",
74 * "pn": "00000000000",
75 * "serial": "00000000000000",
76 * "date": "01/12/2025 00:00",
77 * "custom": ["19-100325"]
78 * },
79 * "product": {
80 * "mfg": "Quanta",
81 * "pname": "CI-Catalina",
82 * "pn": "10000000001",
83 * "ver": "MP",
84 * "serial": "10000000000000",
85 * "atag": "QEMU"
86 * }
87 * }
88 *
89 */
90 static const uint8_t scm_eeprom[] = {
91 0x01, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0xf4, 0x01, 0x09, 0x19, 0x8c,
92 0x19, 0xf0, 0xc6, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xd6, 0x43, 0x61,
93 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x61, 0x20, 0x53, 0x43, 0x4d, 0x20, 0x4d,
94 0x50, 0x20, 0x28, 0x51, 0x45, 0x4d, 0x55, 0x29, 0x8b, 0x10, 0x04, 0x41,
95 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x89, 0x10, 0x04, 0x41,
96 0x10, 0x04, 0x41, 0x10, 0x04, 0x01, 0xc0, 0x87, 0x51, 0xd6, 0x44, 0x10,
97 0x34, 0x49, 0x15, 0xc1, 0x00, 0x00, 0x00, 0xc1, 0x01, 0x07, 0x19, 0xc6,
98 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xcb, 0x43, 0x49, 0x2d, 0x43, 0x61,
99 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x61, 0x89, 0x11, 0x04, 0x41, 0x10, 0x04,
100 0x41, 0x10, 0x14, 0x01, 0x82, 0x2d, 0x0c, 0x8b, 0x11, 0x04, 0x41, 0x10,
101 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x83, 0x71, 0xd9, 0xd6, 0xc0,
102 0xc1, 0x00, 0x00, 0x37
103 };
104 static const size_t scm_eeprom_len = sizeof(scm_eeprom);
105
106 /*
107 * "Power Distribution Board" FRU data. Generated with frugen.
108 *
109 * {
110 * "board": {
111 * "mfg": "Quanta",
112 * "pname": "Catalina PDB MP (QEMU)",
113 * "pn": "00000000000",
114 * "serial": "00000000000000",
115 * "date": "01/12/2025 00:00",
116 * "custom": [
117 * "19-100579",
118 * "",
119 * "",
120 * "hsc-ltc fsc-max vr-delta gndsen-ina p12vsen-ina p12vfan-mps"
121 * ]
122 * },
123 * "product": {
124 * "mfg": "Quanta",
125 * "pname": "CI-Catalina",
126 * "pn": "10000000001",
127 * "ver": "MP",
128 * "serial": "10000000000000",
129 * "atag": "QEMU"
130 * }
131 * }
132 */
133 static const uint8_t pdb_eeprom[] = {
134 0x01, 0x00, 0x00, 0x01, 0x12, 0x00, 0x00, 0xec, 0x01, 0x11, 0x19, 0x8c,
135 0x19, 0xf0, 0xc6, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xd6, 0x43, 0x61,
136 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x61, 0x20, 0x50, 0x44, 0x42, 0x20, 0x4d,
137 0x50, 0x20, 0x28, 0x51, 0x45, 0x4d, 0x55, 0x29, 0x8b, 0x10, 0x04, 0x41,
138 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x89, 0x10, 0x04, 0x41,
139 0x10, 0x04, 0x41, 0x10, 0x04, 0x01, 0xc0, 0x87, 0x51, 0xd6, 0x44, 0x10,
140 0x54, 0x5d, 0x19, 0xc0, 0xc0, 0xfb, 0x68, 0x73, 0x63, 0x2d, 0x6c, 0x74,
141 0x63, 0x20, 0x66, 0x73, 0x63, 0x2d, 0x6d, 0x61, 0x78, 0x20, 0x76, 0x72,
142 0x2d, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x20, 0x67, 0x6e, 0x64, 0x73, 0x65,
143 0x6e, 0x2d, 0x69, 0x6e, 0x61, 0x20, 0x70, 0x31, 0x32, 0x76, 0x73, 0x65,
144 0x6e, 0x2d, 0x69, 0x6e, 0x61, 0x20, 0x70, 0x31, 0x32, 0x76, 0x66, 0x61,
145 0x6e, 0x2d, 0x6d, 0x70, 0x73, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24,
146 0x01, 0x07, 0x19, 0xc6, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xcb, 0x43,
147 0x49, 0x2d, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x61, 0x89, 0x11,
148 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x14, 0x01, 0x82, 0x2d, 0x0c, 0x8b,
149 0x11, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x83,
150 0x71, 0xd9, 0xd6, 0xc0, 0xc1, 0x00, 0x00, 0x37
151 };
152 static const size_t pdb_eeprom_len = sizeof(pdb_eeprom);
153
154 /*
155 * OSFP Carrier Board FRU data. Generated with frugen.
156 *
157 * {
158 * "board": {
159 * "mfg": "Quanta",
160 * "pname": "Catalina OSFP MP (QEMU)",
161 * "pn": "00000000000",
162 * "serial": "00000000000000",
163 * "date": "01/12/2025 00:00",
164 * "custom": ["19-100316"]
165 * },
166 * "product": {
167 * "mfg": "Quanta",
168 * "pname": "CI-Catalina",
169 * "pn": "10000000001",
170 * "ver": "MP",
171 * "serial": "10000000000000",
172 * "atag": "QEMU"
173 * }
174 * }
175 */
176 static const uint8_t osfp_eeprom[] = {
177 0x01, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0xf4, 0x01, 0x09, 0x19, 0x8c,
178 0x19, 0xf0, 0xc6, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xd7, 0x43, 0x61,
179 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x61, 0x20, 0x4f, 0x53, 0x46, 0x50, 0x20,
180 0x4d, 0x50, 0x20, 0x28, 0x51, 0x45, 0x4d, 0x55, 0x29, 0x8b, 0x10, 0x04,
181 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x89, 0x10, 0x04,
182 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x01, 0xc0, 0x87, 0x51, 0xd6, 0x44,
183 0x10, 0x34, 0x45, 0x16, 0xc1, 0x00, 0x00, 0x6e, 0x01, 0x07, 0x19, 0xc6,
184 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xcb, 0x43, 0x49, 0x2d, 0x43, 0x61,
185 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x61, 0x89, 0x11, 0x04, 0x41, 0x10, 0x04,
186 0x41, 0x10, 0x14, 0x01, 0x82, 0x2d, 0x0c, 0x8b, 0x11, 0x04, 0x41, 0x10,
187 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x83, 0x71, 0xd9, 0xd6, 0xc0,
188 0xc1, 0x00, 0x00, 0x37
189 };
190 static const size_t osfp_eeprom_len = sizeof(osfp_eeprom);
191
192 /*
193 * "Front IO" FRU data. Generated with frugen.
194 *
195 * {
196 * "board": {
197 * "mfg": "Quanta",
198 * "pname": "Catalina FIO MP (QEMU)",
199 * "pn": "00000000000",
200 * "serial": "00000000000000",
201 * "date": "01/12/2025 00:00",
202 * "custom": ["19-100290"]
203 * },
204 * "product": {
205 * "mfg": "Quanta",
206 * "pname": "CI-Catalina",
207 * "pn": "10000000001",
208 * "ver": "MP",
209 * "serial": "10000000000000",
210 * "atag": "QEMU"
211 * }
212 * }
213 */
214 static const uint8_t fio_eeprom[] = {
215 0x01, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0xf4, 0x01, 0x09, 0x19, 0x8c,
216 0x19, 0xf0, 0xc6, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xd6, 0x43, 0x61,
217 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x61, 0x20, 0x46, 0x49, 0x4f, 0x20, 0x4d,
218 0x50, 0x20, 0x28, 0x51, 0x45, 0x4d, 0x55, 0x29, 0x8b, 0x10, 0x04, 0x41,
219 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x89, 0x10, 0x04, 0x41,
220 0x10, 0x04, 0x41, 0x10, 0x04, 0x01, 0xc0, 0x87, 0x51, 0xd6, 0x44, 0x10,
221 0x24, 0x65, 0x10, 0xc1, 0x00, 0x00, 0x00, 0xbf, 0x01, 0x07, 0x19, 0xc6,
222 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xcb, 0x43, 0x49, 0x2d, 0x43, 0x61,
223 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x61, 0x89, 0x11, 0x04, 0x41, 0x10, 0x04,
224 0x41, 0x10, 0x14, 0x01, 0x82, 0x2d, 0x0c, 0x8b, 0x11, 0x04, 0x41, 0x10,
225 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x83, 0x71, 0xd9, 0xd6, 0xc0,
226 0xc1, 0x00, 0x00, 0x37
227 };
228 static const size_t fio_eeprom_len = sizeof(fio_eeprom);
229
230 /*
231 * HDD Carrier Board FRU data. Generated with frugen.
232 *
233 * {
234 * "board": {
235 * "mfg": "Quanta",
236 * "pname": "Catalina HDD MP (QEMU)",
237 * "pn": "00000000000",
238 * "serial": "00000000000000",
239 * "date": "01/12/2025 00:00",
240 * "custom": ["19-100319", "", "", "adc-ina"]
241 * },
242 * "product": {
243 * "mfg": "Quanta",
244 * "pname": "CI-Catalina",
245 * "pn": "10000000001",
246 * "ver": "MP",
247 * "serial": "10000000000000",
248 * "atag": "QEMU"
249 * }
250 * }
251 */
252 static const uint8_t hdd_eeprom[] = {
253 0x01, 0x00, 0x00, 0x01, 0x0b, 0x00, 0x00, 0xf3, 0x01, 0x0a, 0x19, 0x8c,
254 0x19, 0xf0, 0xc6, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xd6, 0x43, 0x61,
255 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x61, 0x20, 0x48, 0x44, 0x44, 0x20, 0x4d,
256 0x50, 0x20, 0x28, 0x51, 0x45, 0x4d, 0x55, 0x29, 0x8b, 0x10, 0x04, 0x41,
257 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x89, 0x10, 0x04, 0x41,
258 0x10, 0x04, 0x41, 0x10, 0x04, 0x01, 0xc0, 0x87, 0x51, 0xd6, 0x44, 0x10,
259 0x34, 0x45, 0x19, 0xc0, 0xc0, 0xc7, 0x61, 0x64, 0x63, 0x2d, 0x69, 0x6e,
260 0x61, 0xc1, 0x00, 0xff, 0x01, 0x07, 0x19, 0xc6, 0x51, 0x75, 0x61, 0x6e,
261 0x74, 0x61, 0xcb, 0x43, 0x49, 0x2d, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x69,
262 0x6e, 0x61, 0x89, 0x11, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x14, 0x01,
263 0x82, 0x2d, 0x0c, 0x8b, 0x11, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04,
264 0x41, 0x10, 0x04, 0x83, 0x71, 0xd9, 0xd6, 0xc0, 0xc1, 0x00, 0x00, 0x37
265 };
266 static const size_t hdd_eeprom_len = sizeof(hdd_eeprom);
267
268 /*
269 * GB200 CPU/GPU Board FRU data. Generated with frugen.
270 *
271 * {
272 * "board": {
273 * "mfg": "NVIDIA",
274 * "pname": "PG548 (QEMU)",
275 * "pn": "000-00000-0000-000",
276 * "serial": "0000000000000",
277 * "date": "01/12/2025 00:00",
278 * "custom": ["Version: A", "Rework:"]
279 * },
280 * "product": {
281 * "mfg": "NVIDIA",
282 * "pname": "GB200 1CPU:1GPU Board PC",
283 * "pn": "100-00000-0000-001",
284 * "ver": "E01",
285 * "serial": "1000000000001",
286 * "atag": "QEMU"
287 * }
288 * }
289 */
290 static const uint8_t gb200_eeprom[] = {
291 0x01, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0xf4, 0x01, 0x09, 0x19, 0x8c,
292 0x19, 0xf0, 0x85, 0xae, 0x9d, 0x92, 0x69, 0x08, 0x89, 0xf0, 0x59, 0x51,
293 0x18, 0x80, 0xc4, 0x65, 0x5b, 0x27, 0x8a, 0x10, 0x04, 0x41, 0x10, 0x04,
294 0x41, 0x10, 0x04, 0x41, 0x10, 0x8e, 0x10, 0x04, 0x35, 0x10, 0x04, 0x41,
295 0x50, 0x03, 0x41, 0x10, 0xd4, 0x40, 0x10, 0x04, 0xc0, 0xca, 0x56, 0x65,
296 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x41, 0xc7, 0x52, 0x65, 0x77,
297 0x6f, 0x72, 0x6b, 0x3a, 0xc1, 0x00, 0x00, 0x37, 0x01, 0x09, 0x19, 0x85,
298 0xae, 0x9d, 0x92, 0x69, 0x08, 0xd8, 0x47, 0x42, 0x32, 0x30, 0x30, 0x20,
299 0x31, 0x43, 0x50, 0x55, 0x3a, 0x31, 0x47, 0x50, 0x55, 0x20, 0x42, 0x6f,
300 0x61, 0x72, 0x64, 0x20, 0x50, 0x43, 0x8e, 0x11, 0x04, 0x35, 0x10, 0x04,
301 0x41, 0x50, 0x03, 0x41, 0x10, 0xd4, 0x40, 0x50, 0x04, 0x83, 0x25, 0x14,
302 0x01, 0x8a, 0x11, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x11,
303 0x83, 0x71, 0xd9, 0xd6, 0xc0, 0xc1, 0x00, 0x17
304 };
305 static const size_t gb200_eeprom_len = sizeof(gb200_eeprom);
306
307 /*
308 * GB200 IO Board FRU data. Generated with frugen.
309 *
310 * {
311 * "board": {
312 * "mfg": "Nvidia",
313 * "pname": "2x ConnectX-7 Mezz (QEMU)",
314 * "pn": "000-00000-0000-000",
315 * "serial": "000000000000",
316 * "date": "01/12/2025 00:00"
317 * },
318 * "product": {
319 * "mfg": "Nvidia",
320 * "pname": "2x ConnectX-7 Mezz",
321 * "pn": "100-00000-0000-001",
322 * "ver": "A1",
323 * "serial": "100000000001",
324 * "atag": "QEMU"
325 * }
326 * }
327 */
328 static const uint8_t gb200io_eeprom[] = {
329 0x01, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0xf4, 0x01, 0x09, 0x19, 0x8c,
330 0x19, 0xf0, 0xc6, 0x4e, 0x76, 0x69, 0x64, 0x69, 0x61, 0xd9, 0x32, 0x78,
331 0x20, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x58, 0x2d, 0x37, 0x20,
332 0x4d, 0x65, 0x7a, 0x7a, 0x20, 0x28, 0x51, 0x45, 0x4d, 0x55, 0x29, 0x89,
333 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x8e, 0x10, 0x04,
334 0x35, 0x10, 0x04, 0x41, 0x50, 0x03, 0x41, 0x10, 0xd4, 0x40, 0x10, 0x04,
335 0xc0, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x01, 0x08, 0x19, 0xc6,
336 0x4e, 0x76, 0x69, 0x64, 0x69, 0x61, 0xd2, 0x32, 0x78, 0x20, 0x43, 0x6f,
337 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x58, 0x2d, 0x37, 0x20, 0x4d, 0x65, 0x7a,
338 0x7a, 0x8e, 0x11, 0x04, 0x35, 0x10, 0x04, 0x41, 0x50, 0x03, 0x41, 0x10,
339 0xd4, 0x40, 0x50, 0x04, 0x82, 0x61, 0x04, 0x89, 0x11, 0x04, 0x41, 0x10,
340 0x04, 0x41, 0x10, 0x04, 0x45, 0x83, 0x71, 0xd9, 0xd6, 0xc0, 0xc1, 0x04
341 };
342 static const size_t gb200io_eeprom_len = sizeof(gb200io_eeprom);
343
344 /*
345 * HMC ("HGX Management Controller") FRU data. Generated with frugen.
346 *
347 * {
348 * "board": {
349 * "mfg": "NVIDIA",
350 * "pname": "P4764-A02 (QEMU)",
351 * "pn": "000-00000-0000-000",
352 * "serial": "0000000000000",
353 * "date": "01/12/2025 00:00",
354 * "custom": ["Version: G", "Rework: R0"]
355 * },
356 * "product": {
357 * "mfg": "NVIDIA",
358 * "pname": "HMC for GB200 NVL72",
359 * "pn": "100-00000-0000-001",
360 * "ver": "A1",
361 * "serial": "1000000000001",
362 * "atag": "QEMU"
363 * }
364 * }
365 */
366 static const uint8_t hmc_eeprom[] = {
367 0x01, 0x00, 0x00, 0x01, 0x0b, 0x00, 0x00, 0xf3, 0x01, 0x0a, 0x19, 0x8c,
368 0x19, 0xf0, 0x85, 0xae, 0x9d, 0x92, 0x69, 0x08, 0x8c, 0x30, 0x75, 0x59,
369 0x54, 0x13, 0x42, 0x12, 0x80, 0xc4, 0x65, 0x5b, 0x27, 0x8a, 0x10, 0x04,
370 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x8e, 0x10, 0x04, 0x35,
371 0x10, 0x04, 0x41, 0x50, 0x03, 0x41, 0x10, 0xd4, 0x40, 0x10, 0x04, 0xc0,
372 0xca, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x47, 0xca,
373 0x52, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x3a, 0x20, 0x52, 0x30, 0xc1, 0x00,
374 0x00, 0x00, 0x00, 0x81, 0x01, 0x09, 0x19, 0x85, 0xae, 0x9d, 0x92, 0x69,
375 0x08, 0xd3, 0x48, 0x4d, 0x43, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x47, 0x42,
376 0x32, 0x30, 0x30, 0x20, 0x4e, 0x56, 0x4c, 0x37, 0x32, 0x8e, 0x11, 0x04,
377 0x35, 0x10, 0x04, 0x41, 0x50, 0x03, 0x41, 0x10, 0xd4, 0x40, 0x50, 0x04,
378 0x82, 0x61, 0x04, 0x8a, 0x11, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04,
379 0x41, 0x11, 0x83, 0x71, 0xd9, 0xd6, 0xc0, 0xc1, 0x00, 0x00, 0x00, 0x00,
380 0x00, 0x00, 0x00, 0x65
381 };
382 static const size_t hmc_eeprom_len = sizeof(hmc_eeprom);
383
384 /*
385 * CX-7 NIC FRU data. Generated with frugen.
386 *
387 * {
388 * "board": {
389 * "mfg": "Nvidia",
390 * "pname": "Nvidia ConnectX-7 OCP3.0 (QEMU)",
391 * "pn": "CX70000000-000_00",
392 * "serial": "000000000000",
393 * "date": "01/12/2025 00:00"
394 * },
395 * "product": {
396 * "mfg": "Nvidia",
397 * "pname": "Nvidia ConnectX-7 OCP3.0",
398 * "pn": "CX71000000-000_01",
399 * "ver": "A7",
400 * "serial": "100000000001",
401 * "atag": "QEMU"
402 * }
403 * }
404 */
405 static const uint8_t nic_eeprom[] = {
406 0x01, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0xf4, 0x01, 0x09, 0x19, 0x8c,
407 0x19, 0xf0, 0xc6, 0x4e, 0x76, 0x69, 0x64, 0x69, 0x61, 0xdf, 0x4e, 0x76,
408 0x69, 0x64, 0x69, 0x61, 0x20, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
409 0x58, 0x2d, 0x37, 0x20, 0x4f, 0x43, 0x50, 0x33, 0x2e, 0x30, 0x20, 0x28,
410 0x51, 0x45, 0x4d, 0x55, 0x29, 0x89, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41,
411 0x10, 0x04, 0x41, 0x8d, 0x23, 0x7e, 0x41, 0x10, 0x04, 0x41, 0x10, 0xd4,
412 0x40, 0x10, 0xf4, 0x43, 0x10, 0xc0, 0xc1, 0xc3, 0x01, 0x09, 0x19, 0xc6,
413 0x4e, 0x76, 0x69, 0x64, 0x69, 0x61, 0xd8, 0x4e, 0x76, 0x69, 0x64, 0x69,
414 0x61, 0x20, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x58, 0x2d, 0x37,
415 0x20, 0x4f, 0x43, 0x50, 0x33, 0x2e, 0x30, 0x8d, 0x23, 0x7e, 0x45, 0x10,
416 0x04, 0x41, 0x10, 0xd4, 0x40, 0x10, 0xf4, 0x43, 0x11, 0x82, 0xe1, 0x05,
417 0x89, 0x11, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x45, 0x83, 0x71,
418 0xd9, 0xd6, 0xc0, 0xc1, 0x00, 0x00, 0x00, 0xf3
419 };
420 static const size_t nic_eeprom_len = sizeof(nic_eeprom);
421
422 /*
423 * Cable Cartridge FRU data. Generated with frugen.
424 *
425 * {
426 * "board": {
427 * "mfg": "Nvidia",
428 * "pname": "18x1RU CBL Cartridge (QEMU)",
429 * "pn": "000-0000-000",
430 * "serial": "0000000000000",
431 * "date": "01/12/2025 00:00"
432 * },
433 * "product": {
434 * "mfg": "Nvidia",
435 * "pname": "18x1RU CBL Cartridge",
436 * "pn": "100-00000-0000-001",
437 * "ver": "E.4",
438 * "serial": "1000000000001",
439 * "atag": "QEMU"
440 * }
441 * }
442 */
443 static const uint8_t cable_eeprom[] = {
444 0x01, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0xf4, 0x01, 0x09, 0x19, 0x8c,
445 0x19, 0xf0, 0xc6, 0x4e, 0x76, 0x69, 0x64, 0x69, 0x61, 0xdb, 0x31, 0x38,
446 0x78, 0x31, 0x52, 0x55, 0x20, 0x43, 0x42, 0x4c, 0x20, 0x43, 0x61, 0x72,
447 0x74, 0x72, 0x69, 0x64, 0x67, 0x65, 0x20, 0x28, 0x51, 0x45, 0x4d, 0x55,
448 0x29, 0x8a, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10,
449 0x89, 0x10, 0x04, 0x35, 0x10, 0x04, 0x41, 0x0d, 0x04, 0x41, 0xc0, 0xc1,
450 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb1, 0x01, 0x09, 0x19, 0xc6,
451 0x4e, 0x76, 0x69, 0x64, 0x69, 0x61, 0xd4, 0x31, 0x38, 0x78, 0x31, 0x52,
452 0x55, 0x20, 0x43, 0x42, 0x4c, 0x20, 0x43, 0x61, 0x72, 0x74, 0x72, 0x69,
453 0x64, 0x67, 0x65, 0x8e, 0x11, 0x04, 0x35, 0x10, 0x04, 0x41, 0x50, 0x03,
454 0x41, 0x10, 0xd4, 0x40, 0x50, 0x04, 0x83, 0xa5, 0x43, 0x01, 0x8a, 0x11,
455 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x11, 0x83, 0x71, 0xd9,
456 0xd6, 0xc0, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x25
457 };
458 static const size_t cable_eeprom_len = sizeof(cable_eeprom);
459
460 static void catalina_bmc_i2c_init(AspeedMachineState *bmc)
461 {
462 /* Reference from v6.16-rc2 aspeed-bmc-facebook-catalina.dts */
463
464 AspeedSoCState *soc = bmc->soc;
465 I2CBus *i2c[16] = {};
466 I2CSlave *i2c_mux;
467
468 /* busses 0-15 are all used. */
469 for (int i = 0; i < ARRAY_SIZE(i2c); i++) {
470 i2c[i] = aspeed_i2c_get_bus(&soc->i2c, i);
471 }
472
473 /* &i2c0 */
474 /* i2c-mux@71 (PCA9546) on i2c0 */
475 i2c_mux = i2c_slave_create_simple(i2c[0], TYPE_PCA9546, 0x71);
476
477 /* i2c0mux0ch0 */
478 /* IOB0 NIC0 temperature-sensor@1f - tmp421 */
479 i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 0),
480 TYPE_TMP421, 0x1f);
481 /* i2c0mux0ch2 */
482 /* IOB0 NIC1 temperature-sensor@1f - tmp421 */
483 i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 2),
484 TYPE_TMP421, 0x1f);
485
486 /* i2c-mux@72 (PCA9546) on i2c0 */
487 i2c_mux = i2c_slave_create_simple(i2c[0], TYPE_PCA9546, 0x72);
488
489 /* i2c0mux1ch1 */
490 /* io_expander7 - pca9535@20 */
491 i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 1),
492 TYPE_PCA9535, 0x20);
493 /* eeprom@50 */
494 at24c_eeprom_init_rom(pca954x_i2c_get_bus(i2c_mux, 1), 0x50, 8 * KiB,
495 gb200io_eeprom, gb200io_eeprom_len);
496
497 /* i2c-mux@73 (PCA9546) on i2c0 */
498 i2c_slave_create_simple(i2c[0], TYPE_PCA9546, 0x73);
499
500 /* i2c-mux@75 (PCA9546) on i2c0 */
501 i2c_mux = i2c_slave_create_simple(i2c[0], TYPE_PCA9546, 0x75);
502
503 /* i2c0mux3ch0 */
504 /* IOB1 NIC0 temperature-sensor@1f - tmp421 */
505 i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 0),
506 TYPE_TMP421, 0x1f);
507 /* i2c0mux3ch2 */
508 /* IOB1 NIC1 temperature-sensor@1f - tmp421 */
509 i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 2),
510 TYPE_TMP421, 0x1f);
511
512 /* i2c-mux@76 (PCA9546) on i2c0 */
513 i2c_mux = i2c_slave_create_simple(i2c[0], TYPE_PCA9546, 0x76);
514
515 /* i2c0mux4ch1 */
516 /* io_expander8 - pca9535@21 */
517 i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 1),
518 TYPE_PCA9535, 0x21);
519 /* eeprom@50 */
520 at24c_eeprom_init_rom(pca954x_i2c_get_bus(i2c_mux, 1), 0x50, 8 * KiB,
521 gb200io_eeprom, gb200io_eeprom_len);
522
523 /* i2c-mux@77 (PCA9546) on i2c0 */
524 i2c_slave_create_simple(i2c[0], TYPE_PCA9546, 0x77);
525
526
527 /* &i2c1 */
528 /* i2c-mux@70 (PCA9548) on i2c1 */
529 i2c_mux = i2c_slave_create_simple(i2c[1], TYPE_PCA9548, 0x70);
530 /* i2c1mux0ch0 */
531 /* ina238@41 - no model */
532 /* ina238@42 - no model */
533 /* ina238@44 - no model */
534 /* i2c1mux0ch1 */
535 /* ina238@41 - no model */
536 /* ina238@43 - no model */
537 /* i2c1mux0ch4 */
538 /* ltc4287@42 - no model */
539 /* ltc4287@43 - no model */
540
541 /* i2c1mux0ch5 */
542 /* eeprom@54 */
543 at24c_eeprom_init_rom(pca954x_i2c_get_bus(i2c_mux, 5), 0x54, 8 * KiB,
544 pdb_eeprom, pdb_eeprom_len);
545 /* tpm75@4f */
546 i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 5), TYPE_TMP75, 0x4f);
547
548 /* i2c1mux0ch6 */
549 /* io_expander5 - pca9554@27 */
550 i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 6),
551 TYPE_PCA9554, 0x27);
552 /* io_expander6 - pca9555@25 */
553 i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 6),
554 TYPE_PCA9555, 0x25);
555 /* eeprom@51 */
556 at24c_eeprom_init_rom(pca954x_i2c_get_bus(i2c_mux, 6), 0x51, 8 * KiB,
557 osfp_eeprom, osfp_eeprom_len);
558
559 /* i2c1mux0ch7 */
560 /* eeprom@53 */
561 at24c_eeprom_init_rom(pca954x_i2c_get_bus(i2c_mux, 7), 0x53, 8 * KiB,
562 fio_eeprom, fio_eeprom_len);
563 /* temperature-sensor@4b - tmp75 */
564 i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 7), TYPE_TMP75, 0x4b);
565 /* temperature-sensor@4f - tmp75 (FIO remote) */
566 i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 7), TYPE_TMP75, 0x4f);
567
568 /* &i2c2 */
569 /* io_expander0 - pca9555@20 */
570 i2c_slave_create_simple(i2c[2], TYPE_PCA9555, 0x20);
571 /* io_expander0 - pca9555@21 */
572 i2c_slave_create_simple(i2c[2], TYPE_PCA9555, 0x21);
573 /* io_expander0 - pca9555@27 */
574 i2c_slave_create_simple(i2c[2], TYPE_PCA9555, 0x27);
575 /* eeprom@50 */
576 at24c_eeprom_init(i2c[2], 0x50, 8 * KiB);
577 /* eeprom@51 */
578 at24c_eeprom_init(i2c[2], 0x51, 8 * KiB);
579
580 /* &i2c5 */
581 /* i2c-mux@70 (PCA9548) on i2c5 */
582 i2c_mux = i2c_slave_create_simple(i2c[5], TYPE_PCA9548, 0x70);
583 /* i2c5mux0ch6 */
584 /* eeprom@52 */
585 at24c_eeprom_init_rom(pca954x_i2c_get_bus(i2c_mux, 6), 0x52, 8 * KiB,
586 hdd_eeprom, hdd_eeprom_len);
587 /* i2c5mux0ch7 - empty */
588
589 /* &i2c6 */
590 /* io_expander3 - pca9555@21 */
591 i2c_slave_create_simple(i2c[6], TYPE_PCA9555, 0x21);
592 /* rtc@6f - nct3018y */
593 i2c_slave_create_simple(i2c[6], TYPE_DS1338, 0x6f);
594
595 /* &i2c9 */
596 /* io_expander4 - pca9555@4f */
597 i2c_slave_create_simple(i2c[9], TYPE_PCA9555, 0x4f);
598 /* temperature-sensor@4b - tpm75 */
599 i2c_slave_create_simple(i2c[9], TYPE_TMP75, 0x4b);
600 /* eeprom@50 */
601 at24c_eeprom_init_rom(i2c[9], 0x50, 8 * KiB, scm_eeprom, scm_eeprom_len);
602 /* eeprom@56 */
603 at24c_eeprom_init_rom(i2c[9], 0x56, 8 * KiB, bsm_eeprom, bsm_eeprom_len);
604
605 /* &i2c10 */
606 /* temperature-sensor@1f - tpm421 */
607 i2c_slave_create_simple(i2c[10], TYPE_TMP421, 0x1f);
608 /* eeprom@50 */
609 at24c_eeprom_init_rom(i2c[10], 0x50, 8 * KiB, nic_eeprom, nic_eeprom_len);
610
611 /* &i2c11 */
612 /* ssif-bmc@10 - no model */
613
614 /* &i2c12 */
615 /* eeprom@50 */
616 at24c_eeprom_init_rom(i2c[12], 0x50, 8 * KiB,
617 gb200_eeprom, gb200_eeprom_len);
618 /* eeprom@54 */
619 at24c_eeprom_init_rom(i2c[12], 0x54, 256,
620 cable_eeprom, cable_eeprom_len);
621
622 /* &i2c13 */
623 /* eeprom@50 */
624 at24c_eeprom_init_rom(i2c[13], 0x50, 8 * KiB,
625 gb200_eeprom, gb200_eeprom_len);
626 /* eeprom@54 */
627 at24c_eeprom_init_rom(i2c[13], 0x54, 256,
628 cable_eeprom, cable_eeprom_len);
629 /* eeprom@57 */
630 at24c_eeprom_init_rom(i2c[13], 0x57, 256, hmc_eeprom, hmc_eeprom_len);
631
632 /* &i2c14 */
633 /* io_expander9 - pca9555@10 */
634 i2c_slave_create_simple(i2c[14], TYPE_PCA9555, 0x10);
635 /* io_expander10 - pca9555@11 */
636 i2c_slave_create_simple(i2c[14], TYPE_PCA9555, 0x11);
637 /* io_expander11 - pca9555@12 */
638 i2c_slave_create_simple(i2c[14], TYPE_PCA9555, 0x12);
639 /* io_expander12 - pca9555@13 */
640 i2c_slave_create_simple(i2c[14], TYPE_PCA9555, 0x13);
641 /* io_expander13 - pca9555@14 */
642 i2c_slave_create_simple(i2c[14], TYPE_PCA9555, 0x14);
643 /* io_expander14 - pca9555@15 */
644 i2c_slave_create_simple(i2c[14], TYPE_PCA9555, 0x15);
645
646 /* &i2c15 */
647 /* temperature-sensor@1f - tmp421 */
648 i2c_slave_create_simple(i2c[15], TYPE_TMP421, 0x1f);
649 /* eeprom@52 */
650 at24c_eeprom_init_rom(i2c[15], 0x52, 8 * KiB, nic_eeprom, nic_eeprom_len);
651 }
652
653 static void aspeed_machine_catalina_class_init(ObjectClass *oc,
654 const void *data)
655 {
656 MachineClass *mc = MACHINE_CLASS(oc);
657 AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
658
659 mc->desc = "Facebook Catalina BMC (Cortex-A7)";
660 amc->soc_name = "ast2600-a3";
661 amc->hw_strap1 = CATALINA_BMC_HW_STRAP1;
662 amc->hw_strap2 = CATALINA_BMC_HW_STRAP2;
663 amc->fmc_model = "w25q01jvq";
664 amc->spi_model = NULL;
665 amc->num_cs = 2;
666 amc->macs_mask = ASPEED_MAC2_ON;
667 amc->i2c_init = catalina_bmc_i2c_init;
668 mc->default_ram_size = CATALINA_BMC_RAM_SIZE;
669 aspeed_machine_class_init_cpus_defaults(mc);
670 aspeed_machine_ast2600_class_emmc_init(oc);
671 }
672
673 static const TypeInfo aspeed_ast2600_catalina_types[] = {
674 {
675 .name = MACHINE_TYPE_NAME("catalina-bmc"),
676 .parent = TYPE_ASPEED_MACHINE,
677 .class_init = aspeed_machine_catalina_class_init,
678 .interfaces = arm_machine_interfaces,
679 }
680 };
681
682 DEFINE_TYPES(aspeed_ast2600_catalina_types)