Angel Pons | 89ab250 | 2020-04-03 01:22:28 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Nicolas Reinecke | 572795b | 2014-12-29 19:57:29 +0100 | [diff] [blame] | 2 | |
Kyösti Mälkki | f1b58b7 | 2019-03-01 13:43:02 +0200 | [diff] [blame] | 3 | #include <device/pci_ops.h> |
Nicolas Reinecke | 572795b | 2014-12-29 19:57:29 +0100 | [diff] [blame] | 4 | #include <southbridge/intel/bd82x6x/pch.h> |
Patrick Rudolph | db27e338 | 2017-07-27 18:00:59 +0200 | [diff] [blame] | 5 | #include <drivers/lenovo/hybrid_graphics/hybrid_graphics.h> |
| 6 | #include <northbridge/intel/sandybridge/sandybridge.h> |
Patrick Rudolph | db27e338 | 2017-07-27 18:00:59 +0200 | [diff] [blame] | 7 | |
| 8 | static void hybrid_graphics_init(void) |
| 9 | { |
| 10 | bool peg, igd; |
| 11 | u32 reg32; |
| 12 | |
| 13 | early_hybrid_graphics(&igd, &peg); |
| 14 | |
Evgeny Zinoviev | 384e9ae | 2018-08-30 02:18:48 +0300 | [diff] [blame] | 15 | if (peg && igd) |
| 16 | return; |
| 17 | |
Patrick Rudolph | db27e338 | 2017-07-27 18:00:59 +0200 | [diff] [blame] | 18 | /* 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 Reinecke | 572795b | 2014-12-29 19:57:29 +0100 | [diff] [blame] | 33 | |
Nicolas Reinecke | 572795b | 2014-12-29 19:57:29 +0100 | [diff] [blame] | 34 | const struct southbridge_usb_port mainboard_usb_ports[] = { |
Peter Lemenkov | 18f8885 | 2019-10-23 22:07:58 +0200 | [diff] [blame] | 35 | { 0, 1, -1 }, /* P0: empty */ |
| 36 | { 1, 1, 1 }, /* P1: system port 2 (To system port) (EHCI debug), OC 1 */ |
Nicolas Reinecke | 572795b | 2014-12-29 19:57:29 +0100 | [diff] [blame] | 37 | { 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 Rudolph | db27e338 | 2017-07-27 18:00:59 +0200 | [diff] [blame] | 51 | void mainboard_early_init(int s3resume) |
| 52 | { |
| 53 | hybrid_graphics_init(); |
Vladimir Serbinenko | 609bd94 | 2016-01-31 14:00:54 +0100 | [diff] [blame] | 54 | } |