diff options
author | Sean Rhodes <sean@starlabs.systems> | 2021-10-22 14:33:27 +0100 |
---|---|---|
committer | Martin L Roth <gaumless@tutanota.com> | 2022-05-28 14:19:31 +0000 |
commit | ab5b7b3eadcf386a1c08d9dcd1e9b85b0cb7a7d1 (patch) | |
tree | 6ea8472c7b056aabce50e27c855a30cac78f7844 /src/mainboard/starlabs/labtop/variants/kbl/devtree.c | |
parent | 0b3789f3762356431d6567ba51a44c2a927bdce9 (diff) |
mb/starlabs/labtop: Add LabTop Mk III
Tested using MrChromeBox's `uefipayload_202107` branch:
* Windows 10
* Ubuntu 20.04
* MX Linux 19.4
* Manjaro 21
No known issues.
https://starlabs.systems/pages/labtop-mk-iii-specification
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: Ia52566e06f50c0abcfb657044538db8e92564c36
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58538
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Ben McMillen <ben@starlabs.systems>
Diffstat (limited to 'src/mainboard/starlabs/labtop/variants/kbl/devtree.c')
-rw-r--r-- | src/mainboard/starlabs/labtop/variants/kbl/devtree.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/mainboard/starlabs/labtop/variants/kbl/devtree.c b/src/mainboard/starlabs/labtop/variants/kbl/devtree.c new file mode 100644 index 0000000000..566b0328e7 --- /dev/null +++ b/src/mainboard/starlabs/labtop/variants/kbl/devtree.c @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <chip.h> +#include <cpu/intel/turbo.h> +#include <device/device.h> +#include <device/pci_def.h> +#include <option.h> +#include <types.h> +#include <variants.h> + +void devtree_update(void) +{ + config_t *cfg = config_of_soc(); + + struct soc_power_limits_config *soc_conf = &cfg->power_limits_config; + + struct device *nic_dev = pcidev_on_root(0x1c, 5); + + /* Update PL1 & PL2 based on CMOS settings */ + switch (get_uint_option("power_profile", 0)) { + case 1: + soc_conf->tdp_pl1_override = 17; + soc_conf->tdp_pl2_override = 20; + break; + case 2: + soc_conf->tdp_pl1_override = 20; + soc_conf->tdp_pl2_override = 25; + break; + default: + disable_turbo(); + soc_conf->tdp_pl1_override = 15; + soc_conf->tdp_pl2_override = 15; + break; + } + + /* Enable/Disable Wireless based on CMOS settings */ + if (get_uint_option("wireless", 1) == 0) + nic_dev->enabled = 0; + + /* Enable/Disable Webcam based on CMOS settings */ + if (get_uint_option("webcam", 1) == 0) + cfg->usb2_ports[3].enable = 0; +} |