-/* (c) 2005 Linux Networx GPL see COPYING for details */
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2005 Linux Networx
+ * (Written by Eric Biederman <ebiederman@lnxi.com> for Linux Networx)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
#include <console/console.h>
#include <device/device.h>
/* error... */
return;
}
- printk_debug("PCIEXP: tunning %s\n", dev_path(dev));
-#warning "IMPLEMENT PCI EXPRESS TUNING"
+#ifdef CONFIG_PCIE_TUNING
+ printk(BIOS_DEBUG, "PCIe: tuning %s\n", dev_path(dev));
+
+ // TODO make this depending on ASPM
+ /* Enable ASPM Role Based Error Reporting */
+ u32 reg32;
+ reg32 = pci_read_config32(dev, cap + PCI_EXP_DEVCAP);
+ reg32 |= PCI_EXP_DEVCAP_RBER;
+ pci_write_config32(dev, cap + PCI_EXP_DEVCAP, reg32);
+#endif
}
unsigned int pciexp_scan_bus(struct bus *bus,
device_t child;
max = pci_scan_bus(bus, min_devfn, max_devfn, max);
for(child = bus->children; child; child = child->sibling) {
- if ( (child->path.u.pci.devfn < min_devfn) ||
- (child->path.u.pci.devfn > max_devfn))
+ if ( (child->path.pci.devfn < min_devfn) ||
+ (child->path.pci.devfn > max_devfn))
{
continue;
}