blob: 445ef7afc044a5e896843f9f47d6eb2eb5212e2b [file] [log] [blame]
Angel Pons89ab2502020-04-03 01:22:28 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Nicolas Reineckeb165c4a2015-07-04 23:37:06 +02002
3#include <stdint.h>
4#include <device/pci_ops.h>
5#include <southbridge/intel/ibexpeak/pch.h>
6#include <drivers/lenovo/hybrid_graphics/hybrid_graphics.h>
Angel Pons95de2312020-02-17 13:08:53 +01007#include <northbridge/intel/ironlake/ironlake.h>
Nicolas Reineckeb165c4a2015-07-04 23:37:06 +02008
9const struct southbridge_usb_port mainboard_usb_ports[] = {
10 /* Enabled, Current table lookup index, OC map */
11 { 1, IF1_557, 0 },
12 { 1, IF1_55F, 1 },
13 { 1, IF1_74B, 3 },
14 { 1, IF1_14B, 3 },
15 { 1, IF1_14B, 3 },
16 { 1, IF1_74B, 3 },
17 { 1, IF1_74B, 3 },
18 { 1, IF1_74B, 3 },
19 { 1, IF1_55F, 4 },
20 { 1, IF1_55F, 5 },
21 { 1, IF1_74B, 7 },
22 { 1, IF1_74B, 7 },
23 { 1, IF1_557, 7 },
24 { 1, IF1_55F, 7 },
25};
26
27static void hybrid_graphics_init(void)
28{
29 bool peg, igd;
30 u32 reg32;
31
32 early_hybrid_graphics(&igd, &peg);
33
34 /* Hide disabled devices */
Angel Pons16fe1e02020-07-22 16:12:33 +020035 reg32 = pci_read_config32(PCI_DEV(0, 0, 0), DEVEN);
Nicolas Reineckeb165c4a2015-07-04 23:37:06 +020036 reg32 &= ~(DEVEN_PEG10 | DEVEN_IGD);
37
38 if (peg)
39 reg32 |= DEVEN_PEG10;
40
41 if (igd)
42 reg32 |= DEVEN_IGD;
43 else
44 /* Disable IGD VGA decode, no GTT or GFX stolen */
Angel Pons16fe1e02020-07-22 16:12:33 +020045 pci_write_config16(PCI_DEV(0, 0, 0), GGC, 2);
Nicolas Reineckeb165c4a2015-07-04 23:37:06 +020046
Angel Pons16fe1e02020-07-22 16:12:33 +020047 pci_write_config32(PCI_DEV(0, 0, 0), DEVEN, reg32);
Nicolas Reineckeb165c4a2015-07-04 23:37:06 +020048}
49
50void mainboard_pre_raminit(void)
51{
52 hybrid_graphics_init();
53}
54
55void mainboard_get_spd_map(u8 *spd_addrmap)
56{
57 spd_addrmap[0] = 0x50;
Patrick Rudolph07b402b2019-11-21 09:30:21 +010058 spd_addrmap[2] = 0x51;
Nicolas Reineckeb165c4a2015-07-04 23:37:06 +020059}