diff options
author | Raul E Rangel <rrangel@chromium.org> | 2020-05-04 16:41:22 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-05-12 20:07:25 +0000 |
commit | 5cb34e2ea0034f3d3781006234a0c8b66f4efcfe (patch) | |
tree | 6a06c0cef8e1d2a4367eec3bcf6451f8e10609db | |
parent | 194695fd953a2a8bd10eedc9aa7811c338988d3d (diff) | |
download | coreboot-5cb34e2ea0034f3d3781006234a0c8b66f4efcfe.tar.xz |
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 <rrangel@chromium.org>
Change-Id: Iba9661ac2c3a1803783d5aa32404143c9144aea5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41041
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r-- | src/device/pci_device.c | 5 | ||||
-rw-r--r-- | src/include/device/device.h | 1 | ||||
-rw-r--r-- | src/northbridge/intel/haswell/northbridge.c | 5 | ||||
-rw-r--r-- | src/northbridge/intel/ironlake/northbridge.c | 5 | ||||
-rw-r--r-- | src/northbridge/intel/sandybridge/northbridge.c | 4 | ||||
-rw-r--r-- | src/soc/amd/picasso/chip.c | 2 | ||||
-rw-r--r-- | src/soc/intel/apollolake/chip.c | 5 | ||||
-rw-r--r-- | src/soc/intel/baytrail/chip.c | 5 | ||||
-rw-r--r-- | src/soc/intel/braswell/chip.c | 6 | ||||
-rw-r--r-- | src/soc/intel/broadwell/chip.c | 5 | ||||
-rw-r--r-- | src/soc/intel/cannonlake/chip.c | 5 | ||||
-rw-r--r-- | src/soc/intel/denverton_ns/chip.c | 5 | ||||
-rw-r--r-- | src/soc/intel/icelake/chip.c | 5 | ||||
-rw-r--r-- | src/soc/intel/jasperlake/chip.c | 5 | ||||
-rw-r--r-- | src/soc/intel/quark/chip.c | 5 | ||||
-rw-r--r-- | src/soc/intel/skylake/chip.c | 5 | ||||
-rw-r--r-- | src/soc/intel/tigerlake/chip.c | 5 | ||||
-rw-r--r-- | src/soc/intel/xeon_sp/cpx/chip.c | 5 |
18 files changed, 9 insertions, 74 deletions
diff --git a/src/device/pci_device.c b/src/device/pci_device.c index 2c08ebc72e..05848717e2 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -439,6 +439,11 @@ void pci_domain_read_resources(struct device *dev) IORESOURCE_ASSIGNED; } +void pci_domain_set_resources(struct device *dev) +{ + assign_resources(dev->link_list); +} + static void pci_set_resource(struct device *dev, struct resource *resource) { resource_t base, end; diff --git a/src/include/device/device.h b/src/include/device/device.h index 72df751054..46efbfe679 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -256,6 +256,7 @@ void show_all_devs_resources(int debug_level, const char *msg); extern struct device_operations default_dev_ops_root; void pci_domain_read_resources(struct device *dev); +void pci_domain_set_resources(struct device *dev); void pci_domain_scan_bus(struct device *dev); void fixed_io_resource(struct device *dev, unsigned long index, diff --git a/src/northbridge/intel/haswell/northbridge.c b/src/northbridge/intel/haswell/northbridge.c index 458439ef32..a728e0e8cf 100644 --- a/src/northbridge/intel/haswell/northbridge.c +++ b/src/northbridge/intel/haswell/northbridge.c @@ -52,11 +52,6 @@ static int get_pcie_bar(struct device *dev, unsigned int index, u32 *base, u32 * return 0; } -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - static const char *northbridge_acpi_name(const struct device *dev) { if (dev->path.type == DEVICE_PATH_DOMAIN) diff --git a/src/northbridge/intel/ironlake/northbridge.c b/src/northbridge/intel/ironlake/northbridge.c index 07b8f53e61..d98af9edc9 100644 --- a/src/northbridge/intel/ironlake/northbridge.c +++ b/src/northbridge/intel/ironlake/northbridge.c @@ -67,11 +67,6 @@ static void add_fixed_resources(struct device *dev, int index) #endif } -static void pci_domain_set_resources(struct device *dev) -{ - assign_resources(dev->link_list); -} - #if CONFIG(HAVE_ACPI_TABLES) static const char *northbridge_acpi_name(const struct device *dev) { diff --git a/src/northbridge/intel/sandybridge/northbridge.c b/src/northbridge/intel/sandybridge/northbridge.c index b3772189b2..7a6372c207 100644 --- a/src/northbridge/intel/sandybridge/northbridge.c +++ b/src/northbridge/intel/sandybridge/northbridge.c @@ -99,7 +99,7 @@ static void add_fixed_resources(struct device *dev, int index) } } -static void pci_domain_set_resources(struct device *dev) +static void pci_domain_set_resources_sandybridge(struct device *dev) { uint64_t tom, me_base, touud; uint32_t tseg_base, uma_size, tolud; @@ -243,7 +243,7 @@ static const char *northbridge_acpi_name(const struct device *dev) */ static struct device_operations pci_domain_ops = { .read_resources = pci_domain_read_resources, - .set_resources = pci_domain_set_resources, + .set_resources = pci_domain_set_resources_sandybridge, .scan_bus = pci_domain_scan_bus, .write_acpi_tables = northbridge_write_acpi_tables, .acpi_name = northbridge_acpi_name, 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 <soc/ramstage.h> #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 <soc/ramstage.h> #include <soc/intel/broadwell/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/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 <spi-generic.h> #include <soc/hob_mem.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/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 */ |