coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
variant.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <baseboard/variants.h>
4 #include <console/console.h>
6 #include <fw_config.h>
7 #include <soc/bootblock.h>
8 
9 const char *mainboard_vbt_filename(void)
10 {
11  if (fw_config_probe(FW_CONFIG(DB_USB, DB_1A_HDMI)))
12  return "vbt-nereid_hdmi.bin";
13 
14  return "vbt.bin";
15 }
16 
18 {
19  /* TypeCPort2Config = "No Thunderbolt" */
20  struct descriptor_byte typec_bytes[] = {
21  { 0xc76, 0xb7 },
22  { 0xc77, 0xb6 },
23  { 0xc7c, 0xee },
24  { 0xca0, 0x0c },
25  };
26 
27  /* TypeCPort2Config = "DP Fixed Connection" */
28  struct descriptor_byte hdmi_bytes[] = {
29  { 0xc76, 0x75 },
30  { 0xc77, 0xc4 },
31  { 0xc7c, 0x1e },
32  { 0xca0, 0x0e },
33  };
34 
35  if (fw_config_probe(FW_CONFIG(DB_USB, DB_1A_HDMI))) {
36  printk(BIOS_INFO, "Configuring descriptor for HDMI\n");
37  configure_descriptor(hdmi_bytes, ARRAY_SIZE(hdmi_bytes));
38  } else {
39  printk(BIOS_INFO, "Configuring descriptor for Type-C\n");
40  configure_descriptor(typec_bytes, ARRAY_SIZE(typec_bytes));
41  }
42 }
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define printk(level,...)
Definition: stdlib.h:16
#define FW_CONFIG(__field, __option)
Definition: fw_config.h:28
void variant_update_descriptor(void)
Definition: variant.c:17
const char * mainboard_vbt_filename(void)
Definition: variant.c:9
bool fw_config_probe(const struct fw_config *match)
Definition: fw_config.c:62
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
void configure_descriptor(struct descriptor_byte *bytes, size_t num)