Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2010 Advanced Micro Devices, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #include <console/console.h> |
| 17 | #include <device/device.h> |
| 18 | #include <device/pci.h> |
| 19 | #include <device/pci_ids.h> |
| 20 | #include <device/pci_ops.h> |
| 21 | #include <device/pci_ehci.h> |
| 22 | #include <arch/io.h> |
Marc Jones | dfeb1c4 | 2017-08-07 19:08:24 -0600 | [diff] [blame] | 23 | #include <soc/southbridge.h> |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 24 | |
| 25 | static struct pci_operations lops_pci = { |
| 26 | .set_subsystem = pci_dev_set_subsystem, |
| 27 | }; |
| 28 | |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 29 | static struct device_operations usb_ops = { |
| 30 | .read_resources = pci_ehci_read_resources, |
| 31 | .set_resources = pci_dev_set_resources, |
| 32 | .enable_resources = pci_dev_enable_resources, |
Richard Spiegel | c661c8e | 2017-09-11 15:21:14 -0700 | [diff] [blame^] | 33 | .init = NULL, |
| 34 | .scan_bus = NULL, |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 35 | .ops_pci = &lops_pci, |
| 36 | }; |
| 37 | |
| 38 | static const unsigned short pci_device_ids[] = { |
| 39 | PCI_DEVICE_ID_AMD_SB900_USB_18_0, |
| 40 | PCI_DEVICE_ID_AMD_SB900_USB_18_2, |
| 41 | PCI_DEVICE_ID_AMD_SB900_USB_20_5, |
| 42 | PCI_DEVICE_ID_AMD_CZ_USB_0, |
| 43 | PCI_DEVICE_ID_AMD_CZ_USB_1, |
| 44 | PCI_DEVICE_ID_AMD_CZ_USB3_0, |
| 45 | 0 |
| 46 | }; |
| 47 | |
| 48 | static const struct pci_driver usb_0_driver __pci_driver = { |
| 49 | .ops = &usb_ops, |
| 50 | .vendor = PCI_VENDOR_ID_AMD, |
| 51 | .devices = pci_device_ids, |
| 52 | }; |