blob: 48b990d1acdd67e2fa328c2d5527352153e069d2 [file] [log] [blame]
Stefan Reinauer8702ab52010-03-14 17:01:08 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2004 Ronald G. Minnich
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
9 * the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
19 * MA 02110-1301 USA
20 */
21
Ronald G. Minnich182615d2004-08-24 16:20:46 +000022#include <console/console.h>
23#include <device/device.h>
24#include <device/pci.h>
25#include <device/pci_ids.h>
26#include <device/pci_ops.h>
Stefan Reinauer138be832010-02-27 01:50:21 +000027#include "i82801dx.h"
Ronald G. Minnich182615d2004-08-24 16:20:46 +000028
29static void usb_init(struct device *dev)
30{
Stefan Reinauer8702ab52010-03-14 17:01:08 +000031 u32 cmd;
Ronald G. Minnich182615d2004-08-24 16:20:46 +000032 printk_debug("USB: Setting up controller.. ");
33 cmd = pci_read_config32(dev, PCI_COMMAND);
Stefan Reinauer8702ab52010-03-14 17:01:08 +000034 pci_write_config32(dev, PCI_COMMAND,
35 cmd | PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
36 PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE);
Ronald G. Minnich182615d2004-08-24 16:20:46 +000037 printk_debug("done.\n");
Ronald G. Minnich182615d2004-08-24 16:20:46 +000038}
39
Stefan Reinauer8702ab52010-03-14 17:01:08 +000040static struct device_operations usb_ops = {
41 .read_resources = pci_dev_read_resources,
42 .set_resources = pci_dev_set_resources,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000043 .enable_resources = pci_dev_enable_resources,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000044 .init = usb_init,
45 .scan_bus = 0,
46 .enable = i82801dx_enable,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000047};
48
Stefan Reinauer8702ab52010-03-14 17:01:08 +000049/* 82801DB/DBL/DBM USB1 */
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000050static const struct pci_driver usb_driver_1 __pci_driver = {
Stefan Reinauer8702ab52010-03-14 17:01:08 +000051 .ops = &usb_ops,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000052 .vendor = PCI_VENDOR_ID_INTEL,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000053 .device = PCI_DEVICE_ID_INTEL_82801DB_USB1,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000054};
Stefan Reinauer8702ab52010-03-14 17:01:08 +000055
56/* 82801DB/DBL/DBM USB2 */
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000057static const struct pci_driver usb_driver_2 __pci_driver = {
Stefan Reinauer8702ab52010-03-14 17:01:08 +000058 .ops = &usb_ops,
59 .vendor = PCI_VENDOR_ID_INTEL,
60 .device = PCI_DEVICE_ID_INTEL_82801DB_USB2,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000061};
Stefan Reinauer8702ab52010-03-14 17:01:08 +000062
63/* 82801DB/DBL/DBM USB3 */
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000064static const struct pci_driver usb_driver_3 __pci_driver = {
Stefan Reinauer8702ab52010-03-14 17:01:08 +000065 .ops = &usb_ops,
66 .vendor = PCI_VENDOR_ID_INTEL,
67 .device = PCI_DEVICE_ID_INTEL_82801DB_USB3,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000068};