Subrata Banik | a554b0c | 2017-02-16 16:08:49 +0530 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2014 Google Inc. |
praveen hodagatta pranesh | e26c4a4 | 2018-09-20 03:49:45 +0800 | [diff] [blame] | 5 | * Copyright (C) 2015-2018 Intel Corporation. |
Subrata Banik | a554b0c | 2017-02-16 16:08:49 +0530 | [diff] [blame] | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | */ |
| 16 | |
| 17 | #include <device/device.h> |
| 18 | #include <device/pci.h> |
| 19 | #include <device/pci_ids.h> |
| 20 | #include <arch/io.h> |
Duncan Laurie | bf713b0 | 2018-05-07 15:33:18 -0700 | [diff] [blame] | 21 | #include <intelblocks/acpi.h> |
Subrata Banik | a554b0c | 2017-02-16 16:08:49 +0530 | [diff] [blame] | 22 | #include <intelblocks/xhci.h> |
| 23 | |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 24 | __weak void soc_xhci_init(struct device *dev) { /* no-op */ } |
Subrata Banik | a554b0c | 2017-02-16 16:08:49 +0530 | [diff] [blame] | 25 | |
| 26 | static struct device_operations usb_xhci_ops = { |
| 27 | .read_resources = &pci_dev_read_resources, |
| 28 | .set_resources = &pci_dev_set_resources, |
| 29 | .enable_resources = &pci_dev_enable_resources, |
| 30 | .init = soc_xhci_init, |
Subrata Banik | 6bbc91a | 2017-12-07 14:55:51 +0530 | [diff] [blame] | 31 | .ops_pci = &pci_dev_ops_pci, |
Duncan Laurie | bf713b0 | 2018-05-07 15:33:18 -0700 | [diff] [blame] | 32 | .scan_bus = &scan_usb_bus, |
Subrata Banik | 98376b8 | 2018-05-22 16:18:16 +0530 | [diff] [blame] | 33 | #if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES) |
Duncan Laurie | bf713b0 | 2018-05-07 15:33:18 -0700 | [diff] [blame] | 34 | .acpi_name = &soc_acpi_name, |
Subrata Banik | 98376b8 | 2018-05-22 16:18:16 +0530 | [diff] [blame] | 35 | #endif |
Subrata Banik | a554b0c | 2017-02-16 16:08:49 +0530 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | static const unsigned short pci_device_ids[] = { |
Aaron Durbin | f27d98f | 2017-05-05 16:52:52 -0500 | [diff] [blame] | 39 | PCI_DEVICE_ID_INTEL_APL_XHCI, |
Lijian Zhao | bbedef9 | 2017-07-29 16:38:38 -0700 | [diff] [blame] | 40 | PCI_DEVICE_ID_INTEL_CNL_LP_XHCI, |
Subrata Banik | fc98c01 | 2017-05-03 13:29:19 +0530 | [diff] [blame] | 41 | PCI_DEVICE_ID_INTEL_GLK_XHCI, |
| 42 | PCI_DEVICE_ID_INTEL_SPT_LP_XHCI, |
V Sowmya | 7c15047 | 2018-01-23 14:44:45 +0530 | [diff] [blame] | 43 | PCI_DEVICE_ID_INTEL_SPT_H_XHCI, |
V Sowmya | acc2a48 | 2018-01-23 15:27:23 +0530 | [diff] [blame] | 44 | PCI_DEVICE_ID_INTEL_KBP_H_XHCI, |
praveen hodagatta pranesh | e26c4a4 | 2018-09-20 03:49:45 +0800 | [diff] [blame] | 45 | PCI_DEVICE_ID_INTEL_CNP_H_XHCI, |
Aamir Bohra | 9eac039 | 2018-06-30 12:07:04 +0530 | [diff] [blame] | 46 | PCI_DEVICE_ID_INTEL_ICP_LP_XHCI, |
Subrata Banik | a554b0c | 2017-02-16 16:08:49 +0530 | [diff] [blame] | 47 | 0 |
| 48 | }; |
| 49 | |
| 50 | static const struct pci_driver pch_usb_xhci __pci_driver = { |
| 51 | .ops = &usb_xhci_ops, |
| 52 | .vendor = PCI_VENDOR_ID_INTEL, |
| 53 | .devices = pci_device_ids, |
| 54 | }; |