Hello Karthikeyan Ramasubramanian,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/34291
to review the following change.
Change subject: mb/google/octopus: Disable unused USB devices ......................................................................
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 kramasub@google.com --- M src/mainboard/google/octopus/mainboard.c M src/mainboard/google/octopus/variants/casta/Makefile.inc A src/mainboard/google/octopus/variants/casta/variant.c 3 files changed, 40 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/34291/1
diff --git a/src/mainboard/google/octopus/mainboard.c b/src/mainboard/google/octopus/mainboard.c index 91cf1e4..c902007 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,10 @@
return manuf; } + +static void disable_unused_devices(void *unused) +{ + usb_xhci_internal_device_disable(); +} + +BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_EXIT, disable_unused_devices, NULL); diff --git a/src/mainboard/google/octopus/variants/casta/Makefile.inc b/src/mainboard/google/octopus/variants/casta/Makefile.inc index 9fb63f5..ba865e9 100644 --- a/src/mainboard/google/octopus/variants/casta/Makefile.inc +++ b/src/mainboard/google/octopus/variants/casta/Makefile.inc @@ -1,3 +1,4 @@ bootblock-y += gpio.c
ramstage-y += gpio.c +ramstage-y += variant.c diff --git a/src/mainboard/google/octopus/variants/casta/variant.c b/src/mainboard/google/octopus/variants/casta/variant.c new file mode 100644 index 0000000..c7353c1 --- /dev/null +++ b/src/mainboard/google/octopus/variants/casta/variant.c @@ -0,0 +1,30 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2019 Google LLC + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <baseboard/variants.h> +#include <bootstate.h> +#include <intelblocks/xhci.h> + +#define RIGHT_USB_C_PORT_ID 4 + +static void disable_unused_devices(void *unused) +{ + uint32_t sku_id = get_board_sku(); + + if (sku_id == 2) + usb_xhci_external_device_disable(RIGHT_USB_C_PORT_ID); +} + +BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_EXIT, disable_unused_devices, NULL);