cbfs: Remove remnants of ext-win-*
[coreboot2.git] / src / mainboard / starlabs / lite / devtree.c
blob2e192e35480e663a6755abef026043e753c68bfd
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <cpu/intel/turbo.h>
4 #include <device/device.h>
5 #include <device/pci_def.h>
6 #include <option.h>
7 #include <static.h>
8 #include <types.h>
9 #include <variants.h>
11 #include "soc/intel/apollolake/chip.h"
13 enum cmos_power_profile get_power_profile(enum cmos_power_profile fallback)
15 const unsigned int power_profile = get_uint_option("power_profile", fallback);
16 return power_profile < NUM_POWER_PROFILES ? power_profile : fallback;
19 void devtree_update(void)
21 config_t *cfg = config_of_soc();
23 struct soc_power_limits_config *soc_conf =
24 &cfg->power_limits_config;
26 struct device *nic_dev = pcidev_on_root(0x0c, 0);
28 uint8_t performance_scale = 100;
30 /* Update PL1 & PL2 based on CMOS settings */
31 switch (get_power_profile(PP_POWER_SAVER)) {
32 case PP_POWER_SAVER:
33 performance_scale -= 25;
34 cfg->tcc_offset = 15;
35 break;
36 case PP_BALANCED:
37 /* Use the Intel defaults */
38 cfg->tcc_offset = 10;
39 break;
40 case PP_PERFORMANCE:
41 performance_scale += 25;
42 cfg->tcc_offset = 5;
43 break;
46 soc_conf->tdp_pl1_override = (soc_conf->tdp_pl1_override * performance_scale) / 100;
47 soc_conf->tdp_pl2_override = (soc_conf->tdp_pl2_override * performance_scale) / 100;
49 /* Set PL4 to 1.0C */
50 soc_conf->tdp_pl4 = 31;
52 /* Enable/Disable Wireless based on CMOS settings */
53 if (get_uint_option("wireless", 1) == 0)
54 nic_dev->enabled = 0;
56 /* Enable/Disable Webcam based on CMOS settings */
57 cfg->usb2_port[CONFIG_WEBCAM_USB_PORT].enable = get_uint_option("webcam", 1);