blob: 414fe37aac7b0e21acaa23650eaa9ade8f526ae6 [file] [log] [blame]
Subrata Banik23ccb0d2017-04-24 11:28:40 +05301/*
2 * This file is part of the coreboot project.
3 *
Subrata Banik23ccb0d2017-04-24 11:28:40 +05304 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
Subrata Banik23ccb0d2017-04-24 11:28:40 +053015#include <device/device.h>
16#include <device/pci.h>
17#include <device/pci_ids.h>
18#include <intelblocks/xdci.h>
Duncan Laurie4df7d2c2018-03-26 02:17:33 -070019#include <security/vboot/vboot_common.h>
Subrata Banik23ccb0d2017-04-24 11:28:40 +053020
Aaron Durbin64031672018-04-21 14:45:32 -060021__weak void soc_xdci_init(struct device *dev) { /* no-op */ }
Subrata Banik23ccb0d2017-04-24 11:28:40 +053022
Duncan Laurie4df7d2c2018-03-26 02:17:33 -070023int xdci_can_enable(void)
24{
Furquan Shaikh0b78ae52018-04-25 18:19:58 -070025 return vboot_can_enable_udc();
Duncan Laurie4df7d2c2018-03-26 02:17:33 -070026}
27
Subrata Banik23ccb0d2017-04-24 11:28:40 +053028static struct device_operations usb_xdci_ops = {
Elyes HAOUAS1d191272018-11-27 12:23:48 +010029 .read_resources = pci_dev_read_resources,
30 .set_resources = pci_dev_set_resources,
31 .enable_resources = pci_dev_enable_resources,
Subrata Banik23ccb0d2017-04-24 11:28:40 +053032 .init = soc_xdci_init,
Subrata Banik6bbc91a2017-12-07 14:55:51 +053033 .ops_pci = &pci_dev_ops_pci,
Subrata Banik23ccb0d2017-04-24 11:28:40 +053034};
35
36static const unsigned short pci_device_ids[] = {
Aaron Durbinf27d98f2017-05-05 16:52:52 -050037 PCI_DEVICE_ID_INTEL_APL_XDCI,
Lijian Zhaobbedef92017-07-29 16:38:38 -070038 PCI_DEVICE_ID_INTEL_CNL_LP_XDCI,
Subrata Banik23ccb0d2017-04-24 11:28:40 +053039 PCI_DEVICE_ID_INTEL_GLK_XDCI,
40 PCI_DEVICE_ID_INTEL_SPT_LP_XDCI,
praveen hodagatta praneshe26c4a42018-09-20 03:49:45 +080041 PCI_DEVICE_ID_INTEL_CNP_H_XDCI,
Aamir Bohra9eac0392018-06-30 12:07:04 +053042 PCI_DEVICE_ID_INTEL_ICP_LP_XDCI,
Ronak Kanabarda7ffb482019-02-05 01:51:13 +053043 PCI_DEVICE_ID_INTEL_CMP_LP_XDCI,
Gaggery Tsai12a651c2019-12-05 11:23:20 -080044 PCI_DEVICE_ID_INTEL_CMP_H_XDCI,
Ravi Sarawadi6b5bf402019-10-21 22:25:04 -070045 PCI_DEVICE_ID_INTEL_TGP_LP_XDCI,
Tan, Lean Sheng26136092020-01-20 19:13:56 -080046 PCI_DEVICE_ID_INTEL_MCC_XDCI,
Meera Ravindranath3f4af0d2020-02-12 16:01:22 +053047 PCI_DEVICE_ID_INTEL_JSP_XDCI,
Subrata Banik23ccb0d2017-04-24 11:28:40 +053048 0
49};
50
51static const struct pci_driver pch_usb_xdci __pci_driver = {
52 .ops = &usb_xdci_ops,
53 .vendor = PCI_VENDOR_ID_INTEL,
54 .devices = pci_device_ids,
55};