diff options
author | Matt DeVillier <matt.devillier@amd.corp-partner.google.com> | 2023-01-11 17:41:37 -0600 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2023-01-15 02:01:48 +0000 |
commit | 4902e9b35f1b62c2c28e582e33ad55d2543f1483 (patch) | |
tree | ecf83ae2983dbf3318bbb2bf315eee6cc3ed903d /src/drivers | |
parent | 2e6c55946c4d4ff04e1bc8de7272a4cef63ed55d (diff) |
drivers/i2c/generic: Drop 'disable_gpio_export_in_crs' flag
Exposing the GPIOs via an ACPI PowerResource and the _CRS results in the
OS driver and ACPI thinking they own the GPIO. This can cause timing
problems because it's not clear which system should be controlling the
GPIO.
Previously, we flagged as an error any device which set the
'has_power_resource' flag but did not set 'disable_gpio_export_in_crs.'
There's no reason to require explicit disablement however, so drop the
superfluous 'disable' flag, and change the _CRS generation to check if
the GPIOs will be exported via the 'has_power_resource' flag instead.
BUG=b:265055477
TEST=build/boot skyrim, dump SSDT and verify touchscreen GPIOs only
listed under PRx, not under _CRS.
Change-Id: I837ae6c6fe4b8e1c4e10686406cba06bdb7759d2
Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71849
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/i2c/generic/chip.h | 3 | ||||
-rw-r--r-- | src/drivers/i2c/generic/generic.c | 14 |
2 files changed, 2 insertions, 15 deletions
diff --git a/src/drivers/i2c/generic/chip.h b/src/drivers/i2c/generic/chip.h index a99b09536e..0942d00fc1 100644 --- a/src/drivers/i2c/generic/chip.h +++ b/src/drivers/i2c/generic/chip.h @@ -46,9 +46,6 @@ struct drivers_i2c_generic_config { unsigned int device_present_gpio; unsigned int device_present_gpio_invert; - /* Disable reset and enable GPIO export in _CRS */ - bool disable_gpio_export_in_crs; - /* Does the device have a power resource? */ bool has_power_resource; diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c index 15fe7adebb..d1baeb76f4 100644 --- a/src/drivers/i2c/generic/generic.c +++ b/src/drivers/i2c/generic/generic.c @@ -17,10 +17,10 @@ static bool i2c_generic_add_gpios_to_crs(struct drivers_i2c_generic_config *cfg) { /* * Return false if: - * 1. Request to explicitly disable export of GPIOs in CRS, or + * 1. GPIOs are exported via a power resource, or * 2. Both reset and enable GPIOs are not provided. */ - if (cfg->disable_gpio_export_in_crs || + if (cfg->has_power_resource || ((cfg->reset_gpio.pin_count == 0) && (cfg->enable_gpio.pin_count == 0))) return false; @@ -77,16 +77,6 @@ void i2c_generic_fill_ssdt(const struct device *dev, } } - if (config->has_power_resource && !config->disable_gpio_export_in_crs) { - /* - * This case will most likely cause timing problems. The OS driver might be - * controlling the GPIOs, but the ACPI Power Resource will also be controlling - * them. This will result in the two fighting and stomping on each other. - */ - printk(BIOS_ERR, "%s: Exposing GPIOs in Power Resource and _CRS\n", - dev_path(dev)); - } - /* Device */ acpigen_write_scope(scope); acpigen_write_device(acpi_device_name(dev)); |