cpu/x86/smm/pci_resource_store: Store DEV/VEN ID
[coreboot2.git] / src / mainboard / lenovo / t520 / early_init.c
blob219ffc1751b7d8581a3c626c3532e1edcc51c86a
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 <southbridge/intel/bd82x6x/pch.h>
8 #include <drivers/lenovo/hybrid_graphics/hybrid_graphics.h>
9 #include <device/device.h>
11 static void hybrid_graphics_init(void)
13 bool peg, igd;
14 u32 reg32;
16 early_hybrid_graphics(&igd, &peg);
18 if (peg && igd)
19 return;
21 /* Hide disabled devices */
22 reg32 = pci_read_config32(PCI_DEV(0, 0, 0), DEVEN);
23 reg32 &= ~(DEVEN_PEG10 | DEVEN_IGD);
25 if (peg)
26 reg32 |= DEVEN_PEG10;
28 if (igd)
29 reg32 |= DEVEN_IGD;
30 else
31 /* Disable IGD VGA decode, no GTT or GFX stolen */
32 pci_write_config16(PCI_DEV(0, 0, 0), GGC, 2);
34 pci_write_config32(PCI_DEV(0, 0, 0), DEVEN, reg32);
37 const struct southbridge_usb_port mainboard_usb_ports[] = {
38 { 1, 1, 0 }, /* P0 left dual conn, OC 0 */
39 { 1, 1, 1 }, /* P1 system onboard USB (eSATA), (EHCI debug), OC 1 */
40 { 1, 2, -1 }, /* P2: wimax / WLAN */
41 { 1, 1, -1 }, /* P3: WWAN, no OC */
42 { 1, 1, -1 }, /* P4: smartcard, no OC */
43 { 1, 1, -1 }, /* P5: ExpressCard, no OC */
44 { 0, 2, -1 }, /* P6: empty */
45 { 0, 2, -1 }, /* P7: to touch panel, no OC */
46 { 1, 1, 4 }, /* P8: left dual conn, OC4 */
47 { 1, 4, 5 }, /* P9: to system subcard back right, (EHCI debug), OC 5 */
48 { 1, 1, -1 }, /* P10: fingerprint reader, no OC */
49 { 1, 2, -1 }, /* P11: bluetooth, no OC. */
50 { 1, 1, -1 }, /* P12: docking, no OC */
51 { 1, 1, -1 }, /* P13: CAMERA (LCD), no OC */
54 void mainboard_early_init(int s3resume)
56 hybrid_graphics_init();