blob: 2abfa8a34f68508b3612e802147ed2918d90d19a [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauer8702ab52010-03-14 17:01:08 +00002
Ronald G. Minnich182615d2004-08-24 16:20:46 +00003#include <console/console.h>
4#include <device/device.h>
5#include <device/pci.h>
6#include <device/pci_ids.h>
7#include <device/pci_ops.h>
Stefan Reinauer138be832010-02-27 01:50:21 +00008#include "i82801dx.h"
Ronald G. Minnich182615d2004-08-24 16:20:46 +00009
10static void usb_init(struct device *dev)
11{
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +000012 printk(BIOS_DEBUG, "USB: Setting up controller.. ");
Elyes HAOUAS2f2191a2020-04-28 19:59:30 +020013 pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
Stefan Reinauer8702ab52010-03-14 17:01:08 +000014 PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE);
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +000015 printk(BIOS_DEBUG, "done.\n");
Ronald G. Minnich182615d2004-08-24 16:20:46 +000016}
17
Stefan Reinauer8702ab52010-03-14 17:01:08 +000018static struct device_operations usb_ops = {
19 .read_resources = pci_dev_read_resources,
20 .set_resources = pci_dev_set_resources,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000021 .enable_resources = pci_dev_enable_resources,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000022 .init = usb_init,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000023 .enable = i82801dx_enable,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000024};
25
Stefan Reinauer8702ab52010-03-14 17:01:08 +000026/* 82801DB/DBL/DBM USB1 */
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000027static const struct pci_driver usb_driver_1 __pci_driver = {
Stefan Reinauer8702ab52010-03-14 17:01:08 +000028 .ops = &usb_ops,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000029 .vendor = PCI_VENDOR_ID_INTEL,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000030 .device = PCI_DEVICE_ID_INTEL_82801DB_USB1,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000031};
Stefan Reinauer8702ab52010-03-14 17:01:08 +000032
33/* 82801DB/DBL/DBM USB2 */
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000034static const struct pci_driver usb_driver_2 __pci_driver = {
Stefan Reinauer8702ab52010-03-14 17:01:08 +000035 .ops = &usb_ops,
36 .vendor = PCI_VENDOR_ID_INTEL,
37 .device = PCI_DEVICE_ID_INTEL_82801DB_USB2,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000038};
Stefan Reinauer8702ab52010-03-14 17:01:08 +000039
40/* 82801DB/DBL/DBM USB3 */
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000041static const struct pci_driver usb_driver_3 __pci_driver = {
Stefan Reinauer8702ab52010-03-14 17:01:08 +000042 .ops = &usb_ops,
43 .vendor = PCI_VENDOR_ID_INTEL,
44 .device = PCI_DEVICE_ID_INTEL_82801DB_USB3,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000045};