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>
This commit is contained in:
Raul E Rangel 2021-01-12 15:02:10 -07:00 committed by Felix Held
parent b5e27a81cc
commit 0052d05101
1 changed files with 3 additions and 17 deletions

View File

@ -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 * by amd/common/block/pci/amd_pci_util to write the PCI_INT_LINE register
* to each PCI device. * to each PCI device.
*/ */
static struct pirq_struct pirq_data[] = { static struct pirq_struct pirq_data[ARRAY_SIZE(pci_routing_table)];
{ 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 const struct pci_routing *get_pci_routing(unsigned int devfn) 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) { for (size_t i = 0; i < ARRAY_SIZE(pirq_data); ++i) {
pirq = &pirq_data[i]; pirq = &pirq_data[i];
pci_routing = get_pci_routing(pirq->devfn); pci_routing = &pci_routing_table[i];
if (!pci_routing)
die("%s: devfn %u not found\n", __func__, pirq->devfn);
pirq->devfn = pci_routing->devfn;
for (size_t j = 0; j < 4; ++j) { for (size_t j = 0; j < 4; ++j) {
irq_index = calculate_irq(pci_routing, j); irq_index = calculate_irq(pci_routing, j);