coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
romstage.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
6 #include "../../variant.h"
7 
8 unsigned int variant_get_spd_index(void)
9 {
10  const int gpio_vector[] = {13, 9, 47, -1};
11  return get_gpios(gpio_vector);
12 }
13 
14 bool variant_is_dual_channel(const unsigned int spd_index)
15 {
16  /* Index 0-2,6 are 4GB config with both CH0 and CH1
17  Index 3-5,7 are 2GB config with CH0 only */
18  switch (spd_index) {
19  case 0: case 1: case 2: case 6:
20  return true;
21  case 3: case 4: case 5: case 7:
22  default:
23  return false;
24  }
25 }
26 
28  /* Length, Enable, OCn#, Location */
29  { 0x0064, 1, 0, /* P0: Port A, CN8 */
31  { 0x0052, 1, 0, /* P1: Port B, CN9 */
33  { 0x0040, 1, USB_OC_PIN_SKIP, /* P2: CCD */
35  { 0x0040, 1, USB_OC_PIN_SKIP, /* P3: BT */
37  { 0x0040, 1, USB_OC_PIN_SKIP, /* P4: LTE */
39  { 0x0040, 1, USB_OC_PIN_SKIP, /* P5: TOUCH */
41  { 0x0040, 1, USB_OC_PIN_SKIP, /* P6: SD Card */
43  { 0x0123, 1, 3, /* P7: USB2 Port */
45 };
46 
48  /* Enable, OCn# */
49  { 1, 0 }, /* P1; Port A, CN8 */
50  { 1, 0 }, /* P2; Port B, CN9 */
51  { 0, USB_OC_PIN_SKIP }, /* P3; */
52  { 0, USB_OC_PIN_SKIP }, /* P4; */
53 };
const struct usb3_port_config mainboard_usb3_ports[MAX_USB3_PORTS]
Definition: romstage.c:45
const struct usb2_port_config mainboard_usb2_ports[MAX_USB2_PORTS]
Definition: romstage.c:27
static const int spd_index[32]
Definition: memory.c:10
bool variant_is_dual_channel(const unsigned int spd_index)
Definition: romstage.c:14
unsigned int variant_get_spd_index(void)
Definition: romstage.c:8
#define USB_OC_PIN_SKIP
Definition: pei_data.h:27
#define MAX_USB3_PORTS
Definition: pei_data.h:26
@ USB_PORT_BACK_PANEL
Definition: pei_data.h:30
@ USB_PORT_INTERNAL
Definition: pei_data.h:35
#define MAX_USB2_PORTS
Definition: pei_data.h:25
unsigned int get_gpios(const int *gpio_num_array)
Definition: gpio.c:107