Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soc/intel/meteorlake: Set UsbTcPortEn based on tcss_port[x] (ported from alderlake) #230

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/mainboard/system76/mtl/variants/darp10/overridetree.cb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,26 @@ chip soc/intel/meteorlake
subsystemid 0x1558 0xa743 inherit

device ref tbt_pcie_rp0 on end
device ref tcss_xhci on end
device ref tcss_xhci on
register "tcss_ports[0]" = "TCSS_PORT_DEFAULT(OC_SKIP)"
register "tcss_ports[1]" = "TCSS_PORT_DEFAULT(OC_SKIP)"
# TCP2 is used as HDMI
# TCP3 is not used
chip drivers/usb/acpi
device ref tcss_root_hub on
chip drivers/usb/acpi
register "desc" = ""TBT Type-C""
register "type" = "UPC_TYPE_C_USB2_SS_SWITCH"
device ref tcss_usb3_port0 on end
end
chip drivers/usb/acpi
register "desc" = ""USB Type-C""
register "type" = "UPC_TYPE_C_USB2_SS_SWITCH"
device ref tcss_usb3_port1 on end
end
end
end
end
device ref tcss_dma0 on end
device ref xhci on
register "usb2_ports" = "{
Expand Down
7 changes: 7 additions & 0 deletions src/mainboard/system76/mtl/variants/darp10/ramstage.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

void mainboard_silicon_init_params(FSP_S_CONFIG *params)
{
// Enable TCP1 USB-A conversion
// BIT 0:3 is mapping to PCH XHCI USB2 port
// BIT 4:5 is reserved
// BIT 6 is orientational
// BIT 7 is enable
params->EnableTcssCovTypeA[1] = 0x82;

// XXX: Enabling C10 reporting causes system to constantly enter and
// exit opportunistic suspend when idle.
params->PchEspiHostC10ReportEnable = 0;
Expand Down
11 changes: 2 additions & 9 deletions src/soc/intel/meteorlake/fsp_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,6 @@ static void fill_fsps_igd_params(FSP_S_CONFIG *s_cfg,
static void fill_fsps_tcss_params(FSP_S_CONFIG *s_cfg,
const struct soc_intel_meteorlake_config *config)
{
const struct device *tcss_port_arr[] = {
DEV_PTR(tcss_usb3_port0),
DEV_PTR(tcss_usb3_port1),
DEV_PTR(tcss_usb3_port2),
DEV_PTR(tcss_usb3_port3),
};

s_cfg->TcssAuxOri = config->tcss_aux_ori;

/* Explicitly clear this field to avoid using defaults */
Expand All @@ -438,8 +431,8 @@ static void fill_fsps_tcss_params(FSP_S_CONFIG *s_cfg,
s_cfg->D3ColdEnable = CONFIG(D3COLD_SUPPORT);
s_cfg->UsbTcPortEn = 0;

for (int i = 0; i < MAX_TYPE_C_PORTS; i++) {
if (is_dev_enabled(tcss_port_arr[i]))
for (int i = 0; i < ARRAY_SIZE(config->tcss_ports); i++) {
if (config->tcss_ports[i].enable)
s_cfg->UsbTcPortEn |= BIT(i);
}

Expand Down