2 * This file is part of the coreboot project.
4 * Copyright (C) 2009 University of Heidelberg
5 * Written by Mondrian Nuessle <nuessle@uni-heidelberg.de> for
6 * University of Heidelberg.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #include <console/console.h>
24 #include <device/device.h>
25 #include <device/pci.h>
26 #include <device/pci_ids.h>
27 #include <device/pci_ops.h>
29 static void pcie_init(struct device *dev)
31 /* Enable pci error detecting */
35 printk(BIOS_DEBUG, "PCIE enable.... dev= %s\n",dev_path(dev));
37 /* System error enable */
38 dword = pci_read_config32(dev, 0x04);
39 dword |= (1<<8); /* System error enable */
40 dword |= (1<<30); /* Clear possible errors */
41 pci_write_config32(dev, 0x04, dword);
43 /* enable MSI on PCIE: */
44 msicap = pci_read_config32(dev, 0xa0);
45 msicap |= (1<<16); /* enable MSI*/
46 pci_write_config32(dev, 0xa0, msicap);
49 static struct pci_operations lops_pci = {
53 static struct device_operations pcie_ops = {
54 .read_resources = pci_bus_read_resources,
55 .set_resources = pci_dev_set_resources,
56 .enable_resources = pci_bus_enable_resources,
58 .scan_bus = pci_scan_bridge,
59 .reset_bus = pci_bus_reset,
63 static const struct pci_driver pcie_driver1 __pci_driver = {
65 .vendor = PCI_VENDOR_ID_SERVERWORKS,
66 .device = PCI_DEVICE_ID_SERVERWORKS_BCM21000_EXB0,
69 static const struct pci_driver pcie_driver2 __pci_driver = {
71 .vendor = PCI_VENDOR_ID_SERVERWORKS,
72 .device = PCI_DEVICE_ID_SERVERWORKS_BCM21000_EXB1,
75 static const struct pci_driver pcie_driver3 __pci_driver = {
77 .vendor = PCI_VENDOR_ID_SERVERWORKS,
78 .device = PCI_DEVICE_ID_SERVERWORKS_BCM21000_EXB2,