Subrata Banik | 23ccb0d | 2017-04-24 11:28:40 +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 | 23ccb0d | 2017-04-24 11:28:40 +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 | |
Subrata Banik | 23ccb0d | 2017-04-24 11:28:40 +0530 | [diff] [blame] | 17 | #include <device/device.h> |
| 18 | #include <device/pci.h> |
| 19 | #include <device/pci_ids.h> |
| 20 | #include <intelblocks/xdci.h> |
Duncan Laurie | 4df7d2c | 2018-03-26 02:17:33 -0700 | [diff] [blame] | 21 | #include <security/vboot/vboot_common.h> |
Subrata Banik | 23ccb0d | 2017-04-24 11:28:40 +0530 | [diff] [blame] | 22 | |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 23 | __weak void soc_xdci_init(struct device *dev) { /* no-op */ } |
Subrata Banik | 23ccb0d | 2017-04-24 11:28:40 +0530 | [diff] [blame] | 24 | |
Duncan Laurie | 4df7d2c | 2018-03-26 02:17:33 -0700 | [diff] [blame] | 25 | int xdci_can_enable(void) |
| 26 | { |
Furquan Shaikh | 0b78ae5 | 2018-04-25 18:19:58 -0700 | [diff] [blame] | 27 | return vboot_can_enable_udc(); |
Duncan Laurie | 4df7d2c | 2018-03-26 02:17:33 -0700 | [diff] [blame] | 28 | } |
| 29 | |
Subrata Banik | 23ccb0d | 2017-04-24 11:28:40 +0530 | [diff] [blame] | 30 | static struct device_operations usb_xdci_ops = { |
Elyes HAOUAS | 1d19127 | 2018-11-27 12:23:48 +0100 | [diff] [blame] | 31 | .read_resources = pci_dev_read_resources, |
| 32 | .set_resources = pci_dev_set_resources, |
| 33 | .enable_resources = pci_dev_enable_resources, |
Subrata Banik | 23ccb0d | 2017-04-24 11:28:40 +0530 | [diff] [blame] | 34 | .init = soc_xdci_init, |
Subrata Banik | 6bbc91a | 2017-12-07 14:55:51 +0530 | [diff] [blame] | 35 | .ops_pci = &pci_dev_ops_pci, |
Subrata Banik | 23ccb0d | 2017-04-24 11:28:40 +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_XDCI, |
Lijian Zhao | bbedef9 | 2017-07-29 16:38:38 -0700 | [diff] [blame] | 40 | PCI_DEVICE_ID_INTEL_CNL_LP_XDCI, |
Subrata Banik | 23ccb0d | 2017-04-24 11:28:40 +0530 | [diff] [blame] | 41 | PCI_DEVICE_ID_INTEL_GLK_XDCI, |
| 42 | PCI_DEVICE_ID_INTEL_SPT_LP_XDCI, |
praveen hodagatta pranesh | e26c4a4 | 2018-09-20 03:49:45 +0800 | [diff] [blame] | 43 | PCI_DEVICE_ID_INTEL_CNP_H_XDCI, |
Aamir Bohra | 9eac039 | 2018-06-30 12:07:04 +0530 | [diff] [blame] | 44 | PCI_DEVICE_ID_INTEL_ICP_LP_XDCI, |
Ronak Kanabar | da7ffb48 | 2019-02-05 01:51:13 +0530 | [diff] [blame] | 45 | PCI_DEVICE_ID_INTEL_CMP_LP_XDCI, |
Gaggery Tsai | 12a651c | 2019-12-05 11:23:20 -0800 | [diff] [blame] | 46 | PCI_DEVICE_ID_INTEL_CMP_H_XDCI, |
Ravi Sarawadi | 6b5bf40 | 2019-10-21 22:25:04 -0700 | [diff] [blame] | 47 | PCI_DEVICE_ID_INTEL_TGP_LP_XDCI, |
Tan, Lean Sheng | 2613609 | 2020-01-20 19:13:56 -0800 | [diff] [blame] | 48 | PCI_DEVICE_ID_INTEL_MCC_XDCI, |
Meera Ravindranath | 3f4af0d | 2020-02-12 16:01:22 +0530 | [diff] [blame^] | 49 | PCI_DEVICE_ID_INTEL_JSP_XDCI, |
Subrata Banik | 23ccb0d | 2017-04-24 11:28:40 +0530 | [diff] [blame] | 50 | 0 |
| 51 | }; |
| 52 | |
| 53 | static const struct pci_driver pch_usb_xdci __pci_driver = { |
| 54 | .ops = &usb_xdci_ops, |
| 55 | .vendor = PCI_VENDOR_ID_INTEL, |
| 56 | .devices = pci_device_ids, |
| 57 | }; |