payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / mainboard / lenovo / t420s / early_init.c
blob990a0b3e52e40effee2c84a1e08068135ff264af
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/pci_ops.h>
4 #include <northbridge/intel/sandybridge/raminit_native.h>
5 #include <southbridge/intel/bd82x6x/pch.h>
6 #include <drivers/lenovo/hybrid_graphics/hybrid_graphics.h>
7 #include <northbridge/intel/sandybridge/sandybridge.h>
8 #include <device/device.h>
10 static void hybrid_graphics_init(void)
12 bool peg, igd;
13 u32 reg32;
15 early_hybrid_graphics(&igd, &peg);
17 if (peg && igd)
18 return;
20 /* Hide disabled devices */
21 reg32 = pci_read_config32(PCI_DEV(0, 0, 0), DEVEN);
22 reg32 &= ~(DEVEN_PEG10 | DEVEN_IGD);
24 if (peg)
25 reg32 |= DEVEN_PEG10;
27 if (igd)
28 reg32 |= DEVEN_IGD;
29 else
30 /* Disable IGD VGA decode, no GTT or GFX stolen */
31 pci_write_config16(PCI_DEV(0, 0, 0), GGC, 2);
33 pci_write_config32(PCI_DEV(0, 0, 0), DEVEN, reg32);
36 const struct southbridge_usb_port mainboard_usb_ports[] = {
37 { 0, 1, -1 }, /* P0: empty */
38 { 1, 1, 1 }, /* P1: system port 2 (To system port) (EHCI debug), OC 1 */
39 { 1, 1, -1 }, /* P2: HALF MINICARD (WLAN) no oc */
40 { 1, 0, -1 }, /* P3: WWAN, no OC */
41 { 1, 1, -1 }, /* P4: smartcard, no OC */
42 { 1, 1, -1 }, /* P5: ExpressCard, no OC */
43 { 0, 0, -1 }, /* P6: empty */
44 { 0, 0, -1 }, /* P7: empty */
45 { 0, 1, -1 }, /* P8: empty (touch panel) */
46 { 1, 0, 5 }, /* P9: system port 1 (To USBAO) (EHCI debug), OC 5 */
47 { 1, 0, -1 }, /* P10: fingerprint reader, no OC */
48 { 1, 1, -1 }, /* P11: bluetooth, no OC. */
49 { 1, 1, -1 }, /* P12: docking, no OC */
50 { 1, 1, -1 }, /* P13: camera (LCD), no OC */
53 void mainboard_get_spd(spd_raw_data *spd, bool id_only)
55 read_spd(&spd[0], 0x50, id_only);
56 read_spd(&spd[2], 0x51, id_only);
59 void mainboard_early_init(int s3resume)
61 hybrid_graphics_init();