coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
usb.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #include <types.h>
3 
4 #ifndef _QCS405_USB_H_
5 #define _QCS405_USB_H_
6 
7 /* QSCRATCH_GENERAL_CFG register bit offset */
8 #define PIPE_UTMI_CLK_SEL BIT(0)
9 #define PIPE3_PHYSTATUS_SW BIT(3)
10 #define PIPE_UTMI_CLK_DIS BIT(8)
11 
12 /* Global USB3 Control Registers */
13 #define DWC3_GUSB3PIPECTL_DELAYP1TRANS BIT(18)
14 #define DWC3_GUSB3PIPECTL_UX_EXIT_IN_PX BIT(27)
15 #define DWC3_GCTL_PRTCAPDIR(n) ((n) << 12)
16 #define DWC3_GCTL_PRTCAP_OTG 3
17 #define DWC3_GCTL_PRTCAP_HOST 1
18 
19 /* Global USB2 PHY Configuration Register */
20 #define DWC3_GUSB2PHYCFG_USBTRDTIM(n) ((n) << 10)
21 #define DWC3_GUSB2PHYCFG_USB2TRDTIM_MASK DWC3_GUSB2PHYCFG_USBTRDTIM(0xf)
22 #define DWC3_GUSB2PHYCFG_PHYIF(n) ((n) << 3)
23 #define DWC3_GUSB2PHYCFG_PHYIF_MASK DWC3_GUSB2PHYCFG_PHYIF(1)
24 #define USBTRDTIM_UTMI_8_BIT 9
25 #define UTMI_PHYIF_8_BIT 0
26 
27 #define DWC3_GCTL_SCALEDOWN(n) ((n) << 4)
28 #define DWC3_GCTL_SCALEDOWN_MASK DWC3_GCTL_SCALEDOWN(3)
29 #define DWC3_GCTL_DISSCRAMBLE (1 << 3)
30 #define DWC3_GCTL_U2EXIT_LFPS (1 << 2)
31 #define DWC3_GCTL_DSBLCLKGTNG (1 << 0)
32 
33 /* USB2 PHY register values */
34 #define USB2PHY_TCSR_CTRL 0x01
35 #define USB2PHY_REFCLK_CTRL 0x0d
36 #define USB2PHY_UTMI_CTRL5 0x12
37 #define USB2PHY_PARAMETER_OVERRIDE_X0 0x63
38 #define USB2PHY_PARAMETER_OVERRIDE_X1 0x03
39 #define USB2PHY_PARAMETER_OVERRIDE_X2 0x1d
40 #define USB2PHY_PARAMETER_OVERRIDE_X3 0x03
41 #define USB2PHY_HS_PHY_CTRL1 0x23
42 #define QUSB2PHY_HS_PHY_CTRL_COMMON0 0x08
43 #define QUSB2PHY_HS_PHY_CTRL_COMMON1 0xdc
44 #define USB2PHY_HS_PHY_CTRL2 0xe0
45 #define USB2PHY_UTMI_CTRL5_POR_CLEAR 0x10
46 #define USB2PHY_HS_PHY_CTRL2_SUSPEND_N_SEL 0x60
47 
48 struct usb_board_data {
49  /* Register values going to override from the boardfile */
54 };
55 
56 enum usb_port {
59 };
60 
61 void setup_usb_host(enum usb_port port, struct usb_board_data *data);
62 /* Call reset_ before setup_ */
63 void reset_usb(enum usb_port port);
64 
65 #endif /* _QCS405_USB_H_ */
port
Definition: i915.h:29
void setup_usb_host(enum usb_port port, struct usb_board_data *data)
Definition: usb.c:188
void reset_usb(enum usb_port port)
Definition: usb.c:116
usb_port
Definition: usb.h:56
@ HSUSB_SS_PORT_0
Definition: usb.h:57
@ HSUSB_HS_PORT_1
Definition: usb.h:58
uint8_t u8
Definition: stdint.h:45
u8 parameter_override_x2
Definition: snps_usb_phy.h:10
u8 parameter_override_x0
Definition: snps_usb_phy.h:8
u8 parameter_override_x3
Definition: snps_usb_phy.h:11
u8 parameter_override_x1
Definition: snps_usb_phy.h:9