coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.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 <device/device.h>
7 #include <variant/sku.h>
8 
9 static bool eps_sku(uint32_t sku_id)
10 {
11  /*
12  * Assume EPS SKU by default, helpful for testing on
13  * unprovisioned or development SKUs.
14  */
16  return false;
17  else
18  return true;
19 }
20 
22 {
23  struct device *eps_dev = DEV_PTR(eps);
24 
25  if (eps_sku(sku_id)) {
26  printk(BIOS_INFO, "SKU ID %u has EPS\n", sku_id);
27  return;
28  }
29 
30  if (!eps_dev) {
31  printk(BIOS_ERR, "Error! No EPS dev, view-angle-management won't work\n");
32  return;
33  }
34 
35  printk(BIOS_INFO, "SKU ID %u doesn't have EPS, disabling...\n", sku_id);
36  eps_dev->enabled = 0;
37 }
38 
40 {
42 
43  /* Disable EPS on SKUs that do not support it */
45 }
#define printk(level,...)
Definition: stdlib.h:16
uint32_t google_chromeec_get_board_sku(void)
Definition: ec_skuid.c:6
void __weak variant_devtree_update(void)
Definition: mainboard.c:86
static void check_for_eps(uint32_t sku_id)
Definition: mainboard.c:21
static bool eps_sku(uint32_t sku_id)
Definition: mainboard.c:9
uint32_t sku_id(void)
Definition: mainboard.c:11
@ JINLON_SKU_01
Definition: sku.h:11
@ JINLON_SKU_21
Definition: sku.h:13
#define DEV_PTR(_alias)
Definition: device.h:403
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition: loglevel.h:72
unsigned int uint32_t
Definition: stdint.h:14
Definition: device.h:107
unsigned int enabled
Definition: device.h:122