Brandon Breitenstein has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47684 )
Change subject: soc/tigerlake: Update early TCSS code to not call back and forth between mainboard and soc ......................................................................
soc/tigerlake: Update early TCSS code to not call back and forth between mainboard and soc
The original implementation of early tcss resulted in calling to mainboard then back to soc then back to mainboard to properly configure the muxes. This patch addresses that issue and instead just gets all the mux information from mainboard and does all config in the soc code. This also adds a new check for early display support which removes the requirement for the system to be a vboot compatible system before executing.
Change-Id: Idd50b0ffe1d56dffc3698e07c6e4bc4540d45e73 Signed-off-by: Brandon Breitenstein brandon.breitenstein@intel.com --- M src/soc/intel/tigerlake/early_tcss.c M src/soc/intel/tigerlake/fsp_params.c M src/soc/intel/tigerlake/include/soc/early_tcss.h 3 files changed, 36 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/47684/1
diff --git a/src/soc/intel/tigerlake/early_tcss.c b/src/soc/intel/tigerlake/early_tcss.c index 3944f61..8616bb1 100644 --- a/src/soc/intel/tigerlake/early_tcss.c +++ b/src/soc/intel/tigerlake/early_tcss.c @@ -3,6 +3,7 @@ #include <console/console.h> #include <device/pci.h> #include <intelblocks/pmc_ipc.h> +#include <security/vboot/vboot_common.h> #include <soc/early_tcss.h> #include <soc/pci_devs.h> #include <stdlib.h> @@ -240,7 +241,7 @@ return 0; }
-void update_tcss_mux(int port, struct tcss_mux mux_data) +static void update_tcss_mux(int port, struct tcss_mux mux_data) { struct pmc_ipc_buffer *rbuf = NULL; int ret = 0; @@ -265,7 +266,34 @@ printk(BIOS_ERR, "Port C%d mux set failed with error %d\n", port, ret); }
-__weak void mainboard_early_tcss_enable(void) +static int system_requires_early_display(void) +{ + if (!CONFIG(VBOOT)) + return 1; + else if (vboot_recovery_mode_enabled() || vboot_developer_mode_enabled()) + return 1; + else + return 0; +} + +void tcss_early_configure(void) +{ + + struct tcss_mux *mux_info = NULL; + unsigned int num_ports; + int i; + + if (!system_requires_early_display()) + return; + + mainboard_early_tcss_enable(mux_info, &num_ports); + + for (i = 0; i < num_ports; i++) + update_tcss_mux(i, mux_info[i]); + +} + +__weak void mainboard_early_tcss_enable(struct tcss_mux *mux_info, unsigned int *num_ports) { /* to be overwritten by each mainboard that needs early tcss */ } diff --git a/src/soc/intel/tigerlake/fsp_params.c b/src/soc/intel/tigerlake/fsp_params.c index 6de098a..2bec43e 100644 --- a/src/soc/intel/tigerlake/fsp_params.c +++ b/src/soc/intel/tigerlake/fsp_params.c @@ -387,9 +387,8 @@ /* TCSS specific initialization here */ printk(BIOS_DEBUG, "FSP MultiPhaseSiInit %s/%s called\n", __FILE__, __func__); - if (CONFIG(EARLY_TCSS_DISPLAY) && (vboot_recovery_mode_enabled() || - vboot_developer_mode_enabled())) - mainboard_early_tcss_enable(); + if (CONFIG(EARLY_TCSS_DISPLAY)) + tcss_early_configure(); break; default: break; diff --git a/src/soc/intel/tigerlake/include/soc/early_tcss.h b/src/soc/intel/tigerlake/include/soc/early_tcss.h index c009e84..cee4c12 100644 --- a/src/soc/intel/tigerlake/include/soc/early_tcss.h +++ b/src/soc/intel/tigerlake/include/soc/early_tcss.h @@ -126,7 +126,9 @@ uint8_t usb2_port; /* USB3 Port Number */ };
-void update_tcss_mux(int port, struct tcss_mux mux_data); +//void update_tcss_mux(int port, struct tcss_mux mux_data); + +void tcss_early_configure(void);
/* * Weak mainboard method to setup any mux configuration needed for early TCSS operations. @@ -136,4 +138,4 @@ * must be overridden by the mainboard with its specific mux data stored in a struct tcss_mux * struct as defined above. */ -void mainboard_early_tcss_enable(void); +void mainboard_early_tcss_enable(struct tcss_mux *mux_info, unsigned int *num_ports);