From 5cb34e2ea0034f3d3781006234a0c8b66f4efcfe Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Mon, 4 May 2020 16:41:22 -0600 Subject: device/pci_device: Extract pci_domain_set_resources from SOC pci_domain_set_resources is duplicated in all the SOCs. This change promotes the duplicated function. Picasso was adding it again in the northbridge patch. I decided to promote the function instead of duplicating it. BUG=b:147042464 TEST=Build and boot trembyle. Signed-off-by: Raul E Rangel Change-Id: Iba9661ac2c3a1803783d5aa32404143c9144aea5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/41041 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/soc/amd/picasso/chip.c | 2 +- src/soc/intel/apollolake/chip.c | 5 ----- src/soc/intel/baytrail/chip.c | 5 ----- src/soc/intel/braswell/chip.c | 6 ------ src/soc/intel/broadwell/chip.c | 5 ----- src/soc/intel/cannonlake/chip.c | 5 ----- src/soc/intel/denverton_ns/chip.c | 5 ----- src/soc/intel/icelake/chip.c | 5 ----- src/soc/intel/jasperlake/chip.c | 5 ----- src/soc/intel/quark/chip.c | 5 ----- src/soc/intel/skylake/chip.c | 5 ----- src/soc/intel/tigerlake/chip.c | 5 ----- src/soc/intel/xeon_sp/cpx/chip.c | 5 ----- 13 files changed, 1 insertion(+), 62 deletions(-) (limited to 'src/soc') diff --git a/src/soc/amd/picasso/chip.c b/src/soc/amd/picasso/chip.c index 2e0ba7eaf3..05106f569b 100644 --- a/src/soc/amd/picasso/chip.c +++ b/src/soc/amd/picasso/chip.c @@ -78,7 +78,7 @@ const char *soc_acpi_name(const struct device *dev) struct device_operations pci_domain_ops = { .read_resources = pci_domain_read_resources, - .set_resources = domain_set_resources, + .set_resources = pci_domain_set_resources, .scan_bus = pci_domain_scan_bus, .acpi_name = soc_acpi_name, }; diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c index 778132e7ad..058222ce39 100644 --- a/src/soc/intel/apollolake/chip.c +++ b/src/soc/intel/apollolake/chip.c @@ -197,11 +197,6 @@ const char *soc_acpi_name(const struct device *dev) return NULL; } -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - static struct device_operations pci_domain_ops = { .read_resources = pci_domain_read_resources, .set_resources = pci_domain_set_resources, diff --git a/src/soc/intel/baytrail/chip.c b/src/soc/intel/baytrail/chip.c index 7bb294b935..b7e3250a84 100644 --- a/src/soc/intel/baytrail/chip.c +++ b/src/soc/intel/baytrail/chip.c @@ -8,11 +8,6 @@ #include #include "chip.h" -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - static struct device_operations pci_domain_ops = { .read_resources = pci_domain_read_resources, .set_resources = pci_domain_set_resources, diff --git a/src/soc/intel/braswell/chip.c b/src/soc/intel/braswell/chip.c index 727982677f..c81d307f52 100644 --- a/src/soc/intel/braswell/chip.c +++ b/src/soc/intel/braswell/chip.c @@ -10,12 +10,6 @@ #include "chip.h" -static void pci_domain_set_resources(struct device *dev) -{ - printk(BIOS_SPEW, "%s/%s (%s)\n", __FILE__, __func__, dev_name(dev)); - assign_resources(dev->link_list); -} - static struct device_operations pci_domain_ops = { .read_resources = pci_domain_read_resources, .set_resources = pci_domain_set_resources, diff --git a/src/soc/intel/broadwell/chip.c b/src/soc/intel/broadwell/chip.c index 740e65ed20..16afcce60c 100644 --- a/src/soc/intel/broadwell/chip.c +++ b/src/soc/intel/broadwell/chip.c @@ -7,11 +7,6 @@ #include #include -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - static struct device_operations pci_domain_ops = { .read_resources = &pci_domain_read_resources, .set_resources = &pci_domain_set_resources, diff --git a/src/soc/intel/cannonlake/chip.c b/src/soc/intel/cannonlake/chip.c index a137762ad6..51678add67 100644 --- a/src/soc/intel/cannonlake/chip.c +++ b/src/soc/intel/cannonlake/chip.c @@ -168,11 +168,6 @@ void soc_init_pre_device(void *chip_info) soc_gpio_pm_configuration(); } -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - static struct device_operations pci_domain_ops = { .read_resources = &pci_domain_read_resources, .set_resources = &pci_domain_set_resources, diff --git a/src/soc/intel/denverton_ns/chip.c b/src/soc/intel/denverton_ns/chip.c index f24335cecf..3bade119e6 100644 --- a/src/soc/intel/denverton_ns/chip.c +++ b/src/soc/intel/denverton_ns/chip.c @@ -17,11 +17,6 @@ #include #include -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - static struct device_operations pci_domain_ops = { .read_resources = &pci_domain_read_resources, .set_resources = &pci_domain_set_resources, diff --git a/src/soc/intel/icelake/chip.c b/src/soc/intel/icelake/chip.c index 176a8e4ea2..a455bfce71 100644 --- a/src/soc/intel/icelake/chip.c +++ b/src/soc/intel/icelake/chip.c @@ -124,11 +124,6 @@ void soc_init_pre_device(void *chip_info) soc_fill_gpio_pm_configuration(); } -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - static struct device_operations pci_domain_ops = { .read_resources = &pci_domain_read_resources, .set_resources = &pci_domain_set_resources, diff --git a/src/soc/intel/jasperlake/chip.c b/src/soc/intel/jasperlake/chip.c index 95585d2b9b..6f4ee005c7 100644 --- a/src/soc/intel/jasperlake/chip.c +++ b/src/soc/intel/jasperlake/chip.c @@ -133,11 +133,6 @@ void soc_init_pre_device(void *chip_info) soc_fill_gpio_pm_configuration(); } -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - static struct device_operations pci_domain_ops = { .read_resources = &pci_domain_read_resources, .set_resources = &pci_domain_set_resources, diff --git a/src/soc/intel/quark/chip.c b/src/soc/intel/quark/chip.c index 0852a1a58e..33033a98b6 100644 --- a/src/soc/intel/quark/chip.c +++ b/src/soc/intel/quark/chip.c @@ -106,11 +106,6 @@ static void chip_init(void *chip_info) fsp_silicon_init(romstage_handoff_is_resume()); } -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - static struct device_operations pci_domain_ops = { .read_resources = pci_domain_read_resources, .set_resources = pci_domain_set_resources, diff --git a/src/soc/intel/skylake/chip.c b/src/soc/intel/skylake/chip.c index 4f799763c1..4ad691cb2e 100644 --- a/src/soc/intel/skylake/chip.c +++ b/src/soc/intel/skylake/chip.c @@ -78,11 +78,6 @@ void soc_fsp_load(void) fsps_load(romstage_handoff_is_resume()); } -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - static struct device_operations pci_domain_ops = { .read_resources = &pci_domain_read_resources, .set_resources = &pci_domain_set_resources, diff --git a/src/soc/intel/tigerlake/chip.c b/src/soc/intel/tigerlake/chip.c index 68b5f8996f..c1764cde93 100644 --- a/src/soc/intel/tigerlake/chip.c +++ b/src/soc/intel/tigerlake/chip.c @@ -132,11 +132,6 @@ void soc_init_pre_device(void *chip_info) soc_fill_gpio_pm_configuration(); } -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - static struct device_operations pci_domain_ops = { .read_resources = &pci_domain_read_resources, .set_resources = &pci_domain_set_resources, diff --git a/src/soc/intel/xeon_sp/cpx/chip.c b/src/soc/intel/xeon_sp/cpx/chip.c index d986471889..2125f0a891 100644 --- a/src/soc/intel/xeon_sp/cpx/chip.c +++ b/src/soc/intel/xeon_sp/cpx/chip.c @@ -14,11 +14,6 @@ /* C620 IOAPIC has 120 redirection entries */ #define C620_IOAPIC_REDIR_ENTRIES 120 -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - void platform_fsp_silicon_init_params_cb(FSPS_UPD *silupd) { /* not implemented yet */ -- cgit v1.2.3