payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / mainboard / lenovo / t520 / early_init.c
blob54d42ea3dcafecc6deccec7bd8ca71dd293e8588
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <stdint.h>
4 #include <device/pci_ops.h>
5 #include <device/pci_def.h>
6 #include <northbridge/intel/sandybridge/sandybridge.h>
7 #include <northbridge/intel/sandybridge/raminit_native.h>
8 #include <southbridge/intel/bd82x6x/pch.h>
9 #include <drivers/lenovo/hybrid_graphics/hybrid_graphics.h>
10 #include <device/device.h>
12 static void hybrid_graphics_init(void)
14 bool peg, igd;
15 u32 reg32;
17 early_hybrid_graphics(&igd, &peg);
19 if (peg && igd)
20 return;
22 /* Hide disabled devices */
23 reg32 = pci_read_config32(PCI_DEV(0, 0, 0), DEVEN);
24 reg32 &= ~(DEVEN_PEG10 | DEVEN_IGD);
26 if (peg)
27 reg32 |= DEVEN_PEG10;
29 if (igd)
30 reg32 |= DEVEN_IGD;
31 else
32 /* Disable IGD VGA decode, no GTT or GFX stolen */
33 pci_write_config16(PCI_DEV(0, 0, 0), GGC, 2);
35 pci_write_config32(PCI_DEV(0, 0, 0), DEVEN, reg32);
38 const struct southbridge_usb_port mainboard_usb_ports[] = {
39 { 1, 1, 0 }, /* P0 left dual conn, OC 0 */
40 { 1, 1, 1 }, /* P1 system onboard USB (eSATA), (EHCI debug), OC 1 */
41 { 1, 2, -1 }, /* P2: wimax / WLAN */
42 { 1, 1, -1 }, /* P3: WWAN, no OC */
43 { 1, 1, -1 }, /* P4: smartcard, no OC */
44 { 1, 1, -1 }, /* P5: ExpressCard, no OC */
45 { 0, 2, -1 }, /* P6: empty */
46 { 0, 2, -1 }, /* P7: to touch panel, no OC */
47 { 1, 1, 4 }, /* P8: left dual conn, OC4 */
48 { 1, 4, 5 }, /* P9: to system subcard back right, (EHCI debug), OC 5 */
49 { 1, 1, -1 }, /* P10: fingerprint reader, no OC */
50 { 1, 2, -1 }, /* P11: bluetooth, no OC. */
51 { 1, 1, -1 }, /* P12: docking, no OC */
52 { 1, 1, -1 }, /* P13: CAMERA (LCD), no OC */
55 void mainboard_early_init(int s3resume)
57 hybrid_graphics_init();