Tim Wawrzynczak has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35076 )
Change subject: drivers/spi/acpi: Support power resource as parent in device tree ......................................................................
drivers/spi/acpi: Support power resource as parent in device tree
This allows supporting an independent power resource for SPI ACPI devices, so that the power resource configuration can be refactored out of individual drivers and coalesced into a separate one.
Change-Id: Ib1e52a0f31d430637c9d819e231f9c4af6c68672 Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/drivers/spi/acpi/acpi.c 1 file changed, 16 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/35076/1
diff --git a/src/drivers/spi/acpi/acpi.c b/src/drivers/spi/acpi/acpi.c index 5ae010f..07f1a4b 100644 --- a/src/drivers/spi/acpi/acpi.c +++ b/src/drivers/spi/acpi/acpi.c @@ -23,6 +23,7 @@ #include <stdint.h> #include <string.h> #include "chip.h" +#include "drivers/generic/power_resource/chip.h"
static int spi_acpi_get_bus(const struct device *dev) { @@ -73,8 +74,19 @@
static void spi_acpi_fill_ssdt_generator(struct device *dev) { + const int parent_is_power_resource = + CONFIG(DRIVERS_GENERIC_POWER_RESOURCE) && + (dev->bus && dev->bus->children == dev && + dev->bus->dev->chip_ops == &drivers_generic_power_resource_ops); + /* + * Because the power resource is a "pseudo-device", we don't want it + * to be included in the ACPI path + */ + const char *pr_scope = parent_is_power_resource ? + acpi_device_scope(dev->bus->dev) : + NULL; struct drivers_spi_acpi_config *config = dev->chip_info; - const char *scope = acpi_device_scope(dev); + const char *scope = (pr_scope == NULL) ? acpi_device_scope(dev) : pr_scope; const char *path = acpi_device_path(dev); struct acpi_spi spi = { .device_select = dev->path.spi.cs, @@ -184,6 +196,9 @@ acpi_device_path(dev));
acpi_add_device_power_resource("PRIC"); + } else if (parent_is_power_resource) { + /* Parent device is a power resource, so set up _PR0/_PR3 */ + acpi_add_device_power_resource(acpi_device_path(dev->bus->dev)); }
acpigen_pop_len(); /* Device */
Hello Aaron Durbin, Patrick Rudolph, Julius Werner, Subrata Banik, Duncan Laurie, Paul Menzel, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35076
to look at the new patch set (#2).
Change subject: drivers/spi/acpi: Support power resource as parent in device tree ......................................................................
drivers/spi/acpi: Support power resource as parent in device tree
This allows supporting an independent power resource for SPI ACPI devices, so that the power resource configuration can be refactored out of individual drivers and coalesced into a separate one.
device pci 00.0 on chip drivers/spi/acpi register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPIO0)" register "reset_enable_delay_ms" = "100" ... device spi 1 on end end
chip drivers/spi/acpi register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPIO0)" register "reset_enable_delay_ms" = "2" ... device spi 2 on end end end
You can then write:
device pci 00.0 on chip drivers/generic/power_resource register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPIO0)" register "reset_enable_delay_ms" = "100" device generic 0 on chip drivers/spi/acpi register ... device spi 1 on end end chip drivers/spi/acpi register ... device spi 2 on end end end end end
Change-Id: Ib1e52a0f31d430637c9d819e231f9c4af6c68672 Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/drivers/spi/acpi/acpi.c 1 file changed, 16 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/35076/2
Hello Aaron Durbin, Patrick Rudolph, Julius Werner, Subrata Banik, Duncan Laurie, Paul Menzel, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35076
to look at the new patch set (#5).
Change subject: drivers/spi/acpi: Support power resource as parent in device tree ......................................................................
drivers/spi/acpi: Support power resource as parent in device tree
This allows supporting an independent power resource for SPI ACPI devices, so that the power resource configuration can be refactored out of individual drivers and coalesced into a separate one.
device pci 00.0 on chip drivers/spi/acpi register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPIO0)" register "reset_enable_delay_ms" = "100" ... device spi 1 on end end
chip drivers/spi/acpi register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPIO0)" register "reset_enable_delay_ms" = "2" ... device spi 2 on end end end
You can then write:
device pci 00.0 on chip drivers/generic/power_resource register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPIO0)" register "reset_enable_delay_ms" = "100" device generic 0 on chip drivers/spi/acpi register ... device spi 1 on end end chip drivers/spi/acpi register ... device spi 2 on end end end end end
Change-Id: Ib1e52a0f31d430637c9d819e231f9c4af6c68672 Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/drivers/spi/acpi/acpi.c 1 file changed, 20 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/35076/5
Tim Wawrzynczak has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/35076 )
Change subject: drivers/spi/acpi: Support power resource as parent in device tree ......................................................................
Abandoned
needs more thought