Duncan Laurie submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Duncan Laurie: Looks good to me, approved
mb/google/volteer: disable TBT if no USB4 hardware available

Implement mainboard_silicon_init_params() to allow for disabling of
TBT root ports if the device does not have usb4 hardware.

Add code to mainboard_memory_init_params() to disable memory-related
settings associated with TBT in cases where no usb4 is available.

BUG=b:167983038
TEST=none

Change-Id: Iab23c07e15f754ca807f128b9edad7fdc9a44b9d
Signed-off-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45946
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
---
M src/mainboard/google/volteer/mainboard.c
M src/mainboard/google/volteer/romstage.c
2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/mainboard/google/volteer/mainboard.c b/src/mainboard/google/volteer/mainboard.c
index 23c3e92..1fcd5eb 100644
--- a/src/mainboard/google/volteer/mainboard.c
+++ b/src/mainboard/google/volteer/mainboard.c
@@ -78,6 +78,21 @@
override_pads, override_num);
}

+void mainboard_silicon_init_params(FSP_S_CONFIG *params)
+{
+ bool has_usb4;
+
+ /* If device doesn't have USB4 hardware, disable tbt */
+ has_usb4 = (fw_config_probe(FW_CONFIG(DB_USB, USB4_GEN2)) ||
+ fw_config_probe(FW_CONFIG(DB_USB, USB4_GEN3)));
+
+ if (!has_usb4)
+ memset(params->ITbtPcieRootPortEn,
+ 0,
+ ARRAY_SIZE(params->ITbtPcieRootPortEn) *
+ sizeof(*params->ITbtPcieRootPortEn));
+}
+
struct chip_operations mainboard_ops = {
.init = mainboard_chip_init,
.enable_dev = mainboard_enable,
diff --git a/src/mainboard/google/volteer/romstage.c b/src/mainboard/google/volteer/romstage.c
index 720ab7f..315ec20 100644
--- a/src/mainboard/google/volteer/romstage.c
+++ b/src/mainboard/google/volteer/romstage.c
@@ -27,4 +27,12 @@
mem_cfg->PchHdaEnable = 0;

meminit_ddr(mem_cfg, board_cfg, &spd_info, half_populated);
+
+ /* Disable TBT if no USB4 hardware */
+ if (!(fw_config_probe(FW_CONFIG(DB_USB, USB4_GEN2)) ||
+ fw_config_probe(FW_CONFIG(DB_USB, USB4_GEN3)))) {
+ mem_cfg->TcssDma0En = 0;
+ mem_cfg->TcssItbtPcie0En = 0;
+ mem_cfg->TcssItbtPcie1En = 0;
+ }
}

To view, visit change 45946. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iab23c07e15f754ca807f128b9edad7fdc9a44b9d
Gerrit-Change-Number: 45946
Gerrit-PatchSet: 11
Gerrit-Owner: Nick Vaccaro <nvaccaro@google.com>
Gerrit-Reviewer: Derek Huang <derek.huang@intel.corp-partner.google.com>
Gerrit-Reviewer: Duncan Laurie <dlaurie@chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan@google.com>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: merged