2 * This file is part of the coreboot project.
4 * Copyright (C) 2011 Google Inc
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include <device/device.h>
21 #include <device/pci_def.h>
22 #include <device/pci.h>
23 #include <device/pci_ids.h>
24 #include <console/console.h>
28 static void oxford_oxpcie_enable(device_t dev)
30 printk(BIOS_DEBUG, "Initializing Oxford OXPCIe952\n");
32 struct resource *res = find_resource(dev, 0x10);
34 printk(BIOS_WARNING, "OXPCIe952: No UART resource found.\n");
38 printk(BIOS_DEBUG, "OXPCIe952: Class=%x Revision ID=%x\n",
39 (read32(res->base) >> 8), (read32(res->base) & 0xff));
40 printk(BIOS_DEBUG, "OXPCIe952: %d UARTs detected.\n",
41 (read32(res->base + 4) & 3));
44 static struct device_operations oxford_oxpcie_ops = {
45 .read_resources = pci_dev_read_resources,
46 .set_resources = pci_dev_set_resources,
47 .enable_resources = pci_dev_enable_resources,
48 .init = oxford_oxpcie_enable,
52 static const struct pci_driver oxford_oxpcie_driver __pci_driver = {
53 .ops = &oxford_oxpcie_ops,
58 static const struct pci_driver oxford_oxpcie_driver_2 __pci_driver = {
59 .ops = &oxford_oxpcie_ops,