payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / mainboard / msi / ms7d25 / mainboard.c
blob9c3a3ae17ef4d4427a41101e6250a79ff194cf9b
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <acpi/acpi.h>
4 #include <device/device.h>
5 #include <soc/pci_devs.h>
6 #include <soc/ramstage.h>
7 #include <smbios.h>
8 #include <string.h>
10 void mainboard_fill_fadt(acpi_fadt_t *fadt)
12 fadt->preferred_pm_profile = PM_DESKTOP;
13 fadt->iapc_boot_arch |= ACPI_FADT_LEGACY_DEVICES | ACPI_FADT_8042;
16 static void mainboard_init(void *chip_info)
21 u8 smbios_mainboard_feature_flags(void)
23 return SMBIOS_FEATURE_FLAGS_HOSTING_BOARD | SMBIOS_FEATURE_FLAGS_REPLACEABLE;
26 smbios_wakeup_type smbios_system_wakeup_type(void)
28 return SMBIOS_WAKEUP_TYPE_POWER_SWITCH;
31 const char *smbios_system_product_name(void)
33 return "MS-7D25";
36 const char *smbios_mainboard_product_name(void)
38 /* Currently we support DDR4 variants, but e.g. DDR5 can be added later */
39 if (CONFIG(BOARD_MSI_Z690_A_PRO_WIFI_DDR4)) {
40 if (is_devfn_enabled(PCH_DEVFN_CNVI_WIFI))
41 return "PRO Z690-A WIFI DDR4(MS-7D25)";
42 else
43 return "PRO Z690-A DDR4(MS-7D25)";
46 return CONFIG_MAINBOARD_PART_NUMBER;
49 /* Only baseboard serial number is populated */
50 const char *smbios_system_serial_number(void)
52 return "Default string";
55 const char *smbios_system_sku(void)
57 return "Default string";
60 void mainboard_silicon_init_params(FSP_S_CONFIG *params)
62 memset(params->PcieRpEnableCpm, 0, sizeof(params->PcieRpEnableCpm));
63 memset(params->CpuPcieRpEnableCpm, 0, sizeof(params->CpuPcieRpEnableCpm));
64 memset(params->CpuPcieClockGating, 0, sizeof(params->CpuPcieClockGating));
65 memset(params->CpuPciePowerGating, 0, sizeof(params->CpuPciePowerGating));
67 params->UsbPdoProgramming = 1;
69 params->CpuPcieFiaProgramming = 1;
71 params->PcieRpFunctionSwap = 0;
72 params->CpuPcieRpFunctionSwap = 0;
74 params->CpuPcieRpPmSci[0] = 1; // M2_1
75 params->CpuPcieRpPmSci[1] = 1; // PCI_E1
76 params->PcieRpPmSci[0] = 1; // PCI_E2
77 params->PcieRpPmSci[1] = 1; // PCI_E4
78 params->PcieRpPmSci[2] = 1; // Ethernet
79 params->PcieRpPmSci[4] = 1; // PCI_E3
80 params->PcieRpPmSci[8] = 1; // M2_3
81 params->PcieRpPmSci[20] = 1; // M2_4
82 params->PcieRpPmSci[24] = 1; // M2_2
84 params->PcieRpMaxPayload[0] = 1; // PCI_E2
85 params->PcieRpMaxPayload[1] = 1; // PCI_E4
86 params->PcieRpMaxPayload[2] = 1; // Ethernet
87 params->PcieRpMaxPayload[4] = 1; // PCI_E3
88 params->PcieRpMaxPayload[8] = 1; // M2_3
89 params->PcieRpMaxPayload[20] = 1; // M2_4
90 params->PcieRpMaxPayload[24] = 1; // M2_2
92 params->CpuPcieRpTransmitterHalfSwing[0] = 1; // M2_1
93 params->CpuPcieRpTransmitterHalfSwing[1] = 1; // PCI_E1
94 params->PcieRpTransmitterHalfSwing[0] = 1; // PCI_E2
95 params->PcieRpTransmitterHalfSwing[1] = 1; // PCI_E4
96 params->PcieRpTransmitterHalfSwing[2] = 1; // Ethernet
97 params->PcieRpTransmitterHalfSwing[4] = 1; // PCI_E3
98 params->PcieRpTransmitterHalfSwing[8] = 1; // M2_3
99 params->PcieRpTransmitterHalfSwing[20] = 1; // M2_4
100 params->PcieRpTransmitterHalfSwing[24] = 1; // M2_2
102 params->PcieRpEnableCpm[0] = 1; // PCI_E2
103 params->PcieRpEnableCpm[1] = 1; // PCI_E4
104 params->PcieRpEnableCpm[4] = 1; // PCI_E3
105 params->PcieRpEnableCpm[8] = 1; // M2_3
106 params->PcieRpEnableCpm[20] = 1; // M2_4
107 params->PcieRpEnableCpm[24] = 1; // M2_2
109 params->PcieRpAcsEnabled[0] = 1; // PCI_E2
110 params->PcieRpAcsEnabled[1] = 1; // PCI_E4
111 params->PcieRpAcsEnabled[2] = 1; // Ethernet
112 params->PcieRpAcsEnabled[4] = 1; // PCI_E3
113 params->PcieRpAcsEnabled[8] = 1; // M2_3
114 params->PcieRpAcsEnabled[20] = 1; // M2_4
115 params->PcieRpAcsEnabled[24] = 1; // M2_2
117 params->CpuPcieRpEnableCpm[0] = 1; // M2_1
118 params->CpuPcieClockGating[0] = 1;
119 params->CpuPciePowerGating[0] = 1;
120 params->CpuPcieRpMultiVcEnabled[0] = 1;
121 params->CpuPcieRpPeerToPeerMode[0] = 1;
122 params->CpuPcieRpMaxPayload[0] = 2; // 512B
123 params->CpuPcieRpAcsEnabled[0] = 1;
125 params->CpuPcieRpEnableCpm[1] = 1; // PCI_E1
126 params->CpuPcieClockGating[1] = 1;
127 params->CpuPciePowerGating[1] = 1;
128 params->CpuPcieRpPeerToPeerMode[1] = 1;
129 params->CpuPcieRpMaxPayload[1] = 2; // 512B
130 params->CpuPcieRpAcsEnabled[1] = 1;
132 params->SataPortsSolidStateDrive[6] = 1; // M2_3
133 params->SataPortsSolidStateDrive[7] = 1; // M2_4
134 params->SataLedEnable = 1;
137 #if CONFIG(GENERATE_SMBIOS_TABLES)
138 static const struct port_information smbios_type8_info[] = {
140 .internal_reference_designator = "PS2_USB1",
141 .internal_connector_type = CONN_NONE,
142 .external_reference_designator = "Keyboard",
143 .external_connector_type = CONN_PS_2,
144 .port_type = TYPE_KEYBOARD_PORT
147 .internal_reference_designator = "PS2_USB1",
148 .internal_connector_type = CONN_NONE,
149 .external_reference_designator = "PS2Mouse",
150 .external_connector_type = CONN_PS_2,
151 .port_type = TYPE_MOUSE_PORT
154 .internal_reference_designator = "PS2_USB1",
155 .internal_connector_type = CONN_NONE,
156 .external_reference_designator = "USB 2.0 Type-A",
157 .external_connector_type = CONN_ACCESS_BUS_USB,
158 .port_type = TYPE_USB
161 .internal_reference_designator = "PS2_USB1",
162 .internal_connector_type = CONN_NONE,
163 .external_reference_designator = "USB 2.0 Type-A (Flash BIOS)",
164 .external_connector_type = CONN_ACCESS_BUS_USB,
165 .port_type = TYPE_USB
168 .internal_reference_designator = "JTPM1 - TPM HDR",
169 .internal_connector_type = CONN_OTHER,
170 .external_reference_designator = "",
171 .external_connector_type = CONN_NONE,
172 .port_type = TYPE_OTHER_PORT
175 .internal_reference_designator = "LAN_USB1",
176 .internal_connector_type = CONN_NONE,
177 .external_reference_designator = "Ethernet",
178 .external_connector_type = CONN_RJ_45,
179 .port_type = TYPE_NETWORK_PORT
182 .internal_reference_designator = "LAN_USB1",
183 .internal_connector_type = CONN_NONE,
184 .external_reference_designator = "USB 3.2 Gen2x2 Type-C",
185 .external_connector_type = CONN_USB_TYPE_C,
186 .port_type = TYPE_USB
189 .internal_reference_designator = "LAN_USB1",
190 .internal_connector_type = CONN_NONE,
191 .external_reference_designator = "USB 3.2 Gen2 Type-A",
192 .external_connector_type = CONN_ACCESS_BUS_USB,
193 .port_type = TYPE_USB
196 .internal_reference_designator = "SATA1",
197 .internal_connector_type = CONN_SAS_SATA,
198 .external_reference_designator = "",
199 .external_connector_type = CONN_NONE,
200 .port_type = TYPE_SATA
203 .internal_reference_designator = "SATA2",
204 .internal_connector_type = CONN_SAS_SATA,
205 .external_reference_designator = "",
206 .external_connector_type = CONN_NONE,
207 .port_type = TYPE_SATA
210 .internal_reference_designator = "SATA3",
211 .internal_connector_type = CONN_SAS_SATA,
212 .external_reference_designator = "",
213 .external_connector_type = CONN_NONE,
214 .port_type = TYPE_SATA
217 .internal_reference_designator = "SATA4",
218 .internal_connector_type = CONN_SAS_SATA,
219 .external_reference_designator = "",
220 .external_connector_type = CONN_NONE,
221 .port_type = TYPE_SATA
224 .internal_reference_designator = "SATA5",
225 .internal_connector_type = CONN_SAS_SATA,
226 .external_reference_designator = "",
227 .external_connector_type = CONN_NONE,
228 .port_type = TYPE_SATA
231 .internal_reference_designator = "SATA6",
232 .internal_connector_type = CONN_SAS_SATA,
233 .external_reference_designator = "",
234 .external_connector_type = CONN_NONE,
235 .port_type = TYPE_SATA
238 .internal_reference_designator = "JTBT1",
239 .internal_connector_type = CONN_OTHER,
240 .external_reference_designator = "",
241 .external_connector_type = CONN_NONE,
242 .port_type = TYPE_THUNDERBOLT
245 .internal_reference_designator = "JC1 - CHASSIS INTRUSION",
246 .internal_connector_type = CONN_OTHER,
247 .external_reference_designator = "",
248 .external_connector_type = CONN_NONE,
249 .port_type = TYPE_OTHER_PORT
252 .internal_reference_designator = "JAUD1 - FRONT AUDIO",
253 .internal_connector_type = CONN_OTHER,
254 .external_reference_designator = "",
255 .external_connector_type = CONN_NONE,
256 .port_type = TYPE_AUDIO_PORT
259 .internal_reference_designator = "AUDIO1 - REAR AUDIO",
260 .internal_connector_type = CONN_NONE,
261 .external_reference_designator = "Audio",
262 .external_connector_type = CONN_OTHER,
263 .port_type = TYPE_AUDIO_PORT
266 .internal_reference_designator = "JFP1 - FRONT PANEL",
267 .internal_connector_type = CONN_OTHER,
268 .external_reference_designator = "",
269 .external_connector_type = CONN_NONE,
270 .port_type = TYPE_OTHER_PORT
273 .internal_reference_designator = "JFP2 - PC SPEAKER",
274 .internal_connector_type = CONN_OTHER,
275 .external_reference_designator = "",
276 .external_connector_type = CONN_NONE,
277 .port_type = TYPE_OTHER_PORT
280 .internal_reference_designator = "JBAT1 - CLEAR CMOS",
281 .internal_connector_type = CONN_OTHER,
282 .external_reference_designator = "",
283 .external_connector_type = CONN_NONE,
284 .port_type = TYPE_OTHER_PORT
287 .internal_reference_designator = "JDASH1 - TUNING CONTROLLER",
288 .internal_connector_type = CONN_OTHER,
289 .external_reference_designator = "",
290 .external_connector_type = CONN_NONE,
291 .port_type = TYPE_OTHER_PORT
294 .internal_reference_designator = "JRGB1 - 5050 RGB LED",
295 .internal_connector_type = CONN_OTHER,
296 .external_reference_designator = "",
297 .external_connector_type = CONN_NONE,
298 .port_type = TYPE_OTHER_PORT
301 .internal_reference_designator = "JRAINBOW1 - WS2812B RGB LED",
302 .internal_connector_type = CONN_OTHER,
303 .external_reference_designator = "",
304 .external_connector_type = CONN_NONE,
305 .port_type = TYPE_OTHER_PORT
308 .internal_reference_designator = "JRAINBOW2 - WS2812B RGB LED",
309 .internal_connector_type = CONN_OTHER,
310 .external_reference_designator = "",
311 .external_connector_type = CONN_NONE,
312 .port_type = TYPE_OTHER_PORT
315 .internal_reference_designator = "CPU_FAN1",
316 .internal_connector_type = CONN_OTHER,
317 .external_reference_designator = "",
318 .external_connector_type = CONN_NONE,
319 .port_type = TYPE_OTHER_PORT
322 .internal_reference_designator = "PUMP_FAN1",
323 .internal_connector_type = CONN_OTHER,
324 .external_reference_designator = "",
325 .external_connector_type = CONN_NONE,
326 .port_type = TYPE_OTHER_PORT
329 .internal_reference_designator = "SYS_FAN1",
330 .internal_connector_type = CONN_OTHER,
331 .external_reference_designator = "",
332 .external_connector_type = CONN_NONE,
333 .port_type = TYPE_OTHER_PORT
336 .internal_reference_designator = "SYS_FAN2",
337 .internal_connector_type = CONN_OTHER,
338 .external_reference_designator = "",
339 .external_connector_type = CONN_NONE,
340 .port_type = TYPE_OTHER_PORT
343 .internal_reference_designator = "SYS_FAN3",
344 .internal_connector_type = CONN_OTHER,
345 .external_reference_designator = "",
346 .external_connector_type = CONN_NONE,
347 .port_type = TYPE_OTHER_PORT
350 .internal_reference_designator = "SYS_FAN4",
351 .internal_connector_type = CONN_OTHER,
352 .external_reference_designator = "",
353 .external_connector_type = CONN_NONE,
354 .port_type = TYPE_OTHER_PORT
357 .internal_reference_designator = "SYS_FAN5",
358 .internal_connector_type = CONN_OTHER,
359 .external_reference_designator = "",
360 .external_connector_type = CONN_NONE,
361 .port_type = TYPE_OTHER_PORT
364 .internal_reference_designator = "SYS_FAN6",
365 .internal_connector_type = CONN_OTHER,
366 .external_reference_designator = "",
367 .external_connector_type = CONN_NONE,
368 .port_type = TYPE_OTHER_PORT
371 .internal_reference_designator = "DP_HDMI1",
372 .internal_connector_type = CONN_NONE,
373 .external_reference_designator = "HDMI",
374 .external_connector_type = CONN_OTHER,
375 .port_type = TYPE_VIDEO_PORT
378 .internal_reference_designator = "DP_HDMI1",
379 .internal_connector_type = CONN_NONE,
380 .external_reference_designator = "Display Port",
381 .external_connector_type = CONN_OTHER,
382 .port_type = TYPE_VIDEO_PORT
385 .internal_reference_designator = "USB2",
386 .internal_connector_type = CONN_NONE,
387 .external_reference_designator = "USB 2.0 Type-A (Upper)",
388 .external_connector_type = CONN_ACCESS_BUS_USB,
389 .port_type = TYPE_USB
392 .internal_reference_designator = "USB2",
393 .internal_connector_type = CONN_NONE,
394 .external_reference_designator = "USB 2.0 Type-A (Lower)",
395 .external_connector_type = CONN_ACCESS_BUS_USB,
396 .port_type = TYPE_USB
399 .internal_reference_designator = "USB2",
400 .internal_connector_type = CONN_NONE,
401 .external_reference_designator = "USB 3.2 Gen1 Type-A (Upper)",
402 .external_connector_type = CONN_ACCESS_BUS_USB,
403 .port_type = TYPE_USB
406 .internal_reference_designator = "USB2",
407 .internal_connector_type = CONN_NONE,
408 .external_reference_designator = "USB 3.2 Gen1 Type-A (Lower)",
409 .external_connector_type = CONN_ACCESS_BUS_USB,
410 .port_type = TYPE_USB
413 .internal_reference_designator = "JUSB1 - USB 2.0 ",
414 .internal_connector_type = CONN_OTHER,
415 .external_reference_designator = "",
416 .external_connector_type = CONN_NONE,
417 .port_type = TYPE_USB
420 .internal_reference_designator = "JUSB2 - USB 2.0",
421 .internal_connector_type = CONN_OTHER,
422 .external_reference_designator = "",
423 .external_connector_type = CONN_NONE,
424 .port_type = TYPE_USB
427 .internal_reference_designator = "JUSB3 - USB 3.2 GEN 1",
428 .internal_connector_type = CONN_OTHER,
429 .external_reference_designator = "",
430 .external_connector_type = CONN_NONE,
431 .port_type = TYPE_USB
434 .internal_reference_designator = "JUSB4 - USB 3.2 GEN 1",
435 .internal_connector_type = CONN_OTHER,
436 .external_reference_designator = "",
437 .external_connector_type = CONN_NONE,
438 .port_type = TYPE_USB
441 .internal_reference_designator = "JUSB5 - USB-C",
442 .internal_connector_type = CONN_OTHER,
443 .external_reference_designator = "",
444 .external_connector_type = CONN_NONE,
445 .port_type = TYPE_USB
448 .internal_reference_designator = "ATX_PWR1",
449 .internal_connector_type = CONN_OTHER,
450 .external_reference_designator = "",
451 .external_connector_type = CONN_NONE,
452 .port_type = TYPE_OTHER_PORT
455 .internal_reference_designator = "CPU_PWR1",
456 .internal_connector_type = CONN_OTHER,
457 .external_reference_designator = "",
458 .external_connector_type = CONN_NONE,
459 .port_type = TYPE_OTHER_PORT
462 .internal_reference_designator = "CPU_PWR2",
463 .internal_connector_type = CONN_OTHER,
464 .external_reference_designator = "",
465 .external_connector_type = CONN_NONE,
466 .port_type = TYPE_OTHER_PORT
470 static int mainboard_smbios_data(struct device *dev, int *handle, unsigned long *current)
472 int len = 0;
474 // add port information
475 len += smbios_write_type8(
476 current, handle,
477 smbios_type8_info,
478 ARRAY_SIZE(smbios_type8_info)
481 return len;
483 #endif
485 static void mainboard_enable(struct device *dev)
487 #if CONFIG(GENERATE_SMBIOS_TABLES)
488 dev->ops->get_smbios_data = mainboard_smbios_data;
489 #endif
492 struct chip_operations mainboard_ops = {
493 .init = mainboard_init,
494 .enable_dev = mainboard_enable,