coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
xhci.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <device/pci_type.h>
4 #include <intelblocks/xhci.h>
5 #include <soc/pci_devs.h>
6 
7 /*
8  * Information obtained from Intel doc# 630094, ADL-P PCH EDS Vol. 2,
9  * as well as doc# 626817, ADL-P PCH EDS Vol. 1
10  */
11 
12 #define PCH_XHCI_USB2_PORT_STATUS_REG 0x480
13 #define PCH_XHCI_USB3_PORT_STATUS_REG 0x540
14 #define PCH_XHCI_USB2_PORT_NUM 10
15 #define PCH_XHCI_USB3_PORT_NUM 4
16 
17 #define TCSS_XHCI_USB2_PORT_STATUS_REG 0x480
18 #define TCSS_XHCI_USB3_PORT_STATUS_REG 0x490
19 #define TCSS_XHCI_USB2_PORT_NUM 0
20 #define TCSS_XHCI_USB3_PORT_NUM 4
21 
22 static const struct xhci_usb_info usb_info = {
24  .num_usb2_ports = PCH_XHCI_USB2_PORT_NUM,
25  .usb3_port_status_reg = PCH_XHCI_USB3_PORT_STATUS_REG,
26  .num_usb3_ports = PCH_XHCI_USB3_PORT_NUM,
27 };
28 
29 static const struct xhci_usb_info tcss_usb_info = {
31  .num_usb2_ports = TCSS_XHCI_USB2_PORT_NUM,
32  .usb3_port_status_reg = TCSS_XHCI_USB3_PORT_STATUS_REG,
33  .num_usb3_ports = TCSS_XHCI_USB3_PORT_NUM,
34 };
35 
37 {
38  if (xhci_dev == PCH_DEVFN_XHCI)
39  return &usb_info;
40  else if (xhci_dev == SA_DEVFN_TCSS_XHCI)
41  return &tcss_usb_info;
42 
43  return NULL;
44 }
u32 pci_devfn_t
Definition: pci_type.h:8
#define SA_DEVFN_TCSS_XHCI
Definition: pci_devs.h:70
#define PCH_DEVFN_XHCI
Definition: pci_devs.h:124
#define TCSS_XHCI_USB3_PORT_STATUS_REG
Definition: xhci.c:18
#define TCSS_XHCI_USB2_PORT_STATUS_REG
Definition: xhci.c:17
#define PCH_XHCI_USB2_PORT_NUM
Definition: xhci.c:14
static const struct xhci_usb_info usb_info
Definition: xhci.c:22
const struct xhci_usb_info * soc_get_xhci_usb_info(pci_devfn_t xhci_dev)
Definition: xhci.c:36
#define PCH_XHCI_USB3_PORT_NUM
Definition: xhci.c:15
static const struct xhci_usb_info tcss_usb_info
Definition: xhci.c:29
#define TCSS_XHCI_USB3_PORT_NUM
Definition: xhci.c:20
#define TCSS_XHCI_USB2_PORT_NUM
Definition: xhci.c:19
#define PCH_XHCI_USB2_PORT_STATUS_REG
Definition: xhci.c:12
#define PCH_XHCI_USB3_PORT_STATUS_REG
Definition: xhci.c:13
#define NULL
Definition: stddef.h:19
uint32_t usb2_port_status_reg
Definition: xhci.h:18