blob: 0fe7c9399bf428762796152e0fc3b53f049eeca5 [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Ronald G. Minnich182615d2004-08-24 16:20:46 +00002
3#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>
Kyösti Mälkkie2227a22014-02-05 13:02:55 +02008#include <device/pci_ehci.h>
Stefan Reinauer138be832010-02-27 01:50:21 +00009#include "i82801dx.h"
Ronald G. Minnich182615d2004-08-24 16:20:46 +000010
11static void usb2_init(struct device *dev)
12{
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +000013 printk(BIOS_DEBUG, "USB: Setting up controller.. ");
Elyes HAOUAS2f2191a2020-04-28 19:59:30 +020014 pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
Stefan Reinauer8702ab52010-03-14 17:01:08 +000015 PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE);
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +000016 printk(BIOS_DEBUG, "done.\n");
Ronald G. Minnich182615d2004-08-24 16:20:46 +000017}
18
Stefan Reinauer8702ab52010-03-14 17:01:08 +000019static struct device_operations usb2_ops = {
Kyösti Mälkkicaaf0bf2013-06-06 10:21:28 +030020 .read_resources = pci_ehci_read_resources,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000021 .set_resources = pci_dev_set_resources,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000022 .enable_resources = pci_dev_enable_resources,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000023 .init = usb2_init,
Stefan Reinauer8702ab52010-03-14 17:01:08 +000024 .enable = i82801dx_enable,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000025};
26
Stefan Reinauer8702ab52010-03-14 17:01:08 +000027/* 82801DB/DBM USB 2.0 */
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000028static const struct pci_driver usb2_driver __pci_driver = {
Stefan Reinauer8702ab52010-03-14 17:01:08 +000029 .ops = &usb2_ops,
Felix Singer43b7f412022-03-07 04:34:52 +010030 .vendor = PCI_VID_INTEL,
31 .device = PCI_DID_INTEL_82801DB_EHCI,
Ronald G. Minnich182615d2004-08-24 16:20:46 +000032};