blob: 0ee63657e4f1785d093e4ba9e9c38cbe67923c79 [file] [log] [blame]
Subrata Banik23ccb0d2017-04-24 11:28:40 +05301/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2014 Google Inc.
praveen hodagatta praneshe26c4a42018-09-20 03:49:45 +08005 * Copyright (C) 2015-2018 Intel Corporation.
Subrata Banik23ccb0d2017-04-24 11:28:40 +05306 *
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 <arch/io.h>
18#include <device/device.h>
19#include <device/pci.h>
20#include <device/pci_ids.h>
21#include <intelblocks/xdci.h>
Duncan Laurie4df7d2c2018-03-26 02:17:33 -070022#include <security/vboot/vboot_common.h>
Subrata Banik23ccb0d2017-04-24 11:28:40 +053023
Aaron Durbin64031672018-04-21 14:45:32 -060024__weak void soc_xdci_init(struct device *dev) { /* no-op */ }
Subrata Banik23ccb0d2017-04-24 11:28:40 +053025
Duncan Laurie4df7d2c2018-03-26 02:17:33 -070026int xdci_can_enable(void)
27{
Furquan Shaikh0b78ae52018-04-25 18:19:58 -070028 return vboot_can_enable_udc();
Duncan Laurie4df7d2c2018-03-26 02:17:33 -070029}
30
Subrata Banik23ccb0d2017-04-24 11:28:40 +053031static struct device_operations usb_xdci_ops = {
Elyes HAOUAS1d191272018-11-27 12:23:48 +010032 .read_resources = pci_dev_read_resources,
33 .set_resources = pci_dev_set_resources,
34 .enable_resources = pci_dev_enable_resources,
Subrata Banik23ccb0d2017-04-24 11:28:40 +053035 .init = soc_xdci_init,
Subrata Banik6bbc91a2017-12-07 14:55:51 +053036 .ops_pci = &pci_dev_ops_pci,
Subrata Banik23ccb0d2017-04-24 11:28:40 +053037};
38
39static const unsigned short pci_device_ids[] = {
Aaron Durbinf27d98f2017-05-05 16:52:52 -050040 PCI_DEVICE_ID_INTEL_APL_XDCI,
Lijian Zhaobbedef92017-07-29 16:38:38 -070041 PCI_DEVICE_ID_INTEL_CNL_LP_XDCI,
Subrata Banik23ccb0d2017-04-24 11:28:40 +053042 PCI_DEVICE_ID_INTEL_GLK_XDCI,
43 PCI_DEVICE_ID_INTEL_SPT_LP_XDCI,
praveen hodagatta praneshe26c4a42018-09-20 03:49:45 +080044 PCI_DEVICE_ID_INTEL_CNP_H_XDCI,
Aamir Bohra9eac0392018-06-30 12:07:04 +053045 PCI_DEVICE_ID_INTEL_ICP_LP_XDCI,
Subrata Banik23ccb0d2017-04-24 11:28:40 +053046 0
47};
48
49static const struct pci_driver pch_usb_xdci __pci_driver = {
50 .ops = &usb_xdci_ops,
51 .vendor = PCI_VENDOR_ID_INTEL,
52 .devices = pci_device_ids,
53};