Lijian Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31905
Change subject: drivers/usb: Fix USB acpi gpio programming ......................................................................
drivers/usb: Fix USB acpi gpio programming
GPIO programming for transition between D0 and D3 state will require power resources to be present. Otherwise the previously defined "reset-gpio" can't take effect.
BUG=b:123342945 TEST=Boot up on Arcada platform and extract SSDT table, find the GPIOIO entry and set/clear and "_ON/_OFF" present under USB devices after reset-gpio entry added in devicetree.cb file.
Signed-off-by: Lijian Zhao lijian.zhao@intel.com Change-Id: If312150b5065e2e3fb362e9433cdeff47064a35a --- M src/drivers/usb/acpi/chip.h M src/drivers/usb/acpi/usb_acpi.c 2 files changed, 38 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/05/31905/1
diff --git a/src/drivers/usb/acpi/chip.h b/src/drivers/usb/acpi/chip.h index 512893d..51dec63 100644 --- a/src/drivers/usb/acpi/chip.h +++ b/src/drivers/usb/acpi/chip.h @@ -56,7 +56,29 @@ bool use_custom_pld; struct acpi_pld custom_pld;
+ /* Does the device have a power resource? */ + bool has_power_resource; + + /* GPIO used to take device out of reset or to put it into reset. */ struct acpi_gpio reset_gpio; + /* Delay to be inserted after device is taken out of reset. */ + unsigned int reset_delay_ms; + /* Delay to be inserted after device is put into reset. */ + unsigned int reset_off_delay_ms; + + /* GPIO used to enable device. */ + struct acpi_gpio enable_gpio; + /* Delay to be inserted after device is enabled. */ + unsigned int enable_delay_ms; + /* Delay to be inserted after device is disabled. */ + unsigned int enable_off_delay_ms; + + /* GPIO used to stop operation of device. */ + struct acpi_gpio stop_gpio; + /* Delay to be inserted after disabling stop. */ + unsigned int stop_delay_ms; + /* Delay to be inserted after enabling stop. */ + unsigned int stop_off_delay_ms; };
#endif /* __USB_ACPI_CHIP_H__ */ diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c index 8c63d2a..e77472c 100644 --- a/src/drivers/usb/acpi/usb_acpi.c +++ b/src/drivers/usb/acpi/usb_acpi.c @@ -76,6 +76,22 @@ acpi_dp_write(dsd); }
+ /* Power Resource */ + if (config->has_power_resource) { + const struct acpi_power_res_params power_res_params = { + &config->reset_gpio, + config->reset_delay_ms, + config->reset_off_delay_ms, + &config->enable_gpio, + config->enable_delay_ms, + config->enable_off_delay_ms, + &config->stop_gpio, + config->stop_delay_ms, + config->stop_off_delay_ms + }; + acpi_device_add_power_res(&power_res_params); + } + acpigen_pop_len();
printk(BIOS_INFO, "%s: %s at %s\n", path,