Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31987 )
Change subject: sb/intel/{i82801g/i/j,bd82x6x}: Make use of generic set_subsystem() ......................................................................
sb/intel/{i82801g/i/j,bd82x6x}: Make use of generic set_subsystem()
Change-Id: Ia7a3eb2e29eb245c0e70abc23c2139aebc07cbfe Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/31987 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Subrata Banik subrata.banik@intel.com --- M src/southbridge/intel/bd82x6x/pci.c M src/southbridge/intel/i82801gx/pci.c M src/southbridge/intel/i82801ix/pci.c M src/southbridge/intel/i82801jx/pci.c 4 files changed, 4 insertions(+), 77 deletions(-)
Approvals: build bot (Jenkins): Verified Subrata Banik: Looks good to me, approved
diff --git a/src/southbridge/intel/bd82x6x/pci.c b/src/southbridge/intel/bd82x6x/pci.c index 4a62eb8..c3b8257 100644 --- a/src/southbridge/intel/bd82x6x/pci.c +++ b/src/southbridge/intel/bd82x6x/pci.c @@ -62,21 +62,8 @@
static void ich_pci_dev_enable_resources(struct device *dev) { - const struct pci_operations *ops; uint16_t command;
- /* Set the subsystem vendor and device id for mainboard devices */ - ops = ops_pci(dev); - if (dev->on_mainboard && ops && ops->set_subsystem) { - printk(BIOS_DEBUG, "%s subsystem <- %02x/%02x\n", - dev_path(dev), - CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); - ops->set_subsystem(dev, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); - } - command = pci_read_config16(dev, PCI_COMMAND); command |= dev->command; printk(BIOS_DEBUG, "%s cmd <- %02x\n", dev_path(dev), command); @@ -101,20 +88,8 @@ ich_pci_dev_enable_resources(dev); }
-static void set_subsystem(struct device *dev, unsigned vendor, unsigned device) -{ - /* NOTE: This is not the default position! */ - if (!vendor || !device) { - pci_write_config32(dev, 0x54, - pci_read_config32(dev, PCI_VENDOR_ID)); - } else { - pci_write_config32(dev, 0x54, - ((device & 0xffff) << 16) | (vendor & 0xffff)); - } -} - static struct pci_operations pci_ops = { - .set_subsystem = set_subsystem, + .set_subsystem = pci_dev_set_subsystem, };
static struct device_operations device_ops = { diff --git a/src/southbridge/intel/i82801gx/pci.c b/src/southbridge/intel/i82801gx/pci.c index 514db3c..c54769f 100644 --- a/src/southbridge/intel/i82801gx/pci.c +++ b/src/southbridge/intel/i82801gx/pci.c @@ -61,19 +61,8 @@
static void ich_pci_dev_enable_resources(struct device *dev) { - const struct pci_operations *ops; uint16_t command;
- /* Set the subsystem vendor and device id for mainboard devices */ - ops = ops_pci(dev); - if (dev->on_mainboard && ops && ops->set_subsystem) { - printk(BIOS_DEBUG, "%s subsystem <- %04x/%04x\n", - dev_path(dev), dev->subsystem_vendor, - dev->subsystem_device); - ops->set_subsystem(dev, dev->subsystem_vendor, - dev->subsystem_device); - } - command = pci_read_config16(dev, PCI_COMMAND); command |= dev->command; printk(BIOS_DEBUG, "%s cmd <- %02x\n", dev_path(dev), command); @@ -98,21 +87,8 @@ ich_pci_dev_enable_resources(dev); }
-static void set_subsystem(struct device *dev, unsigned int vendor, - unsigned int device) -{ - /* NOTE: This is not the default position! */ - if (!vendor || !device) { - pci_write_config32(dev, 0x54, - pci_read_config32(dev, PCI_VENDOR_ID)); - } else { - pci_write_config32(dev, 0x54, - ((device & 0xffff) << 16) | (vendor & 0xffff)); - } -} - static struct pci_operations pci_ops = { - .set_subsystem = set_subsystem, + .set_subsystem = pci_dev_set_subsystem, };
static struct device_operations device_ops = { diff --git a/src/southbridge/intel/i82801ix/pci.c b/src/southbridge/intel/i82801ix/pci.c index 4003e74..889e042 100644 --- a/src/southbridge/intel/i82801ix/pci.c +++ b/src/southbridge/intel/i82801ix/pci.c @@ -44,20 +44,8 @@ pci_write_config16(dev, PCI_SEC_STATUS, reg16); }
-static void set_subsystem(struct device *dev, unsigned vendor, unsigned device) -{ - /* NOTE: 0x54 is not the default position! */ - if (!vendor || !device) { - pci_write_config32(dev, 0x54, - pci_read_config32(dev, PCI_VENDOR_ID)); - } else { - pci_write_config32(dev, 0x54, - ((device & 0xffff) << 16) | (vendor & 0xffff)); - } -} - static struct pci_operations pci_ops = { - .set_subsystem = set_subsystem, + .set_subsystem = pci_dev_set_subsystem, };
static struct device_operations device_ops = { diff --git a/src/southbridge/intel/i82801jx/pci.c b/src/southbridge/intel/i82801jx/pci.c index a32d4a9..6918922 100644 --- a/src/southbridge/intel/i82801jx/pci.c +++ b/src/southbridge/intel/i82801jx/pci.c @@ -44,20 +44,8 @@ pci_write_config16(dev, PCI_SEC_STATUS, reg16); }
-static void set_subsystem(struct device *dev, unsigned vendor, unsigned device) -{ - /* NOTE: 0x54 is not the default position! */ - if (!vendor || !device) { - pci_write_config32(dev, 0x54, - pci_read_config32(dev, PCI_VENDOR_ID)); - } else { - pci_write_config32(dev, 0x54, - ((device & 0xffff) << 16) | (vendor & 0xffff)); - } -} - static struct pci_operations pci_ops = { - .set_subsystem = set_subsystem, + .set_subsystem = pci_dev_set_subsystem, };
static struct device_operations device_ops = {