diff options
author | Deepti Deshatty <deepti.deshatty@intel.com> | 2021-05-20 21:01:52 +0530 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-06-04 12:36:07 +0000 |
commit | c146daf8a3241026c8c8906add2b5ae37cc76427 (patch) | |
tree | dea56397963aa97bc0db20d8339528ec353ae0ae /src/mainboard/google | |
parent | 7014efd8cfb1c496354cc991bbb9443e882d5d82 (diff) |
intel/common/block: Move mainboard api to tcss common block
As per the comments in CB:54090 mainboard api
mainboard_tcss_get_port_info() is simplified and moved to tcss common
block code.
Signed-off-by: Deepti Deshatty <deepti.deshatty@intel.com>
Change-Id: I7894363df4862f7cfe733d93e6160677fb8a9e31
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54733
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r-- | src/mainboard/google/volteer/mainboard.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/mainboard/google/volteer/mainboard.c b/src/mainboard/google/volteer/mainboard.c index 5e52b01a6a..74264451b6 100644 --- a/src/mainboard/google/volteer/mainboard.c +++ b/src/mainboard/google/volteer/mainboard.c @@ -142,63 +142,6 @@ void mainboard_update_soc_chip_config(struct soc_intel_tigerlake_config *cfg) } } -static bool is_correct_port(const struct device *dev, int port) -{ - return dev->path.type == DEVICE_PATH_GENERIC && dev->path.generic.id == port - && dev->chip_ops == &drivers_intel_pmc_mux_conn_ops; -} - -static const struct drivers_intel_pmc_mux_conn_config *get_connector_config( - const struct device *mux, - int port) -{ - const struct drivers_intel_pmc_mux_conn_config *config = NULL; - DEVTREE_CONST struct device *conn = NULL; - - while ((conn = dev_bus_each_child(mux->link_list, conn)) != NULL) { - if (is_correct_port(conn, port)) - break; - } - - if (conn) - config = (const struct drivers_intel_pmc_mux_conn_config *) conn->chip_info; - - return config; -} - -const struct tcss_port_map *mainboard_tcss_get_port_info(size_t *num_ports) -{ - static struct tcss_port_map port_map[MAX_TYPE_C_PORTS]; - size_t port; - const struct device *pmc; - const struct device *mux; - const struct drivers_intel_pmc_mux_conn_config *mux_config; - size_t active_ports = 0; - - pmc = pcidev_path_on_root(PCH_DEVFN_PMC); - if (!pmc || !pmc->link_list) { - printk(BIOS_ERR, "%s: unable to find PMC device or its mux\n", __func__); - return NULL; - } - - mux = pmc->link_list->children; - if (!mux) - return NULL; - - for (port = 0; port < MAX_TYPE_C_PORTS; port++) { - mux_config = get_connector_config(mux, port); - if (mux_config == NULL) - continue; - - port_map[active_ports].usb2_port = mux_config->usb2_port_number; - port_map[active_ports].usb3_port = mux_config->usb3_port_number; - active_ports++; - } - - *num_ports = active_ports; - return port_map; -} - static void mainboard_chip_init(void *chip_info) { const struct pad_config *base_pads; |