mb/google/nissa/var/rull: Change padbased_override to rtd3 of wifi
[coreboot2.git] / src / mainboard / lenovo / t420 / early_init.c
blob514e5677c27c17c705b77b9af3552a8a79cfa45b
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/pci_ops.h>
4 #include <drivers/lenovo/hybrid_graphics/hybrid_graphics.h>
5 #include <northbridge/intel/sandybridge/sandybridge.h>
7 static void hybrid_graphics_init(void)
9 bool peg, igd;
10 u32 reg32;
12 early_hybrid_graphics(&igd, &peg);
14 if (peg && igd)
15 return;
17 /* Hide disabled devices */
18 reg32 = pci_read_config32(PCI_DEV(0, 0, 0), DEVEN);
19 reg32 &= ~(DEVEN_PEG10 | DEVEN_IGD);
21 if (peg)
22 reg32 |= DEVEN_PEG10;
24 if (igd)
25 reg32 |= DEVEN_IGD;
26 else
27 /* Disable IGD VGA decode, no GTT or GFX stolen */
28 pci_write_config16(PCI_DEV(0, 0, 0), GGC, 2);
30 pci_write_config32(PCI_DEV(0, 0, 0), DEVEN, reg32);
33 void mainboard_early_init(int s3resume)
35 hybrid_graphics_init();