Angel Pons | d28443e | 2020-04-05 13:22:44 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 2 | |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 3 | #include <stdint.h> |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 4 | #include <string.h> |
Angel Pons | 77ef99b | 2021-02-11 14:25:44 +0100 | [diff] [blame] | 5 | #include <ec/google/chromeec/ec.h> |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 6 | #include <northbridge/intel/haswell/raminit.h> |
| 7 | #include <southbridge/intel/lynxpoint/pch.h> |
| 8 | #include <southbridge/intel/lynxpoint/lp_gpio.h> |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 9 | #include "../../onboard.h" |
| 10 | #include "../../variant.h" |
| 11 | |
Angel Pons | 90ae089 | 2021-03-12 17:00:52 +0100 | [diff] [blame] | 12 | unsigned int variant_get_spd_index(void) |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 13 | { |
| 14 | const int gpio_vector[] = {13, 9, 47, -1}; |
Angel Pons | 90ae089 | 2021-03-12 17:00:52 +0100 | [diff] [blame] | 15 | return get_gpios(gpio_vector); |
| 16 | } |
Angel Pons | 77ef99b | 2021-02-11 14:25:44 +0100 | [diff] [blame] | 17 | |
Angel Pons | 90ae089 | 2021-03-12 17:00:52 +0100 | [diff] [blame] | 18 | bool variant_is_dual_channel(const unsigned int spd_index) |
| 19 | { |
Karthikeyan Ramasubramanian | c80ff84 | 2018-09-17 16:19:34 -0600 | [diff] [blame] | 20 | uint32_t board_version = PEPPY_BOARD_VERSION_PROTO; |
Karthikeyan Ramasubramanian | c80ff84 | 2018-09-17 16:19:34 -0600 | [diff] [blame] | 21 | google_chromeec_get_board_version(&board_version); |
| 22 | switch (board_version) { |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 23 | case PEPPY_BOARD_VERSION_PROTO: |
| 24 | /* Index 0 is 2GB config with CH0 only. */ |
Angel Pons | 90ae089 | 2021-03-12 17:00:52 +0100 | [diff] [blame] | 25 | return spd_index != 0; |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 26 | |
| 27 | case PEPPY_BOARD_VERSION_EVT: |
| 28 | default: |
Matt DeVillier | f41eea4 | 2019-12-26 20:10:32 -0600 | [diff] [blame] | 29 | /* Index 0-3 are 4GB config with both CH0 and CH1. |
Angel Pons | 90ae089 | 2021-03-12 17:00:52 +0100 | [diff] [blame] | 30 | Index 4-7 are 2GB config with CH0 only. */ |
| 31 | return spd_index <= 3; |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 32 | } |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 33 | } |
| 34 | |
Angel Pons | a3c6ed0 | 2021-02-11 13:59:12 +0100 | [diff] [blame] | 35 | const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = { |
| 36 | /* Length, Enable, OCn#, Location */ |
| 37 | { 0x0150, 1, USB_OC_PIN_SKIP, /* P0: LTE */ |
| 38 | USB_PORT_MINI_PCIE }, |
| 39 | { 0x0040, 1, 0, /* P1: Port A, CN10 */ |
| 40 | USB_PORT_BACK_PANEL }, |
| 41 | { 0x0080, 1, USB_OC_PIN_SKIP, /* P2: CCD */ |
| 42 | USB_PORT_INTERNAL }, |
| 43 | { 0x0040, 1, USB_OC_PIN_SKIP, /* P3: BT */ |
| 44 | USB_PORT_MINI_PCIE }, |
| 45 | { 0x0040, 1, 2, /* P4: Port B, CN6 */ |
| 46 | USB_PORT_BACK_PANEL }, |
| 47 | { 0x0000, 0, USB_OC_PIN_SKIP, /* P5: EMPTY */ |
| 48 | USB_PORT_SKIP }, |
| 49 | { 0x0150, 1, USB_OC_PIN_SKIP, /* P6: SD Card */ |
| 50 | USB_PORT_FLEX }, |
| 51 | { 0x0000, 0, USB_OC_PIN_SKIP, /* P7: EMPTY */ |
| 52 | USB_PORT_SKIP }, |
| 53 | }; |
Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [diff] [blame] | 54 | |
Angel Pons | a3c6ed0 | 2021-02-11 13:59:12 +0100 | [diff] [blame] | 55 | const struct usb3_port_setting mainboard_usb3_ports[MAX_USB3_PORTS] = { |
| 56 | /* Enable, OCn# */ |
| 57 | { 1, 0 }, /* P1; Port A, CN6 */ |
| 58 | { 0, USB_OC_PIN_SKIP }, /* P2; */ |
| 59 | { 0, USB_OC_PIN_SKIP }, /* P3; */ |
| 60 | { 0, USB_OC_PIN_SKIP }, /* P4; */ |
| 61 | }; |