blob: 47156f410236cc0bafb42470669524d3665e858e [file] [log] [blame]
Angel Pons6bc13742020-04-05 15:46:38 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Karthikeyan Ramasubramanian0f718312019-07-03 13:02:37 -06002
Tim Wawrzynczak56fcfb52020-11-10 13:39:37 -07003#include <device/pci_type.h>
Karthikeyan Ramasubramanian0f718312019-07-03 13:02:37 -06004#include <intelblocks/xhci.h>
5
6#define XHCI_USB2_PORT_STATUS_REG 0x480
Angel Ponsb36100f2020-09-07 13:18:10 +02007#if CONFIG(SOC_INTEL_GEMINILAKE)
Karthikeyan Ramasubramanian0f718312019-07-03 13:02:37 -06008#define XHCI_USB3_PORT_STATUS_REG 0x510
9#define XHCI_USB2_PORT_NUM 9
10#else
11#define XHCI_USB3_PORT_STATUS_REG 0x500
12#define XHCI_USB2_PORT_NUM 8
13#endif
14#define XHCI_USB3_PORT_NUM 7
15
16static const struct xhci_usb_info usb_info = {
17 .usb2_port_status_reg = XHCI_USB2_PORT_STATUS_REG,
18 .num_usb2_ports = XHCI_USB2_PORT_NUM,
19 .usb3_port_status_reg = XHCI_USB3_PORT_STATUS_REG,
20 .num_usb3_ports = XHCI_USB3_PORT_NUM,
21};
22
Tim Wawrzynczak56fcfb52020-11-10 13:39:37 -070023const struct xhci_usb_info *soc_get_xhci_usb_info(pci_devfn_t xhci_dev)
Karthikeyan Ramasubramanian0f718312019-07-03 13:02:37 -060024{
Tim Wawrzynczak56fcfb52020-11-10 13:39:37 -070025 /* Apollo Lake only has one XHCI controller */
Karthikeyan Ramasubramanian0f718312019-07-03 13:02:37 -060026 return &usb_info;
27}