Angel Pons | ae59387 | 2020-04-04 18:50:57 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 2 | |
| 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> |
| 8 | #include <device/pci_ehci.h> |
| 9 | #include <soc/acpi.h> |
| 10 | #include <soc/pci_devs.h> |
| 11 | #include <soc/southbridge.h> |
| 12 | #include <amdblocks/acpimmio.h> |
| 13 | |
Marshall Dawson | e0fd9a6 | 2019-07-09 18:12:03 -0500 | [diff] [blame] | 14 | static void picasso_usb_init(struct device *dev) |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 15 | { |
Marshall Dawson | e0fd9a6 | 2019-07-09 18:12:03 -0500 | [diff] [blame] | 16 | /* USB overcurrent configuration is programmed inside the FSP */ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 17 | |
Marshall Dawson | e0fd9a6 | 2019-07-09 18:12:03 -0500 | [diff] [blame] | 18 | printk(BIOS_DEBUG, "%s\n", __func__); |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | static struct pci_operations lops_pci = { |
| 22 | .set_subsystem = pci_dev_set_subsystem, |
| 23 | }; |
| 24 | |
| 25 | static struct device_operations usb_ops = { |
Marshall Dawson | e0fd9a6 | 2019-07-09 18:12:03 -0500 | [diff] [blame] | 26 | .read_resources = pci_dev_read_resources, |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 27 | .set_resources = pci_dev_set_resources, |
| 28 | .enable_resources = pci_dev_enable_resources, |
Marshall Dawson | e0fd9a6 | 2019-07-09 18:12:03 -0500 | [diff] [blame] | 29 | .init = picasso_usb_init, |
Nico Huber | a89c82e | 2017-09-14 15:40:28 +0200 | [diff] [blame] | 30 | .scan_bus = scan_static_bus, |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 31 | .acpi_name = soc_acpi_name, |
| 32 | .ops_pci = &lops_pci, |
| 33 | }; |
| 34 | |
| 35 | static const unsigned short pci_device_ids[] = { |
Furquan Shaikh | a1cd7eb | 2020-04-15 23:58:22 -0700 | [diff] [blame] | 36 | PCI_DEVICE_ID_AMD_FAM17H_MODEL18H_XHCI0, |
| 37 | PCI_DEVICE_ID_AMD_FAM17H_MODEL18H_XHCI1, |
| 38 | PCI_DEVICE_ID_AMD_FAM17H_MODEL20H_XHCI0, |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 39 | 0 |
| 40 | }; |
| 41 | |
| 42 | static const struct pci_driver usb_0_driver __pci_driver = { |
| 43 | .ops = &usb_ops, |
| 44 | .vendor = PCI_VENDOR_ID_AMD, |
| 45 | .devices = pci_device_ids, |
| 46 | }; |