blob: ab87f365dadee619c049b5dce79cfc2ad7dbf0ba [file] [log] [blame]
Subrata Banika554b0c2017-02-16 16:08:49 +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 Banika554b0c2017-02-16 16:08:49 +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 <device/device.h>
18#include <device/pci.h>
19#include <device/pci_ids.h>
20#include <arch/io.h>
Duncan Lauriebf713b02018-05-07 15:33:18 -070021#include <intelblocks/acpi.h>
Subrata Banika554b0c2017-02-16 16:08:49 +053022#include <intelblocks/xhci.h>
23
Aaron Durbin64031672018-04-21 14:45:32 -060024__weak void soc_xhci_init(struct device *dev) { /* no-op */ }
Subrata Banika554b0c2017-02-16 16:08:49 +053025
26static struct device_operations usb_xhci_ops = {
Elyes HAOUAS1d191272018-11-27 12:23:48 +010027 .read_resources = pci_dev_read_resources,
28 .set_resources = pci_dev_set_resources,
29 .enable_resources = pci_dev_enable_resources,
Subrata Banika554b0c2017-02-16 16:08:49 +053030 .init = soc_xhci_init,
Subrata Banik6bbc91a2017-12-07 14:55:51 +053031 .ops_pci = &pci_dev_ops_pci,
Elyes HAOUAS1d191272018-11-27 12:23:48 +010032 .scan_bus = scan_usb_bus,
Subrata Banik98376b82018-05-22 16:18:16 +053033#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
Elyes HAOUAS1d191272018-11-27 12:23:48 +010034 .acpi_name = soc_acpi_name,
Subrata Banik98376b82018-05-22 16:18:16 +053035#endif
Subrata Banika554b0c2017-02-16 16:08:49 +053036};
37
38static const unsigned short pci_device_ids[] = {
Aaron Durbinf27d98f2017-05-05 16:52:52 -050039 PCI_DEVICE_ID_INTEL_APL_XHCI,
Lijian Zhaobbedef92017-07-29 16:38:38 -070040 PCI_DEVICE_ID_INTEL_CNL_LP_XHCI,
Subrata Banikfc98c012017-05-03 13:29:19 +053041 PCI_DEVICE_ID_INTEL_GLK_XHCI,
42 PCI_DEVICE_ID_INTEL_SPT_LP_XHCI,
V Sowmya7c150472018-01-23 14:44:45 +053043 PCI_DEVICE_ID_INTEL_SPT_H_XHCI,
V Sowmyaacc2a482018-01-23 15:27:23 +053044 PCI_DEVICE_ID_INTEL_KBP_H_XHCI,
praveen hodagatta praneshe26c4a42018-09-20 03:49:45 +080045 PCI_DEVICE_ID_INTEL_CNP_H_XHCI,
Aamir Bohra9eac0392018-06-30 12:07:04 +053046 PCI_DEVICE_ID_INTEL_ICP_LP_XHCI,
Subrata Banika554b0c2017-02-16 16:08:49 +053047 0
48};
49
50static 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};