diff options
author | Matt DeVillier <matt.devillier@amd.corp-partner.google.com> | 2023-01-11 17:59:08 -0600 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2023-01-15 02:02:01 +0000 |
commit | ce7b252c4f6c2d44c98a033b13caa48c6cbd2b33 (patch) | |
tree | 5c69539dc2b626e511bf51e905a9b1ba108c567d /src/drivers/spi | |
parent | 4902e9b35f1b62c2c28e582e33ad55d2543f1483 (diff) | |
download | coreboot-ce7b252c4f6c2d44c98a033b13caa48c6cbd2b33.tar.gz coreboot-ce7b252c4f6c2d44c98a033b13caa48c6cbd2b33.tar.bz2 coreboot-ce7b252c4f6c2d44c98a033b13caa48c6cbd2b33.zip |
drivers/spi/acpi: 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.
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.
This mirrors the change made for drivers/i2c/generic.
TEST=untested, as no boards selected this option.
Change-Id: I4f95d0e453d89b7e1978d3efac304518304495d1
Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71850
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/spi')
-rw-r--r-- | src/drivers/spi/acpi/acpi.c | 4 | ||||
-rw-r--r-- | src/drivers/spi/acpi/chip.h | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/drivers/spi/acpi/acpi.c b/src/drivers/spi/acpi/acpi.c index abebd8809532..9b6fd80023f2 100644 --- a/src/drivers/spi/acpi/acpi.c +++ b/src/drivers/spi/acpi/acpi.c @@ -32,10 +32,10 @@ static bool spi_acpi_add_gpios_to_crs(struct drivers_spi_acpi_config *config) { /* * 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 (config->disable_gpio_export_in_crs || + if (config->has_power_resource || ((config->reset_gpio.pin_count == 0) && (config->enable_gpio.pin_count == 0))) return false; diff --git a/src/drivers/spi/acpi/chip.h b/src/drivers/spi/acpi/chip.h index 9849f177f87e..9bee847f2bef 100644 --- a/src/drivers/spi/acpi/chip.h +++ b/src/drivers/spi/acpi/chip.h @@ -19,9 +19,6 @@ struct drivers_spi_acpi_config { /* Use GPIO based interrupt instead of PIRQ */ struct acpi_gpio irq_gpio; - /* 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; |