From 02592ec2912e064f0cd0f6a5094382913f1f6b2f Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Thu, 6 Jun 2019 15:57:47 -0600 Subject: mb/google/octopus: Disable unused USB devices Disable unused USB devices in the device tree so that the concerned ACPI objects do not get exported to the OS. BUG=b:133513961 BRANCH=octopus TEST=Boot to ChromeOS. Ensure that the USB devices are disabled based on port status and the concerned ACPI objects are not exported. Change-Id: I0faccdfb8a9df9ec52130437433b15973e3d6f1a Signed-off-by: Karthikeyan Ramasubramanian Reviewed-on: https://review.coreboot.org/c/coreboot/+/34291 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/mainboard/google/octopus/mainboard.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mainboard/google/octopus/mainboard.c') 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 #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -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); -- cgit v1.2.3