diff options
author | Raul E Rangel <rrangel@chromium.org> | 2021-12-14 12:55:36 -0700 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-11-05 02:09:34 +0000 |
commit | ae129fc6d6fa714d5a2149f99316900148670249 (patch) | |
tree | fa46252f89bf11657fad072297015212f6f252b9 /src/drivers | |
parent | b02a5014ea52774a74f3cc9b455fbccea954b018 (diff) |
drivers/i2c/generic: Print error when using _CRS and PowerResource
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. I'm making this an error because we should really clean these up.
BUG=b:210694108
TEST=Boot guybrush and see error:
> I2C: 02:5d: ERROR: Exposing GPIOs in Power Resource and _CRS
> \_SB.I2C1.H05D: Goodix Touchscreen at I2C: 02:5d
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Ifcc42ed81fff295fb168a0b343e96b3a650b1c84
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60174
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/i2c/generic/generic.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c index 981c2d9532..15fe7adebb 100644 --- a/src/drivers/i2c/generic/generic.c +++ b/src/drivers/i2c/generic/generic.c @@ -77,6 +77,16 @@ 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)); |