blob: e5e95b218a119564045b06ce7d11ac12f3742e6b [file] [log] [blame]
Angel Pons89ab2502020-04-03 01:22:28 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Nicolas Reinecke572795b2014-12-29 19:57:29 +01002
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +02003#include <device/pci_ops.h>
Nicolas Reinecke572795b2014-12-29 19:57:29 +01004#include <southbridge/intel/bd82x6x/pch.h>
Patrick Rudolphdb27e3382017-07-27 18:00:59 +02005#include <drivers/lenovo/hybrid_graphics/hybrid_graphics.h>
6#include <northbridge/intel/sandybridge/sandybridge.h>
Patrick Rudolphdb27e3382017-07-27 18:00:59 +02007
8static void hybrid_graphics_init(void)
9{
10 bool peg, igd;
11 u32 reg32;
12
13 early_hybrid_graphics(&igd, &peg);
14
Evgeny Zinoviev384e9ae2018-08-30 02:18:48 +030015 if (peg && igd)
16 return;
17
Patrick Rudolphdb27e3382017-07-27 18:00:59 +020018 /* Hide disabled devices */
19 reg32 = pci_read_config32(PCI_DEV(0, 0, 0), DEVEN);
20 reg32 &= ~(DEVEN_PEG10 | DEVEN_IGD);
21
22 if (peg)
23 reg32 |= DEVEN_PEG10;
24
25 if (igd)
26 reg32 |= DEVEN_IGD;
27 else
28 /* Disable IGD VGA decode, no GTT or GFX stolen */
29 pci_write_config16(PCI_DEV(0, 0, 0), GGC, 2);
30
31 pci_write_config32(PCI_DEV(0, 0, 0), DEVEN, reg32);
32}
Nicolas Reinecke572795b2014-12-29 19:57:29 +010033
Nicolas Reinecke572795b2014-12-29 19:57:29 +010034const struct southbridge_usb_port mainboard_usb_ports[] = {
Peter Lemenkov18f88852019-10-23 22:07:58 +020035 { 0, 1, -1 }, /* P0: empty */
36 { 1, 1, 1 }, /* P1: system port 2 (To system port) (EHCI debug), OC 1 */
Nicolas Reinecke572795b2014-12-29 19:57:29 +010037 { 1, 1, -1 }, /* P2: HALF MINICARD (WLAN) no oc */
38 { 1, 0, -1 }, /* P3: WWAN, no OC */
39 { 1, 1, -1 }, /* P4: smartcard, no OC */
40 { 1, 1, -1 }, /* P5: ExpressCard, no OC */
41 { 0, 0, -1 }, /* P6: empty */
42 { 0, 0, -1 }, /* P7: empty */
43 { 0, 1, -1 }, /* P8: empty (touch panel) */
44 { 1, 0, 5 }, /* P9: system port 1 (To USBAO) (EHCI debug), OC 5 */
45 { 1, 0, -1 }, /* P10: fingerprint reader, no OC */
46 { 1, 1, -1 }, /* P11: bluetooth, no OC. */
47 { 1, 1, -1 }, /* P12: docking, no OC */
48 { 1, 1, -1 }, /* P13: camera (LCD), no OC */
49};
50
Patrick Rudolphdb27e3382017-07-27 18:00:59 +020051void mainboard_early_init(int s3resume)
52{
53 hybrid_graphics_init();
Vladimir Serbinenko609bd942016-01-31 14:00:54 +010054}