From 0052d051011825bbd43f625d208de3f186eec512 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Tue, 12 Jan 2021 15:02:10 -0700 Subject: 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 Change-Id: Ief714266cdb1b4f89afd0d9e50238200b87687ef Reviewed-on: https://review.coreboot.org/c/coreboot/+/49367 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held Reviewed-by: Marshall Dawson --- src/soc/amd/picasso/pcie_gpp.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/soc/amd/picasso') 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); -- cgit v1.2.3