{northbridge, soc, southbridge}/intel: Make use of generic set_subsystem()
This patch removes all local definitions of sub_system functions and make use of common generic pci_dev_set_subsystem() from PCI bridge and Cardbus devices as well. Change-Id: I5fbed39ed448baf11f0e0786ce0ee94741d57237 Signed-off-by: Subrata Banik <subrata.banik@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31950 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
committed by
Patrick Georgi
parent
9514d47d3c
commit
15ccbf042d
@@ -306,21 +306,8 @@ static const char *pch_pcie_acpi_name(const struct device *dev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void pcie_set_subsystem(struct device *dev, unsigned vendor,
|
||||
unsigned device)
|
||||
{
|
||||
/* NOTE: This is not the default position! */
|
||||
if (!vendor || !device) {
|
||||
pci_write_config32(dev, 0x94,
|
||||
pci_read_config32(dev, 0));
|
||||
} else {
|
||||
pci_write_config32(dev, 0x94,
|
||||
((device & 0xffff) << 16) | (vendor & 0xffff));
|
||||
}
|
||||
}
|
||||
|
||||
static struct pci_operations pci_ops = {
|
||||
.set_subsystem = pcie_set_subsystem,
|
||||
.set_subsystem = pci_dev_set_subsystem,
|
||||
};
|
||||
|
||||
static struct device_operations device_ops = {
|
||||
|
@@ -252,22 +252,8 @@ static void ich_pcie_enable(struct device *dev)
|
||||
root_port_commit_config(dev);
|
||||
}
|
||||
|
||||
|
||||
static void pcie_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, 0x94,
|
||||
pci_read_config32(dev, 0));
|
||||
} else {
|
||||
pci_write_config32(dev, 0x94,
|
||||
((device & 0xffff) << 16) | (vendor & 0xffff));
|
||||
}
|
||||
}
|
||||
|
||||
static struct pci_operations pci_ops = {
|
||||
.set_subsystem = pcie_set_subsystem,
|
||||
.set_subsystem = pci_dev_set_subsystem,
|
||||
};
|
||||
|
||||
static struct device_operations device_ops = {
|
||||
|
@@ -95,19 +95,6 @@ static void pci_init(struct device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
static void pcie_set_subsystem(struct device *dev, unsigned vendor,
|
||||
unsigned device)
|
||||
{
|
||||
/* NOTE: 0x94 is not the default position! */
|
||||
if (!vendor || !device) {
|
||||
pci_write_config32(dev, 0x94,
|
||||
pci_read_config32(dev, 0));
|
||||
} else {
|
||||
pci_write_config32(dev, 0x94,
|
||||
((device & 0xffff) << 16) | (vendor & 0xffff));
|
||||
}
|
||||
}
|
||||
|
||||
static void pch_pciexp_scan_bridge(struct device *dev)
|
||||
{
|
||||
struct southbridge_intel_i82801ix_config *config = dev->chip_info;
|
||||
@@ -121,7 +108,7 @@ static void pch_pciexp_scan_bridge(struct device *dev)
|
||||
}
|
||||
|
||||
static struct pci_operations pci_ops = {
|
||||
.set_subsystem = pcie_set_subsystem,
|
||||
.set_subsystem = pci_dev_set_subsystem,
|
||||
};
|
||||
|
||||
static struct device_operations device_ops = {
|
||||
|
@@ -95,19 +95,6 @@ static void pci_init(struct device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
static void pcie_set_subsystem(struct device *dev, unsigned vendor,
|
||||
unsigned device)
|
||||
{
|
||||
/* NOTE: 0x94 is not the default position! */
|
||||
if (!vendor || !device) {
|
||||
pci_write_config32(dev, 0x94,
|
||||
pci_read_config32(dev, 0));
|
||||
} else {
|
||||
pci_write_config32(dev, 0x94,
|
||||
((device & 0xffff) << 16) | (vendor & 0xffff));
|
||||
}
|
||||
}
|
||||
|
||||
static void pch_pciexp_scan_bridge(struct device *dev)
|
||||
{
|
||||
struct southbridge_intel_i82801jx_config *config = dev->chip_info;
|
||||
@@ -121,7 +108,7 @@ static void pch_pciexp_scan_bridge(struct device *dev)
|
||||
}
|
||||
|
||||
static struct pci_operations pci_ops = {
|
||||
.set_subsystem = pcie_set_subsystem,
|
||||
.set_subsystem = pci_dev_set_subsystem,
|
||||
};
|
||||
|
||||
static struct device_operations device_ops = {
|
||||
|
@@ -727,21 +727,8 @@ static void pch_pcie_enable(struct device *dev)
|
||||
root_port_commit_config();
|
||||
}
|
||||
|
||||
static void pcie_set_subsystem(struct device *dev, unsigned vendor,
|
||||
unsigned device)
|
||||
{
|
||||
/* NOTE: This is not the default position! */
|
||||
if (!vendor || !device) {
|
||||
pci_write_config32(dev, 0x94,
|
||||
pci_read_config32(dev, 0));
|
||||
} else {
|
||||
pci_write_config32(dev, 0x94,
|
||||
((device & 0xffff) << 16) | (vendor & 0xffff));
|
||||
}
|
||||
}
|
||||
|
||||
static struct pci_operations pci_ops = {
|
||||
.set_subsystem = pcie_set_subsystem,
|
||||
.set_subsystem = pci_dev_set_subsystem,
|
||||
};
|
||||
|
||||
static struct device_operations device_ops = {
|
||||
|
@@ -200,8 +200,8 @@ static void rl5c476_set_subsystem(struct device *dev, unsigned vendor,
|
||||
/* Enable subsystem id register writes */
|
||||
pci_write_config16(dev, 0x82, miscreg | 0x40);
|
||||
|
||||
pci_write_config16(dev, 0x40, vendor);
|
||||
pci_write_config16(dev, 0x42, device);
|
||||
pci_dev_set_subsystem(dev, vendor, device);
|
||||
|
||||
/* restore original contents */
|
||||
pci_write_config16(dev, 0x82, miscreg);
|
||||
}
|
||||
|
@@ -46,8 +46,7 @@ static void ti_pci1x2y_set_subsystem(struct device *dev, unsigned vendor,
|
||||
* to the sub-vendor/device ids at 40 and 42.
|
||||
*/
|
||||
pci_write_config32(dev, 0x80, pci_read_config32(dev, 0x080) & ~0x10);
|
||||
pci_write_config16(dev, 0x40, vendor);
|
||||
pci_write_config16(dev, 0x42, device);
|
||||
pci_dev_set_subsystem(dev, vendor, device);
|
||||
pci_write_config32(dev, 0x80, pci_read_config32(dev, 0x80) | 0x10);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user