summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/google/octopus/mainboard.c15
-rw-r--r--src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h11
-rw-r--r--src/mainboard/google/octopus/variants/casta/variant.c11
3 files changed, 37 insertions, 0 deletions
diff --git a/src/mainboard/google/octopus/mainboard.c b/src/mainboard/google/octopus/mainboard.c
index 91cf1e4b70..3312d4d988 100644
--- a/src/mainboard/google/octopus/mainboard.c
+++ b/src/mainboard/google/octopus/mainboard.c
@@ -16,12 +16,14 @@
#include <arch/acpi.h>
#include <baseboard/variants.h>
#include <boardid.h>
+#include <bootstate.h>
#include <console/console.h>
#include <device/device.h>
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <ec/google/chromeec/ec.h>
#include <ec/ec.h>
+#include <intelblocks/xhci.h>
#include <nhlt.h>
#include <smbios.h>
#include <soc/cpu.h>
@@ -199,3 +201,16 @@ const char *smbios_mainboard_manufacturer(void)
return manuf;
}
+
+bool __weak variant_ext_usb_status(unsigned int port_type, unsigned int port_id)
+{
+ /* All externally visible USB ports are present */
+ return true;
+}
+
+static void disable_unused_devices(void *unused)
+{
+ usb_xhci_disable_unused(variant_ext_usb_status);
+}
+
+BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_EXIT, disable_unused_devices, NULL);
diff --git a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h
index 140beb4649..2132db591d 100644
--- a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h
@@ -47,6 +47,17 @@ void variant_nhlt_init(struct nhlt *nhlt);
/* Modify devictree settings during ramstage. */
struct device;
void variant_update_devtree(struct device *dev);
+/**
+ * variant_ext_usb_status() - Get status of externally visible USB ports
+ * @port_type: Type of USB port i.e. USB2/USB3
+ * @port_id: USB Port ID
+ *
+ * This function is supplied by the mainboard/variant to SoC's XHCI driver to
+ * identify the status of externally visible USB ports.
+ *
+ * Return: true if the port is present, false if the port is absent.
+ */
+bool variant_ext_usb_status(unsigned int port_type, unsigned int port_id);
/* Get no touchscreen SKU ID. */
bool no_touchscreen_sku(uint32_t sku_id);
diff --git a/src/mainboard/google/octopus/variants/casta/variant.c b/src/mainboard/google/octopus/variants/casta/variant.c
index 89b1033886..12c8dd747b 100644
--- a/src/mainboard/google/octopus/variants/casta/variant.c
+++ b/src/mainboard/google/octopus/variants/casta/variant.c
@@ -16,6 +16,8 @@
#include <baseboard/variants.h>
#include <sar.h>
+#define RIGHT_USB_C_PORT_ID 4
+
const char *get_wifi_sar_cbfs_filename(void)
{
const char *filename = NULL;
@@ -26,3 +28,12 @@ const char *get_wifi_sar_cbfs_filename(void)
return filename;
}
+
+bool variant_ext_usb_status(unsigned int port_type, unsigned int port_id)
+{
+ uint32_t sku_id = get_board_sku();
+
+ if (sku_id == 2 && port_id == RIGHT_USB_C_PORT_ID)
+ return false;
+ return true;
+}