summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/northbridge/intel/gm45/northbridge.c14
-rw-r--r--src/northbridge/intel/sandybridge/northbridge.c26
2 files changed, 6 insertions, 34 deletions
diff --git a/src/northbridge/intel/gm45/northbridge.c b/src/northbridge/intel/gm45/northbridge.c
index 84df62dd32..ce75aea442 100644
--- a/src/northbridge/intel/gm45/northbridge.c
+++ b/src/northbridge/intel/gm45/northbridge.c
@@ -243,17 +243,6 @@ static void enable_dev(device_t dev)
}
}
-static u8 scan_bus_unused(struct bus *link)
-{
- struct device *dev;
-
- for (dev = link->children; dev; dev = dev->sibling) {
- if (dev->enabled)
- return 0;
- }
- return 1;
-}
-
static void gm45_init(void *const chip_info)
{
int dev, fn, bit_base;
@@ -279,8 +268,7 @@ static void gm45_init(void *const chip_info)
for (; fn >= 0; --fn) {
const struct device *const d =
dev_find_slot(0, PCI_DEVFN(dev, fn));
- if (d && d->enabled && d->link_list && !scan_bus_unused(d->link_list))
- continue;
+ if (!d || d->enabled) continue;
const u32 deven = pci_read_config32(d0f0, D0F0_DEVEN);
pci_write_config32(d0f0, D0F0_DEVEN,
deven & ~(1 << (bit_base + fn)));
diff --git a/src/northbridge/intel/sandybridge/northbridge.c b/src/northbridge/intel/sandybridge/northbridge.c
index 3974fe895c..53d93a2501 100644
--- a/src/northbridge/intel/sandybridge/northbridge.c
+++ b/src/northbridge/intel/sandybridge/northbridge.c
@@ -368,17 +368,6 @@ static void northbridge_dmi_init(struct device *dev)
DMIBAR32(0x88) = reg32;
}
-static u8 scan_bus_unused(struct bus *link)
-{
- struct device *dev;
-
- for (dev = link->children; dev; dev = dev->sibling) {
- if (dev->enabled)
- return 0;
- }
- return 1;
-}
-
/* Disable unused PEG devices based on devicetree */
static void disable_peg(void)
{
@@ -389,32 +378,27 @@ static void disable_peg(void)
reg = pci_read_config32(dev, DEVEN);
dev = dev_find_slot(0, PCI_DEVFN(1, 2));
- if (!dev || !dev->enabled ||
- (dev->link_list && scan_bus_unused(dev->link_list))) {
+ if (!dev || !dev->enabled) {
printk(BIOS_DEBUG, "Disabling PEG12.\n");
reg &= ~DEVEN_PEG12;
}
dev = dev_find_slot(0, PCI_DEVFN(1, 1));
- if (!dev || !dev->enabled ||
- (dev->link_list && scan_bus_unused(dev->link_list))) {
+ if (!dev || !dev->enabled) {
printk(BIOS_DEBUG, "Disabling PEG11.\n");
reg &= ~DEVEN_PEG11;
}
dev = dev_find_slot(0, PCI_DEVFN(1, 0));
- if (!dev || !dev->enabled ||
- (dev->link_list && scan_bus_unused(dev->link_list))) {
+ if (!dev || !dev->enabled) {
printk(BIOS_DEBUG, "Disabling PEG10.\n");
reg &= ~DEVEN_PEG10;
}
dev = dev_find_slot(0, PCI_DEVFN(2, 0));
- if (!dev || !dev->enabled ||
- (dev->link_list && scan_bus_unused(dev->link_list))) {
+ if (!dev || !dev->enabled) {
printk(BIOS_DEBUG, "Disabling IGD.\n");
reg &= ~DEVEN_IGD;
}
dev = dev_find_slot(0, PCI_DEVFN(6, 0));
- if (!dev || !dev->enabled ||
- (dev->link_list && scan_bus_unused(dev->link_list))) {
+ if (!dev || !dev->enabled) {
printk(BIOS_DEBUG, "Disabling PEG60.\n");
reg &= ~DEVEN_PEG60;
}