summaryrefslogtreecommitdiff
path: root/src/mainboard/starlabs
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2021-11-28 08:34:53 +0000
committerFelix Held <felix-coreboot@felixheld.de>2021-12-15 15:55:09 +0000
commit1b66bbaf8380f72faffb48e2bb4f977fb8b3e958 (patch)
tree6219a070e9b7841ce56cbb1c3950ebfa185fb6ab /src/mainboard/starlabs
parent5e59f169ec866443a90af363192324bd46fd5cbf (diff)
mainboard/starlabs/labtop: Hook up Thunderbolt to CMOS
Hook up Thunderbolt and related settings to CMOS value of `thunderbolt`. Changes TcssXhciEn, UsbTcPortEn and the relevant PCI devices. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ibadc7464831242ae51982610b410ccf0a6811edd Reviewed-on: https://review.coreboot.org/c/coreboot/+/59705 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Andy Pont <andy.pont@sdcsystems.com>
Diffstat (limited to 'src/mainboard/starlabs')
-rw-r--r--src/mainboard/starlabs/labtop/cmos.default1
-rw-r--r--src/mainboard/starlabs/labtop/cmos.layout1
-rw-r--r--src/mainboard/starlabs/labtop/variants/tgl/devtree.c12
-rw-r--r--src/mainboard/starlabs/labtop/variants/tgl/romstage.c8
4 files changed, 22 insertions, 0 deletions
diff --git a/src/mainboard/starlabs/labtop/cmos.default b/src/mainboard/starlabs/labtop/cmos.default
index b4b2d2600b..589189f9dd 100644
--- a/src/mainboard/starlabs/labtop/cmos.default
+++ b/src/mainboard/starlabs/labtop/cmos.default
@@ -14,6 +14,7 @@ webcam=Enable
microphone=Enable
legacy_8254_timer=Enable
usb_always_on=Disable
+thunderbolt=Disable
# EC
kbl_timeout=30 seconds
fn_ctrl_swap=Disable
diff --git a/src/mainboard/starlabs/labtop/cmos.layout b/src/mainboard/starlabs/labtop/cmos.layout
index 2601e9818a..85ec47772c 100644
--- a/src/mainboard/starlabs/labtop/cmos.layout
+++ b/src/mainboard/starlabs/labtop/cmos.layout
@@ -30,6 +30,7 @@ entries
520 1 e 1 microphone
528 1 e 1 legacy_8254_timer
536 1 e 1 usb_always_on
+544 1 e 1 thunderbolt
# coreboot config options: EC
600 3 e 4 kbl_timeout
diff --git a/src/mainboard/starlabs/labtop/variants/tgl/devtree.c b/src/mainboard/starlabs/labtop/variants/tgl/devtree.c
index 034877c66e..42a5aff366 100644
--- a/src/mainboard/starlabs/labtop/variants/tgl/devtree.c
+++ b/src/mainboard/starlabs/labtop/variants/tgl/devtree.c
@@ -19,6 +19,9 @@ void devtree_update(void)
&cfg->power_limits_config[POWER_LIMITS_U_4_CORE];
struct device *nic_dev = pcidev_on_root(0x14, 3);
+ struct device *tbt_pci_dev = pcidev_on_root(0x07, 0);
+ struct device *tbt_dma_dev = pcidev_on_root(0x0d, 2);
+
/* Update PL1 & PL2 based on CMOS settings */
switch (get_uint_option("power_profile", 0)) {
@@ -50,4 +53,13 @@ void devtree_update(void)
/* Enable/Disable Webcam based on CMOS settings */
if (get_uint_option("webcam", 1) == 0)
cfg->usb2_ports[3].enable = 0;
+
+ /* Enable/Disable Thunderbolt based on CMOS settings */
+ if (get_uint_option("thunderbolt", 1) == 0) {
+ cfg->UsbTcPortEn = 0;
+ cfg->TcssXhciEn = 0;
+ cfg->TcssD3ColdDisable = 0;
+ tbt_pci_dev->enabled = 0;
+ tbt_dma_dev->enabled = 0;
+ }
}
diff --git a/src/mainboard/starlabs/labtop/variants/tgl/romstage.c b/src/mainboard/starlabs/labtop/variants/tgl/romstage.c
index dae2142a91..1d65c61ba5 100644
--- a/src/mainboard/starlabs/labtop/variants/tgl/romstage.c
+++ b/src/mainboard/starlabs/labtop/variants/tgl/romstage.c
@@ -33,4 +33,12 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
const uint8_t ht = get_uint_option("hyper_threading",
mupd->FspmConfig.HyperThreading);
mupd->FspmConfig.HyperThreading = ht;
+
+ /* Enable/Disable Thunderbolt based on CMOS settings */
+ if (get_uint_option("thunderbolt", 1) == 0) {
+ mupd->FspmConfig.VtdItbtEnable = 0;
+ mupd->FspmConfig.VtdBaseAddress[3] = 0;
+ mupd->FspmConfig.TcssDma0En = 0;
+ mupd->FspmConfig.TcssItbtPcie0En = 0;
+ }
};