Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 2 | |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 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> |
Stefan Reinauer | 138be83 | 2010-02-27 01:50:21 +0000 | [diff] [blame] | 8 | #include "i82801dx.h" |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 9 | |
| 10 | static void usb_init(struct device *dev) |
| 11 | { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 12 | printk(BIOS_DEBUG, "USB: Setting up controller.. "); |
Elyes HAOUAS | 2f2191a | 2020-04-28 19:59:30 +0200 | [diff] [blame^] | 13 | pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_IO | PCI_COMMAND_MEMORY | |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 14 | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE); |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 15 | printk(BIOS_DEBUG, "done.\n"); |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 16 | } |
| 17 | |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 18 | static struct device_operations usb_ops = { |
| 19 | .read_resources = pci_dev_read_resources, |
| 20 | .set_resources = pci_dev_set_resources, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 21 | .enable_resources = pci_dev_enable_resources, |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 22 | .init = usb_init, |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 23 | .enable = i82801dx_enable, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 24 | }; |
| 25 | |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 26 | /* 82801DB/DBL/DBM USB1 */ |
Stefan Reinauer | f1cf1f7 | 2007-10-24 09:08:58 +0000 | [diff] [blame] | 27 | static const struct pci_driver usb_driver_1 __pci_driver = { |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 28 | .ops = &usb_ops, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 29 | .vendor = PCI_VENDOR_ID_INTEL, |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 30 | .device = PCI_DEVICE_ID_INTEL_82801DB_USB1, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 31 | }; |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 32 | |
| 33 | /* 82801DB/DBL/DBM USB2 */ |
Stefan Reinauer | f1cf1f7 | 2007-10-24 09:08:58 +0000 | [diff] [blame] | 34 | static const struct pci_driver usb_driver_2 __pci_driver = { |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 35 | .ops = &usb_ops, |
| 36 | .vendor = PCI_VENDOR_ID_INTEL, |
| 37 | .device = PCI_DEVICE_ID_INTEL_82801DB_USB2, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 38 | }; |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 39 | |
| 40 | /* 82801DB/DBL/DBM USB3 */ |
Stefan Reinauer | f1cf1f7 | 2007-10-24 09:08:58 +0000 | [diff] [blame] | 41 | static const struct pci_driver usb_driver_3 __pci_driver = { |
Stefan Reinauer | 8702ab5 | 2010-03-14 17:01:08 +0000 | [diff] [blame] | 42 | .ops = &usb_ops, |
| 43 | .vendor = PCI_VENDOR_ID_INTEL, |
| 44 | .device = PCI_DEVICE_ID_INTEL_82801DB_USB3, |
Ronald G. Minnich | 182615d | 2004-08-24 16:20:46 +0000 | [diff] [blame] | 45 | }; |