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 University of Heidelberg
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * 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)
32 /* Enable pci error detecting */
36 printk(BIOS_DEBUG, "PCIE enable.... dev= %s\n",dev_path(dev));
38 /* System error enable */
39 dword = pci_read_config32(dev, 0x04);
40 dword |= (1<<8); /* System error enable */
41 dword |= (1<<30); /* Clear possible errors */
42 pci_write_config32(dev, 0x04, dword);
44 /* enable MSI on PCIE: */
45 msicap = pci_read_config32(dev, 0xa0);
46 msicap |= (1<<16); /* enable MSI*/
47 pci_write_config32(dev, 0xa0, msicap);
50 static struct pci_operations lops_pci = {
54 static struct device_operations pcie_ops = {
55 .read_resources = pci_bus_read_resources,
56 .set_resources = pci_dev_set_resources,
57 .enable_resources = pci_bus_enable_resources,
59 .scan_bus = pci_scan_bridge,
60 .reset_bus = pci_bus_reset,
65 static const struct pci_driver pcie_driver1 __pci_driver = {
67 .vendor = PCI_VENDOR_ID_SERVERWORKS,
68 .device = PCI_DEVICE_ID_SERVERWORKS_BCM21000_EXB0,
71 static const struct pci_driver pcie_driver2 __pci_driver = {
73 .vendor = PCI_VENDOR_ID_SERVERWORKS,
74 .device = PCI_DEVICE_ID_SERVERWORKS_BCM21000_EXB1,
77 static const struct pci_driver pcie_driver3 __pci_driver = {
79 .vendor = PCI_VENDOR_ID_SERVERWORKS,
80 .device = PCI_DEVICE_ID_SERVERWORKS_BCM21000_EXB2,