Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/59705 )
Change subject: mainboard/starlabs/labtop: Hook up Thunderbolt to CMOS ......................................................................
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 --- M src/mainboard/starlabs/labtop/cmos.default M src/mainboard/starlabs/labtop/cmos.layout M src/mainboard/starlabs/labtop/variants/tgl/devtree.c M src/mainboard/starlabs/labtop/variants/tgl/romstage.c 4 files changed, 22 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Andy Pont: Looks good to me, but someone else must approve
diff --git a/src/mainboard/starlabs/labtop/cmos.default b/src/mainboard/starlabs/labtop/cmos.default index b4b2d26..589189f 100644 --- a/src/mainboard/starlabs/labtop/cmos.default +++ b/src/mainboard/starlabs/labtop/cmos.default @@ -14,6 +14,7 @@ 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 2601e98..85ec477 100644 --- a/src/mainboard/starlabs/labtop/cmos.layout +++ b/src/mainboard/starlabs/labtop/cmos.layout @@ -30,6 +30,7 @@ 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 034877c..42a5aff 100644 --- a/src/mainboard/starlabs/labtop/variants/tgl/devtree.c +++ b/src/mainboard/starlabs/labtop/variants/tgl/devtree.c @@ -19,6 +19,9 @@ &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 @@ /* 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 dae2142..1d65c61 100644 --- a/src/mainboard/starlabs/labtop/variants/tgl/romstage.c +++ b/src/mainboard/starlabs/labtop/variants/tgl/romstage.c @@ -33,4 +33,12 @@ 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; + } };