sb/intel/bd82x6x: Use array for PCIe ASPM overrides

Using an array reduces the amount of boilerplate code.

Change-Id: Ic6a48a01d3b96e69273dc28bdb6699ce7c0931b2
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55246
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Angel Pons
2021-06-05 12:34:23 +02:00
committed by Patrick Georgi
parent d047927168
commit 023968453e
4 changed files with 4 additions and 36 deletions

View File

@@ -61,14 +61,7 @@ struct southbridge_intel_bd82x6x_config {
uint8_t pcie_port_coalesce;
/* Override PCIe ASPM */
uint8_t pcie_aspm_f0;
uint8_t pcie_aspm_f1;
uint8_t pcie_aspm_f2;
uint8_t pcie_aspm_f3;
uint8_t pcie_aspm_f4;
uint8_t pcie_aspm_f5;
uint8_t pcie_aspm_f6;
uint8_t pcie_aspm_f7;
uint8_t pcie_aspm[8];
int c2_latency;
int docking_supported;

View File

@@ -162,32 +162,7 @@ static void pch_pcie_pm_late(struct device *dev)
pci_or_config32(dev, 0xd4, 1 << 1);
/* Check for a rootport ASPM override */
switch (PCI_FUNC(dev->path.pci.devfn)) {
case 0:
apmc = config->pcie_aspm_f0;
break;
case 1:
apmc = config->pcie_aspm_f1;
break;
case 2:
apmc = config->pcie_aspm_f2;
break;
case 3:
apmc = config->pcie_aspm_f3;
break;
case 4:
apmc = config->pcie_aspm_f4;
break;
case 5:
apmc = config->pcie_aspm_f5;
break;
case 6:
apmc = config->pcie_aspm_f6;
break;
case 7:
apmc = config->pcie_aspm_f7;
break;
}
apmc = config->pcie_aspm[PCI_FUNC(dev->path.pci.devfn)];
/* Setup the override or get the real ASPM setting */
if (apmc) {