summaryrefslogtreecommitdiff
path: root/src/southbridge/intel/bd82x6x
diff options
context:
space:
mode:
authorSubrata Banik <subrata.banik@intel.com>2019-03-20 14:29:47 +0530
committerPatrick Georgi <pgeorgi@google.com>2019-03-21 16:18:05 +0000
commit4a0f07166f0f0b6eb799e2670b47ce31d0cfc60b (patch)
tree6a4ca1aad66f7ca8d2886f7a607132269b82f663 /src/southbridge/intel/bd82x6x
parent6520ec0650c4af616e1da92a5d90263e895f50ca (diff)
downloadcoreboot-4a0f07166f0f0b6eb799e2670b47ce31d0cfc60b.tar.xz
{northbridge, soc, southbridge}/intel: Make use of pci_dev_set_subsystem()
This patch removes local definitions of sub_system function and make use of common function pci_dev_set_subsystem(). Change-Id: I91982597fdf586ab514bec3d8e4d09f2565fe56d Signed-off-by: Subrata Banik <subrata.banik@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31982 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: David Guckian Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/southbridge/intel/bd82x6x')
-rw-r--r--src/southbridge/intel/bd82x6x/azalia.c14
-rw-r--r--src/southbridge/intel/bd82x6x/lpc.c13
-rw-r--r--src/southbridge/intel/bd82x6x/me.c13
-rw-r--r--src/southbridge/intel/bd82x6x/me_8.x.c13
-rw-r--r--src/southbridge/intel/bd82x6x/sata.c14
-rw-r--r--src/southbridge/intel/bd82x6x/smbus.c14
-rw-r--r--src/southbridge/intel/bd82x6x/usb_ehci.c8
-rw-r--r--src/southbridge/intel/bd82x6x/usb_xhci.c14
8 files changed, 8 insertions, 95 deletions
diff --git a/src/southbridge/intel/bd82x6x/azalia.c b/src/southbridge/intel/bd82x6x/azalia.c
index 0cc9efa133..8d424b8ba6 100644
--- a/src/southbridge/intel/bd82x6x/azalia.c
+++ b/src/southbridge/intel/bd82x6x/azalia.c
@@ -336,20 +336,8 @@ static const char *azalia_acpi_name(const struct device *dev)
return "HDEF";
}
-static void azalia_set_subsystem(struct device *dev, unsigned vendor,
- unsigned device)
-{
- if (!vendor || !device) {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- pci_read_config32(dev, PCI_VENDOR_ID));
- } else {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
- }
-}
-
static struct pci_operations azalia_pci_ops = {
- .set_subsystem = azalia_set_subsystem,
+ .set_subsystem = pci_dev_set_subsystem,
};
static struct device_operations azalia_ops = {
diff --git a/src/southbridge/intel/bd82x6x/lpc.c b/src/southbridge/intel/bd82x6x/lpc.c
index f22be9ed12..eda16da6f7 100644
--- a/src/southbridge/intel/bd82x6x/lpc.c
+++ b/src/southbridge/intel/bd82x6x/lpc.c
@@ -694,17 +694,6 @@ static void pch_lpc_enable(struct device *dev)
pch_enable(dev);
}
-static void set_subsystem(struct device *dev, unsigned vendor, unsigned device)
-{
- if (!vendor || !device) {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- pci_read_config32(dev, PCI_VENDOR_ID));
- } else {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
- }
-}
-
static void southbridge_inject_dsdt(struct device *dev)
{
global_nvs_t *gnvs = cbmem_add (CBMEM_ID_ACPI_GNVS, sizeof(*gnvs));
@@ -924,7 +913,7 @@ static void lpc_final(struct device *dev)
}
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/bd82x6x/me.c b/src/southbridge/intel/bd82x6x/me.c
index 5731b9bcd0..1670091055 100644
--- a/src/southbridge/intel/bd82x6x/me.c
+++ b/src/southbridge/intel/bd82x6x/me.c
@@ -735,19 +735,8 @@ static void intel_me_init(struct device *dev)
}
}
-static void set_subsystem(struct device *dev, unsigned vendor, unsigned device)
-{
- if (!vendor || !device) {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- pci_read_config32(dev, PCI_VENDOR_ID));
- } else {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- ((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/bd82x6x/me_8.x.c b/src/southbridge/intel/bd82x6x/me_8.x.c
index a6ffe896c4..954353698d 100644
--- a/src/southbridge/intel/bd82x6x/me_8.x.c
+++ b/src/southbridge/intel/bd82x6x/me_8.x.c
@@ -738,19 +738,8 @@ static void intel_me_init(struct device *dev)
}
}
-static void set_subsystem(struct device *dev, unsigned vendor, unsigned device)
-{
- if (!vendor || !device) {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- pci_read_config32(dev, PCI_VENDOR_ID));
- } else {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- ((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/bd82x6x/sata.c b/src/southbridge/intel/bd82x6x/sata.c
index 3ee0a5983b..91c87bf26e 100644
--- a/src/southbridge/intel/bd82x6x/sata.c
+++ b/src/southbridge/intel/bd82x6x/sata.c
@@ -234,18 +234,6 @@ static void sata_enable(struct device *dev)
pci_write_config16(dev, 0x90, map);
}
-static void sata_set_subsystem(struct device *dev, unsigned vendor,
- unsigned device)
-{
- if (!vendor || !device) {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- pci_read_config32(dev, PCI_VENDOR_ID));
- } else {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
- }
-}
-
static const char *sata_acpi_name(const struct device *dev)
{
return "SATA";
@@ -258,7 +246,7 @@ static void sata_fill_ssdt(struct device *dev)
}
static struct pci_operations sata_pci_ops = {
- .set_subsystem = sata_set_subsystem,
+ .set_subsystem = pci_dev_set_subsystem,
};
static struct device_operations sata_ops = {
diff --git a/src/southbridge/intel/bd82x6x/smbus.c b/src/southbridge/intel/bd82x6x/smbus.c
index 908380626c..4fb7539889 100644
--- a/src/southbridge/intel/bd82x6x/smbus.c
+++ b/src/southbridge/intel/bd82x6x/smbus.c
@@ -71,20 +71,8 @@ static struct smbus_bus_operations lops_smbus_bus = {
.write_byte = lsmbus_write_byte,
};
-static void smbus_set_subsystem(struct device *dev, unsigned vendor,
- unsigned device)
-{
- if (!vendor || !device) {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- pci_read_config32(dev, PCI_VENDOR_ID));
- } else {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
- }
-}
-
static struct pci_operations smbus_pci_ops = {
- .set_subsystem = smbus_set_subsystem,
+ .set_subsystem = pci_dev_set_subsystem,
};
static void smbus_read_resources(struct device *dev)
diff --git a/src/southbridge/intel/bd82x6x/usb_ehci.c b/src/southbridge/intel/bd82x6x/usb_ehci.c
index 6cf4c1061b..8fe3e41d6d 100644
--- a/src/southbridge/intel/bd82x6x/usb_ehci.c
+++ b/src/southbridge/intel/bd82x6x/usb_ehci.c
@@ -84,13 +84,7 @@ static void usb_ehci_set_subsystem(struct device *dev, unsigned vendor,
/* Enable writes to protected registers. */
pci_write_config8(dev, 0x80, access_cntl | 1);
- if (!vendor || !device) {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- pci_read_config32(dev, PCI_VENDOR_ID));
- } else {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
- }
+ pci_dev_set_subsystem(dev, vendor, device);
/* Restore protection. */
pci_write_config8(dev, 0x80, access_cntl);
diff --git a/src/southbridge/intel/bd82x6x/usb_xhci.c b/src/southbridge/intel/bd82x6x/usb_xhci.c
index 07d74e0248..85e450db5b 100644
--- a/src/southbridge/intel/bd82x6x/usb_xhci.c
+++ b/src/southbridge/intel/bd82x6x/usb_xhci.c
@@ -56,20 +56,8 @@ static const char *xhci_acpi_name(const struct device *dev)
return "XHC";
}
-static void xhci_set_subsystem(struct device *dev, unsigned vendor,
- unsigned device)
-{
- if (!vendor || !device) {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- pci_read_config32(dev, PCI_VENDOR_ID));
- } else {
- pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
- }
-}
-
static struct pci_operations xhci_pci_ops = {
- .set_subsystem = xhci_set_subsystem,
+ .set_subsystem = pci_dev_set_subsystem,
};
static struct device_operations usb_xhci_ops = {