From e96ade6981c60af4d6f24471d7f6a440ab7bfd4e Mon Sep 17 00:00:00 2001 From: Sean Rhodes Date: Mon, 18 Oct 2021 21:07:20 +0100 Subject: mb/starlabs/labtop: Add LabTop Mk IV 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-iv-specification Signed-off-by: Sean Rhodes Change-Id: Idbaa907dc38dc521961806132f21b7a90324ec9c Reviewed-on: https://review.coreboot.org/c/coreboot/+/58428 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- .../starlabs/labtop/variants/cml/devtree.c | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/mainboard/starlabs/labtop/variants/cml/devtree.c (limited to 'src/mainboard/starlabs/labtop/variants/cml/devtree.c') diff --git a/src/mainboard/starlabs/labtop/variants/cml/devtree.c b/src/mainboard/starlabs/labtop/variants/cml/devtree.c new file mode 100644 index 0000000000..cf0734e4ce --- /dev/null +++ b/src/mainboard/starlabs/labtop/variants/cml/devtree.c @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include +#include +#include +#include + +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(0x14, 3); + + /* 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; +} -- cgit v1.2.3