Skip to content

Commit

Permalink
sb/intel/bd82x6x: assign PCIe root port ops in chipset devicetree
Browse files Browse the repository at this point in the history
Since the PCIe root ports in the PCH are always on the same device
functions, the device operations can be statically assigned in the
devicetree and there's no need to bind the host bridge device operations
to the PCI device during runtime via a list of PCI IDs.

TEST=Lenovo X220 still boots to Linux and all PCIe devices on PCH are
visible and working.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Change-Id: I05bfe8db88fd54415f320f32ea147636ca4e0df8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79117
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
  • Loading branch information
felixheld committed Nov 18, 2023
1 parent 61f22cf commit 58a5374
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
16 changes: 8 additions & 8 deletions src/northbridge/intel/sandybridge/chipset.cb
Expand Up @@ -27,14 +27,14 @@ chip northbridge/intel/sandybridge
device pci 19.0 alias gbe off end # Intel Gigabit Ethernet
device pci 1a.0 alias ehci2 off end # USB2 EHCI #2
device pci 1b.0 alias hda off end # High Definition Audio
device pci 1c.0 alias pcie_rp1 off end # PCIe Port #1
device pci 1c.1 alias pcie_rp2 off end # PCIe Port #2
device pci 1c.2 alias pcie_rp3 off end # PCIe Port #3
device pci 1c.3 alias pcie_rp4 off end # PCIe Port #4
device pci 1c.4 alias pcie_rp5 off end # PCIe Port #5
device pci 1c.5 alias pcie_rp6 off end # PCIe Port #6
device pci 1c.6 alias pcie_rp7 off end # PCIe Port #7
device pci 1c.7 alias pcie_rp8 off end # PCIe Port #8
device pci 1c.0 alias pcie_rp1 off ops bd82x6x_pcie_rp_ops end # PCIe Port #1
device pci 1c.1 alias pcie_rp2 off ops bd82x6x_pcie_rp_ops end # PCIe Port #2
device pci 1c.2 alias pcie_rp3 off ops bd82x6x_pcie_rp_ops end # PCIe Port #3
device pci 1c.3 alias pcie_rp4 off ops bd82x6x_pcie_rp_ops end # PCIe Port #4
device pci 1c.4 alias pcie_rp5 off ops bd82x6x_pcie_rp_ops end # PCIe Port #5
device pci 1c.5 alias pcie_rp6 off ops bd82x6x_pcie_rp_ops end # PCIe Port #6
device pci 1c.6 alias pcie_rp7 off ops bd82x6x_pcie_rp_ops end # PCIe Port #7
device pci 1c.7 alias pcie_rp8 off ops bd82x6x_pcie_rp_ops end # PCIe Port #8
device pci 1d.0 alias ehci1 off end # USB2 EHCI #1
device pci 1e.0 alias pci_bridge off end # PCI bridge
device pci 1f.0 alias lpc on end # LPC bridge
Expand Down
14 changes: 1 addition & 13 deletions src/southbridge/intel/bd82x6x/pcie.c
Expand Up @@ -258,7 +258,7 @@ static void pch_pciexp_scan_bridge(struct device *dev)
pch_pcie_pm_late(dev);
}

static struct device_operations device_ops = {
struct device_operations bd82x6x_pcie_rp_ops = {
.read_resources = pci_bus_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_bus_enable_resources,
Expand All @@ -268,15 +268,3 @@ static struct device_operations device_ops = {
.acpi_name = pch_pcie_acpi_name,
.ops_pci = &pci_dev_ops_pci,
};

static const unsigned short pci_device_ids[] = { 0x1c10, 0x1c12, 0x1c14, 0x1c16,
0x1c18, 0x1c1a, 0x1c1c, 0x1c1e,
0x1e10, 0x1e12, 0x1e14, 0x1e16,
0x1e18, 0x1e1a, 0x1e1c, 0x1e1e,
0 };

static const struct pci_driver pch_pcie __pci_driver = {
.ops = &device_ops,
.vendor = PCI_VID_INTEL,
.devices = pci_device_ids,
};

0 comments on commit 58a5374

Please sign in to comment.