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-only */
2 
3 #include <baseboard/variants.h>
4 #include <chip.h>
5 #include <soc/pci_devs.h>
7 #include <sar.h>
9 
11 {
13  struct device *emmc_host;
14  struct device *ssd_host;
15  config_t *cfg = config_of_soc();
18 
19  /* SKU ID 1/3/23/24 doesn't have a eMMC device, hence disable it. */
21  if (sku_id == 1 || sku_id == 3 || sku_id == 23 || sku_id == 24) {
22  if (emmc_host == NULL)
23  return;
24  emmc_host->enabled = 0;
25  cfg->ScsEmmcHs400Enabled = 0;
26  }
27  /* SKU ID 2/4/21/22 doesn't have a SSD device, hence disable it. */
28  if (sku_id == 2 || sku_id == 4 || sku_id == 21 || sku_id == 22) {
29  if (ssd_host == NULL)
30  return;
31  ssd_host->enabled = 0;
32  cfg->SataSalpSupport = 0;
33  cfg->SataPortsEnable[1] = 0;
34  cfg->SataPortsDevSlp[1] = 0;
35  cfg->satapwroptimize = 0;
36  }
37 }
38 
39 const char *get_wifi_sar_cbfs_filename(void)
40 {
42 
43  if (sku_id == 1 || sku_id == 2 || sku_id == 3 || sku_id == 4)
44  return "wifi_sar-kled.hex";
46 }
47 
48 const char *mainboard_vbt_filename(void)
49 {
51 
52  if (sku_id == 1 || sku_id == 2 || sku_id == 3 || sku_id == 4)
53  return "vbt-kled.bin";
54  else
55  return "vbt.bin";
56 }
uint32_t sku_id(void)
DEVTREE_CONST struct device * pcidev_path_on_root(pci_devfn_t devfn)
Definition: device_const.c:255
uint32_t google_chromeec_get_board_sku(void)
Definition: ec_skuid.c:6
const char * get_wifi_sar_cbfs_filename(void)
Definition: variant.c:5
const char * mainboard_vbt_filename(void)
Definition: variant.c:9
void variant_devtree_update(void)
Definition: variant.c:53
#define config_of_soc()
Definition: device.h:394
#define WIFI_SAR_CBFS_DEFAULT_FILENAME
Definition: sar.h:87
#define PCH_DEVFN_SATA
Definition: pci_devs.h:158
#define PCH_DEVFN_EMMC
Definition: pci_devs.h:148
#define NULL
Definition: stddef.h:19
unsigned int uint32_t
Definition: stdint.h:14
Definition: device.h:107
unsigned int enabled
Definition: device.h:122