blob: 7a354d6c222b7c07ccef7b9db76e2693ed422c4e [file] [log] [blame]
Martin Roth55e31a92014-12-16 20:53:49 -07001//2003 Copyright Tyan
Eric Biederman2c018fb2003-07-21 20:13:45 +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>
Eric Biederman83b991a2003-10-11 06:20:25 +00008#include "amd8111.h"
Eric Biederman2c018fb2003-07-21 20:13:45 +00009
Yinghai Luf19e2c72004-10-21 01:52:21 +000010#if 0
Eric Biederman2c018fb2003-07-21 20:13:45 +000011
Eric Biedermandbec2d42004-10-21 10:44:08 +000012static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
13{
Stefan Reinauer14e22772010-04-27 06:56:47 +000014 pci_write_config32(dev, 0x70,
Eric Biedermandbec2d42004-10-21 10:44:08 +000015 ((device & 0xffff) << 16) | (vendor & 0xffff));
16}
17
18static struct pci_operations lops_pci = {
19 .set_subsystem = lpci_set_subsystem,
20};
21
Jason Schildtc9c4dd62005-10-25 21:04:09 +000022#endif
23
24static void amd8111_usb2_enable(device_t dev)
25{
Stefan Reinauer14e22772010-04-27 06:56:47 +000026 // Due to buggy USB2 we force it to disable.
Jason Schildt984bab52005-10-25 22:24:46 +000027 dev->enabled = 0;
Jason Schildtc9c4dd62005-10-25 21:04:09 +000028 amd8111_enable(dev);
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +000029 printk(BIOS_DEBUG, "USB2 disabled.\n");
Jason Schildtc9c4dd62005-10-25 21:04:09 +000030}
31
Eric Biederman83b991a2003-10-11 06:20:25 +000032static struct device_operations usb2_ops = {
Eric Biedermane9a271e32003-09-02 03:36:25 +000033 .read_resources = pci_dev_read_resources,
34 .set_resources = pci_dev_set_resources,
35 .enable_resources = pci_dev_enable_resources,
Eric Biedermane9a271e32003-09-02 03:36:25 +000036 .scan_bus = 0,
Jason Schildtc9c4dd62005-10-25 21:04:09 +000037 .enable = amd8111_usb2_enable,
38 // .ops_pci = &lops_pci,
Eric Biederman2c018fb2003-07-21 20:13:45 +000039};
40
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +000041static const struct pci_driver usb2_driver __pci_driver = {
Eric Biederman83b991a2003-10-11 06:20:25 +000042 .ops = &usb2_ops,
Eric Biederman2c018fb2003-07-21 20:13:45 +000043 .vendor = PCI_VENDOR_ID_AMD,
44 .device = PCI_DEVICE_ID_AMD_8111_USB2,
45};