diff options
author | Raul E Rangel <rrangel@chromium.org> | 2021-01-12 15:02:10 -0700 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-01-23 20:14:42 +0000 |
commit | 0052d051011825bbd43f625d208de3f186eec512 (patch) | |
tree | a05a8369397286e79aa88b3d94925b212d169010 | |
parent | b5e27a81cc971af3c7e5e4c8038d23593339b66c (diff) |
soc/amd/picasso/pcie_gpp: Remove duplication in pirq_data declaration
There is no reason to duplicate the table.
BUG=b:170595019
BRANCH=zork
TEST=boot zork with pci=nomsi and verify /proc/interrupts didn't change
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Ief714266cdb1b4f89afd0d9e50238200b87687ef
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49367
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
-rw-r--r-- | src/soc/amd/picasso/pcie_gpp.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/soc/amd/picasso/pcie_gpp.c b/src/soc/amd/picasso/pcie_gpp.c index 722dc88f90..3101eb4637 100644 --- a/src/soc/amd/picasso/pcie_gpp.c +++ b/src/soc/amd/picasso/pcie_gpp.c @@ -42,20 +42,7 @@ static const struct pci_routing pci_routing_table[] = { * by amd/common/block/pci/amd_pci_util to write the PCI_INT_LINE register * to each PCI device. */ -static struct pirq_struct pirq_data[] = { - { PCIE_GPP_0_DEVFN }, - { PCIE_GPP_1_DEVFN }, - { PCIE_GPP_2_DEVFN }, - { PCIE_GPP_3_DEVFN }, - { PCIE_GPP_4_DEVFN }, - { PCIE_GPP_5_DEVFN }, - { PCIE_GPP_6_DEVFN }, - { PCIE_GPP_A_DEVFN }, - { PCIE_GPP_B_DEVFN }, -}; - -_Static_assert(ARRAY_SIZE(pci_routing_table) == ARRAY_SIZE(pirq_data), - "PCI and PIRQ tables must be the same size"); +static struct pirq_struct pirq_data[ARRAY_SIZE(pci_routing_table)]; static const struct pci_routing *get_pci_routing(unsigned int devfn) { @@ -84,10 +71,9 @@ void populate_pirq_data(void) for (size_t i = 0; i < ARRAY_SIZE(pirq_data); ++i) { pirq = &pirq_data[i]; - pci_routing = get_pci_routing(pirq->devfn); - if (!pci_routing) - die("%s: devfn %u not found\n", __func__, pirq->devfn); + pci_routing = &pci_routing_table[i]; + pirq->devfn = pci_routing->devfn; for (size_t j = 0; j < 4; ++j) { irq_index = calculate_irq(pci_routing, j); |